]> www.infradead.org Git - users/hch/misc.git/commitdiff
MIPS: loongson: Add built-in DTB support
authorKeguang Zhang <keguang.zhang@gmail.com>
Wed, 16 Jul 2025 11:25:15 +0000 (19:25 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 29 Aug 2025 20:34:31 +0000 (22:34 +0200)
Since the current bootloader for Loongson-1 does not support FDT,
introduce CONFIG_BUILTIN_DTB_NAME to enable a built-in DTB.

Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/boot/dts/loongson/Makefile
arch/mips/loongson32/Kconfig

index e8f76e7ac30351f7ac5b66307b2f492ec4d0b399..8ee12504d3536b7e162198808906840d63333fcb 100644 (file)
@@ -1,4 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
+
+ifneq ($(CONFIG_BUILTIN_DTB_NAME),)
+dtb-y  := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME))
+else
 dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64_2core_2k1000.dtb
 dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64c_4core_ls7a.dtb
 dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64c_4core_rs780e.dtb
@@ -10,3 +14,4 @@ dtb-$(CONFIG_MACH_LOONGSON32) += cq-t300b.dtb
 dtb-$(CONFIG_MACH_LOONGSON32)  += ls1b-demo.dtb
 dtb-$(CONFIG_MACH_LOONGSON32)  += lsgz_1b_dev.dtb
 dtb-$(CONFIG_MACH_LOONGSON32)  += smartloong-1c.dtb
+endif
index a7c5009595779ecabc149049509b9982ece38d7d..52e925309f15d23ed6def2c81a30b190a203f347 100644 (file)
@@ -36,3 +36,11 @@ config LOONGSON1_LS1C
 endchoice
 
 endif # MACH_LOONGSON32
+
+config BUILTIN_DTB_NAME
+       string "Source file for built-in DTB"
+       depends on BUILTIN_DTB
+       help
+         Base name (without suffix, relative to arch/mips/boot/dts/loongson)
+         for the DTS file that will be used to produce the DTB linked into
+         the kernel.