diff mbox series

[v2,3/3] board: tbs2910: Add support for generic distro configuration

Message ID 20200128170418.15912-3-GNUtoo@cyberdimension.org
State New
Headers show
Series [v2,1/3] tbs2910: disable fuse command | expand

Commit Message

Denis 'GNUtoo' Carikli Jan. 28, 2020, 5:04 p.m. UTC
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.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 configs/tbs2910_defconfig | 17 ++++-------------
 include/configs/tbs2910.h | 37 ++++++++++++++++++++++++++++---------
 2 files changed, 32 insertions(+), 22 deletions(-)

Comments

Soeren Moch Jan. 28, 2020, 5:51 p.m. UTC | #1
On 28.01.20 18:04, 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.
>
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
There are a lot of unrelated/unexplained changes in tbs2910_defconfig.
This probably should not be part of this patch.

As already discussed, the bootm_size environment variable is not
necessary, otherwise  somewhat dangerous with this value.

The requested changes for CONFIG_BOOTCOMMAND are not addressed in this v2.

Soeren

> ---
>  configs/tbs2910_defconfig | 17 ++++-------------
>  include/configs/tbs2910.h | 37 ++++++++++++++++++++++++++++---------
>  2 files changed, 32 insertions(+), 22 deletions(-)
>
> diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
> index 0e91eeffd4..0d9e11bd20 100644
> --- a/configs/tbs2910_defconfig
> +++ b/configs/tbs2910_defconfig
> @@ -9,16 +9,16 @@ 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 is not set
>  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_DEFAULT_FDT_FILE="imx6q-tbs2910.dtb"
>  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
> @@ -30,22 +30,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"
> @@ -75,7 +67,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
> diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
> index b598fca1ec..abeca16555 100644
> --- a/include/configs/tbs2910.h
> +++ b/include/configs/tbs2910.h
> @@ -8,6 +8,24 @@
>  #ifndef __TBS2910_CONFIG_H
>  #define __TBS2910_CONFIG_H
>  
> +#define CONFIG_BOOTCOMMAND \
> +	"mmc rescan; " \
> +	"if run bootcmd_up1; then " \
> +		"run bootcmd_up2; " \
> +	"else " \
> +		"run bootcmd_mmc || run distro_bootcmd; " \
> +	"fi"
> +
> +#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 <config_distro_bootcmd.h>
> +
>  #include "mx6_common.h"
>  
>  /* General configuration */
> @@ -80,6 +98,13 @@
>  #define CONFIG_BOARD_SIZE_LIMIT		392192 /* (CONFIG_ENV_OFFSET - 1024) */
>  
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> +	"bootm_size=0x80000000\0" \
> +	"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,14 +127,8 @@
>  			"setenv stderr serial,vga\0" \
>  	"stderr=serial,vga\0" \
>  	"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"
> +	"stdout=serial,vga\0" \
> +	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> +	BOOTENV
>  
>  #endif			       /* __TBS2910_CONFIG_H * */
Denis 'GNUtoo' Carikli Jan. 28, 2020, 9:16 p.m. UTC | #2
On Tue, 28 Jan 2020 18:51:26 +0100
Soeren Moch <smoch at web.de> wrote:

> There are a lot of unrelated/unexplained changes in tbs2910_defconfig.
> This probably should not be part of this patch.
I changed only 2 things here:
- I added CONFIG_DISTRO_DEFAULTS=y
- I added CONFIG_DEFAULT_FDT_FILE="imx6q-tbs2910.dtb"

I double checked that change before sending the patch.

Here the big diff is due to savedefconfig minimizing the defconfig after
enabling CONFIG_DISTRO_DEFAULTS=y.

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/20200128/773f545a/attachment.sig>
Denis 'GNUtoo' Carikli Jan. 28, 2020, 9:27 p.m. UTC | #3
On Tue, 28 Jan 2020 18:51:26 +0100
Soeren Moch <smoch at web.de> wrote:

