All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board
@ 2017-12-03 18:18 Sergey Matyukevich
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package Sergey Matyukevich
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Sergey Matyukevich @ 2017-12-03 18:18 UTC (permalink / raw)
  To: buildroot

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(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package
  2017-12-03 18:18 [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Sergey Matyukevich
@ 2017-12-03 18:18 ` Sergey Matyukevich
  2017-12-03 22:01   ` Thomas Petazzoni
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 2/4] binaries-marvell: " Sergey Matyukevich
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Sergey Matyukevich @ 2017-12-03 18:18 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 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

diff --git a/DEVELOPERS b/DEVELOPERS
index d96884b7fb..d223be9643 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1508,8 +1508,9 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
-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
diff --git a/boot/Config.in b/boot/Config.in
index 2f46c8546e..3950c49524 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -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"
diff --git a/boot/mv-ddr-marvell/Config.in b/boot/mv-ddr-marvell/Config.in
new file mode 100644
index 0000000000..d5c28af97a
--- /dev/null
+++ b/boot/mv-ddr-marvell/Config.in
@@ -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.
diff --git a/boot/mv-ddr-marvell/mv-ddr-marvell.hash b/boot/mv-ddr-marvell/mv-ddr-marvell.hash
new file mode 100644
index 0000000000..b96d4d2bc8
--- /dev/null
+++ b/boot/mv-ddr-marvell/mv-ddr-marvell.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 d413546367ffa3b5f4373a777b9efeb32dcc74d6106897c248935ecb79afc454 mv-ddr-marvell-656440a9690f3d07be9e3d2c39d7cf56fd96eb7b.tar.gz
diff --git a/boot/mv-ddr-marvell/mv-ddr-marvell.mk b/boot/mv-ddr-marvell/mv-ddr-marvell.mk
new file mode 100644
index 0000000000..e33065c24e
--- /dev/null
+++ b/boot/mv-ddr-marvell/mv-ddr-marvell.mk
@@ -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))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 2/4] binaries-marvell: new package
  2017-12-03 18:18 [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Sergey Matyukevich
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package Sergey Matyukevich
@ 2017-12-03 18:18 ` Sergey Matyukevich
  2017-12-03 22:03   ` Thomas Petazzoni
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 3/4] atf: add support for Marvell Armada SoCs Sergey Matyukevich
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Sergey Matyukevich @ 2017-12-03 18:18 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 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

diff --git a/DEVELOPERS b/DEVELOPERS
index d223be9643..840159fc2b 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1508,6 +1508,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
+F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	package/armbian-firmware/
 F:	package/xr819-xradio/
