apm821xx: switch over from DTB_SIZE to DEVICE_DTC_FLAGS
[openwrt/staging/jow.git] / target / linux / apm821xx / image / Makefile
index 2331947e332e5447aec9becf779bfd7f7c7b6975..03799bcc1061d43fe508d0e765ac9400812b91ee 100644 (file)
@@ -1,18 +1,14 @@
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
+# SPDX-License-Identifier: GPL-2.0-only
+
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-DEVICE_VARS += DTB_SIZE
-
 define Build/boot-img
        $(RM) -rf $@.bootdir
        mkdir -p $@.bootdir/boot
 
        $(CP) $@.scr $@.bootdir/boot/boot.scr
-       $(CP) $(IMAGE_KERNEL).dtb $@.bootdir/boot/$(DEVICE_DTB)
+       $(CP) $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.bootdir/boot/$(DEVICE_DTB)
        $(CP) $(IMAGE_KERNEL) $@.bootdir/boot/uImage
 
        genext2fs --block-size $(BLOCKSIZE:%k=%Ki) \
@@ -30,16 +26,8 @@ define Build/boot-script
                $@.scr
 endef
 
-define Build/copy-file
-       cat "$(1)" > "$@"
-endef
-
-define Build/dtb
-       $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE))
-endef
-
 define Build/export-dtb
-       cp $(IMAGE_KERNEL).dtb $@
+       cp $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@
 endef
 
 define Build/MuImage-initramfs
@@ -64,15 +52,15 @@ define Build/MuImage-initramfs
        # part of the legacy multi image. Since we need to put the
        # device tree stuff into part 3.
 
-       -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \
-               -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \
-               -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new
+       -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi -C $(1) \
+               -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) -n '$(BOARD_NAME) initramfs' \
+               -d $@:$@.fakerd:$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb $@.new
        mv $@.new $@
        rm -rf $@.fakerd
 endef
 
 define Build/prepend-dtb
-       cat "$@.dtb.uimage" "$@" > "$@.new"
+       cat "$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb" "$@" > "$@.new"
        mv "$@.new" "$@"
 endef
 
@@ -88,7 +76,6 @@ define Device/Default
   KERNEL_LOADADDR := 0x00000000
   DEVICE_DTS_DIR := ../dts
   DEVICE_DTS = $(subst _,-,$(1))
-  SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
 endef
 
 include $(SUBTARGET).mk