Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 1 | /* |
Haojian Zhuang | 3bd9438 | 2018-01-28 23:33:02 +0800 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef __PLATFORM_DEF_H__ |
| 8 | #define __PLATFORM_DEF_H__ |
| 9 | |
| 10 | #include <arch.h> |
Michael Brandl | afdff3c | 2018-02-22 16:30:30 +0100 | [diff] [blame] | 11 | #include <common_def.h> |
| 12 | #include <hikey_def.h> |
| 13 | #include <hikey_layout.h> /* BL memory region sizes, etc */ |
| 14 | #include <tbbr_img_def.h> |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 15 | |
Victor Chong | 2d9a42d | 2017-08-17 15:21:10 +0900 | [diff] [blame] | 16 | /* Special value used to verify platform parameters from BL2 to BL3-1 */ |
| 17 | #define HIKEY_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL |
| 18 | |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 19 | /* |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 20 | * Generic platform constants |
| 21 | */ |
| 22 | |
| 23 | /* Size of cacheable stacks */ |
| 24 | #define PLATFORM_STACK_SIZE 0x800 |
| 25 | |
| 26 | #define FIRMWARE_WELCOME_STR "Booting Trusted Firmware\n" |
| 27 | |
| 28 | #define PLATFORM_CACHE_LINE_SIZE 64 |
| 29 | #define PLATFORM_CLUSTER_COUNT 2 |
| 30 | #define PLATFORM_CORE_COUNT_PER_CLUSTER 4 |
| 31 | #define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER_COUNT * \ |
| 32 | PLATFORM_CORE_COUNT_PER_CLUSTER) |
Michael Brandl | afdff3c | 2018-02-22 16:30:30 +0100 | [diff] [blame] | 33 | #define PLAT_MAX_PWR_LVL (MPIDR_AFFLVL2) |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 34 | #define PLAT_NUM_PWR_DOMAINS (PLATFORM_CORE_COUNT + \ |
| 35 | PLATFORM_CLUSTER_COUNT + 1) |
| 36 | |
| 37 | #define PLAT_MAX_RET_STATE 1 |
| 38 | #define PLAT_MAX_OFF_STATE 2 |
| 39 | |
| 40 | #define MAX_IO_DEVICES 3 |
| 41 | #define MAX_IO_HANDLES 4 |
| 42 | /* eMMC RPMB and eMMC User Data */ |
| 43 | #define MAX_IO_BLOCK_DEVICES 2 |
| 44 | |
| 45 | /* GIC related constants (no GICR in GIC-400) */ |
| 46 | #define PLAT_ARM_GICD_BASE 0xF6801000 |
| 47 | #define PLAT_ARM_GICC_BASE 0xF6802000 |
| 48 | #define PLAT_ARM_GICH_BASE 0xF6804000 |
| 49 | #define PLAT_ARM_GICV_BASE 0xF6806000 |
| 50 | |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 51 | /* |
| 52 | * Platform specific page table and MMU setup constants |
| 53 | */ |
David Cunado | c150312 | 2018-02-16 21:12:58 +0000 | [diff] [blame] | 54 | #define ADDR_SPACE_SIZE (1ULL << 32) |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 55 | |
Roberto Vargas | 8247796 | 2017-10-23 08:22:17 +0100 | [diff] [blame] | 56 | #if defined(IMAGE_BL1) || defined(IMAGE_BL32) |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 57 | #define MAX_XLAT_TABLES 3 |
| 58 | #endif |
| 59 | |
Roberto Vargas | 8247796 | 2017-10-23 08:22:17 +0100 | [diff] [blame] | 60 | #ifdef IMAGE_BL31 |
Victor Chong | b9a8db2 | 2017-05-28 00:14:25 +0900 | [diff] [blame] | 61 | #define MAX_XLAT_TABLES 4 |
Victor Chong | 7d787f5 | 2017-08-16 13:53:56 +0900 | [diff] [blame] | 62 | #endif |
| 63 | |
Roberto Vargas | 8247796 | 2017-10-23 08:22:17 +0100 | [diff] [blame] | 64 | #ifdef IMAGE_BL2 |
Victor Chong | 7d787f5 | 2017-08-16 13:53:56 +0900 | [diff] [blame] | 65 | #define MAX_XLAT_TABLES 4 |
Victor Chong | b9a8db2 | 2017-05-28 00:14:25 +0900 | [diff] [blame] | 66 | #endif |
| 67 | |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 68 | #define MAX_MMAP_REGIONS 16 |
| 69 | |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 70 | /* |
| 71 | * Declarations and constants to access the mailboxes safely. Each mailbox is |
| 72 | * aligned on the biggest cache line size in the platform. This is known only |
| 73 | * to the platform as it might have a combination of integrated and external |
| 74 | * caches. Such alignment ensures that two maiboxes do not sit on the same cache |
| 75 | * line at any cache level. They could belong to different cpus/clusters & |
| 76 | * get written while being protected by different locks causing corruption of |
| 77 | * a valid mailbox address. |
| 78 | */ |
| 79 | #define CACHE_WRITEBACK_SHIFT 6 |
| 80 | #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT) |
| 81 | |
| 82 | #endif /* __PLATFORM_DEF_H__ */ |