Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 1 | /* |
Venkatesh Yadav Abbarapu | 9c3b77b | 2022-04-13 09:04:53 +0530 | [diff] [blame] | 2 | * Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved. |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef VERSAL_DEF_H |
| 8 | #define VERSAL_DEF_H |
| 9 | |
Manish V Badarkhe | 5586151 | 2020-03-27 13:25:51 +0000 | [diff] [blame] | 10 | #include <plat/arm/common/smccc_def.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | #include <plat/common/common_def.h> |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 12 | |
| 13 | /* List all consoles */ |
| 14 | #define VERSAL_CONSOLE_ID_pl011 1 |
| 15 | #define VERSAL_CONSOLE_ID_pl011_0 1 |
| 16 | #define VERSAL_CONSOLE_ID_pl011_1 2 |
| 17 | #define VERSAL_CONSOLE_ID_dcc 3 |
| 18 | |
| 19 | #define VERSAL_CONSOLE_IS(con) (VERSAL_CONSOLE_ID_ ## con == VERSAL_CONSOLE) |
| 20 | |
| 21 | /* List all supported platforms */ |
| 22 | #define VERSAL_PLATFORM_ID_versal_virt 1 |
Venkatesh Yadav Abbarapu | 9c3b77b | 2022-04-13 09:04:53 +0530 | [diff] [blame] | 23 | #define VERSAL_PLATFORM_ID_spp_itr6 2 |
| 24 | #define VERSAL_PLATFORM_ID_emu_itr6 3 |
Siva Durga Prasad Paladugu | 2f4cc71 | 2019-05-03 16:35:25 +0530 | [diff] [blame] | 25 | #define VERSAL_PLATFORM_ID_silicon 4 |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 26 | |
| 27 | #define VERSAL_PLATFORM_IS(con) (VERSAL_PLATFORM_ID_ ## con == VERSAL_PLATFORM) |
| 28 | |
| 29 | /* Firmware Image Package */ |
| 30 | #define VERSAL_PRIMARY_CPU 0 |
| 31 | |
| 32 | /******************************************************************************* |
| 33 | * memory map related constants |
| 34 | ******************************************************************************/ |
| 35 | #define DEVICE0_BASE 0xFF000000 |
| 36 | #define DEVICE0_SIZE 0x00E00000 |
| 37 | #define DEVICE1_BASE 0xF9000000 |
| 38 | #define DEVICE1_SIZE 0x00800000 |
| 39 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 40 | /******************************************************************************* |
| 41 | * IRQ constants |
| 42 | ******************************************************************************/ |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 43 | #define VERSAL_IRQ_SEC_PHY_TIMER U(29) |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 44 | |
| 45 | /******************************************************************************* |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 46 | * CCI-400 related constants |
| 47 | ******************************************************************************/ |
| 48 | #define PLAT_ARM_CCI_BASE 0xFD000000 |
| 49 | #define PLAT_ARM_CCI_CLUSTER0_SL_IFACE_IX 4 |
| 50 | #define PLAT_ARM_CCI_CLUSTER1_SL_IFACE_IX 5 |
| 51 | |
| 52 | /******************************************************************************* |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 53 | * UART related constants |
| 54 | ******************************************************************************/ |
| 55 | #define VERSAL_UART0_BASE 0xFF000000 |
| 56 | #define VERSAL_UART1_BASE 0xFF010000 |
| 57 | |
Venkatesh Yadav Abbarapu | 17a12ce | 2020-11-27 08:42:14 -0700 | [diff] [blame] | 58 | #if VERSAL_CONSOLE_IS(pl011) || VERSAL_CONSOLE_IS(dcc) |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 59 | # define VERSAL_UART_BASE VERSAL_UART0_BASE |
| 60 | #elif VERSAL_CONSOLE_IS(pl011_1) |
| 61 | # define VERSAL_UART_BASE VERSAL_UART1_BASE |
| 62 | #else |
| 63 | # error "invalid VERSAL_CONSOLE" |
| 64 | #endif |
| 65 | |
| 66 | #define PLAT_VERSAL_CRASH_UART_BASE VERSAL_UART_BASE |
| 67 | #define PLAT_VERSAL_CRASH_UART_CLK_IN_HZ VERSAL_UART_CLOCK |
| 68 | #define VERSAL_CONSOLE_BAUDRATE VERSAL_UART_BAUDRATE |
| 69 | |
| 70 | /******************************************************************************* |
| 71 | * Platform related constants |
| 72 | ******************************************************************************/ |
| 73 | #if VERSAL_PLATFORM_IS(versal_virt) |
| 74 | # define PLATFORM_NAME "Versal Virt" |
| 75 | # define VERSAL_UART_CLOCK 25000000 |
| 76 | # define VERSAL_UART_BAUDRATE 115200 |
Siva Durga Prasad Paladugu | 10161e5 | 2019-04-27 11:23:20 +0530 | [diff] [blame] | 77 | # define VERSAL_CPU_CLOCK 2720000 |
Siva Durga Prasad Paladugu | 2f4cc71 | 2019-05-03 16:35:25 +0530 | [diff] [blame] | 78 | #elif VERSAL_PLATFORM_IS(silicon) |
| 79 | # define PLATFORM_NAME "Versal Silicon" |
| 80 | # define VERSAL_UART_CLOCK 100000000 |
| 81 | # define VERSAL_UART_BAUDRATE 115200 |
| 82 | # define VERSAL_CPU_CLOCK 100000000 |
Venkatesh Yadav Abbarapu | 9c3b77b | 2022-04-13 09:04:53 +0530 | [diff] [blame] | 83 | #elif VERSAL_PLATFORM_IS(spp_itr6) |
Venkatesh Yadav Abbarapu | d90e47b | 2022-07-28 08:50:30 +0530 | [diff] [blame] | 84 | # define PLATFORM_NAME "SPP ITR6" |
| 85 | # define VERSAL_UART_CLOCK 25000000 |
| 86 | # define VERSAL_UART_BAUDRATE 115200 |
| 87 | # define VERSAL_CPU_CLOCK 2720000 |
Venkatesh Yadav Abbarapu | 9c3b77b | 2022-04-13 09:04:53 +0530 | [diff] [blame] | 88 | #elif VERSAL_PLATFORM_IS(emu_itr6) |
Venkatesh Yadav Abbarapu | d90e47b | 2022-07-28 08:50:30 +0530 | [diff] [blame] | 89 | # define PLATFORM_NAME "EMU ITR6" |
| 90 | # define VERSAL_UART_CLOCK 212000 |
| 91 | # define VERSAL_UART_BAUDRATE 9600 |
| 92 | # define VERSAL_CPU_CLOCK 212000 |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 93 | #endif |
| 94 | |
| 95 | /* Access control register defines */ |
| 96 | #define ACTLR_EL3_L2ACTLR_BIT (1 << 6) |
| 97 | #define ACTLR_EL3_CPUACTLR_BIT (1 << 0) |
| 98 | |
| 99 | /* For cpu reset APU space here too 0xFE5F1000 CRF_APB*/ |
| 100 | #define CRF_BASE 0xFD1A0000 |
| 101 | #define CRF_SIZE 0x00600000 |
| 102 | |
| 103 | /* CRF registers and bitfields */ |
| 104 | #define CRF_RST_APU (CRF_BASE + 0X00000300) |
| 105 | |
| 106 | #define CRF_RST_APU_ACPU_RESET (1 << 0) |
| 107 | #define CRF_RST_APU_ACPU_PWRON_RESET (1 << 10) |
| 108 | |
Tejas Patel | 54d1319 | 2019-02-27 18:44:55 +0530 | [diff] [blame] | 109 | #define FPD_MAINCCI_BASE 0xFD000000 |
| 110 | #define FPD_MAINCCI_SIZE 0x00100000 |
| 111 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 112 | /* APU registers and bitfields */ |
Abhyuday Godhasara | edc38ae | 2021-08-04 23:58:46 -0700 | [diff] [blame] | 113 | #define FPD_APU_BASE 0xFD5C0000U |
| 114 | #define FPD_APU_CONFIG_0 (FPD_APU_BASE + 0x20U) |
| 115 | #define FPD_APU_RVBAR_L_0 (FPD_APU_BASE + 0x40U) |
| 116 | #define FPD_APU_RVBAR_H_0 (FPD_APU_BASE + 0x44U) |
| 117 | #define FPD_APU_PWRCTL (FPD_APU_BASE + 0x90U) |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 118 | |
Abhyuday Godhasara | edc38ae | 2021-08-04 23:58:46 -0700 | [diff] [blame] | 119 | #define FPD_APU_CONFIG_0_VINITHI_SHIFT 8U |
| 120 | #define APU_0_PWRCTL_CPUPWRDWNREQ_MASK 1U |
| 121 | #define APU_1_PWRCTL_CPUPWRDWNREQ_MASK 2U |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 122 | |
Venkatesh Yadav Abbarapu | 9156ffd | 2020-01-22 21:23:20 -0700 | [diff] [blame] | 123 | /* PMC registers and bitfields */ |
Abhyuday Godhasara | edc38ae | 2021-08-04 23:58:46 -0700 | [diff] [blame] | 124 | #define PMC_GLOBAL_BASE 0xF1110000U |
| 125 | #define PMC_GLOBAL_GLOB_GEN_STORAGE4 (PMC_GLOBAL_BASE + 0x40U) |
Venkatesh Yadav Abbarapu | 9156ffd | 2020-01-22 21:23:20 -0700 | [diff] [blame] | 126 | |
Tejas Patel | 354fe57 | 2018-12-14 00:55:37 -0800 | [diff] [blame] | 127 | /* IPI registers and bitfields */ |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 128 | #define IPI0_REG_BASE U(0xFF330000) |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 129 | #define IPI0_TRIG_BIT (1U << 2U) |
| 130 | #define PMC_IPI_TRIG_BIT (1U << 1U) |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 131 | #define IPI1_REG_BASE U(0xFF340000) |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 132 | #define IPI1_TRIG_BIT (1U << 3U) |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 133 | #define IPI2_REG_BASE U(0xFF350000) |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 134 | #define IPI2_TRIG_BIT (1U << 4U) |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 135 | #define IPI3_REG_BASE U(0xFF360000) |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 136 | #define IPI3_TRIG_BIT (1U << 5U) |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 137 | #define IPI4_REG_BASE U(0xFF370000) |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 138 | #define IPI4_TRIG_BIT (1U << 5U) |
Abhyuday Godhasara | 589afa5 | 2021-08-11 06:15:13 -0700 | [diff] [blame] | 139 | #define IPI5_REG_BASE U(0xFF380000) |
Abhyuday Godhasara | 096f5cc | 2021-08-13 06:45:32 -0700 | [diff] [blame] | 140 | #define IPI5_TRIG_BIT (1U << 6U) |
Tejas Patel | 354fe57 | 2018-12-14 00:55:37 -0800 | [diff] [blame] | 141 | |
Siva Durga Prasad Paladugu | fe4af66 | 2018-09-25 18:44:58 +0530 | [diff] [blame] | 142 | #endif /* VERSAL_DEF_H */ |