From patchwork Sat Feb 8 05:38:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 236058 List-Id: U-Boot discussion From: GNUtoo at cyberdimension.org (Denis 'GNUtoo' Carikli) Date: Sat, 8 Feb 2020 06:38:34 +0100 Subject: [PATCH v3][ 1/6] board: tbs2910: disable loadb and loads commands Message-ID: <20200208053839.7101-1-GNUtoo@cyberdimension.org> The loadb and loads commands are not needed for booting. There are also more reliable and faster alternatives to loadb and loads that can be used with the current configuration. As that the resulting image is already very close to the size limit, removing the loadb and loads commands shouldn't hurt. With arm-linux-gnueabi-gcc 9.2.0-1 from the Parabola GNU/Linux distribution we have the following size reduction: - text: 6733 bytes - data: 116 bytes - bss: 1172 bytes - total: 8021 bytes Acked-by: Soeren Moch Signed-off-by: Denis 'GNUtoo' Carikli --- configs/tbs2910_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index 61d4c74324..570ae850e4 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -26,6 +26,8 @@ CONFIG_CMD_BOOTZ=y CONFIG_CMD_MEMTEST=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y CONFIG_CMD_PART=y CONFIG_CMD_PCI=y From patchwork Sat Feb 8 05:38:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 236057 List-Id: U-Boot discussion From: GNUtoo at cyberdimension.org (Denis 'GNUtoo' Carikli) Date: Sat, 8 Feb 2020 06:38:35 +0100 Subject: [PATCH v3][ 2/6] board: tbs2910: disable CONFIG_GZIP In-Reply-To: <20200208053839.7101-1-GNUtoo@cyberdimension.org> References: <20200208053839.7101-1-GNUtoo@cyberdimension.org> Message-ID: <20200208053839.7101-2-GNUtoo@cyberdimension.org> As that the resulting image is already very close to the size limit, and that CONFIG_GZIP is not strictly required, removing it shouldn't hurt. With arm-linux-gnueabi-gcc 9.2.0-1 from the Parabola GNU/Linux distribution we have the following size reduction: - text: 9752 - data: 0 - bss: 16 - total: 9768 Signed-off-by: Denis 'GNUtoo' Carikli --- configs/tbs2910_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index 570ae850e4..fcaa101044 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -86,5 +86,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_I2C_EDID=y CONFIG_VIDEO_IPUV3=y CONFIG_VIDEO=y +# CONFIG_GZIP is not set CONFIG_OF_LIBFDT_ASSUME_MASK=0xff # CONFIG_EFI_LOADER is not set From patchwork Sat Feb 8 05:38:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 236061 List-Id: U-Boot discussion From: GNUtoo at cyberdimension.org (Denis 'GNUtoo' Carikli) Date: Sat, 8 Feb 2020 06:38:36 +0100 Subject: [PATCH v3][ 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig In-Reply-To: <20200208053839.7101-1-GNUtoo@cyberdimension.org> References: <20200208053839.7101-1-GNUtoo@cyberdimension.org> Message-ID: <20200208053839.7101-3-GNUtoo@cyberdimension.org> This doesn't affect the size of the image: with arm-linux-gnueabi-gcc 9.2.0-1 from the Parabola GNU/Linux distribution, the text, data, bss and total sizes remain unchanged. Signed-off-by: Denis 'GNUtoo' Carikli --- configs/tbs2910_defconfig | 2 ++ include/configs/tbs2910.h | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index fcaa101044..5603bef64e 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -10,6 +10,8 @@ CONFIG_PRE_CON_BUF_ADDR=0x7c000000 CONFIG_CMD_HDMIDETECT=y CONFIG_AHCI=y CONFIG_BOOTDELAY=3 +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc; fi" CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="echo PCI:; pci enum; pci 1; usb start; if hdmidet; then run set_con_hdmi; else run set_con_serial; fi" CONFIG_PRE_CONSOLE_BUFFER=y diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h index b598fca1ec..3975f4cc8b 100644 --- a/include/configs/tbs2910.h +++ b/include/configs/tbs2910.h @@ -104,12 +104,4 @@ "stdin=serial,usbkbd\0" \ "stdout=serial,vga\0" -#define CONFIG_BOOTCOMMAND \ - "mmc rescan; " \ - "if run bootcmd_up1; then " \ - "run bootcmd_up2; " \ - "else " \ - "run bootcmd_mmc; " \ - "fi" - #endif /* __TBS2910_CONFIG_H * */ From patchwork Sat Feb 8 05:38:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 236062 List-Id: U-Boot discussion From: GNUtoo at cyberdimension.org (Denis 'GNUtoo' Carikli) Date: Sat, 8 Feb 2020 06:38:37 +0100 Subject: [PATCH v3][ 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS In-Reply-To: <20200208053839.7101-1-GNUtoo@cyberdimension.org> References: <20200208053839.7101-1-GNUtoo@cyberdimension.org> Message-ID: <20200208053839.7101-4-GNUtoo@cyberdimension.org> The side effect is that it increase the size of the resultimg image, which is already very close to the size limit. With arm-linux-gnueabi-gcc 9.2.0-1 from the Parabola GNU/Linux distribution, we have the following size increase: - text: 8744 bytes - data: 132 bytes - bss: 60 bytes - total: 8936 bytes Signed-off-by: Denis 'GNUtoo' Carikli --- configs/tbs2910_defconfig | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index 5603bef64e..1cf09bb741 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -9,18 +9,15 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_PRE_CON_BUF_ADDR=0x7c000000 CONFIG_CMD_HDMIDETECT=y CONFIG_AHCI=y +CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=3 -CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc; fi" CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="echo PCI:; pci enum; pci 1; usb start; if hdmidet; then run set_con_hdmi; else run set_con_serial; fi" CONFIG_PRE_CONSOLE_BUFFER=y -CONFIG_SUPPORT_RAW_INITRD=y CONFIG_BOUNCE_BUFFER=y CONFIG_BOARD_EARLY_INIT_F=y -CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="Matrix U-Boot> " -CONFIG_CMD_BOOTZ=y # CONFIG_BOOTM_PLAN9 is not set # CONFIG_BOOTM_RTEMS is not set # CONFIG_BOOTM_VXWORKS is not set @@ -31,22 +28,14 @@ CONFIG_CMD_I2C=y # CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y -CONFIG_CMD_PART=y CONFIG_CMD_PCI=y CONFIG_CMD_SATA=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y -CONFIG_CMD_DHCP=y -CONFIG_CMD_MII=y -CONFIG_CMD_PING=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y -CONFIG_CMD_EXT2=y -CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_FAT=y -CONFIG_CMD_FS_GENERIC=y -CONFIG_EFI_PARTITION=y +# CONFIG_ISO_PARTITION is not set CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_DEFAULT_DEVICE_TREE="imx6q-tbs2910" @@ -76,7 +65,6 @@ CONFIG_RTC_DS1307=y CONFIG_DM_THERMAL=y CONFIG_USB=y CONFIG_DM_USB=y -CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y CONFIG_USB_GADGET=y From patchwork Sat Feb 8 05:38:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 236059 List-Id: U-Boot discussion From: GNUtoo at cyberdimension.org (Denis 'GNUtoo' Carikli) Date: Sat, 8 Feb 2020 06:38:38 +0100 Subject: [PATCH v3][ 5/6] board: tbs2910: Enable distro_boot support. In-Reply-To: <20200208053839.7101-1-GNUtoo@cyberdimension.org> References: <20200208053839.7101-1-GNUtoo@cyberdimension.org> Message-ID: <20200208053839.7101-5-GNUtoo@cyberdimension.org> This keeps the compatibility with the old bootcmd. The fdtfile environment variable also needed to be set to imx6q-tbs2910.dtb to enable booting mainline kernels otherwise with extlinux.conf it tries to load mx6-tbs2910.dtb instead. With arm-linux-gnueabi-gcc 9.2.0-1 from the Parabola GNU/Linux distribution, we have the following size differences: - text: +2271 bytes - data: 0 bytes - bss: -32 bytes - total: 2239 bytes Signed-off-by: Denis 'GNUtoo' Carikli --- configs/tbs2910_defconfig | 3 ++- include/configs/tbs2910.h | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index 1cf09bb741..b3a8e11a57 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -11,10 +11,11 @@ CONFIG_CMD_HDMIDETECT=y CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=3 -CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc; fi" +CONFIG_BOOTCOMMAND="mmc rescan; if run bootcmd_up1; then run bootcmd_up2; else run bootcmd_mmc || run distro_bootcmd; fi" CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="echo PCI:; pci enum; pci 1; usb start; if hdmidet; then run set_con_hdmi; else run set_con_serial; fi" CONFIG_PRE_CONSOLE_BUFFER=y +CONFIG_DEFAULT_FDT_FILE="imx6q-tbs2910.dtb" CONFIG_BOUNCE_BUFFER=y CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SYS_PROMPT="Matrix U-Boot> " diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h index 3975f4cc8b..534500116d 100644 --- a/include/configs/tbs2910.h +++ b/include/configs/tbs2910.h @@ -8,6 +8,16 @@ #ifndef __TBS2910_CONFIG_H #define __TBS2910_CONFIG_H +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 2) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) +#include + #include "mx6_common.h" /* General configuration */ @@ -80,6 +90,12 @@ #define CONFIG_BOARD_SIZE_LIMIT 392192 /* (CONFIG_ENV_OFFSET - 1024) */ #define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_addr=0x13000000\0" \ + "fdt_addr_r=0x13000000\0" \ + "kernel_addr_r=0x10008000\0" \ + "pxefile_addr_r=0x10008000\0" \ + "ramdisk_addr_r=0x18000000\0" \ + "scriptaddr=0x14000000\0" \ "bootargs_mmc1=console=ttymxc0,115200 di0_primary console=tty1\0" \ "bootargs_mmc2=video=mxcfb0:dev=hdmi,1920x1080M at 60 " \ "video=mxcfb1:off video=mxcfb2:off fbmem=28M\0" \ @@ -102,6 +118,8 @@ "setenv stderr serial,vga\0" \ "stderr=serial,vga\0" \ "stdin=serial,usbkbd\0" \ - "stdout=serial,vga\0" + "stdout=serial,vga\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + BOOTENV #endif /* __TBS2910_CONFIG_H * */ From patchwork Sat Feb 8 05:38:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 236060 List-Id: U-Boot discussion From: GNUtoo at cyberdimension.org (Denis 'GNUtoo' Carikli) Date: Sat, 8 Feb 2020 06:38:39 +0100 Subject: [PATCH v3][ 6/6] boards: tbs2910: add README In-Reply-To: <20200208053839.7101-1-GNUtoo@cyberdimension.org> References: <20200208053839.7101-1-GNUtoo@cyberdimension.org> Message-ID: <20200208053839.7101-6-GNUtoo@cyberdimension.org> The installation documentation make use of the "BOOT/UPDATE" mechanism that is documented in the TBS2910 OS installation manual[1]. This is to make sure that they work on the different PCB revisions of this board. There is also a boot configuration switch (SW6) but the one described in the v2.1 schematics has 8 switches whereas the one present on the v2.3 board has only 4. Only the v2.1 board schematics are available. [1]https://www.tbsdtv.com/download/document/tbs2910/How-to-burn-a-new-OS-into-eMMC-on-Matrix-V2.0.pdf Signed-off-by: Denis 'GNUtoo' Carikli --- board/tbs/tbs2910/README | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 board/tbs/tbs2910/README diff --git a/board/tbs/tbs2910/README b/board/tbs/tbs2910/README new file mode 100644 index 0000000000..6562897e21 --- /dev/null +++ b/board/tbs/tbs2910/README @@ -0,0 +1,37 @@ +How to use U-Boot on the TBS2910 +-------------------------------- + +Configure and build U-boot for the TBS2910: + $ make mrproper + $ make tbs2910_defconfig + $ make + +This will generate the u-boot.imx image. + +UART: +- The UART voltage is at 3.3V and its settings are 115200bps 8N1 + +Boot from eMMC: +- Once the board is booted, flash u-boot.imx to mmcblk0boot0: + $ sudo echo 0 >/sys/block/mmcblk0boot0/force_ro + $ sudo dd if=u-boot.imx of=/dev/mmcblk0boot0 bs=1k seek=1; sync + Note that the eMMC card node may vary, so adjust this as needed. +- Power off the board +- Make sure that the boot switch is set to "BOOT" +- Connect the UART cable to the host PC +- Power up the board and U-Boot messages will appear in the serial console. + +Boot from USB: +- Build imx_usb_loader + $ git clone git://github.com/boundarydevices/imx_usb_loader.git + $ cd imx_usb_loader + $ make +- Copy u-boot.imx in the imx_usb_loader directory +- Power off the board +- Make sure that the boot switch is set to "UPDATE" +- Connect an USB cable to the host PC +- Connect the UART cable to the host PC +- Power on the board +- Load u-boot.img through USB with imx_usb: + $ sudo ./imx_usb -v u-boot.imx +- U-Boot messages will appear in the serial console \ No newline at end of file