xref: /openbmc/u-boot/include/configs/iot_devkit.h (revision 748ad078)
1*5396e8b1SAlexey Brodkin /* SPDX-License-Identifier: GPL-2.0+ */
2*5396e8b1SAlexey Brodkin /*
3*5396e8b1SAlexey Brodkin  * Copyright (C) 2018 Synopsys, Inc. All rights reserved.
4*5396e8b1SAlexey Brodkin  */
5*5396e8b1SAlexey Brodkin 
6*5396e8b1SAlexey Brodkin #ifndef _CONFIG_IOT_DEVKIT_H_
7*5396e8b1SAlexey Brodkin #define _CONFIG_IOT_DEVKIT_H_
8*5396e8b1SAlexey Brodkin 
9*5396e8b1SAlexey Brodkin #include <linux/sizes.h>
10*5396e8b1SAlexey Brodkin 
11*5396e8b1SAlexey Brodkin /*
12*5396e8b1SAlexey Brodkin  *                         MEMORY MAP
13*5396e8b1SAlexey Brodkin  *
14*5396e8b1SAlexey Brodkin  * eFlash: 0x0000_0000 - 0x0008_0000 (512K)
15*5396e8b1SAlexey Brodkin  *   ICCM: 0x2000_0000 - 0x2004_0000 (256K)
16*5396e8b1SAlexey Brodkin  *   SRAM: 0x3000_0000 - 0x3002_0000 (128K)
17*5396e8b1SAlexey Brodkin  *   DCCM: 0x8000_0000 - 0x8002_0000 (128K)
18*5396e8b1SAlexey Brodkin  *     Note: only data goes here, as IFQ cannot fetch instructions from DCCM
19*5396e8b1SAlexey Brodkin  *
20*5396e8b1SAlexey Brodkin  *
21*5396e8b1SAlexey Brodkin  *                         RAM PARTITIONING
22*5396e8b1SAlexey Brodkin  *
23*5396e8b1SAlexey Brodkin  *   +-----------+----------+---------------------+-------------+
24*5396e8b1SAlexey Brodkin  *   | <-- Stack |  .data   | Malloc              | Environment |
25*5396e8b1SAlexey Brodkin  *   +-----------+----------+---------------------+-------------+
26*5396e8b1SAlexey Brodkin  *   :           :          :                     :\___________/
27*5396e8b1SAlexey Brodkin  *   :           :          :                     :      |
28*5396e8b1SAlexey Brodkin  *   :           :          :                     :     CONFIG_ENV_SIZE
29*5396e8b1SAlexey Brodkin  *   :           :           \____________________/
30*5396e8b1SAlexey Brodkin  *   :           :                     |
31*5396e8b1SAlexey Brodkin  *   :           :                    CONFIG_SYS_MALLOC_LEN
32*5396e8b1SAlexey Brodkin  *   :           :
33*5396e8b1SAlexey Brodkin  *   :          Specified explicitly by CONFIG_SYS_INIT_SP_ADDR
34*5396e8b1SAlexey Brodkin  *   :
35*5396e8b1SAlexey Brodkin  *  Specified explicitly by CONFIG_SYS_SDRAM_BASE
36*5396e8b1SAlexey Brodkin  *
37*5396e8b1SAlexey Brodkin  *  NOTES:
38*5396e8b1SAlexey Brodkin  *    - Stack starts from CONFIG_SYS_INIT_SP_ADDR and grows down,
39*5396e8b1SAlexey Brodkin  *      i.e. towards CONFIG_SYS_SDRAM_BASE but nothing stops it from crossing
40*5396e8b1SAlexey Brodkin  *      that CONFIG_SYS_SDRAM_BASE in which case data won't be really saved on
41*5396e8b1SAlexey Brodkin  *      stack any longer and values popped from stack will contain garbage
42*5396e8b1SAlexey Brodkin  *      leading to unexpected behavior, typically but not limited to:
43*5396e8b1SAlexey Brodkin  *        - "Returning" back to bogus caller function
44*5396e8b1SAlexey Brodkin  *        - Reading data from weird addresses
45*5396e8b1SAlexey Brodkin  */
46*5396e8b1SAlexey Brodkin 
47*5396e8b1SAlexey Brodkin #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
48*5396e8b1SAlexey Brodkin 
49*5396e8b1SAlexey Brodkin #define SRAM_BASE			0x30000000
50*5396e8b1SAlexey Brodkin #define SRAM_SIZE			SZ_128K
51*5396e8b1SAlexey Brodkin 
52*5396e8b1SAlexey Brodkin #define DCCM_BASE			0x80000000
53*5396e8b1SAlexey Brodkin #define DCCM_SIZE			SZ_128K
54*5396e8b1SAlexey Brodkin 
55*5396e8b1SAlexey Brodkin #define CONFIG_SYS_SDRAM_BASE		DCCM_BASE
56*5396e8b1SAlexey Brodkin #define CONFIG_SYS_SDRAM_SIZE		DCCM_SIZE
57*5396e8b1SAlexey Brodkin 
58*5396e8b1SAlexey Brodkin #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + SZ_32K)
59*5396e8b1SAlexey Brodkin 
60*5396e8b1SAlexey Brodkin #define CONFIG_SYS_MALLOC_LEN		SZ_64K
61*5396e8b1SAlexey Brodkin #define CONFIG_SYS_BOOTM_LEN		SZ_128K
62*5396e8b1SAlexey Brodkin #define CONFIG_SYS_LOAD_ADDR		SRAM_BASE
63*5396e8b1SAlexey Brodkin 
64*5396e8b1SAlexey Brodkin #define ROM_BASE			CONFIG_SYS_MONITOR_BASE
65*5396e8b1SAlexey Brodkin #define ROM_SIZE			SZ_256K
66*5396e8b1SAlexey Brodkin 
67*5396e8b1SAlexey Brodkin #define RAM_DATA_BASE			CONFIG_SYS_INIT_SP_ADDR
68*5396e8b1SAlexey Brodkin #define RAM_DATA_SIZE			CONFIG_SYS_SDRAM_SIZE - \
69*5396e8b1SAlexey Brodkin 					(CONFIG_SYS_INIT_SP_ADDR - \
70*5396e8b1SAlexey Brodkin 					CONFIG_SYS_SDRAM_BASE) - \
71*5396e8b1SAlexey Brodkin 					CONFIG_SYS_MALLOC_LEN - \
72*5396e8b1SAlexey Brodkin 					CONFIG_ENV_SIZE
73*5396e8b1SAlexey Brodkin 
74*5396e8b1SAlexey Brodkin /*
75*5396e8b1SAlexey Brodkin  * Environment
76*5396e8b1SAlexey Brodkin  */
77*5396e8b1SAlexey Brodkin #define CONFIG_BOOTFILE			"app.bin"
78*5396e8b1SAlexey Brodkin #define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
79*5396e8b1SAlexey Brodkin 
80*5396e8b1SAlexey Brodkin #endif /* _CONFIG_IOT_DEVKIT_H_ */
81