Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are met: |
| 6 | * |
| 7 | * Redistributions of source code must retain the above copyright notice, this |
| 8 | * list of conditions and the following disclaimer. |
| 9 | * |
| 10 | * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * Neither the name of ARM nor the names of its contributors may be used |
| 15 | * to endorse or promote products derived from this software without specific |
| 16 | * prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 | * POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | |
| 31 | #ifndef __PLAT_DEF_H__ |
| 32 | #define __PLAT_DEF_H__ |
| 33 | |
| 34 | #define RK3399_PRIMARY_CPU 0x0 |
| 35 | |
| 36 | /* Special value used to verify platform parameters from BL2 to BL3-1 */ |
| 37 | #define RK_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL |
| 38 | |
| 39 | #define SIZE_K(n) ((n) * 1024) |
| 40 | #define SIZE_M(n) ((n) * 1024 * 1024) |
| 41 | |
| 42 | #define CCI500_BASE 0xffb00000 |
| 43 | #define CCI500_SIZE SIZE_M(1) |
| 44 | |
| 45 | #define GIC500_BASE 0xfee00000 |
| 46 | #define GIC500_SIZE SIZE_M(2) |
| 47 | |
| 48 | #define STIME_BASE 0xff860000 |
| 49 | #define STIME_SIZE SIZE_K(64) |
| 50 | |
| 51 | #define CRUS_BASE 0xff750000 |
| 52 | #define CRUS_SIZE SIZE_K(128) |
| 53 | |
| 54 | #define SGRF_BASE 0xff330000 |
| 55 | #define SGRF_SIZE SIZE_K(64) |
| 56 | |
| 57 | #define PMU_BASE 0xff310000 |
| 58 | #define PMU_SIZE SIZE_K(64) |
| 59 | |
| 60 | #define PMUSRAM_BASE 0xff3b0000 |
| 61 | #define PMUSRAM_SIZE SIZE_K(64) |
| 62 | #define PMUSRAM_RSIZE SIZE_K(8) |
| 63 | |
Caesar Wang | 59e41b5 | 2016-04-10 14:11:07 +0800 | [diff] [blame] | 64 | #define PMUGRF_BASE 0xff320000 |
| 65 | #define PMUGRF_SIZE SIZE_K(64) |
| 66 | |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 67 | /* |
| 68 | * include i2c pmu/audio, pwm0-3 rkpwm0-3 uart_dbg,mailbox scr |
| 69 | * 0xff650000 -0xff6c0000 |
| 70 | */ |
| 71 | #define PD_BUS0_BASE 0xff650000 |
| 72 | #define PD_BUS0_SIZE 0x70000 |
| 73 | |
| 74 | #define PMUCRU_BASE 0xff750000 |
| 75 | #define CRU_BASE 0xff760000 |
| 76 | |
| 77 | #define COLD_BOOT_BASE 0xffff0000 |
| 78 | |
| 79 | /************************************************************************** |
| 80 | * UART related constants |
| 81 | **************************************************************************/ |
| 82 | #define RK3399_UART2_BASE (0xff1a0000) |
| 83 | #define RK3399_UART2_SIZE SIZE_K(64) |
| 84 | |
Caesar Wang | 5a7131e | 2016-04-19 20:42:17 +0800 | [diff] [blame] | 85 | #define RK3399_BAUDRATE (115200) |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 86 | #define RK3399_UART_CLOCK (24000000) |
| 87 | |
| 88 | /****************************************************************************** |
| 89 | * System counter frequency related constants |
| 90 | ******************************************************************************/ |
| 91 | #define SYS_COUNTER_FREQ_IN_TICKS 24000000 |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 92 | |
| 93 | /* Base rockchip_platform compatible GIC memory map */ |
| 94 | #define BASE_GICD_BASE (GIC500_BASE) |
| 95 | #define BASE_GICR_BASE (GIC500_BASE + SIZE_M(1)) |
| 96 | |
| 97 | /***************************************************************************** |
| 98 | * CCI-400 related constants |
| 99 | ******************************************************************************/ |
| 100 | #define PLAT_RK_CCI_CLUSTER0_SL_IFACE_IX 0 |
| 101 | #define PLAT_RK_CCI_CLUSTER1_SL_IFACE_IX 1 |
| 102 | |
| 103 | /****************************************************************************** |
| 104 | * cpu up status |
| 105 | ******************************************************************************/ |
| 106 | #define PMU_CPU_HOTPLUG 0xdeadbeaf |
| 107 | #define PMU_CPU_AUTO_PWRDN 0xabcdef12 |
| 108 | |
| 109 | /****************************************************************************** |
| 110 | * sgi, ppi |
| 111 | ******************************************************************************/ |
| 112 | #define ARM_IRQ_SEC_PHY_TIMER 29 |
| 113 | |
| 114 | #define ARM_IRQ_SEC_SGI_0 8 |
| 115 | #define ARM_IRQ_SEC_SGI_1 9 |
| 116 | #define ARM_IRQ_SEC_SGI_2 10 |
| 117 | #define ARM_IRQ_SEC_SGI_3 11 |
| 118 | #define ARM_IRQ_SEC_SGI_4 12 |
| 119 | #define ARM_IRQ_SEC_SGI_5 13 |
| 120 | #define ARM_IRQ_SEC_SGI_6 14 |
| 121 | #define ARM_IRQ_SEC_SGI_7 15 |
| 122 | /* |
| 123 | * Define a list of Group 1 Secure and Group 0 interrupts as per GICv3 |
| 124 | * terminology. On a GICv2 system or mode, the lists will be merged and treated |
| 125 | * as Group 0 interrupts. |
| 126 | */ |
| 127 | #define RK3399_G1S_IRQS ARM_IRQ_SEC_PHY_TIMER |
| 128 | #define RK3399_G0_IRQS ARM_IRQ_SEC_SGI_6 |
| 129 | |
| 130 | #endif /* __PLAT_DEF_H__ */ |