• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * hi3516av300.h
3  *
4  * Declaration of Header Files Related to the Chip.
5  *
6  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
7  *
8  * This program is free software; you can redistribute  it and/or modify it
9  * under  the terms of  the GNU General  Public License as published by the
10  * Free Software Foundation;  either version 2 of the  License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef __HI3516AV300_H
24 #define __HI3516AV300_H
25 
26 #include <linux/sizes.h>
27 #include <asm/arch/platform.h>
28 
29 #define CONFIG_SYS_CACHELINE_SIZE   64
30 
31 /* base on needs #define CONFIG_REMAKE_ELF */
32 
33 #define CONFIG_SUPPORT_RAW_INITRD
34 
35 #define CONFIG_BOARD_EARLY_INIT_F
36 
37 /* Physical Memory Map */
38 
39 /* CONFIG_SYS_TEXT_BASE needs to align with where ATF loads bl33.bin */
40 #define CONFIG_SYS_TEXT_BASE        0x80800000
41 #define CONFIG_SYS_TEXT_BASE_ORI        0x80700000
42 
43 #define PHYS_SDRAM_1            0x80000000
44 #define PHYS_SDRAM_1_SIZE       0x10000000
45 
46 #define CONFIG_SYS_SDRAM_BASE       PHYS_SDRAM_1
47 
48 
49 #define CONFIG_SYS_INIT_SP_ADDR     0x04014000
50 
51 #define CONFIG_SYS_LOAD_ADDR        (CONFIG_SYS_SDRAM_BASE + 0x80000 + 0x2000000)
52 #define CONFIG_SYS_GBL_DATA_SIZE    128
53 
54 /* Generic Timer Definitions */
55 #define COUNTER_FREQUENCY       0x1800000
56 
57 #define CONFIG_SYS_TIMER_RATE       CFG_TIMER_CLK
58 #define CONFIG_SYS_TIMER_COUNTER    (CFG_TIMERBASE + REG_TIMER_VALUE)
59 #define CONFIG_SYS_TIMER_COUNTS_DOWN
60 
61 
62 /* Generic Interrupt Controller Definitions */
63 #define GICD_BASE           0xf6801000
64 #define GICC_BASE           0xf6802000
65 
66 /* Size of malloc() pool */
67 #define CONFIG_SYS_MALLOC_LEN       (CONFIG_ENV_SIZE + SZ_128K)
68 
69 /* PL011 Serial Configuration */
70 #define CONFIG_PL011_CLOCK      24000000
71 
72 #define CONFIG_PL01x_PORTS  \
73 	{(void *)UART0_REG_BASE, (void *)UART1_REG_BASE, \
74 	(void *)UART2_REG_BASE, (void *)UART3_REG_BASE}
75 
76 #define CONFIG_CUR_UART_BASE    UART0_REG_BASE
77 
78 /* Flash Memory Configuration v100 */
79 #ifdef CONFIG_HIFMC
80 #define CONFIG_HIFMC_REG_BASE       FMC_REG_BASE
81 #define CONFIG_HIFMC_BUFFER_BASE    FMC_MEM_BASE
82 #define CONFIG_HIFMC_MAX_CS_NUM     1
83 #endif
84 
85 #ifdef CONFIG_HIFMC_SPI_NOR
86 #define CONFIG_CMD_SF
87 #define CONFIG_SPI_NOR_MAX_CHIP_NUM 1
88 #define CONFIG_SPI_NOR_QUIET_TEST
89 #endif
90 
91 #ifdef CONFIG_HIFMC_SPI_NAND
92 #define CONFIG_CMD_NAND
93 #define CONFIG_SPI_NAND_MAX_CHIP_NUM    1
94 #define CONFIG_SYS_MAX_NAND_DEVICE  CONFIG_SPI_NAND_MAX_CHIP_NUM
95 #define CONFIG_SYS_NAND_MAX_CHIPS   CONFIG_SPI_NAND_MAX_CHIP_NUM
96 #define CONFIG_SYS_NAND_BASE        FMC_MEM_BASE
97 #endif
98 
99 #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
100 /*-----------------------------------------------------------------------
101  * HIETH driver
102  -----------------------------------------------------------------------*/
103 /* default is hieth-switch-fabric */
104 #ifdef CONFIG_HISFV300_ETH
105 #define HISFV_RESET_PHY_BY_CRG
106 #define HISFV_MII_MODE              0
107 #define HISFV_RMII_MODE             1
108 #define HIETH_MII_RMII_MODE_U           HISFV_RMII_MODE
109 #define HIETH_MII_RMII_MODE_D           HISFV_RMII_MODE
110 #define HISFV_PHY_U             1
111 #define HISFV_PHY_D             2
112 #endif /* CONFIG_HISFV300_ETH */
113 
114 /* SD/MMC configuration */
115 #ifdef CONFIG_MMC
116 #define CONFIG_SUPPORT_EMMC_BOOT
117 #define CONFIG_GENERIC_MMC
118 #define CONFIG_CMD_MMC
119 #define CONFIG_SYS_MMC_ENV_DEV  0
120 #define CONFIG_EXT4_SPARSE
121 #define CONFIG_BOUNCE_BUFFER
122 #define CONFIG_FS_EXT4
123 #endif
124 
125 #define CONFIG_MISC_INIT_R
126 
127 /* Command line configuration */
128 #define CONFIG_MENU
129 #define CONFIG_CMD_UNZIP
130 #define CONFIG_CMD_ENV
131 
132 #define CONFIG_MTD_PARTITIONS
133 
134 /* BOOTP options */
135 #define CONFIG_BOOTP_BOOTFILESIZE
136 
137 /* Initial environment variables */
138 
139 /*
140  * Defines where the kernel and FDT will be put in RAM
141  */
142 
143 /* Assume we boot with root on the seventh partition of eMMC */
144 #define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 root=/dev/mtdblock2 rw"
145 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
146 #define BOOT_TARGET_DEVICES(func) \
147 	func(USB, usb, 0) \
148 	func(MMC, mmc, 1) \
149 	func(DHCP, dhcp, na)
150 #include <config_distro_bootcmd.h>
151 
152 /* allow change env */
153 #define  CONFIG_ENV_OVERWRITE
154 
155 #define CONFIG_COMMAND_HISTORY
156 
157 /* env in flash instead of CFG_ENV_IS_NOWHERE */
158 #define CONFIG_ENV_OFFSET       0x80000      /* environment starts here */
159 #define CONFIG_ENV_VARS_UBOOT_CONFIG
160 
161 /* kernel parameter list phy addr */
162 #define CFG_BOOT_PARAMS          (0x82800000 - 0x100)
163 
164 /* Monitor Command Prompt */
165 #define CONFIG_SYS_CBSIZE       1024    /* Console I/O Buffer Size */
166 #define CONFIG_SYS_PBSIZE       (CONFIG_SYS_CBSIZE + \
167 					sizeof(CONFIG_SYS_PROMPT) + 16)
168 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE
169 #define CONFIG_SYS_MAXARGS      64  /* max command args */
170 
171 #define CONFIG_SYS_NO_FLASH
172 
173 #define CONFIG_DDR_TRAINING_V2
174 
175 #define CONFIG_PRODUCTNAME "hi3516av300"
176 
177 /* the flag for auto update. 1:enable; 0:disable */
178 #define CONFIG_AUTO_UPDATE         1
179 
180 #if (CONFIG_AUTO_UPDATE == 1)
181 #define CONFIG_AUTO_UPDATE_ADAPTATION   1
182 #define CONFIG_AUTO_SD_UPDATE       1
183 #define CONFIG_AUTO_USB_UPDATE      1
184 
185 #define CONFIG_FS_FAT 1
186 #define CONFIG_FS_FAT_MAX_CLUSTSIZE 65536
187 #endif
188 
189 /*---------------------------------------------------------------------
190  * sdcard system updae
191  * ---------------------------------------------------------------------*/
192 #ifdef CONFIG_AUTO_SD_UPDATE
193 
194 #ifndef CONFIG_GENERIC_MMC
195 #define CONFIG_GENERIC_MMC
196 #define CONFIG_CMD_MMC
197 #endif
198 
199 #ifndef CONFIG_MMC
200 #define CONFIG_MMC      1
201 #define CONFIG_HIMCI   1
202 #define CONFIG_MMC_WRITE 1
203 #define CONFIG_MMC_QUIRKS 1
204 #define CONFIG_MMC_HW_PARTITIONING  1
205 #define CONFIG_MMC_HS400_ES_SUPPORT  1
206 #define CONFIG_MMC_HS400_SUPPORT  1
207 #define CONFIG_MMC_HS200_SUPPORT  1
208 #define CONFIG_MMC_VERBOSE  1
209 #endif
210 #ifndef CONFIG_HIFMC
211 #define CONFIG_EMMC
212 #endif
213 #endif
214 
215 #ifdef CONFIG_HIMCI
216 #define CONFIG_HIMCI_MAX_FREQ           100000000
217 #define CONFIG_SDIO0_FREQ           50000000
218 #define CONFIG_MMC_POWER_OFF_TIMEOUT    5
219 #define CONFIG_MMC_POWER_ON_TIMEROUT    40
220 #define CONFIG_MMC_RESET_LOW_TIMEOUT    10
221 #define CONFIG_MMC_RESET_HIGH_TIMEROUT  300
222 #endif
223 
224 #define CONFIG_SKIP_LOWLEVEL_INIT
225 #define CONFIG_CMDLINE_TAG
226 
227 #define CONFIG_OSD_ENABLE
228 #define CONFIG_CIPHER_ENABLE
229 
230 /* base on needs #define CONFIG_EDMA_PLL_TRAINNING */
231 
232 #endif /* __HI3516AV300_H */
233