ox820.h 12 KB

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