[U-Boot] [PATCH 0/7] Update support for Helios4 board

Hi everyone,
This series add some missing peripheral support and fixed that was implemented on U-Boot 2013.01 Marvell version: 2015_T1.0p16 - helios4: Update Load address - helios4: mmc: move environment before 1M - helios4: Enable I2C - helios4: Reset uSOM onboard phy during board init
and added new peripheral support and improvement - helios4: Enable mvebu GPIO and IO Expander - helios4: Enable SPI flash support - helios4: Reduce U-Boot image size
--- Aditya Prayoga (7): arm: mvebu: helios4: Update Load address arm: mvebu: helios4: mmc: move environment before 1M arm: mvebu: helios4: Enable I2C arm: mvebu: helios4: Enable mvebu GPIO and IO Expander arm: mvebu: helios4: Reduce U-Boot image size arm: mvebu: helios4: Enable SPI flash support arm: mvebu: helios4: Reset uSOM onboard phy during board init
arch/arm/dts/armada-388-helios4.dts | 9 ++++++ board/kobol/helios4/helios4.c | 37 ++++------------------- configs/helios4_defconfig | 13 +++++---- include/configs/helios4.h | 58 +++++++++++++++++++++++++------------ 4 files changed, 62 insertions(+), 55 deletions(-)

Use the values from U-Boot 2013.01 Marvell version: 2015_T1.0p16
Signed-off-by: Aditya Prayoga aditya@kobol.io --- include/configs/helios4.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/configs/helios4.h b/include/configs/helios4.h index ce912ea..c289490 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -145,11 +145,11 @@ func(PXE, pxe, na) \ func(DHCP, dhcp, na)
-#define KERNEL_ADDR_R __stringify(0x800000) -#define FDT_ADDR_R __stringify(0x100000) -#define RAMDISK_ADDR_R __stringify(0x1800000) -#define SCRIPT_ADDR_R __stringify(0x200000) -#define PXEFILE_ADDR_R __stringify(0x300000) +#define KERNEL_ADDR_R __stringify(0x2080000) +#define FDT_ADDR_R __stringify(0x2040000) +#define RAMDISK_ADDR_R __stringify(0x2880000) +#define SCRIPT_ADDR_R __stringify(0x3000000) +#define PXEFILE_ADDR_R __stringify(0x3100000)
#define LOAD_ADDRESS_ENV_SETTINGS \ "kernel_addr_r=" KERNEL_ADDR_R "\0" \

I would strongly prefer to keep the addresses consistent across platforms in u-boot. Is there bugs you are seeing as a result of this?
Dennis
On Wed, 2018-11-28 at 16:59 +0800, Aditya Prayoga wrote:
Use the values from U-Boot 2013.01 Marvell version: 2015_T1.0p16
Signed-off-by: Aditya Prayoga aditya@kobol.io
include/configs/helios4.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/configs/helios4.h b/include/configs/helios4.h index ce912ea..c289490 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -145,11 +145,11 @@ func(PXE, pxe, na) \ func(DHCP, dhcp, na)
-#define KERNEL_ADDR_R __stringify(0x800000) -#define FDT_ADDR_R __stringify(0x100000) -#define RAMDISK_ADDR_R __stringify(0x1800000) -#define SCRIPT_ADDR_R __stringify(0x200000) -#define PXEFILE_ADDR_R __stringify(0x300000) +#define KERNEL_ADDR_R __stringify(0x2080000) +#define FDT_ADDR_R __stringify(0x2040000) +#define RAMDISK_ADDR_R __stringify(0x2880000) +#define SCRIPT_ADDR_R __stringify(0x3000000) +#define PXEFILE_ADDR_R __stringify(0x3100000)
#define LOAD_ADDRESS_ENV_SETTINGS \ "kernel_addr_r=" KERNEL_ADDR_R "\0" \

