Skip to contentSkip to conversation

Add support for MacchiatoBin board

PATCH Superseded Sergey Matyukevich 3 participants 13 messages Dec 3, 2017 – Dec 4, 2017

lore
Share & tools
lore
#0 lore raw

v3 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

Changes v2->v3
Resend due to patchwork issues
- rebase on top of master

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 v3 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 d96884b7fb..d223be9643 100644
@@ -1508,8 +1508,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 v3 1/4 mv-ddr-marvell: new package

Hello,

As I replied on the cover letter, I've adopted this patch in my series, after doing a number of changes. See below the details of the changes I've made.

Quoted 5 lines · Sergey Matyukevich
DEVELOPERS +0 -0
index d96884b7fb..d223be9643 100644

DEVELOPERS F: package/lua-resty-http/ · line 1516

Quoted 10 lines
DEVELOPERS +2 -1
@@ -1508,8 +1508,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

You're mixing unrelated changes here, which is why I committed separately the alphabetic ordering fix.

boot/mv-ddr-marvell/Config.in line 2

Quoted 8 lines
boot/mv-ddr-marvell/Config.in new file +2 -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"

I've changed that to use the package name mv-ddr-marvell, like we do for all other packages (yes I know there are a few historical exceptions in boot/).

boot/mv-ddr-marvell/Config.in line 7

Quoted 5 lines
boot/mv-ddr-marvell/Config.in new file +5 -0
+	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.

I've rewrapped those lines that were too long, and added the URL to the upstream project on Github.

Quoted 6 lines
boot/mv-ddr-marvell/mv-ddr-marvell.mk new file +0 -0
new file mode 100644
index 0000000000..e33065c24e

boot/mv-ddr-marvell/mv-ddr-marvell.mk line 9

Quoted 9 lines
boot/mv-ddr-marvell/mv-ddr-marvell.mk new file +9 -0
@@ -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

I've changed that to:

MV_DDR_MARVELL_LICENSE = GPL-2.0+ or LGPL-2.1 with freertos-exception-2.0, BSD-3-Clause, Marvell Commercial

indeed, it's LGPL-2.1 and not GPL-2.1 (GPL-2.1 does not exist), the SDPX license code for the FreeRTOS exception is "freertos-exception-2.0", and BSD-3-Clause is the valid SPDX license code matching the license.

boot/mv-ddr-marvell/mv-ddr-marvell.mk line 16

Quoted 7 lines
boot/mv-ddr-marvell/mv-ddr-marvell.mk new file +7 -0
+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

I've removed this post-extract hook. The ATF code will directly use the mv-ddr code from its normal build directory.

Best regards,

Thomas

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

PATCH v3 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 d223be9643..840159fc2b 100644
@@ -1508,6 +1508,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
#4 lore raw

PATCH v3 2/4 binaries-marvell: new package

Hello,

boot/binaries-marvell/Config.in line 2

Quoted 8 lines · Sergey Matyukevich
boot/binaries-marvell/Config.in new file +2 -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"

I've used the package name here as well.

boot/binaries-marvell/Config.in line 9

Quoted 7 lines
boot/binaries-marvell/Config.in new file +7 -0
+	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.

Added an upstream URL here.

Quoted 6 lines
boot/binaries-marvell/binaries-marvell.mk new file +0 -0
new file mode 100644
index 0000000000..7bb5071aed

boot/binaries-marvell/binaries-marvell.mk line 10

Quoted 10 lines
boot/binaries-marvell/binaries-marvell.mk new file +10 -0
@@ -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

Well, if you can't distribute it... it's a bit problematic no?

In fact, there is a license on the master branch, i.e at
https://raw.githubusercontent.com/MarvellEmbeddedProcessors/binaries-marvell/master/README.md.
And to me, this is GPL-2.0 with the FreeRTOS exception, so I've changed the BINARIES_MARVELL_LICENSE variable to that, and dropped BINARIES_MARVELL_REDISTRIBUTE. Let me know what you think.

boot/binaries-marvell/binaries-marvell.mk line 19

Quoted 8 lines
boot/binaries-marvell/binaries-marvell.mk new file +8 -0
+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))

