14368ae07SMichael Brandl /* 24368ae07SMichael Brandl * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. 34368ae07SMichael Brandl * 44368ae07SMichael Brandl * SPDX-License-Identifier: BSD-3-Clause 54368ae07SMichael Brandl */ 64368ae07SMichael Brandl 7*c3cf06f1SAntonio Nino Diaz #ifndef HIKEY_DEF_H 8*c3cf06f1SAntonio Nino Diaz #define HIKEY_DEF_H 94368ae07SMichael Brandl 104368ae07SMichael Brandl /* Always assume DDR is 1GB size. */ 114368ae07SMichael Brandl #define DDR_BASE 0x0 124368ae07SMichael Brandl #define DDR_SIZE 0x40000000 134368ae07SMichael Brandl 144368ae07SMichael Brandl #define DEVICE_BASE 0xF4000000 154368ae07SMichael Brandl #define DEVICE_SIZE 0x05800000 164368ae07SMichael Brandl 174368ae07SMichael Brandl /* Memory location options for TSP */ 184368ae07SMichael Brandl #define HIKEY_SRAM_ID 0 194368ae07SMichael Brandl #define HIKEY_DRAM_ID 1 204368ae07SMichael Brandl 214368ae07SMichael Brandl /* 224368ae07SMichael Brandl * DDR for OP-TEE (32MB from 0x3E00000-0x3FFFFFFF) is divided in several 234368ae07SMichael Brandl * regions 244368ae07SMichael Brandl * - Secure DDR (default is the top 16MB) used by OP-TEE 254368ae07SMichael Brandl * - Non-secure DDR used by OP-TEE (shared memory and padding) (4MB) 264368ae07SMichael Brandl * - Secure DDR (4MB aligned on 4MB) for OP-TEE's "Secure Data Path" feature 274368ae07SMichael Brandl * - Non-secure DDR (8MB) reserved for OP-TEE's future use 284368ae07SMichael Brandl */ 294368ae07SMichael Brandl #define DDR_SEC_SIZE 0x01000000 304368ae07SMichael Brandl #define DDR_SEC_BASE (DDR_BASE + DDR_SIZE - DDR_SEC_SIZE) /* 0x3F000000 */ 314368ae07SMichael Brandl 324368ae07SMichael Brandl #define DDR_SDP_SIZE 0x00400000 334368ae07SMichael Brandl #define DDR_SDP_BASE (DDR_SEC_BASE - 0x400000 /* align */ - \ 344368ae07SMichael Brandl DDR_SDP_SIZE) 354368ae07SMichael Brandl 364368ae07SMichael Brandl #define SRAM_BASE 0xFFF80000 374368ae07SMichael Brandl #define SRAM_SIZE 0x00012000 384368ae07SMichael Brandl 394368ae07SMichael Brandl /* 404368ae07SMichael Brandl * PL011 related constants 414368ae07SMichael Brandl */ 424368ae07SMichael Brandl #define PL011_UART0_BASE 0xF8015000 434368ae07SMichael Brandl #define PL011_UART3_BASE 0xF7113000 444368ae07SMichael Brandl #define PL011_BAUDRATE 115200 454368ae07SMichael Brandl #define PL011_UART_CLK_IN_HZ 19200000 464368ae07SMichael Brandl 474368ae07SMichael Brandl #define HIKEY_USB_DESC_BASE (DDR_BASE + 0x00800000) 484368ae07SMichael Brandl #define HIKEY_USB_DESC_SIZE 0x00100000 494368ae07SMichael Brandl #define HIKEY_USB_DATA_BASE (DDR_BASE + 0x10000000) 504368ae07SMichael Brandl #define HIKEY_USB_DATA_SIZE 0x10000000 514368ae07SMichael Brandl #define HIKEY_FB_BUFFER_BASE (HIKEY_USB_DATA_BASE) 524368ae07SMichael Brandl #define HIKEY_FB_BUFFER_SIZE HIKEY_USB_DATA_SIZE 534368ae07SMichael Brandl #define HIKEY_FB_DOWNLOAD_BASE (HIKEY_FB_BUFFER_BASE + \ 544368ae07SMichael Brandl HIKEY_FB_BUFFER_SIZE) 554368ae07SMichael Brandl #define HIKEY_FB_DOWNLOAD_SIZE HIKEY_USB_DATA_SIZE 564368ae07SMichael Brandl 574368ae07SMichael Brandl #define HIKEY_USB_DESC_IN_BASE (DDR_BASE + 0x00800000) 584368ae07SMichael Brandl #define HIKEY_USB_DESC_IN_SIZE 0x00040000 594368ae07SMichael Brandl #define HIKEY_USB_DESC_EP0_OUT_BASE (HIKEY_USB_DESC_IN_BASE + \ 604368ae07SMichael Brandl HIKEY_USB_DESC_IN_SIZE) 614368ae07SMichael Brandl #define HIKEY_USB_DESC_EP0_OUT_SIZE 0x00040000 624368ae07SMichael Brandl #define HIKEY_USB_DESC_EPX_OUT_BASE (HIKEY_USB_DESC_EP0_OUT_BASE + \ 634368ae07SMichael Brandl HIKEY_USB_DESC_EP0_OUT_SIZE) 644368ae07SMichael Brandl #define HIKEY_USB_DESC_EPX_OUT_SIZE 0x00080000 654368ae07SMichael Brandl 664368ae07SMichael Brandl #define HIKEY_MMC_DESC_BASE (DDR_BASE + 0x03000000) 674368ae07SMichael Brandl #define HIKEY_MMC_DESC_SIZE 0x00100000 684368ae07SMichael Brandl 694368ae07SMichael Brandl /* 704368ae07SMichael Brandl * HIKEY_MMC_DATA_BASE & HIKEY_MMC_DATA_SIZE are shared between fastboot 714368ae07SMichael Brandl * and eMMC driver. Since it could avoid to memory copy. 724368ae07SMichael Brandl * So this SRAM region is used twice. First, it's used in BL1 as temporary 734368ae07SMichael Brandl * buffer in eMMC driver. Second, it's used by MCU in BL2. The SRAM region 744368ae07SMichael Brandl * needs to be clear before used in BL2. 754368ae07SMichael Brandl */ 764368ae07SMichael Brandl #define HIKEY_MMC_DATA_BASE (DDR_BASE + 0x10000000) 774368ae07SMichael Brandl #define HIKEY_MMC_DATA_SIZE 0x20000000 784368ae07SMichael Brandl #define HIKEY_NS_IMAGE_OFFSET (DDR_BASE + 0x35000000) 794368ae07SMichael Brandl #define HIKEY_BL1_MMC_DESC_BASE (SRAM_BASE) 804368ae07SMichael Brandl #define HIKEY_BL1_MMC_DESC_SIZE 0x00001000 814368ae07SMichael Brandl #define HIKEY_BL1_MMC_DATA_BASE (HIKEY_BL1_MMC_DESC_BASE + \ 824368ae07SMichael Brandl HIKEY_BL1_MMC_DESC_SIZE) 834368ae07SMichael Brandl #define HIKEY_BL1_MMC_DATA_SIZE 0x0000B000 844368ae07SMichael Brandl 854368ae07SMichael Brandl #define EMMC_BASE 0 864368ae07SMichael Brandl #define HIKEY_FIP_BASE (EMMC_BASE + (4 << 20)) 874368ae07SMichael Brandl #define HIKEY_FIP_MAX_SIZE (8 << 20) 884368ae07SMichael Brandl #define HIKEY_EMMC_RPMB_BASE (EMMC_BASE + 0) 894368ae07SMichael Brandl #define HIKEY_EMMC_RPMB_MAX_SIZE (128 << 10) 904368ae07SMichael Brandl #define HIKEY_EMMC_USERDATA_BASE (EMMC_BASE + 0) 914368ae07SMichael Brandl #define HIKEY_EMMC_USERDATA_MAX_SIZE (4 << 30) 924368ae07SMichael Brandl 934368ae07SMichael Brandl /* 944368ae07SMichael Brandl * GIC400 interrupt handling related constants 954368ae07SMichael Brandl */ 964368ae07SMichael Brandl #define IRQ_SEC_PHY_TIMER 29 974368ae07SMichael Brandl #define IRQ_SEC_SGI_0 8 984368ae07SMichael Brandl #define IRQ_SEC_SGI_1 9 994368ae07SMichael Brandl #define IRQ_SEC_SGI_2 10 1004368ae07SMichael Brandl #define IRQ_SEC_SGI_3 11 1014368ae07SMichael Brandl #define IRQ_SEC_SGI_4 12 1024368ae07SMichael Brandl #define IRQ_SEC_SGI_5 13 1034368ae07SMichael Brandl #define IRQ_SEC_SGI_6 14 1044368ae07SMichael Brandl #define IRQ_SEC_SGI_7 15 1054368ae07SMichael Brandl #define IRQ_SEC_SGI_8 16 1064368ae07SMichael Brandl 107*c3cf06f1SAntonio Nino Diaz #endif /* HIKEY_DEF_H */ 108