blob: 7b31917c95d82cf6149ca6ab433572b3c95c673f [file] [log] [blame]
Stephan Gerhold14fdf072021-12-01 20:01:11 +01001/*
Stephan Gerhold4f29e6c2023-03-25 13:28:46 +01002 * Copyright (c) 2021-2023, Stephan Gerhold <stephan@gerhold.net>
Stephan Gerhold14fdf072021-12-01 20:01:11 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#ifndef PLATFORM_DEF_H
7#define PLATFORM_DEF_H
8
9#include <plat/common/common_def.h>
10
Stephan Gerholdb68e4e92022-08-28 15:18:55 +020011#ifdef __aarch64__
Stephan Gerhold14fdf072021-12-01 20:01:11 +010012/*
13 * There is at least 1 MiB available for BL31. However, at the moment the
14 * "msm8916_entry_point" variable in the data section is read through the
15 * 64 KiB region of the "boot remapper" after reset. For simplicity, limit
16 * the end of the data section (BL31_PROGBITS_LIMIT) to 64 KiB for now and
17 * the overall limit to 128 KiB. This could be increased if needed by placing
18 * the "msm8916_entry_point" variable explicitly in the first 64 KiB of BL31.
19 */
Stephan Gerhold20e84c82023-03-26 13:07:25 +020020#define BL31_LIMIT (BL31_BASE + SZ_128K)
21#define BL31_PROGBITS_LIMIT (BL31_BASE + SZ_64K)
Stephan Gerholdb68e4e92022-08-28 15:18:55 +020022#endif
Stephan Gerholdd0fed052023-03-24 19:18:51 +010023#define BL32_LIMIT (BL32_BASE + SZ_128K)
Stephan Gerhold14fdf072021-12-01 20:01:11 +010024
25#define CACHE_WRITEBACK_GRANULE U(64)
Stephan Gerhold20e84c82023-03-26 13:07:25 +020026#define PLATFORM_STACK_SIZE SZ_4K
Stephan Gerhold14fdf072021-12-01 20:01:11 +010027
28/* CPU topology: single cluster with 4 cores */
29#define PLATFORM_CLUSTER_COUNT U(1)
Stephan Gerholdf0ed7282022-09-16 10:45:19 +020030#define PLATFORM_CPU_PER_CLUSTER_SHIFT U(2) /* 4 */
31#define PLATFORM_CPUS_PER_CLUSTER (1 << PLATFORM_CPU_PER_CLUSTER_SHIFT)
Stephan Gerhold14fdf072021-12-01 20:01:11 +010032#define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER_COUNT * \
Stephan Gerholdf0ed7282022-09-16 10:45:19 +020033 PLATFORM_CPUS_PER_CLUSTER)
Stephan Gerhold14fdf072021-12-01 20:01:11 +010034
35/* Power management */
36#define PLATFORM_SYSTEM_COUNT U(1)
37#define PLAT_NUM_PWR_DOMAINS (PLATFORM_SYSTEM_COUNT + \
38 PLATFORM_CLUSTER_COUNT + \
39 PLATFORM_CORE_COUNT)
40#define PLAT_MAX_PWR_LVL MPIDR_AFFLVL2
41#define PLAT_MAX_RET_STATE U(2)
42#define PLAT_MAX_OFF_STATE U(3)
43
44/* Translation tables */
45#define MAX_MMAP_REGIONS 8
46#define MAX_XLAT_TABLES 4
47
48#define PLAT_PHY_ADDR_SPACE_SIZE (ULL(1) << 32)
49#define PLAT_VIRT_ADDR_SPACE_SIZE (ULL(1) << 32)
50
Stephan Gerhold4f29e6c2023-03-25 13:28:46 +010051/* Timer */
Stephan Gerhold14fdf072021-12-01 20:01:11 +010052#define PLAT_SYSCNT_FREQ 19200000
Stephan Gerhold4f29e6c2023-03-25 13:28:46 +010053#define IRQ_SEC_PHY_TIMER (16 + 2) /* PPI #2 */
Stephan Gerhold14fdf072021-12-01 20:01:11 +010054
Stephan Gerhold253fef02021-12-01 20:03:33 +010055/*
56 * The Qualcomm QGIC2 implementation seems to have PIDR0-4 and PIDR4-7
57 * erroneously swapped for some reason. PIDR2 is actually at 0xFD8.
58 * Override the address in <drivers/arm/gicv2.h> to avoid a failing assert().
59 */
60#define GICD_PIDR2_GICV2 U(0xFD8)
61
Stephan Gerhold4f29e6c2023-03-25 13:28:46 +010062/* TSP */
63#define TSP_IRQ_SEC_PHY_TIMER IRQ_SEC_PHY_TIMER
64#define TSP_SEC_MEM_BASE BL32_BASE
65#define TSP_SEC_MEM_SIZE (BL32_LIMIT - BL32_BASE)
66
Stephan Gerhold14fdf072021-12-01 20:01:11 +010067#endif /* PLATFORM_DEF_H */