Best regards,

Thomas

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

PATCH v3 2/4 binaries-marvell: new package

Hi Thomas,

Quoted 20 lines · Thomas Petazzoni
Quoted 6 lines · Sergey Matyukevich
boot/binaries-marvell/binaries-marvell.mk new file +0 -0
new file mode 100644
index 0000000000..7bb5071aed

boot/binaries-marvell/binaries-marvell.mk line 10

Quoted 10 lines
boot/binaries-marvell/binaries-marvell.mk new file +10 -0
@@ -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

Well, if you can't distribute it... it's a bit problematic no?

Quoted 5 lines

In fact, there is a license on the master branch, i.e at
https://raw.githubusercontent.com/MarvellEmbeddedProcessors/binaries-marvell/master/README.md.
And to me, this is GPL-2.0 with the FreeRTOS exception, so I've changed the BINARIES_MARVELL_LICENSE variable to that, and dropped BINARIES_MARVELL_REDISTRIBUTE. Let me know what you think.

IANAL, but as this text does not appear in the branch we are using, this might indicate that it does not apply there. Moreover, the text in README.md refers to sources that we do not have. AFAICS, it says nothing about the binaries license, and there is no indication that the binaries were generated from GPL code.

I believe that this is just an oversight of Marvell, but having an explicit assurance would be better.

baruch

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

PATCH v3 2/4 binaries-marvell: new package

Hello,

Quoted 13 lines · Baruch Siach
Quoted 7 lines

boot/binaries-marvell/binaries-marvell.mk line 10

Quoted 4 lines
boot/binaries-marvell/binaries-marvell.mk new file +4 -0
+BINARIES_MARVELL_VERSION = 0dabe23b956420b0928d337d635f0cd5646c33d0
+BINARIES_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,binaries-marvell,$(BINARIES_MARVELL_VERSION))
+BINARIES_MARVELL_LICENSE = PROPRIETARY
+BINARIES_MARVELL_REDISTRIBUTE = NO  

Well, if you can't distribute it... it's a bit problematic no?

Quoted 5 lines

In fact, there is a license on the master branch, i.e at
https://raw.githubusercontent.com/MarvellEmbeddedProcessors/binaries-marvell/master/README.md.
And to me, this is GPL-2.0 with the FreeRTOS exception, so I've changed the BINARIES_MARVELL_LICENSE variable to that, and dropped BINARIES_MARVELL_REDISTRIBUTE. Let me know what you think.

Quoted 5 lines

IANAL, but as this text does not appear in the branch we are using, this might indicate that it does not apply there. Moreover, the text in README.md refers to sources that we do not have. AFAICS, it says nothing about the binaries license, and there is no indication that the binaries were generated from GPL code.

True.

Quoted 2 lines

I believe that this is just an oversight of Marvell, but having an explicit assurance would be better.

Agreed. Perhaps in the mean time, what Sergey originally did is the safest, i.e assuming is proprietary.

And in fact, my statement about <pkg>_REDISTRIBUTE = NO was incorrect. In the context of Buildroot <pkg>_REDISTRIBUTE = NO does not mean that you're not allowed to redistribute the software, it means that it shouldn't be shipped as part of legal-info. But still, I don't see why binaries-marvell shouldn't be listed as part of legal-info.

I'll go and ask Marvell about the license of those blobs.

Best regards,

Thomas

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

PATCH v3 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 840159fc2b..87b18cc9b9 100644
@@ -1508,6 +1508,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
#8 lore raw

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

Hello,

Quoted 6 lines · Sergey Matyukevich
boot/arm-trusted-firmware/arm-trusted-firmware.mk +0 -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

boot/arm-trusted-firmware/arm-trusted-firmware.mk ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin · line 49

Quoted 10 lines
boot/arm-trusted-firmware/arm-trusted-firmware.mk +8 -0
 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

I've changed that to:

	MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)

which avoids the need for the symlink you were creating in mv-ddr-marvell.

Best regards,

Thomas

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

PATCH v3 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 87b18cc9b9..54c45d60cf 100644
@@ -1513,12 +1513,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
#10 lore raw

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

