[meta-xilinx] [PATCH v2] platform-init: add support for psu_init_gpl files

Jean-Francois Dagenais jeff.dagenais at gmail.com
Thu Feb 2 12:05:12 PST 2017


Signed-off-by: Jean-Francois Dagenais <jeff.dagenais at gmail.com>
---
 classes/zynq-platform-paths.bbclass               |  6 +++++
 classes/zynq7-platform-paths.bbclass              |  4 ---
 conf/machine/zybo-linux-bd-zynq7.conf             |  2 +-
 recipes-bsp/platform-init/platform-init.bb        | 10 +++----
 recipes-bsp/platform-init/zynq-platform-init.inc  | 22 +++++++++++++++
 recipes-bsp/platform-init/zynq7-platform-init.inc | 22 ---------------
 recipes-bsp/reference-design/zybo-linux-bd.bb     |  4 +--
 recipes-bsp/u-boot/u-boot-spl-zynq-init.inc       | 33 ++++++++++++-----------
 recipes-bsp/u-boot/u-boot-xlnx-dev.bb             |  2 +-
 recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb         |  2 +-
 recipes-bsp/u-boot/u-boot_2016.11.bbappend        |  2 +-
 11 files changed, 56 insertions(+), 53 deletions(-)
 create mode 100644 classes/zynq-platform-paths.bbclass
 delete mode 100644 classes/zynq7-platform-paths.bbclass
 create mode 100644 recipes-bsp/platform-init/zynq-platform-init.inc
 delete mode 100644 recipes-bsp/platform-init/zynq7-platform-init.inc

diff --git a/classes/zynq-platform-paths.bbclass b/classes/zynq-platform-paths.bbclass
new file mode 100644
index 0000000..4b05681
--- /dev/null
+++ b/classes/zynq-platform-paths.bbclass
@@ -0,0 +1,6 @@
+# Define the path to the zynq platform init code/headers
+PLATFORM_INIT_DIR = "/usr/src/zynq-platform"
+PLATFORM_INIT_STAGE_DIR = "${STAGING_DIR_HOST}${PLATFORM_INIT_DIR}"
+PSx = ""
+PSx_zynq = "ps7"
+PSx_zynqmp = "psu"
diff --git a/classes/zynq7-platform-paths.bbclass b/classes/zynq7-platform-paths.bbclass
deleted file mode 100644
index a15f6ae..0000000
--- a/classes/zynq7-platform-paths.bbclass
+++ /dev/null
@@ -1,4 +0,0 @@
-# Define the path to the zynq platform init code/headers
-PLATFORM_INIT_DIR = "/usr/src/zynq7-platform"
-PLATFORM_INIT_STAGE_DIR = "${STAGING_DIR_HOST}${PLATFORM_INIT_DIR}"
-
diff --git a/conf/machine/zybo-linux-bd-zynq7.conf b/conf/machine/zybo-linux-bd-zynq7.conf
index f5524c1..32f5a87 100644
--- a/conf/machine/zybo-linux-bd-zynq7.conf
+++ b/conf/machine/zybo-linux-bd-zynq7.conf
@@ -25,7 +25,7 @@ MACHINE_DEVICETREE = " \
 
 UBOOT_MACHINE = "zynq_zybo_config"
 SPL_BINARY = "spl/boot.bin"
-FORCE_PS7INIT = "zybo"
+FORCE_PSxINIT = "zybo"
 
 EXTRA_IMAGEDEPENDS += "virtual/bitstream"
 
diff --git a/recipes-bsp/platform-init/platform-init.bb b/recipes-bsp/platform-init/platform-init.bb
index 5a98c55..9c54a9d 100644
--- a/recipes-bsp/platform-init/platform-init.bb
+++ b/recipes-bsp/platform-init/platform-init.bb
@@ -1,9 +1,9 @@
 SUMMARY = "Xilinx Platform Headers"
-DESCRPTION = "Xilinx ps7_init_gpl.c/h platform headers, used for building u-boot-spl and fsbl"
+DESCRPTION = "Xilinx ${PSx}_init_gpl.c/h platform headers, used for building u-boot-spl and fsbl"
 HOMEPAGE = "http://www.xilinx.com"
 SECTION = "bsp"
 
-include zynq7-platform-init.inc
+include zynq-platform-init.inc
 
 COMPATIBLE_MACHINE = "$^"
 COMPATIBLE_MACHINE_picozed-zynq7 = "picozed-zynq7"
