Skip to contentSkip to conversation

Update support for Helios4 board

PATCH Superseded Aditya Prayoga 2 participants 9 messages Nov 28, 2018 Arm (32-bit)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/7 arm: mvebu: helios4: Update Load address

Use the values from U-Boot 2013.01 Marvell version: 2015_T1.0p16

---
 include/configs/helios4.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/helios4.h +5 -5
index ce912ea..c289490 100644
@@ -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" \
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/7 arm: mvebu: helios4: Update Load address

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

Quoted 28 lines · Aditya Prayoga

Use the values from U-Boot 2013.01 Marvell version: 2015_T1.0p16

---
 include/configs/helios4.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/helios4.h +5 -5
index ce912ea..c289490 100644
@@ -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" \
#3 lore raw

PATCH 1/7 arm: mvebu: helios4: Update Load address

Hi Dennis,

Quoted 4 lines · Dennis Gilmore

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

Quoted 32 lines

Dennis

Quoted 28 lines · Aditya Prayoga

Use the values from U-Boot 2013.01 Marvell version: 2015_T1.0p16

---
 include/configs/helios4.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/helios4.h +5 -5
index ce912ea..c289490 100644
@@ -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" \
#4 lore raw

PATCH 2/7 arm: mvebu: helios4: mmc: move environment before 1M

In reply to Aditya Prayoga

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.

[ Aditya Prayoga:
* Port forward]

---
 include/configs/helios4.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
include/configs/helios4.h +3 -8
index c289490..1401a12 100644
@@ -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 */
Signature · 1 line
2.7.4
#5 lore raw

PATCH 3/7 arm: mvebu: helios4: Enable I2C

In reply to Aditya Prayoga

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.

---
 arch/arm/dts/armada-388-helios4.dts | 2 ++
 configs/helios4_defconfig           | 3 +++
 2 files changed, 5 insertions(+)
arch/arm/dts/armada-388-helios4.dts +2 -0
index a154e0f..711fc22 100644
@@ -24,6 +24,8 @@
 	aliases {
 		/* So that mvebu u-boot can update the MAC addresses */
 		ethernet1 = &eth0;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
 	};
 
 	chosen {
configs/helios4_defconfig +3 -0
index e30eb3d..8ac8978 100644
@@ -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
Signature · 1 line
2.7.4
#6 lore raw

PATCH 3/7 arm: mvebu: helios4: Enable I2C

Quoted 16 lines · Aditya Prayoga

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.

---
 arch/arm/dts/armada-388-helios4.dts | 2 ++
 configs/helios4_defconfig           | 3 +++
 2 files changed, 5 insertions(+)
arch/arm/dts/armada-388-helios4.dts +0 -0
index a154e0f..711fc22 100644

arch/arm/dts/armada-388-helios4.dts line 28

Quoted 5 lines
arch/arm/dts/armada-388-helios4.dts +2 -0
@@ -24,6 +24,8 @@
 	aliases {
 		/* So that mvebu u-boot can update the MAC addresses */
 		ethernet1 = &eth0;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;

have you sent the dts changes to the linux kernel also?

Dennis

Quoted 17 lines
arch/arm/dts/armada-388-helios4.dts +0 -0
 	};
 
 	chosen {
configs/helios4_defconfig +3 -0
index e30eb3d..8ac8978 100644
@@ -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
#7 lore raw

PATCH 3/7 arm: mvebu: helios4: Enable I2C

Quoted 12 lines · Dennis Gilmore
Quoted 10 lines · Aditya Prayoga

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.

---
 arch/arm/dts/armada-388-helios4.dts | 2 ++
 configs/helios4_defconfig           | 3 +++
 2 files changed, 5 insertions(+)
Quoted 13 lines

arch/arm/dts/armada-388-helios4.dts line 28

Quoted 11 lines
arch/arm/dts/armada-388-helios4.dts +2 -0
index a154e0f..711fc22 100644
@@ -24,6 +24,8 @@
      aliases {
              /* So that mvebu u-boot can update the MAC addresses */
              ethernet1 = &eth0;
+             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

Quoted 19 lines

Dennis

Quoted 17 lines
arch/arm/dts/armada-388-helios4.dts +0 -0
      };
 
      chosen {
configs/helios4_defconfig +3 -0
index e30eb3d..8ac8978 100644
@@ -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
#8 lore raw

PATCH 3/7 arm: mvebu: helios4: Enable I2C

El jue, 29-11-2018 a las 00:42 +0700, Aditya Prayoga escribió:

Quoted 29 lines
Quoted 12 lines · Dennis Gilmore
Quoted 11 lines · Aditya Prayoga

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.

---
 arch/arm/dts/armada-388-helios4.dts | 2 ++
 configs/helios4_defconfig           | 3 +++
 2 files changed, 5 insertions(+)
Quoted 14 lines

arch/arm/dts/armada-388-helios4.dts line 28

Quoted 12 lines
arch/arm/dts/armada-388-helios4.dts +0 -0
index a154e0f..711fc22 100644
@@ -24,6 +24,8 @@
      aliases {
              /* So that mvebu u-boot can update the MAC

addresses */

              ethernet1 = &eth0;
arch/arm/dts/armada-388-helios4.dts +2 -0
+             i2c0 = &i2c0;
+             i2c1 = &i2c1;

have you sent the dts changes to the linux kernel also?

Quoted 3 lines

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

Quoted 21 lines

Aditya

Quoted 19 lines

Dennis

Quoted 18 lines
      };

      chosen {
configs/helios4_defconfig +3 -0
index e30eb3d..8ac8978 100644
@@ -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