Hello Sergey,

Quoted 7 lines · Sergey Matyukevich
board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch new file +1 -0
new file mode 100644
index 0000000000..87a4a93ff4
@@ -0,0 +1,38 @@
+commit 0f0dfbec373eef37dcb424b5b24ce899f05249cd

board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch line 11

Quoted 10 lines
board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch new file +10 -0
+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]>

Please use "git format-patch -N" to format the patches, and add your Signed-off-by after the existing Signed-off-by.

board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch line 23

Quoted 12 lines
board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch new file +12 -0
+Insert the micro SDcard in MacchiatoBin board and power it up.
+Serial console is accessible at the micro-USB Type-B connector
+marked CON9. The serial line setings are 115200 8N1.
+
+By default U-Boot will use environment from SPI flash. On first boot
+SPI flash may be empty or it may keep legacy environment incompatible
+with up-to-date mainline U-Boot and kernel. Then the following
+commands can be used to boot the board:
+
+=> ext4load mmc 1:1 0x01700000 /boot/uEnv-example.txt
+=> env import -t 0x01700000 $filesize
+=> boot  

So the default bootcmd is not running some U-Boot script by default ?

configs/solidrun_macchiatobin_mainline_defconfig line 3

Quoted 9 lines
configs/solidrun_macchiatobin_mainline_defconfig new file +3 -0
new file mode 100644
index 0000000000..aca798ab05
@@ -0,0 +1,45 @@
+BR2_aarch64=y
+
+#

This comment is not very useful :)

configs/solidrun_macchiatobin_mainline_defconfig line 37

Quoted 12 lines
configs/solidrun_macchiatobin_mainline_defconfig new file +12 -0
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="marvell/armada-8040-mcbin"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/macchiatobin/linux-extras.config"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+
+# rootfs
+BR2_TARGET_ROOTFS_TAR=y

Is the tarball really useful ?

configs/solidrun_macchiatobin_mainline_defconfig line 42

Quoted 5 lines
configs/solidrun_macchiatobin_mainline_defconfig new file +5 -0
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y

You don't have a FAT filesystem, so dosfstools and mtools are not needed.

(Same comment apply to the vendor defconfig, of course).

Thanks!

Thomas

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

v3 cover Add support for MacchiatoBin board

In reply to Sergey Matyukevich

Hello,

Quoted 4 lines · Sergey Matyukevich

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

Since these changes conflicted with changes proposed by Jagan Teki to support Allwinner A64/H5, and because I was not entirely happy with Jagan's proposal, I made a different proposal that solves both Jagan's use case and your use case. So I've taken those 3 patches and adapted them, fixing some issues along the way. Of course, I've preserved your authorship on the patches.

Could you check my proposal at
http://lists.busybox.net/pipermail/buildroot/2017-December/208788.html ?

Quoted 1 line

solidrun/macchiatobin: add new board

I have replied separately to this patch, which I have not taken in my patch series. If Jagan and you are happy with my patches, it would be nice if you could resubmit your defconfig on top of it (and after fixing the other comments I made).

Thanks a lot!

Thomas

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

v3 cover Add support for MacchiatoBin board

Hello Thomas,

Quoted 17 lines · Sergey Matyukevich
Quoted 5 lines

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

Since these changes conflicted with changes proposed by Jagan Teki to support Allwinner A64/H5, and because I was not entirely happy with Jagan's proposal, I made a different proposal that solves both Jagan's use case and your use case. So I've taken those 3 patches and adapted them, fixing some issues along the way. Of course, I've preserved your authorship on the patches.

Could you check my proposal at
http://lists.busybox.net/pipermail/buildroot/2017-December/208788.html ?

Quoted 6 lines
Quoted 1 line

solidrun/macchiatobin: add new board

I have replied separately to this patch, which I have not taken in my patch series. If Jagan and you are happy with my patches, it would be nice if you could resubmit your defconfig on top of it (and after fixing the other comments I made).

Sure, I will take part in review of your ATF patchset. Then I will resubmit MacchiatoBin support as soon as the common base for arm64 boards is settled.

Regards,
Sergey