From 5b8639f02e2680cbf3a0a5ffe0a9959386e9230b Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Thu, 26 Oct 2017 15:49:31 +0800 Subject: [PATCH] layerscape: add ppa firmware package This patch is to add PPA (The Primary Protected Application) package and also enable it for all layerscape devices. LSDK github provides ppa source code git tree, but it only could be compiled with 64-bit toolchain. For 32-bit devices, there was no method to use it. https://github.com/qoriq-open-source/ppa-generic This patch is to directly use a private ppa binary tree for both 32-bit and 64-bit devices. Signed-off-by: Yangbo Lu --- package/firmware/layerscape/ppa/Makefile | 105 +++++++++++++++++++++++ target/linux/layerscape/image/Makefile | 33 ++++--- 2 files changed, 128 insertions(+), 10 deletions(-) create mode 100644 package/firmware/layerscape/ppa/Makefile diff --git a/package/firmware/layerscape/ppa/Makefile b/package/firmware/layerscape/ppa/Makefile new file mode 100644 index 0000000000..eea8c5fdd2 --- /dev/null +++ b/package/firmware/layerscape/ppa/Makefile @@ -0,0 +1,105 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +PKG_NAME:=ppa +PKG_VERSION:=2017.09 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/yangbolu1991/ppa-binary.git +PKG_SOURCE_VERSION:=76a80ca988affbee67bb17096aefb82ba6d91be7 +PKG_MIRROR_HASH:=76be14a8be9e01036a0e103c8e86d40a6ce4c1a7504930d0d9da54a570744be3 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define ppa/Default + TITLE:= + CONFIG:= +endef + +define ppa/ls1043ardb + TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board + CONFIG=ppa-ls1043a.itb +endef + +define ppa/ls1046ardb + TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board + CONFIG=ppa-ls1046a.itb +endef + +define ppa/ls1012ardb + TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board + CONFIG=ppa-ls1012a.itb +endef + +define ppa/ls1088ardb + TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board + CONFIG=ppa-ls1088a.itb +endef + +define ppa/ls2088ardb + TITLE=PPA firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board + CONFIG=ppa-ls2088a.itb +endef + +PPAS := \ + ls1043ardb \ + ls1046ardb \ + ls1012ardb \ + ls1088ardb \ + ls2088ardb + +define Package/ppa/template +define Package/layerscape-ppa-$(1) + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:= @TARGET_layerscape + TITLE:=$(2) + VARIANT:=$(1) +endef +endef + +define BuildPPAPackage + $(eval $(ppa/Default)) + $(eval $(ppa/$(1))) + $(call Package/ppa/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call ppa/$(BUILD_VARIANT))) +PPA_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +endif + +define Build/Compile +endef + +define Package/ppa/install/default + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(PPA_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-ppa.itb +endef + +define Package/ppa/install/template +define Package/layerscape-ppa-$(1)/install + $(call Package/ppa/install/default,$(2)) +endef +endef + +$(foreach r,$(PPAS), \ + $(eval $(call Package/ppa/install/template,$(r),$(r))) \ +) + +$(foreach r,$(PPAS), \ + $(eval $(call BuildPPAPackage,$(r))) \ + $(eval $(call BuildPackage,layerscape-ppa-$(r))) \ +) diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index 85a6b822eb..d1449aa105 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -16,6 +16,10 @@ define Build/append-ls-uboot dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@ endef +define Build/append-ls-ppa + dd if=$(STAGING_DIR_IMAGE)/$(1)-ppa.itb >> $@ +endef + define Build/append-ls-fman dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@ endef @@ -67,10 +71,12 @@ endef define Device/ls1043ardb DEVICE_TITLE := ls1043ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb + DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ + fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 9M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 9M | \ append-ls-fman $(1) | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ @@ -80,10 +86,12 @@ TARGET_DEVICES += ls1043ardb define Device/ls1046ardb DEVICE_TITLE := ls1046ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb + DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ + fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 9M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 9M | \ append-ls-fman $(1) | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ @@ -94,10 +102,11 @@ TARGET_DEVICES += ls1046ardb define Device/ls1012ardb DEVICE_TITLE := ls1012ardb-$(SUBTARGET) DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ - kmod-ppfe layerscape-ppfe + kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 10M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ append-ls-ppfe | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ @@ -109,10 +118,12 @@ ifeq ($(SUBTARGET),armv8_64b) define Device/ls1088ardb DEVICE_TITLE := ls1088ardb-$(SUBTARGET) DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \ - layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool + layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \ + layerscape-ppa-ls1088ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 10M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ append-ls-mc $(1) | pad-to 13M | \ append-ls-dpl $(1) | pad-to 14M | \ append-ls-dpc $(1) | pad-to 15M | \ @@ -125,10 +136,12 @@ TARGET_DEVICES += ls1088ardb define Device/ls2088ardb DEVICE_TITLE := ls2088ardb-$(SUBTARGET) DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \ - layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool + layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \ + layerscape-ppa-ls2088ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 10M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ append-ls-mc $(1) | pad-to 13M | \ append-ls-dpl $(1) | pad-to 14M | \ append-ls-dpc $(1) | pad-to 15M | \