diff --git a/boot/Config.in b/boot/Config.in
index 3950c49524..3687c41a2c 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -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"
diff --git a/boot/binaries-marvell/Config.in b/boot/binaries-marvell/Config.in
new file mode 100644
index 0000000000..0a0717cd26
--- /dev/null
+++ b/boot/binaries-marvell/Config.in
@@ -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
diff --git a/boot/binaries-marvell/binaries-marvell.hash b/boot/binaries-marvell/binaries-marvell.hash
new file mode 100644
index 0000000000..401584dacd
--- /dev/null
+++ b/boot/binaries-marvell/binaries-marvell.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 22a201542d8f93cf88623065db5f3377822b59cbfdf98a8e60cdee629273d3a0 binaries-marvell-0dabe23b956420b0928d337d635f0cd5646c33d0.tar.gz
diff --git a/boot/binaries-marvell/binaries-marvell.mk b/boot/binaries-marvell/binaries-marvell.mk
new file mode 100644
index 0000000000..7bb5071aed
--- /dev/null
+++ b/boot/binaries-marvell/binaries-marvell.mk
@@ -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))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 3/4] atf: add support for Marvell Armada SoCs
  2017-12-03 18:18 [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Sergey Matyukevich
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package Sergey Matyukevich
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 2/4] binaries-marvell: " Sergey Matyukevich
@ 2017-12-03 18:18 ` Sergey Matyukevich
  2017-12-03 22:04   ` Thomas Petazzoni
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 4/4] solidrun/macchiatobin: add new board Sergey Matyukevich
  2017-12-03 21:53 ` [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Thomas Petazzoni
  4 siblings, 1 reply; 13+ messages in thread
From: Sergey Matyukevich @ 2017-12-03 18:18 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 DEVELOPERS                                        |  1 +
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 840159fc2b..87b18cc9b9 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1508,6 +1508,7 @@ F:	package/lua-resty-http/
 F:	package/mpir/
 
 N:	Sergey Matyukevich <geomatsi@gmail.com>
+F:	boot/arm-trusted-firmware/
 F:	boot/binaries-marvell/
 F:	boot/mv-ddr-marvell/
 F:	package/armbian-firmware/
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 7b1cc6ebb6..035f7de189 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -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) \
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 4/4] solidrun/macchiatobin: add new board
  2017-12-03 18:18 [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Sergey Matyukevich
                   ` (2 preceding siblings ...)
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 3/4] atf: add support for Marvell Armada SoCs Sergey Matyukevich
@ 2017-12-03 18:18 ` Sergey Matyukevich
  2017-12-03 21:35   ` Thomas Petazzoni
  2017-12-03 21:53 ` [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Thomas Petazzoni
  4 siblings, 1 reply; 13+ messages in thread
From: Sergey Matyukevich @ 2017-12-03 18:18 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 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

diff --git a/DEVELOPERS b/DEVELOPERS
index 87b18cc9b9..54c45d60cf 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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 <sergio.prado@e-labworks.com>
 F:	package/libgdiplus/
diff --git a/board/solidrun/macchiatobin/genimage.cfg b/board/solidrun/macchiatobin/genimage.cfg
new file mode 100644
index 0000000000..fdcda368a2
--- /dev/null
+++ b/board/solidrun/macchiatobin/genimage.cfg
@@ -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"
+	}
+}
diff --git a/board/solidrun/macchiatobin/linux-extras.config b/board/solidrun/macchiatobin/linux-extras.config
new file mode 100644
index 0000000000..11267d2f80
--- /dev/null
+++ b/board/solidrun/macchiatobin/linux-extras.config
@@ -0,0 +1,3 @@
+CONFIG_MARVELL_PHY=y
+CONFIG_MARVELL_10G_PHY=y
+CONFIG_PHY_MVEBU_CP110_COMPHY=y
diff --git a/board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch b/board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch
new file mode 100644
index 0000000000..87a4a93ff4
--- /dev/null
+++ b/board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch
@@ -0,0 +1,38 @@
+commit 0f0dfbec373eef37dcb424b5b24ce899f05249cd
+Author: Antoine Tenart <antoine.tenart@free-electrons.com>
+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 <antoine.tenart@free-electrons.com>
+    Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+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";
diff --git a/board/solidrun/macchiatobin/patches/linux/0002-arm64-dts-marvell-add-comphy-nodes-on-cp110.patch b/board/solidrun/macchiatobin/patches/linux/0002-arm64-dts-marvell-add-comphy-nodes-on-cp110.patch
new file mode 100644
index 0000000000..738abfa670
--- /dev/null
+++ b/board/solidrun/macchiatobin/patches/linux/0002-arm64-dts-marvell-add-comphy-nodes-on-cp110.patch
@@ -0,0 +1,111 @@
+commit c90dab5d2bf4f6726e5900c6baeb3ed9ff7fbb03
+Author: Antoine Tenart <antoine.tenart@free-electrons.com>
+Date:   Mon Sep 18 09:58:09 2017 +0200
+
+    arm64: dts: marvell: add comphy nodes on cp110 master and slave
+    
+    This patch describes the comphy available in the cp110 master and slave.
+    This comphy provides serdes lanes used by various controllers such as
+    the network one.
+    
+    Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
+    Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
+index 4dd8c7d53764..b91c27ccee33 100644
+--- a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
++++ b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
+@@ -109,6 +109,44 @@
+ 				};
+ 			};
+ 
++			cpm_comphy: phy at 120000 {
++				compatible = "marvell,comphy-cp110";
++				reg = <0x120000 0x6000>;
++				marvell,system-controller = <&cpm_syscon0>;
++				#address-cells = <1>;
++				#size-cells = <0>;
++
++				cpm_comphy0: phy at 0 {
++					reg = <0>;
++					#phy-cells = <1>;
++				};
++
++				cpm_comphy1: phy at 1 {
++					reg = <1>;
++					#phy-cells = <1>;
++				};
++
++				cpm_comphy2: phy at 2 {
++					reg = <2>;
++					#phy-cells = <1>;
++				};
++
++				cpm_comphy3: phy at 3 {
++					reg = <3>;
++					#phy-cells = <1>;
++				};
++
++				cpm_comphy4: phy at 4 {
++					reg = <4>;
++					#phy-cells = <1>;
++				};
++
++				cpm_comphy5: phy at 5 {
++					reg = <5>;
++					#phy-cells = <1>;
++				};
++			};
++
+ 			cpm_mdio: mdio at 12a200 {
+ 				#address-cells = <1>;
+ 				#size-cells = <0>;
+diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
+index 43fa491da6ce..6849348ae214 100644
+--- a/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
++++ b/arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
+@@ -109,6 +109,44 @@
+ 				};
+ 			};
+ 
++			cps_comphy: phy at 120000 {
++				compatible = "marvell,comphy-cp110";
++				reg = <0x120000 0x6000>;
++				marvell,system-controller = <&cps_syscon0>;
++				#address-cells = <1>;
++				#size-cells = <0>;
++
++				cps_comphy0: phy at 0 {
++					reg = <0>;
++					#phy-cells = <1>;
++				};
++
++				cps_comphy1: phy at 1 {
++					reg = <1>;
++					#phy-cells = <1>;
++				};
++
++				cps_comphy2: phy at 2 {
++					reg = <2>;
++					#phy-cells = <1>;
++				};
++
++				cps_comphy3: phy at 3 {
++					reg = <3>;
++					#phy-cells = <1>;
++				};
++
++				cps_comphy4: phy at 4 {
++					reg = <4>;
++					#phy-cells = <1>;
++				};
++
++				cps_comphy5: phy at 5 {
++					reg = <5>;
++					#phy-cells = <1>;
++				};
++			};
++
+ 			cps_mdio: mdio at 12a200 {
+ 				#address-cells = <1>;
+ 				#size-cells = <0>;
diff --git a/board/solidrun/macchiatobin/patches/linux/0003-arm64-dts-marvell-mcbin-add-comphy.patch b/board/solidrun/macchiatobin/patches/linux/0003-arm64-dts-marvell-mcbin-add-comphy.patch
new file mode 100644
index 0000000000..ef9baa0cb6
--- /dev/null
+++ b/board/solidrun/macchiatobin/patches/linux/0003-arm64-dts-marvell-mcbin-add-comphy.patch
@@ -0,0 +1,52 @@
+commit 26c08c06b8270ebdd1b8841bdf7e48f07a06cf3d
+Author: Antoine Tenart <antoine.tenart@free-electrons.com>
+Date:   Thu Sep 21 09:54:07 2017 +0200
+
+    arm64: dts: marvell: mcbin: add comphy references to Ethernet ports
+    
+    This patch adds comphy phandles to the Ethernet ports in the mcbin
+    device tree. The comphy is used to configure the serdes PHYs used by
+    these ports.
+    
+    Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
+    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+    Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+diff --git a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
+index e7a7cbee2fe4..a59a35c182bd 100644
+--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
++++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
+@@ -224,8 +224,11 @@
+ 
+ &cpm_eth0 {
+ 	status = "okay";
++	/* Network PHY */
+ 	phy = <&phy0>;
+ 	phy-mode = "10gbase-kr";
++	/* Generic PHY, providing serdes lanes */
++	phys = <&cpm_comphy4 0>;
+ };
+ 
+ &cpm_sata0 {
+@@ -259,15 +262,21 @@
+ 
+ &cps_eth0 {
+ 	status = "okay";
++	/* Network PHY */
+ 	phy = <&phy8>;
+ 	phy-mode = "10gbase-kr";
++	/* Generic PHY, providing serdes lanes */
++	phys = <&cps_comphy4 0>;
+ };
+ 
+ &cps_eth1 {
+ 	/* CPS Lane 0 - J5 (Gigabit RJ45) */
+ 	status = "okay";
++	/* Network PHY */
+ 	phy = <&ge_phy>;
+ 	phy-mode = "sgmii";
++	/* Generic PHY, providing serdes lanes */
++	phys = <&cps_comphy0 1>;
+ };
+ 
+ &cps_pinctrl {
diff --git a/board/solidrun/macchiatobin/post-build.sh b/board/solidrun/macchiatobin/post-build.sh
new file mode 100755
index 0000000000..9c1b5b883c
--- /dev/null
+++ b/board/solidrun/macchiatobin/post-build.sh
@@ -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
diff --git a/board/solidrun/macchiatobin/readme.txt b/board/solidrun/macchiatobin/readme.txt
new file mode 100644
index 0000000000..7fee6a11e0
--- /dev/null
+++ b/board/solidrun/macchiatobin/readme.txt
@@ -0,0 +1,82 @@
+Intro
+=====
+
+This default configuration will allow you to start experimenting with the
+buildroot environment for the MacchiatoBin board based on Marvell Armada
+8040 SoC. Documentation for the board hardware and software
+is available on wiki: http://wiki.macchiatobin.net
+
+This default configuration will bring-up the board and allow
+access through the serial console.
+
+How to build
+============
+
+There are two build options. The first option is mainline BSP:
+ - Linux v4.14
+ - U-Boot v2017.09
+
+Marvell BSP is based on the following Linux and U-Boot versions:
+ - Linux v4.4.52
+ - U-Boot v2017.03
+Sources are available on Marvell GitHub page:
+   https://github.com/MarvellEmbeddedProcessors
+
+At the moment mainline support for the board is a work in progress.
+Mainline kernel 4.14 with provided patches enables eth2 in 1Gb
+(RJ45 connector J5) and eth0 in 10Gb (SFP connector J15).
+Vendor BSP enables more hardware features out of the box,
+e.g. all the network interfaces.
+
+To use mainline BSP run the following commands:
+    $ make solidrun_macchiatobin_mainline_defconfig
+    $ make
+
+To use vendor BSP run the following commands:
+    $ make solidrun_macchiatobin_marvell_defconfig
+    $ make
+
+Note: you will need access to the internet to download
+all the required sources.
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image
+called "sdcard.img" in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX bs=1M conv=fsync
+  $ sudo sync
+
+How to boot the board
+=====================
+
+MacchiatoBin board can be setup to load bootloader from different
+sources including eMMC, SPI flash, and SD-card. In order to select
+boot from SD-card DIP switches SW1 and SW2 should be configured
+as follows:
+SW2: 01110
+SW1: 1xxxx
+
+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
+
+The example environment from uEnv-example.txt can be written to
+SPI flash using the following commands:
+
+=> env default -f -a
+=> ext4load mmc 1:1 0x01700000 /boot/uEnv-example.txt
+=> env import -t 0x01700000 $filesize
+=> saveenv
diff --git a/board/solidrun/macchiatobin/uEnv-example.txt b/board/solidrun/macchiatobin/uEnv-example.txt
new file mode 100644
index 0000000000..1967e2badd
--- /dev/null
+++ b/board/solidrun/macchiatobin/uEnv-example.txt
@@ -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
diff --git a/configs/solidrun_macchiatobin_mainline_defconfig b/configs/solidrun_macchiatobin_mainline_defconfig
new file mode 100644
index 0000000000..aca798ab05
--- /dev/null
+++ b/configs/solidrun_macchiatobin_mainline_defconfig
@@ -0,0 +1,45 @@
+BR2_aarch64=y
+
+#
+BR2_GLOBAL_PATCH_DIR="board/solidrun/macchiatobin/patches"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14=y
+BR2_TARGET_GENERIC_HOSTNAME="mcbin"
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for Marvell MacchiatoBin"
+
+# Firmware
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/atf-marvell.git"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="atf-v1.3-armada-17.10"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="a80x0_mcbin"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="USE_COHERENT_MEM=0"
+BR2_TARGET_BINARIES_MARVELL=y
+BR2_TARGET_BINARIES_MARVELL_8040=y
+BR2_TARGET_MV_DDR_MARVELL=y
+
+# U-Boot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="mvebu_mcbin-88f8040"
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.09"
+
+# 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
+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
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/solidrun/macchiatobin/genimage.cfg"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/solidrun/macchiatobin/post-build.sh"
diff --git a/configs/solidrun_macchiatobin_marvell_defconfig b/configs/solidrun_macchiatobin_marvell_defconfig
new file mode 100644
index 0000000000..26a1943cd8
--- /dev/null
+++ b/configs/solidrun_macchiatobin_marvell_defconfig
@@ -0,0 +1,45 @@
+BR2_aarch64=y
+
+#
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_TARGET_GENERIC_HOSTNAME="mcbin"
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for Marvell MacchiatoBin"
+
+# Firmware
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/atf-marvell.git"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="atf-v1.3-armada-17.10"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="a80x0_mcbin"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="USE_COHERENT_MEM=0"
+BR2_TARGET_BINARIES_MARVELL=y
+BR2_TARGET_BINARIES_MARVELL_8040=y
+BR2_TARGET_MV_DDR_MARVELL=y
+
+# U-Boot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/u-boot-marvell"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="u-boot-2017.03-armada-17.10"
+BR2_TARGET_UBOOT_BOARDNAME="mvebu_mcbin-88f8040"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/linux-marvell"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="linux-4.4.52-armada-17.10"
+BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v8_lsp"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="marvell/armada-8040-mcbin"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+
+# rootfs
+BR2_TARGET_ROOTFS_TAR=y
+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
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/solidrun/macchiatobin/genimage.cfg"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/solidrun/macchiatobin/post-build.sh"
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 4/4] solidrun/macchiatobin: add new board
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 4/4] solidrun/macchiatobin: add new board Sergey Matyukevich
@ 2017-12-03 21:35   ` Thomas Petazzoni
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:35 UTC (permalink / raw)
  To: buildroot

