0005-board-tbs2910-Enable-distro_boot-support.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. From 9658884f3d923ab266903fd18ee7ff6ecf4ff096 Mon Sep 17 00:00:00 2001
  2. From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  3. Date: Sat, 30 May 2020 05:24:24 +0200
  4. Subject: [PATCH 5/6] board: tbs2910: Enable distro_boot support.
  5. This keeps the compatibility with the old bootcmd.
  6. The fdtfile environment variable also needed to be set to
  7. imx6q-tbs2910.dtb to enable booting mainline kernels
  8. otherwise with extlinux.conf it tries to load
  9. mx6-tbs2910.dtb instead.
  10. With arm-linux-gnueabi-gcc 9.2.0-1 from the Parabola
  11. GNU/Linux distribution, we have the following size
  12. differences:
  13. - text: +2041 bytes
  14. - data: 0 bytes
  15. - bss: 0 bytes
  16. - total: +2041 bytes
  17. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  18. Reviewed-by: Soeren Moch <smoch@web.de>
  19. ---
  20. configs/tbs2910_defconfig | 3 ++-
  21. include/configs/tbs2910.h | 18 ++++++++++++++++++
  22. 2 files changed, 20 insertions(+), 1 deletion(-)
  23. diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
  24. index fc9095c859..fbd2293add 100644
  25. --- a/configs/tbs2910_defconfig
  26. +++ b/configs/tbs2910_defconfig
  27. @@ -12,11 +12,12 @@ CONFIG_AHCI=y
  28. CONFIG_ENV_VARS_UBOOT_CONFIG=y
  29. CONFIG_BOOTDELAY=3
  30. CONFIG_USE_BOOTCOMMAND=y
  31. -CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc; fi"
  32. +CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc || run distro_bootcmd; fi"
  33. CONFIG_USE_PREBOOT=y
  34. CONFIG_PREBOOT="echo PCI:; pci enum; pci 1; usb start; if hdmidet; then run set_con_hdmi; else run set_con_serial; fi"
  35. CONFIG_PRE_CONSOLE_BUFFER=y
  36. CONFIG_SUPPORT_RAW_INITRD=y
  37. +CONFIG_DEFAULT_FDT_FILE="imx6q-tbs2910.dtb"
  38. CONFIG_BOUNCE_BUFFER=y
  39. CONFIG_BOARD_EARLY_INIT_F=y
  40. CONFIG_HUSH_PARSER=y
  41. diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
  42. index a230111251..17de122852 100644
  43. --- a/include/configs/tbs2910.h
  44. +++ b/include/configs/tbs2910.h
  45. @@ -76,6 +76,7 @@
  46. #define CONFIG_BOARD_SIZE_LIMIT 392192 /* (CONFIG_ENV_OFFSET - 1024) */
  47. #define CONFIG_EXTRA_ENV_SETTINGS \
  48. + BOOTENV \
  49. "bootargs_mmc1=console=ttymxc0,115200 di0_primary console=tty1\0" \
  50. "bootargs_mmc2=video=mxcfb0:dev=hdmi,1920x1080M@60 " \
  51. "video=mxcfb1:off video=mxcfb2:off fbmem=28M\0" \
  52. @@ -92,6 +93,13 @@
  53. "bootm 0x10800000 0x10d00000\0" \
  54. "console=ttymxc0\0" \
  55. "fan=gpio set 92\0" \
  56. + "fdt_addr=0x13000000\0" \
  57. + "fdt_addr_r=0x13000000\0" \
  58. + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
  59. + "kernel_addr_r=0x10008000\0" \
  60. + "pxefile_addr_r=0x10008000\0" \
  61. + "ramdisk_addr_r=0x18000000\0" \
  62. + "scriptaddr=0x14000000\0" \
  63. "set_con_serial=setenv stdout serial; " \
  64. "setenv stderr serial\0" \
  65. "set_con_hdmi=setenv stdout serial,vga; " \
  66. @@ -100,4 +108,14 @@
  67. "stdin=serial,usbkbd\0" \
  68. "stdout=serial,vga\0"
  69. +/* Enable distro boot */
  70. +#define BOOT_TARGET_DEVICES(func) \
  71. + func(MMC, mmc, 0) \
  72. + func(MMC, mmc, 1) \
  73. + func(MMC, mmc, 2) \
  74. + func(SATA, sata, 0) \
  75. + func(USB, usb, 0)
  76. +
  77. +#include <config_distro_bootcmd.h>
  78. +
  79. #endif /* __TBS2910_CONFIG_H * */
  80. --
  81. 2.27.0