Skip to contentSkip to conversation

Add support for MacchiatoBin board

PATCH Superseded Sergey Matyukevich 2 participants 7 messages Nov 18, 2017 – Dec 2, 2017

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for MacchiatoBin board

Hi all,
This is the second revision of the patchset adding support for MacchiatoBin board. The most part of changes address review comments provided by Baruch Siach and Arnout Vandecappelle. Besides, dts kernel patches by Antoine T?nart has been added in order to enable networking on mainline kernel and make the board more usable from the start.

Changes v1->v2
- update mv-ddr-marvell package: rename/cleanup
- update binary-marvell package: rename/cleanup
- update changes for atf package: cleanup
- update board readme.txt
- add example U-Boot environment
- bump Linux kernel version to 4.14
- add dts patches to enable networking on mainline U-Boot/kernel

Sergey Matyukevich (4):
mv-ddr-marvell: new package
binaries-marvell: new package
atf: add support for Marvell Armada
solidrun/macchiatobin: add new board

 DEVELOPERS                                                                                       |   14 -
 board/solidrun/macchiatobin/genimage.cfg                                                         |   16 +
 board/solidrun/macchiatobin/linux-extras.config                                                  |    3 
 board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch  |   38 +++
 board/solidrun/macchiatobin/patches/linux/0002-arm64-dts-marvell-add-comphy-nodes-on-cp110.patch |  111 ++++++++++
 board/solidrun/macchiatobin/patches/linux/0003-arm64-dts-marvell-mcbin-add-comphy.patch          |   52 ++++
 board/solidrun/macchiatobin/post-build.sh                                                        |    5 
 board/solidrun/macchiatobin/readme.txt                                                           |   82 +++++++
 board/solidrun/macchiatobin/uEnv-example.txt                                                     |    7 
 boot/Config.in                                                                                   |    2 
 boot/arm-trusted-firmware/arm-trusted-firmware.mk                                                |   11 
 boot/binaries-marvell/Config.in                                                                  |   29 ++
 boot/binaries-marvell/binaries-marvell.hash                                                      |    2 
 boot/binaries-marvell/binaries-marvell.mk                                                        |   19 +
 boot/mv-ddr-marvell/Config.in                                                                    |    7 
 boot/mv-ddr-marvell/mv-ddr-marvell.hash                                                          |    2 
 boot/mv-ddr-marvell/mv-ddr-marvell.mk                                                            |   18 +
 configs/solidrun_macchiatobin_mainline_defconfig                                                 |   45 ++++
 configs/solidrun_macchiatobin_marvell_defconfig                                                  |   45 ++++
 19 files changed, 504 insertions(+), 4 deletions(-)
#1 lore raw

PATCH v2 1/4 mv-ddr-marvell: new package

This package adds Marvell Armada SoC DDR training algorithms. This code is not built separately, it is needed as dependency to build ATF firmware for Marvell Armada SoCs.

---
 DEVELOPERS                              |  3 ++-
 boot/Config.in                          |  1 +
 boot/mv-ddr-marvell/Config.in           |  7 +++++++
 boot/mv-ddr-marvell/mv-ddr-marvell.hash |  2 ++
 boot/mv-ddr-marvell/mv-ddr-marvell.mk   | 18 ++++++++++++++++++
 5 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 boot/mv-ddr-marvell/Config.in
 create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.hash
 create mode 100644 boot/mv-ddr-marvell/mv-ddr-marvell.mk
DEVELOPERS +2 -1
index 37b7dfe815..edca05ea6f 100644
@@ -1478,8 +1478,9 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <[email protected]>
-F:	package/xr819-xradio/
+F:	boot/mv-ddr-marvell/
 F:	package/armbian-firmware/
+F:	package/xr819-xradio/
 F:	board/orangepi/orangepi-zero
 F:	board/orangepi/orangepi-one
 F:	board/linksprite/pcduino
boot/Config.in +1 -0
index 2f46c8546e..3950c49524 100644
@@ -10,6 +10,7 @@ source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub2/Config.in"
 source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
