diff mbox series

[v3,08/15] MIPS: generic: Support booting with built-in or appended DTB

Message ID 20200906192935.107086-9-paul@crapouillou.net (mailing list archive)
State Accepted
Commit 323690d23be14fa4b7be8bd2961810df6fe42138
Headers show
Series MIPS: Convert Ingenic to a generic board v3 | expand

Commit Message

Paul Cercueil Sept. 6, 2020, 7:29 p.m. UTC
The plat_get_fdt() checked that the kernel was booted using UHI before
reading the 'fw_passed_dtb' variable. However, this variable is also set
when the kernel has been appended, or when it has been built into the
kernel.

Support these usecases by removing the UHI check.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2-v3: No change

 arch/mips/generic/init.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Sergey Shtylyov Sept. 7, 2020, 7:54 a.m. UTC | #1
On 06.09.2020 22:29, Paul Cercueil wrote:

> The plat_get_fdt() checked that the kernel was booted using UHI before
> reading the 'fw_passed_dtb' variable. However, this variable is also set
> when the kernel has been appended, or when it has been built into the

    You haven't fixed s/kernel/DT/ here... :-/

> kernel.
> 
> Support these usecases by removing the UHI check.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
[...]

MBR, Sergei
Paul Cercueil Sept. 7, 2020, 12:39 p.m. UTC | #2
Le lun. 7 sept. 2020 à 10:54, Sergei Shtylyov 
<sergei.shtylyov@gmail.com> a écrit :
> On 06.09.2020 22:29, Paul Cercueil wrote:
> 
>> The plat_get_fdt() checked that the kernel was booted using UHI 
>> before
>> reading the 'fw_passed_dtb' variable. However, this variable is also 
>> set
>> when the kernel has been appended, or when it has been built into the
> 
>    You haven't fixed s/kernel/DT/ here... :-/

Dammit. Sorry about that.

-Paul

> 
>> kernel.
>> 
>> Support these usecases by removing the UHI check.
>> 
>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> [...]
> 
> MBR, Sergei
diff mbox series

Patch

diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index 029f47ea390c..66a19337d2ab 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -39,12 +39,11 @@  void __init *plat_get_fdt(void)
 		/* Already set up */
 		return (void *)fdt;
 
-	if ((fw_arg0 == -2) && !fdt_check_header((void *)fw_passed_dtb)) {
+	if (fw_passed_dtb && !fdt_check_header((void *)fw_passed_dtb)) {
 		/*
-		 * We booted using the UHI boot protocol, so we have been
-		 * provided with the appropriate device tree for the board.
-		 * Make use of it & search for any machine struct based upon
-		 * the root compatible string.
+		 * We have been provided with the appropriate device tree for
+		 * the board. Make use of it & search for any machine struct
+		 * based upon the root compatible string.
 		 */
 		fdt = (void *)fw_passed_dtb;