001-add-i2se-duckbill.patch 16 KB

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