blob: 0f024076dcabb6029d689b5e760fac46828e5f0d [file] [log] [blame]
Nariman Poushin0ece80f2018-02-26 06:52:04 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __PLATFORM_DEF_H__
8#define __PLATFORM_DEF_H__
9
10#include <arm_def.h>
11#include <board_arm_def.h>
12#include <board_css_def.h>
13#include <common_def.h>
14#include <css_def.h>
15#include <soc_css_def.h>
16
Vishwanatha HG64f0b6f2018-05-08 17:15:37 +053017#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
Nariman Poushin0ece80f2018-02-26 06:52:04 +000018
19/* CPU topology */
20#define PLAT_ARM_CLUSTER_COUNT 2
Vishwanatha HG64f0b6f2018-05-08 17:15:37 +053021#define CSS_SGI_MAX_PE_PER_CPU 1
Nariman Poushin0ece80f2018-02-26 06:52:04 +000022#define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \
Vishwanatha HG64f0b6f2018-05-08 17:15:37 +053023 CSS_SGI_MAX_CPUS_PER_CLUSTER * \
24 CSS_SGI_MAX_PE_PER_CPU)
Nariman Poushin0ece80f2018-02-26 06:52:04 +000025
26#if ARM_BOARD_OPTIMISE_MEM
27
28#if defined(IMAGE_BL31) || defined(IMAGE_BL32)
29# define PLAT_ARM_MMAP_ENTRIES 6
30# define MAX_XLAT_TABLES 4
31#else
32# define PLAT_ARM_MMAP_ENTRIES 10
33# define MAX_XLAT_TABLES 5
34#endif
35
36#if TRUSTED_BOARD_BOOT
37# define PLAT_ARM_MAX_BL1_RW_SIZE 0xA000
38#else
39# define PLAT_ARM_MAX_BL1_RW_SIZE 0x6000
40#endif
41
42#if TRUSTED_BOARD_BOOT
43# define PLAT_ARM_MAX_BL2_SIZE 0x1D000
44#else
45# define PLAT_ARM_MAX_BL2_SIZE 0xC000
46#endif
47
48#endif /* ARM_BOARD_OPTIMISE_MEM */
49
50#define PLAT_ARM_NSTIMER_FRAME_ID 0
51
52#define PLAT_CSS_MHU_BASE 0x45000000
53
54#define PLAT_ARM_TRUSTED_ROM_BASE 0x0
55#define PLAT_ARM_TRUSTED_ROM_SIZE 0x00080000 /* 512KB */
56
Chris Kay42fbdfc2018-05-10 14:27:45 +010057#define PLAT_ARM_NSRAM_BASE 0x06000000
58#define PLAT_ARM_NSRAM_SIZE 0x00080000 /* 512KB */
59
Nariman Poushin0ece80f2018-02-26 06:52:04 +000060#define PLAT_MAX_PWR_LVL 1
61
62#define PLAT_ARM_G1S_IRQS ARM_G1S_IRQS, \
63 CSS_IRQ_MHU
64
65#define PLAT_ARM_G0_IRQS ARM_G0_IRQS
66
67#define PLAT_ARM_G1S_IRQ_PROPS(grp) CSS_G1S_IRQ_PROPS(grp)
68#define PLAT_ARM_G0_IRQ_PROPS(grp) ARM_G0_IRQ_PROPS(grp)
69
70#define CSS_SGI_DEVICE_BASE (0x20000000)
71#define CSS_SGI_DEVICE_SIZE (0x20000000)
72#define CSS_SGI_MAP_DEVICE MAP_REGION_FLAT( \
73 CSS_SGI_DEVICE_BASE, \
74 CSS_SGI_DEVICE_SIZE, \
75 MT_DEVICE | MT_RW | MT_SECURE)
76
77#define PLAT_CSS_SCP_COM_SHARED_MEM_BASE 0x45400000
78#define SGI_BOOT_CFG_ADDR 0x45410000
79#define PLAT_CSS_PRIMARY_CPU_SHIFT 8
80#define PLAT_CSS_PRIMARY_CPU_BIT_WIDTH 6
81
82/* GIC related constants */
83#define PLAT_ARM_GICD_BASE 0x30000000
84#define PLAT_ARM_GICC_BASE 0x2C000000
85#define PLAT_ARM_GICR_BASE 0x300C0000
86
87/* Platform ID address */
88#define SSC_VERSION (SSC_REG_BASE + SSC_VERSION_OFFSET)
89#ifndef __ASSEMBLY__
90/* SSC_VERSION related accessors */
91/* Returns the part number of the platform */
92#define GET_SGI_PART_NUM \
93 GET_SSC_VERSION_PART_NUM(mmio_read_32(SSC_VERSION))
94/* Returns the configuration number of the platform */
95#define GET_SGI_CONFIG_NUM \
96 GET_SSC_VERSION_CONFIG(mmio_read_32(SSC_VERSION))
97#endif /* __ASSEMBLY__ */
98
99#endif /* __PLATFORM_DEF_H__ */