2 * Copyright (C) 2015 <LW@KARO-electronics.de>
4 * SPDX-License-Identifier: GPL-2.0
11 #include <linux/kconfig.h>
12 #include <linux/sizes.h>
13 #include <asm/hardware.h>
15 #define CONFIG_SYS_TEXT_BASE 0x20100000
17 /* ARM asynchronous clock */
18 #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
19 #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
21 #define CONFIG_ARCH_CPU_INIT
23 #define CONFIG_SKIP_LOWLEVEL_INIT
24 #define CONFIG_BOARD_LATE_INIT
25 #define CONFIG_BOARD_EARLY_INIT_F
26 #define CONFIG_DISPLAY_CPUINFO
28 #define CONFIG_SYS_GENERIC_BOARD
30 /* general purpose I/O */
31 #define CONFIG_AT91_GPIO
34 #define CONFIG_ATMEL_USART
35 #define CONFIG_USART_BASE ATMEL_BASE_USART0
36 #define CONFIG_USART_ID ATMEL_ID_USART0
37 #define CONFIG_SYS_CONSOLE_INFO_QUIET
39 #define xstr(s) str(s)
41 #define __pfx(x, s) (x##s)
42 #define _pfx(x, s) __pfx(x, s)
45 #define CONFIG_NR_DRAM_BANKS 1
46 #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
47 #define CONFIG_SYS_SDRAM_SIZE 0x20000000
49 #define CONFIG_SYS_INIT_SP_ADDR \
50 (CONFIG_SYS_SDRAM_BASE + SZ_4K - GENERATED_GBL_DATA_SIZE)
52 #define CONFIG_CMDLINE_TAG
53 #define CONFIG_SETUP_MEMORY_TAGS
54 #define CONFIG_BOOTDELAY 3
55 #define CONFIG_ZERO_BOOTDELAY_CHECK
56 #define CONFIG_SYS_AUTOLOAD "no"
57 #define CONFIG_BOOTFILE "uImage"
58 #define CONFIG_BOOTARGS "init=/linuxrc console=ttyS0,115200 ro debug panic=1"
59 #define CONFIG_BOOTCOMMAND "run bootcmd_${boot_mode} bootm_cmd"
60 #define CONFIG_LOADADDR 22000000 /* load address */
61 #define CONFIG_FDTADDR 21000000
62 #define CONFIG_SYS_LOAD_ADDR _pfx(0x, CONFIG_LOADADDR)
63 #define CONFIG_SYS_FDT_ADDR _pfx(0x, CONFIG_FDTADDR)
64 #define CONFIG_U_BOOT_IMG_SIZE SZ_1M
67 #ifdef CONFIG_TXA5_NAND
68 #define CONFIG_SYS_MAX_NAND_DEVICE 0x1
70 #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
72 #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
73 #define CONFIG_SYS_NAND_ONFI_DETECTION
74 /* PMECC & PMERRLOC */
75 #define CONFIG_ATMEL_NAND_HWECC
76 #define CONFIG_ATMEL_NAND_HW_PMECC
77 #ifdef CONFIG_ENV_IS_IN_NAND
78 #define CONFIG_SYS_NAND_U_BOOT_OFFS SZ_128K
79 #define CONFIG_ENV_OVERWRITE
80 #define CONFIG_ENV_OFFSET (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
81 #define CONFIG_ENV_SIZE SZ_128K
82 #define CONFIG_ENV_RANGE 0x60000
83 #endif /* CONFIG_ENV_IS_IN_NAND */
84 #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
85 #define CONFIG_SYS_NAND_SIZE SZ_128M
86 #define NAND_BASE CONFIG_SYS_NAND_BASE
87 #endif /* CONFIG_CMD_NAND */
91 #define CONFIG_GENERIC_MMC
92 #define CONFIG_GENERIC_ATMEL_MCI
93 #define ATMEL_BASE_MMCI ATMEL_BASE_MCI1
95 #define CONFIG_CMD_FAT
96 #define CONFIG_FAT_WRITE
97 #define CONFIG_CMD_EXT2
100 /* Ethernet Hardware */
103 #define CONFIG_NET_RETRY_COUNT 20
104 #define CONFIG_MACB_SEARCH_PHY
107 /* #define CONFIG_LCD */
110 extern int lcd_output_bpp;
112 #define LCD_BPP LCD_COLOR16
113 #define LCD_OUTPUT_BPP lcd_output_bpp
114 #define CONFIG_LCD_LOGO
115 #define CONFIG_ATMEL_HLCD
116 #define CONFIG_ATMEL_LCD_RGB565
117 #define CONFIG_CMD_BMP
118 #define CONFIG_VIDEO_BMP_RLE8
121 #ifdef CONFIG_TXA5_NAND
122 #define CONFIG_SYS_DEFAULT_BOOT_MODE "nand"
123 #define CONFIG_SYS_BOOT_CMD_NAND \
124 "bootcmd_nand=setenv autostart no;run bootargs_ubifs;nboot linux\0"
125 #define CONFIG_SYS_FDTSAVE_CMD \
126 "fdtsave=fdt resize;nand erase.part dtb" \
127 ";nand write ${fdtaddr} dtb ${fdtsize}\0"
128 #define MTD_NAME "atmel_nand"
129 #define MTDIDS_DEFAULT "nand0=" MTD_NAME
130 #ifdef CONFIG_ENV_OFFSET_REDUND
131 #define MTDPARTS_DEFAULT "mtdparts=" MTD_NAME ":" \
132 "128k(u-boot-spl)," \
134 xstr(CONFIG_ENV_RANGE) \
136 xstr(CONFIG_ENV_RANGE) \
137 "(env2),6m(linux),32m(rootfs),89216k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
139 #define MTDPARTS_DEFAULT "mtdparts=" MTD_NAME ":" \
140 "128k(u-boot-spl)," \
142 xstr(CONFIG_ENV_RANGE) \
143 "(env),6m(linux),32m(rootfs),89600k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
146 #define MMC_ROOT_STR " root=/dev/mmcblk0p2 rootwait\0"
147 #define ROOTPART_UUID_STR ""
149 #else /* CONFIG_TXA5_NAND */
150 /* bootstrap + u-boot + env in sd card */
151 #define CONFIG_SYS_FDTSAVE_CMD \
152 "fdtsave=mmc open 0 1;mmc write ${fdtaddr} " \
153 xstr(CONFIG_SYS_DTB_BLKNO) " 80;mmc close 0 1\0"
154 #define MMC_ROOT_STR " root=PARTUUID=${rootpart_uuid} rootwait\0"
155 #define ROOTPART_UUID_STR "rootpart_uuid=0cc66cc0-02\0"
157 #define MTDIDS_DEFAULT ""
158 #define MTDPARTS_DEFAULT ""
159 #define CONFIG_SYS_DEFAULT_BOOT_MODE "mmc"
160 #define CONFIG_SYS_BOOT_CMD_NAND ""
161 #define CONFIG_SYS_FDTSAVE_CMD \
162 "fdtsave=mmc open 0 1;mmc write ${fdtaddr} " \
163 xstr(CONFIG_SYS_DTB_BLKNO) " 80;mmc close 0 1\0"
164 #define MMC_ROOT_STR " root=PARTUUID=${rootpart_uuid} rootwait\0"
165 #define ROOTPART_UUID_STR "rootpart_uuid=0cc66cc0-02\0"
166 #ifdef CONFIG_ENV_IS_IN_MMC
167 #define CONFIG_ENV_SIZE SZ_128K
168 #define CONFIG_SYS_MMC_ENV_DEV 0
169 #define CONFIG_SYS_MMC_ENV_PART 0x1
170 #define CONFIG_DYNAMIC_MMC_DEVNO
171 #endif /* CONFIG_ENV_IS_IN_MMC */
172 #endif /* CONFIG_TXA5_NAND */
175 * Extra Environment Settings
177 #ifdef CONFIG_ENV_IS_NOWHERE
178 #define CONFIG_EXTRA_ENV_SETTINGS \
181 "baseboard=stk5-v3\0" \
183 "fdtaddr=" xstr(CONFIG_FDTADDR) "\0" \
184 "mtdids=" MTDIDS_DEFAULT "\0" \
185 "mtdparts=" MTDPARTS_DEFAULT "\0"
187 #define CONFIG_EXTRA_ENV_SETTINGS \
189 "baseboard=stk5-v3\0" \
190 "bootargs_jffs2=run default_bootargs" \
191 ";setenv bootargs ${bootargs}" \
192 " root=/dev/mtdblock4 rootfstype=jffs2\0" \
193 "bootargs_mmc=run default_bootargs;setenv bootargs ${bootargs}" \
195 "bootargs_nfs=run default_bootargs;setenv bootargs ${bootargs}" \
196 " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock" \
198 "bootargs_ubifs=run default_bootargs" \
199 ";setenv bootargs ${bootargs}" \
200 " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0" \
201 "bootcmd_jffs2=setenv autostart no;run bootargs_jffs2" \
203 "bootcmd_mmc=setenv autostart no;run bootargs_mmc" \
204 ";fatload mmc 0 ${loadaddr} uImage\0" \
205 CONFIG_SYS_BOOT_CMD_NAND \
206 "bootcmd_net=setenv autoload y;setenv autostart n" \
207 ";run bootargs_nfs" \
209 "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0" \
210 "boot_mode=" CONFIG_SYS_DEFAULT_BOOT_MODE "\0" \
211 "default_bootargs=setenv bootargs " CONFIG_BOOTARGS \
212 " ${append_bootargs}\0" \
213 "fdtaddr=" xstr(CONFIG_FDTADDR) "\0" \
214 CONFIG_SYS_FDTSAVE_CMD \
215 "mtdids=" MTDIDS_DEFAULT "\0" \
216 "mtdparts=" MTDPARTS_DEFAULT "\0" \
217 "nfsroot=/tftpboot/rootfs\0" \
218 "otg_mode=device\0" \
220 "touchpanel=tsc2007\0" \
222 #endif /* CONFIG_ENV_IS_NOWHERE */
225 #define CONFIG_BAUDRATE 115200
227 #define CONFIG_SYS_LONGHELP
228 #define CONFIG_SYS_CBSIZE 2048
229 #define CONFIG_SYS_PBSIZE \
230 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
231 #define CONFIG_SYS_MAXARGS 256
232 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
234 #define CONFIG_VERSION_VARIABLE /* U-BOOT version */
235 #define CONFIG_AUTO_COMPLETE
236 #define CONFIG_CMDLINE_EDITING
238 #define CONFIG_SYS_64BIT_VSPRINTF
240 /* Size of malloc() pool */
241 #define CONFIG_SYS_MALLOC_LEN SZ_4M
242 #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE /* Memtest start address */
243 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + SZ_4M)