0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. From 1457e5e6623dd33c4d20341afc270f7ae75847ea Mon Sep 17 00:00:00 2001
  2. From: Robert Nelson <robertcnelson@gmail.com>
  3. Date: Tue, 14 Mar 2017 09:35:43 -0500
  4. Subject: [PATCH 1/3] am335x_evm: uEnv.txt, bootz, n fixes
  5. Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
  6. ---
  7. board/ti/am335x/board.c | 43 +++++-
  8. board/ti/am335x/board.h | 20 +++
  9. board/ti/am335x/mux.c | 9 +-
  10. configs/am335x_boneblack_defconfig | 3 +-
  11. configs/am335x_evm_defconfig | 27 ++--
  12. include/configs/am335x_evm.h | 59 ++++++--
  13. include/configs/ti_armv7_common.h | 276 +++++++++++++++++++++++++++++++++++--
  14. 7 files changed, 397 insertions(+), 40 deletions(-)
  15. diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
  16. index 8eaf3e9a5c..cde6c3ba32 100644
  17. --- a/board/ti/am335x/board.c
  18. +++ b/board/ti/am335x/board.c
  19. @@ -556,6 +556,24 @@ static struct clk_synth cdce913_data = {
  20. */
  21. int board_init(void)
  22. {
  23. + u32 sys_reboot;
  24. +
  25. + sys_reboot = readl(PRM_RSTST);
  26. + if (sys_reboot & (1 << 9))
  27. + puts("Reset Source: IcePick reset has occurred.\n");
  28. +
  29. + if (sys_reboot & (1 << 5))
  30. + puts("Reset Source: Global external warm reset has occurred.\n");
  31. +
  32. + if (sys_reboot & (1 << 4))
  33. + puts("Reset Source: watchdog reset has occurred.\n");
  34. +
  35. + if (sys_reboot & (1 << 1))
  36. + puts("Reset Source: Global warm SW reset has occurred.\n");
  37. +
  38. + if (sys_reboot & (1 << 0))
  39. + puts("Reset Source: Power-on reset has occurred.\n");
  40. +
  41. #if defined(CONFIG_HW_WATCHDOG)
  42. hw_watchdog_init();
  43. #endif
  44. @@ -651,8 +669,26 @@ int board_late_init(void)
  45. #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  46. char *name = NULL;
  47. + if (board_is_bone_lt()) {
  48. + puts("Board: BeagleBone Black\n");
  49. + name = "A335BNLT";
  50. + if (!strncmp(board_ti_get_rev(), "BW", 2)) {
  51. + puts("Model: BeagleBone Black Wireless\n");
  52. + name = "BBBW";
  53. + }
  54. + if (!strncmp(board_ti_get_rev(), "BLA", 3)) {
  55. + puts("Model: BeagleBone Blue\n");
  56. + name = "BBBL";
  57. + }
  58. + if (!strncmp(board_ti_get_rev(), "SE", 2)) {
  59. + puts("Model: SanCloud BeagleBone Enhanced\n");
  60. + name = "SBBE";
  61. + }
  62. + }
  63. +
  64. if (board_is_bbg1())
  65. name = "BBG1";
  66. +
  67. set_board_info_env(name);
  68. /*
  69. @@ -788,18 +824,21 @@ int board_eth_init(bd_t *bis)
  70. (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
  71. #ifdef CONFIG_DRIVER_TI_CPSW
  72. - if (board_is_bone() || board_is_bone_lt() ||
  73. + if (board_is_bone() || (board_is_bone_lt() && !board_is_bone_lt_enhanced() && !board_is_m10a()) ||
  74. board_is_idk()) {
  75. + puts("eth0: MII MODE\n");
  76. writel(MII_MODE_ENABLE, &cdev->miisel);
  77. cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
  78. PHY_INTERFACE_MODE_MII;
  79. } else if (board_is_icev2()) {
  80. + puts("eth0: icev2: RGMII MODE\n");
  81. writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
  82. cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
  83. cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
  84. cpsw_slaves[0].phy_addr = 1;
  85. cpsw_slaves[1].phy_addr = 3;
  86. } else {
  87. + puts("eth0: RGMII MODE\n");
  88. writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel);
  89. cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
  90. PHY_INTERFACE_MODE_RGMII;
  91. @@ -824,7 +863,7 @@ int board_eth_init(bd_t *bis)
  92. #define AR8051_DEBUG_RGMII_CLK_DLY_REG 0x5
  93. #define AR8051_RGMII_TX_CLK_DLY 0x100
  94. - if (board_is_evm_sk() || board_is_gp_evm()) {
  95. + if (board_is_evm_sk() || board_is_gp_evm() || board_is_bone_lt_enhanced() || board_is_m10a()) {
  96. const char *devname;
  97. devname = miiphy_get_current_dev();
  98. diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h
  99. index 48c139a817..fdf8c56258 100644
  100. --- a/board/ti/am335x/board.h
  101. +++ b/board/ti/am335x/board.h
  102. @@ -34,11 +34,31 @@ static inline int board_is_bone_lt(void)
  103. return board_ti_is("A335BNLT");
  104. }
  105. +static inline int board_is_bbbw(void)
  106. +{
  107. + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BW", 2);
  108. +}
  109. +
  110. +static inline int board_is_blue(void)
  111. +{
  112. + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BLA", 3);
  113. +}
  114. +
  115. static inline int board_is_bbg1(void)
  116. {
  117. return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
  118. }
  119. +static inline int board_is_bone_lt_enhanced(void)
  120. +{
  121. + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "SE", 2);
  122. +}
  123. +
  124. +static inline int board_is_m10a(void)
  125. +{
  126. + return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "M10A", 4);
  127. +}
  128. +
  129. static inline int board_is_evm_sk(void)
  130. {
  131. return board_ti_is("A335X_SK");
  132. diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
  133. index ad85b3a19a..6d65e99a1a 100644
  134. --- a/board/ti/am335x/mux.c
  135. +++ b/board/ti/am335x/mux.c
  136. @@ -381,7 +381,14 @@ void enable_board_pin_mux(void)
  137. configure_module_pin_mux(mmc0_pin_mux_sk_evm);
  138. } else if (board_is_bone_lt()) {
  139. /* Beaglebone LT pinmux */
  140. - configure_module_pin_mux(mii1_pin_mux);
  141. + if(board_is_bone_lt_enhanced() || board_is_m10a()) {
  142. + /* SanCloud Beaglebone LT Enhanced pinmux */
  143. + configure_module_pin_mux(rgmii1_pin_mux);
  144. + }
  145. + else {
  146. + /* Beaglebone LT pinmux */
  147. + configure_module_pin_mux(mii1_pin_mux);
  148. + }
  149. configure_module_pin_mux(mmc0_pin_mux);
  150. #if defined(CONFIG_NAND) && defined(CONFIG_EMMC_BOOT)
  151. configure_module_pin_mux(nand_pin_mux);
  152. diff --git a/configs/am335x_boneblack_defconfig b/configs/am335x_boneblack_defconfig
  153. index d0e1bcc8a3..ca1c746054 100644
  154. --- a/configs/am335x_boneblack_defconfig
  155. +++ b/configs/am335x_boneblack_defconfig
  156. @@ -5,7 +5,6 @@ CONFIG_TARGET_AM335X_EVM=y
  157. CONFIG_SPL_STACK_R_ADDR=0x82000000
  158. CONFIG_DISTRO_DEFAULTS=y
  159. CONFIG_FIT=y
  160. -CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
  161. CONFIG_SYS_CONSOLE_INFO_QUIET=y
  162. CONFIG_VERSION_VARIABLE=y
  163. CONFIG_ARCH_MISC_INIT=y
  164. @@ -47,3 +46,5 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
  165. CONFIG_G_DNL_VENDOR_NUM=0x0451
  166. CONFIG_G_DNL_PRODUCT_NUM=0xd022
  167. CONFIG_OF_LIBFDT=y
  168. +CONFIG_OF_LIBFDT_OVERLAY=y
  169. +CONFIG_PHY_MSCC=y
  170. diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
  171. index ab7b9aa6aa..6fcfa5216f 100644
  172. --- a/configs/am335x_evm_defconfig
  173. +++ b/configs/am335x_evm_defconfig
  174. @@ -1,20 +1,21 @@
  175. CONFIG_ARM=y
  176. CONFIG_AM33XX=y
  177. +# CONFIG_SPL_NAND_SUPPORT is not set
  178. CONFIG_TARGET_AM335X_EVM=y
  179. CONFIG_SPL_STACK_R_ADDR=0x82000000
  180. -CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
  181. CONFIG_DISTRO_DEFAULTS=y
  182. CONFIG_FIT=y
  183. -CONFIG_SPL_LOAD_FIT=y
  184. -CONFIG_SYS_EXTRA_OPTIONS="NAND"
  185. CONFIG_SYS_CONSOLE_INFO_QUIET=y
  186. CONFIG_VERSION_VARIABLE=y
  187. CONFIG_ARCH_MISC_INIT=y
  188. CONFIG_SPL=y
  189. CONFIG_SPL_STACK_R=y
  190. -CONFIG_SPL_MTD_SUPPORT=y
  191. CONFIG_SPL_MUSB_NEW_SUPPORT=y
  192. CONFIG_SPL_OS_BOOT=y
  193. +CONFIG_AUTOBOOT_KEYED=y
  194. +CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
  195. +CONFIG_AUTOBOOT_DELAY_STR="d"
  196. +CONFIG_AUTOBOOT_STOP_STR=" "
  197. # CONFIG_CMD_IMLS is not set
  198. CONFIG_CMD_ASKENV=y
  199. # CONFIG_CMD_FLASH is not set
  200. @@ -24,37 +25,27 @@ CONFIG_CMD_SF=y
  201. CONFIG_CMD_SPI=y
  202. CONFIG_CMD_I2C=y
  203. CONFIG_CMD_USB=y
  204. +CONFIG_CMD_USB_MASS_STORAGE=y
  205. CONFIG_CMD_DFU=y
  206. CONFIG_CMD_GPIO=y
  207. # CONFIG_CMD_SETEXPR is not set
  208. CONFIG_CMD_EXT4_WRITE=y
  209. -CONFIG_OF_CONTROL=y
  210. -CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2"
  211. # CONFIG_BLK is not set
  212. CONFIG_DFU_MMC=y
  213. -CONFIG_DFU_NAND=y
  214. CONFIG_DFU_RAM=y
  215. -CONFIG_DM_I2C=y
  216. -CONFIG_MISC=y
  217. -CONFIG_DM_MMC=y
  218. -# CONFIG_DM_MMC_OPS is not set
  219. CONFIG_MMC_OMAP_HS=y
  220. CONFIG_SPI_FLASH=y
  221. CONFIG_SPI_FLASH_WINBOND=y
  222. -CONFIG_DM_ETH=y
  223. CONFIG_SYS_NS16550=y
  224. -CONFIG_TIMER=y
  225. -CONFIG_OMAP_TIMER=y
  226. CONFIG_USB=y
  227. -CONFIG_DM_USB=y
  228. CONFIG_USB_MUSB_HOST=y
  229. CONFIG_USB_MUSB_GADGET=y
  230. -CONFIG_USB_MUSB_TI=y
  231. CONFIG_USB_STORAGE=y
  232. CONFIG_USB_GADGET=y
  233. CONFIG_USB_GADGET_DOWNLOAD=y
  234. CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
  235. CONFIG_G_DNL_VENDOR_NUM=0x0451
  236. CONFIG_G_DNL_PRODUCT_NUM=0xd022
  237. -CONFIG_RSA=y
  238. -CONFIG_SPL_OF_LIBFDT=y
  239. +CONFIG_OF_LIBFDT=y
  240. +CONFIG_OF_LIBFDT_OVERLAY=y
  241. +CONFIG_PHY_MSCC=y
  242. diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
  243. index 27126871f7..399b25f47a 100644
  244. --- a/include/configs/am335x_evm.h
  245. +++ b/include/configs/am335x_evm.h
  246. @@ -18,6 +18,7 @@
  247. #include <configs/ti_am335x_common.h>
  248. #include <environment/ti/dfu.h>
  249. +#define CONFIG_ENV_IS_NOWHERE
  250. #ifndef CONFIG_SPL_BUILD
  251. # define CONFIG_TIMESTAMP
  252. @@ -61,9 +62,14 @@
  253. #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
  254. "bootcmd_" #devtypel #instance "=" \
  255. + "gpio clear 56; " \
  256. + "gpio clear 55; " \
  257. + "gpio clear 54; " \
  258. + "gpio set 53; " \
  259. + "setenv devtype mmc; " \
  260. "setenv mmcdev " #instance"; "\
  261. - "setenv bootpart " #instance":2 ; "\
  262. - "run mmcboot\0"
  263. + "setenv bootpart " #instance":1 ; "\
  264. + "run boot\0"
  265. #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
  266. #devtypel #instance " "
  267. @@ -80,7 +86,6 @@
  268. func(LEGACY_MMC, legacy_mmc, 0) \
  269. func(MMC, mmc, 1) \
  270. func(LEGACY_MMC, legacy_mmc, 1) \
  271. - func(NAND, nand, 0) \
  272. func(PXE, pxe, na) \
  273. func(DHCP, dhcp, na)
  274. @@ -134,12 +139,41 @@
  275. "run ramargs; " \
  276. "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
  277. "findfdt="\
  278. + "echo board_name=[$board_name] ...; " \
  279. "if test $board_name = A335BONE; then " \
  280. - "setenv fdtfile am335x-bone.dtb; fi; " \
  281. + "setenv fdtfile am335x-bone.dtb; setenv fdtbase am335x-bone; fi; " \
  282. "if test $board_name = A335BNLT; then " \
  283. - "setenv fdtfile am335x-boneblack.dtb; fi; " \
  284. + "echo board_rev=[$board_rev] ...; " \
  285. + "if test $board_rev = GH01; then " \
  286. + "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; " \
  287. + "elif test $board_rev = BBG1; then " \
  288. + "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; " \
  289. + "elif test $board_rev = BP00; then " \
  290. + "setenv fdtfile am335x-pocketbone.dtb; setenv fdtbase am335x-pocketbone; " \
  291. + "elif test $board_rev = GW1A; then " \
  292. + "setenv fdtfile am335x-bonegreen-wireless.dtb; setenv fdtbase am335x-bonegreen-wireless; " \
  293. + "elif test $board_rev = AIA0; then " \
  294. + "setenv fdtfile am335x-abbbi.dtb; setenv fdtbase am335x-abbbi; " \
  295. + "elif test $board_rev = EIA0; then " \
  296. + "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; " \
  297. + "elif test $board_rev = SE0A; then " \
  298. + "setenv fdtfile am335x-sancloud-bbe.dtb; setenv fdtbase am335x-sancloud-bbe; " \
  299. + "elif test $board_rev = ME06; then " \
  300. + "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; " \
  301. + "elif test $board_rev = M10A; then " \
  302. + "setenv fdtfile am335x-vsc8531bbb.dtb; setenv fdtbase am335x-vsc8531bbb; " \
  303. + "else " \
  304. + "setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; " \
  305. + "fi; " \
  306. + "fi; " \
  307. "if test $board_name = BBG1; then " \
  308. - "setenv fdtfile am335x-bonegreen.dtb; fi; " \
  309. + "setenv fdtfile am335x-bonegreen.dtb; setenv fdtbase am335x-bonegreen; fi; " \
  310. + "if test $board_name = BBBW; then " \
  311. + "setenv fdtfile am335x-boneblack-wireless.dtb; setenv fdtbase am335x-boneblack-wireless; fi; " \
  312. + "if test $board_name = BBBL; then " \
  313. + "setenv fdtfile am335x-boneblue.dtb; setenv fdtbase am335x-boneblue; fi; " \
  314. + "if test $board_name = SBBE; then " \
  315. + "setenv fdtfile am335x-sancloud-bbe.dtb; setenv fdtbase am335x-sancloud-bbe; fi; " \
  316. "if test $board_name = A33515BB; then " \
  317. "setenv fdtfile am335x-evm.dtb; fi; " \
  318. "if test $board_name = A335X_SK; then " \
  319. @@ -147,13 +181,20 @@
  320. "if test $board_name = A335_ICE; then " \
  321. "setenv fdtfile am335x-icev2.dtb; fi; " \
  322. "if test $fdtfile = undefined; then " \
  323. - "echo WARNING: Could not determine device tree to use; fi; \0" \
  324. + "setenv board_name A335BNLT; " \
  325. + "setenv board_rev EMMC; " \
  326. + "setenv fdtbase am335x-boneblack-emmc-overlay; " \
  327. + "setenv fdtfile am335x-boneblack-emmc-overlay.dtb; " \
  328. + "fi; \0" \
  329. "init_console=" \
  330. "if test $board_name = A335_ICE; then "\
  331. "setenv console ttyO3,115200n8;" \
  332. "else " \
  333. "setenv console ttyO0,115200n8;" \
  334. "fi;\0" \
  335. + EEWIKI_NFS \
  336. + EEWIKI_BOOT \
  337. + EEWIKI_UNAME_BOOT \
  338. NANDARGS \
  339. NETARGS \
  340. DFUARGS \
  341. @@ -273,9 +314,7 @@
  342. #endif
  343. #ifdef CONFIG_USB_MUSB_GADGET
  344. -#define CONFIG_USB_ETHER
  345. -#define CONFIG_USB_ETH_RNDIS
  346. -#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
  347. +#define CONFIG_USB_FUNCTION_MASS_STORAGE
  348. #endif /* CONFIG_USB_MUSB_GADGET */
  349. /*
  350. diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
  351. index a4ec4ce00a..bb3676b57f 100644
  352. --- a/include/configs/ti_armv7_common.h
  353. +++ b/include/configs/ti_armv7_common.h
  354. @@ -54,20 +54,60 @@
  355. #define DEFAULT_MMC_TI_ARGS \
  356. "mmcdev=0\0" \
  357. "mmcrootfstype=ext4 rootwait\0" \
  358. - "finduuid=part uuid mmc ${bootpart} uuid\0" \
  359. + "finduuid=part uuid ${devtype} ${bootpart} uuid\0" \
  360. "args_mmc=run finduuid;setenv bootargs console=${console} " \
  361. + "${cape_disable} " \
  362. + "${cape_enable} " \
  363. + "${cape_uboot} " \
  364. + "root=PARTUUID=${uuid} ro " \
  365. + "rootfstype=${mmcrootfstype} " \
  366. + "${cmdline}\0" \
  367. + "args_mmc_old=setenv bootargs console=${console} " \
  368. "${optargs} " \
  369. - "root=PARTUUID=${uuid} rw " \
  370. - "rootfstype=${mmcrootfstype}\0" \
  371. - "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  372. - "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
  373. + "${cape_disable} " \
  374. + "${cape_enable} " \
  375. + "${cape_uboot} " \
  376. + "root=${oldroot} ro " \
  377. + "rootfstype=${mmcrootfstype} " \
  378. + "${cmdline}\0" \
  379. + "args_mmc_uuid=setenv bootargs console=${console} " \
  380. + "${optargs} " \
  381. + "${cape_disable} " \
  382. + "${cape_enable} " \
  383. + "${cape_uboot} " \
  384. + "root=UUID=${uuid} ro " \
  385. + "rootfstype=${mmcrootfstype} " \
  386. + "${cmdline}\0" \
  387. + "args_uenv_root=setenv bootargs console=${console} " \
  388. + "${optargs} " \
  389. + "${cape_disable} " \
  390. + "${cape_enable} " \
  391. + "${cape_uboot} " \
  392. + "root=${uenv_root} ro " \
  393. + "rootfstype=${mmcrootfstype} " \
  394. + "${cmdline}\0" \
  395. + "args_netinstall=setenv bootargs ${netinstall_bootargs} " \
  396. + "${optargs} " \
  397. + "${cape_disable} " \
  398. + "${cape_enable} " \
  399. + "${cape_uboot} " \
  400. + "root=/dev/ram rw " \
  401. + "${cmdline}\0" \
  402. + "script=boot.scr\0" \
  403. + "scriptfile=${script}\0" \
  404. + "loadbootscript=load ${devtype} ${bootpart} ${loadaddr} ${scriptfile};\0" \
  405. + "bootscript=echo Running bootscript from mmc${bootpart} ...; " \
  406. "source ${loadaddr}\0" \
  407. "bootenvfile=uEnv.txt\0" \
  408. - "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
  409. + "bootenv=uEnv.txt\0" \
  410. + "importbootenv=echo Importing environment from ${devtype} ...; " \
  411. "env import -t ${loadaddr} ${filesize}\0" \
  412. - "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \
  413. + "loadbootenv=load ${devtype} ${bootpart} ${loadaddr} ${bootenvfile}\0" \
  414. "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  415. - "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  416. + "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
  417. + "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
  418. + "failumsboot=echo; echo FAILSAFE: U-Boot UMS (USB Mass Storage) enabled, media now available over the usb slave port ...; " \
  419. + "ums 0 ${devtype} 1;\0" \
  420. "envboot=mmc dev ${mmcdev}; " \
  421. "if mmc rescan; then " \
  422. "echo SD/MMC found on device ${mmcdev};" \
  423. @@ -120,6 +160,226 @@
  424. "args_fit=setenv bootargs console=${console} \0" \
  425. "loadfit=run args_fit; bootm ${loadaddr}#${fdtfile};\0" \
  426. +#define EEWIKI_NFS \
  427. + "server_ip=192.168.1.100\0" \
  428. + "gw_ip=192.168.1.1\0" \
  429. + "netmask=255.255.255.0\0" \
  430. + "hostname=\0" \
  431. + "device=eth0\0" \
  432. + "autoconf=off\0" \
  433. + "root_dir=/home/userid/targetNFS\0" \
  434. + "tftp_dir=\0" \
  435. + "nfs_options=,vers=3\0" \
  436. + "nfsrootfstype=ext4 rootwait fixrtc\0" \
  437. + "nfsargs=setenv bootargs console=${console} " \
  438. + "${optargs} " \
  439. + "${cape_disable} " \
  440. + "${cape_enable} " \
  441. + "${cape_uboot} " \
  442. + "root=/dev/nfs rw " \
  443. + "rootfstype=${nfsrootfstype} " \
  444. + "nfsroot=${nfsroot} " \
  445. + "ip=${ip} " \
  446. + "${cmdline}\0" \
  447. + "nfsboot=echo Booting from ${server_ip} ...; " \
  448. + "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
  449. + "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}:${device}:${autoconf}; " \
  450. + "setenv autoload no; " \
  451. + "setenv serverip ${server_ip}; " \
  452. + "setenv ipaddr ${client_ip}; " \
  453. + "tftp ${loadaddr} ${tftp_dir}${bootfile}; " \
  454. + "tftp ${fdtaddr} ${tftp_dir}dtbs/${fdtfile}; " \
  455. + "run nfsargs; " \
  456. + "bootz ${loadaddr} - ${fdtaddr}\0" \
  457. + "nfsboot_uname_r=echo Booting from ${server_ip} ...; " \
  458. + "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
  459. + "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}:${device}:${autoconf}; " \
  460. + "setenv autoload no; " \
  461. + "setenv serverip ${server_ip}; " \
  462. + "setenv ipaddr ${client_ip}; " \
  463. + "tftp ${loadaddr} ${tftp_dir}vmlinuz-${uname_r}; " \
  464. + "tftp ${fdtaddr} ${tftp_dir}dtbs/${uname_r}/${fdtfile}; " \
  465. + "run nfsargs; " \
  466. + "bootz ${loadaddr} - ${fdtaddr}\0" \
  467. +
  468. +#define EEWIKI_BOOT \
  469. + "boot=${devtype} dev ${mmcdev}; " \
  470. + "if ${devtype} rescan; then " \
  471. + "gpio set 54;" \
  472. + "setenv bootpart ${mmcdev}:1; " \
  473. + "if test -e ${devtype} ${bootpart} /etc/fstab; then " \
  474. + "setenv mmcpart 1;" \
  475. + "fi; " \
  476. + "echo Checking for: /uEnv.txt ...;" \
  477. + "if test -e ${devtype} ${bootpart} /uEnv.txt; then " \
  478. + "if run loadbootenv; then " \
  479. + "gpio set 55;" \
  480. + "echo Loaded environment from /uEnv.txt;" \
  481. + "run importbootenv;" \
  482. + "fi;" \
  483. + "if test -n ${cape}; then " \
  484. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtbase}-${cape}.dtb; then " \
  485. + "setenv fdtfile ${fdtbase}-${cape}.dtb; " \
  486. + "fi; " \
  487. + "echo using: $fdtfile...; " \
  488. + "fi; " \
  489. + "echo Checking if uenvcmd is set ...;" \
  490. + "if test -n ${uenvcmd}; then " \
  491. + "gpio set 56; " \
  492. + "echo Running uenvcmd ...;" \
  493. + "run uenvcmd;" \
  494. + "fi;" \
  495. + "echo Checking if client_ip is set ...;" \
  496. + "if test -n ${client_ip}; then " \
  497. + "if test -n ${dtb}; then " \
  498. + "setenv fdtfile ${dtb};" \
  499. + "echo using ${fdtfile} ...;" \
  500. + "fi;" \
  501. + "gpio set 56; " \
  502. + "if test -n ${uname_r}; then " \
  503. + "echo Running nfsboot_uname_r ...;" \
  504. + "run nfsboot_uname_r;" \
  505. + "fi;" \
  506. + "echo Running nfsboot ...;" \
  507. + "run nfsboot;" \
  508. + "fi;" \
  509. + "fi; " \
  510. + "echo Checking for: /${script} ...;" \
  511. + "if test -e ${devtype} ${bootpart} /${script}; then " \
  512. + "gpio set 55;" \
  513. + "setenv scriptfile ${script};" \
  514. + "run loadbootscript;" \
  515. + "echo Loaded script from ${scriptfile};" \
  516. + "gpio set 56; " \
  517. + "run bootscript;" \
  518. + "fi; " \
  519. + "echo Checking for: /boot/${script} ...;" \
  520. + "if test -e ${devtype} ${bootpart} /boot/${script}; then " \
  521. + "gpio set 55;" \
  522. + "setenv scriptfile /boot/${script};" \
  523. + "run loadbootscript;" \
  524. + "echo Loaded script from ${scriptfile};" \
  525. + "gpio set 56; " \
  526. + "run bootscript;" \
  527. + "fi; " \
  528. + "echo Checking for: /boot/uEnv.txt ...;" \
  529. + "for i in 1 2 3 4 5 6 7 ; do " \
  530. + "setenv mmcpart ${i};" \
  531. + "setenv bootpart ${mmcdev}:${mmcpart};" \
  532. + "if test -e ${devtype} ${bootpart} /boot/uEnv.txt; then " \
  533. + "gpio set 55;" \
  534. + "load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt;" \
  535. + "env import -t ${loadaddr} ${filesize};" \
  536. + "echo Loaded environment from /boot/uEnv.txt;" \
  537. + "if test -n ${cape}; then " \
  538. + "echo debug: [cape=${cape}] ... ;" \
  539. + "setenv fdtfile ${fdtbase}-${cape}.dtb; " \
  540. + "echo Using: dtb=${fdtfile} ...;" \
  541. + "fi; " \
  542. + "if test -n ${dtb}; then " \
  543. + "echo debug: [dtb=${dtb}] ... ;" \
  544. + "setenv fdtfile ${dtb};" \
  545. + "echo Using: dtb=${fdtfile} ...;" \
  546. + "fi;" \
  547. + "echo Checking if uname_r is set in /boot/uEnv.txt...;" \
  548. + "if test -n ${uname_r}; then " \
  549. + "gpio set 56; " \
  550. + "setenv oldroot /dev/mmcblk${mmcdev}p${mmcpart};" \
  551. + "echo Running uname_boot ...;" \
  552. + "run uname_boot;" \
  553. + "fi;" \
  554. + "fi;" \
  555. + "done;" \
  556. + "fi;\0" \
  557. +
  558. +#define EEWIKI_UNAME_BOOT \
  559. + "uname_boot="\
  560. + "setenv bootdir /boot; " \
  561. + "setenv bootfile vmlinuz-${uname_r}; " \
  562. + "if test -e ${devtype} ${bootpart} ${bootdir}/${bootfile}; then " \
  563. + "echo loading ${bootdir}/${bootfile} ...; "\
  564. + "run loadimage;" \
  565. + "setenv fdtdir /boot/dtbs/${uname_r}; " \
  566. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  567. + "run loadfdt;" \
  568. + "else " \
  569. + "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \
  570. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  571. + "run loadfdt;" \
  572. + "else " \
  573. + "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
  574. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  575. + "run loadfdt;" \
  576. + "else " \
  577. + "setenv fdtdir /boot/dtb-${uname_r}; " \
  578. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  579. + "run loadfdt;" \
  580. + "else " \
  581. + "setenv fdtdir /boot/dtbs; " \
  582. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  583. + "run loadfdt;" \
  584. + "else " \
  585. + "setenv fdtdir /boot/dtb; " \
  586. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  587. + "run loadfdt;" \
  588. + "else " \
  589. + "setenv fdtdir /boot; " \
  590. + "if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtfile}; then " \
  591. + "run loadfdt;" \
  592. + "else " \
  593. + "if test -e ${devtype} ${bootpart} ${fdtfile}; then " \
  594. + "run loadfdt;" \
  595. + "else " \
  596. + "echo; echo unable to find [dtb=${fdtfile}] did you name it correctly? ...; " \
  597. + "run failumsboot;" \
  598. + "fi;" \
  599. + "fi;" \
  600. + "fi;" \
  601. + "fi;" \
  602. + "fi;" \
  603. + "fi;" \
  604. + "fi;" \
  605. + "fi; " \
  606. + "setenv rdfile initrd.img-${uname_r}; " \
  607. + "if test -e ${devtype} ${bootpart} ${bootdir}/${rdfile}; then " \
  608. + "echo loading ${bootdir}/${rdfile} ...; "\
  609. + "run loadrd;" \
  610. + "if test -n ${netinstall_enable}; then " \
  611. + "run args_netinstall; run message;" \
  612. + "echo debug: [${bootargs}] ... ;" \
  613. + "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
  614. + "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
  615. + "fi;" \
  616. + "if test -n ${uenv_root}; then " \
  617. + "run args_uenv_root;" \
  618. + "echo debug: [${bootargs}] ... ;" \
  619. + "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
  620. + "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
  621. + "fi;" \
  622. + "if test -n ${uuid}; then " \
  623. + "run args_mmc_uuid;" \
  624. + "echo debug: [${bootargs}] ... ;" \
  625. + "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
  626. + "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
  627. + "fi;" \
  628. + "run args_mmc_old;" \
  629. + "echo debug: [${bootargs}] ... ;" \
  630. + "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \
  631. + "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
  632. + "else " \
  633. + "if test -n ${uenv_root}; then " \
  634. + "run args_uenv_root;" \
  635. + "echo debug: [${bootargs}] ... ;" \
  636. + "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
  637. + "bootz ${loadaddr} - ${fdtaddr}; " \
  638. + "fi;" \
  639. + "run args_mmc_old;" \
  640. + "echo debug: [${bootargs}] ... ;" \
  641. + "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
  642. + "bootz ${loadaddr} - ${fdtaddr}; " \
  643. + "fi;" \
  644. + "fi;\0" \
  645. +
  646. /*
  647. * DDR information. If the CONFIG_NR_DRAM_BANKS is not defined,
  648. * we say (for simplicity) that we have 1 bank, always, even when
  649. --
  650. 2.12.1