[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_4D42DA1AD5F8B00585B4E91D7F716762AE09@qq.com>
Date: Wed, 21 Feb 2024 00:41:17 +0800
From: Yangyu Chen <cyy@...self.name>
To: masahiroy@...nel.org
Cc: alex@...ti.fr, aou@...s.berkeley.edu, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, palmer@...belt.com,
paul.walmsley@...ive.com, conor@...nel.org
Subject: Re: Question about BUILTIN_DTB support in RISCV
Same problem here. I review the code in the current mainline kernel.
On arch/riscv/kernel/head.S:297:
```asm
#ifdef CONFIG_BUILTIN_DTB
la a0, __dtb_start
XIP_FIXUP_OFFSET a0
#else
mv a0, a1
#endif /* CONFIG_BUILTIN_DTB */
call setup_vm
```
Then, function `void __init setup_vm(uintptr_t dtb_pa)` will take this
dtb address from a0, and consume the dtb_pa as the only one dtb to set
dtb_early_va and dtb_early_pa. It will never change. Then, the
`parse_dtb` function which will be called from start_kernel-
>setup_arch->parse_dtb will only use dtb_early_va.
I think there is something that might need to be changed. As
CONFIG_BUILTIN_DTB depends on NONPORTABLE, we might need a config like
BUILTIN_DTB_NAME / BUILTIN_DTB_SOURCE to specify what dtb to be linked
to the kernel as loongarch / sh / xtensa does. Currently, we have only
ARCH_CANAAN_K210_DTB_SOURCE to select when building the K210 kernel.
Things to do is to make this configuration more general and let it be
set on all riscv rather than k210 only currently.
Thanks,
Yangyu Chen
Powered by blists - more mailing lists