+source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/mv-ddr-marvell/Config.in new file +7 -0
new file mode 100644
index 0000000000..d5c28af97a
@@ -0,0 +1,7 @@
+config BR2_TARGET_MV_DDR_MARVELL
+	bool "Marvell DDR training code for ATF"
+	depends on BR2_aarch64
+	help
+	  Marvell keeps algorithms for DDR training in a separate repository.
+	  This code is not built separately, it is needed as dependency
+	  to build ATF firmware for Marvell Armada 7040 and 8040 SoCs.
boot/mv-ddr-marvell/mv-ddr-marvell.hash new file +2 -0
new file mode 100644
index 0000000000..b96d4d2bc8
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 d413546367ffa3b5f4373a777b9efeb32dcc74d6106897c248935ecb79afc454 mv-ddr-marvell-656440a9690f3d07be9e3d2c39d7cf56fd96eb7b.tar.gz
boot/mv-ddr-marvell/mv-ddr-marvell.mk new file +18 -0
new file mode 100644
index 0000000000..e33065c24e
@@ -0,0 +1,18 @@
+################################################################################
+#
+# Marvell Armada DDR training code
+#
+################################################################################
+
+MV_DDR_MARVELL_VERSION = 656440a9690f3d07be9e3d2c39d7cf56fd96eb7b
+MV_DDR_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,mv-ddr-marvell,$(MV_DDR_MARVELL_VERSION))
+MV_DDR_MARVELL_LICENSE = GPL-2.0+, GPL-2.1 with FreeRTOS exception, BSD, Marvell Commercial
+MV_DDR_MARVELL_LICENSE_FILES = ddr3_init.c
+
+define MV_DDR_MARVELL_SRC_SYMLINK
+	ln -s $(BUILD_DIR)/mv-ddr-marvell-$(MV_DDR_MARVELL_VERSION) $(BUILD_DIR)/mv-ddr-marvell
+endef
+
+MV_DDR_MARVELL_POST_EXTRACT_HOOKS += MV_DDR_MARVELL_SRC_SYMLINK
+
+$(eval $(generic-package))
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 2/4 binaries-marvell: new package

In reply to Sergey Matyukevich

Some systems, including Marvell Armada 7k/8k SoCs, have a separate System Control Processor (SCP) for power management, clocks, reset and system control. ATF Boot Loader stage 2 (BL2) loads optional SCP_BL2 image into a platform-specific region of secure memory.

This package adds SCP_BL2 firmware for Marvell Armada 7040 and 8040 SoCs.

---
 DEVELOPERS                                  |  1 +
 boot/Config.in                              |  1 +
 boot/binaries-marvell/Config.in             | 29 +++++++++++++++++++++++++++++
 boot/binaries-marvell/binaries-marvell.hash |  2 ++
 boot/binaries-marvell/binaries-marvell.mk   | 19 +++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 boot/binaries-marvell/Config.in
 create mode 100644 boot/binaries-marvell/binaries-marvell.hash
 create mode 100644 boot/binaries-marvell/binaries-marvell.mk
DEVELOPERS +1 -0
index edca05ea6f..11590f2ab0 100644
@@ -1478,6 +1478,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <[email protected]>
+F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	package/armbian-firmware/
 F:	package/xr819-xradio/
boot/Config.in +1 -0
index 3950c49524..3687c41a2c 100644
@@ -6,6 +6,7 @@ source "boot/at91bootstrap3/Config.in"
 source "boot/at91dataflashboot/Config.in"
 source "boot/arm-trusted-firmware/Config.in"
 source "boot/barebox/Config.in"
+source "boot/binaries-marvell/Config.in"
 source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub2/Config.in"
 source "boot/gummiboot/Config.in"