Hi Dennis,
On Wed, Nov 28, 2018 at 8:40 PM Dennis Gilmore dgilmore@redhat.com wrote:
I would strongly prefer to keep the addresses consistent across platforms in u-boot. Is there bugs you are seeing as a result of this?
At that time, I was not able to load linux with these commands setenv bootargs "${console} root=/dev/mmcblk0p1 rootwait rw scandelay ignore_loglevel" load mmc 0:1 ${kernel_addr_r} /boot/zImage load mmc 0:1 ${ramdisk_addr_r} /boot/uInitrd load mmc 0:1 ${fdt_addr_r} /boot/dtb/${fdtfile} bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
but after getting your feedback, I re-tested it without this patch and it's running fine. So no reason to apply this patch anymore. I will remove it on next version. Thanks
Aditya
Dennis
On Wed, 2018-11-28 at 16:59 +0800, Aditya Prayoga wrote:
Use the values from U-Boot 2013.01 Marvell version: 2015_T1.0p16
Signed-off-by: Aditya Prayoga aditya@kobol.io
include/configs/helios4.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/configs/helios4.h b/include/configs/helios4.h index ce912ea..c289490 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -145,11 +145,11 @@ func(PXE, pxe, na) \ func(DHCP, dhcp, na)
-#define KERNEL_ADDR_R __stringify(0x800000) -#define FDT_ADDR_R __stringify(0x100000) -#define RAMDISK_ADDR_R __stringify(0x1800000) -#define SCRIPT_ADDR_R __stringify(0x200000) -#define PXEFILE_ADDR_R __stringify(0x300000) +#define KERNEL_ADDR_R __stringify(0x2080000) +#define FDT_ADDR_R __stringify(0x2040000) +#define RAMDISK_ADDR_R __stringify(0x2880000) +#define SCRIPT_ADDR_R __stringify(0x3000000) +#define PXEFILE_ADDR_R __stringify(0x3100000)
#define LOAD_ADDRESS_ENV_SETTINGS \ "kernel_addr_r=" KERNEL_ADDR_R "\0" \

Store the environment before 1M into the block device. This constant is easier to remember, saves a little space, and is in line with what SolidRun's 2018.01-based fork does for the clearfog.
Signed-off-by: Josua Mayer josua.mayer97@gmail.com [ Aditya Prayoga: * Port forward] Signed-off-by: Aditya Prayoga aditya@kobol.io --- include/configs/helios4.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/include/configs/helios4.h b/include/configs/helios4.h index c289490..1401a12 100644 --- a/include/configs/helios4.h +++ b/include/configs/helios4.h @@ -46,14 +46,9 @@ /* Environment in MMC */ #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SECT_SIZE 0x200 -#define CONFIG_ENV_SIZE 0x10000 -/* - * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC - * boot image starts @ LBA-0. - * As result in MMC/eMMC case it will be a 1 sector gap between u-boot - * image and environment - */ -#define CONFIG_ENV_OFFSET 0xf0000 +#define CONFIG_ENV_SIZE 0x2000 +/* stay within first 1M */ +#define CONFIG_ENV_OFFSET (SZ_1M - CONFIG_ENV_SIZE) #define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET
#define CONFIG_PHY_MARVELL /* there is a marvell phy */

