Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. From a4a4cfc588c889873e5a31e097287abc7255e53f Mon Sep 17 00:00:00 2001
  2. From: Robert Nelson <robertcnelson@gmail.com>
  3. Date: Wed, 3 Jun 2015 14:48:45 -0500
  4. Subject: [PATCH] mx23_olinuxino: uEnv.txt, bootz, n fixes
  5. Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
  6. ---
  7. include/configs/mx23_olinuxino.h | 120 +++++++++++++++++++++++++++++++++------
  8. 1 file changed, 104 insertions(+), 16 deletions(-)
  9. diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
  10. index 65203a0..1827e2b 100644
  11. --- a/include/configs/mx23_olinuxino.h
  12. +++ b/include/configs/mx23_olinuxino.h
  13. @@ -25,6 +25,14 @@
  14. #define CONFIG_CMD_MMC
  15. #define CONFIG_CMD_USB
  16. +#define CONFIG_CMD_FAT
  17. +#define CONFIG_CMD_EXT4
  18. +#define CONFIG_CMD_FS_GENERIC
  19. +
  20. +/* bootz: zImage/initrd.img support */
  21. +#define CONFIG_CMD_BOOTZ
  22. +#define CONFIG_SUPPORT_RAW_INITRD
  23. +
  24. /* Memory configuration */
  25. #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
  26. #define PHYS_SDRAM_1 0x40000000 /* Base address */
  27. @@ -65,7 +73,7 @@
  28. #endif
  29. /* Booting Linux */
  30. -#define CONFIG_BOOTDELAY 3
  31. +#define CONFIG_BOOTDELAY 1
  32. #define CONFIG_BOOTFILE "uImage"
  33. #define CONFIG_LOADADDR 0x42000000
  34. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  35. @@ -86,20 +94,58 @@
  36. "console=ttyAMA0\0" \
  37. "fdt_file=imx23-olinuxino.dtb\0" \
  38. "fdt_addr=0x41000000\0" \
  39. + "fdtdir=\0" \
  40. + "bootfile=\0" \
  41. + "bootdir=\0" \
  42. "boot_fdt=try\0" \
  43. "ip_dyn=yes\0" \
  44. + "optargs=\0" \
  45. + "cmdline=\0" \
  46. "mmcdev=0\0" \
  47. "mmcpart=2\0" \
  48. - "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
  49. + "mmcroot=/dev/mmcblk0p2 ro\0" \
  50. + "mmcrootfstype=ext4 rootwait fixrtc\0" \
  51. "mmcargs=setenv bootargs console=${console},${baudrate} " \
  52. - "root=${mmcroot}\0" \
  53. + "${optargs} " \
  54. + "root=${mmcroot} " \
  55. + "rootfstype=${mmcrootfstype} " \
  56. + "${cmdline}\0" \
  57. + "loadbootenv=load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt\0" \
  58. + "importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
  59. + "env import -t ${loadaddr} ${filesize}\0" \
  60. "loadbootscript=" \
  61. "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  62. "bootscript=echo Running bootscript from mmc ...; " \
  63. "source\0" \
  64. - "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
  65. - "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
  66. - "mmcboot=echo Booting from mmc ...; " \
  67. + "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  68. + "loadfdt=echo loading ${fdtdir}/${fdt_file} ...; load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \
  69. + "mmcboot=mmc dev ${mmcdev}; " \
  70. + "if mmc rescan; then " \
  71. + "echo SD/MMC found on device ${mmcdev};" \
  72. + "echo Checking for: /boot/uEnv.txt ...;" \
  73. + "for i in 2 3 4 5 6 7 ; do " \
  74. + "setenv mmcpart ${i};" \
  75. + "setenv bootpart ${mmcdev}:${mmcpart};" \
  76. + "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
  77. + "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \
  78. + "env import -t ${loadaddr} ${filesize};" \
  79. + "echo Loaded environment from /boot/uEnv.txt;" \
  80. + "if test -n ${dtb}; then " \
  81. + "setenv fdt_file ${dtb};" \
  82. + "echo using ${fdt_file} ...;" \
  83. + "fi;" \
  84. + "echo Checking if uname_r is set in /boot/uEnv.txt...;" \
  85. + "if test -n ${uname_r}; then " \
  86. + "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \
  87. + "if test -n ${uuid}; then " \
  88. + "setenv mmcroot UUID=${uuid} ro;" \
  89. + "fi;" \
  90. + "run uname_boot;" \
  91. + "fi;" \
  92. + "fi;" \
  93. + "done;" \
  94. + "fi;\0" \
  95. + "mmcboot_old=echo Booting from mmc ...; " \
  96. "run mmcargs; " \
  97. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  98. "if run loadfdt; then " \
  99. @@ -138,19 +184,61 @@
  100. "fi; " \
  101. "else " \
  102. "bootm; " \
  103. + "fi;\0" \
  104. + "uname_boot="\
  105. + "setenv bootdir /boot; " \
  106. + "setenv bootfile vmlinuz-${uname_r}; " \
  107. + "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
  108. + "echo loading ${bootdir}/${bootfile} ...; "\
  109. + "run loadimage;" \
  110. + "setenv fdtdir /boot/dtbs/${uname_r}; " \
  111. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  112. + "run loadfdt;" \
  113. + "else " \
  114. + "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \
  115. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  116. + "run loadfdt;" \
  117. + "else " \
  118. + "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
  119. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  120. + "run loadfdt;" \
  121. + "else " \
  122. + "setenv fdtdir /boot/dtb-${uname_r}; " \
  123. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  124. + "run loadfdt;" \
  125. + "else " \
  126. + "setenv fdtdir /boot/dtbs; " \
  127. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  128. + "run loadfdt;" \
  129. + "else " \
  130. + "setenv fdtdir /boot/dtb; " \
  131. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  132. + "run loadfdt;" \
  133. + "else " \
  134. + "setenv fdtdir /boot; " \
  135. + "if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
  136. + "run loadfdt;" \
  137. + "else " \
  138. + "echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\
  139. + "run mmcargs;" \
  140. + "echo debug: [${bootargs}] ... ;" \
  141. + "echo debug: [bootz ${loadaddr}] ... ;" \
  142. + "bootz ${loadaddr}; " \
  143. + "fi;" \
  144. + "fi;" \
  145. + "fi;" \
  146. + "fi;" \
  147. + "fi;" \
  148. + "fi;" \
  149. + "fi; " \
  150. + "run mmcargs;" \
  151. + "echo debug: [${bootargs}] ... ;" \
  152. + "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \
  153. + "bootz ${loadaddr} - ${fdt_addr}; " \
  154. "fi;\0"
  155. #define CONFIG_BOOTCOMMAND \
  156. - "mmc dev ${mmcdev}; if mmc rescan; then " \
  157. - "if run loadbootscript; then " \
  158. - "run bootscript; " \
  159. - "else " \
  160. - "if run loaduimage; then " \
  161. - "run mmcboot; " \
  162. - "else run netboot; " \
  163. - "fi; " \
  164. - "fi; " \
  165. - "else run netboot; fi"
  166. + "run mmcboot;"
  167. /* The rest of the configuration is shared */
  168. #include <configs/mxs.h>
  169. --
  170. 2.1.4