boot/binaries-marvell/Config.in new file +29 -0
new file mode 100644
index 0000000000..0a0717cd26
@@ -0,0 +1,29 @@
+config BR2_TARGET_BINARIES_MARVELL
+	bool "Marvell Armada SCP_BL2 image for ATF"
+	depends on BR2_aarch64
+	help
+	  Some systems, including Marvell Armada SoC, have a separate
+	  System Control Processor (SCP) for power management, clocks,
+	  reset and system control. ATF Boot Loader stage 2 (BL2) loads
+	  optional SCP_BL2 image into a platform-specific region
+	  of secure memory.
+
+if BR2_TARGET_BINARIES_MARVELL
+
+choice
+	prompt "Marvell Armada platform"
+
+config BR2_TARGET_BINARIES_MARVELL_7040
+	bool "7040"
+
+config BR2_TARGET_BINARIES_MARVELL_8040
+	bool "8040"
+
+endchoice
+
+config BR2_TARGET_BINARIES_MARVELL_IMAGE
+	string
+	default "mrvl_scp_bl2_8040.img" if BR2_TARGET_BINARIES_MARVELL_8040
+	default "mrvl_scp_bl2_7040.img" if BR2_TARGET_BINARIES_MARVELL_7040
+
+endif
boot/binaries-marvell/binaries-marvell.hash new file +2 -0
new file mode 100644
index 0000000000..401584dacd
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 22a201542d8f93cf88623065db5f3377822b59cbfdf98a8e60cdee629273d3a0 binaries-marvell-0dabe23b956420b0928d337d635f0cd5646c33d0.tar.gz
boot/binaries-marvell/binaries-marvell.mk new file +19 -0
new file mode 100644
index 0000000000..7bb5071aed
@@ -0,0 +1,19 @@
+################################################################################
+#
+# Marvell Armada SCP_BL2 firmware images
+#
+################################################################################
+
+BINARIES_MARVELL_VERSION = 0dabe23b956420b0928d337d635f0cd5646c33d0
+BINARIES_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,binaries-marvell,$(BINARIES_MARVELL_VERSION))
+BINARIES_MARVELL_LICENSE = PROPRIETARY
+BINARIES_MARVELL_REDISTRIBUTE = NO
+
+BINARIES_MARVELL_IMAGE = $(call qstrip,$(BR2_TARGET_BINARIES_MARVELL_IMAGE))
+BINARIES_MARVELL_INSTALL_IMAGES  = YES
+
+define BINARIES_MARVELL_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/$(BINARIES_MARVELL_IMAGE) $(BINARIES_DIR)/scp-fw.bin
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.11.0
#3 lore raw

PATCH v2 3/4 atf: add support for Marvell Armada SoCs

In reply to Sergey Matyukevich

Add Marvell Armada 7k/8k SoCs support to arm-trusted-firmware package. Marvell ATF needs two additional dependencies:
DDR training code and SCP_BL2 image.

---
 DEVELOPERS                                        |  1 +
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 11 +++++++++++
 2 files changed, 12 insertions(+)
DEVELOPERS +1 -0
index 11590f2ab0..e695f66a1f 100644
@@ -1478,6 +1478,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <[email protected]>
+F:	boot/arm-trusted-firmware/
 F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	package/armbian-firmware/
boot/arm-trusted-firmware/arm-trusted-firmware.mk +11 -0
index 7b1cc6ebb6..035f7de189 100644
@@ -39,6 +39,17 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
 endif
 