> As already discussed, the bootm_size environment variable is not
> necessary, otherwise  somewhat dangerous with this value.
Sorry, for the mistake, I've fixed it now.

I'll send a v3 after some feedback from my response to your other
points.

Thanks a lot for the reviews.

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/20200128/1801faee/attachment.sig>
Soeren Moch Jan. 29, 2020, 11:48 p.m. UTC | #4
On 28.01.20 22:27, Denis 'GNUtoo' Carikli wrote:
> On Tue, 28 Jan 2020 18:51:26 +0100
> Soeren Moch <smoch at web.de> wrote:
>
>> As already discussed, the bootm_size environment variable is not
>> necessary, otherwise  somewhat dangerous with this value.
> Sorry, for the mistake, I've fixed it now.
>
> I'll send a v3 after some feedback from my response to your other
> points.
Thanks.
Not all expected patches made it into v2020.04-rc1. I have to check what
happened here before I will come back to your patch. Unfortunately I
will ask you for additional changes.

Please do not split your response into several e-mails.

Thanks,
Soeren


>
> Thanks a lot for the reviews.
>
> Denis.
Soeren Moch Jan. 30, 2020, 10:14 p.m. UTC | #5
On 28.01.20 22:27, Denis 'GNUtoo' Carikli wrote:
> On Tue, 28 Jan 2020 18:51:26 +0100
> Soeren Moch <smoch at web.de> wrote:
>
>> As already discussed, the bootm_size environment variable is not
>> necessary, otherwise  somewhat dangerous with this value.
> Sorry, for the mistake, I've fixed it now.
>
> I'll send a v3 after some feedback from my response to your other
> points.
>
> Thanks a lot for the reviews.
For your v3 please drop patch 1/3, please disable CONFIG_GZIP instead.
If you want to indicate the size reduction, please do so for u-boot.bin
instead of u-boot.imx. And please only report the size reduction instead
of absolute size values, as suggested by Fabio.

For patch 2/3 please include my Acked-by, and update size reduction
description as suggested above.

Please split patch 3/3 into 3 separate patches:
- Move (the existing) CONFIG_BOOTCOMMAND to defconfig.
- Enable DISTRO_DEFAULTS in defconfig, in preparation of distro_boot
support. Also do the defconfig sync here.
- Enable distro_boot support. This includes the modified BOOTCOMMAND,
DEFAULT_FDT_FILE,BOOT_TARGET_DEVICES, and environment update.

For all patches please also Cc: Stefano and Fabio.

Thanks,
Soeren
diff mbox series

Patch

diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
index 0e91eeffd4..0d9e11bd20 100644
--- a/configs/tbs2910_defconfig
+++ b/configs/tbs2910_defconfig
@@ -9,16 +9,16 @@  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 is not set
 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_DEFAULT_FDT_FILE="imx6q-tbs2910.dtb"
 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
@@ -30,22 +30,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"
@@ -75,7 +67,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
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index b598fca1ec..abeca16555 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -8,6 +8,24 @@ 
 #ifndef __TBS2910_CONFIG_H
 #define __TBS2910_CONFIG_H
 
+#define CONFIG_BOOTCOMMAND \
+	"mmc rescan; " \
+	"if run bootcmd_up1; then " \
+		"run bootcmd_up2; " \
+	"else " \
+		"run bootcmd_mmc || run distro_bootcmd; " \
+	"fi"
+
+#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 <config_distro_bootcmd.h>
+
 #include "mx6_common.h"
 
 /* General configuration */
@@ -80,6 +98,13 @@ 
 #define CONFIG_BOARD_SIZE_LIMIT		392192 /* (CONFIG_ENV_OFFSET - 1024) */
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
+	"bootm_size=0x80000000\0" \
+	"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,14 +127,8 @@ 
 			"setenv stderr serial,vga\0" \
 	"stderr=serial,vga\0" \
 	"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"
+	"stdout=serial,vga\0" \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+	BOOTENV
 
 #endif			       /* __TBS2910_CONFIG_H * */