Skip to contentSkip to conversation

arm: fix bootm with device tree

PATCH New Stephen Warren 4 participants 5 messages Apr 19, 2012 – Apr 23, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 arm: fix bootm with device tree

From: Stephen Warren <[email protected]>

Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux() for ARM. During the re-organization, the code to pass the device tree to the kernel was removed. Add it back. This restores the ability to boot a kernel using device tree.

---
v2: Fix a build warning

---
 arch/arm/lib/bootm.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
arch/arm/lib/bootm.c +10 -1
index 1c1bee6..cba457f 100644
@@ -317,6 +317,7 @@ static void boot_jump_linux(bootm_headers_t *images)
 	unsigned long machid = gd->bd->bi_arch_number;
 	char *s;
 	void (*kernel_entry)(int zero, int arch, uint params);
+	unsigned long r2;
 
 	kernel_entry = (void (*)(int, int, uint))images->ep;
 
@@ -330,7 +331,15 @@ static void boot_jump_linux(bootm_headers_t *images)
 		"...\n", (ulong) kernel_entry);
 	bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 	announce_and_cleanup();
-	kernel_entry(0, machid, gd->bd->bi_boot_params);
+
+#ifdef CONFIG_OF_LIBFDT
+	if (images->ft_len)
+		r2 = (unsigned long)images->ft_addr;
+	else
+#endif
+		r2 = gd->bd->bi_boot_params;
+
+	kernel_entry(0, machid, r2);
 }
 
 /* Main Entry point for arm bootm implementation
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v2 2/2 arm: restore fdt_fixup_ethernet call to do_bootm_linux

From: Stephen Warren <[email protected]>

Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux for ARM. During the re-organization, the call to fdt_fixup_ethernet() was removed. I assume this was useful, so add it back.

---
 arch/arm/lib/bootm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/lib/bootm.c +1 -0
index cba457f..599547d 100644
@@ -256,6 +256,7 @@ static int create_fdt(bootm_headers_t *images)
 
 	fdt_chosen(*of_flat_tree, 1);
 	fixup_memory_node(*of_flat_tree);
+	fdt_fixup_ethernet(*of_flat_tree);
 	fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
 
 	return 0;
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 1/2 arm: fix bootm with device tree

In reply to Stephen Warren

Stephen,

Quoted 9 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Thursday, April 19, 2012 2:34 PM
To: Wolfgang Denk; Tom Rini; Albert ARIBAUD
Cc: Simon Schwarz; u-boot at lists.denx.de; Tom Warren; Stephen Warren
Subject: [PATCH V2 1/2] arm: fix bootm with device tree

From: Stephen Warren <[email protected]>

Quoted 7 lines

Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux() for ARM. During the re-organization, the code to pass the device tree to the kernel was removed. Add it back. This restores the ability to boot a kernel using device tree.

Quoted 37 lines

---
v2: Fix a build warning

---
 arch/arm/lib/bootm.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
arch/arm/lib/bootm.c index renamed from arch/arm/lib/bootm.c +0 -0

1c1bee6..cba457f 100644

arch/arm/lib/bootm.c +10 -2
@@ -317,6 +317,7 @@ static void boot_jump_linux(bootm_headers_t *images)
 	unsigned long machid = gd->bd->bi_arch_number;
 	char *s;
 	void (*kernel_entry)(int zero, int arch, uint params);
+	unsigned long r2;
 
 	kernel_entry = (void (*)(int, int, uint))images->ep;
 
@@ -330,7 +331,15 @@ static void boot_jump_linux(bootm_headers_t *images)
 		"...\n", (ulong) kernel_entry);
 	bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 	announce_and_cleanup();
-	kernel_entry(0, machid, gd->bd->bi_boot_params);
+
+#ifdef CONFIG_OF_LIBFDT
+	if (images->ft_len)
+		r2 = (unsigned long)images->ft_addr;
+	else
+#endif
+		r2 = gd->bd->bi_boot_params;
+
+	kernel_entry(0, machid, r2);
 }
 
 /* Main Entry point for arm bootm implementation
--

1.7.0.4

Signature · 1 line
nvpublic
#3 lore raw

PATCH v2 1/2 arm: fix bootm with device tree

In reply to Stephen Warren
Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux() for ARM. During the re-organization, the code to pass the device tree to the kernel was removed. Add it back. This restores the ability to boot a kernel using device tree.

Verified I can boot a device tree kernel again after applying this. Thanks for fixing this Stephen, I'm not sure why device tree support was removed, but it broken tegra bad (and anyone else using device tree I would imagine).

-Allen

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

#4 lore raw

PATCH v2 1/2 arm: fix bootm with device tree

In reply to Stephen Warren

Dear Stephen Warren,

Quoted 7 lines · In message <[email protected]> you wrote:

From: Stephen Warren <[email protected]>

Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux() for ARM. During the re-organization, the code to pass the device tree to the kernel was removed. Add it back. This restores the ability to boot a kernel using device tree.

Quoted 7 lines

---
v2: Fix a build warning

---
 arch/arm/lib/bootm.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Keep your head and your heart going in the right  direction  and  you
will not have to worry about your feet.