0006-parabola-arm-modifications.patch 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. diff -Nur u-boot-2014.07.orig/include/config_distro_bootcmd.h u-boot-2014.07/include/config_distro_bootcmd.h
  2. --- u-boot-2014.07.orig/include/config_distro_bootcmd.h 1969-12-31 21:00:00.000000000 -0300
  3. +++ u-boot-2014.07/include/config_distro_bootcmd.h 2015-04-13 11:53:03.000000000 -0300
  4. @@ -0,0 +1,236 @@
  5. +/*
  6. + * (C) Copyright 2014
  7. + * NVIDIA Corporation <www.nvidia.com>
  8. + *
  9. + * Copyright 2014 Red Hat, Inc.
  10. + *
  11. + * SPDX-License-Identifier: GPL-2.0+
  12. + */
  13. +
  14. +#ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H
  15. +#define _CONFIG_CMD_DISTRO_BOOTCMD_H
  16. +
  17. +/*
  18. + * A note on error handling: It is possible for BOOT_TARGET_DEVICES to
  19. + * reference a device that is not enabled in the U-Boot configuration, e.g.
  20. + * it may include MMC in the list without CONFIG_CMD_MMC being enabled. Given
  21. + * that BOOT_TARGET_DEVICES is a macro that's expanded by the C pre-processor
  22. + * at compile time, it's not possible to detect and report such problems via
  23. + * a simple #ifdef/#error combination. Still, the code needs to report errors.
  24. + * The best way I've found to do this is to make BOOT_TARGET_DEVICES expand to
  25. + * reference a non-existent symbol, and have the name of that symbol encode
  26. + * the error message. Consequently, this file contains references to e.g.
  27. + * BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC. Given the
  28. + * prevalence of capitals here, this looks like a pre-processor macro and
  29. + * hence seems like it should be all capitals, but it's really an error
  30. + * message that includes some other pre-processor symbols in the text.
  31. + */
  32. +
  33. +/* We need the part command */
  34. +#define CONFIG_PARTITION_UUIDS
  35. +#define CONFIG_CMD_PART
  36. +
  37. +#define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \
  38. + "if " #devtypel " dev ${devnum}; then " \
  39. + "setenv devtype " #devtypel "; " \
  40. + "run scan_dev_for_boot_part; " \
  41. + "fi\0"
  42. +
  43. +#define BOOTENV_SHARED_BLKDEV(devtypel) \
  44. + #devtypel "_boot=" \
  45. + BOOTENV_SHARED_BLKDEV_BODY(devtypel)
  46. +
  47. +#define BOOTENV_DEV_BLKDEV(devtypeu, devtypel, instance) \
  48. + "bootcmd_" #devtypel #instance "=" \
  49. + "setenv devnum " #instance "; " \
  50. + "run " #devtypel "_boot\0"
  51. +
  52. +#define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \
  53. + #devtypel #instance " "
  54. +
  55. +#ifdef CONFIG_CMD_MMC
  56. +#define BOOTENV_SHARED_MMC BOOTENV_SHARED_BLKDEV(mmc)
  57. +#define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV
  58. +#define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV
  59. +#else
  60. +#define BOOTENV_SHARED_MMC
  61. +#define BOOTENV_DEV_MMC \
  62. + BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC
  63. +#define BOOTENV_DEV_NAME_MMC \
  64. + BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC
  65. +#endif
  66. +
  67. +#ifdef CONFIG_CMD_SATA
  68. +#define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata)
  69. +#define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV
  70. +#define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV
  71. +#else
  72. +#define BOOTENV_SHARED_SATA
  73. +#define BOOTENV_DEV_SATA \
  74. + BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA
  75. +#define BOOTENV_DEV_NAME_SATA \
  76. + BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA
  77. +#endif
  78. +
  79. +#ifdef CONFIG_CMD_SCSI
  80. +#define BOOTENV_RUN_SCSI_INIT "run scsi_init; "
  81. +#define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; "
  82. +#define BOOTENV_SHARED_SCSI \
  83. + "scsi_init=" \
  84. + "if ${scsi_need_init}; then " \
  85. + "setenv scsi_need_init false; " \
  86. + "scsi scan; " \
  87. + "fi\0" \
  88. + \
  89. + "scsi_boot=" \
  90. + BOOTENV_RUN_SCSI_INIT \
  91. + BOOTENV_SHARED_BLKDEV_BODY(scsi)
  92. +#define BOOTENV_DEV_SCSI BOOTENV_DEV_BLKDEV
  93. +#define BOOTENV_DEV_NAME_SCSI BOOTENV_DEV_NAME_BLKDEV
  94. +#else
  95. +#define BOOTENV_RUN_SCSI_INIT
  96. +#define BOOTENV_SET_SCSI_NEED_INIT
  97. +#define BOOTENV_SHARED_SCSI
  98. +#define BOOTENV_DEV_SCSI \
  99. + BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI
  100. +#define BOOTENV_DEV_NAME_SCSI \
  101. + BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI
  102. +#endif
  103. +
  104. +#ifdef CONFIG_CMD_IDE
  105. +#define BOOTENV_SHARED_IDE BOOTENV_SHARED_BLKDEV(ide)
  106. +#define BOOTENV_DEV_IDE BOOTENV_DEV_BLKDEV
  107. +#define BOOTENV_DEV_NAME_IDE BOOTENV_DEV_NAME_BLKDEV
  108. +#else
  109. +#define BOOTENV_SHARED_IDE
  110. +#define BOOTENV_DEV_IDE \
  111. + BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE
  112. +#define BOOTENV_DEV_NAME_IDE \
  113. + BOOT_TARGET_DEVICES_references_IDE_without_CONFIG_CMD_IDE
  114. +#endif
  115. +
  116. +#ifdef CONFIG_CMD_USB
  117. +#define BOOTENV_RUN_USB_INIT "usb start; "
  118. +#define BOOTENV_SHARED_USB \
  119. + "usb_boot=" \
  120. + BOOTENV_RUN_USB_INIT \
  121. + BOOTENV_SHARED_BLKDEV_BODY(usb)
  122. +#define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV
  123. +#define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV
  124. +#else
  125. +#define BOOTENV_RUN_USB_INIT
  126. +#define BOOTENV_SHARED_USB
  127. +#define BOOTENV_DEV_USB \
  128. + BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
  129. +#define BOOTENV_DEV_NAME_USB \
  130. + BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
  131. +#endif
  132. +
  133. +#if defined(CONFIG_CMD_DHCP)
  134. +#define BOOTENV_DEV_DHCP(devtypeu, devtypel, instance) \
  135. + "bootcmd_dhcp=" \
  136. + BOOTENV_RUN_USB_INIT \
  137. + "if dhcp ${scriptaddr} ${boot_script_dhcp}; then " \
  138. + "source ${scriptaddr}; " \
  139. + "fi\0"
  140. +#define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \
  141. + "dhcp "
  142. +#else
  143. +#define BOOTENV_DEV_DHCP \
  144. + BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP
  145. +#define BOOTENV_DEV_NAME_DHCP \
  146. + BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP
  147. +#endif
  148. +
  149. +#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
  150. +#define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \
  151. + "bootcmd_pxe=" \
  152. + BOOTENV_RUN_USB_INIT \
  153. + "dhcp; " \
  154. + "if pxe get; then " \
  155. + "pxe boot; " \
  156. + "fi\0"
  157. +#define BOOTENV_DEV_NAME_PXE(devtypeu, devtypel, instance) \
  158. + "pxe "
  159. +#else
  160. +#define BOOTENV_DEV_PXE \
  161. + BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
  162. +#define BOOTENV_DEV_NAME_PXE \
  163. + BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
  164. +#endif
  165. +
  166. +#define BOOTENV_DEV_NAME(devtypeu, devtypel, instance) \
  167. + BOOTENV_DEV_NAME_##devtypeu(devtypeu, devtypel, instance)
  168. +#define BOOTENV_BOOT_TARGETS \
  169. + "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
  170. +
  171. +#define BOOTENV_DEV(devtypeu, devtypel, instance) \
  172. + BOOTENV_DEV_##devtypeu(devtypeu, devtypel, instance)
  173. +#define BOOTENV \
  174. + BOOTENV_SHARED_MMC \
  175. + BOOTENV_SHARED_USB \
  176. + BOOTENV_SHARED_SATA \
  177. + BOOTENV_SHARED_SCSI \
  178. + BOOTENV_SHARED_IDE \
  179. + "boot_prefixes=/ /boot/\0" \
  180. + "boot_scripts=boot.scr.uimg boot.scr\0" \
  181. + "boot_script_dhcp=boot.scr.uimg\0" \
  182. + BOOTENV_BOOT_TARGETS \
  183. + \
  184. + "boot_extlinux=" \
  185. + "sysboot ${devtype} ${devnum}:${bootpart} any " \
  186. + "${scriptaddr} ${prefix}extlinux/extlinux.conf\0" \
  187. + \
  188. + "scan_dev_for_extlinux=" \
  189. + "if test -e ${devtype} ${devnum}:${bootpart} " \
  190. + "${prefix}extlinux/extlinux.conf; then " \
  191. + "echo Found ${prefix}extlinux/extlinux.conf; " \
  192. + "run boot_extlinux; " \
  193. + "echo SCRIPT FAILED: continuing...; " \
  194. + "fi\0" \
  195. + \
  196. + "boot_a_script=" \
  197. + "load ${devtype} ${devnum}:${bootpart} " \
  198. + "${scriptaddr} ${prefix}${script}; " \
  199. + "source ${scriptaddr}\0" \
  200. + \
  201. + "scan_dev_for_scripts=" \
  202. + "for script in ${boot_scripts}; do " \
  203. + "if test -e ${devtype} ${devnum}:${bootpart} " \
  204. + "${prefix}${script}; then " \
  205. + "echo Found U-Boot script " \
  206. + "${prefix}${script}; " \
  207. + "run boot_a_script; " \
  208. + "echo SCRIPT FAILED: continuing...; " \
  209. + "fi; " \
  210. + "done\0" \
  211. + \
  212. + "scan_dev_for_boot=" \
  213. + "echo Scanning ${devtype} ${devnum}:${bootpart}...; " \
  214. + "for prefix in ${boot_prefixes}; do " \
  215. + "run scan_dev_for_extlinux; " \
  216. + "run scan_dev_for_scripts; " \
  217. + "done\0" \
  218. + \
  219. + "scan_dev_for_boot_part=" \
  220. + "part list ${devtype} ${devnum} -bootable devplist; " \
  221. + "env exists devplist || setenv devplist 1; " \
  222. + "for bootpart in ${devplist}; do " \
  223. + "if fstype ${devtype} ${devnum}:${bootpart} " \
  224. + "bootfstype; then " \
  225. + "run scan_dev_for_boot; " \
  226. + "fi; " \
  227. + "done\0" \
  228. + \
  229. + BOOT_TARGET_DEVICES(BOOTENV_DEV) \
  230. + \
  231. + "distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT \
  232. + "for target in ${boot_targets}; do " \
  233. + "run bootcmd_${target}; " \
  234. + "done\0"
  235. +
  236. +#ifndef CONFIG_BOOTCOMMAND
  237. +#define CONFIG_BOOTCOMMAND "run distro_bootcmd"
  238. +#endif
  239. +
  240. +#endif /* _CONFIG_CMD_DISTRO_BOOTCMD_H */
  241. diff -Nur u-boot-2014.07.orig/include/configs/chiliboard.h u-boot-2014.07/include/configs/chiliboard.h
  242. --- u-boot-2014.07.orig/include/configs/chiliboard.h 2016-02-25 00:53:19.766846991 -0300
  243. +++ u-boot-2014.07/include/configs/chiliboard.h 2016-02-25 00:57:01.436205462 -0300
  244. @@ -124,7 +124,6 @@
  245. * as that will normally be within the kernel lowmem and thus visible via
  246. * bootm_size and we only run on platforms with 256MB or more of memory.
  247. */
  248. -#ifdef CONFIG_RAM128MB
  249. #define DEFAULT_LINUX_BOOT_ENV \
  250. "loadaddr=0x82000000\0" \
  251. "kernel_addr_r=0x82000000\0" \
  252. @@ -133,16 +132,6 @@
  253. "rdaddr=0x84080000\0" \
  254. "ramdisk_addr_r=0x84080000\0" \
  255. "bootm_size=0x8000000\0"
  256. -#else
  257. -#define DEFAULT_LINUX_BOOT_ENV \
  258. - "loadaddr=0x82000000\0" \
  259. - "kernel_addr_r=0x82000000\0" \
  260. - "fdtaddr=0x88000000\0" \
  261. - "fdt_addr_r=0x88000000\0" \
  262. - "rdaddr=0x88080000\0" \
  263. - "ramdisk_addr_r=0x88080000\0" \
  264. - "bootm_size=0x10000000\0"
  265. -#endif
  266. /*
  267. * Default to a quick boot delay.
  268. @@ -258,6 +247,7 @@
  269. #define CONFIG_CMD_ASKENV
  270. #define CONFIG_CMD_ECHO
  271. #define CONFIG_CMD_BOOTZ
  272. +#define CONFIG_SUPPORT_RAW_INITRD
  273. /*
  274. * Common filesystems support. When we have removable storage we
  275. @@ -398,6 +388,9 @@
  276. #define CONFIG_EFI_PARTITION
  277. #define CONFIG_PARTITION_UUIDS
  278. #define CONFIG_CMD_PART
  279. +#define CONFIG_CMD_SETEXPR
  280. +
  281. +#define CONFIG_IDENT_STRING " Parabola GNU/Linux-libre"
  282. #ifdef CONFIG_NAND
  283. #ifndef CONFIG_NAND512MB
  284. @@ -437,12 +430,20 @@
  285. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  286. +/* Enable Extlinux boot support */
  287. +#define CONFIG_CMD_PXE
  288. +#define CONFIG_MENU
  289. +#define BOOT_TARGET_DEVICES(func)
  290. +#include <config_distro_bootcmd.h>
  291. +
  292. #ifndef CONFIG_SPL_BUILD
  293. #define CONFIG_EXTRA_ENV_SETTINGS \
  294. + BOOTENV \
  295. DEFAULT_LINUX_BOOT_ENV \
  296. "boot_fdt=try\0" \
  297. - "bootpart=0:2\0" \
  298. + "bootpart=0:1\0" \
  299. "bootdir=/boot\0" \
  300. + "fdtdir=/boot/dtbs\0" \
  301. "bootfile=zImage\0" \
  302. "fdtfile=undefined\0" \
  303. "console=ttyO0,115200n8\0" \
  304. @@ -450,9 +451,6 @@
  305. "uuid_disk=${uuid_gpt_disk};" \
  306. "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
  307. "optargs=\0" \
  308. - "mmcdev=0\0" \
  309. - "mmcroot=/dev/mmcblk0p2 rw\0" \
  310. - "mmcrootfstype=ext4 rootwait\0" \
  311. "rootpath=/export/rootfs\0" \
  312. "nfsopts=nolock\0" \
  313. "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
  314. @@ -461,8 +459,7 @@
  315. "ramrootfstype=ext2\0" \
  316. "mmcargs=setenv bootargs console=${console} " \
  317. "${optargs} " \
  318. - "root=${mmcroot} " \
  319. - "rootfstype=${mmcrootfstype}\0" \
  320. + "root=${root}\0" \
  321. "spiroot=/dev/mtdblock4 rw\0" \
  322. "spirootfstype=jffs2\0" \
  323. "spisrcaddr=0xe0000\0" \
  324. @@ -477,46 +474,48 @@
  325. "root=/dev/nfs " \
  326. "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
  327. "ip=dhcp\0" \
  328. - "bootenv=uEnv.txt\0" \
  329. - "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
  330. - "importbootenv=echo Importing environment from mmc ...; " \
  331. - "env import -t $loadaddr $filesize\0" \
  332. "ramargs=setenv bootargs console=${console} " \
  333. "${optargs} " \
  334. "root=${ramroot} " \
  335. "rootfstype=${ramrootfstype}\0" \
  336. - "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
  337. - "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  338. - "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  339. - "mmcloados=run mmcargs; " \
  340. - "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  341. - "if run loadfdt; then " \
  342. - "bootz ${loadaddr} - ${fdtaddr}; " \
  343. - "else " \
  344. - "if test ${boot_fdt} = try; then " \
  345. - "bootz; " \
  346. - "else " \
  347. - "echo WARN: Cannot load the DT; " \
  348. - "fi; " \
  349. - "fi; " \
  350. - "else " \
  351. - "bootz; " \
  352. - "fi;\0" \
  353. - "mmcboot=mmc dev ${mmcdev}; " \
  354. - "if mmc rescan; then " \
  355. - "echo SD/MMC found on device ${mmcdev};" \
  356. - "if run loadbootenv; then " \
  357. - "echo Loaded environment from ${bootenv};" \
  358. - "run importbootenv;" \
  359. - "fi;" \
  360. - "if test -n $uenvcmd; then " \
  361. - "echo Running uenvcmd ...;" \
  362. - "run uenvcmd;" \
  363. - "fi;" \
  364. - "if run loadimage; then " \
  365. - "run mmcloados;" \
  366. - "fi;" \
  367. - "fi;\0" \
  368. + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  369. + "loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\0" \
  370. + "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
  371. + "mmcboot=for devtype in mmc; do " \
  372. + "for devnum in 0 1; do " \
  373. + "if ${devtype} dev ${devnum}; then " \
  374. + "echo ${devtype} found on device ${devnum};" \
  375. + "setenv bootpart ${devnum}:1;" \
  376. + "part uuid ${devtype} ${bootpart} uuid;" \
  377. + "setenv root PARTUUID=${uuid} rw rootwait;" \
  378. + "echo Checking for: ${bootdir}/uEnv.txt ...;" \
  379. + "if test -e ${devtype} ${bootpart} ${bootdir}/uEnv.txt; then " \
  380. + "load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uEnv.txt;" \
  381. + "env import -t ${loadaddr} ${filesize};" \
  382. + "echo Loaded environment from ${bootdir}/uEnv.txt;" \
  383. + "echo Checking if uenvcmd is set ...;" \
  384. + "if test -n ${uenvcmd}; then " \
  385. + "echo Running uenvcmd ...;" \
  386. + "run uenvcmd;" \
  387. + "fi;" \
  388. + "fi;" \
  389. + "run scan_dev_for_boot;" \
  390. + "if run loadimage; then " \
  391. + "run mmcargs;" \
  392. + "if run loadfdt; then " \
  393. + "if run loadrd; then " \
  394. + "bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};" \
  395. + "else " \
  396. + "bootz ${loadaddr} - ${fdtaddr};" \
  397. + "fi;" \
  398. + "fi;" \
  399. + "else " \
  400. + "echo No kernel found;" \
  401. + "fi;" \
  402. + "setexpr devnum ${devnum} + 1;" \
  403. + "fi;" \
  404. + "done;" \
  405. + "done;\0" \
  406. "spiboot=echo Booting from spi ...; " \
  407. "run spiargs; " \
  408. "sf probe ${spibusno}:0; " \
  409. @@ -541,9 +540,6 @@
  410. #define CONFIG_BOOTCOMMAND \
  411. "run findfdt; " \
  412. "run mmcboot;" \
  413. - "setenv mmcdev 1; " \
  414. - "setenv bootpart 1:2; " \
  415. - "run mmcboot;" \
  416. "run nandboot;"
  417. /* NS16550 Configuration */