Enable Marvell I2C driver and set default bus to external I2C bus. Define I2C aliases in device tree so it can be recognized by the driver.
Signed-off-by: Aditya Prayoga aditya@kobol.io --- arch/arm/dts/armada-388-helios4.dts | 2 ++ configs/helios4_defconfig | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/arch/arm/dts/armada-388-helios4.dts b/arch/arm/dts/armada-388-helios4.dts index a154e0f..711fc22 100644 --- a/arch/arm/dts/armada-388-helios4.dts +++ b/arch/arm/dts/armada-388-helios4.dts @@ -24,6 +24,8 @@ aliases { /* So that mvebu u-boot can update the MAC addresses */ ethernet1 = ð0; + i2c0 = &i2c0; + i2c1 = &i2c1; };
chosen { diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index e30eb3d..8ac8978 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -39,6 +39,9 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_SCSI_AHCI=y CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x1 CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_MV=y

On Wed, 2018-11-28 at 16:59 +0800, Aditya Prayoga wrote:
Enable Marvell I2C driver and set default bus to external I2C bus. Define I2C aliases in device tree so it can be recognized by the driver.
Signed-off-by: Aditya Prayoga aditya@kobol.io
arch/arm/dts/armada-388-helios4.dts | 2 ++ configs/helios4_defconfig | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/arch/arm/dts/armada-388-helios4.dts b/arch/arm/dts/armada-388-helios4.dts index a154e0f..711fc22 100644 --- a/arch/arm/dts/armada-388-helios4.dts +++ b/arch/arm/dts/armada-388-helios4.dts @@ -24,6 +24,8 @@ aliases { /* So that mvebu u-boot can update the MAC addresses */ ethernet1 = ð0;
i2c0 = &i2c0;
i2c1 = &i2c1;
have you sent the dts changes to the linux kernel also?
Dennis
};
chosen { diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index e30eb3d..8ac8978 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -39,6 +39,9 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_SCSI_AHCI=y CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x1 CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_MV=y

On Wed, Nov 28, 2018 at 8:44 PM Dennis Gilmore dgilmore@redhat.com wrote:
On Wed, 2018-11-28 at 16:59 +0800, Aditya Prayoga wrote:
Enable Marvell I2C driver and set default bus to external I2C bus. Define I2C aliases in device tree so it can be recognized by the driver.
Signed-off-by: Aditya Prayoga aditya@kobol.io
arch/arm/dts/armada-388-helios4.dts | 2 ++ configs/helios4_defconfig | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/arch/arm/dts/armada-388-helios4.dts b/arch/arm/dts/armada-388-helios4.dts index a154e0f..711fc22 100644 --- a/arch/arm/dts/armada-388-helios4.dts +++ b/arch/arm/dts/armada-388-helios4.dts @@ -24,6 +24,8 @@ aliases { /* So that mvebu u-boot can update the MAC addresses */ ethernet1 = ð0;
i2c0 = &i2c0;
i2c1 = &i2c1;
have you sent the dts changes to the linux kernel also?
No, I haven't. Should I also send it to Linux kernel? WIthout those aliases, Linux can detect the i2c buses.
Aditya
Dennis
}; chosen {
diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index e30eb3d..8ac8978 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -39,6 +39,9 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_SCSI_AHCI=y CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x1 CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_MV=y

El jue, 29-11-2018 a las 00:42 +0700, Aditya Prayoga escribió:
On Wed, Nov 28, 2018 at 8:44 PM Dennis Gilmore dgilmore@redhat.com wrote:
On Wed, 2018-11-28 at 16:59 +0800, Aditya Prayoga wrote:
Enable Marvell I2C driver and set default bus to external I2C bus. Define I2C aliases in device tree so it can be recognized by the driver.
Signed-off-by: Aditya Prayoga aditya@kobol.io
arch/arm/dts/armada-388-helios4.dts | 2 ++ configs/helios4_defconfig | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/arch/arm/dts/armada-388-helios4.dts b/arch/arm/dts/armada-388-helios4.dts index a154e0f..711fc22 100644 --- a/arch/arm/dts/armada-388-helios4.dts +++ b/arch/arm/dts/armada-388-helios4.dts @@ -24,6 +24,8 @@ aliases { /* So that mvebu u-boot can update the MAC addresses */ ethernet1 = ð0;
i2c0 = &i2c0;
i2c1 = &i2c1;
have you sent the dts changes to the linux kernel also?
No, I haven't. Should I also send it to Linux kernel? WIthout those aliases, Linux can detect the i2c buses.
we should put them in -u-boot.dtsi files if they are not needed then. u-boot has been trying to make sure that they can sync devicetree files from the kernel without modification.
Dennis
Aditya
Dennis
}; chosen {
diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index e30eb3d..8ac8978 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -39,6 +39,9 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_SCSI_AHCI=y CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_I2C_DEFAULT_BUS_NUMBER=0x1 CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_MV=y
participants (2)
-
Aditya Prayoga
-
Dennis Gilmore