Skip to contentSkip to conversation

kwbimage: Align payload size to 4 bytes

PATCH New Stefan Roese 3 participants 14 messages Sep 3, 2015 – Sep 4, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/7 kwbimage: Align payload size to 4 bytes

The MVEBU BootROM does not allow non word aligned payloads.

---
 tools/kwbimage.c | 3 +++
 1 file changed, 3 insertions(+)
tools/kwbimage.c +3 -0
index 3fa90d3..886682d 100644
@@ -775,6 +775,9 @@ static void kwbimage_set_header(void *ptr, struct stat *sbuf, int ifd,
 		exit(EXIT_FAILURE);
 	}
 
+	/* The MVEBU BootROM does not allow non word aligned payloads */
+	sbuf->st_size = ALIGN_SUP(sbuf->st_size, 4);
+
 	version = image_get_version();
 	switch (version) {
 		/*
Signature · 1 line
2.5.1
#1 lore raw

PATCH 2/7 arm: mvebu: Do not call board_init_r() from board_init_f()

Instead of calling board_init_r() directly from board_init_f(), just return from board_init_f(). This will make the code continue executing in crt0.S _main(), from which the board_init_r() is called. This patch aligns the MVEBU SPL with the correct SPL design as well as reduces the stack utilisation slightly.

Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
---
 arch/arm/mach-mvebu/spl.c | 2 --
 1 file changed, 2 deletions(-)
arch/arm/mach-mvebu/spl.c +0 -2
index 26ff1a2..e273339 100644
@@ -78,6 +78,4 @@ void board_init_f(ulong dummy)
 	 */
 	return_to_bootrom();
 #endif
-
-	board_init_r(NULL, 0);
 }
Signature · 1 line
2.5.1
#2 lore raw

PATCH 2/7 arm: mvebu: Do not call board_init_r() from board_init_f()

Quoted 11 lines · Stefan Roese

Instead of calling board_init_r() directly from board_init_f(), just return from board_init_f(). This will make the code continue executing in crt0.S _main(), from which the board_init_r() is called. This patch aligns the MVEBU SPL with the correct SPL design as well as reduces the stack utilisation slightly.

Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>

---

Best regards,
Marek Vasut

#3 lore raw

PATCH 2/7 arm: mvebu: Do not call board_init_r() from board_init_f()

Quoted 7 lines · Marek Vasut
Quoted 6 lines · Stefan Roese

Instead of calling board_init_r() directly from board_init_f(), just return from board_init_f(). This will make the code continue executing in crt0.S _main(), from which the board_init_r() is called. This patch aligns the MVEBU SPL with the correct SPL design as well as reduces the stack utilisation slightly.

Quoted 7 lines
Quoted 5 lines
Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>

---

Great!

#4 lore raw

PATCH 3/7 arm: mvebu: Add basic Armada XP / 38x dtsi/dts files

In reply to Stefan Roese

These will be needed by the upcoming DM (driver model) support for the Armada XP / 38x SoC's. This will provide DT based probing.

The dts files are copied 1:1 from the Linux kernel release v4.2.

---
 arch/arm/dts/Makefile               |   5 +
 arch/arm/dts/armada-370-xp.dtsi     | 333 ++++++++++++++++++++
 arch/arm/dts/armada-380.dtsi        | 152 +++++++++
 arch/arm/dts/armada-385.dtsi        | 184 +++++++++++
 arch/arm/dts/armada-388-gp.dts      | 413 +++++++++++++++++++++++++
 arch/arm/dts/armada-388.dtsi        |  70 +++++
 arch/arm/dts/armada-38x.dtsi        | 600 ++++++++++++++++++++++++++++++++++++
 arch/arm/dts/armada-xp-gp.dts       | 245 +++++++++++++++
 arch/arm/dts/armada-xp-mv78230.dtsi | 231 ++++++++++++++
 arch/arm/dts/armada-xp-mv78260.dtsi | 333 ++++++++++++++++++++
 arch/arm/dts/armada-xp-mv78460.dtsi | 371 ++++++++++++++++++++++
 arch/arm/dts/armada-xp.dtsi         | 320 +++++++++++++++++++
 12 files changed, 3257 insertions(+)
 create mode 100644 arch/arm/dts/armada-370-xp.dtsi
 create mode 100644 arch/arm/dts/armada-380.dtsi
 create mode 100644 arch/arm/dts/armada-385.dtsi
 create mode 100644 arch/arm/dts/armada-388-gp.dts
 create mode 100644 arch/arm/dts/armada-388.dtsi
 create mode 100644 arch/arm/dts/armada-38x.dtsi
 create mode 100644 arch/arm/dts/armada-xp-gp.dts
 create mode 100644 arch/arm/dts/armada-xp-mv78230.dtsi
 create mode 100644 arch/arm/dts/armada-xp-mv78260.dtsi
 create mode 100644 arch/arm/dts/armada-xp-mv78460.dtsi
 create mode 100644 arch/arm/dts/armada-xp.dtsi
