0001-parabola-arm-modifications.patch 10 KB

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