@@ -11,12 +11,12 @@ COMPATIBLE_MACHINE_picozed-zynq7 = "picozed-zynq7"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
-SRC_URI = "file://ps7_init_gpl.c file://ps7_init_gpl.h"
+SRC_URI = "file://${PSx}_init_gpl.c file://${PSx}_init_gpl.h"
 
 S = "${WORKDIR}"
 
 do_install_append() {
-	install -m 0644 ${S}/ps7_init_gpl.c ${D}${PLATFORM_INIT_DIR}/
-	install -m 0644 ${S}/ps7_init_gpl.h ${D}${PLATFORM_INIT_DIR}/
+	install -m 0644 ${S}/${PSx}_init_gpl.c ${D}${PLATFORM_INIT_DIR}/
+	install -m 0644 ${S}/${PSx}_init_gpl.h ${D}${PLATFORM_INIT_DIR}/
 }
 
diff --git a/recipes-bsp/platform-init/zynq-platform-init.inc b/recipes-bsp/platform-init/zynq-platform-init.inc
new file mode 100644
index 0000000..4f609fd
--- /dev/null
+++ b/recipes-bsp/platform-init/zynq-platform-init.inc
@@ -0,0 +1,22 @@
+inherit zynq-platform-paths
+
+PROVIDES += "virtual/zynq-platform-init"
+
+INHIBIT_DEFAULT_DEPS = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SYSROOT_DIRS += "${PLATFORM_INIT_DIR}"
+
+do_compile() {
+	:
+}
+
+do_install() {
+	install -d ${D}${PLATFORM_INIT_DIR}
+}
+
+FILES_${PN} += " \
+		${PLATFORM_INIT_DIR}/${PSx}_init_gpl.c \
+		${PLATFORM_INIT_DIR}/${PSx}_init_gpl.h \
+		"
+
diff --git a/recipes-bsp/platform-init/zynq7-platform-init.inc b/recipes-bsp/platform-init/zynq7-platform-init.inc
deleted file mode 100644
index 2282428..0000000
--- a/recipes-bsp/platform-init/zynq7-platform-init.inc
+++ /dev/null
@@ -1,22 +0,0 @@
-inherit zynq7-platform-paths
-
-PROVIDES += "virtual/zynq7-platform-init"
-
-INHIBIT_DEFAULT_DEPS = "1"
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-SYSROOT_DIRS += "${PLATFORM_INIT_DIR}"
-
-do_compile() {
-	:
-}
-
-do_install() {
-	install -d ${D}${PLATFORM_INIT_DIR}
-}
-
-FILES_${PN} += " \
-		${PLATFORM_INIT_DIR}/ps7_init_gpl.c \
-		${PLATFORM_INIT_DIR}/ps7_init_gpl.h \
-		"
-
diff --git a/recipes-bsp/reference-design/zybo-linux-bd.bb b/recipes-bsp/reference-design/zybo-linux-bd.bb
index a6df84d..bb6411d 100644
--- a/recipes-bsp/reference-design/zybo-linux-bd.bb
+++ b/recipes-bsp/reference-design/zybo-linux-bd.bb
@@ -23,7 +23,7 @@ HDF = "/Projects/${HW_BD}/hw_handoff/${HW_BD}_wrapper.hdf"
 
 S ?= "${WORKDIR}/${MACHINE}"
 
-PROVIDES = "virtual/bitstream virtual/zynq7-platform-init"
+PROVIDES = "virtual/bitstream virtual/zynq-platform-init"
 
 PLATFORM_INIT ?= "ps7_init_gpl.c \
 		  ps7_init_gpl.h"
@@ -43,7 +43,7 @@ BITSTREAM ?= "bitstream-${PV}-${PR}.bit"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-inherit zynq7-platform-paths
+inherit zynq-platform-paths
 inherit deploy
 
 SYSROOT_DIRS += "${PLATFORM_INIT_DIR}"