arch/arm/dts/Makefile +5 -0
index c97f39d..439343b 100644
@@ -37,6 +37,11 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra210-e2220-1170.dtb \
 	tegra210-p2371-0000.dtb \
 	tegra210-p2571.dtb
+
+dtb-$(CONFIG_ARCH_MVEBU) +=			\
+	armada-388-gp.dtb			\
+	armada-xp-gp.dtb
+
 dtb-$(CONFIG_ARCH_UNIPHIER) += \
 	uniphier-ph1-ld4-ref.dtb \
 	uniphier-ph1-ld6b-ref.dtb \
arch/arm/dts/armada-370-xp.dtsi new file +333 -0

333 lines not on this page · raw message

arch/arm/dts/armada-380.dtsi new file +152 -0

152 lines not on this page · raw message

arch/arm/dts/armada-385.dtsi new file +184 -0

184 lines not on this page · raw message

arch/arm/dts/armada-388-gp.dts new file +413 -0

413 lines not on this page · raw message

arch/arm/dts/armada-388.dtsi new file +70 -0

70 lines not on this page · raw message

arch/arm/dts/armada-38x.dtsi new file +600 -0

600 lines not on this page · raw message

arch/arm/dts/armada-xp-gp.dts new file +245 -0

245 lines not on this page · raw message

arch/arm/dts/armada-xp-mv78230.dtsi new file +231 -0

231 lines not on this page · raw message

arch/arm/dts/armada-xp-mv78260.dtsi new file +333 -0

333 lines not on this page · raw message

arch/arm/dts/armada-xp-mv78460.dtsi new file +371 -0

371 lines not on this page · raw message

arch/arm/dts/armada-xp.dtsi new file +320 -0

57 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.5.1

Part of the diff is not shown here. View the raw message.

#5 lore raw

PATCH 4/7 arm: mvebu: Add DM (driver model) support

In reply to Stefan Roese

This patch adds driver model support for some Marvell MVEBU SoC's. Including Armada XP and 38x. All 3 currently mainlined boards are converted. DM is now selected automatically for MVEBU platforms.

With this DM support now available for MVEBU, hardcoding the base addresses and other information is not necessary any more. Probing should be done by using the values provided via the device tree now instead. For this the driver also need to be converted to DM. Patches for some of the drivers will follow.

Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
---
 Makefile                        | 2 +-
 arch/arm/Kconfig                | 3 +++
 arch/arm/mach-mvebu/spl.c       | 3 ---
 configs/db-88f6820-gp_defconfig | 1 +
 configs/db-mv784mp-gp_defconfig | 1 +
 configs/maxbcm_defconfig        | 1 +
 6 files changed, 7 insertions(+), 4 deletions(-)
Makefile +1 -1
index d47e1ba..7372da8 100644
@@ -918,7 +918,7 @@ ifdef CONFIG_MVEBU_BOOTROM_UARTBOOT
 u-boot-spl.kwb: u-boot.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 else
-u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
+u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 endif
 
arch/arm/Kconfig +3 -0
index 226599f..8f5a0ea 100644
@@ -113,6 +113,9 @@ config ARCH_MVEBU
 	bool "Marvell MVEBU family (Armada XP/38x)"
 	select CPU_V7
 	select SUPPORT_SPL
+	select OF_CONTROL
+	select OF_SEPARATE
+	select DM
 
 config TARGET_DEVKIT3250
 	bool "Support devkit3250"
