[PATCH 0/3] arm: mvebu: helios-4: add defconfig forspi booting et al

This patch-set introduces a new defconfig for spi booting on kobol helios-4.
Additionally add minor update for default defconfig to enable setexpr command, and fix u-boot command access to i2c0 bus.
Signed-off-by: Josua Mayer josua@solid-run.com --- Josua Mayer (3): arm: dts: armada-38x-solidrun-microsom: configure i2c0 bus arm: mvebu: helios4_defconfig: enable setexpr command arm: mvebu: helios-4: add defconfig for spi booting
arch/arm/dts/armada-38x-solidrun-microsom.dtsi | 5 ++ configs/helios4_defconfig | 1 - configs/helios4_spi_defconfig | 81 ++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) --- base-commit: 547d3dd28a46a18d59e00a153c8becca8d4e8cf9 change-id: 20240113-helios4-spi-144085c0bbc7
Sincerely,

SolidRun Armada-388 SoM has an i2c bus supporting on-som eeprom, and peripherals on a carrier. armada-38x.dtsi disables this bus by default, it should be enabled by som or carrier dts.
Linux has moved i2c0 from helios-4 board dts to som dtsi, including status, pinctrl and clock speed. Copy these settings from mainline.
This fixes accessing i2c bus from u-boot commandline.
Signed-off-by: Josua Mayer josua@solid-run.com --- arch/arm/dts/armada-38x-solidrun-microsom.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/arch/arm/dts/armada-38x-solidrun-microsom.dtsi b/arch/arm/dts/armada-38x-solidrun-microsom.dtsi index f6ae784bed..1540162e03 100644 --- a/arch/arm/dts/armada-38x-solidrun-microsom.dtsi +++ b/arch/arm/dts/armada-38x-solidrun-microsom.dtsi @@ -99,6 +99,11 @@ };
&i2c0 { + clock-frequency = <400000>; + pinctrl-0 = <&i2c0_pins>; + pinctrl-names = "default"; + status = "okay"; + eeprom@53 { compatible = "atmel,24c02"; reg = <0x53>;

Update the helios4 defconfig to enable the 'setexpr' command, which is a default and useful for various complex boot-scripts.
Signed-off-by: Josua Mayer josua@solid-run.com --- configs/helios4_defconfig | 1 - 1 file changed, 1 deletion(-)
diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index 1d8d374fe2..5f568d1695 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -44,7 +44,6 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y -# CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TFTPPUT=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y

Add a new defconfig based on existing helios4_config file to support booting from spi flash.
Settings for environment location are based on vendor u-boot: https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L5...
A separate defconfig is required because the options are not intuitive from menuconfig, numeric values in particular.
Signed-off-by: Josua Mayer josua@solid-run.com --- configs/helios4_spi_defconfig | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
diff --git a/configs/helios4_spi_defconfig b/configs/helios4_spi_defconfig new file mode 100644 index 0000000000..6b8c6dfc56 --- /dev/null +++ b/configs/helios4_spi_defconfig @@ -0,0 +1,81 @@ +CONFIG_ARM=y +CONFIG_ARCH_CPU_INIT=y +CONFIG_SYS_THUMB_BUILD=y +CONFIG_ARCH_MVEBU=y +CONFIG_TEXT_BASE=0x00800000 +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_NR_DRAM_BANKS=2 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xff0000 +CONFIG_TARGET_HELIOS4=y +CONFIG_ENV_OFFSET=0x100000 +CONFIG_ENV_SECT_SIZE=0x10000 +CONFIG_DEFAULT_DEVICE_TREE="armada-388-helios4" +CONFIG_SPL_TEXT_BASE=0x40000030 +CONFIG_SPL_SERIAL=y +CONFIG_SPL_STACK=0x4002c000 +CONFIG_SPL=y +CONFIG_DEBUG_UART_BASE=0xf1012000 +CONFIG_DEBUG_UART_CLOCK=250000000 +CONFIG_SYS_LOAD_ADDR=0x800000 +CONFIG_PCI=y +CONFIG_DEBUG_UART=y +CONFIG_AHCI=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTDELAY=3 +CONFIG_USE_PREBOOT=y +CONFIG_SYS_CONSOLE_INFO_QUIET=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_MAX_SIZE=0x22fd0 +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y +CONFIG_SPL_BSS_START_ADDR=0x40023000 +CONFIG_SPL_BSS_MAX_SIZE=0x4000 +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +CONFIG_SPL_I2C=y +CONFIG_SYS_MAXARGS=32 +CONFIG_CMD_TLV_EEPROM=y +CONFIG_SPL_CMD_TLV_EEPROM=y +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_PCI=y +CONFIG_CMD_SPI=y +CONFIG_CMD_USB=y +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_TIME=y +CONFIG_ENV_OVERWRITE=y +CONFIG_ENV_MIN_ENTRIES=128 +CONFIG_ARP_TIMEOUT=200 +CONFIG_NET_RETRY_COUNT=50 +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_SPL_OF_TRANSLATE=y +CONFIG_AHCI_MVEBU=y +CONFIG_DM_PCA953X=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_I2C_EEPROM=y +CONFIG_SPL_I2C_EEPROM=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SDMA=y +CONFIG_MMC_SDHCI_MV=y +CONFIG_MTD=y +CONFIG_SF_DEFAULT_BUS=1 +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_PHY_MARVELL=y +CONFIG_PHY_GIGE=y +CONFIG_MVNETA=y +CONFIG_MII=y +CONFIG_MVMDIO=y +CONFIG_PCI_MVEBU=y +CONFIG_SPL_DEBUG_UART_BASE=0xd0012000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYS_NS16550=y +CONFIG_KIRKWOOD_SPI=y +CONFIG_USB=y +CONFIG_USB_XHCI_HCD=y

On Sat, Jan 13, 2024 at 05:36:57PM +0100, Josua Mayer wrote:
Add a new defconfig based on existing helios4_config file to support booting from spi flash.
Settings for environment location are based on vendor u-boot: https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L5...
A separate defconfig is required because the options are not intuitive from menuconfig, numeric values in particular.
Signed-off-by: Josua Mayer josua@solid-run.com
configs/helios4_spi_defconfig | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
So, a super new thing that might be of interest, but please try this since I'd like to prove/disprove the use-case. This could instead be: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" ... enable/disable options specific to the SPI boot use case ...
And so now both boards will otherwise be kept in-sync for general config changes. It could further be done as: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" #include "board/kobol/helios4/spiboot.config"
And have board/kobol/helios4/spiboot.config contain the SPI-boot specific options. This path would allow for: make helios4_defconfig spiboot.config to be a valid alternative way of configuring a build for spiboot.

Hi Tim,
Am 13.01.24 um 18:22 schrieb Tom Rini:
On Sat, Jan 13, 2024 at 05:36:57PM +0100, Josua Mayer wrote:
Add a new defconfig based on existing helios4_config file to support booting from spi flash.
Settings for environment location are based on vendor u-boot: https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L5...
A separate defconfig is required because the options are not intuitive from menuconfig, numeric values in particular.
Signed-off-by: Josua Mayer josua@solid-run.com
configs/helios4_spi_defconfig | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
So, a super new thing that might be of interest, but please try this since I'd like to prove/disprove the use-case. This could instead be: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" ... enable/disable options specific to the SPI boot use case ...
I will try it, I like the idea conceptually.
And so now both boards will otherwise be kept in-sync for general config changes. It could further be done as: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" #include "board/kobol/helios4/spiboot.config"
Here is potential for making it infinitely complex. E.g. one might argue there should be an armada38x_spi.config
And have board/kobol/helios4/spiboot.config contain the SPI-boot specific options. This path would allow for: make helios4_defconfig spiboot.config to be a valid alternative way of configuring a build for spiboot.

On Sun, Jan 14, 2024 at 09:47:31AM +0000, Josua Mayer wrote:
Hi Tim,
Am 13.01.24 um 18:22 schrieb Tom Rini:
On Sat, Jan 13, 2024 at 05:36:57PM +0100, Josua Mayer wrote:
Add a new defconfig based on existing helios4_config file to support booting from spi flash.
Settings for environment location are based on vendor u-boot: https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L5...
A separate defconfig is required because the options are not intuitive from menuconfig, numeric values in particular.
Signed-off-by: Josua Mayer josua@solid-run.com
configs/helios4_spi_defconfig | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
So, a super new thing that might be of interest, but please try this since I'd like to prove/disprove the use-case. This could instead be: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" ... enable/disable options specific to the SPI boot use case ...
I will try it, I like the idea conceptually.
OK.
And so now both boards will otherwise be kept in-sync for general config changes. It could further be done as: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" #include "board/kobol/helios4/spiboot.config"
Here is potential for making it infinitely complex. E.g. one might argue there should be an armada38x_spi.config
Yes, and it depends a little on the use cases of the hardware platforms what makes the most sense. Today we have some Tegra platforms that started out using config fragments, but thinking about it right now should perhaps change to this style of defconfig. On the other hand, TI is intentionally adding feature.config fragments as the "feature.config" doesn't change between parts of the K3 family and should also be re-used on custom designs to enable that feature. Things are new enough here that I want people to experiment and see what works best for their use cases rather than providing strict rules just yet.

Am 14.01.24 um 15:37 schrieb Tom Rini:
On Sun, Jan 14, 2024 at 09:47:31AM +0000, Josua Mayer wrote:
Hi Tim,
Am 13.01.24 um 18:22 schrieb Tom Rini:
On Sat, Jan 13, 2024 at 05:36:57PM +0100, Josua Mayer wrote:
Add a new defconfig based on existing helios4_config file to support booting from spi flash.
Settings for environment location are based on vendor u-boot: https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L5...
A separate defconfig is required because the options are not intuitive from menuconfig, numeric values in particular.
Signed-off-by: Josua Mayer josua@solid-run.com
configs/helios4_spi_defconfig | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
So, a super new thing that might be of interest, but please try this since I'd like to prove/disprove the use-case. This could instead be: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" ... enable/disable options specific to the SPI boot use case ...
I will try it, I like the idea conceptually.
OK.
And so now both boards will otherwise be kept in-sync for general config changes. It could further be done as: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" #include "board/kobol/helios4/spiboot.config"
Here is potential for making it infinitely complex. E.g. one might argue there should be an armada38x_spi.config
Yes, and it depends a little on the use cases of the hardware platforms what makes the most sense. Today we have some Tegra platforms that started out using config fragments, but thinking about it right now should perhaps change to this style of defconfig.
Using the fragments avoids adding more defconfig files, and adding to MAINTAINERS file. So I attempt this method for v2.
My reasoning would be that boot media related options are mostly maintainers choices to be made once per product, and then kept constant. So it fits better in board/ directory than configs/.
On the other hand, TI is intentionally adding feature.config fragments as the "feature.config" doesn't change between parts of the K3 family and should also be re-used on custom designs to enable that feature. Things are new enough here that I want people to experiment and see what works best for their use cases rather than providing strict rules just yet.

Hi Josua,
On 1/13/24 18:22, Tom Rini wrote:
On Sat, Jan 13, 2024 at 05:36:57PM +0100, Josua Mayer wrote:
Add a new defconfig based on existing helios4_config file to support booting from spi flash.
Settings for environment location are based on vendor u-boot: https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L5...
A separate defconfig is required because the options are not intuitive from menuconfig, numeric values in particular.
Signed-off-by: Josua Mayer josua@solid-run.com
configs/helios4_spi_defconfig | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
So, a super new thing that might be of interest, but please try this since I'd like to prove/disprove the use-case. This could instead be: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" ... enable/disable options specific to the SPI boot use case ...
And so now both boards will otherwise be kept in-sync for general config changes. It could further be done as: configs/helios4_spi_defconfig: #include "configs/helios4_defconfig" #include "board/kobol/helios4/spiboot.config"
And have board/kobol/helios4/spiboot.config contain the SPI-boot specific options. This path would allow for: make helios4_defconfig spiboot.config to be a valid alternative way of configuring a build for spiboot.
That would be cool.
Still: The current version leads to this compilation warning:
WARNING: no maintainers for 'helios4_spi'
Please fix in v2.
Thanks, Stefan
BTW: Could you please also Cc me directly with such patches?
participants (3)
-
Josua Mayer
-
Stefan Roese
-
Tom Rini