diff options
author | Qing Zhang <zhangqing@loongson.cn> | 2021-03-15 15:49:59 +0800 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2021-03-25 10:44:01 +0100 |
commit | 8e2fe0ecfb96d7b1baa9720e36305515c3079e8c (patch) | |
tree | e16622c38a8a4ea9724cb3fdd9030599f7c51ece /arch/mips/loongson64/env.c | |
parent | b1a792601f264df7172a728f1a83a05b6b399dfb (diff) |
MIPS: Loongson64: Distinguish firmware dependencies DTB/LEFI
Add DTB boot support, only support Loongson-2K1000 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.
loongson_fw_interface will be used in the future.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Tested-by: Ming Wang <wangming01@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/loongson64/env.c')
-rw-r--r-- | arch/mips/loongson64/env.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c index 1821d461b606..c8bb75d58f17 100644 --- a/arch/mips/loongson64/env.c +++ b/arch/mips/loongson64/env.c @@ -43,7 +43,18 @@ const char *get_system_type(void) return "Generic Loongson64 System"; } -void __init prom_init_env(void) + +void __init prom_dtb_init_env(void) +{ + if ((fw_arg2 < CKSEG0 || fw_arg2 > CKSEG1) + && (fw_arg2 < XKPHYS || fw_arg2 > XKSEG)) + + loongson_fdt_blob = __dtb_loongson64_2core_2k1000_begin; + else + loongson_fdt_blob = (void *)fw_arg2; +} + +void __init prom_lefi_init_env(void) { struct boot_params *boot_p; struct loongson_params *loongson_p; |