diff mbox series

[v2,2/2] bcm4908: automatically set DEVICE_DTS from device name

Message ID 20210123122429.52929-2-freifunk@adrianschmutzler.de
State Under Review
Delegated to: Adrian Schmutzler
Headers show
Series [v2,1/2] bcm4908: sort and wrap build recipes | expand

Commit Message

Adrian Schmutzler Jan. 23, 2021, 12:24 p.m. UTC
This sets the DTS paths automatically based on their device definition
name. Devices where this is not possible may still be served by simply
overwriting DEVICE_DTS in their respective definition.

Cc: Rafał Miłecki <rafal@milecki.pl>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---
Changes in v2:
- rebase
---
 target/linux/bcm4908/image/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile
index 8a40a1e6a9..559f60faf1 100644
--- a/target/linux/bcm4908/image/Makefile
+++ b/target/linux/bcm4908/image/Makefile
@@ -37,6 +37,8 @@  define Build/bcm4908lzma
 	mv $@.new $@
 endef
 
+DTS_DIR := $(DTS_DIR)/broadcom/bcm4908
+
 define Device/Default
   KERNEL := kernel-bin | bcm4908lzma | bcm4908kernel
   KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
@@ -44,15 +46,16 @@  define Device/Default
   KERNEL_INITRAMFS := kernel-bin | bcm4908lzma | bcm4908kernel
   FILESYSTEMS := squashfs
   KERNEL_NAME := Image
+  DEVICE_DTS = $$(SOC)-$(subst _,-,$(1))
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
 endef
 
 define Device/asus_gt-ac5300
+  SOC := bcm4908
   DEVICE_VENDOR := Asus
   DEVICE_MODEL := GT-AC5300
-  DEVICE_DTS := broadcom/bcm4908/bcm4908-asus-gt-ac5300
   IMAGES := bin
   IMAGE/bin := append-ubi | bcm4908img | bcm4908asus
   ASUS_PRODUCTID := GT-AC5300
@@ -63,9 +66,9 @@  endef
 TARGET_DEVICES += asus_gt-ac5300
 
 define Device/netgear_r8000p
+  SOC := bcm4906
   DEVICE_VENDOR := Netgear
   DEVICE_MODEL := R8000P
-  DEVICE_DTS := broadcom/bcm4908/bcm4906-netgear-r8000p
   IMAGES := bin
   IMAGE/bin := append-ubi | bcm4908img
 endef