diff --git a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
index cc06de6..bd7a580 100644
--- a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
+++ b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
@@ -1,35 +1,36 @@
-inherit zynq7-platform-paths
+inherit zynq-platform-paths
 
 do_configure_prepend() {
-	if ${@bb.utils.contains('DEPENDS', 'virtual/zynq7-platform-init', 'true', 'false', d)}; then
+	if ${@bb.utils.contains('DEPENDS', 'virtual/zynq-platform-init', 'true', 'false', d)}; then
 		if [ -d "${S}/board/xilinx/zynq/custom_hw_platform" ]; then
-			cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/
-			cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/
+			cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/
+			cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/
 		else
-			cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/
-			cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/
+			cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.h ${S}/board/xilinx/zynq/
+			cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.c ${S}/board/xilinx/zynq/
 		fi
-		if [ -n "${FORCE_PS7INIT}" ]; then
-			# overwrite all the existing platforms ps7_init files, this is a shotgun approach and only works due to
+		if [ -n "${FORCE_PSxINIT}" ]; then
+			# overwrite all the existing platforms ${PSx}_init files, this is a shotgun approach and only works due to
 			# u-boot being built for each machine seperately with seperate source directories.
 			for i in ${S}/board/xilinx/zynq/*/; do
-				cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h $i
-				cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c $i
+				cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.h $i
+				cp ${PLATFORM_INIT_STAGE_DIR}/${PSx}_init_gpl.c $i
 			done
 		fi
 	fi
 }
 
-FORCE_PS7INIT[doc] = "This variable is used to force the overriding of all ps7_init_gpl.* files in u-boot source with what is provided by virtual/zynq7-platform-init."
+FORCE_PSxINIT[doc] = "This variable is used to force the overriding of all ${PSx}_init_gpl.* files in u-boot source with what is provided by virtual/zynq-platform-init."
 
 python () {
-	# Determine if target machine needs to provide a custom ps7_init_gpl.*
-	if d.getVar("SOC_FAMILY", True) == "zynq":
+	# Determine if target machine needs to provide a custom ${PSx}_init_gpl.*
+	if "zynq" in d.getVar("SOC_FAMILY", True):
+		print("is zynq!\n")
 		if d.getVar("SPL_BINARY", True):
-			# only add the dependency if u-bopt doesn't already provide the platform init files
-			if d.getVar("FORCE_PS7INIT", True) or not bb.utils.contains("HAS_PS7INIT", d.getVar("UBOOT_MACHINE", True), True, False, d):
+			# only add the dependency if u-boot doesn't already provide the platform init files
+			if d.getVar("FORCE_PSxINIT", True) or not bb.utils.contains("HAS_PSxINIT", d.getVar("UBOOT_MACHINE", True), True, False, d):
 				# force the dependency on a recipe that provides the platform init files
-				d.setVar("DEPENDS", "%s virtual/zynq7-platform-init" % d.getVar("DEPENDS", True))
+				d.setVar("DEPENDS", "%s virtual/zynq-platform-init" % d.getVar("DEPENDS", True))
 
 		if d.getVar("SPL_BINARY", True) == "boot.bin":
 			# Add this for backwards compatiblity
diff --git a/recipes-bsp/u-boot/u-boot-xlnx-dev.bb b/recipes-bsp/u-boot/u-boot-xlnx-dev.bb
index 7653da5..2a100e6 100644
--- a/recipes-bsp/u-boot/u-boot-xlnx-dev.bb
+++ b/recipes-bsp/u-boot/u-boot-xlnx-dev.bb
@@ -18,7 +18,7 @@ SRCREV ?= "${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/bootloader", "u-b
 PV = "${UBRANCH}-xilinx-dev+git${SRCPV}"
 
 # Newer versions of u-boot have support for these
-HAS_PS7INIT ?= " \
+HAS_PSxINIT ?= " \
 		zynq_microzed_config \
 		zynq_zed_config \
 		zynq_zc702_config \
diff --git a/recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb b/recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb
index 61f1cb7..18f7d34 100644
--- a/recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb
+++ b/recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb
@@ -20,7 +20,7 @@ SRC_URI_append_zc702-zynq7 = " file://uEnv.txt"
 SRC_URI_append_zedboard-zynq7 = " file://uEnv.txt"
 
 # u-boot 2016.07 has support for these
-HAS_PS7INIT ?= " \
+HAS_PSxINIT ?= " \
 		zynq_microzed_config \
 		zynq_zed_config \
 		zynq_zc702_config \
diff --git a/recipes-bsp/u-boot/u-boot_2016.11.bbappend b/recipes-bsp/u-boot/u-boot_2016.11.bbappend
index 78e5ac6..bd142fb 100644
--- a/recipes-bsp/u-boot/u-boot_2016.11.bbappend
+++ b/recipes-bsp/u-boot/u-boot_2016.11.bbappend
@@ -1,7 +1,7 @@
 include u-boot-spl-zynq-init.inc
 
 # u-boot 2016.11 has support for these
-HAS_PS7INIT ?= " \
+HAS_PSxINIT ?= " \
 		zynq_microzed_config \
 		zynq_zed_config \
 		zynq_zc702_config \
-- 
2.1.4




More information about the meta-xilinx mailing list