arch/arm/mach-mvebu/spl.c +0 -3
index e273339..0ab729a 100644
@@ -31,9 +31,6 @@ u32 spl_boot_mode(void)
 
 void board_init_f(ulong dummy)
 {
-	/* Set global data pointer */
-	gd = &gdata;
-
 #ifndef CONFIG_MVEBU_BOOTROM_UARTBOOT
 	/*
 	 * Only call arch_cpu_init() when not returning to the
configs/db-88f6820-gp_defconfig +1 -0
index 24647ce..f2b1126 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_TARGET_DB_88F6820_GP=y
+CONFIG_DEFAULT_DEVICE_TREE="armada-388-gp"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
configs/db-mv784mp-gp_defconfig +1 -0
index 4e4da3c..df17dba 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_TARGET_DB_MV784MP_GP=y
+CONFIG_DEFAULT_DEVICE_TREE="armada-xp-gp"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
configs/maxbcm_defconfig +1 -0
index 5957997..d49def1 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_TARGET_MAXBCM=y
+CONFIG_DEFAULT_DEVICE_TREE="armada-xp-gp"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
Signature · 1 line
2.5.1
#6 lore raw

PATCH 5/7 usb: ehci-marvell.c: Add DM support

In reply to Stefan Roese

This patch adds driver model (DM) support to the Marvell EHCI driver. This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
---
 drivers/usb/host/Kconfig        |  7 ++++
 drivers/usb/host/ehci-marvell.c | 86 +++++++++++++++++++++++++++++++++--------
 2 files changed, 77 insertions(+), 16 deletions(-)
drivers/usb/host/Kconfig +7 -0
index b30b43d..2a2bffe 100644
@@ -52,6 +52,13 @@ config USB_EHCI
 
 if USB_EHCI_HCD
 
+config USB_EHCI_MARVELL
+	bool "Support for MVEBU (AXP / A38x) on-chip EHCI USB controller"
+	depends on ARCH_MVEBU
+	default y
+	---help---
+	  Enables support for the on-chip EHCI controller on MVEBU SoCs.
+
 config USB_EHCI_MX6
 	bool "Support for i.MX6 on-chip EHCI USB controller"
 	depends on ARCH_MX6
drivers/usb/host/ehci-marvell.c +70 -16

130 lines not on this page · raw message

Signature · 1 line
2.5.1
#7 lore raw

PATCH 5/7 usb: ehci-marvell.c: Add DM support

Quoted 9 lines · Stefan Roese

This patch adds driver model (DM) support to the Marvell EHCI driver. This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>

Looks ok, but do you want to get this applied into current release or for the next one ?

Best regards,
Marek Vasut

#8 lore raw

PATCH 5/7 usb: ehci-marvell.c: Add DM support

Quoted 6 lines · Marek Vasut
Quoted 5 lines · Stefan Roese

This patch adds driver model (DM) support to the Marvell EHCI driver. This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Quoted 7 lines
Quoted 4 lines
Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>

Looks ok, but do you want to get this applied into current release or for the next one ?

We are pretty late in the release cycle. That's all stuff for the next release. So no hurry.

Thanks,
Stefan

#9 lore raw

PATCH 5/7 usb: ehci-marvell.c: Add DM support

Quoted 12 lines · Stefan Roese
Quoted 11 lines · Marek Vasut
Quoted 9 lines · Stefan Roese

This patch adds driver model (DM) support to the Marvell EHCI driver. This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
Quoted 5 lines
Quoted 2 lines

Looks ok, but do you want to get this applied into current release or for the next one ?

We are pretty late in the release cycle. That's all stuff for the next release. So no hurry.

Cool, do you want me to pick it via u-boot-usb/next or will you pick the whole series through ... errr ... some other tree ?

Best regards,
Marek Vasut

#10 lore raw

PATCH 5/7 usb: ehci-marvell.c: Add DM support

Quoted 13 lines · Marek Vasut
Quoted 12 lines · Stefan Roese
Quoted 11 lines · Marek Vasut
Quoted 9 lines · Stefan Roese

This patch adds driver model (DM) support to the Marvell EHCI driver. This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Looks ok, but do you want to get this applied into current release or for the next one ?

We are pretty late in the release cycle. That's all stuff for the next release. So no hurry.

Cool, do you want me to pick it via u-boot-usb/next or will you pick the whole series through ... errr ... some other tree ?

Its probably best, if Luka pushed all patches together. As there is some dependency. So please send your Acked-by / Reviewed-by, whatever is fitting best. And I'll "persuade" Luka to pick up all this stuff in the next few days / weeks (IIRC, he's on vacation right now).

Thanks,
Stefan

#11 lore raw

PATCH 5/7 usb: ehci-marvell.c: Add DM support

Quoted 20 lines · Stefan Roese
Quoted 19 lines · Marek Vasut
Quoted 17 lines · Stefan Roese
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Stefan Roese

This patch adds driver model (DM) support to the Marvell EHCI driver. This will be used by the MVEBU SoC's, currently Armada XP and 38x.

Tested on Marvell Armada XP and 38x eval boards.

Quoted 7 lines
Quoted 4 lines
Cc Marek Vasut <[email protected]>
Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>

Looks ok, but do you want to get this applied into current release or for the next one ?

We are pretty late in the release cycle. That's all stuff for the next release. So no hurry.

Quoted 7 lines
Quoted 2 lines

Cool, do you want me to pick it via u-boot-usb/next or will you pick the whole series through ... errr ... some other tree ?

Its probably best, if Luka pushed all patches together. As there is some dependency. So please send your Acked-by / Reviewed-by, whatever is fitting best. And I'll "persuade" Luka to pick up all this stuff in the next few days / weeks (IIRC, he's on vacation right now).

Best regards,
Marek Vasut

#12 lore raw

PATCH 6/7 arm: mvebu: Enable DM_USB on AXP / A38x boards

In reply to Stefan Roese

This patch enables DM_USB on the Marvell AXP / A38x eval boards.

Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
---
 configs/db-88f6820-gp_defconfig | 5 +++++
 configs/db-mv784mp-gp_defconfig | 5 +++++
 include/configs/db-88f6820-gp.h | 4 ----
 include/configs/db-mv784mp-gp.h | 4 ----
 include/configs/mv-common.h     | 2 +-
 5 files changed, 11 insertions(+), 9 deletions(-)
configs/db-88f6820-gp_defconfig +5 -0
index f2b1126..6f612d9 100644
@@ -5,5 +5,10 @@ CONFIG_DEFAULT_DEVICE_TREE="armada-388-gp"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_SPI_FLASH=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
configs/db-mv784mp-gp_defconfig +5 -0
index df17dba..258e4d6 100644
@@ -5,6 +5,11 @@ CONFIG_DEFAULT_DEVICE_TREE="armada-xp-gp"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_NAND_PXA3XX=y
 CONFIG_SPI_FLASH=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
include/configs/db-88f6820-gp.h +0 -4
index 15f7bdf..74e5b47 100644
@@ -50,7 +50,6 @@
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_TFTPPUT
 #define CONFIG_CMD_TIME
-#define CONFIG_CMD_USB
 
 /* I2C */
 #define CONFIG_SYS_I2C
@@ -93,9 +92,6 @@
 #define CONFIG_SUPPORT_VFAT
 
 /* USB/EHCI configuration */
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_STORAGE
-#define CONFIG_USB_EHCI_MARVELL
 #define CONFIG_EHCI_IS_TDI
 
 /* Environment in SPI NOR flash */
include/configs/db-mv784mp-gp.h +0 -4
index 5b39762..672518b 100644
@@ -42,7 +42,6 @@
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_TFTPPUT
 #define CONFIG_CMD_TIME
-#define CONFIG_CMD_USB
 
 /* I2C */
 #define CONFIG_SYS_I2C
@@ -52,9 +51,6 @@
 #define CONFIG_SYS_I2C_SPEED		100000
 
 /* USB/EHCI configuration */
-#define CONFIG_USB_EHCI
-#define CONFIG_USB_STORAGE
-#define CONFIG_USB_EHCI_MARVELL
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
include/configs/mv-common.h +1 -1
index 92e5429..a2f60dc 100644
@@ -128,7 +128,7 @@
 /*
  * Common USB/EHCI configuration
  */
-#ifdef CONFIG_CMD_USB
+#if defined(CONFIG_CMD_USB) && !defined(CONFIG_DM)
 #define CONFIG_USB_EHCI		/* Enable EHCI USB support */
 #define CONFIG_USB_STORAGE
 #define CONFIG_DOS_PARTITION
Signature · 1 line
2.5.1
#13 lore raw

PATCH 7/7 arm: mvebu: Enable DM_SERIAL on AXP / A38x boards

In reply to Stefan Roese

This patch enables DM_SERIAL for all ARCH_MVEBU boards (AXP & A38x).

Cc Simon Glass <[email protected]>
Cc Luka Perkov <[email protected]>
---
 arch/arm/Kconfig            | 1 +
 include/configs/mv-common.h | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 8f5a0ea..b4c80b2 100644
@@ -116,6 +116,7 @@ config ARCH_MVEBU
 	select OF_CONTROL
 	select OF_SEPARATE
 	select DM
+	select DM_SERIAL
 
 config TARGET_DEVKIT3250
 	bool "Support devkit3250"
include/configs/mv-common.h +7 -1
index a2f60dc..1ecbd35 100644
@@ -39,11 +39,17 @@
 /*
  * NS16550 Configuration
  */
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM_SERIAL)
+#define CONFIG_DW_SERIAL
+#endif
+
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE	(-4)
 #define CONFIG_SYS_NS16550_CLK		CONFIG_SYS_TCLK
+#if !defined(CONFIG_DM_SERIAL)
+#define CONFIG_SYS_NS16550_REG_SIZE	(-4)
 #define CONFIG_SYS_NS16550_COM1		MV_UART_CONSOLE_BASE
+#endif
 
 /*
  * Serial Port configuration
Signature · 1 line
2.5.1