Hello Sergey,

On Sun,  3 Dec 2017 21:18:18 +0300, Sergey Matyukevich wrote:

> diff --git a/board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch b/board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch
> new file mode 100644
> index 0000000000..87a4a93ff4
> --- /dev/null
> +++ b/board/solidrun/macchiatobin/patches/linux/0001-arm64-dts-marvell-extend-cp110-syscon-regs.patch
> @@ -0,0 +1,38 @@
> +commit 0f0dfbec373eef37dcb424b5b24ce899f05249cd
> +Author: Antoine Tenart <antoine.tenart@free-electrons.com>
> +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 <antoine.tenart@free-electrons.com>
> +    Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

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

> +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 ?

> diff --git a/configs/solidrun_macchiatobin_mainline_defconfig b/configs/solidrun_macchiatobin_mainline_defconfig
> new file mode 100644
> index 0000000000..aca798ab05
> --- /dev/null
> +++ b/configs/solidrun_macchiatobin_mainline_defconfig
> @@ -0,0 +1,45 @@
> +BR2_aarch64=y
> +
> +#

This comment is not very useful :)

> +# 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 ?

> +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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board
  2017-12-03 18:18 [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Sergey Matyukevich
                   ` (3 preceding siblings ...)
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 4/4] solidrun/macchiatobin: add new board Sergey Matyukevich
@ 2017-12-03 21:53 ` Thomas Petazzoni
  2017-12-04  6:10   ` Sergey Matyukevich
  4 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 21:53 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  3 Dec 2017 21:18:14 +0300, Sergey Matyukevich wrote:

> 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 ?

>   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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package Sergey Matyukevich
@ 2017-12-03 22:01   ` Thomas Petazzoni
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 22:01 UTC (permalink / raw)
  To: buildroot

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.

On Sun,  3 Dec 2017 21:18:15 +0300, Sergey Matyukevich wrote:

> diff --git a/DEVELOPERS b/DEVELOPERS
> index d96884b7fb..d223be9643 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1508,8 +1508,9 @@ F:	package/lua-resty-http/
>  F:	package/mpir/
>  
>  N:	Sergey Matyukevich <geomatsi@gmail.com>
> -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.

> diff --git a/boot/mv-ddr-marvell/Config.in b/boot/mv-ddr-marvell/Config.in
> new file mode 100644
> index 0000000000..d5c28af97a
> --- /dev/null
> +++ b/boot/mv-ddr-marvell/Config.in
> @@ -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/).

