0001-parabola-arm-modifications.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. diff -Nur u-boot-2016.01.orig/board/ti/beagle/beagle.c u-boot-2016.01/board/ti/beagle/beagle.c
  2. --- u-boot-2016.01.orig/board/ti/beagle/beagle.c 2016-01-12 11:06:54.000000000 -0300
  3. +++ u-boot-2016.01/board/ti/beagle/beagle.c 2016-02-24 19:45:05.779336247 -0300
  4. @@ -56,6 +56,7 @@
  5. #define BBTOYS_WIFI 0x01000B00
  6. #define BBTOYS_VGA 0x02000B00
  7. #define BBTOYS_LCD 0x03000B00
  8. +#define BBTOYS_ULCD 0x04000B00
  9. #define BCT_BRETTL3 0x01000F00
  10. #define BCT_BRETTL4 0x02000F00
  11. #define LSR_COM6L_ADPT 0x01001300
  12. @@ -211,25 +212,25 @@
  13. * bus 1 for the availability of an AT24C01B serial EEPROM.
  14. * returns the device_vendor field from the EEPROM
  15. */
  16. -static unsigned int get_expansion_id(void)
  17. +static unsigned int get_expansion_id(int eeprom_address)
  18. {
  19. i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
  20. /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
  21. - if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
  22. + if (i2c_probe(eeprom_address) == 1) {
  23. i2c_set_bus_num(TWL4030_I2C_BUS);
  24. return BEAGLE_NO_EEPROM;
  25. }
  26. /* read configuration data */
  27. - i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
  28. + i2c_read(eeprom_address, 0, 1, (u8 *)&expansion_config,
  29. sizeof(expansion_config));
  30. /* retry reading configuration data with 16bit addressing */
  31. if ((expansion_config.device_vendor == 0xFFFFFF00) ||
  32. (expansion_config.device_vendor == 0xFFFFFFFF)) {
  33. printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
  34. - i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
  35. + i2c_read(eeprom_address, 0, 2, (u8 *)&expansion_config,
  36. sizeof(expansion_config));
  37. }
  38. @@ -341,15 +342,18 @@
  39. case REVISION_AXBX:
  40. printf("Beagle Rev Ax/Bx\n");
  41. setenv("beaglerev", "AxBx");
  42. + setenv("musb", "musb_hdrc.fifo_mode=5");
  43. break;
  44. case REVISION_CX:
  45. printf("Beagle Rev C1/C2/C3\n");
  46. setenv("beaglerev", "Cx");
  47. + setenv("musb", "musb_hdrc.fifo_mode=5");
  48. MUX_BEAGLE_C();
  49. break;
  50. case REVISION_C4:
  51. printf("Beagle Rev C4\n");
  52. setenv("beaglerev", "C4");
  53. + setenv("musb", "musb_hdrc.fifo_mode=5");
  54. MUX_BEAGLE_C();
  55. /* Set VAUX2 to 1.8V for EHCI PHY */
  56. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  57. @@ -390,7 +394,7 @@
  58. generate_fake_mac = true;
  59. }
  60. - switch (get_expansion_id()) {
  61. + switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS)) {
  62. case TINCANTOOLS_ZIPPY:
  63. printf("Recognized Tincantools Zippy board (rev %d %s)\n",
  64. expansion_config.revision,
  65. @@ -471,6 +475,30 @@
  66. }
  67. if (expansion_config.content == 1)
  68. + setenv(expansion_config.env_var, expansion_config.env_setting);
  69. +
  70. + /* Scan 0x51 as well for loop-thru boards */
  71. + switch (get_expansion_id(EXPANSION_EEPROM_I2C_ADDRESS + 1)) {
  72. + case BBTOYS_ULCD:
  73. + printf("Recognized BeagleBoardToys uLCD-lite board\n");
  74. + setenv("buddy2", "bbtoys-ulcd");
  75. + setenv("defaultdisplay", "dvi");
  76. + setenv("dvimode", "800x480MR-16@60");
  77. + setenv("lcd1", "i2c mw 40 00 00; i2c mw 40 04 80; i2c mw 40 0d 05");
  78. + setenv("lcdcmd", "i2c dev 1 ; run lcd1; i2c dev 0");
  79. + setenv("kmsmode", "video=DVI-D-1:800x480");
  80. + break;
  81. + case BEAGLE_NO_EEPROM:
  82. + printf("No EEPROM on expansion board\n");
  83. + setenv("buddy2", "none");
  84. + break;
  85. + default:
  86. + printf("Unrecognized expansion board: %x\n",
  87. + expansion_config.device_vendor);
  88. + setenv("buddy2", "unknown");
  89. + }
  90. +
  91. + if (expansion_config.content == 1)
  92. setenv(expansion_config.env_var, expansion_config.env_setting);
  93. twl4030_power_init();
  94. diff -Nur u-boot-2016.01.orig/include/configs/omap3_beagle.h u-boot-2016.01/include/configs/omap3_beagle.h
  95. --- u-boot-2016.01.orig/include/configs/omap3_beagle.h 2016-01-12 11:06:54.000000000 -0300
  96. +++ u-boot-2016.01/include/configs/omap3_beagle.h 2016-02-24 19:50:25.959802093 -0300
  97. @@ -91,6 +91,12 @@
  98. #define CONFIG_USB_ETHER_MCS7830
  99. #define CONFIG_USB_ETHER_SMSC95XX
  100. +/* Parabola GNU/Linux-libre extras */
  101. +#define CONFIG_IDENT_STRING " Parabola GNU/Linux-libre"
  102. +#define CONFIG_SUPPORT_RAW_INITRD
  103. +#define CONFIG_CMD_PART
  104. +#define CONFIG_PARTITION_UUIDS
  105. +
  106. /* GPIO banks */
  107. #define CONFIG_OMAP3_GPIO_5 /* GPIO128..159 is in GPIO bank 5 */
  108. #define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */
  109. @@ -124,51 +130,71 @@
  110. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  111. /* devices */
  112. +/* Enable Extlinux boot support */
  113. +#define CONFIG_CMD_PXE
  114. +#define CONFIG_MENU
  115. +#define BOOT_TARGET_DEVICES(func)
  116. +#include <config_distro_bootcmd.h>
  117. +
  118. #define CONFIG_EXTRA_ENV_SETTINGS \
  119. - "loadaddr=0x80200000\0" \
  120. - "rdaddr=0x81000000\0" \
  121. + BOOTENV \
  122. + "loadaddr=0x82000000\0" \
  123. + "rdaddr=0x88080000\0" \
  124. "fdt_high=0xffffffff\0" \
  125. - "fdtaddr=0x80f80000\0" \
  126. - "usbtty=cdc_acm\0" \
  127. - "bootfile=uImage\0" \
  128. - "ramdisk=ramdisk.gz\0" \
  129. - "bootdir=/boot\0" \
  130. - "bootpart=0:2\0" \
  131. + "fdtaddr=0x88000000\0" \
  132. "console=ttyO2,115200n8\0" \
  133. - "mpurate=auto\0" \
  134. - "buddy=none\0" \
  135. - "optargs=\0" \
  136. - "camera=none\0" \
  137. - "vram=12M\0" \
  138. - "dvimode=640x480MR-16@60\0" \
  139. - "defaultdisplay=dvi\0" \
  140. + "fdtfile=undefined\0" \
  141. + "bootpart=0:1\0" \
  142. + "bootdir=\0" \
  143. + "fdtdir=/dtbs\0" \
  144. + "bootfile=zImage\0" \
  145. + "rdfile=initramfs-linux.img\0" \
  146. "mmcdev=0\0" \
  147. - "mmcroot=/dev/mmcblk0p2 rw\0" \
  148. - "mmcrootfstype=ext3 rootwait\0" \
  149. - "nandroot=ubi0:rootfs ubi.mtd=4\0" \
  150. - "nandrootfstype=ubifs\0" \
  151. - "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x81000000,64M\0" \
  152. - "ramrootfstype=ext2\0" \
  153. + "optargs=\0" \
  154. "mmcargs=setenv bootargs console=${console} " \
  155. "${optargs} " \
  156. - "mpurate=${mpurate} " \
  157. - "buddy=${buddy} "\
  158. - "camera=${camera} "\
  159. - "vram=${vram} " \
  160. - "omapfb.mode=dvi:${dvimode} " \
  161. - "omapdss.def_disp=${defaultdisplay} " \
  162. - "root=${mmcroot} " \
  163. - "rootfstype=${mmcrootfstype}\0" \
  164. - "nandargs=setenv bootargs console=${console} " \
  165. - "${optargs} " \
  166. - "mpurate=${mpurate} " \
  167. - "buddy=${buddy} "\
  168. - "camera=${camera} "\
  169. - "vram=${vram} " \
  170. - "omapfb.mode=dvi:${dvimode} " \
  171. - "omapdss.def_disp=${defaultdisplay} " \
  172. - "root=${nandroot} " \
  173. - "rootfstype=${nandrootfstype}\0" \
  174. + "root=${root} " \
  175. + "${musb} " \
  176. + "${cmdline}\0" \
  177. + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  178. + "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\0" \
  179. + "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
  180. + "mmcboot=usb start;" \
  181. + "for devtype in mmc usb; do " \
  182. + "setenv devnum 0;" \
  183. + "while ${devtype} dev ${devnum}; do " \
  184. + "echo ${devtype} found on device ${devnum};" \
  185. + "setenv bootpart ${devnum}:1;" \
  186. + "if test ${devtype} = mmc; then part uuid mmc ${devnum}:2 uuid; else part uuid ${devtype} ${devnum}:1 uuid; fi;" \
  187. + "part uuid ${devtype} ${rootpart} uuid;" \
  188. + "setenv root PARTUUID=${uuid} rw rootwait;" \
  189. + "echo Checking for: ${bootdir}/uEnv.txt ...;" \
  190. + "if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then " \
  191. + "load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt;" \
  192. + "env import -t ${loadaddr} ${filesize};" \
  193. + "echo Loaded environment from ${bootdir}/uEnv.txt;" \
  194. + "echo Checking if uenvcmd is set ...;" \
  195. + "if test -n ${uenvcmd}; then " \
  196. + "echo Running uenvcmd ...;" \
  197. + "run uenvcmd;" \
  198. + "fi;" \
  199. + "fi;" \
  200. + "run scan_dev_for_boot;" \
  201. + "if run loadimage; then " \
  202. + "run mmcargs;" \
  203. + "if run loadfdt; then " \
  204. + "if run loadrd; then " \
  205. + "bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};" \
  206. + "else " \
  207. + "bootz ${loadaddr} - ${fdtaddr};" \
  208. + "fi;" \
  209. + "fi;" \
  210. + "else " \
  211. + "echo No kernel found;" \
  212. + "fi;" \
  213. + "setexpr devnum ${devnum} + 1;" \
  214. + "done;" \
  215. + "done;\0" \
  216. "findfdt=" \
  217. "if test $beaglerev = AxBx; then " \
  218. "setenv fdtfile omap3-beagle.dtb; fi; " \
  219. @@ -181,81 +207,11 @@
  220. "if test $beaglerev = xMC; then " \
  221. "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
  222. "if test $fdtfile = undefined; then " \
  223. - "echo WARNING: Could not determine device tree to use; fi; \0" \
  224. - "validatefdt=" \
  225. - "if test $beaglerev = xMAB; then " \
  226. - "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
  227. - "setenv fdtfile omap3-beagle-xm.dtb; " \
  228. - "fi; " \
  229. - "fi; \0" \
  230. - "bootenv=uEnv.txt\0" \
  231. - "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
  232. - "importbootenv=echo Importing environment from mmc ...; " \
  233. - "env import -t -r $loadaddr $filesize\0" \
  234. - "ramargs=setenv bootargs console=${console} " \
  235. - "${optargs} " \
  236. - "mpurate=${mpurate} " \
  237. - "buddy=${buddy} "\
  238. - "vram=${vram} " \
  239. - "omapfb.mode=dvi:${dvimode} " \
  240. - "omapdss.def_disp=${defaultdisplay} " \
  241. - "root=${ramroot} " \
  242. - "rootfstype=${ramrootfstype}\0" \
  243. - "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
  244. - "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  245. - "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  246. - "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
  247. - "source ${loadaddr}\0" \
  248. - "loadfdt=run validatefdt; load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  249. - "mmcboot=echo Booting from mmc ...; " \
  250. - "run mmcargs; " \
  251. - "bootm ${loadaddr}\0" \
  252. - "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \
  253. - "run mmcargs; " \
  254. - "bootz ${loadaddr} - ${fdtaddr}\0" \
  255. - "nandboot=echo Booting from nand ...; " \
  256. - "run nandargs; " \
  257. - "nand read ${loadaddr} 280000 400000; " \
  258. - "bootm ${loadaddr}\0" \
  259. - "ramboot=echo Booting from ramdisk ...; " \
  260. - "run ramargs; " \
  261. - "bootm ${loadaddr}\0" \
  262. - "userbutton=if gpio input 173; then run userbutton_xm; " \
  263. - "else run userbutton_nonxm; fi;\0" \
  264. - "userbutton_xm=gpio input 4;\0" \
  265. - "userbutton_nonxm=gpio input 7;\0"
  266. -/* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */
  267. + "echo WARNING: Could not determine device tree to use; fi; \0"
  268. +
  269. #define CONFIG_BOOTCOMMAND \
  270. "run findfdt; " \
  271. - "mmc dev ${mmcdev}; if mmc rescan; then " \
  272. - "if run userbutton; then " \
  273. - "setenv bootenv uEnv.txt;" \
  274. - "else " \
  275. - "setenv bootenv user.txt;" \
  276. - "fi;" \
  277. - "echo SD/MMC found on device ${mmcdev};" \
  278. - "if run loadbootenv; then " \
  279. - "echo Loaded environment from ${bootenv};" \
  280. - "run importbootenv;" \
  281. - "fi;" \
  282. - "if test -n $uenvcmd; then " \
  283. - "echo Running uenvcmd ...;" \
  284. - "run uenvcmd;" \
  285. - "fi;" \
  286. - "if run loadbootscript; then " \
  287. - "run bootscript; " \
  288. - "else " \
  289. - "if run loadimage; then " \
  290. - "run mmcboot;" \
  291. - "fi;" \
  292. - "fi; " \
  293. - "fi;" \
  294. - "run nandboot;" \
  295. - "setenv bootfile zImage;" \
  296. - "if run loadimage; then " \
  297. - "run loadfdt;" \
  298. - "run mmcbootz; " \
  299. - "fi; " \
  300. + "run mmcboot"
  301. /*
  302. * OMAP3 has 12 GP timers, they can be driven by the system clock