layerscape: define only one package for ls-rcw
authorYangbo Lu <yangbo.lu@nxp.com>
Wed, 1 Apr 2020 08:47:41 +0000 (16:47 +0800)
committerPetr Štetiar <ynezz@true.cz>
Thu, 7 May 2020 10:53:06 +0000 (12:53 +0200)
We do not have to define package for each board, and
consider variant's building/installing.
It is easier to maintain ls-rcw with only one package
installing all boards RCW binaries as intermediate
files, each of which is just about hundreds of bytes.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
package/boot/tfa-layerscape/Makefile
package/firmware/layerscape/ls-rcw/Makefile
target/linux/layerscape/image/armv7.mk

index d2da84ec159a4e80bbe0c91ab1c3aea778313065..9de0908528ef4f29c22629a23460b48fed3b69fe 100644 (file)
@@ -25,7 +25,7 @@ define Package/tfa-layerscape/Config
     SECTION:=boot
     CATEGORY:=Boot Loaders
     TITLE:=$(2)
-    DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw-$(1)
+    DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw
     HIDDEN:=1
     VARIANT:=$(1)
     BIN_BL2:=$(3)
index ddef58fa0be72001ecd75189bceb325d83ca705a..a30ecb9fd956253ef530f721fa9a09f7fb5cd9f7 100644 (file)
@@ -18,81 +18,16 @@ PKG_MIRROR_HASH:=a9c97755809994a668ee5f0e535cef9f344fc5523c4299ac76f26c63976c80b
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/layerscape-rcw/Config
-  define Package/layerscape-rcw-$(1)
-    SECTION:=firmware
-    CATEGORY:=Firmware
-    TITLE:=$(2)
-    DEPENDS:=@TARGET_layerscape
-    CONFIG:=$(3)
-  endef
+define Package/layerscape-rcw
+  SECTION:=firmware
+  CATEGORY:=Firmware
+  TITLE:=NXP Layerscape RCW binaries
+  DEPENDS:=@TARGET_layerscape
 endef
 
-define Package/layerscape-rcw/ls1012afrdm
-  TITLE:=NXP LS1012AFRDM RCW binary
-  CONFIG:=ls1012afrdm/N_SSNP_3305/rcw_800.bin
-endef
-
-define Package/layerscape-rcw/ls1012ardb
-  TITLE:=NXP LS1012ARDB RCW binary
-  CONFIG:=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
-endef
-
-define Package/layerscape-rcw/ls1012afrwy
-  TITLE:=NXP LS1012AFRWY RCW binary
-  CONFIG:=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin
-endef
-
-define Package/layerscape-rcw/ls1043ardb
-  TITLE:=NXP LS1043ARDB RCW binary
-  CONFIG:=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
-endef
-
-define Package/layerscape-rcw/ls1043ardb-sdboot
-  TITLE:=NXP LS1043ARDB SD card boot RCW binary
-  CONFIG:=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin
-endef
-
-define Package/layerscape-rcw/ls1046ardb
-  TITLE:=NXP LS1046ARDB RCW binary
-  CONFIG:=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin
-endef
-
-define Package/layerscape-rcw/ls1046ardb-sdboot
-  TITLE:=NXP LS1046ARDB SD card boot RCW binary
-  CONFIG:=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
-endef
-
-define Package/layerscape-rcw/ls1088ardb
-  TITLE:=NXP LS1088ARDB RCW binary
-  CONFIG:=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
-endef
-
-define Package/layerscape-rcw/ls1088ardb-sdboot
-  TITLE:=NXP LS1088ARDB SD card boot RCW binary
-  CONFIG:=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
-endef
-
-define Package/layerscape-rcw/ls2088ardb
-  TITLE:=NXP LS2088ARDB RCW binary
-  CONFIG:=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
-endef
-
-define Package/layerscape-rcw/ls1021atwr
-  TITLE:=NXP LS1021ATWR RCW binary
-  CONFIG:=ls1021atwr/SSR_PNS_30/rcw_1200.bin
-endef
-
-define Package/layerscape-rcw/Install
-  define Package/layerscape-rcw-$(1)/install
-       $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
-       $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/$(1)-rcw.bin
-  endef
-endef
-
-RCWS := \
-  ls1012afrdm \
+BOARDS := \
   ls1012ardb \
+  ls1012afrdm \
   ls1012afrwy \
   ls1043ardb \
   ls1043ardb-sdboot \
@@ -103,9 +38,22 @@ RCWS := \
   ls2088ardb \
   ls1021atwr
 
-$(foreach rcw,$(RCWS), \
-       $(eval $(Package/layerscape-rcw/$(rcw))) \
-       $(eval $(call Package/layerscape-rcw/Config,$(rcw),$(TITLE),$(CONFIG))) \
-       $(eval $(call Package/layerscape-rcw/Install,$(rcw))) \
-       $(eval $(call BuildPackage,layerscape-rcw-$(rcw))) \
-)
+RCW_ls1012ardb        :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
+RCW_ls1012afrdm       :=ls1012afrdm/N_SSNP_3305/rcw_800.bin
+RCW_ls1012afrwy       :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin
+RCW_ls1043ardb        :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
+RCW_ls1043ardb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin
+RCW_ls1046ardb        :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin
+RCW_ls1046ardb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
+RCW_ls1088ardb        :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
+RCW_ls1088ardb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
+RCW_ls2088ardb        :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
+RCW_ls1021atwr        :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
+       $(foreach board,$(BOARDS), \
+               $(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/$(board)-rcw.bin;)
+endef
+
+$(eval $(call BuildPackage,layerscape-rcw))
index 96b45c272b8d79b5a841dd78fed16540a3a1a83e..e1a9efb8b6d370e99161e4b9c6a146a6395ffb89 100644 (file)
@@ -19,7 +19,7 @@ define Device/ls1021atwr
   DEVICE_VENDOR := NXP
   DEVICE_MODEL := TWR-LS1021A
   DEVICE_VARIANT := Default
-  DEVICE_PACKAGES += layerscape-rcw-ls1021atwr
+  DEVICE_PACKAGES += layerscape-rcw
   DEVICE_DTS := ls1021a-twr
   IMAGE/firmware.bin := \
     ls-clean | \