[OpenWrt-Devel] [PATCH 2/8] mvebu: image: stack repeated variables

Tomasz Maciej Nowak tomek_n at o2.pl
Wed May 1 10:42:18 PDT 2019


All of arm64 devices have part of variables repeatedly defined. Stack
them to common define, and reference it in each device recipe.

Signed-off-by: Tomasz Maciej Nowak <tomek_n at o2.pl>
---
 target/linux/mvebu/image/Makefile      |  8 ++++++++
 target/linux/mvebu/image/cortex-a53.mk | 12 ++----------
 target/linux/mvebu/image/cortex-a72.mk | 20 +++++---------------
 3 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 18421d1dd0..c0bb02d7c0 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -83,6 +83,14 @@ define Device/Default
 endef
 DEVICE_VARS += UBOOT
 
+define Device/Default-arm64
+  DTS_DIR := $(DTS_DIR)/marvell
+  IMAGES := sdcard.img.gz
+  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
+  KERNEL_NAME := Image
+  KERNEL := kernel-bin
+endef
+
 define Device/UBI
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk
index dd6176100b..a102f52481 100644
--- a/target/linux/mvebu/image/cortex-a53.mk
+++ b/target/linux/mvebu/image/cortex-a53.mk
@@ -1,25 +1,17 @@
 ifeq ($(SUBTARGET),cortexa53)
 
 define Device/globalscale-espressobin
-  KERNEL_NAME := Image
-  KERNEL := kernel-bin
+  $(call Device/Default-arm64)
   DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
-  IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   DEVICE_DTS := armada-3720-espressobin
-  DTS_DIR := $(DTS_DIR)/marvell
   SUPPORTED_DEVICES := globalscale,espressobin
 endef
 TARGET_DEVICES += globalscale-espressobin
 
 define Device/armada-3720-db
-  KERNEL_NAME := Image
-  KERNEL := kernel-bin
+  $(call Device/Default-arm64)
   DEVICE_TITLE := Marvell Armada 3720 Development Board DB-88F3720-DDR3
-  IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   DEVICE_DTS := armada-3720-db
-  DTS_DIR := $(DTS_DIR)/marvell
   SUPPORTED_DEVICES := marvell,armada-3720-db
 endef
 TARGET_DEVICES += armada-3720-db
diff --git a/target/linux/mvebu/image/cortex-a72.mk b/target/linux/mvebu/image/cortex-a72.mk
index 25bcf534bc..824f6b5d0f 100644
--- a/target/linux/mvebu/image/cortex-a72.mk
+++ b/target/linux/mvebu/image/cortex-a72.mk
@@ -1,38 +1,28 @@
 ifeq ($(SUBTARGET),cortexa72)
 
 define Device/armada-macchiatobin
-  KERNEL_NAME := Image
-  KERNEL := kernel-bin
+  $(call Device/Default-arm64)
   DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
   DEVICE_PACKAGES += kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
-  IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   DEVICE_DTS := armada-8040-mcbin
-  DTS_DIR := $(DTS_DIR)/marvell
   SUPPORTED_DEVICES := marvell,armada8040-mcbin
 endef
 TARGET_DEVICES += armada-macchiatobin
 
 define Device/armada-8040-db
-  KERNEL_NAME := Image
-  KERNEL := kernel-bin
+  $(call Device/Default-arm64)
   DEVICE_TITLE := Marvell Armada 8040 DB board
-  IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   DEVICE_DTS := armada-8040-db
-  DTS_DIR := $(DTS_DIR)/marvell
+  IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   SUPPORTED_DEVICES := marvell,armada8040-db
 endef
 TARGET_DEVICES += armada-8040-db
 
 define Device/armada-7040-db
-  KERNEL_NAME := Image
-  KERNEL := kernel-bin
+  $(call Device/Default-arm64)
   DEVICE_TITLE := Marvell Armada 7040 DB board
-  IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   DEVICE_DTS := armada-7040-db
-  DTS_DIR := $(DTS_DIR)/marvell
+  IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
   SUPPORTED_DEVICES := marvell,armada7040-db
 endef
 TARGET_DEVICES += armada-7040-db
-- 
2.21.0




More information about the openwrt-devel mailing list