Skip to contentSkip to conversation

ARM: mvebu: helios4 adjust env sizes to enable SPI to work

PATCH Superseded dgilmore at redhat.com 2 participants 5 messages Dec 7, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ARM: mvebu: helios4 adjust env sizes to enable SPI to work

From: Dennis Gilmore <[email protected]>

mirror the clearfog setup to enable SPI to work

---
 arch/arm/mach-mvebu/Kconfig |  1 +
 board/kobol/helios4/Kconfig | 24 ++++++++++++++++++++++++
 configs/helios4_defconfig   |  2 --
 3 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 board/kobol/helios4/Kconfig
arch/arm/mach-mvebu/Kconfig +1 -0
index 0d8e0922a2..66fd771dff 100644
@@ -293,5 +293,6 @@ config SECURED_MODE_CSK_INDEX
 	depends on SECURED_MODE_IMAGE
 
 source "board/solidrun/clearfog/Kconfig"
+source "board/kobol/helios4/Kconfig"
 
 endif
board/kobol/helios4/Kconfig new file +24 -0
new file mode 100644
index 0000000000..cad51c1cf0
@@ -0,0 +1,24 @@
+menu "Helios4 configuration"
+	depends on TARGET_HELIOS4
+
+config ENV_SIZE
+	hex "Environment Size"
+	default 0x10000
+
+config ENV_OFFSET
+	hex "Environment offset"
+	default 0xF0000
+
+config ENV_SECT_SIZE
+	hex "Environment Sector-Size"
+	# Use SPI or SATA flash erase block size of 4 KiB
+	default 0x1000 if MVEBU_SPL_BOOT_DEVICE_SPI || MVEBU_SPL_BOOT_DEVICE_SATA
+	# Use optimistic 64 KiB erase block, will vary between actual media
+	default 0x10000 if MVEBU_SPL_BOOT_DEVICE_MMC || MVEBU_SPL_BOOT_DEVICE_UART
+
+config SYS_SPI_U_BOOT_OFFS
+	hex "address of u-boot payload in SPI flash"
+	default 0x20000
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
+endmenu
configs/helios4_defconfig +0 -2
index eceb85f082..bdc6f43554 100644
@@ -9,8 +9,6 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_TARGET_HELIOS4=y
 CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC=y
-CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_OFFSET=0xFE000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_TEXT_BASE=0x40000030
 CONFIG_SPL_SERIAL_SUPPORT=y
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/4 ARM: mvebu: helios4 dts changes to enable SPI

From: Dennis Gilmore <[email protected]>

mirror seettings for the clearfog on the helios4 to get SPI working.

---
 arch/arm/dts/armada-388-helios4-u-boot.dtsi | 22 ++++++----
 arch/arm/dts/armada-388-helios4.dts         | 46 ++++++++++++++++++++-
 2 files changed, 58 insertions(+), 10 deletions(-)
arch/arm/dts/armada-388-helios4-u-boot.dtsi +13 -9
index 0753889854..82513a1ce7 100644
@@ -1,13 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-/ {
-	aliases {
-		i2c0 = &i2c0;
-		i2c1 = &i2c1;
-		spi1 = &spi1;
-	};
-};
-
 &eth0 {
 	phy-reset-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
 };
@@ -37,5 +29,17 @@
 };
 
 &sdhci {
-       u-boot,dm-spl;
+	u-boot,dm-spl;
+};
+
+&i2c0 {
+	u-boot,dm-spl;
+
+	eeprom at 52 {
+		u-boot,dm-spl;
+	};
+
+	eeprom at 53 {
+		u-boot,dm-spl;
+	};
 };
arch/arm/dts/armada-388-helios4.dts +45 -1

58 lines not on this page · raw message

Signature · 1 line
2.28.0
#2 lore raw

PATCH 2/4 ARM: mvebu: helios4 dts changes to enable SPI

Hi Dennis,

Quoted 84 lines · dgilmore at redhat.com

From: Dennis Gilmore <[email protected]>

mirror seettings for the clearfog on the helios4 to get SPI working.

---
 arch/arm/dts/armada-388-helios4-u-boot.dtsi | 22 ++++++----
 arch/arm/dts/armada-388-helios4.dts         | 46 ++++++++++++++++++++-
 2 files changed, 58 insertions(+), 10 deletions(-)
arch/arm/dts/armada-388-helios4-u-boot.dtsi +13 -9
index 0753889854..82513a1ce7 100644
@@ -1,13 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-/ {
-	aliases {
-		i2c0 = &i2c0;
-		i2c1 = &i2c1;
-		spi1 = &spi1;
-	};
-};
-
 &eth0 {
 	phy-reset-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
 };
@@ -37,5 +29,17 @@
 };
 
 &sdhci {
-       u-boot,dm-spl;
+	u-boot,dm-spl;
+};
+
+&i2c0 {
+	u-boot,dm-spl;
+
+	eeprom at 52 {
+		u-boot,dm-spl;
+	};
+
+	eeprom at 53 {
+		u-boot,dm-spl;
+	};
 };