> +	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.

> diff --git a/boot/mv-ddr-marvell/mv-ddr-marvell.mk b/boot/mv-ddr-marvell/mv-ddr-marvell.mk
> new file mode 100644
> index 0000000000..e33065c24e
> --- /dev/null
> +++ b/boot/mv-ddr-marvell/mv-ddr-marvell.mk
> @@ -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.

> +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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 2/4] binaries-marvell: new package
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 2/4] binaries-marvell: " Sergey Matyukevich
@ 2017-12-03 22:03   ` Thomas Petazzoni
  2017-12-04  5:45     ` Baruch Siach
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 22:03 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  3 Dec 2017 21:18:16 +0300, Sergey Matyukevich wrote:

> diff --git a/boot/binaries-marvell/Config.in b/boot/binaries-marvell/Config.in
> new file mode 100644
> index 0000000000..0a0717cd26
> --- /dev/null
> +++ b/boot/binaries-marvell/Config.in
> @@ -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.

> +	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.

> diff --git a/boot/binaries-marvell/binaries-marvell.mk b/boot/binaries-marvell/binaries-marvell.mk
> new file mode 100644
> index 0000000000..7bb5071aed
> --- /dev/null
> +++ b/boot/binaries-marvell/binaries-marvell.mk
> @@ -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.