+ifeq ($(BR2_TARGET_BINARIES_MARVELL),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += binaries-marvell
+endif
+
+ifeq ($(BR2_TARGET_MV_DDR_MARVELL),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
+	MV_DDR_PATH=$(BUILD_DIR)/mv-ddr-marvell
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
+endif
+
 define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) \
 		$(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
Signature · 1 line
2.11.0
#4 lore raw

PATCH v2 4/4 solidrun/macchiatobin: add new board

In reply to Sergey Matyukevich

Add MacchiatoBin board by SolidRun. This board is based on Marvell Armada 8040 SoC. Board support package includes the following two options: mainline and vendor BSPs.

Mainline BSP:
- Marvell ATF v1.3-armada-17.10
- mainline U-Boot v2017.09
- mainline Linux kernel v4.14

Marvell BSP with more hardware support enabled:
- Marvell ATF v1.3-armada-17.10
- vendor U-Boot based on v2017.03
- Marvell Linux kernel based v4.4.52

More details about this board are available on wiki:
- http://wiki.macchiatobin.net

---
 DEVELOPERS                                         |   9 +-
 board/solidrun/macchiatobin/genimage.cfg           |  16 +++
 board/solidrun/macchiatobin/linux-extras.config    |   3 +
 ...rm64-dts-marvell-extend-cp110-syscon-regs.patch |  38 +++++++
 ...m64-dts-marvell-add-comphy-nodes-on-cp110.patch | 111 +++++++++++++++++++++
 .../0003-arm64-dts-marvell-mcbin-add-comphy.patch  |  52 ++++++++++
 board/solidrun/macchiatobin/post-build.sh          |   5 +
 board/solidrun/macchiatobin/readme.txt             |  82 +++++++++++++++
 board/solidrun/macchiatobin/uEnv-example.txt       |   7 ++
 configs/solidrun_macchiatobin_mainline_defconfig   |  45 +++++++++
 configs/solidrun_macchiatobin_marvell_defconfig    |  45 +++++++++
 11 files changed, 410 insertions(+), 3 deletions(-)
 create mode 100644 board/solidrun/macchiatobin/genimage.cfg
 create mode 100644 board/solidrun/macchiatobin/linux-extras.config
 create mode 100644 board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch
 create mode 100644 board/solidrun/macchiatobin/patches/linux/0002-arm64-dts-marvell-add-comphy-nodes-on-cp110.patch
 create mode 100644 board/solidrun/macchiatobin/patches/linux/0003-arm64-dts-marvell-mcbin-add-comphy.patch
 create mode 100755 board/solidrun/macchiatobin/post-build.sh
 create mode 100644 board/solidrun/macchiatobin/readme.txt
 create mode 100644 board/solidrun/macchiatobin/uEnv-example.txt
 create mode 100644 configs/solidrun_macchiatobin_mainline_defconfig
 create mode 100644 configs/solidrun_macchiatobin_marvell_defconfig
DEVELOPERS +6 -3
index e695f66a1f..b1be7a3c6e 100644
@@ -1483,12 +1483,15 @@ F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	package/armbian-firmware/
 F:	package/xr819-xradio/
-F:	board/orangepi/orangepi-zero
-F:	board/orangepi/orangepi-one
 F:	board/linksprite/pcduino
+F:	board/orangepi/orangepi-one
+F:	board/orangepi/orangepi-zero
+F:	board/solidrun/macchiatobin
+F:	configs/linksprite_pcduino_defconfig
 F:	configs/orangepi_one_defconfig
 F:	configs/orangepi_zero_defconfig
-F:	configs/linksprite_pcduino_defconfig
+F:	configs/solidrun_macchiatobin_mainline_defconfig
+F:	configs/solidrun_macchiatobin_marvell_defconfig
 
 N:	Sergio Prado <[email protected]>
 F:	package/libgdiplus/
board/solidrun/macchiatobin/genimage.cfg new file +16 -0
new file mode 100644
index 0000000000..fdcda368a2
@@ -0,0 +1,16 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition uboot {
+		in-partition-table = "no"
+		image = "flash-image.bin"
+		offset = 0x200000
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		offset = 0x2200000
+		image = "rootfs.ext4"
+	}
+}
board/solidrun/macchiatobin/linux-extras.config new file +3 -0
new file mode 100644
index 0000000000..11267d2f80
@@ -0,0 +1,3 @@
+CONFIG_MARVELL_PHY=y
+CONFIG_MARVELL_10G_PHY=y
+CONFIG_PHY_MVEBU_CP110_COMPHY=y
board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch new file +38 -0
new file mode 100644
index 0000000000..87a4a93ff4
@@ -0,0 +1,38 @@
+commit 0f0dfbec373eef37dcb424b5b24ce899f05249cd
+Author: Antoine Tenart <[email protected]>
+Date:   Mon Sep 18 09:58:08 2017 +0200
+
+    arm64: dts: marvell: extend the cp110 syscon register area length
+    
+    This patch extends on both cp110 the system register area length to
+    include some of the comphy registers as well.
+    
+    Signed-off-by: Antoine Tenart <[email protected]>
+    Signed-off-by: Gregory CLEMENT <[email protected]>
+
+diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
+index f2aa2a81de4d..4dd8c7d53764 100644
+--- a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
++++ b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
+@@ -143,7 +143,7 @@
+ 
+ 			cpm_syscon0: system-controller at 440000 {
+ 				compatible = "syscon", "simple-mfd";
+-				reg = <0x440000 0x1000>;
++				reg = <0x440000 0x2000>;
+ 
+ 				cpm_clk: clock {
+ 					compatible = "marvell,cp110-clock";
+diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
+index 4fe70323abb3..43fa491da6ce 100644
+--- a/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
++++ b/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
+@@ -143,7 +143,7 @@
+ 
+ 			cps_syscon0: system-controller at 440000 {
+ 				compatible = "syscon", "simple-mfd";
+-				reg = <0x440000 0x1000>;
++				reg = <0x440000 0x2000>;
+ 
+ 				cps_clk: clock {
+ 					compatible = "marvell,cp110-clock";
board/solidrun/macchiatobin/patches/linux/0002-arm64-dts-marvell-add-comphy-nodes-on-cp110.patch new file +111 -0

111 lines not on this page · raw message

board/solidrun/macchiatobin/patches/linux/0003-arm64-dts-marvell-mcbin-add-comphy.patch new file +52 -0

52 lines not on this page · raw message

board/solidrun/macchiatobin/post-build.sh new file +5 -0
new file mode 100755
index 0000000000..9c1b5b883c
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D ${BOARD_DIR}/uEnv-example.txt ${TARGET_DIR}/boot/uEnv-example.txt
board/solidrun/macchiatobin/readme.txt new file +82 -0

82 lines not on this page · raw message

board/solidrun/macchiatobin/uEnv-example.txt new file +7 -0
new file mode 100644
index 0000000000..1967e2badd
@@ -0,0 +1,7 @@
+bootargs=console=ttyS0,115200 root=/dev/mmcblk1p1 rw rootwait
+fdt_addr=0x1000000
+fdt_high=0xffffffffffffffff
+fdt_name=boot/armada-8040-mcbin.dtb
+kernel_addr=0x2000000
+image_name=boot/Image
+bootcmd=mmc dev 1; ext4load mmc 1:1 $kernel_addr $image_name; ext4load mmc 1:1 $fdt_addr $fdt_name; booti $kernel_addr - $fdt_addr
configs/solidrun_macchiatobin_mainline_defconfig new file +45 -0

45 lines not on this page · raw message

configs/solidrun_macchiatobin_marvell_defconfig new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.11.0
#5 lore raw

v2 cover Add support for MacchiatoBin board

In reply to Sergey Matyukevich

Hi Thomas, Peter, and all

Quoted 5 lines

This is the second revision of the patchset adding support for MacchiatoBin board. The most part of changes address review comments provided by Baruch Siach and Arnout Vandecappelle. Besides, dts kernel patches by Antoine T?nart has been added in order to enable networking on mainline kernel and make the board more usable from the start.

I noticed today that this patch series was not properly handled by buildroot patchwork. I can see only two patches there. I don't know exactly why it happened, probably because of the wrong order of version and patch number in subject.

Let me know if I should resend the whole series.

Regards,
Sergey

#6 lore raw

v2 cover Add support for MacchiatoBin board

Hello,

Quoted 6 lines · Sergey Matyukevich
Quoted 5 lines

This is the second revision of the patchset adding support for MacchiatoBin board. The most part of changes address review comments provided by Baruch Siach and Arnout Vandecappelle. Besides, dts kernel patches by Antoine T?nart has been added in order to enable networking on mainline kernel and make the board more usable from the start.

Quoted 6 lines

I noticed today that this patch series was not properly handled by buildroot patchwork. I can see only two patches there. I don't know exactly why it happened, probably because of the wrong order of version and patch number in subject.

Let me know if I should resend the whole series.

There were some mail delivery issues, and other series were affected as well. If you could resend the series, it would be nice.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com