uboot-oxnas: bump to U-Boot 2014.10
[openwrt.git] / package / boot / uboot-oxnas / files / include / configs / ox820.h
1 #ifndef __CONFIG_H
2 #define __CONFIG_H
3
4 /* High Level Configuration Options */
5 #define CONFIG_ARM1136
6 #define CONFIG_OX820
7 #define CONFIG_SYS_GENERIC_BOARD
8 #define CONFIG_BOARD_EARLY_INIT_F
9
10 #include <asm/arch/cpu.h>       /* get chip and board defs */
11
12 /* make cmd_ide.c quiet when compile */
13 #define __io
14
15 /*#define CONFIG_ARCH_CPU_INIT*/
16 /*#define CONFIG_DISPLAY_CPUINFO*/
17 /*#define CONFIG_DISPLAY_BOARDINFO*/
18 /*#define CONFIG_BOARD_EARLY_INIT_F*/
19 /*#define CONFIG_SKIP_LOWLEVEL_INIT*/
20
21 /* mem */
22 #define CONFIG_SYS_SDRAM_BASE           0x60000000
23 #define CONFIG_NR_DRAM_BANKS            1
24 #define CONFIG_MIN_SDRAM_SIZE           (128 * 1024 * 1024)     /* 128 MB */
25 #define CONFIG_MAX_SDRAM_SIZE           (512 * 1024 * 1024)     /* 512 MB */
26 #define CONFIG_SRAM_BASE                0x50000000
27 #define CONFIG_SRAM_SIZE                (64 * 1024)
28
29 /* need do dma so better keep dcache off */
30 #define CONFIG_SYS_DCACHE_OFF
31
32 /* clock */
33 #define CONFIG_PLLA_FREQ_MHZ            800
34 #define CONFIG_RPSCLK                   6250000
35 #define CONFIG_SYS_HZ                   1000
36 #define CONFIG_SYS_CLK_FREQ             CONFIG_RPSCLK
37 #define CONFIG_SYS_TIMERBASE            TIMER1_BASE
38 #define CONFIG_TIMER_PRESCALE           TIMER_PRESCALE_16
39
40 /* serial */
41 #define CONFIG_SYS_NS16550
42 #define CONFIG_SYS_NS16550_SERIAL
43 #define CONFIG_SYS_NS16550_CLK          CONFIG_RPSCLK
44 #define CONFIG_SYS_NS16550_REG_SIZE     1
45 #define CONFIG_BAUDRATE                 115200
46 #define CONFIG_SYS_NS16550_COM1         UART_1_BASE
47 #define CONFIG_CONS_INDEX               1
48
49 /* ide */
50 #define CONFIG_SYS_ATA_BASE_ADDR        0
51 #define CONFIG_SYS_ATA_DATA_OFFSET      0
52 #define CONFIG_SYS_ATA_REG_OFFSET       0
53 #define CONFIG_SYS_ATA_ALT_OFFSET       0
54 #define CONFIG_IDE_PLX
55 #define CONFIG_SYS_IDE_MAXDEVICE        2
56 #define CONFIG_SYS_IDE_MAXBUS           1
57 #define CONFIG_IDE_PREINIT
58 #define CONFIG_LBA48
59
60 /* nand */
61 #define CONFIG_NAND
62 #define CONFIG_SYS_MAX_NAND_DEVICE      1
63 #define CONFIG_SYS_NAND_BASE            STATIC_CS0_BASE
64 #define NAND_CLE_ADDR_PIN               19
65 #define NAND_ALE_ADDR_PIN               18
66 #define MTDPARTS_DEFAULT                "mtdparts=41000000.nand:" \
67                                                 "14m(boot)," \
68                                                 "-(ubi)"
69 #define MTDIDS_DEFAULT                  "nand0=41000000.nand"
70 #define UBIPART_DEFAULT                 "ubi"
71
72 /* net */
73 #define CONFIG_DESIGNWARE_ETH
74 #define CONFIG_DW_ALTDESCRIPTOR
75 #define CONFIG_MII
76 #define CONFIG_CMD_MII
77 #define CONFIG_PHYLIB
78 #define CONFIG_PHY_REALTEK
79
80 /* spl */
81 #ifdef CONFIG_SPL_BUILD
82 #define USE_DL_PREFIX   /* rename malloc free etc, so we can override them */
83 #endif
84
85 #if defined(CONFIG_BOOT_FROM_NAND) || defined(CONFIG_BOOT_FROM_SATA)
86 #define CONFIG_SPL
87 #define CONFIG_SPL_FRAMEWORK
88 #define CONFIG_SPL_LIBCOMMON_SUPPORT
89 #define CONFIG_SPL_SERIAL_SUPPORT
90 #define CONFIG_SPL_LIBGENERIC_SUPPORT
91 #define CONFIG_SPL_TEXT_BASE                    0x50000000
92 #define CONFIG_SPL_STACK                        (CONFIG_SRAM_BASE + (48 * 1024))
93 #define CONFIG_SPL_DISPLAY_PRINT
94 #define CONFIG_SPL_BSS_DRAM_START                       0x65000000
95 #define CONFIG_SPL_BSS_DRAM_SIZE                        0x01000000
96 #define CONFIG_SPL_MALLOC_START                         0x66000000
97 #endif
98
99 #if defined(CONFIG_BOOT_FROM_NAND)
100 #define CONFIG_SPL_NAND_SUPPORT
101 #define BOOT_DEVICE_TYPE                        "NAND"
102 #define BOOT_DEVICE_NAND                        0xfeedbacc
103 #define CONFIG_SPL_BOOT_DEVICE                  BOOT_DEVICE_NAND
104 #define CONFIG_SPL_NAND_SIMPLE
105 #define CONFIG_SPL_NAND_ECC
106 #define CONFIG_SPL_NAND_SOFTECC
107 #define CONFIG_SYS_NAND_ECCSIZE                 512
108 #define CONFIG_SYS_NAND_ECCBYTES                6
109 #define CONFIG_SYS_NAND_ECCPOS                  {40, 41, 42, 43, 44, 45, 46, 47, \
110                                                 48, 49, 50, 51, 52, 53, 54, 55, \
111                                                 56, 57, 58, 59, 60, 61, 62, 63}
112 #define CONFIG_SYS_NAND_PAGE_SIZE               2048
113 #define CONFIG_SYS_NAND_OOBSIZE                 64
114 #define CONFIG_SYS_NAND_BLOCK_SIZE              (128 * 1024)
115 #define CONFIG_SYS_NAND_BAD_BLOCK_POS           0
116 /* pages per erase block */
117 #define CONFIG_SYS_NAND_PAGE_COUNT              (CONFIG_SYS_NAND_BLOCK_SIZE / CONFIG_SYS_NAND_PAGE_SIZE)
118 /* nand spl use 1 erase block, and use bit to byte encode for reliability */
119 #define CONFIG_SPL_MAX_SIZE                     (128 * 1024 / 8)
120 #define CONFIG_SYS_NAND_U_BOOT_OFFS             0x00040000
121 /* spl kernel load is not enabled */
122 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS         0x00200000
123 #define CONFIG_CMD_SPL_NAND_OFS                 0
124 #define CONFIG_CMD_SPL_WRITE_SIZE               1024
125 #define CONFIG_SYS_SPL_ARGS_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x100)
126 /* CONFIG_BOOT_FROM_NAND end */
127
128 #elif defined(CONFIG_BOOT_FROM_SATA)
129 #define CONFIG_SPL_BLOCK_SUPPORT
130 #define BOOT_DEVICE_TYPE                                "SATA"
131 #define BOOT_DEVICE_BLOCK                               860202
132 #define CONFIG_SPL_BOOT_DEVICE                          BOOT_DEVICE_BLOCK
133 #define CONFIG_SPL_MAX_SIZE                             (36 * 1024)
134 #define CONFIG_SPL_LIBDISK_SUPPORT
135 #define CONFIG_SPL_BLOCKDEV_INTERFACE                   "ide"
136 #define CONFIG_SPL_BLOCKDEV_ID                          0
137
138 #ifdef CONFIG_BOOT_FROM_FAT /* u-boot in fat partition */
139
140 #define CONFIG_SPL_FAT_SUPPORT
141
142 #define CONFIG_BLOCKDEV_FAT_BOOT_PARTITION              1 /* first partition */
143 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME                "u-boot.img" /* u-boot file name */
144 /* enable U-Boot Falcon Mode */
145 #define CONFIG_CMD_SPL
146 #define CONFIG_SPL_OS_BOOT
147 #define CONFIG_SPL_FAT_LOAD_ARGS_NAME                   "bootargs.bin" /* boot parameters */
148 #define CONFIG_SPL_FAT_LOAD_KERNEL_NAME                 "falcon.img" /* kernel */
149 #define CONFIG_SYS_SPL_ARGS_ADDR                        (CONFIG_SYS_SDRAM_BASE + 0x100)
150
151 #elif CONFIG_BOOT_FROM_EXT4
152
153 #define CONFIG_SPL_EXT4_SUPPORT
154 #define CONFIG_BLOCKDEV_EXT4_BOOT_PARTITION             1 /* first partition */
155 #define CONFIG_SPL_EXT4_LOAD_PAYLOAD_NAME               "/boot/u-boot.img" /* u-boot file name */
156 /* enable U-Boot Falcon Mode */
157 #define CONFIG_CMD_SPL
158 #define CONFIG_SPL_OS_BOOT
159 #define CONFIG_SPL_EXT4_LOAD_ARGS_NAME                  "/boot/bootargs.bin" /* boot parameters */
160 #define CONFIG_SPL_EXT4_LOAD_KERNEL_NAME                "/boot/falcon.img" /* kernel */
161 #define CONFIG_SYS_SPL_ARGS_ADDR                        (CONFIG_SYS_SDRAM_BASE + 0x100)
162
163 #else /* u-boot in raw sectors */
164
165 #define CONFIG_SYS_BLOCK_RAW_MODE_U_BOOT_SECTOR         1024
166 /* spl kernel load is not enabled */
167 #define CONFIG_SYS_BLOCK_RAW_MODE_KERNEL_SECTOR         4096
168 #define CONFIG_SYS_BLOCK_RAW_MODE_ARGS_SECTOR           0
169 #define CONFIG_SYS_BLOCK_RAW_MODE_ARGS_SECTORS          (1024 / 512)
170 #define CONFIG_SYS_SPL_ARGS_ADDR                        (CONFIG_SYS_SDRAM_BASE + 0x100)
171
172 #endif /* CONFIG_BOOT_FROM_FAT */
173 /* CONFIG_BOOT_FROM_SATA end */
174
175 #else
176 /* generic, no spl support */
177 #endif
178
179 /* boot */
180 #define CONFIG_IDENT_STRING             " for OXNAS"
181 #define CONFIG_MACH_TYPE                MACH_TYPE_OXNAS
182 #ifndef CONFIG_SPL_BUILD
183 /* Enable devicetree support */
184 #define CONFIG_OF_LIBFDT
185 #endif
186 #define CONFIG_SETUP_MEMORY_TAGS
187 #define CONFIG_CMDLINE_TAG
188 #define CONFIG_INITRD_TAG
189 #define CONFIG_BOOTDELAY                1
190 #define CONFIG_ZERO_BOOTDELAY_CHECK
191 #define CONFIG_DEFAULT_CONSOLE_PARM     "console=ttyS0,115200n8 earlyprintk=serial"
192 /* Boot Argument Buffer Size */
193 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
194 /* memtest works on */
195 #define CONFIG_SYS_LOAD_ADDR            (CONFIG_SYS_SDRAM_BASE)
196 #define CONFIG_SYS_AUTOLOAD             "no"
197
198 #define CONFIG_DEFAULT_CONSOLE          CONFIG_DEFAULT_CONSOLE_PARM "\0"
199 #define CONFIG_BOOTARGS                 CONFIG_DEFAULT_CONSOLE_PARM
200 #define CONFIG_BOOTCOMMAND              "run nandboot"
201 #define CONFIG_BOOT_RETRY_TIME          -1
202 #define CONFIG_RESET_TO_RETRY           60
203
204 #define CONFIG_NETCONSOLE
205 #define CONFIG_IPADDR                   192.168.50.100
206 #define CONFIG_SERVERIP                 192.168.50.59
207
208 /* A sane default configuration...
209  * When booting without a valid environment in ubi, first to loading and booting
210  * the kernel image directly above U-Boot, maybe both were loaded there by
211  * another bootloader.
212  * Also use that same offset (0x90000) to load the rescue image later on (by
213  * adding it onto the flash address where U-Boot is supposed to be stored by
214  * the legacy loader, 0x440000, resulting in offset 0x4d0000 on the flash).
215  * When coming up with a valid environment in ubi, first try to load the
216  * kernel from a ubi volume kernel, if that fails, fallback to the rescue
217  * image stored in boot partition. As a last resort try booting via
218  * DHCP/TFTP.
219  * In case there is no valid environment, first probe for a uimage in ram left
220  * behind by the first bootloader on a tftp boot.
221  * If that fails, switch to normal boot order and save environment.
222  * The loader is supposed to be written to flash at offset 0x440000 and loaded to
223  * RAM at 0x64000000
224  */
225 #define CONFIG_EXTRA_ENV_SETTINGS       \
226         "load_kernel_ubi=ubi readvol 0x62000000 kernel;\0" \
227         "load_kernel_rescue=nand read 0x62000000 0x4e0000 0x400000;\0" \
228         "load_kernel_dhcp=dhcp 0x62000000 oxnas-rescue.bin;\0" \
229         "boot_kernel=bootm 0x62000000;\0" \
230         "boot_ubi=run load_kernel_ubi && run boot_kernel;\0" \
231         "boot_rescue=run load_kernel_rescue && run boot_kernel;\0" \
232         "boot_dhcp=run load_kernel_dhcp && run boot_kernel;\0" \
233         "normalboot=run boot_ubi; run boot_rescue; run boot_dhcp;\0" \
234         "firstboot=bootm 0x640a0000; setenv bootcmd run normalboot; " \
235         "setenv firstboot; saveenv; run bootcmd; \0" \
236         "bootcmd=run firstboot; \0" \
237         "console=" CONFIG_DEFAULT_CONSOLE \
238         "bootargs=" CONFIG_BOOTARGS "\0" \
239         "mtdids=" MTDIDS_DEFAULT "\0" \
240         "mtdparts=" MTDPARTS_DEFAULT "\0" \
241
242 /* env */
243 #if defined(CONFIG_BOOT_FROM_NAND)
244 #define CONFIG_ENV_IS_IN_NAND
245 #define CONFIG_ENV_OFFSET               0x000C0000
246 #define CONFIG_ENV_SIZE                 0x00020000
247 #define CONFIG_ENV_OFFSET_REDUND        0x00100000
248 #define CONFIG_ENV_SIZE_REDUND          0x00020000
249 #define CONFIG_ENV_RANGE                (CONFIG_ENV_SIZE * 2)
250 /* CONFIG_BOOT_FROM_NAND end */
251
252 #elif defined(CONFIG_BOOT_FROM_SATA)
253 #ifdef CONFIG_BOOT_FROM_EXT4
254 #define CONFIG_ENV_IS_IN_EXT4
255 #define CONFIG_START_IDE
256 #define EXT4_ENV_INTERFACE              "ide"
257 #define EXT4_ENV_DEVICE                 0
258 #define EXT4_ENV_PART                   1
259 #define EXT4_ENV_FILE                   "/boot/u-boot.env"
260 #define CONFIG_ENV_SIZE                 (16 * 1024)
261 #else
262 #define CONFIG_ENV_IS_IN_FAT
263 #define CONFIG_START_IDE
264 #define FAT_ENV_INTERFACE               "ide"
265 #define FAT_ENV_DEVICE                  0
266 #define FAT_ENV_PART                    1
267 #define FAT_ENV_FILE                    "u-boot.env"
268 #define CONFIG_ENV_SIZE                 (16 * 1024)
269 #endif
270 /* CONFIG_BOOT_FROM_SATA end */
271 #elif defined(CONFIG_BOOT_FROM_SATA)
272
273 #else
274 /* generic */
275 #define CONFIG_ENV_IS_IN_UBI            1
276 #define CONFIG_ENV_UBI_PART             UBIPART_DEFAULT
277 #define CONFIG_ENV_UBI_VOLUME           "ubootenv"
278 #define CONFIG_ENV_UBI_VOLUME_REDUND    "ubootenv2"
279 #define CONFIG_ENV_SIZE                 (16 * 1024)
280 #endif
281
282 /* allow to overwrite serial and ethaddr */
283 #define CONFIG_ENV_OVERWRITE
284
285 #define CONFIG_SYS_MONITOR_LEN          (512 * 1024)
286 #define CONFIG_SYS_TEXT_BASE            0x64000000
287 #define CONFIG_SYS_INIT_SP_ADDR         0x65000000
288 /* Size of malloc() pool */
289 #define CONFIG_SYS_MALLOC_LEN           (1 * 1024 * 1024)
290
291 /* Miscellaneous configurable options */
292 #define CONFIG_SYS_LONGHELP             /* undef to save memory */
293 #define CONFIG_SYS_HUSH_PARSER          /* use "hush" command parser    */
294 #define CONFIG_SYS_PROMPT               "OX820 # "
295 #define CONFIG_SYS_CBSIZE               1024    /* Console I/O Buffer Size*/
296 #define CONFIG_SYS_PBSIZE               1024    /* Print Buffer Size */
297 #define CONFIG_SYS_MAXARGS              32      /* max number of command args */
298 #define CONFIG_CMDLINE_EDITING
299 #define CONFIG_AUTO_COMPLETE
300
301 /* usb */
302 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
303 #define CONFIG_USB_EHCI
304 #define CONFIG_EHCI_IS_TDI
305 /* #define CONFIG_USB_EHCI_TXFIFO_THRESH        0x3F */
306 #define CONFIG_USB_PLLB_CLK
307 #define CONFIG_USB_EHCI_OXNAS
308 #ifndef CONFIG_SPL_BUILD
309 #define CONFIG_USB_STORAGE
310 #endif
311 #define CONFIG_CMD_USB
312
313 /* cmds */
314 #define CONFIG_SYS_NO_FLASH
315 #include <config_cmd_default.h>
316
317 #define CONFIG_CMD_SAVEENV
318 #define CONFIG_CMD_ASKENV
319 #define CONFIG_CMD_GREPENV
320 #define CONFIG_CMD_ENV_FLAGS
321
322 #define CONFIG_CMD_NET
323 #define CONFIG_CMD_DHCP
324 #define CONFIG_CMD_NFS
325 #define CONFIG_CMD_PING
326 #define CONFIG_CMD_PXE
327
328 #define CONFIG_CMD_NAND
329 #define CONFIG_CMD_MTDPARTS
330 #define CONFIG_CMD_UBI
331 #define CONFIG_CMD_UBIFS
332
333 #define CONFIG_CMD_IDE
334 #define CONFIG_CMD_FAT
335 #define CONFIG_FAT_WRITE
336 #define CONFIG_CMD_EXT2
337 #define CONFIG_CMD_EXT4
338 #ifndef CONFIG_SPL_BUILD
339 #define CONFIG_CMD_EXT4_WRITE
340 #endif
341
342 #define CONFIG_CMD_ZIP
343 #define CONFIG_CMD_UNZIP
344 #define CONFIG_CMD_TIME
345 #define CONFIG_CMD_SETEXPR
346 #define CONFIG_CMD_MD5SUM
347 #define CONFIG_CMD_HASH
348 #define CONFIG_CMD_INI
349 #define CONFIG_CMD_GETTIME
350 #define CONFIG_CMD_BOOTMENU
351 #define CONFIG_CMD_ELF
352
353 #define CONFIG_DOS_PARTITION
354 #define CONFIG_EFI_PARTITION
355
356 /* for CONFIG_CMD_MTDPARTS */
357 #define CONFIG_MTD_DEVICE
358 /* for CONFIG_CMD_UBI */
359 #define CONFIG_MTD_PARTITIONS
360 /* for CONFIG_CMD_UBI */
361 #define CONFIG_RBTREE
362
363 /* optional, for CONFIG_CMD_BOOTM & required by CONFIG_CMD_UBIFS */
364 #define CONFIG_LZO
365 #define CONFIG_LZMA
366 #define CONFIG_BZIP2
367
368 /* for CONFIG_CMD_ZIP */
369 #define CONFIG_GZIP_COMPRESSED
370 /* for CONFIG_CMD_MD5SUM */
371 #define CONFIG_MD5
372 #define CONFIG_MD5SUM_VERIFY
373 /* enable CONFIG_CMD_HASH's verification feature */
374 #define CONFIG_HASH_VERIFY
375 #define CONFIG_REGEX
376 /* for CONFIG_CMD_BOOTMENU & CONFIG_CMD_PXE */
377 #define CONFIG_MENU
378
379 /* for new FIT uImage format generated in OpenWrt */
380 #define CONFIG_FIT
381
382 #endif  /* __CONFIG_H */