xref: /rk3399_ARM-atf/plat/hisilicon/hikey/include/hikey_def.h (revision 69ef7b7ffe66b64bdffee0a387774e7088022503)
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 
7c3cf06f1SAntonio Nino Diaz #ifndef HIKEY_DEF_H
8c3cf06f1SAntonio 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
43*84086055SMichalis Pappas #define PL011_UART2_BASE		0xF7112000
444368ae07SMichael Brandl #define PL011_UART3_BASE		0xF7113000
454368ae07SMichael Brandl #define PL011_BAUDRATE			115200
464368ae07SMichael Brandl #define PL011_UART_CLK_IN_HZ		19200000
474368ae07SMichael Brandl 
484368ae07SMichael Brandl #define HIKEY_USB_DESC_BASE		(DDR_BASE + 0x00800000)
494368ae07SMichael Brandl #define HIKEY_USB_DESC_SIZE		0x00100000
504368ae07SMichael Brandl #define HIKEY_USB_DATA_BASE		(DDR_BASE + 0x10000000)
514368ae07SMichael Brandl #define HIKEY_USB_DATA_SIZE		0x10000000
524368ae07SMichael Brandl #define HIKEY_FB_BUFFER_BASE		(HIKEY_USB_DATA_BASE)
534368ae07SMichael Brandl #define HIKEY_FB_BUFFER_SIZE		HIKEY_USB_DATA_SIZE
544368ae07SMichael Brandl #define HIKEY_FB_DOWNLOAD_BASE		(HIKEY_FB_BUFFER_BASE +		\
554368ae07SMichael Brandl 					 HIKEY_FB_BUFFER_SIZE)
564368ae07SMichael Brandl #define HIKEY_FB_DOWNLOAD_SIZE		HIKEY_USB_DATA_SIZE
574368ae07SMichael Brandl 
584368ae07SMichael Brandl #define HIKEY_USB_DESC_IN_BASE		(DDR_BASE + 0x00800000)
594368ae07SMichael Brandl #define HIKEY_USB_DESC_IN_SIZE		0x00040000
604368ae07SMichael Brandl #define HIKEY_USB_DESC_EP0_OUT_BASE	(HIKEY_USB_DESC_IN_BASE +	\
614368ae07SMichael Brandl 					 HIKEY_USB_DESC_IN_SIZE)
624368ae07SMichael Brandl #define HIKEY_USB_DESC_EP0_OUT_SIZE	0x00040000
634368ae07SMichael Brandl #define HIKEY_USB_DESC_EPX_OUT_BASE	(HIKEY_USB_DESC_EP0_OUT_BASE +	\
644368ae07SMichael Brandl 					 HIKEY_USB_DESC_EP0_OUT_SIZE)
654368ae07SMichael Brandl #define HIKEY_USB_DESC_EPX_OUT_SIZE	0x00080000
664368ae07SMichael Brandl 
674368ae07SMichael Brandl #define HIKEY_MMC_DESC_BASE		(DDR_BASE + 0x03000000)
684368ae07SMichael Brandl #define HIKEY_MMC_DESC_SIZE		0x00100000
694368ae07SMichael Brandl 
704368ae07SMichael Brandl /*
714368ae07SMichael Brandl  * HIKEY_MMC_DATA_BASE & HIKEY_MMC_DATA_SIZE are shared between fastboot
724368ae07SMichael Brandl  * and eMMC driver. Since it could avoid to memory copy.
734368ae07SMichael Brandl  * So this SRAM region is used twice. First, it's used in BL1 as temporary
744368ae07SMichael Brandl  * buffer in eMMC driver. Second, it's used by MCU in BL2. The SRAM region
754368ae07SMichael Brandl  * needs to be clear before used in BL2.
764368ae07SMichael Brandl  */
774368ae07SMichael Brandl #define HIKEY_MMC_DATA_BASE		(DDR_BASE + 0x10000000)
784368ae07SMichael Brandl #define HIKEY_MMC_DATA_SIZE		0x20000000
794368ae07SMichael Brandl #define HIKEY_NS_IMAGE_OFFSET		(DDR_BASE + 0x35000000)
804368ae07SMichael Brandl #define HIKEY_BL1_MMC_DESC_BASE		(SRAM_BASE)
814368ae07SMichael Brandl #define HIKEY_BL1_MMC_DESC_SIZE		0x00001000
824368ae07SMichael Brandl #define HIKEY_BL1_MMC_DATA_BASE		(HIKEY_BL1_MMC_DESC_BASE +	\
834368ae07SMichael Brandl 					 HIKEY_BL1_MMC_DESC_SIZE)
844368ae07SMichael Brandl #define HIKEY_BL1_MMC_DATA_SIZE		0x0000B000
854368ae07SMichael Brandl 
864368ae07SMichael Brandl #define EMMC_BASE			0
874368ae07SMichael Brandl #define HIKEY_EMMC_RPMB_BASE		(EMMC_BASE + 0)
884368ae07SMichael Brandl #define HIKEY_EMMC_RPMB_MAX_SIZE	(128 << 10)
894368ae07SMichael Brandl #define HIKEY_EMMC_USERDATA_BASE	(EMMC_BASE + 0)
904368ae07SMichael Brandl #define HIKEY_EMMC_USERDATA_MAX_SIZE	(4 << 30)
914368ae07SMichael Brandl 
924368ae07SMichael Brandl /*
934368ae07SMichael Brandl  * GIC400 interrupt handling related constants
944368ae07SMichael Brandl  */
954368ae07SMichael Brandl #define IRQ_SEC_PHY_TIMER			29
964368ae07SMichael Brandl #define IRQ_SEC_SGI_0				8
974368ae07SMichael Brandl #define IRQ_SEC_SGI_1				9
984368ae07SMichael Brandl #define IRQ_SEC_SGI_2				10
994368ae07SMichael Brandl #define IRQ_SEC_SGI_3				11
1004368ae07SMichael Brandl #define IRQ_SEC_SGI_4				12
1014368ae07SMichael Brandl #define IRQ_SEC_SGI_5				13
1024368ae07SMichael Brandl #define IRQ_SEC_SGI_6				14
1034368ae07SMichael Brandl #define IRQ_SEC_SGI_7				15
1044368ae07SMichael Brandl #define IRQ_SEC_SGI_8				16
1054368ae07SMichael Brandl 
106c3cf06f1SAntonio Nino Diaz #endif /* HIKEY_DEF_H */
107