All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands
@ 2020-02-27  0:36 Denis 'GNUtoo' Carikli
  2020-02-27  0:36 ` [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP Denis 'GNUtoo' Carikli
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-02-27  0:36 UTC (permalink / raw)
  To: u-boot

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 <smoch@web.de>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP
  2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
@ 2020-02-27  0:36 ` Denis 'GNUtoo' Carikli
  2020-03-01 13:57   ` Soeren Moch
  2020-02-27  0:36 ` [PATCH][v4 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig Denis 'GNUtoo' Carikli
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-02-27  0:36 UTC (permalink / raw)
  To: u-boot

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 <GNUtoo@cyberdimension.org>
---
 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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH][v4 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig
  2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
  2020-02-27  0:36 ` [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP Denis 'GNUtoo' Carikli
@ 2020-02-27  0:36 ` Denis 'GNUtoo' Carikli
  2020-03-01 13:58   ` Soeren Moch
  2020-02-27  0:37 ` [PATCH][v4 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS Denis 'GNUtoo' Carikli
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-02-27  0:36 UTC (permalink / raw)
  To: u-boot

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 <GNUtoo@cyberdimension.org>
---
 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 * */
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH][v4 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS
  2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
  2020-02-27  0:36 ` [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP Denis 'GNUtoo' Carikli
  2020-02-27  0:36 ` [PATCH][v4 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig Denis 'GNUtoo' Carikli
@ 2020-02-27  0:37 ` Denis 'GNUtoo' Carikli
  2020-03-01 13:58   ` Soeren Moch
  2020-02-27  0:37 ` [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support Denis 'GNUtoo' Carikli
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-02-27  0:37 UTC (permalink / raw)
  To: u-boot

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 <GNUtoo@cyberdimension.org>
---
 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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support.
  2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
                   ` (2 preceding siblings ...)
  2020-02-27  0:37 ` [PATCH][v4 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS Denis 'GNUtoo' Carikli
@ 2020-02-27  0:37 ` Denis 'GNUtoo' Carikli
  2020-03-01 13:59   ` Soeren Moch
  2020-02-27  0:37 ` [PATCH][v4 6/6] board: tbs2910: add documentation Denis 'GNUtoo' Carikli
  2020-03-01 13:57 ` [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Soeren Moch
  5 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-02-27  0:37 UTC (permalink / raw)
  To: u-boot

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: +2041 bytes
- data: 0 bytes
- bss: 0 bytes
- total: +2041 bytes

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
Changelog:
In addition to the changes requested I also did the
following changes:
- I removed func(PXE, pxe, na) from the BOOT_TARGET_DEVICES
- I removed func(DHCP, dhcp, na) from the BOOT_TARGET_DEVICES
---
 configs/tbs2910_defconfig |  3 ++-
 include/configs/tbs2910.h | 19 ++++++++++++++++++-
 2 files changed, 20 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..9380406529 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -8,6 +8,15 @@
 #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)
+
+#include <config_distro_bootcmd.h>
+
 #include "mx6_common.h"
 
 /* General configuration */
@@ -80,6 +89,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 +117,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 * */
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
                   ` (3 preceding siblings ...)
  2020-02-27  0:37 ` [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support Denis 'GNUtoo' Carikli
@ 2020-02-27  0:37 ` Denis 'GNUtoo' Carikli
  2020-03-01 13:59   ` Soeren Moch
  2020-03-01 13:57 ` [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Soeren Moch
  5 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-02-27  0:37 UTC (permalink / raw)
  To: u-boot

This documents the u-boot installation procedure and the
hardware in order to get started.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 doc/board/index.rst       |   1 +
 doc/board/tbs/index.rst   |   9 ++
 doc/board/tbs/tbs2910.rst | 179 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 189 insertions(+)
 create mode 100644 doc/board/tbs/index.rst
 create mode 100644 doc/board/tbs/tbs2910.rst

diff --git a/doc/board/index.rst b/doc/board/index.rst
index b8b956d730..4564c8245f 100644
--- a/doc/board/index.rst
+++ b/doc/board/index.rst
@@ -16,4 +16,5 @@ Board-specific doc
    renesas/index
    rockchip/index
    sifive/index
+   tbs/index
    xilinx/index
diff --git a/doc/board/tbs/index.rst b/doc/board/tbs/index.rst
new file mode 100644
index 0000000000..b677bc624f
--- /dev/null
+++ b/doc/board/tbs/index.rst
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+TBS
+===
+
+.. toctree::
+   :maxdepth: 2
+
+   tbs2910
diff --git a/doc/board/tbs/tbs2910.rst b/doc/board/tbs/tbs2910.rst
new file mode 100644
index 0000000000..2fc84c66ec
--- /dev/null
+++ b/doc/board/tbs/tbs2910.rst
@@ -0,0 +1,179 @@
+TBS2910 Matrix ARM miniPC
+=========================
+
+Building
+--------
+To build u-boot for the TBS2910 Matrix ARM miniPC, you can use the following
+procedure:
+
+First add the ARM toolchain to your PATH
+
+Then setup the ARCH and cross compilation environment variables.
+
+When this is done you can then build u-boot for the TBS2910 Matrix ARM miniPC
+with the following commands:
+
+.. code-block:: none
+
+   make mrproper
+   make tbs2910_defconfig
+   make
+
+Once the build is complete, you can find the resulting image as u-boot.imx in
+the current directory.
+
+UART
+----
+The UART voltage is at 3.3V and its settings are 115200bps 8N1
+
+BOOT/UPDATE boot switch:
+------------------------
+The BOOT/UPDATE switch (SW11) is connected to the BOOT_MODE0 and
+BOOT_MODE1 SoC pins. It has "BOOT" and "UPDATE" markings both on
+the PCB and on the plastic case.
+
+When set to the "UPDATE" position, the SoC will use the "Boot From Fuses"
+configuration, and since BT_FUSE_SEL is 0, this makes the SOC jump to serial
+downloader.
+
+When set in the "BOOT" position, the SoC will use the "Internal boot"
+configuration, and since BT_FUSE_SEL is 0, it will then use the GPIO pins
+for the boot configuration.
+
+SW6 binary DIP switch array on the PCB revision 2.1:
+----------------------------------------------------
+On that PCB revision, SW6 has 8 positions.
+
+Switching a position to ON sets the corresponding
+register to 1.
+
+See the following table for a correspondence between the switch positions and
+registers:
+
+===============    ============
+Switch position    Register
+===============    ============
+1                  BOOT_CFG2[3]
+2                  BOOT_CFG2[4]
+3                  BOOT_CFG2[5]
+4                  BOOT_CFG2[6]
+5                  BOOT_CFG1[4]
+6                  BOOT_CFG1[5]
+7                  BOOT_CFG1[6]
+8                  BOOT_CFG1[7]
+===============    ============
+
+For example:
+
+  - To boot from the eMMC: 1:ON , 2:ON, 3:ON, 4:OFF, 5:OFF, 6:ON, 7:ON, 8:ON
+  - To boot from the microSD slot: 1: ON, 2: OFF, 3: OFF, 4: OFF, 5:OFF, 6:OFF,
+    7:ON, 8:OFF
+  - To boot from the SD slot: 1: OFF, 2: ON, 3: OFF, 4: OFF, 5:OFF, 6:OFF, 7:ON,
+    8:OFF
+  - To boot from SATA: 5:OFF, 6:ON, 7:OFF, 8:OFF
+
+You can refer to the BOOT_CFG registers in the I.MX6Q reference manual for
+additional details.
+
+SW6 binary DIP switch array on the PCB revision 2.3:
+----------------------------------------------------
+On that PCB revision, SW6 has only 4 positions.
+
+Switching a position to ON sets the corresponding
+register to 1.
+
+See the following table for a correspondence between the switch positions and
+registers:
+
+===============    ============
+Switch position    Register
+===============    ============
+1                  BOOT_CFG2[3]
+2                  BOOT_CFG2[4]
+3                  BOOT_CFG2[5]
+4                  BOOT_CFG1[5]
+===============    ============
+
+For example:
+
+- To boot from the eMMC: 1:ON, 2:ON, 3:ON, 4:ON
+- To boot from the microSD slot: 1:ON, 2:OFF, 3:OFF, 4:OFF
+- To boot from the SD slot: 1:OFF, 2:ON, 3:OFF, 4:OFF
+
+You can refer to the BOOT_CFG registers in the I.MX6Q reference manual for
+additional details.
+
+Loading u-boot from USB:
+------------------------
+If you need to load u-boot from USB, you can use the following instructions:
+
+First build imx_usb_loader, as we will need it to load u-boot from USB. This
+can be done with the following commands:
+
+.. code-block:: none
+
+   git clone git://github.com/boundarydevices/imx_usb_loader.git
+   cd imx_usb_loader
+   make
+
+This will create the resulting imx_usb binary.
+
+When this is done, you can copy the u-boot.imx image that you built earlier
+in in the imx_usb_loader directory.
+
+You will then need to power off the TBS2910 Matrix ARM miniPC and make sure that
+the boot switch is set to "UPDATE"
+
+Once this is done you can connect an USB cable between the computer that will
+run imx_usb and the TBS2910 Matrix ARM miniPC.
+
+If you also need to access the u-boot console, you will also need to connect an
+UART cable between the computer running imx_usb and the TBS2910 Matrix ARM
+miniPC.
+
+Once everything is connected you can finally power on the TBS2910 Matrix ARM
+miniPC. The SoC will then jump to the serial download and wait for you.
+
+Finlay, you can load u-boot through USB with with the following command:
+
+.. code-block:: none
+
+   sudo ./imx_usb -v u-boot.imx
+
+The u-boot boot messages will then appear in the serial console.
+
+Install u-boot on the eMMC:
+---------------------------
+To install u-boot on the eMMC, you first need to boot the TBS2910 Matrix ARM
+miniPC.
+
+Once booted, you can flash u-boot.imx to mmcblk0boot0 with the
+following commands:
+
+.. code-block:: none
+
+   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.
+
+Once the new u-boot version is installed, to boot on it you then need to power
+off the TBS2910 Matrix ARM miniPC.
+
+Once it is off, you need make sure that the boot switch is set to "BOOT" and
+that the SW6 switch is set to boot on the eMMC as described in the previous
+sections.
+
+If you also need to access the u-boot console, you will also need to connect an
+UART cable between the computer running imx_usb and the TBS2910 Matrix ARM
+miniPC.
+
+You can then power up the TBS2910 Matrix ARM miniPC and U-Boot messages will
+appear in the serial console.
+
+Links:
+------
+  - https://www.tbsdtv.com/download/document/tbs2910/TBS2910-Matrix-ARM-mini-PC-SCH_rev2.1.pdf
+    - The schematics for the revision 2.1 of the TBS2910 Matrix ARM miniPC.
+  - https://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf - The
+    SoC reference manual for additional details on the BOOT_CFG registers.
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands
  2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
                   ` (4 preceding siblings ...)
  2020-02-27  0:37 ` [PATCH][v4 6/6] board: tbs2910: add documentation Denis 'GNUtoo' Carikli
@ 2020-03-01 13:57 ` Soeren Moch
  5 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-03-01 13:57 UTC (permalink / raw)
  To: u-boot

On 27.02.20 01:36, Denis 'GNUtoo' Carikli wrote:
> 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 <smoch@web.de>
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
nit-picking:
Tags that inspired you to write a patch (like Reported-by or
Suggested-by) should be placed before your sign-off, tags you already
received for the patch (like Acked-by, Tested-by, Reviewed-by) should
come after the sign-off.

Soeren

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP
  2020-02-27  0:36 ` [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP Denis 'GNUtoo' Carikli
@ 2020-03-01 13:57   ` Soeren Moch
  0 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-03-01 13:57 UTC (permalink / raw)
  To: u-boot

On 27.02.20 01:36, Denis 'GNUtoo' Carikli wrote:
> 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 <GNUtoo@cyberdimension.org>
Acked-by: Soeren Moch <smoch@web.de>

Thanks,
Soeren

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig
  2020-02-27  0:36 ` [PATCH][v4 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig Denis 'GNUtoo' Carikli
@ 2020-03-01 13:58   ` Soeren Moch
  0 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-03-01 13:58 UTC (permalink / raw)
  To: u-boot

On 27.02.20 01:36, Denis 'GNUtoo' Carikli wrote:
> 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 <GNUtoo@cyberdimension.org>
Reviewed-by: Soeren Moch <smoch@web.de>

Thanks,
Soeren

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS
  2020-02-27  0:37 ` [PATCH][v4 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS Denis 'GNUtoo' Carikli
@ 2020-03-01 13:58   ` Soeren Moch
  0 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-03-01 13:58 UTC (permalink / raw)
  To: u-boot

On 27.02.20 01:37, Denis 'GNUtoo' Carikli wrote:
> The side effect is that it increase the size of the
> resultimg image, which is already very close to the
> size limit.
Please also mention the main purpose, preparation for distro_boot
support, not only the side effect of this patch.
>
> 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 <GNUtoo@cyberdimension.org>
I hoped you would enable CONFIG_CMD_SYSBOOT instead of enabling
CONFIG_DISTRO_DEFAULTS with associated defconfig cleanup, as discussed
for v3 of this patch. This would save ~1.4k of image size without
reducing functionality. A possible split out of PXE support from
DISTRO_DEFAULTS should be done as separate independent patch series (as
suggested by Tom Rini), since this affects more boards, needs more
discussions and review, and would unnecessarily delay the SYSBOOT
support for tbs2910 if done in the same series.

Thanks,
Soeren
> ---
>  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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support.
  2020-02-27  0:37 ` [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support Denis 'GNUtoo' Carikli
@ 2020-03-01 13:59   ` Soeren Moch
  2020-05-27  0:39     ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 19+ messages in thread
From: Soeren Moch @ 2020-03-01 13:59 UTC (permalink / raw)
  To: u-boot

On 27.02.20 01:37, Denis 'GNUtoo' Carikli wrote:
> 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: +2041 bytes
> - data: 0 bytes
> - bss: 0 bytes
> - total: +2041 bytes
>
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
> ---
> Changelog:
> In addition to the changes requested I also did the
> following changes:
> - I removed func(PXE, pxe, na) from the BOOT_TARGET_DEVICES
> - I removed func(DHCP, dhcp, na) from the BOOT_TARGET_DEVICES
> ---
>  configs/tbs2910_defconfig |  3 ++-
>  include/configs/tbs2910.h | 19 ++++++++++++++++++-
>  2 files changed, 20 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..9380406529 100644
> --- a/include/configs/tbs2910.h
> +++ b/include/configs/tbs2910.h
> @@ -8,6 +8,15 @@
>  #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)
> +
> +#include <config_distro_bootcmd.h>
> +
>  #include "mx6_common.h"
I prefer to include the new section below the existing #include
"mx6_common.h". This way we keep that include at the usual place in the
beginning, while marking the config_distro_bootcmd.h as special case.
>
>  /* General configuration */
> @@ -80,6 +89,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 +117,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 * */
Can you please keep the EXTRA_ENV_SETTINGS sorted alphabetically?

Thanks,
Soeren

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-02-27  0:37 ` [PATCH][v4 6/6] board: tbs2910: add documentation Denis 'GNUtoo' Carikli
@ 2020-03-01 13:59   ` Soeren Moch
  2020-05-07 18:12     ` Soeren Moch
  2020-05-09 17:59     ` Denis 'GNUtoo' Carikli
  0 siblings, 2 replies; 19+ messages in thread
From: Soeren Moch @ 2020-03-01 13:59 UTC (permalink / raw)
  To: u-boot

On 27.02.20 01:37, Denis 'GNUtoo' Carikli wrote:
> This documents the u-boot installation procedure and the
> hardware in order to get started.
Thanks for adding this documentation!

Since you added SYSBOOT support in this series, it also might be good to
mention this (and maybe how to use it) in the documentation.
Sorry for again bringing up new wishes here, but due to the corrections
below unfortunately we need a new version of this patch anyway.
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
To ease the review process it is good style to add a patch revision
history below the sign-off after a "---" separator. This would look like
---
changes in v4:
?- bla

This is not a problem for this particular patch, just as hint for future
patch submissions.
> ---
>  doc/board/index.rst       |   1 +
>  doc/board/tbs/index.rst   |   9 ++
>  doc/board/tbs/tbs2910.rst | 179 ++++++++++++++++++++++++++++++++++++++
>  3 files changed, 189 insertions(+)
>  create mode 100644 doc/board/tbs/index.rst
>  create mode 100644 doc/board/tbs/tbs2910.rst
This new board specific documentation should be added to the
board/tbs/tbs2910/MAINTAINERS file.
> diff --git a/doc/board/index.rst b/doc/board/index.rst
> index b8b956d730..4564c8245f 100644
> --- a/doc/board/index.rst
> +++ b/doc/board/index.rst
> @@ -16,4 +16,5 @@ Board-specific doc
>     renesas/index
>     rockchip/index
>     sifive/index
> +   tbs/index
>     xilinx/index
> diff --git a/doc/board/tbs/index.rst b/doc/board/tbs/index.rst
> new file mode 100644
> index 0000000000..b677bc624f
> --- /dev/null
> +++ b/doc/board/tbs/index.rst
> @@ -0,0 +1,9 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +
> +TBS
> +===
> +
> +.. toctree::
> +   :maxdepth: 2
> +
> +   tbs2910
> diff --git a/doc/board/tbs/tbs2910.rst b/doc/board/tbs/tbs2910.rst
> new file mode 100644
> index 0000000000..2fc84c66ec
> --- /dev/null
> +++ b/doc/board/tbs/tbs2910.rst
> @@ -0,0 +1,179 @@
> +TBS2910 Matrix ARM miniPC
> +=========================
> +
> +Building
> +--------
> +To build u-boot for the TBS2910 Matrix ARM miniPC, you can use the following
> +procedure:
> +
> +First add the ARM toolchain to your PATH
> +
> +Then setup the ARCH and cross compilation environment variables.
> +
> +When this is done you can then build u-boot for the TBS2910 Matrix ARM miniPC
> +with the following commands:
> +
> +.. code-block:: none
> +
> +   make mrproper
> +   make tbs2910_defconfig
> +   make
> +
> +Once the build is complete, you can find the resulting image as u-boot.imx in
> +the current directory.
> +
> +UART
> +----
> +The UART voltage is at 3.3V and its settings are 115200bps 8N1
> +
> +BOOT/UPDATE boot switch:
> +------------------------
> +The BOOT/UPDATE switch (SW11) is connected to the BOOT_MODE0 and
> +BOOT_MODE1 SoC pins. It has "BOOT" and "UPDATE" markings both on
> +the PCB and on the plastic case.
> +
> +When set to the "UPDATE" position, the SoC will use the "Boot From Fuses"
> +configuration, and since BT_FUSE_SEL is 0, this makes the SOC jump to serial
> +downloader.
> +
> +When set in the "BOOT" position, the SoC will use the "Internal boot"
> +configuration, and since BT_FUSE_SEL is 0, it will then use the GPIO pins
> +for the boot configuration.
> +
> +SW6 binary DIP switch array on the PCB revision 2.1:
> +----------------------------------------------------
> +On that PCB revision, SW6 has 8 positions.
> +
> +Switching a position to ON sets the corresponding
> +register to 1.
> +
> +See the following table for a correspondence between the switch positions and
> +registers:
> +
> +===============    ============
> +Switch position    Register
> +===============    ============
> +1                  BOOT_CFG2[3]
> +2                  BOOT_CFG2[4]
> +3                  BOOT_CFG2[5]
> +4                  BOOT_CFG2[6]
> +5                  BOOT_CFG1[4]
> +6                  BOOT_CFG1[5]
> +7                  BOOT_CFG1[6]
> +8                  BOOT_CFG1[7]
> +===============    ============
> +
> +For example:
> +
> +  - To boot from the eMMC: 1:ON , 2:ON, 3:ON, 4:OFF, 5:OFF, 6:ON, 7:ON, 8:ON
Due to the schematic we need 8:OFF.
> +  - To boot from the microSD slot: 1: ON, 2: OFF, 3: OFF, 4: OFF, 5:OFF, 6:OFF,
> +    7:ON, 8:OFF
> +  - To boot from the SD slot: 1: OFF, 2: ON, 3: OFF, 4: OFF, 5:OFF, 6:OFF, 7:ON,
> +    8:OFF
> +  - To boot from SATA: 5:OFF, 6:ON, 7:OFF, 8:OFF
Again due to the schematic we need 1:OFF in addition. Probably also a
good idea to set 2,3,4 OFF.

Thanks for improving tbs2910 support and documentation,
Soeren
> +
> +You can refer to the BOOT_CFG registers in the I.MX6Q reference manual for
> +additional details.
> +
> +SW6 binary DIP switch array on the PCB revision 2.3:
> +----------------------------------------------------
> +On that PCB revision, SW6 has only 4 positions.
> +
> +Switching a position to ON sets the corresponding
> +register to 1.
> +
> +See the following table for a correspondence between the switch positions and
> +registers:
> +
> +===============    ============
> +Switch position    Register
> +===============    ============
> +1                  BOOT_CFG2[3]
> +2                  BOOT_CFG2[4]
> +3                  BOOT_CFG2[5]
> +4                  BOOT_CFG1[5]
> +===============    ============
> +
> +For example:
> +
> +- To boot from the eMMC: 1:ON, 2:ON, 3:ON, 4:ON
> +- To boot from the microSD slot: 1:ON, 2:OFF, 3:OFF, 4:OFF
> +- To boot from the SD slot: 1:OFF, 2:ON, 3:OFF, 4:OFF
> +
> +You can refer to the BOOT_CFG registers in the I.MX6Q reference manual for
> +additional details.
> +
> +Loading u-boot from USB:
> +------------------------
> +If you need to load u-boot from USB, you can use the following instructions:
> +
> +First build imx_usb_loader, as we will need it to load u-boot from USB. This
> +can be done with the following commands:
> +
> +.. code-block:: none
> +
> +   git clone git://github.com/boundarydevices/imx_usb_loader.git
> +   cd imx_usb_loader
> +   make
> +
> +This will create the resulting imx_usb binary.
> +
> +When this is done, you can copy the u-boot.imx image that you built earlier
> +in in the imx_usb_loader directory.
> +
> +You will then need to power off the TBS2910 Matrix ARM miniPC and make sure that
> +the boot switch is set to "UPDATE"
> +
> +Once this is done you can connect an USB cable between the computer that will
> +run imx_usb and the TBS2910 Matrix ARM miniPC.
> +
> +If you also need to access the u-boot console, you will also need to connect an
> +UART cable between the computer running imx_usb and the TBS2910 Matrix ARM
> +miniPC.
> +
> +Once everything is connected you can finally power on the TBS2910 Matrix ARM
> +miniPC. The SoC will then jump to the serial download and wait for you.
> +
> +Finlay, you can load u-boot through USB with with the following command:
> +
> +.. code-block:: none
> +
> +   sudo ./imx_usb -v u-boot.imx
> +
> +The u-boot boot messages will then appear in the serial console.
> +
> +Install u-boot on the eMMC:
> +---------------------------
> +To install u-boot on the eMMC, you first need to boot the TBS2910 Matrix ARM
> +miniPC.
> +
> +Once booted, you can flash u-boot.imx to mmcblk0boot0 with the
> +following commands:
> +
> +.. code-block:: none
> +
> +   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.
> +
> +Once the new u-boot version is installed, to boot on it you then need to power
> +off the TBS2910 Matrix ARM miniPC.
> +
> +Once it is off, you need make sure that the boot switch is set to "BOOT" and
> +that the SW6 switch is set to boot on the eMMC as described in the previous
> +sections.
> +
> +If you also need to access the u-boot console, you will also need to connect an
> +UART cable between the computer running imx_usb and the TBS2910 Matrix ARM
> +miniPC.
> +
> +You can then power up the TBS2910 Matrix ARM miniPC and U-Boot messages will
> +appear in the serial console.
> +
> +Links:
> +------
> +  - https://www.tbsdtv.com/download/document/tbs2910/TBS2910-Matrix-ARM-mini-PC-SCH_rev2.1.pdf
> +    - The schematics for the revision 2.1 of the TBS2910 Matrix ARM miniPC.
> +  - https://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf - The
> +    SoC reference manual for additional details on the BOOT_CFG registers.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-03-01 13:59   ` Soeren Moch
@ 2020-05-07 18:12     ` Soeren Moch
  2020-05-09 17:36       ` Denis 'GNUtoo' Carikli
  2020-05-09 17:59     ` Denis 'GNUtoo' Carikli
  1 sibling, 1 reply; 19+ messages in thread
From: Soeren Moch @ 2020-05-07 18:12 UTC (permalink / raw)
  To: u-boot

Denis,

do you plan to re-send a fixed version of this series?

Thanks,
Soeren


On 01.03.20 14:59, Soeren Moch wrote:
> On 27.02.20 01:37, Denis 'GNUtoo' Carikli wrote:
>> This documents the u-boot installation procedure and the
>> hardware in order to get started.
> Thanks for adding this documentation!
>
> Since you added SYSBOOT support in this series, it also might be good to
> mention this (and maybe how to use it) in the documentation.
> Sorry for again bringing up new wishes here, but due to the corrections
> below unfortunately we need a new version of this patch anyway.
>> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
> To ease the review process it is good style to add a patch revision
> history below the sign-off after a "---" separator. This would look like
> ---
> changes in v4:
> ?- bla
>
> This is not a problem for this particular patch, just as hint for future
> patch submissions.
>> ---
>>  doc/board/index.rst       |   1 +
>>  doc/board/tbs/index.rst   |   9 ++
>>  doc/board/tbs/tbs2910.rst | 179 ++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 189 insertions(+)
>>  create mode 100644 doc/board/tbs/index.rst
>>  create mode 100644 doc/board/tbs/tbs2910.rst
> This new board specific documentation should be added to the
> board/tbs/tbs2910/MAINTAINERS file.
>> diff --git a/doc/board/index.rst b/doc/board/index.rst
>> index b8b956d730..4564c8245f 100644
>> --- a/doc/board/index.rst
>> +++ b/doc/board/index.rst
>> @@ -16,4 +16,5 @@ Board-specific doc
>>     renesas/index
>>     rockchip/index
>>     sifive/index
>> +   tbs/index
>>     xilinx/index
>> diff --git a/doc/board/tbs/index.rst b/doc/board/tbs/index.rst
>> new file mode 100644
>> index 0000000000..b677bc624f
>> --- /dev/null
>> +++ b/doc/board/tbs/index.rst
>> @@ -0,0 +1,9 @@
>> +.. SPDX-License-Identifier: GPL-2.0+
>> +
>> +TBS
>> +===
>> +
>> +.. toctree::
>> +   :maxdepth: 2
>> +
>> +   tbs2910
>> diff --git a/doc/board/tbs/tbs2910.rst b/doc/board/tbs/tbs2910.rst
>> new file mode 100644
>> index 0000000000..2fc84c66ec
>> --- /dev/null
>> +++ b/doc/board/tbs/tbs2910.rst
>> @@ -0,0 +1,179 @@
>> +TBS2910 Matrix ARM miniPC
>> +=========================
>> +
>> +Building
>> +--------
>> +To build u-boot for the TBS2910 Matrix ARM miniPC, you can use the following
>> +procedure:
>> +
>> +First add the ARM toolchain to your PATH
>> +
>> +Then setup the ARCH and cross compilation environment variables.
>> +
>> +When this is done you can then build u-boot for the TBS2910 Matrix ARM miniPC
>> +with the following commands:
>> +
>> +.. code-block:: none
>> +
>> +   make mrproper
>> +   make tbs2910_defconfig
>> +   make
>> +
>> +Once the build is complete, you can find the resulting image as u-boot.imx in
>> +the current directory.
>> +
>> +UART
>> +----
>> +The UART voltage is at 3.3V and its settings are 115200bps 8N1
>> +
>> +BOOT/UPDATE boot switch:
>> +------------------------
>> +The BOOT/UPDATE switch (SW11) is connected to the BOOT_MODE0 and
>> +BOOT_MODE1 SoC pins. It has "BOOT" and "UPDATE" markings both on
>> +the PCB and on the plastic case.
>> +
>> +When set to the "UPDATE" position, the SoC will use the "Boot From Fuses"
>> +configuration, and since BT_FUSE_SEL is 0, this makes the SOC jump to serial
>> +downloader.
>> +
>> +When set in the "BOOT" position, the SoC will use the "Internal boot"
>> +configuration, and since BT_FUSE_SEL is 0, it will then use the GPIO pins
>> +for the boot configuration.
>> +
>> +SW6 binary DIP switch array on the PCB revision 2.1:
>> +----------------------------------------------------
>> +On that PCB revision, SW6 has 8 positions.
>> +
>> +Switching a position to ON sets the corresponding
>> +register to 1.
>> +
>> +See the following table for a correspondence between the switch positions and
>> +registers:
>> +
>> +===============    ============
>> +Switch position    Register
>> +===============    ============
>> +1                  BOOT_CFG2[3]
>> +2                  BOOT_CFG2[4]
>> +3                  BOOT_CFG2[5]
>> +4                  BOOT_CFG2[6]
>> +5                  BOOT_CFG1[4]
>> +6                  BOOT_CFG1[5]
>> +7                  BOOT_CFG1[6]
>> +8                  BOOT_CFG1[7]
>> +===============    ============
>> +
>> +For example:
>> +
>> +  - To boot from the eMMC: 1:ON , 2:ON, 3:ON, 4:OFF, 5:OFF, 6:ON, 7:ON, 8:ON
> Due to the schematic we need 8:OFF.
>> +  - To boot from the microSD slot: 1: ON, 2: OFF, 3: OFF, 4: OFF, 5:OFF, 6:OFF,
>> +    7:ON, 8:OFF
>> +  - To boot from the SD slot: 1: OFF, 2: ON, 3: OFF, 4: OFF, 5:OFF, 6:OFF, 7:ON,
>> +    8:OFF
>> +  - To boot from SATA: 5:OFF, 6:ON, 7:OFF, 8:OFF
> Again due to the schematic we need 1:OFF in addition. Probably also a
> good idea to set 2,3,4 OFF.
>
> Thanks for improving tbs2910 support and documentation,
> Soeren
>> +
>> +You can refer to the BOOT_CFG registers in the I.MX6Q reference manual for
>> +additional details.
>> +
>> +SW6 binary DIP switch array on the PCB revision 2.3:
>> +----------------------------------------------------
>> +On that PCB revision, SW6 has only 4 positions.
>> +
>> +Switching a position to ON sets the corresponding
>> +register to 1.
>> +
>> +See the following table for a correspondence between the switch positions and
>> +registers:
>> +
>> +===============    ============
>> +Switch position    Register
>> +===============    ============
>> +1                  BOOT_CFG2[3]
>> +2                  BOOT_CFG2[4]
>> +3                  BOOT_CFG2[5]
>> +4                  BOOT_CFG1[5]
>> +===============    ============
>> +
>> +For example:
>> +
>> +- To boot from the eMMC: 1:ON, 2:ON, 3:ON, 4:ON
>> +- To boot from the microSD slot: 1:ON, 2:OFF, 3:OFF, 4:OFF
>> +- To boot from the SD slot: 1:OFF, 2:ON, 3:OFF, 4:OFF
>> +
>> +You can refer to the BOOT_CFG registers in the I.MX6Q reference manual for
>> +additional details.
>> +
>> +Loading u-boot from USB:
>> +------------------------
>> +If you need to load u-boot from USB, you can use the following instructions:
>> +
>> +First build imx_usb_loader, as we will need it to load u-boot from USB. This
>> +can be done with the following commands:
>> +
>> +.. code-block:: none
>> +
>> +   git clone git://github.com/boundarydevices/imx_usb_loader.git
>> +   cd imx_usb_loader
>> +   make
>> +
>> +This will create the resulting imx_usb binary.
>> +
>> +When this is done, you can copy the u-boot.imx image that you built earlier
>> +in in the imx_usb_loader directory.
>> +
>> +You will then need to power off the TBS2910 Matrix ARM miniPC and make sure that
>> +the boot switch is set to "UPDATE"
>> +
>> +Once this is done you can connect an USB cable between the computer that will
>> +run imx_usb and the TBS2910 Matrix ARM miniPC.
>> +
>> +If you also need to access the u-boot console, you will also need to connect an
>> +UART cable between the computer running imx_usb and the TBS2910 Matrix ARM
>> +miniPC.
>> +
>> +Once everything is connected you can finally power on the TBS2910 Matrix ARM
>> +miniPC. The SoC will then jump to the serial download and wait for you.
>> +
>> +Finlay, you can load u-boot through USB with with the following command:
>> +
>> +.. code-block:: none
>> +
>> +   sudo ./imx_usb -v u-boot.imx
>> +
>> +The u-boot boot messages will then appear in the serial console.
>> +
>> +Install u-boot on the eMMC:
>> +---------------------------
>> +To install u-boot on the eMMC, you first need to boot the TBS2910 Matrix ARM
>> +miniPC.
>> +
>> +Once booted, you can flash u-boot.imx to mmcblk0boot0 with the
>> +following commands:
>> +
>> +.. code-block:: none
>> +
>> +   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.
>> +
>> +Once the new u-boot version is installed, to boot on it you then need to power
>> +off the TBS2910 Matrix ARM miniPC.
>> +
>> +Once it is off, you need make sure that the boot switch is set to "BOOT" and
>> +that the SW6 switch is set to boot on the eMMC as described in the previous
>> +sections.
>> +
>> +If you also need to access the u-boot console, you will also need to connect an
>> +UART cable between the computer running imx_usb and the TBS2910 Matrix ARM
>> +miniPC.
>> +
>> +You can then power up the TBS2910 Matrix ARM miniPC and U-Boot messages will
>> +appear in the serial console.
>> +
>> +Links:
>> +------
>> +  - https://www.tbsdtv.com/download/document/tbs2910/TBS2910-Matrix-ARM-mini-PC-SCH_rev2.1.pdf
>> +    - The schematics for the revision 2.1 of the TBS2910 Matrix ARM miniPC.
>> +  - https://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf - The
>> +    SoC reference manual for additional details on the BOOT_CFG registers.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-05-07 18:12     ` Soeren Moch
@ 2020-05-09 17:36       ` Denis 'GNUtoo' Carikli
  2020-05-10  9:11         ` Soeren Moch
  0 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-05-09 17:36 UTC (permalink / raw)
  To: u-boot

On Thu, 7 May 2020 20:12:19 +0200
Soeren Moch <smoch@web.de> wrote:
> do you plan to re-send a fixed version of this series?
I definitely do.

I'm really sorry for the delay.

I've been struggling with a personal issue and urgent things that
needed to be done.

I also had another patch serie for GRUB that I needed to take care of,
which I only managed to resend yesterday after more than 1 month since
the last version.

Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200509/d8ab3501/attachment.sig>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-03-01 13:59   ` Soeren Moch
  2020-05-07 18:12     ` Soeren Moch
@ 2020-05-09 17:59     ` Denis 'GNUtoo' Carikli
  2020-05-12 19:27       ` Soeren Moch
  1 sibling, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-05-09 17:59 UTC (permalink / raw)
  To: u-boot

On Sun, 1 Mar 2020 14:59:23 +0100
Soeren Moch <smoch@web.de> wrote:

> To ease the review process it is good style to add a patch revision
> history below the sign-off after a "---" separator. This would look
> like ---
> changes in v4:
> ?- bla
I usually use that to indicate changes that do not correspond to the
changes requested by the reviewers, or where the fix is slightly
different from the one suggested during the review.

If the fix sticks to precisely what was suggested, does it still
helps to include such changes in the ChangeLog too?

Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200509/c5a7590b/attachment.sig>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-05-09 17:36       ` Denis 'GNUtoo' Carikli
@ 2020-05-10  9:11         ` Soeren Moch
  0 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-05-10  9:11 UTC (permalink / raw)
  To: u-boot

On 09.05.20 19:36, Denis 'GNUtoo' Carikli wrote:
> On Thu, 7 May 2020 20:12:19 +0200
> Soeren Moch <smoch@web.de> wrote:
>> do you plan to re-send a fixed version of this series?
> I definitely do.
OK. I look forward to your new series.
>
> I'm really sorry for the delay.
No problem, it is not that urgent. I just would like to get distroboot
supported on tbs2910.

Thanks,
Soeren
>
> I've been struggling with a personal issue and urgent things that
> needed to be done.
>
> I also had another patch serie for GRUB that I needed to take care of,
> which I only managed to resend yesterday after more than 1 month since
> the last version.
>
> Denis.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 6/6] board: tbs2910: add documentation
  2020-05-09 17:59     ` Denis 'GNUtoo' Carikli
@ 2020-05-12 19:27       ` Soeren Moch
  0 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-05-12 19:27 UTC (permalink / raw)
  To: u-boot



On 09.05.20 19:59, Denis 'GNUtoo' Carikli wrote:
> On Sun, 1 Mar 2020 14:59:23 +0100
> Soeren Moch <smoch@web.de> wrote:
>
>> To ease the review process it is good style to add a patch revision
>> history below the sign-off after a "---" separator. This would look
>> like ---
>> changes in v4:
>> ?- bla
> I usually use that to indicate changes that do not correspond to the
> changes requested by the reviewers, or where the fix is slightly
> different from the one suggested during the review.
This usually is better addressed in a discussion before sending a new
version of a patch series. Just ignoring review comments often leads to
rejection of the new patch, this is waste of time for everybody, and
unnecessarily delays? patch merging. Of course reviewers not always have
the best idea how to solve a problem. But discussing pros and cons in a
direct answer to the review is much faster and easier as always sending
a new version of the patches.
>
> If the fix sticks to precisely what was suggested, does it still
> helps to include such changes in the ChangeLog too?
Yes , this helps for sure. Even if there is no change at all in some
patches of a series, it helps if there is a
---
changes in v4:
- none

Soeren

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support.
  2020-03-01 13:59   ` Soeren Moch
@ 2020-05-27  0:39     ` Denis 'GNUtoo' Carikli
  2020-05-28  4:54       ` Soeren Moch
  0 siblings, 1 reply; 19+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2020-05-27  0:39 UTC (permalink / raw)
  To: u-boot

On Sun, 1 Mar 2020 14:59:04 +0100
Soeren Moch <smoch@web.de> wrote:

> On 27.02.20 01:37, Denis 'GNUtoo' Carikli wrote:
> > This keeps the compatibility with the old bootcmd.
[...]
> > --- a/include/configs/tbs2910.h
> > +++ b/include/configs/tbs2910.h
> > @@ -8,6 +8,15 @@
> >  #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)
> > +
> > +#include <config_distro_bootcmd.h>
> > +
> >  #include "mx6_common.h"
> I prefer to include the new section below the existing #include
> "mx6_common.h". This way we keep that include at the usual place in
> the beginning, while marking the config_distro_bootcmd.h as special
> case.

Is right under the "General configuration" comment a good place for
that?

Denis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200527/5717146a/attachment.sig>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support.
  2020-05-27  0:39     ` Denis 'GNUtoo' Carikli
@ 2020-05-28  4:54       ` Soeren Moch
  0 siblings, 0 replies; 19+ messages in thread
From: Soeren Moch @ 2020-05-28  4:54 UTC (permalink / raw)
  To: u-boot

On 27.05.20 02:39, Denis 'GNUtoo' Carikli wrote:
> On Sun, 1 Mar 2020 14:59:04 +0100
> Soeren Moch <smoch@web.de> wrote:
>
>> On 27.02.20 01:37, Denis 'GNUtoo' Carikli wrote:
>>> This keeps the compatibility with the old bootcmd.
> [...]
>>> --- a/include/configs/tbs2910.h
>>> +++ b/include/configs/tbs2910.h
>>> @@ -8,6 +8,15 @@
>>>  #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)
>>> +
>>> +#include <config_distro_bootcmd.h>
>>> +
>>>  #include "mx6_common.h"
>> I prefer to include the new section below the existing #include
>> "mx6_common.h". This way we keep that include at the usual place in
>> the beginning, while marking the config_distro_bootcmd.h as special
>> case.
> Is right under the "General configuration" comment a good place for
> that?
>
If you ask, maybe a new section
/* Distroboot */
before " Environment organization" would look nicer. Or can this even go
below BOOTENV in your new CONFIG_EXTRA_ENV_SETTINGS?

Soeren

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-05-28  4:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27  0:36 [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Denis 'GNUtoo' Carikli
2020-02-27  0:36 ` [PATCH][v4 2/6] board: tbs2910: disable CONFIG_GZIP Denis 'GNUtoo' Carikli
2020-03-01 13:57   ` Soeren Moch
2020-02-27  0:36 ` [PATCH][v4 3/6] board: tbs2910: move CONFIG_BOOTCOMMAND from header to defconfig Denis 'GNUtoo' Carikli
2020-03-01 13:58   ` Soeren Moch
2020-02-27  0:37 ` [PATCH][v4 4/6] board: tbs2910: enable CONFIG_DISTRO_DEFAULTS Denis 'GNUtoo' Carikli
2020-03-01 13:58   ` Soeren Moch
2020-02-27  0:37 ` [PATCH][v4 5/6] board: tbs2910: Enable distro_boot support Denis 'GNUtoo' Carikli
2020-03-01 13:59   ` Soeren Moch
2020-05-27  0:39     ` Denis 'GNUtoo' Carikli
2020-05-28  4:54       ` Soeren Moch
2020-02-27  0:37 ` [PATCH][v4 6/6] board: tbs2910: add documentation Denis 'GNUtoo' Carikli
2020-03-01 13:59   ` Soeren Moch
2020-05-07 18:12     ` Soeren Moch
2020-05-09 17:36       ` Denis 'GNUtoo' Carikli
2020-05-10  9:11         ` Soeren Moch
2020-05-09 17:59     ` Denis 'GNUtoo' Carikli
2020-05-12 19:27       ` Soeren Moch
2020-03-01 13:57 ` [PATCH][v4 1/6] board: tbs2910: disable loadb and loads commands Soeren Moch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.