> +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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 3/4] atf: add support for Marvell Armada SoCs
  2017-12-03 18:18 ` [Buildroot] [PATCH v3 3/4] atf: add support for Marvell Armada SoCs Sergey Matyukevich
@ 2017-12-03 22:04   ` Thomas Petazzoni
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2017-12-03 22:04 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  3 Dec 2017 21:18:17 +0300, Sergey Matyukevich wrote:

> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index 7b1cc6ebb6..035f7de189 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -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

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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 2/4] binaries-marvell: new package
  2017-12-03 22:03   ` Thomas Petazzoni
@ 2017-12-04  5:45     ` Baruch Siach
  2017-12-04  8:01       ` Thomas Petazzoni
  0 siblings, 1 reply; 13+ messages in thread
From: Baruch Siach @ 2017-12-04  5:45 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sun, Dec 03, 2017 at 11:03:13PM +0100, Thomas Petazzoni wrote:
> On Sun,  3 Dec 2017 21:18:16 +0300, Sergey Matyukevich wrote: 
> > diff --git a/boot/binaries-marvell/binaries-marvell.mk b/boot/binaries-marvell/binaries-marvell.mk
> > new file mode 100644
> > index 0000000000..7bb5071aed
> > --- /dev/null
> > +++ b/boot/binaries-marvell/binaries-marvell.mk
> > @@ -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.

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

-- 
     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 -

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board
  2017-12-03 21:53 ` [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Thomas Petazzoni
@ 2017-12-04  6:10   ` Sergey Matyukevich
  0 siblings, 0 replies; 13+ messages in thread
From: Sergey Matyukevich @ 2017-12-04  6:10 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

> On Sun,  3 Dec 2017 21:18:14 +0300, Sergey Matyukevich wrote:
> 
> > 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 ?
> 
> >   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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH v3 2/4] binaries-marvell: new package
  2017-12-04  5:45     ` Baruch Siach
@ 2017-12-04  8:01       ` Thomas Petazzoni
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2017-12-04  8:01 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 4 Dec 2017 07:45:10 +0200, Baruch Siach wrote:

> > > +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.  
> 
> 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.

> 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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-12-04  8:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-03 18:18 [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Sergey Matyukevich
2017-12-03 18:18 ` [Buildroot] [PATCH v3 1/4] mv-ddr-marvell: new package Sergey Matyukevich
2017-12-03 22:01   ` Thomas Petazzoni
2017-12-03 18:18 ` [Buildroot] [PATCH v3 2/4] binaries-marvell: " Sergey Matyukevich
2017-12-03 22:03   ` Thomas Petazzoni
2017-12-04  5:45     ` Baruch Siach
2017-12-04  8:01       ` Thomas Petazzoni
2017-12-03 18:18 ` [Buildroot] [PATCH v3 3/4] atf: add support for Marvell Armada SoCs Sergey Matyukevich
2017-12-03 22:04   ` Thomas Petazzoni
2017-12-03 18:18 ` [Buildroot] [PATCH v3 4/4] solidrun/macchiatobin: add new board Sergey Matyukevich
2017-12-03 21:35   ` Thomas Petazzoni
2017-12-03 21:53 ` [Buildroot] [PATCH v3 0/4] Add support for MacchiatoBin board Thomas Petazzoni
2017-12-04  6:10   ` Sergey Matyukevich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.