1*4368ae07SMichael Brandl /* 2*4368ae07SMichael Brandl * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. 3*4368ae07SMichael Brandl * 4*4368ae07SMichael Brandl * SPDX-License-Identifier: BSD-3-Clause 5*4368ae07SMichael Brandl */ 6*4368ae07SMichael Brandl 7*4368ae07SMichael Brandl #ifndef __HIKEY_DEF_H__ 8*4368ae07SMichael Brandl #define __HIKEY_DEF_H__ 9*4368ae07SMichael Brandl 10*4368ae07SMichael Brandl /* Always assume DDR is 1GB size. */ 11*4368ae07SMichael Brandl #define DDR_BASE 0x0 12*4368ae07SMichael Brandl #define DDR_SIZE 0x40000000 13*4368ae07SMichael Brandl 14*4368ae07SMichael Brandl #define DEVICE_BASE 0xF4000000 15*4368ae07SMichael Brandl #define DEVICE_SIZE 0x05800000 16*4368ae07SMichael Brandl 17*4368ae07SMichael Brandl /* Memory location options for TSP */ 18*4368ae07SMichael Brandl #define HIKEY_SRAM_ID 0 19*4368ae07SMichael Brandl #define HIKEY_DRAM_ID 1 20*4368ae07SMichael Brandl 21*4368ae07SMichael Brandl /* 22*4368ae07SMichael Brandl * DDR for OP-TEE (32MB from 0x3E00000-0x3FFFFFFF) is divided in several 23*4368ae07SMichael Brandl * regions 24*4368ae07SMichael Brandl * - Secure DDR (default is the top 16MB) used by OP-TEE 25*4368ae07SMichael Brandl * - Non-secure DDR used by OP-TEE (shared memory and padding) (4MB) 26*4368ae07SMichael Brandl * - Secure DDR (4MB aligned on 4MB) for OP-TEE's "Secure Data Path" feature 27*4368ae07SMichael Brandl * - Non-secure DDR (8MB) reserved for OP-TEE's future use 28*4368ae07SMichael Brandl */ 29*4368ae07SMichael Brandl #define DDR_SEC_SIZE 0x01000000 30*4368ae07SMichael Brandl #define DDR_SEC_BASE (DDR_BASE + DDR_SIZE - DDR_SEC_SIZE) /* 0x3F000000 */ 31*4368ae07SMichael Brandl 32*4368ae07SMichael Brandl #define DDR_SDP_SIZE 0x00400000 33*4368ae07SMichael Brandl #define DDR_SDP_BASE (DDR_SEC_BASE - 0x400000 /* align */ - \ 34*4368ae07SMichael Brandl DDR_SDP_SIZE) 35*4368ae07SMichael Brandl 36*4368ae07SMichael Brandl #define SRAM_BASE 0xFFF80000 37*4368ae07SMichael Brandl #define SRAM_SIZE 0x00012000 38*4368ae07SMichael Brandl 39*4368ae07SMichael Brandl /* 40*4368ae07SMichael Brandl * PL011 related constants 41*4368ae07SMichael Brandl */ 42*4368ae07SMichael Brandl #define PL011_UART0_BASE 0xF8015000 43*4368ae07SMichael Brandl #define PL011_UART3_BASE 0xF7113000 44*4368ae07SMichael Brandl #define PL011_BAUDRATE 115200 45*4368ae07SMichael Brandl #define PL011_UART_CLK_IN_HZ 19200000 46*4368ae07SMichael Brandl 47*4368ae07SMichael Brandl #define HIKEY_USB_DESC_BASE (DDR_BASE + 0x00800000) 48*4368ae07SMichael Brandl #define HIKEY_USB_DESC_SIZE 0x00100000 49*4368ae07SMichael Brandl #define HIKEY_USB_DATA_BASE (DDR_BASE + 0x10000000) 50*4368ae07SMichael Brandl #define HIKEY_USB_DATA_SIZE 0x10000000 51*4368ae07SMichael Brandl #define HIKEY_FB_BUFFER_BASE (HIKEY_USB_DATA_BASE) 52*4368ae07SMichael Brandl #define HIKEY_FB_BUFFER_SIZE HIKEY_USB_DATA_SIZE 53*4368ae07SMichael Brandl #define HIKEY_FB_DOWNLOAD_BASE (HIKEY_FB_BUFFER_BASE + \ 54*4368ae07SMichael Brandl HIKEY_FB_BUFFER_SIZE) 55*4368ae07SMichael Brandl #define HIKEY_FB_DOWNLOAD_SIZE HIKEY_USB_DATA_SIZE 56*4368ae07SMichael Brandl 57*4368ae07SMichael Brandl #define HIKEY_USB_DESC_IN_BASE (DDR_BASE + 0x00800000) 58*4368ae07SMichael Brandl #define HIKEY_USB_DESC_IN_SIZE 0x00040000 59*4368ae07SMichael Brandl #define HIKEY_USB_DESC_EP0_OUT_BASE (HIKEY_USB_DESC_IN_BASE + \ 60*4368ae07SMichael Brandl HIKEY_USB_DESC_IN_SIZE) 61*4368ae07SMichael Brandl #define HIKEY_USB_DESC_EP0_OUT_SIZE 0x00040000 62*4368ae07SMichael Brandl #define HIKEY_USB_DESC_EPX_OUT_BASE (HIKEY_USB_DESC_EP0_OUT_BASE + \ 63*4368ae07SMichael Brandl HIKEY_USB_DESC_EP0_OUT_SIZE) 64*4368ae07SMichael Brandl #define HIKEY_USB_DESC_EPX_OUT_SIZE 0x00080000 65*4368ae07SMichael Brandl 66*4368ae07SMichael Brandl #define HIKEY_MMC_DESC_BASE (DDR_BASE + 0x03000000) 67*4368ae07SMichael Brandl #define HIKEY_MMC_DESC_SIZE 0x00100000 68*4368ae07SMichael Brandl 69*4368ae07SMichael Brandl /* 70*4368ae07SMichael Brandl * HIKEY_MMC_DATA_BASE & HIKEY_MMC_DATA_SIZE are shared between fastboot 71*4368ae07SMichael Brandl * and eMMC driver. Since it could avoid to memory copy. 72*4368ae07SMichael Brandl * So this SRAM region is used twice. First, it's used in BL1 as temporary 73*4368ae07SMichael Brandl * buffer in eMMC driver. Second, it's used by MCU in BL2. The SRAM region 74*4368ae07SMichael Brandl * needs to be clear before used in BL2. 75*4368ae07SMichael Brandl */ 76*4368ae07SMichael Brandl #define HIKEY_MMC_DATA_BASE (DDR_BASE + 0x10000000) 77*4368ae07SMichael Brandl #define HIKEY_MMC_DATA_SIZE 0x20000000 78*4368ae07SMichael Brandl #define HIKEY_NS_IMAGE_OFFSET (DDR_BASE + 0x35000000) 79*4368ae07SMichael Brandl #define HIKEY_BL1_MMC_DESC_BASE (SRAM_BASE) 80*4368ae07SMichael Brandl #define HIKEY_BL1_MMC_DESC_SIZE 0x00001000 81*4368ae07SMichael Brandl #define HIKEY_BL1_MMC_DATA_BASE (HIKEY_BL1_MMC_DESC_BASE + \ 82*4368ae07SMichael Brandl HIKEY_BL1_MMC_DESC_SIZE) 83*4368ae07SMichael Brandl #define HIKEY_BL1_MMC_DATA_SIZE 0x0000B000 84*4368ae07SMichael Brandl 85*4368ae07SMichael Brandl #define EMMC_BASE 0 86*4368ae07SMichael Brandl #define HIKEY_FIP_BASE (EMMC_BASE + (4 << 20)) 87*4368ae07SMichael Brandl #define HIKEY_FIP_MAX_SIZE (8 << 20) 88*4368ae07SMichael Brandl #define HIKEY_EMMC_RPMB_BASE (EMMC_BASE + 0) 89*4368ae07SMichael Brandl #define HIKEY_EMMC_RPMB_MAX_SIZE (128 << 10) 90*4368ae07SMichael Brandl #define HIKEY_EMMC_USERDATA_BASE (EMMC_BASE + 0) 91*4368ae07SMichael Brandl #define HIKEY_EMMC_USERDATA_MAX_SIZE (4 << 30) 92*4368ae07SMichael Brandl 93*4368ae07SMichael Brandl /* 94*4368ae07SMichael Brandl * GIC400 interrupt handling related constants 95*4368ae07SMichael Brandl */ 96*4368ae07SMichael Brandl #define IRQ_SEC_PHY_TIMER 29 97*4368ae07SMichael Brandl #define IRQ_SEC_SGI_0 8 98*4368ae07SMichael Brandl #define IRQ_SEC_SGI_1 9 99*4368ae07SMichael Brandl #define IRQ_SEC_SGI_2 10 100*4368ae07SMichael Brandl #define IRQ_SEC_SGI_3 11 101*4368ae07SMichael Brandl #define IRQ_SEC_SGI_4 12 102*4368ae07SMichael Brandl #define IRQ_SEC_SGI_5 13 103*4368ae07SMichael Brandl #define IRQ_SEC_SGI_6 14 104*4368ae07SMichael Brandl #define IRQ_SEC_SGI_7 15 105*4368ae07SMichael Brandl #define IRQ_SEC_SGI_8 16 106*4368ae07SMichael Brandl 107*4368ae07SMichael Brandl #endif /* __HIKEY_DEF_H__ */ 108