[U-Boot-Users] [PATCH] PPC-44x: Add Open Firmware support to AMCC Yosemite

Ira Snyder iws at ovro.caltech.edu
Tue Apr 29 07:25:54 CEST 2008


Hello U-Boot users,

This is my first patch, so any suggestions would be welcome.

I have an AMCC Yosemite board, which I recently updated to use the
recent ARCH=powerpc work from mainline Linux. Without this patch, trying
to boot from a uImage does not work. The kernel panics while trying to
parse the device tree blob. Note that a cuImage works fine previous to
this patch.

Also, I noticed that when I started booting with a uImage and dtb, that
eth0 had a MAC address of 00:00:00:00:00:00. Adding
#define CONFIG_HAS_ETH0 1 fixed this issue, by setting the MAC address
via the eth0addr variable in U-Boot.

I tested the following setups:
1) Old ARCH=ppc 2.6.13 kernel
2) New ARCH=powerpc 2.6.26rc0 kernel (cuImage)
3) New ARCH=powerpc 2.6.26rc0 kernel (uImage + dtb)

I ran MAKEALL both with and without the patch. The only changes in output
were a ~20kB increase in image size for the yellowstone and yosemite boards.

Thanks for all of the great work.
Ira

--

>From d76d560b1f61126c63320cec18d5b436f4bb10c0 Mon Sep 17 00:00:00 2001
From: Ira W. Snyder <iws at ovro.caltech.edu>
Date: Sat, 26 Apr 2008 16:06:26 -0700
Subject: [PATCH] PPC-44x: Add Open Firmware support to AMCC Yosemite

Add support for booting with a device tree blob. This is needed to boot
ARCH=powerpc kernels. Also add support for setting the eth0 mac address
via the eth0addr variable.

Signed-off-by: Ira W. Snyder <iws at ovro.caltech.edu>
---
 board/amcc/yosemite/yosemite.c |   11 +++++++++++
 include/configs/yosemite.h     |    9 +++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c
index 6ec922a..fa610c3 100644
--- a/board/amcc/yosemite/yosemite.c
+++ b/board/amcc/yosemite/yosemite.c
@@ -26,6 +26,9 @@
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <spd_sdram.h>
+#if defined(CONFIG_OF_LIBFDT)
+	#include <libfdt.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -554,3 +557,11 @@ void board_reset(void)
 	/* give reset to BCSR */
 	*(unsigned char *)(CFG_BCSR_BASE | 0x06) = 0x09;
 }
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+
+}
+#endif
diff --git a/include/configs/yosemite.h b/include/configs/yosemite.h
index c9323f6..7dcd4e6 100644
--- a/include/configs/yosemite.h
+++ b/include/configs/yosemite.h
@@ -141,6 +141,14 @@
 
 
 /*-----------------------------------------------------------------------
+ * Open Firmware (Linux-2.6.26+)
+ *----------------------------------------------------------------------*/
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT	1
+#define CONFIG_OF_BOARD_SETUP	1
+
+/*-----------------------------------------------------------------------
  * I2C
  *----------------------------------------------------------------------*/
 #define CONFIG_HARD_I2C		1	    /* I2C with hardware support	*/
@@ -227,6 +235,7 @@
 #define CONFIG_MII		1	/* MII PHY management		*/
 #define CONFIG_NET_MULTI        1	/* required for netconsole      */
 #define CONFIG_PHY1_ADDR        3
+#define CONFIG_HAS_ETH0		1	/* add support for "eth0addr"	*/
 #define CONFIG_HAS_ETH1		1	/* add support for "eth1addr"	*/
 #define CONFIG_PHY_ADDR		1	/* PHY address, See schematics	*/
 
-- 
1.5.4.3





More information about the U-Boot mailing list