Thread (10 messages) 10 messages, 3 authors, 2021-02-10

Re: [PATCH 2/6] MIPS: Loongson64: Distinguish firmware dependencies DTB/LEFI.

From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Date: 2021-02-09 15:40:01
Also in: linux-mips, lkml

On Tue, Feb 09, 2021 at 05:32:20PM +0800, Qing Zhang wrote:
quoted hunk ↗ jump to hunk
Add DTB boot support, only support LS2K1000 processor for now,
determine whether to use the built-in DTB or the DTB from the
firmware by checking the range of CKSEG0 and XKPHYS.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Qing Zhang <redacted>
Signed-off-by: Xingxing Su <redacted>
---
 .../include/asm/mach-loongson64/boot_param.h     |  6 ++++++
 arch/mips/include/asm/mach-loongson64/loongson.h |  3 ++-
 arch/mips/loongson64/env.c                       | 13 ++++++++++++-
 arch/mips/loongson64/init.c                      | 16 ++++++++++++++--
 4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
index 4592841b6b0c..53c29a305ff0 100644
--- a/arch/mips/include/asm/mach-loongson64/boot_param.h
+++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
@@ -198,7 +198,13 @@ enum loongson_bridge_type {
 	VIRTUAL = 3
 };
 
+enum loongson_fw_interface {
+	LOONGSON_LEFI = 0,
+	LOONGSON_DTB = 1,
+};
+
 struct loongson_system_configuration {
+	enum loongson_fw_interface fw_interface;
do you need this for future use ? Right now this information is only
needed in init.c and doesn't need to be exported...
+	if (fw_arg2 == 0 || (be32_to_cpup((__be32 *)fw_arg2) == OF_DT_HEADER)) {
what about using fdt_magic(fw_arg2) == FDT_MAGIC ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help