001-add-i2se-duckbill.patch 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. From 4d9a32780ec795b9edc83c7b3a1e947cec49a5a4 Mon Sep 17 00:00:00 2001
  2. From: Michael Heimpold <mhei@heimpold.de>
  3. Date: Sat, 15 Aug 2015 20:26:18 +0200
  4. Subject: [PATCH] Add support for I2SE Duckbill boards
  5. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
  6. ---
  7. arch/arm/Kconfig | 6 ++
  8. arch/arm/include/asm/mach-types.h | 13 +++
  9. board/i2se/duckbill/Kconfig | 15 ++++
  10. board/i2se/duckbill/MAINTAINERS | 6 ++
  11. board/i2se/duckbill/Makefile | 12 +++
  12. board/i2se/duckbill/duckbill.c | 112 +++++++++++++++++++++++
  13. board/i2se/duckbill/iomux.c | 125 ++++++++++++++++++++++++++
  14. configs/duckbill_defconfig | 9 ++
  15. include/configs/duckbill.h | 177 +++++++++++++++++++++++++++++++++++++
  16. 9 files changed, 475 insertions(+)
  17. create mode 100644 board/i2se/duckbill/Kconfig
  18. create mode 100644 board/i2se/duckbill/MAINTAINERS
  19. create mode 100644 board/i2se/duckbill/Makefile
  20. create mode 100644 board/i2se/duckbill/duckbill.c
  21. create mode 100644 board/i2se/duckbill/iomux.c
  22. create mode 100644 configs/duckbill_defconfig
  23. create mode 100644 include/configs/duckbill.h
  24. --- a/arch/arm/Kconfig
  25. +++ b/arch/arm/Kconfig
  26. @@ -178,6 +178,11 @@ config TARGET_MX28EVK
  27. select CPU_ARM926EJS
  28. select SUPPORT_SPL
  29. +config TARGET_DUCKBILL
  30. + bool "Support I2SE Duckbill"
  31. + select CPU_ARM926EJS
  32. + select SUPPORT_SPL
  33. +
  34. config TARGET_MX23_OLINUXINO
  35. bool "Support mx23_olinuxino"
  36. select CPU_ARM926EJS
  37. @@ -926,6 +931,7 @@ source "board/genesi/mx51_efikamx/Kconfi
  38. source "board/gumstix/pepper/Kconfig"
  39. source "board/h2200/Kconfig"
  40. source "board/hisilicon/hikey/Kconfig"
  41. +source "board/i2se/duckbill/Kconfig"
  42. source "board/imx31_phycore/Kconfig"
  43. source "board/isee/igep0033/Kconfig"
  44. source "board/maxbcm/Kconfig"
  45. --- a/arch/arm/include/asm/mach-types.h
  46. +++ b/arch/arm/include/asm/mach-types.h
  47. @@ -1109,6 +1109,7 @@ extern unsigned int __machine_arch_type;
  48. #define MACH_TYPE_COLIBRI_T30 4493
  49. #define MACH_TYPE_APALIS_T30 4513
  50. #define MACH_TYPE_OMAPL138_LCDK 2495
  51. +#define MACH_TYPE_DUCKBILL 4754
  52. #ifdef CONFIG_ARCH_EBSA110
  53. # ifdef machine_arch_type
  54. @@ -14262,6 +14263,18 @@ extern unsigned int __machine_arch_type;
  55. # define machine_is_apalis_t30() (0)
  56. #endif
  57. +#ifdef CONFIG_MACH_DUCKBILL
  58. +# ifdef machine_arch_type
  59. +# undef machine_arch_type
  60. +# define machine_arch_type __machine_arch_type
  61. +# else
  62. +# define machine_arch_type MACH_TYPE_DUCKBILL
  63. +# endif
  64. +# define machine_is_duckbill() (machine_arch_type == MACH_TYPE_DUCKBILL)
  65. +#else
  66. +# define machine_is_duckbill() (0)
  67. +#endif
  68. +
  69. /*
  70. * These have not yet been registered
  71. */
  72. --- /dev/null
  73. +++ b/board/i2se/duckbill/Kconfig
  74. @@ -0,0 +1,15 @@
  75. +if TARGET_DUCKBILL
  76. +
  77. +config SYS_BOARD
  78. + default "duckbill"
  79. +
  80. +config SYS_VENDOR
  81. + default "i2se"
  82. +
  83. +config SYS_SOC
  84. + default "mxs"
  85. +
  86. +config SYS_CONFIG_NAME
  87. + default "duckbill"
  88. +
  89. +endif
  90. --- /dev/null
  91. +++ b/board/i2se/duckbill/MAINTAINERS
  92. @@ -0,0 +1,6 @@
  93. +I2SE DUCKBILL BOARD
  94. +M: Michael Heimpold <mhei@heimpold.de>
  95. +S: Maintained
  96. +F: board/i2se/duckbill/
  97. +F: include/configs/duckbill.h
  98. +F: configs/duckbill_defconfig
  99. --- /dev/null
  100. +++ b/board/i2se/duckbill/Makefile
  101. @@ -0,0 +1,12 @@
  102. +#
  103. +# (C) Copyright 2014-2015
  104. +# Michael Heimpold, mhei@heimpold.de.
  105. +#
  106. +# SPDX-License-Identifier: GPL-2.0+
  107. +#
  108. +
  109. +ifndef CONFIG_SPL_BUILD
  110. +obj-y := duckbill.o
  111. +else
  112. +obj-y := iomux.o
  113. +endif
  114. --- /dev/null
  115. +++ b/board/i2se/duckbill/duckbill.c
  116. @@ -0,0 +1,112 @@
  117. +/*
  118. + * I2SE Duckbill board
  119. + *
  120. + * (C) Copyright 2014-2015 Michael Heimpold <mhei@heimpold.de>
  121. + *
  122. + * SPDX-License-Identifier: GPL-2.0+
  123. + */
  124. +
  125. +#include <common.h>
  126. +#include <asm/gpio.h>
  127. +#include <asm/io.h>
  128. +#include <asm/arch/imx-regs.h>
  129. +#include <asm/arch/iomux-mx28.h>
  130. +#include <asm/arch/clock.h>
  131. +#include <asm/arch/sys_proto.h>
  132. +#include <linux/mii.h>
  133. +#include <miiphy.h>
  134. +#include <netdev.h>
  135. +#include <errno.h>
  136. +
  137. +#define GPIO_PHY_RESET MX28_PAD_SSP0_DATA7__GPIO_2_7
  138. +#define GPIO_LED_GREEN MX28_PAD_AUART1_TX__GPIO_3_5
  139. +#define GPIO_LED_RED MX28_PAD_AUART1_RX__GPIO_3_4
  140. +
  141. +DECLARE_GLOBAL_DATA_PTR;
  142. +
  143. +/*
  144. + * Functions
  145. + */
  146. +int board_early_init_f(void)
  147. +{
  148. + /* IO0 clock at 480MHz */
  149. + mxs_set_ioclk(MXC_IOCLK0, 480000);
  150. + /* IO1 clock at 480MHz */
  151. + mxs_set_ioclk(MXC_IOCLK1, 480000);
  152. +
  153. + /* SSP0 clock at 96MHz */
  154. + mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
  155. +
  156. + return 0;
  157. +}
  158. +
  159. +int dram_init(void)
  160. +{
  161. + return mxs_dram_init();
  162. +}
  163. +
  164. +int board_init(void)
  165. +{
  166. + /* Adress of boot parameters */
  167. + gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  168. +
  169. + return 0;
  170. +}
  171. +
  172. +#ifdef CONFIG_CMD_MMC
  173. +int board_mmc_init(bd_t *bis)
  174. +{
  175. + return mxsmmc_initialize(bis, 0, NULL, NULL);
  176. +}
  177. +#endif
  178. +
  179. +#ifdef CONFIG_CMD_NET
  180. +int board_eth_init(bd_t *bis)
  181. +{
  182. + int ret;
  183. +
  184. + ret = cpu_eth_init(bis);
  185. +
  186. + /* Reset PHY */
  187. + gpio_direction_output(GPIO_PHY_RESET, 0);
  188. + udelay(200);
  189. + gpio_set_value(GPIO_PHY_RESET, 1);
  190. +
  191. + /* give PHY some time to get out of the reset */
  192. + udelay(10000);
  193. +
  194. + ret = fecmxc_initialize(bis);
  195. + if (ret) {
  196. + puts("FEC MXS: Unable to init FEC\n");
  197. + return ret;
  198. + }
  199. +
  200. + return ret;
  201. +}
  202. +
  203. +void mx28_adjust_mac(int dev_id, unsigned char *mac)
  204. +{
  205. + mac[0] = 0x00;
  206. + mac[1] = 0x01;
  207. +
  208. + if (dev_id == 1) /* Let MAC1 be MAC0 + 1 by default */
  209. + mac[5] += 1;
  210. +}
  211. +#endif
  212. +
  213. +int misc_init_r(void)
  214. +{
  215. + char *s = getenv("serial#");
  216. +
  217. + /* enable red LED to indicate a running bootloader */
  218. + gpio_direction_output(GPIO_LED_RED, 1);
  219. +
  220. + puts("Board: I2SE Duckbill\n");
  221. + if (s && s[0]) {
  222. + puts("Serial: ");
  223. + puts(s);
  224. + putc('\n');
  225. + }
  226. +
  227. + return 0;
  228. +}
  229. --- /dev/null
  230. +++ b/board/i2se/duckbill/iomux.c
  231. @@ -0,0 +1,125 @@
  232. +/*
  233. + * I2SE Duckbill IOMUX setup
  234. + *
  235. + * Copyright (C) 2013-2015 Michael Heimpold <mhei@heimpold.de>
  236. + *
  237. + * SPDX-License-Identifier: GPL-2.0+
  238. + */
  239. +
  240. +#include <common.h>
  241. +#include <config.h>
  242. +#include <asm/io.h>
  243. +#include <asm/arch/iomux-mx28.h>
  244. +#include <asm/arch/imx-regs.h>
  245. +#include <asm/arch/sys_proto.h>
  246. +
  247. +#define MUX_CONFIG_SSP0 (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
  248. +#define MUX_CONFIG_ENET (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
  249. +#define MUX_CONFIG_EMI (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
  250. +
  251. +const iomux_cfg_t iomux_setup[] = {
  252. + /* DUART */
  253. + MX28_PAD_PWM0__DUART_RX,
  254. + MX28_PAD_PWM1__DUART_TX,
  255. +
  256. + /* SD card */
  257. + MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0,
  258. + MX28_PAD_SSP0_DATA1__SSP0_D1 | MUX_CONFIG_SSP0,
  259. + MX28_PAD_SSP0_DATA2__SSP0_D2 | MUX_CONFIG_SSP0,
  260. + MX28_PAD_SSP0_DATA3__SSP0_D3 | MUX_CONFIG_SSP0,
  261. + MX28_PAD_SSP0_CMD__SSP0_CMD | MUX_CONFIG_SSP0,
  262. + MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
  263. + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
  264. + MX28_PAD_SSP0_SCK__SSP0_SCK |
  265. + (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
  266. +
  267. + /* Ethernet */
  268. + MX28_PAD_ENET0_MDC__ENET0_MDC | MUX_CONFIG_ENET,
  269. + MX28_PAD_ENET0_MDIO__ENET0_MDIO | MUX_CONFIG_ENET,
  270. + MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MUX_CONFIG_ENET,
  271. + MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MUX_CONFIG_ENET,
  272. + MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MUX_CONFIG_ENET,
  273. + MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MUX_CONFIG_ENET,
  274. + MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MUX_CONFIG_ENET,
  275. + MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MUX_CONFIG_ENET,
  276. + MX28_PAD_ENET_CLK__CLKCTRL_ENET | MUX_CONFIG_ENET,
  277. +
  278. + /* PHY reset */
  279. + MX28_PAD_SSP0_DATA7__GPIO_2_7 |
  280. + (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
  281. +
  282. + /* EMI */
  283. + MX28_PAD_EMI_D00__EMI_DATA0 | MUX_CONFIG_EMI,
  284. + MX28_PAD_EMI_D01__EMI_DATA1 | MUX_CONFIG_EMI,
  285. + MX28_PAD_EMI_D02__EMI_DATA2 | MUX_CONFIG_EMI,
  286. + MX28_PAD_EMI_D03__EMI_DATA3 | MUX_CONFIG_EMI,
  287. + MX28_PAD_EMI_D04__EMI_DATA4 | MUX_CONFIG_EMI,
  288. + MX28_PAD_EMI_D05__EMI_DATA5 | MUX_CONFIG_EMI,
  289. + MX28_PAD_EMI_D06__EMI_DATA6 | MUX_CONFIG_EMI,
  290. + MX28_PAD_EMI_D07__EMI_DATA7 | MUX_CONFIG_EMI,
  291. + MX28_PAD_EMI_D08__EMI_DATA8 | MUX_CONFIG_EMI,
  292. + MX28_PAD_EMI_D09__EMI_DATA9 | MUX_CONFIG_EMI,
  293. + MX28_PAD_EMI_D10__EMI_DATA10 | MUX_CONFIG_EMI,
  294. + MX28_PAD_EMI_D11__EMI_DATA11 | MUX_CONFIG_EMI,
  295. + MX28_PAD_EMI_D12__EMI_DATA12 | MUX_CONFIG_EMI,
  296. + MX28_PAD_EMI_D13__EMI_DATA13 | MUX_CONFIG_EMI,
  297. + MX28_PAD_EMI_D14__EMI_DATA14 | MUX_CONFIG_EMI,
  298. + MX28_PAD_EMI_D15__EMI_DATA15 | MUX_CONFIG_EMI,
  299. + MX28_PAD_EMI_ODT0__EMI_ODT0 | MUX_CONFIG_EMI,
  300. + MX28_PAD_EMI_DQM0__EMI_DQM0 | MUX_CONFIG_EMI,
  301. + MX28_PAD_EMI_ODT1__EMI_ODT1 | MUX_CONFIG_EMI,
  302. + MX28_PAD_EMI_DQM1__EMI_DQM1 | MUX_CONFIG_EMI,
  303. + MX28_PAD_EMI_DDR_OPEN_FB__EMI_DDR_OPEN_FEEDBACK | MUX_CONFIG_EMI,
  304. + MX28_PAD_EMI_CLK__EMI_CLK | MUX_CONFIG_EMI,
  305. + MX28_PAD_EMI_DQS0__EMI_DQS0 | MUX_CONFIG_EMI,
  306. + MX28_PAD_EMI_DQS1__EMI_DQS1 | MUX_CONFIG_EMI,
  307. + MX28_PAD_EMI_DDR_OPEN__EMI_DDR_OPEN | MUX_CONFIG_EMI,
  308. +
  309. + MX28_PAD_EMI_A00__EMI_ADDR0 | MUX_CONFIG_EMI,
  310. + MX28_PAD_EMI_A01__EMI_ADDR1 | MUX_CONFIG_EMI,
  311. + MX28_PAD_EMI_A02__EMI_ADDR2 | MUX_CONFIG_EMI,
  312. + MX28_PAD_EMI_A03__EMI_ADDR3 | MUX_CONFIG_EMI,
  313. + MX28_PAD_EMI_A04__EMI_ADDR4 | MUX_CONFIG_EMI,
  314. + MX28_PAD_EMI_A05__EMI_ADDR5 | MUX_CONFIG_EMI,
  315. + MX28_PAD_EMI_A06__EMI_ADDR6 | MUX_CONFIG_EMI,
  316. + MX28_PAD_EMI_A07__EMI_ADDR7 | MUX_CONFIG_EMI,
  317. + MX28_PAD_EMI_A08__EMI_ADDR8 | MUX_CONFIG_EMI,
  318. + MX28_PAD_EMI_A09__EMI_ADDR9 | MUX_CONFIG_EMI,
  319. + MX28_PAD_EMI_A10__EMI_ADDR10 | MUX_CONFIG_EMI,
  320. + MX28_PAD_EMI_A11__EMI_ADDR11 | MUX_CONFIG_EMI,
  321. + MX28_PAD_EMI_A12__EMI_ADDR12 | MUX_CONFIG_EMI,
  322. + MX28_PAD_EMI_A13__EMI_ADDR13 | MUX_CONFIG_EMI,
  323. + MX28_PAD_EMI_A14__EMI_ADDR14 | MUX_CONFIG_EMI,
  324. + MX28_PAD_EMI_BA0__EMI_BA0 | MUX_CONFIG_EMI,
  325. + MX28_PAD_EMI_BA1__EMI_BA1 | MUX_CONFIG_EMI,
  326. + MX28_PAD_EMI_BA2__EMI_BA2 | MUX_CONFIG_EMI,
  327. + MX28_PAD_EMI_CASN__EMI_CASN | MUX_CONFIG_EMI,
  328. + MX28_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI,
  329. + MX28_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI,
  330. + MX28_PAD_EMI_CE0N__EMI_CE0N | MUX_CONFIG_EMI,
  331. + MX28_PAD_EMI_CE1N__EMI_CE1N | MUX_CONFIG_EMI,
  332. + MX28_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
  333. +
  334. + /* LEDs */
  335. + MX28_PAD_AUART1_RX__GPIO_3_4,
  336. + MX28_PAD_AUART1_TX__GPIO_3_5,
  337. +};
  338. +
  339. +#define HW_DRAM_CTL29 (0x74 >> 2)
  340. +#define CS_MAP 0xf
  341. +#define COLUMN_SIZE 0x2
  342. +#define ADDR_PINS 0x1
  343. +#define APREBIT 0xa
  344. +
  345. +#define HW_DRAM_CTL29_CONFIG (CS_MAP << 24 | COLUMN_SIZE << 16 | \
  346. + ADDR_PINS << 8 | APREBIT)
  347. +
  348. +void mxs_adjust_memory_params(uint32_t *dram_vals)
  349. +{
  350. + dram_vals[HW_DRAM_CTL29] = HW_DRAM_CTL29_CONFIG;
  351. +}
  352. +
  353. +void board_init_ll(const uint32_t arg, const uint32_t *resptr)
  354. +{
  355. + mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
  356. +}
  357. --- /dev/null
  358. +++ b/configs/duckbill_defconfig
  359. @@ -0,0 +1,9 @@
  360. +CONFIG_ARM=y
  361. +CONFIG_TARGET_DUCKBILL=y
  362. +CONFIG_SPL=y
  363. +CONFIG_SYS_EXTRA_OPTIONS="ENV_IS_IN_MMC"
  364. +# CONFIG_CMD_IMLS is not set
  365. +# CONFIG_CMD_FLASH is not set
  366. +# CONFIG_SPI_FLASH is not set
  367. +# CONFIG_CMD_FPGA is not set
  368. +CONFIG_CMD_PING=y
  369. --- /dev/null
  370. +++ b/include/configs/duckbill.h
  371. @@ -0,0 +1,177 @@
  372. +/*
  373. + * Copyright (C) 2014-2015 Michael Heimpold <mhei@heimpold.de>
  374. + *
  375. + * SPDX-License-Identifier: GPL-2.0+
  376. + */
  377. +#ifndef __CONFIGS_DUCKBILL_H__
  378. +#define __CONFIGS_DUCKBILL_H__
  379. +
  380. +/* System configurations */
  381. +#define CONFIG_MX28 /* i.MX28 SoC */
  382. +#define CONFIG_MACH_TYPE MACH_TYPE_DUCKBILL
  383. +
  384. +#define CONFIG_MISC_INIT_R
  385. +
  386. +#define CONFIG_SYS_MXS_VDD5V_ONLY
  387. +
  388. +/* U-Boot Commands */
  389. +#define CONFIG_SYS_NO_FLASH
  390. +#define CONFIG_DISPLAY_CPUINFO
  391. +#define CONFIG_DOS_PARTITION
  392. +
  393. +#define CONFIG_CMD_BOOTZ
  394. +#define CONFIG_CMD_CACHE
  395. +#define CONFIG_CMD_DHCP
  396. +#define CONFIG_CMD_EXT4
  397. +#define CONFIG_CMD_EXT4_WRITE
  398. +#define CONFIG_CMD_FAT
  399. +#define CONFIG_CMD_FUSE
  400. +#define CONFIG_CMD_GPIO
  401. +#define CONFIG_CMD_I2C
  402. +#define CONFIG_CMD_MII
  403. +#define CONFIG_CMD_MMC
  404. +#define CONFIG_CMD_SPI
  405. +#define CONFIG_CMD_UNZIP
  406. +
  407. +/* Memory configuration */
  408. +#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
  409. +#define PHYS_SDRAM_1 0x40000000 /* Base address */
  410. +#define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
  411. +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  412. +
  413. +/* Environment is in MMC */
  414. +#define CONFIG_ENV_OVERWRITE
  415. +#define CONFIG_ENV_IS_IN_MMC 1
  416. +#define CONFIG_ENV_SIZE (128 * 1024)
  417. +#define CONFIG_ENV_OFFSET (128 * 1024)
  418. +#define CONFIG_ENV_OFFSET_REDUND (256 * 1024)
  419. +#define CONFIG_SYS_MMC_ENV_DEV 0
  420. +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  421. +
  422. +/* FEC Ethernet on SoC */
  423. +#ifdef CONFIG_CMD_NET
  424. +#define CONFIG_FEC_MXC
  425. +#define CONFIG_NET_MULTI
  426. +#define CONFIG_MX28_FEC_MAC_IN_OCOTP
  427. +#define CONFIG_FEC_MXC_PHYADDR 1
  428. +#define IMX_FEC_BASE MXS_ENET0_BASE
  429. +#endif
  430. +
  431. +#define CONFIG_IPADDR 192.168.1.10
  432. +#define CONFIG_SERVERIP 192.168.1.1
  433. +#define CONFIG_NETMASK 255.255.255.0
  434. +#define CONFIG_GATEWAYIP 192.168.1.254
  435. +
  436. +/* BOOTP options */
  437. +#define CONFIG_BOOTP_SUBNETMASK
  438. +#define CONFIG_BOOTP_GATEWAY
  439. +#define CONFIG_BOOTP_HOSTNAME
  440. +
  441. +/* SPI */
  442. +#ifdef CONFIG_CMD_SPI
  443. +#define CONFIG_DEFAULT_SPI_BUS 2
  444. +#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
  445. +#endif
  446. +
  447. +/* Boot Linux */
  448. +#define CONFIG_BOOTDELAY 1
  449. +#define CONFIG_BOOTFILE "zImage"
  450. +#define CONFIG_LOADADDR 0x42000000
  451. +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  452. +
  453. +/* Extra Environment */
  454. +#define CONFIG_EXTRA_ENV_SETTINGS \
  455. + "update_sd_firmware_filename=openwrt-mxs-root.ext4\0" \
  456. + "update_sd_firmware=" \
  457. + "if mmc rescan; then " \
  458. + "if tftp ${update_sd_firmware_filename}; then " \
  459. + "setexpr fw_sz ${filesize} / 200; " \
  460. + "setexpr fw_sz ${fw_sz} + 1; " \
  461. + "mmc dev ${mmcdev} 3; " \
  462. + "mmc write ${loadaddr} 0 ${fw_sz}; " \
  463. + "mmc dev ${mmcdev} 2; " \
  464. + "mmc write ${loadaddr} 0 ${fw_sz}; " \
  465. + "mmc dev ${mmcdev}; " \
  466. + "fi; " \
  467. + "fi\0" \
  468. + "erase_mmc=mmc erase 0 2\0" \
  469. + "erase_env1=mmc erase 100 100\0" \
  470. + "erase_env2=mmc erase 200 100\0" \
  471. + "script=boot.scr\0" \
  472. + "image=zImage\0" \
  473. + "console=ttyAMA0\0" \
  474. + "fdt_file=imx28-duckbill.dtb\0" \
  475. + "fdt_addr=0x41000000\0" \
  476. + "boot_fdt=try\0" \
  477. + "ip_dyn=yes\0" \
  478. + "bootsys=1\0" \
  479. + "mmcdev=0\0" \
  480. + "mmcpart=2\0" \
  481. + "mmcroot=/dev/mmcblk0p2\0" \
  482. + "mmcargs=setenv bootargs console=${console},${baudrate} " \
  483. + "root=${mmcroot} " \
  484. + "rootwait bootsys=${bootsys} panic=1\0" \
  485. + "loadbootscript=" \
  486. + "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  487. + "bootscript=echo Running bootscript from mmc ...; " \
  488. + "source\0" \
  489. + "loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${image}\0" \
  490. + "loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/${fdt_file}\0" \
  491. + "mmcboot=echo Booting from mmc ...; " \
  492. + "setexpr mmcpart 1 + ${bootsys}; " \
  493. + "setenv mmcroot /dev/mmcblk0p${mmcpart}; " \
  494. + "run mmcargs; " \
  495. + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  496. + "if run loadfdt; then " \
  497. + "bootz ${loadaddr} - ${fdt_addr}; " \
  498. + "else " \
  499. + "if test ${boot_fdt} = try; then " \
  500. + "bootz; " \
  501. + "else " \
  502. + "echo WARN: Cannot load the DT; " \
  503. + "fi; " \
  504. + "fi; " \
  505. + "else " \
  506. + "bootz; " \
  507. + "fi;\0" \
  508. + "netargs=setenv bootargs console=${console},${baudrate} " \
  509. + "root=/dev/nfs " \
  510. + "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
  511. + "netboot=echo Booting from net ...; " \
  512. + "run netargs; " \
  513. + "if test ${ip_dyn} = yes; then " \
  514. + "setenv get_cmd dhcp; " \
  515. + "else " \
  516. + "setenv get_cmd tftp; " \
  517. + "fi; " \
  518. + "${get_cmd} ${image}; " \
  519. + "if test ${boot_fdt} = yes; then " \
  520. + "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
  521. + "bootz ${loadaddr} - ${fdt_addr}; " \
  522. + "else " \
  523. + "if test ${boot_fdt} = try; then " \
  524. + "bootz; " \
  525. + "else " \
  526. + "echo WARN: Cannot load the DT; " \
  527. + "fi;" \
  528. + "fi; " \
  529. + "else " \
  530. + "bootz; " \
  531. + "fi;\0"
  532. +
  533. +#define CONFIG_BOOTCOMMAND \
  534. + "mmc dev ${mmcdev}; if mmc rescan; then " \
  535. + "if run loadbootscript; then " \
  536. + "run bootscript; " \
  537. + "else " \
  538. + "if run loadimage; then " \
  539. + "run mmcboot; " \
  540. + "else run netboot; " \
  541. + "fi; " \
  542. + "fi; " \
  543. + "else run netboot; fi"
  544. +
  545. +/* The rest of the configuration is shared */
  546. +#include <configs/mxs.h>
  547. +
  548. +#endif /* __CONFIGS_DUCKBILL_H__ */