arch/arm/dts/armada-388-helios4.dts +18 -1
index fb49df2a3b..e948b94090 100644
@@ -22,10 +22,14 @@
 	};
 
 	aliases {
-		/* So that mvebu u-boot can update the MAC addresses */
+		/* So that mvebu u-boot can update the MAC address */
 		ethernet1 = &eth0;
+		spi1 = &spi1;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
 	};
 
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
@@ -306,3 +310,43 @@
 		};
 	};
 };
+
+&pinctrl {
+	helios4_spi1_cs_pins: spi1-cs-pins {
+		marvell,pins = "mpp55";
+		marvell,function = "spi1";
+	};
+	mikro_pins: mikro-pins {
+		/* int: mpp22 rst: mpp29 */
+		marvell,pins = "mpp22", "mpp29";
+		marvell,function = "gpio";
+	};
+	mikro_spi_pins: mikro-spi-pins {
+		marvell,pins = "mpp43";

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

Quoted 10 lines
arch/arm/dts/armada-388-helios4.dts +10 -0
+		marvell,function = "spi1";
+	};
+	mikro_uart_pins: mikro-uart-pins {
+		marvell,pins = "mpp24", "mpp25";
+		marvell,function = "ua1";
+	};
+	rear_button_pins: rear-button-pins {
+		marvell,pins = "mpp34";
+		marvell,function = "gpio";
+	};

There is no MikroBUS header or rear button on the Helios4 carrier as far as I can see.

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

Quoted 12 lines
arch/arm/dts/armada-388-helios4.dts +12 -0
+};
+
+&w25q32 {
+	status = "okay";
+};
+
+&spi1 {
+	/*
+	 * Add SPI CS pins for helios4:
+	 * CS0: W25Q32
+	 * CS1:
+	 * CS2: mikrobus

Ditto.

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

Quoted 5 lines
arch/arm/dts/armada-388-helios4.dts +5 -0
+	 */
+	pinctrl-0 = <&spi1_pins &mikro_spi_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};

baruch

Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 3/4 ARM: mvebu: ClearFog make sure that SATA and UART images are buildable

In reply to dgilmore at redhat.com

From: Dennis Gilmore <[email protected]>

SATA and UART ClearFog imaages are not buildable as ENV_SECT_SIZE is not defined set values for both possible targets

---
 board/solidrun/clearfog/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/solidrun/clearfog/Kconfig +2 -2
index e8c3f53d84..cf95258090 100644
@@ -50,9 +50,9 @@ config ENV_OFFSET
 config ENV_SECT_SIZE
 	hex "Environment Sector-Size"
 	# Use SPI flash erase block size of 4 KiB
-	default 0x1000 if MVEBU_SPL_BOOT_DEVICE_SPI
+	default 0x1000 if MVEBU_SPL_BOOT_DEVICE_SPI || MVEBU_SPL_BOOT_DEVICE_SATA
 	# Use optimistic 64 KiB erase block, will vary between actual media
-	default 0x10000 if MVEBU_SPL_BOOT_DEVICE_MMC
+	default 0x10000 if MVEBU_SPL_BOOT_DEVICE_MMC || MVEBU_SPL_BOOT_DEVICE_UART
 
 config SYS_SPI_U_BOOT_OFFS
 	hex "address of u-boot payload in SPI flash"
Signature · 1 line
2.28.0
#4 lore raw

PATCH 4/4 ARM: mvebu: fixup building a SPI image for db-mv784mp-gp

In reply to dgilmore at redhat.com

From: Dennis Gilmore <[email protected]>

sync config options from clearfog to db-mv784mp-gp to enable building a SPI image

---
 include/configs/db-mv784mp-gp.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
include/configs/db-mv784mp-gp.h +10 -1
index 3e20516e94..79ee5909d5 100644
@@ -78,8 +78,17 @@
 #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
 #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
 
+#if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI)
 /* SPL related SPI defines */
-#define CONFIG_SYS_U_BOOT_OFFS		CONFIG_SYS_SPI_U_BOOT_OFFS
+#define CONFIG_SYS_U_BOOT_OFFS          CONFIG_SYS_SPI_U_BOOT_OFFS
+#elif defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
+/* SPL related MMC defines */
+#define CONFIG_SYS_MMC_U_BOOT_OFFS              (160 << 10)
+#define CONFIG_SYS_U_BOOT_OFFS                  CONFIG_SYS_MMC_U_BOOT_OFFS
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER       0x00180000      /* in SDRAM */
+#endif
+#endif
 
 /* Enable DDR support in SPL (DDR3 training from Marvell bin_hdr) */
 #define CONFIG_SPD_EEPROM		0x4e
Signature · 1 line
2.28.0