Skip to contentSkip to conversation

PPC-44x: Add Open Firmware support to AMCC Yosemite

PATCH New Ira Snyder 2 participants 3 messages Apr 29, 2008

lore
Share & tools
lore

Ira Snyder

author
#0 lore raw

PATCH 1/1 PPC-44x: Add Open Firmware support to AMCC Yosemite

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

--

#1 lore raw

PATCH 1/1 PPC-44x: Add Open Firmware support to AMCC Yosemite

Hi Ira,

Quoted 1 line · Ira Snyder

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

Thanks for your contribution. Its actually quite good for the first time. :)

Quoted 10 lines

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.

This should be "ethaddr" instead of "eth0addr".

Quoted 8 lines

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. Please find some comments below.

Quoted 9 lines

Thanks for all of the great work.
Ira

--

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

I find the subject a little misleading. "Open Firmware" support sounds a little too much. How about:

"ppc4xx: Add device tree support to AMCC Yosemite"

Quoted 3 lines

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.

"ethaddr".

Quoted 11 lines
---
 board/amcc/yosemite/yosemite.c |   11 +++++++++++
 include/configs/yosemite.h     |    9 +++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/amcc/yosemite/yosemite.c index 6ec922a..fa610c3 100644

board/amcc/yosemite/yosemite.c line 31

Quoted 6 lines
board/amcc/yosemite/yosemite.c +3 -0
@@ -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

Please add this header unconditionally (without indentation).

board/amcc/yosemite/yosemite.c void board_reset(void) · line 565

Quoted 12 lines
board/amcc/yosemite/yosemite.c +6 -0
 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);
+

Why didn't you add the NOR FLASH mapping fixup as done on Sequoia etc? Please add it here.

include/configs/yosemite.h line 144

Quoted 11 lines
board/amcc/yosemite/yosemite.c +2 -0
+}
+#endif
include/configs/yosemite.h +1 -0
index c9323f6..7dcd4e6 100644
@@ -141,6 +141,14 @@
 
 
 /*-----------------------------------------------------------------------
+ * Open Firmware (Linux-2.6.26+)

I would prefer "Device tree support" here too.

Quoted 11 lines
include/configs/yosemite.h +7 -0
+ *----------------------------------------------------------------------*/
+
+/* 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	*/

include/configs/yosemite.h line 240

Quoted 6 lines
include/configs/yosemite.h +1 -0
@@ -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	*/

Please address the issues above and resend.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

author
#2 lore raw

PATCH 1/1 ppc4xx: Add device tree support to AMCC Yosemite

Hello Stefan, U-Boot users

I have made the changes that Stefan requested:
* Include headers unconditionally
* Change "eth0addr" to "ethaddr"
* Change "Open Firmware support" to "device tree support"
* Add NOR flash mapping fixup from Sequoia

I have re-tested the same three setups I tested earlier:
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 did not test the NOR flash mapping fixup, as I do not have any NOR flash to test with. It is an exact copy of the Sequoia code, so I hope it is correct.

Thanks for the comments.
Ira