linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/6] Current 4xx patch queue
@ 2007-08-31 20:04 Josh Boyer
  2007-08-31 20:04 ` [patch 1/6] Fix bus probe on Bamboo board Josh Boyer
                   ` (5 more replies)
  0 siblings, 6 replies; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Hi All,

Below is my latest patch queue for 4xx.  There are a couple Bamboo updates,
and the next round of PPC 405 Walnut support.

josh

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 1/6] Fix bus probe on Bamboo board
  2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
@ 2007-08-31 20:04 ` Josh Boyer
  2007-09-03  0:58   ` David Gibson
  2007-08-31 20:04 ` [patch 2/6] cuimage for " Josh Boyer
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Commit 804ace8881d21 changed the behavior of how compatible nodes are found.
This highlighted a bug on the Bamboo board where it wasn't probing the bus
specified in the DTS file.  We fix it by being explicit about which bus to
probe.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/platforms/44x/bamboo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.orig/arch/powerpc/platforms/44x/bamboo.c
+++ linux-2.6/arch/powerpc/platforms/44x/bamboo.c
@@ -23,7 +23,7 @@
 #include "44x.h"
 
 static struct of_device_id bamboo_of_bus[] = {
-	{ .compatible = "ibm,plb", },
+	{ .compatible = "ibm,plb4", },
 	{ .compatible = "ibm,opb", },
 	{ .compatible = "ibm,ebc", },
 	{},

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 2/6] cuimage for Bamboo board
  2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
  2007-08-31 20:04 ` [patch 1/6] Fix bus probe on Bamboo board Josh Boyer
@ 2007-08-31 20:04 ` Josh Boyer
  2007-09-03  1:01   ` David Gibson
  2007-08-31 20:04 ` [patch 3/6] Walnut DTS Josh Boyer
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
linker declarations that have been moved into ops.h

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/boot/44x.h             |    2 +-
 arch/powerpc/boot/Makefile          |    5 +++--
 arch/powerpc/boot/bamboo.c          |    9 ++++++---
 arch/powerpc/boot/cuboot-bamboo.c   |   30 ++++++++++++++++++++++++++++++
 arch/powerpc/boot/treeboot-bamboo.c |    4 +---
 5 files changed, 41 insertions(+), 9 deletions(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -48,7 +48,8 @@ src-wlib := string.S crt0.S stdio.c main
 		cpm-serial.c
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
-		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c cuboot-pq2.c
+		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
+		cuboot-pq2.c cuboot-bamboo.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -145,7 +146,7 @@ image-$(CONFIG_8260)			+= cuImage.pq2
 image-$(CONFIG_PPC_83xx)		+= cuImage.83xx
 image-$(CONFIG_PPC_85xx)		+= cuImage.85xx
 image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
-image-$(CONFIG_BAMBOO)			+= treeImage.bamboo
+image-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/cuboot-bamboo.c
@@ -0,0 +1,30 @@
+/*
+ * Old U-boot compatibility for Ebony
+ *
+ * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Copyright 2007 IBM Corporation
+ *
+ * Based on cuboot-ebony.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "44x.h"
+#include "cuboot.h"
+
+#define TARGET_44x
+#include "ppcboot.h"
+
+static bd_t bd;
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+		unsigned long r6, unsigned long r7)
+{
+	CUBOOT_INIT();
+	bamboo_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
+}
--- linux-2.6.orig/arch/powerpc/boot/44x.h
+++ linux-2.6/arch/powerpc/boot/44x.h
@@ -11,6 +11,6 @@
 #define _PPC_BOOT_44X_H_
 
 void ebony_init(void *mac0, void *mac1);
-void bamboo_init(void);
+void bamboo_init(void *mac0, void *mac1);
 
 #endif /* _PPC_BOOT_44X_H_ */
--- linux-2.6.orig/arch/powerpc/boot/bamboo.c
+++ linux-2.6/arch/powerpc/boot/bamboo.c
@@ -24,8 +24,7 @@
 #include "4xx.h"
 #include "44x.h"
 
-extern char _dtb_start[];
-extern char _dtb_end[];
+static u8 *bamboo_mac0, *bamboo_mac1;
 
 static void bamboo_fixups(void)
 {
@@ -34,12 +33,16 @@ static void bamboo_fixups(void)
 	ibm440ep_fixup_clocks(sysclk, 11059200);
 	ibm4xx_fixup_memsize();
 	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
+	if (bamboo_mac0 && bamboo_mac1)
+		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
 }
 
-void bamboo_init(void)
+void bamboo_init(void *mac0, void *mac1)
 {
 	platform_ops.fixups = bamboo_fixups;
 	platform_ops.exit = ibm44x_dbcr_reset;
+	bamboo_mac0 = mac0;
+	bamboo_mac1 = mac1;
 	ft_init(_dtb_start, 0, 32);
 	serial_console_init();
 }
--- linux-2.6.orig/arch/powerpc/boot/treeboot-bamboo.c
+++ linux-2.6/arch/powerpc/boot/treeboot-bamboo.c
@@ -13,8 +13,6 @@
 #include "stdio.h"
 #include "44x.h"
 
-extern char _end[];
-
 BSS_STACK(4096);
 
 void platform_init(void)
@@ -23,5 +21,5 @@ void platform_init(void)
 	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
 
 	simple_alloc_init(_end, avail_ram, 32, 64);
-	bamboo_init();
+	bamboo_init(NULL, NULL);
 }

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 3/6] Walnut DTS
  2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
  2007-08-31 20:04 ` [patch 1/6] Fix bus probe on Bamboo board Josh Boyer
  2007-08-31 20:04 ` [patch 2/6] cuimage for " Josh Boyer
@ 2007-08-31 20:04 ` Josh Boyer
  2007-09-03  1:08   ` David Gibson
  2007-08-31 20:04 ` [patch 4/6] Walnut defconfig Josh Boyer
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Device tree source file for the PPC405 Walnut evaluation board.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/boot/dts/walnut.dts |  183 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 183 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/boot/dts/walnut.dts
@@ -0,0 +1,183 @@
+/*
+ * Device Tree Source for IBM Walnut
+ *
+ * Copyright 2007 IBM Corp.
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	model = "ibm,walnut";
+	compatible = "ibm,walnut";
+	dcr-parent = <&/cpus/PowerPC,405GP@0>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,405GP@0 {
+			device_type = "cpu";
+			reg = <0>;
+			clock-frequency = <bebc200>; /* Filled in by zImage */
+			timebase-frequency = <0>; /* Filled in by zImage */
+			i-cache-line-size = <20>;
+			d-cache-line-size = <20>;
+			i-cache-size = <4000>;
+			d-cache-size = <4000>;
+			dcr-controller;
+			dcr-access-method = "native";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled in by zImage */
+	};
+
+	UIC0: interrupt-controller {
+		compatible = "ibm,uic";
+		interrupt-controller;
+		cell-index = <0>;
+		dcr-reg = <0c0 9>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+	};
+
+	plb {
+		compatible = "ibm,plb3";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		clock-frequency = <0>; /* Filled in by zImage */
+
+		SDRAM0: memory-controller {
+			compatible = "ibm,sdram-405gp";
+			dcr-reg = <010 2>;
+		};
+
+		MAL: mcmal {
+			compatible = "ibm,mcmal-405gp", "ibm,mcmal";
+			dcr-reg = <180 62>;
+			num-tx-chans = <2>;
+			num-rx-chans = <1>;
+			interrupt-parent = <&UIC0>;
+			interrupts = <a 4 b 4 c 4 d 4 e 4>;
+		};
+
+		POB0: opb {
+			compatible = "ibm,opb";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 ef600000 a00000>;
+			dcr-reg = <0a0 5>;
+			clock-frequency = <0>; /* Filled in by zImage */
+
+			UART0: serial@300 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <300 8>;
+				virtual-reg = <ef600300>;
+				clock-frequency = <0>; /* Filled in by zImage */
+				current-speed = <2580>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0 4>;
+			};
+
+			UART1: serial@400 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <400 8>;
+				virtual-reg = <ef600400>;
+				clock-frequency = <0>; /* Filled in by zImage */
+				current-speed = <2580>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <1 4>;
+			};
+
+			IIC: i2c@500 {
+				compatible = "ibm,iic-405gp", "ibm,iic";
+				reg = <500 11>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <2 4>;
+			};
+
+			GPIO: gpio@700 {
+				compatible = "ibm,gpio-405gp";
+				reg = <700 20>;
+			};
+
+			EMAC: ethernet@800 {
+				linux,network-index = <0>;
+				device_type = "network";
+				compatible = "ibm,emac-405gp", "ibm,emac";
+				interrupt-parent = <&UIC0>;
+				interrupts = <9 4 f 4>;
+				reg = <800 70>;
+				mal-device = <&MAL>;
+				mal-tx-channel = <0 1>;
+				mal-rx-channel = <0>;
+				cell-index = <0>;
+				max-frame-size = <5dc>;
+				rx-fifo-size = <1000>;
+				tx-fifo-size = <800>;
+				phy-mode = "rmii";
+				phy-map = <00000001>;
+			};
+
+		};
+
+		EBC0: ebc {
+			compatible = "ibm,ebc-405gp", "ibm,ebc";
+			dcr-reg = <012 2>;
+			#address-cells = <2>;
+			#size-cells = <1>;
+			clock-frequency = <0>; /* Filled in by zImage */
+
+			sram@0,0 {
+				reg = <0 0 80000>;
+			};
+
+			flash@0,80000 {
+				device_type = "rom";
+				compatible = "direct-mapped";
+				probe-type = "JEDEC";
+				bank-width = <1>;
+				partitions = <0 80000>;
+				partition-names = "OpenBIOS";
+				reg = <0 80000 80000>;
+			};
+
+			ds1743@1,0 {
+				/* NVRAM and RTC */
+				compatible = "ds1743";
+				reg = <1 0 2000>;
+			};
+
+			keyboard@2,0 {
+				compatible = "intel,82C42PC";
+				reg = <2 0 2>;
+			};
+
+			ir@3,0 {
+				compatible = "ti,TIR2000PAG";
+				reg = <3 0 10>;
+			};
+
+			fpga@7,0 {
+				compatible = "Walnut-FPGA";
+				reg = <7 0 10>;
+				virtual-reg = <f0300005>;
+			};
+		};
+	};
+
+	chosen {
+		linux,stdout-path = "/plb/opb/serial@300";
+	};
+};

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 4/6] Walnut defconfig
  2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
                   ` (2 preceding siblings ...)
  2007-08-31 20:04 ` [patch 3/6] Walnut DTS Josh Boyer
@ 2007-08-31 20:04 ` Josh Boyer
  2007-08-31 20:04 ` [patch 5/6] Walnut board support Josh Boyer
  2007-08-31 20:04 ` [patch 6/6] Walnut zImage wrapper Josh Boyer
  5 siblings, 0 replies; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Walnut board defconfig

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/configs/walnut_defconfig |  698 ++++++++++++++++++++++++++++++++++
 1 file changed, 698 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/configs/walnut_defconfig
@@ -0,0 +1,698 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23-rc4
+# Tue Aug 28 09:29:22 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_4xx=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_WALNUT=y
+CONFIG_405GP=y
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_DEVICE_TREE="walnut.dts"
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x00400000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+# CONFIG_MTD is not set
+CONFIG_OF_DEVICE=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=35000
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_XILINX_SYSACE is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_EDAC is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+# CONFIG_UCC_SLOW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=y
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+CONFIG_CRYPTO_HW=y

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 5/6] Walnut board support
  2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
                   ` (3 preceding siblings ...)
  2007-08-31 20:04 ` [patch 4/6] Walnut defconfig Josh Boyer
@ 2007-08-31 20:04 ` Josh Boyer
  2007-09-03  1:11   ` David Gibson
  2007-09-05  3:01   ` David Gibson
  2007-08-31 20:04 ` [patch 6/6] Walnut zImage wrapper Josh Boyer
  5 siblings, 2 replies; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Board support for the PPC405 Walnut evaluation board

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/platforms/40x/Kconfig  |   14 +++----
 arch/powerpc/platforms/40x/Makefile |    2 -
 arch/powerpc/platforms/40x/walnut.c |   68 ++++++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/Kconfig      |    2 -
 arch/powerpc/platforms/Makefile     |    2 -
 5 files changed, 78 insertions(+), 10 deletions(-)

--- linux-2.6.orig/arch/powerpc/platforms/40x/Makefile
+++ linux-2.6/arch/powerpc/platforms/40x/Makefile
@@ -1 +1 @@
-# empty makefile so make clean works
\ No newline at end of file
+obj-$(CONFIG_WALNUT) += walnut.o
--- /dev/null
+++ linux-2.6/arch/powerpc/platforms/40x/walnut.c
@@ -0,0 +1,68 @@
+/*
+ * Architecture- / platform-specific boot-time initialization code for
+ * IBM PowerPC 4xx based boards. Adapted from original
+ * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
+ * <dan@net4x.com>.
+ *
+ * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
+ *
+ * Rewritten and ported to the merged powerpc tree:
+ * Copyright 2007 IBM Corporation
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * 2002 (c) MontaVista, Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/init.h>
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/time.h>
+#include <asm/uic.h>
+#include <asm/of_platform.h>
+
+static struct of_device_id walnut_of_bus[] = {
+	{ .compatible = "ibm,plb3", },
+	{ .compatible = "ibm,opb", },
+	{ .compatible = "ibm,ebc", },
+	{},
+};
+
+static int __init walnut_device_probe(void)
+{
+	if (!machine_is(walnut))
+		return 0;
+
+	/* FIXME: do bus probe here */
+	of_platform_bus_probe(NULL, walnut_of_bus, NULL);
+
+	return 0;
+}
+device_initcall(walnut_device_probe);
+
+static int __init walnut_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+
+	if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
+		return 0;
+
+	return 1;
+}
+
+static void __init walnut_setup_arch(void)
+{
+}
+
+define_machine(walnut) {
+	.name			= "Walnut",
+	.probe			= walnut_probe,
+	.setup_arch		= walnut_setup_arch,
+	.progress		= udbg_progress,
+	.init_IRQ		= uic_init_tree,
+	.get_irq		= uic_get_irq,
+	.calibrate_decr	= generic_calibrate_decr,
+};
--- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
+++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
@@ -53,13 +53,13 @@
 #	help
 #	  This option enables support for the IBM PPC405GPr evaluation board.
 
-#config WALNUT
-#	bool "Walnut"
-#	depends on 40x
-#	default y
-#	select 405GP
-#	help
-#	  This option enables support for the IBM PPC405GP evaluation board.
+config WALNUT
+	bool "Walnut"
+	depends on 40x
+	default y
+	select 405GP
+	help
+	  This option enables support for the IBM PPC405GP evaluation board.
 
 #config XILINX_ML300
 #	bool "Xilinx-ML300"
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig
+++ linux-2.6/arch/powerpc/platforms/Kconfig
@@ -59,7 +59,7 @@ source "arch/powerpc/platforms/85xx/Kcon
 source "arch/powerpc/platforms/86xx/Kconfig"
 source "arch/powerpc/platforms/embedded6xx/Kconfig"
 source "arch/powerpc/platforms/44x/Kconfig"
-#source "arch/powerpc/platforms/4xx/Kconfig
+source "arch/powerpc/platforms/40x/Kconfig"
 
 config PPC_NATIVE
 	bool
--- linux-2.6.orig/arch/powerpc/platforms/Makefile
+++ linux-2.6/arch/powerpc/platforms/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_PPC_PMAC)		+= powermac/
 endif
 endif
 obj-$(CONFIG_PPC_CHRP)		+= chrp/
-#obj-$(CONFIG_4xx)		+= 4xx/
+obj-$(CONFIG_40x)		+= 40x/
 obj-$(CONFIG_44x)		+= 44x/
 obj-$(CONFIG_PPC_MPC52xx)	+= 52xx/
 obj-$(CONFIG_PPC_8xx)		+= 8xx/

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 6/6] Walnut zImage wrapper
  2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
                   ` (4 preceding siblings ...)
  2007-08-31 20:04 ` [patch 5/6] Walnut board support Josh Boyer
@ 2007-08-31 20:04 ` Josh Boyer
  2007-09-03  1:13   ` David Gibson
  5 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-08-31 20:04 UTC (permalink / raw)
  To: linuxppc-dev

Add zImage wrapper for walnut board

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/boot/Makefile          |    3 
 arch/powerpc/boot/treeboot-walnut.c |  133 ++++++++++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -49,7 +49,7 @@ src-wlib := string.S crt0.S stdio.c main
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
 		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
-		cuboot-pq2.c cuboot-bamboo.c
+		cuboot-pq2.c cuboot-bamboo.c treeboot-walnut.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -147,6 +147,7 @@ image-$(CONFIG_PPC_83xx)		+= cuImage.83x
 image-$(CONFIG_PPC_85xx)		+= cuImage.85xx
 image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
 image-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
+image-$(CONFIG_WALNUT)			+= treeImage.walnut
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/treeboot-walnut.c
@@ -0,0 +1,133 @@
+/*
+ * Old U-boot compatibility for Walnut
+ *
+ * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Copyright 2007 IBM Corporation
+ *   Based on cuboot-83xx.c, which is:
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "dcr.h"
+#include "4xx.h"
+#include "io.h"
+
+BSS_STACK(4096);
+
+void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
+{
+	u32 pllmr = mfdcr(0xb0);
+	u32 cpc0_cr0 = mfdcr(0xb1);
+	u32 cpc0_cr1 = mfdcr(0xb2);
+	u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
+	u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
+
+	fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
+	fbdv = (pllmr & 0x1e000000) >> 25;
+	cbdv = ((pllmr & 0x00060000) >> 17) + 1;
+	opdv = ((pllmr & 0x00018000) >> 15) + 1;
+	epdv = ((pllmr & 0x00001800) >> 13) + 2;
+	udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
+
+	m = fwdv * fbdv * cbdv;
+
+	cpu = sysclk * m / fwdv;
+	plb = cpu / cbdv;
+	opb = plb / opdv;
+	ebc = plb / epdv;
+
+	if (cpc0_cr0 & 0x80) {
+		/* uart0 uses the external clock */
+		uart0 = ser_clk;
+	} else {
+		uart0 = cpu / udiv;
+	}
+
+	if (cpc0_cr0 & 0x40) {
+		/* uart1 uses the external clock */
+		uart1 = ser_clk;
+	} else {
+		uart1 = cpu / udiv;
+	}
+
+	/* setup the timebase clock to tick at the cpu frequency */
+	cpc0_cr1 = cpc0_cr1 & ~ 0x00800000;
+	mtdcr(0xb2, cpc0_cr1);
+	tb = cpu;
+
+	dt_fixup_cpu_clocks(cpu, tb, 0);
+	dt_fixup_clock("/plb", plb);
+	dt_fixup_clock("/plb/opb", opb);
+	dt_fixup_clock("/plb/ebc", ebc);
+	dt_fixup_clock("/plb/opb/serial@300", uart0);
+	dt_fixup_clock("/plb/opb/serial@400", uart1);
+}
+
+static void walnut_flashsel_fixup(void)
+{
+	void *devp, *sram;
+	u32 reg_flash[3] = {0x0, 0x0, 0x80000};
+	u32 reg_sram[3] = {0x0, 0x0, 0x80000};
+	u8 *fpga;
+	u8 fpga_brds1 = 0x0;
+
+	devp = finddevice("/plb/ebc/fpga");
+	if (!devp)
+		fatal("Couldn't locate FPGA node\n\r");
+
+	if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
+		fatal("no virtual-reg property\n\r");
+
+	fpga_brds1 = in_8(fpga);
+
+	printf("FPGA_BRDS1: %08x\n", fpga_brds1);
+
+	devp = finddevice("/plb/ebc/flash");
+	if (!devp)
+		fatal("Couldn't locate flash node\n\r");
+
+	if (getprop(devp, "reg", reg_flash, sizeof(reg_flash)) != sizeof(reg_flash))
+		fatal("flash reg property has unexpected size\n\r");
+
+	sram = finddevice("/plb/ebc/sram");
+	if (!sram)
+		fatal("Couldn't locate sram node\n\r");
+
+	if (getprop(sram, "reg", reg_sram, sizeof(reg_sram)) != sizeof(reg_sram))
+		fatal("sram reg property has unexpected size\n\r");
+
+	if (fpga_brds1 & 0x1) {
+		reg_flash[1] ^= 0x80000;
+		reg_sram[1] ^= 0x80000;
+	}
+
+	setprop(devp, "reg", reg_flash, sizeof(reg_flash));
+	setprop(sram, "reg", reg_sram, sizeof(reg_sram));
+}
+
+static void walnut_fixups(void)
+{
+	ibm4xx_fixup_memsize();
+	ibm405gp_fixup_clocks(33330000, 0xa8c000);
+	ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
+	ibm4xx_fixup_ebc_ranges("/plb/ebc");
+	walnut_flashsel_fixup();
+}
+
+void platform_init(void)
+{
+	unsigned long end_of_ram = 0x2000000;
+	unsigned long avail_ram = end_of_ram - (unsigned long) _end;
+
+	simple_alloc_init(_end, avail_ram, 32, 32);
+	platform_ops.fixups = walnut_fixups;
+	platform_ops.exit = ibm40x_dbcr_reset;
+	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
+	serial_console_init();
+}

-- 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-09-03  1:13   ` David Gibson
@ 2007-09-02 13:58     ` Josh Boyer
  2007-09-05 16:36       ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-02 13:58 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Mon, 2007-09-03 at 11:13 +1000, David Gibson wrote:
> On Fri, Aug 31, 2007 at 03:04:55PM -0500, Josh Boyer wrote:
> > Add zImage wrapper for walnut board
> > 
> > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> 
> [snip]
> > --- /dev/null
> > +++ linux-2.6/arch/powerpc/boot/treeboot-walnut.c
> > @@ -0,0 +1,133 @@
> > +/*
> > + * Old U-boot compatibility for Walnut
> > + *
> > + * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > + *
> > + * Copyright 2007 IBM Corporation
> > + *   Based on cuboot-83xx.c, which is:
> > + * Copyright (c) 2007 Freescale Semiconductor, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms of the GNU General Public License version 2 as published
> > + * by the Free Software Foundation.
> > + */
> > +
> > +#include "ops.h"
> > +#include "stdio.h"
> > +#include "dcr.h"
> > +#include "4xx.h"
> > +#include "io.h"
> > +
> > +BSS_STACK(4096);
> > +
> > +void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
> > +{
> > +	u32 pllmr = mfdcr(0xb0);
> 
> Please add #defines for the DCR numbers, rather than using literals.

Oops.  Meant to do that cleanup before I sent out this round.  Will be
fixed.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 5/6] Walnut board support
  2007-09-03  1:11   ` David Gibson
@ 2007-09-02 13:59     ` Josh Boyer
  2007-09-04 12:37       ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-02 13:59 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Mon, 2007-09-03 at 11:11 +1000, David Gibson wrote:
> On Fri, Aug 31, 2007 at 03:04:54PM -0500, Josh Boyer wrote:
> > Board support for the PPC405 Walnut evaluation board
> > 
> > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> 
> [snip]
> > --- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
> > +++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
> > @@ -53,13 +53,13 @@
> >  #	help
> >  #	  This option enables support for the IBM PPC405GPr evaluation board.
> >  
> > -#config WALNUT
> > -#	bool "Walnut"
> > -#	depends on 40x
> > -#	default y
> > -#	select 405GP
> > -#	help
> > -#	  This option enables support for the IBM PPC405GP evaluation board.
> > +config WALNUT
> > +	bool "Walnut"
> > +	depends on 40x
> > +	default y
> > +	select 405GP
> > +	help
> > +	  This option enables support for the IBM PPC405GP evaluation board.
> 
> Surely this needs WANT_DEVICE_TREE, too.

Yes, will be fixed.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-09-03  1:08   ` David Gibson
@ 2007-09-02 13:59     ` Josh Boyer
  2007-09-04 12:42       ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-02 13:59 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Mon, 2007-09-03 at 11:08 +1000, David Gibson wrote:
> On Fri, Aug 31, 2007 at 03:04:52PM -0500, Josh Boyer wrote:
> > Device tree source file for the PPC405 Walnut evaluation board.
> > 
> > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > 
> > ---
> >  arch/powerpc/boot/dts/walnut.dts |  183 +++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 183 insertions(+)
> > 
> > --- /dev/null
> > +++ linux-2.6/arch/powerpc/boot/dts/walnut.dts
> > @@ -0,0 +1,183 @@
> > +/*
> > + * Device Tree Source for IBM Walnut
> > + *
> > + * Copyright 2007 IBM Corp.
> > + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > + * License version 2.  This program is licensed "as is" without
> > + * any warranty of any kind, whether express or implied.
> > + */
> > +
> > +/ {
> > +	#address-cells = <1>;
> > +	#size-cells = <1>;
> > +	model = "ibm,walnut";
> > +	compatible = "ibm,walnut";
> > +	dcr-parent = <&/cpus/PowerPC,405GP@0>;
> > +
> > +	cpus {
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> > +
> > +		PowerPC,405GP@0 {
> > +			device_type = "cpu";
> > +			reg = <0>;
> > +			clock-frequency = <bebc200>; /* Filled in by zImage */
> > +			timebase-frequency = <0>; /* Filled in by zImage */
> > +			i-cache-line-size = <20>;
> > +			d-cache-line-size = <20>;
> > +			i-cache-size = <4000>;
> > +			d-cache-size = <4000>;
> > +			dcr-controller;
> > +			dcr-access-method = "native";
> > +		};
> > +	};
> > +
> > +	memory {
> > +		device_type = "memory";
> > +		reg = <0 0>; /* Filled in by zImage */
> > +	};
> > +
> > +	UIC0: interrupt-controller {
> > +		compatible = "ibm,uic";
> > +		interrupt-controller;
> > +		cell-index = <0>;
> > +		dcr-reg = <0c0 9>;
> > +		#address-cells = <0>;
> > +		#size-cells = <0>;
> > +		#interrupt-cells = <2>;
> > +	};
> > +
> > +	plb {
> > +		compatible = "ibm,plb3";
> > +		#address-cells = <1>;
> > +		#size-cells = <1>;
> > +		ranges;
> > +		clock-frequency = <0>; /* Filled in by zImage */
> > +
> > +		SDRAM0: memory-controller {
> > +			compatible = "ibm,sdram-405gp";
> > +			dcr-reg = <010 2>;
> > +		};
> > +
> > +		MAL: mcmal {
> > +			compatible = "ibm,mcmal-405gp", "ibm,mcmal";
> > +			dcr-reg = <180 62>;
> > +			num-tx-chans = <2>;
> > +			num-rx-chans = <1>;
> > +			interrupt-parent = <&UIC0>;
> > +			interrupts = <a 4 b 4 c 4 d 4 e 4>;
> > +		};
> > +
> > +		POB0: opb {
> > +			compatible = "ibm,opb";
> 
> Need an opb-405gp here, too.

Yep.

> > +			#address-cells = <1>;
> > +			#size-cells = <1>;
> > +			ranges = <0 ef600000 a00000>;
> 
> Hrm... something we ought to clarify is the interpretation of the
> POB0_BEAR register with respect to the bridge's ranges property.  For
> 440 I think the BEAR will need to be interpreted as an OPB address,
> rather than a PLB address, but I'm not sure if that will work here
> with the limited ranges property you have.

Ok, I'll look at this.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 1/6] Fix bus probe on Bamboo board
  2007-08-31 20:04 ` [patch 1/6] Fix bus probe on Bamboo board Josh Boyer
@ 2007-09-03  0:58   ` David Gibson
  0 siblings, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-03  0:58 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Fri, Aug 31, 2007 at 03:04:50PM -0500, Josh Boyer wrote:
> Commit 804ace8881d21 changed the behavior of how compatible nodes are found.
> This highlighted a bug on the Bamboo board where it wasn't probing the bus
> specified in the DTS file.  We fix it by being explicit about which bus to
> probe.
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

Acked-by: David Gibson <david@gibson.dropbvear.id.au>

> 
> ---
>  arch/powerpc/platforms/44x/bamboo.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-2.6.orig/arch/powerpc/platforms/44x/bamboo.c
> +++ linux-2.6/arch/powerpc/platforms/44x/bamboo.c
> @@ -23,7 +23,7 @@
>  #include "44x.h"
>  
>  static struct of_device_id bamboo_of_bus[] = {
> -	{ .compatible = "ibm,plb", },
> +	{ .compatible = "ibm,plb4", },
>  	{ .compatible = "ibm,opb", },
>  	{ .compatible = "ibm,ebc", },
>  	{},
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-08-31 20:04 ` [patch 2/6] cuimage for " Josh Boyer
@ 2007-09-03  1:01   ` David Gibson
  2007-09-03 13:42     ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-03  1:01 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Fri, Aug 31, 2007 at 03:04:51PM -0500, Josh Boyer wrote:
> Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> linker declarations that have been moved into ops.h
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

[snip]
> --- linux-2.6.orig/arch/powerpc/boot/bamboo.c
> +++ linux-2.6/arch/powerpc/boot/bamboo.c
> @@ -24,8 +24,7 @@
>  #include "4xx.h"
>  #include "44x.h"
>  
> -extern char _dtb_start[];
> -extern char _dtb_end[];
> +static u8 *bamboo_mac0, *bamboo_mac1;
>  
>  static void bamboo_fixups(void)
>  {
> @@ -34,12 +33,16 @@ static void bamboo_fixups(void)
>  	ibm440ep_fixup_clocks(sysclk, 11059200);
>  	ibm4xx_fixup_memsize();
>  	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
> +	if (bamboo_mac0 && bamboo_mac1)
> +		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);

Bit ugly that you only set the MAC address for any ethernet if they're
supplied for every ethernet.

>  }
>  
> -void bamboo_init(void)
> +void bamboo_init(void *mac0, void *mac1)
>  {
>  	platform_ops.fixups = bamboo_fixups;
>  	platform_ops.exit = ibm44x_dbcr_reset;
> +	bamboo_mac0 = mac0;
> +	bamboo_mac1 = mac1;
>  	ft_init(_dtb_start, 0, 32);
>  	serial_console_init();
>  }
> --- linux-2.6.orig/arch/powerpc/boot/treeboot-bamboo.c
> +++ linux-2.6/arch/powerpc/boot/treeboot-bamboo.c
> @@ -13,8 +13,6 @@
>  #include "stdio.h"
>  #include "44x.h"
>  
> -extern char _end[];
> -
>  BSS_STACK(4096);
>  
>  void platform_init(void)
> @@ -23,5 +21,5 @@ void platform_init(void)
>  	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
>  
>  	simple_alloc_init(_end, avail_ram, 32, 64);
> -	bamboo_init();
> +	bamboo_init(NULL, NULL);

There must surely be a way to get the MAC addresses out of OpenBIOS...

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-08-31 20:04 ` [patch 3/6] Walnut DTS Josh Boyer
@ 2007-09-03  1:08   ` David Gibson
  2007-09-02 13:59     ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-03  1:08 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Fri, Aug 31, 2007 at 03:04:52PM -0500, Josh Boyer wrote:
> Device tree source file for the PPC405 Walnut evaluation board.
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> 
> ---
>  arch/powerpc/boot/dts/walnut.dts |  183 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 183 insertions(+)
> 
> --- /dev/null
> +++ linux-2.6/arch/powerpc/boot/dts/walnut.dts
> @@ -0,0 +1,183 @@
> +/*
> + * Device Tree Source for IBM Walnut
> + *
> + * Copyright 2007 IBM Corp.
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without
> + * any warranty of any kind, whether express or implied.
> + */
> +
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	model = "ibm,walnut";
> +	compatible = "ibm,walnut";
> +	dcr-parent = <&/cpus/PowerPC,405GP@0>;
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		PowerPC,405GP@0 {
> +			device_type = "cpu";
> +			reg = <0>;
> +			clock-frequency = <bebc200>; /* Filled in by zImage */
> +			timebase-frequency = <0>; /* Filled in by zImage */
> +			i-cache-line-size = <20>;
> +			d-cache-line-size = <20>;
> +			i-cache-size = <4000>;
> +			d-cache-size = <4000>;
> +			dcr-controller;
> +			dcr-access-method = "native";
> +		};
> +	};
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0 0>; /* Filled in by zImage */
> +	};
> +
> +	UIC0: interrupt-controller {
> +		compatible = "ibm,uic";
> +		interrupt-controller;
> +		cell-index = <0>;
> +		dcr-reg = <0c0 9>;
> +		#address-cells = <0>;
> +		#size-cells = <0>;
> +		#interrupt-cells = <2>;
> +	};
> +
> +	plb {
> +		compatible = "ibm,plb3";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +		clock-frequency = <0>; /* Filled in by zImage */
> +
> +		SDRAM0: memory-controller {
> +			compatible = "ibm,sdram-405gp";
> +			dcr-reg = <010 2>;
> +		};
> +
> +		MAL: mcmal {
> +			compatible = "ibm,mcmal-405gp", "ibm,mcmal";
> +			dcr-reg = <180 62>;
> +			num-tx-chans = <2>;
> +			num-rx-chans = <1>;
> +			interrupt-parent = <&UIC0>;
> +			interrupts = <a 4 b 4 c 4 d 4 e 4>;
> +		};
> +
> +		POB0: opb {
> +			compatible = "ibm,opb";

Need an opb-405gp here, too.

> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			ranges = <0 ef600000 a00000>;

Hrm... something we ought to clarify is the interpretation of the
POB0_BEAR register with respect to the bridge's ranges property.  For
440 I think the BEAR will need to be interpreted as an OPB address,
rather than a PLB address, but I'm not sure if that will work here
with the limited ranges property you have.

> +			dcr-reg = <0a0 5>;
> +			clock-frequency = <0>; /* Filled in by zImage */
> +
> +			UART0: serial@300 {
> +				device_type = "serial";
> +				compatible = "ns16550";
> +				reg = <300 8>;
> +				virtual-reg = <ef600300>;
> +				clock-frequency = <0>; /* Filled in by zImage */
> +				current-speed = <2580>;
> +				interrupt-parent = <&UIC0>;
> +				interrupts = <0 4>;
> +			};
> +
> +			UART1: serial@400 {
> +				device_type = "serial";
> +				compatible = "ns16550";
> +				reg = <400 8>;
> +				virtual-reg = <ef600400>;
> +				clock-frequency = <0>; /* Filled in by zImage */
> +				current-speed = <2580>;
> +				interrupt-parent = <&UIC0>;
> +				interrupts = <1 4>;
> +			};
> +
> +			IIC: i2c@500 {
> +				compatible = "ibm,iic-405gp", "ibm,iic";
> +				reg = <500 11>;
> +				interrupt-parent = <&UIC0>;
> +				interrupts = <2 4>;
> +			};
> +
> +			GPIO: gpio@700 {
> +				compatible = "ibm,gpio-405gp";
> +				reg = <700 20>;
> +			};
> +
> +			EMAC: ethernet@800 {
> +				linux,network-index = <0>;
> +				device_type = "network";
> +				compatible = "ibm,emac-405gp", "ibm,emac";
> +				interrupt-parent = <&UIC0>;
> +				interrupts = <9 4 f 4>;
> +				reg = <800 70>;
> +				mal-device = <&MAL>;
> +				mal-tx-channel = <0 1>;
> +				mal-rx-channel = <0>;
> +				cell-index = <0>;
> +				max-frame-size = <5dc>;
> +				rx-fifo-size = <1000>;
> +				tx-fifo-size = <800>;
> +				phy-mode = "rmii";
> +				phy-map = <00000001>;
> +			};
> +
> +		};
> +
> +		EBC0: ebc {
> +			compatible = "ibm,ebc-405gp", "ibm,ebc";
> +			dcr-reg = <012 2>;
> +			#address-cells = <2>;
> +			#size-cells = <1>;
> +			clock-frequency = <0>; /* Filled in by zImage */
> +
> +			sram@0,0 {
> +				reg = <0 0 80000>;
> +			};
> +
> +			flash@0,80000 {
> +				device_type = "rom";
> +				compatible = "direct-mapped";
> +				probe-type = "JEDEC";
> +				bank-width = <1>;
> +				partitions = <0 80000>;
> +				partition-names = "OpenBIOS";
> +				reg = <0 80000 80000>;
> +			};
> +
> +			ds1743@1,0 {
> +				/* NVRAM and RTC */
> +				compatible = "ds1743";
> +				reg = <1 0 2000>;
> +			};
> +
> +			keyboard@2,0 {
> +				compatible = "intel,82C42PC";
> +				reg = <2 0 2>;
> +			};
> +
> +			ir@3,0 {
> +				compatible = "ti,TIR2000PAG";
> +				reg = <3 0 10>;
> +			};
> +
> +			fpga@7,0 {
> +				compatible = "Walnut-FPGA";
> +				reg = <7 0 10>;
> +				virtual-reg = <f0300005>;
> +			};
> +		};
> +	};
> +
> +	chosen {
> +		linux,stdout-path = "/plb/opb/serial@300";
> +	};
> +};
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 5/6] Walnut board support
  2007-08-31 20:04 ` [patch 5/6] Walnut board support Josh Boyer
@ 2007-09-03  1:11   ` David Gibson
  2007-09-02 13:59     ` Josh Boyer
  2007-09-05  3:01   ` David Gibson
  1 sibling, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-03  1:11 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Fri, Aug 31, 2007 at 03:04:54PM -0500, Josh Boyer wrote:
> Board support for the PPC405 Walnut evaluation board
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

[snip]
> --- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
> +++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
> @@ -53,13 +53,13 @@
>  #	help
>  #	  This option enables support for the IBM PPC405GPr evaluation board.
>  
> -#config WALNUT
> -#	bool "Walnut"
> -#	depends on 40x
> -#	default y
> -#	select 405GP
> -#	help
> -#	  This option enables support for the IBM PPC405GP evaluation board.
> +config WALNUT
> +	bool "Walnut"
> +	depends on 40x
> +	default y
> +	select 405GP
> +	help
> +	  This option enables support for the IBM PPC405GP evaluation board.

Surely this needs WANT_DEVICE_TREE, too.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-08-31 20:04 ` [patch 6/6] Walnut zImage wrapper Josh Boyer
@ 2007-09-03  1:13   ` David Gibson
  2007-09-02 13:58     ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-03  1:13 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Fri, Aug 31, 2007 at 03:04:55PM -0500, Josh Boyer wrote:
> Add zImage wrapper for walnut board
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

[snip]
> --- /dev/null
> +++ linux-2.6/arch/powerpc/boot/treeboot-walnut.c
> @@ -0,0 +1,133 @@
> +/*
> + * Old U-boot compatibility for Walnut
> + *
> + * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + *
> + * Copyright 2007 IBM Corporation
> + *   Based on cuboot-83xx.c, which is:
> + * Copyright (c) 2007 Freescale Semiconductor, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published
> + * by the Free Software Foundation.
> + */
> +
> +#include "ops.h"
> +#include "stdio.h"
> +#include "dcr.h"
> +#include "4xx.h"
> +#include "io.h"
> +
> +BSS_STACK(4096);
> +
> +void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
> +{
> +	u32 pllmr = mfdcr(0xb0);

Please add #defines for the DCR numbers, rather than using literals.

> +	u32 cpc0_cr0 = mfdcr(0xb1);
> +	u32 cpc0_cr1 = mfdcr(0xb2);
> +	u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
> +	u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
> +
> +	fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
> +	fbdv = (pllmr & 0x1e000000) >> 25;
> +	cbdv = ((pllmr & 0x00060000) >> 17) + 1;
> +	opdv = ((pllmr & 0x00018000) >> 15) + 1;
> +	epdv = ((pllmr & 0x00001800) >> 13) + 2;
> +	udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
> +
> +	m = fwdv * fbdv * cbdv;
> +
> +	cpu = sysclk * m / fwdv;
> +	plb = cpu / cbdv;
> +	opb = plb / opdv;
> +	ebc = plb / epdv;
> +
> +	if (cpc0_cr0 & 0x80) {
> +		/* uart0 uses the external clock */
> +		uart0 = ser_clk;
> +	} else {
> +		uart0 = cpu / udiv;
> +	}
> +
> +	if (cpc0_cr0 & 0x40) {
> +		/* uart1 uses the external clock */
> +		uart1 = ser_clk;
> +	} else {
> +		uart1 = cpu / udiv;
> +	}
> +
> +	/* setup the timebase clock to tick at the cpu frequency */
> +	cpc0_cr1 = cpc0_cr1 & ~ 0x00800000;
> +	mtdcr(0xb2, cpc0_cr1);
> +	tb = cpu;
> +
> +	dt_fixup_cpu_clocks(cpu, tb, 0);
> +	dt_fixup_clock("/plb", plb);
> +	dt_fixup_clock("/plb/opb", opb);
> +	dt_fixup_clock("/plb/ebc", ebc);
> +	dt_fixup_clock("/plb/opb/serial@300", uart0);
> +	dt_fixup_clock("/plb/opb/serial@400", uart1);
> +}
> +
> +static void walnut_flashsel_fixup(void)
> +{
> +	void *devp, *sram;
> +	u32 reg_flash[3] = {0x0, 0x0, 0x80000};
> +	u32 reg_sram[3] = {0x0, 0x0, 0x80000};
> +	u8 *fpga;
> +	u8 fpga_brds1 = 0x0;
> +
> +	devp = finddevice("/plb/ebc/fpga");
> +	if (!devp)
> +		fatal("Couldn't locate FPGA node\n\r");
> +
> +	if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
> +		fatal("no virtual-reg property\n\r");
> +
> +	fpga_brds1 = in_8(fpga);
> +
> +	printf("FPGA_BRDS1: %08x\n", fpga_brds1);
> +
> +	devp = finddevice("/plb/ebc/flash");
> +	if (!devp)
> +		fatal("Couldn't locate flash node\n\r");
> +
> +	if (getprop(devp, "reg", reg_flash, sizeof(reg_flash)) != sizeof(reg_flash))
> +		fatal("flash reg property has unexpected size\n\r");
> +
> +	sram = finddevice("/plb/ebc/sram");
> +	if (!sram)
> +		fatal("Couldn't locate sram node\n\r");
> +
> +	if (getprop(sram, "reg", reg_sram, sizeof(reg_sram)) != sizeof(reg_sram))
> +		fatal("sram reg property has unexpected size\n\r");
> +
> +	if (fpga_brds1 & 0x1) {
> +		reg_flash[1] ^= 0x80000;
> +		reg_sram[1] ^= 0x80000;
> +	}
> +
> +	setprop(devp, "reg", reg_flash, sizeof(reg_flash));
> +	setprop(sram, "reg", reg_sram, sizeof(reg_sram));
> +}
> +
> +static void walnut_fixups(void)
> +{
> +	ibm4xx_fixup_memsize();
> +	ibm405gp_fixup_clocks(33330000, 0xa8c000);
> +	ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
> +	ibm4xx_fixup_ebc_ranges("/plb/ebc");
> +	walnut_flashsel_fixup();
> +}
> +
> +void platform_init(void)
> +{
> +	unsigned long end_of_ram = 0x2000000;
> +	unsigned long avail_ram = end_of_ram - (unsigned long) _end;
> +
> +	simple_alloc_init(_end, avail_ram, 32, 32);
> +	platform_ops.fixups = walnut_fixups;
> +	platform_ops.exit = ibm40x_dbcr_reset;
> +	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
> +	serial_console_init();
> +}
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-03  1:01   ` David Gibson
@ 2007-09-03 13:42     ` Josh Boyer
  2007-09-05  1:10       ` David Gibson
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-03 13:42 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Mon, 2007-09-03 at 11:01 +1000, David Gibson wrote:
> On Fri, Aug 31, 2007 at 03:04:51PM -0500, Josh Boyer wrote:
> > Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> > linker declarations that have been moved into ops.h
> > 
> > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> 
> [snip]
> > --- linux-2.6.orig/arch/powerpc/boot/bamboo.c
> > +++ linux-2.6/arch/powerpc/boot/bamboo.c
> > @@ -24,8 +24,7 @@
> >  #include "4xx.h"
> >  #include "44x.h"
> >  
> > -extern char _dtb_start[];
> > -extern char _dtb_end[];
> > +static u8 *bamboo_mac0, *bamboo_mac1;
> >  
> >  static void bamboo_fixups(void)
> >  {
> > @@ -34,12 +33,16 @@ static void bamboo_fixups(void)
> >  	ibm440ep_fixup_clocks(sysclk, 11059200);
> >  	ibm4xx_fixup_memsize();
> >  	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
> > +	if (bamboo_mac0 && bamboo_mac1)
> > +		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
> 
> Bit ugly that you only set the MAC address for any ethernet if they're
> supplied for every ethernet.

Good point.  Will fix.

> >  	simple_alloc_init(_end, avail_ram, 32, 64);
> > -	bamboo_init();
> > +	bamboo_init(NULL, NULL);
> 
> There must surely be a way to get the MAC addresses out of OpenBIOS...

Probably.  I just need to find out where they are stored.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 5/6] Walnut board support
  2007-09-02 13:59     ` Josh Boyer
@ 2007-09-04 12:37       ` Josh Boyer
  2007-09-05  1:09         ` David Gibson
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-04 12:37 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Sun, 02 Sep 2007 08:59:06 -0500
Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:

> On Mon, 2007-09-03 at 11:11 +1000, David Gibson wrote:
> > On Fri, Aug 31, 2007 at 03:04:54PM -0500, Josh Boyer wrote:
> > > Board support for the PPC405 Walnut evaluation board
> > > 
> > > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > 
> > [snip]
> > > --- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
> > > +++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
> > > @@ -53,13 +53,13 @@
> > >  #	help
> > >  #	  This option enables support for the IBM PPC405GPr evaluation board.
> > >  
> > > -#config WALNUT
> > > -#	bool "Walnut"
> > > -#	depends on 40x
> > > -#	default y
> > > -#	select 405GP
> > > -#	help
> > > -#	  This option enables support for the IBM PPC405GP evaluation board.
> > > +config WALNUT
> > > +	bool "Walnut"
> > > +	depends on 40x
> > > +	default y
> > > +	select 405GP
> > > +	help
> > > +	  This option enables support for the IBM PPC405GP evaluation board.
> > 
> > Surely this needs WANT_DEVICE_TREE, too.
> 
> Yes, will be fixed.

Er, actually no it won't.  It doesn't need to be selected here, as 40x
in arch/powerpc/platforms/Kconfig.cputype already selects
WANT_DEVICE_TREE.  Same thing that ebony and bamboo do for 44x.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-09-02 13:59     ` Josh Boyer
@ 2007-09-04 12:42       ` Josh Boyer
  2007-09-05  2:36         ` David Gibson
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-04 12:42 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Sun, 02 Sep 2007 08:59:44 -0500
Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:

> On Mon, 2007-09-03 at 11:08 +1000, David Gibson wrote:
> > On Fri, Aug 31, 2007 at 03:04:52PM -0500, Josh Boyer wrote:
> > > Device tree source file for the PPC405 Walnut evaluation board.
> > > 
> > > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > > 
> > > ---
> > >  arch/powerpc/boot/dts/walnut.dts |  183 +++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 183 insertions(+)
> > > 
> > > --- /dev/null
> > > +++ linux-2.6/arch/powerpc/boot/dts/walnut.dts
> > > @@ -0,0 +1,183 @@
> > > +/*
> > > + * Device Tree Source for IBM Walnut
> > > + *
> > > + * Copyright 2007 IBM Corp.
> > > + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > > + *
> > > + * This file is licensed under the terms of the GNU General Public
> > > + * License version 2.  This program is licensed "as is" without
> > > + * any warranty of any kind, whether express or implied.
> > > + */
> > > +
> > > +/ {
> > > +	#address-cells = <1>;
> > > +	#size-cells = <1>;
> > > +	model = "ibm,walnut";
> > > +	compatible = "ibm,walnut";
> > > +	dcr-parent = <&/cpus/PowerPC,405GP@0>;
> > > +
> > > +	cpus {
> > > +		#address-cells = <1>;
> > > +		#size-cells = <0>;
> > > +
> > > +		PowerPC,405GP@0 {
> > > +			device_type = "cpu";
> > > +			reg = <0>;
> > > +			clock-frequency = <bebc200>; /* Filled in by zImage */
> > > +			timebase-frequency = <0>; /* Filled in by zImage */
> > > +			i-cache-line-size = <20>;
> > > +			d-cache-line-size = <20>;
> > > +			i-cache-size = <4000>;
> > > +			d-cache-size = <4000>;
> > > +			dcr-controller;
> > > +			dcr-access-method = "native";
> > > +		};
> > > +	};
> > > +
> > > +	memory {
> > > +		device_type = "memory";
> > > +		reg = <0 0>; /* Filled in by zImage */
> > > +	};
> > > +
> > > +	UIC0: interrupt-controller {
> > > +		compatible = "ibm,uic";
> > > +		interrupt-controller;
> > > +		cell-index = <0>;
> > > +		dcr-reg = <0c0 9>;
> > > +		#address-cells = <0>;
> > > +		#size-cells = <0>;
> > > +		#interrupt-cells = <2>;
> > > +	};
> > > +
> > > +	plb {
> > > +		compatible = "ibm,plb3";
> > > +		#address-cells = <1>;
> > > +		#size-cells = <1>;
> > > +		ranges;
> > > +		clock-frequency = <0>; /* Filled in by zImage */
> > > +
> > > +		SDRAM0: memory-controller {
> > > +			compatible = "ibm,sdram-405gp";
> > > +			dcr-reg = <010 2>;
> > > +		};
> > > +
> > > +		MAL: mcmal {
> > > +			compatible = "ibm,mcmal-405gp", "ibm,mcmal";
> > > +			dcr-reg = <180 62>;
> > > +			num-tx-chans = <2>;
> > > +			num-rx-chans = <1>;
> > > +			interrupt-parent = <&UIC0>;
> > > +			interrupts = <a 4 b 4 c 4 d 4 e 4>;
> > > +		};
> > > +
> > > +		POB0: opb {
> > > +			compatible = "ibm,opb";
> > 
> > Need an opb-405gp here, too.
> 
> Yep.

Fixed.

> > > +			#address-cells = <1>;
> > > +			#size-cells = <1>;
> > > +			ranges = <0 ef600000 a00000>;
> > 
> > Hrm... something we ought to clarify is the interpretation of the
> > POB0_BEAR register with respect to the bridge's ranges property.  For
> > 440 I think the BEAR will need to be interpreted as an OPB address,
> > rather than a PLB address, but I'm not sure if that will work here
> > with the limited ranges property you have.
> 
> Ok, I'll look at this.

The BEAR will still be interpreted as a PLB address here as far as I
can see.  The ranges spans the entire OPB space.  Am I missing
something?

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-09-05  2:36         ` David Gibson
@ 2007-09-05  0:39           ` Josh Boyer
  2007-09-05 11:38             ` Segher Boessenkool
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-05  0:39 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Wed, 2007-09-05 at 12:36 +1000, David Gibson wrote:
> On Tue, Sep 04, 2007 at 07:42:03AM -0500, Josh Boyer wrote:
> > On Sun, 02 Sep 2007 08:59:44 -0500
> > Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
> [snip]
> > > > > +		POB0: opb {
> > > > > +			compatible = "ibm,opb";
> > > > 
> > > > Need an opb-405gp here, too.
> > > 
> > > Yep.
> > 
> > Fixed.
> > 
> > > > > +			#address-cells = <1>;
> > > > > +			#size-cells = <1>;
> > > > > +			ranges = <0 ef600000 a00000>;
> > > > 
> > > > Hrm... something we ought to clarify is the interpretation of the
> > > > POB0_BEAR register with respect to the bridge's ranges property.  For
> > > > 440 I think the BEAR will need to be interpreted as an OPB address,
> > > > rather than a PLB address, but I'm not sure if that will work here
> > > > with the limited ranges property you have.
> > > 
> > > Ok, I'll look at this.
> > 
> > The BEAR will still be interpreted as a PLB address here as far as I
> > can see.  The ranges spans the entire OPB space.  Am I missing
> > something?
> 
> Ah, sorry, my mistake.  I thought the BEAR register would encode an
> OPB address rather than a PLB address (and thus, be only 32-bits wide
> on 440).  In fact it appears it does encode a PLB address (and is
> split into BEARH and BEARL registers on 440).

Right.

> Hrm.. I'm still slightly uneasy though.  In my Ebony device tree, the
> POB's ranges exists to embed the 32-bit OPB space into the 64-bit PLB
> space by tacking on a 0x1 in bits 32:35.  In your 405gp ranges, you're
> describing just the address range used by OPB peripherals
> (0xef600000-0xf0000000) as residing at address 0 in OPB-space.
> 
> Since the ranges will still generate the right physical addresses, I
> guess it doesn't matter.  But I'm not sure it meets the principle of
> least surprise - since I think the documentation generally talks as
> though addresses on the 405 OPB bus are identical to addreses on the
> PLB.

I don't care either way.  If I remember correctly, this way of doing it
came out of a discussion with Segher.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-05  1:10       ` David Gibson
@ 2007-09-05  0:40         ` Josh Boyer
  2007-09-05  5:46           ` David Gibson
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-05  0:40 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Wed, 2007-09-05 at 11:10 +1000, David Gibson wrote:
> On Mon, Sep 03, 2007 at 08:42:11AM -0500, Josh Boyer wrote:
> > On Mon, 2007-09-03 at 11:01 +1000, David Gibson wrote:
> > > On Fri, Aug 31, 2007 at 03:04:51PM -0500, Josh Boyer wrote:
> > > > Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> > > > linker declarations that have been moved into ops.h
> > > > 
> > > > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > > 
> > > [snip]
> > > > --- linux-2.6.orig/arch/powerpc/boot/bamboo.c
> > > > +++ linux-2.6/arch/powerpc/boot/bamboo.c
> > > > @@ -24,8 +24,7 @@
> > > >  #include "4xx.h"
> > > >  #include "44x.h"
> > > >  
> > > > -extern char _dtb_start[];
> > > > -extern char _dtb_end[];
> > > > +static u8 *bamboo_mac0, *bamboo_mac1;
> > > >  
> > > >  static void bamboo_fixups(void)
> > > >  {
> > > > @@ -34,12 +33,16 @@ static void bamboo_fixups(void)
> > > >  	ibm440ep_fixup_clocks(sysclk, 11059200);
> > > >  	ibm4xx_fixup_memsize();
> > > >  	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
> > > > +	if (bamboo_mac0 && bamboo_mac1)
> > > > +		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
> > > 
> > > Bit ugly that you only set the MAC address for any ethernet if they're
> > > supplied for every ethernet.
> > 
> > Good point.  Will fix.
> > 
> > > >  	simple_alloc_init(_end, avail_ram, 32, 64);
> > > > -	bamboo_init();
> > > > +	bamboo_init(NULL, NULL);
> > > 
> > > There must surely be a way to get the MAC addresses out of OpenBIOS...
> > 
> > Probably.  I just need to find out where they are stored.
> 
> It's not buried somewhere in the arch/ppc/boot code?

It's not OpenBIOS, it's PIBS.  And the arch/ppc port uses __res, which
I'd rather avoid.  But I did find where it's stored in flash, so I can
read it from there.  I just need to do a little more work to get it in a
manner that can be used.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 5/6] Walnut board support
  2007-09-04 12:37       ` Josh Boyer
@ 2007-09-05  1:09         ` David Gibson
  0 siblings, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-05  1:09 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Tue, Sep 04, 2007 at 07:37:41AM -0500, Josh Boyer wrote:
> On Sun, 02 Sep 2007 08:59:06 -0500
> Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
> 
> > On Mon, 2007-09-03 at 11:11 +1000, David Gibson wrote:
> > > On Fri, Aug 31, 2007 at 03:04:54PM -0500, Josh Boyer wrote:
> > > > Board support for the PPC405 Walnut evaluation board
> > > > 
> > > > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > > 
> > > [snip]
> > > > --- linux-2.6.orig/arch/powerpc/platforms/40x/Kconfig
> > > > +++ linux-2.6/arch/powerpc/platforms/40x/Kconfig
> > > > @@ -53,13 +53,13 @@
> > > >  #	help
> > > >  #	  This option enables support for the IBM PPC405GPr evaluation board.
> > > >  
> > > > -#config WALNUT
> > > > -#	bool "Walnut"
> > > > -#	depends on 40x
> > > > -#	default y
> > > > -#	select 405GP
> > > > -#	help
> > > > -#	  This option enables support for the IBM PPC405GP evaluation board.
> > > > +config WALNUT
> > > > +	bool "Walnut"
> > > > +	depends on 40x
> > > > +	default y
> > > > +	select 405GP
> > > > +	help
> > > > +	  This option enables support for the IBM PPC405GP evaluation board.
> > > 
> > > Surely this needs WANT_DEVICE_TREE, too.
> > 
> > Yes, will be fixed.
> 
> Er, actually no it won't.  It doesn't need to be selected here, as 40x
> in arch/powerpc/platforms/Kconfig.cputype already selects
> WANT_DEVICE_TREE.  Same thing that ebony and bamboo do for 44x.

Oh, yes, so it does, sorry.  Though we may need to change that if
anyone goes and puts a real OF implementation on some 44x board.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-03 13:42     ` Josh Boyer
@ 2007-09-05  1:10       ` David Gibson
  2007-09-05  0:40         ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-05  1:10 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Mon, Sep 03, 2007 at 08:42:11AM -0500, Josh Boyer wrote:
> On Mon, 2007-09-03 at 11:01 +1000, David Gibson wrote:
> > On Fri, Aug 31, 2007 at 03:04:51PM -0500, Josh Boyer wrote:
> > > Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> > > linker declarations that have been moved into ops.h
> > > 
> > > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > 
> > [snip]
> > > --- linux-2.6.orig/arch/powerpc/boot/bamboo.c
> > > +++ linux-2.6/arch/powerpc/boot/bamboo.c
> > > @@ -24,8 +24,7 @@
> > >  #include "4xx.h"
> > >  #include "44x.h"
> > >  
> > > -extern char _dtb_start[];
> > > -extern char _dtb_end[];
> > > +static u8 *bamboo_mac0, *bamboo_mac1;
> > >  
> > >  static void bamboo_fixups(void)
> > >  {
> > > @@ -34,12 +33,16 @@ static void bamboo_fixups(void)
> > >  	ibm440ep_fixup_clocks(sysclk, 11059200);
> > >  	ibm4xx_fixup_memsize();
> > >  	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
> > > +	if (bamboo_mac0 && bamboo_mac1)
> > > +		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
> > 
> > Bit ugly that you only set the MAC address for any ethernet if they're
> > supplied for every ethernet.
> 
> Good point.  Will fix.
> 
> > >  	simple_alloc_init(_end, avail_ram, 32, 64);
> > > -	bamboo_init();
> > > +	bamboo_init(NULL, NULL);
> > 
> > There must surely be a way to get the MAC addresses out of OpenBIOS...
> 
> Probably.  I just need to find out where they are stored.

It's not buried somewhere in the arch/ppc/boot code?

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-09-04 12:42       ` Josh Boyer
@ 2007-09-05  2:36         ` David Gibson
  2007-09-05  0:39           ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-05  2:36 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Tue, Sep 04, 2007 at 07:42:03AM -0500, Josh Boyer wrote:
> On Sun, 02 Sep 2007 08:59:44 -0500
> Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
[snip]
> > > > +		POB0: opb {
> > > > +			compatible = "ibm,opb";
> > > 
> > > Need an opb-405gp here, too.
> > 
> > Yep.
> 
> Fixed.
> 
> > > > +			#address-cells = <1>;
> > > > +			#size-cells = <1>;
> > > > +			ranges = <0 ef600000 a00000>;
> > > 
> > > Hrm... something we ought to clarify is the interpretation of the
> > > POB0_BEAR register with respect to the bridge's ranges property.  For
> > > 440 I think the BEAR will need to be interpreted as an OPB address,
> > > rather than a PLB address, but I'm not sure if that will work here
> > > with the limited ranges property you have.
> > 
> > Ok, I'll look at this.
> 
> The BEAR will still be interpreted as a PLB address here as far as I
> can see.  The ranges spans the entire OPB space.  Am I missing
> something?

Ah, sorry, my mistake.  I thought the BEAR register would encode an
OPB address rather than a PLB address (and thus, be only 32-bits wide
on 440).  In fact it appears it does encode a PLB address (and is
split into BEARH and BEARL registers on 440).

Hrm.. I'm still slightly uneasy though.  In my Ebony device tree, the
POB's ranges exists to embed the 32-bit OPB space into the 64-bit PLB
space by tacking on a 0x1 in bits 32:35.  In your 405gp ranges, you're
describing just the address range used by OPB peripherals
(0xef600000-0xf0000000) as residing at address 0 in OPB-space.

Since the ranges will still generate the right physical addresses, I
guess it doesn't matter.  But I'm not sure it meets the principle of
least surprise - since I think the documentation generally talks as
though addresses on the 405 OPB bus are identical to addreses on the
PLB.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 5/6] Walnut board support
  2007-08-31 20:04 ` [patch 5/6] Walnut board support Josh Boyer
  2007-09-03  1:11   ` David Gibson
@ 2007-09-05  3:01   ` David Gibson
  1 sibling, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-05  3:01 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Fri, Aug 31, 2007 at 03:04:54PM -0500, Josh Boyer wrote:
> Board support for the PPC405 Walnut evaluation board
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-05  0:40         ` Josh Boyer
@ 2007-09-05  5:46           ` David Gibson
  2007-09-05  5:53             ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: David Gibson @ 2007-09-05  5:46 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Tue, Sep 04, 2007 at 07:40:19PM -0500, Josh Boyer wrote:
> On Wed, 2007-09-05 at 11:10 +1000, David Gibson wrote:
> > On Mon, Sep 03, 2007 at 08:42:11AM -0500, Josh Boyer wrote:
> > > On Mon, 2007-09-03 at 11:01 +1000, David Gibson wrote:
> > > > On Fri, Aug 31, 2007 at 03:04:51PM -0500, Josh Boyer wrote:
> > > > > Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> > > > > linker declarations that have been moved into ops.h
> > > > > 
> > > > > Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> > > > 
> > > > [snip]
> > > > > --- linux-2.6.orig/arch/powerpc/boot/bamboo.c
> > > > > +++ linux-2.6/arch/powerpc/boot/bamboo.c
> > > > > @@ -24,8 +24,7 @@
> > > > >  #include "4xx.h"
> > > > >  #include "44x.h"
> > > > >  
> > > > > -extern char _dtb_start[];
> > > > > -extern char _dtb_end[];
> > > > > +static u8 *bamboo_mac0, *bamboo_mac1;
> > > > >  
> > > > >  static void bamboo_fixups(void)
> > > > >  {
> > > > > @@ -34,12 +33,16 @@ static void bamboo_fixups(void)
> > > > >  	ibm440ep_fixup_clocks(sysclk, 11059200);
> > > > >  	ibm4xx_fixup_memsize();
> > > > >  	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
> > > > > +	if (bamboo_mac0 && bamboo_mac1)
> > > > > +		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
> > > > 
> > > > Bit ugly that you only set the MAC address for any ethernet if they're
> > > > supplied for every ethernet.
> > > 
> > > Good point.  Will fix.
> > > 
> > > > >  	simple_alloc_init(_end, avail_ram, 32, 64);
> > > > > -	bamboo_init();
> > > > > +	bamboo_init(NULL, NULL);
> > > > 
> > > > There must surely be a way to get the MAC addresses out of OpenBIOS...
> > > 
> > > Probably.  I just need to find out where they are stored.
> > 
> > It's not buried somewhere in the arch/ppc/boot code?
> 
> It's not OpenBIOS, it's PIBS.  And the arch/ppc port uses __res, which
> I'd rather avoid.  But I did find where it's stored in flash, so I can
> read it from there.  I just need to do a little more work to get it in a
> manner that can be used.

Hrm.. is that address actually guaranteed to be stable across PIBS
versions?  If arch/ppc uses __res, I think we should do that too.  It
shouldn't be any worse than what we already do fot cuboot.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-05  5:46           ` David Gibson
@ 2007-09-05  5:53             ` Josh Boyer
  2007-09-05 16:42               ` Josh Boyer
  2007-09-07  1:06               ` David Gibson
  0 siblings, 2 replies; 38+ messages in thread
From: Josh Boyer @ 2007-09-05  5:53 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev

On Wed, 2007-09-05 at 15:46 +1000, David Gibson wrote:
> > > > > There must surely be a way to get the MAC addresses out of OpenBIOS...
> > > > 
> > > > Probably.  I just need to find out where they are stored.
> > > 
> > > It's not buried somewhere in the arch/ppc/boot code?
> > 
> > It's not OpenBIOS, it's PIBS.  And the arch/ppc port uses __res, which
> > I'd rather avoid.  But I did find where it's stored in flash, so I can
> > read it from there.  I just need to do a little more work to get it in a
> > manner that can be used.
> 
> Hrm.. is that address actually guaranteed to be stable across PIBS
> versions?  If arch/ppc uses __res, I think we should do that too.  It
> shouldn't be any worse than what we already do fot cuboot.

The address should be stable for all versions of PIBS that come on the
Bamboo boards, yes.  And after looking at it a bit more, the wrapper in
arch/ppc for PIBS essentially mocks up __res by reading the values out
of flash.  So the way I'm doing it is the way it was already done.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-09-05  0:39           ` Josh Boyer
@ 2007-09-05 11:38             ` Segher Boessenkool
  2007-09-05 16:33               ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: Segher Boessenkool @ 2007-09-05 11:38 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, David Gibson

>> Hrm.. I'm still slightly uneasy though.  In my Ebony device tree, the
>> POB's ranges exists to embed the 32-bit OPB space into the 64-bit PLB
>> space by tacking on a 0x1 in bits 32:35.  In your 405gp ranges, you're
>> describing just the address range used by OPB peripherals
>> (0xef600000-0xf0000000) as residing at address 0 in OPB-space.
>>
>> Since the ranges will still generate the right physical addresses, I
>> guess it doesn't matter.  But I'm not sure it meets the principle of
>> least surprise - since I think the documentation generally talks as
>> though addresses on the 405 OPB bus are identical to addreses on the
>> PLB.
>
> I don't care either way.  If I remember correctly, this way of doing it
> came out of a discussion with Segher.

I don't think I ever said that this is a better way of doing things --
then again, I change my mind now and then.

Someone needs to write down a proposed device binding for these busses,
and then we can really discuss things ;-)


Segher

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 3/6] Walnut DTS
  2007-09-05 11:38             ` Segher Boessenkool
@ 2007-09-05 16:33               ` Josh Boyer
  2007-09-07  1:07                 ` David Gibson
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-05 16:33 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, David Gibson

Updated DTS below

Device tree source file for the PPC405 Walnut evaluation board.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/boot/dts/walnut.dts |  183 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 183 insertions(+)

--- /dev/null
+++ linux-2.6/arch/powerpc/boot/dts/walnut.dts
@@ -0,0 +1,183 @@
+/*
+ * Device Tree Source for IBM Walnut
+ *
+ * Copyright 2007 IBM Corp.
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	model = "ibm,walnut";
+	compatible = "ibm,walnut";
+	dcr-parent = <&/cpus/PowerPC,405GP@0>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,405GP@0 {
+			device_type = "cpu";
+			reg = <0>;
+			clock-frequency = <bebc200>; /* Filled in by zImage */
+			timebase-frequency = <0>; /* Filled in by zImage */
+			i-cache-line-size = <20>;
+			d-cache-line-size = <20>;
+			i-cache-size = <4000>;
+			d-cache-size = <4000>;
+			dcr-controller;
+			dcr-access-method = "native";
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>; /* Filled in by zImage */
+	};
+
+	UIC0: interrupt-controller {
+		compatible = "ibm,uic";
+		interrupt-controller;
+		cell-index = <0>;
+		dcr-reg = <0c0 9>;
+		#address-cells = <0>;
+		#size-cells = <0>;
+		#interrupt-cells = <2>;
+	};
+
+	plb {
+		compatible = "ibm,plb3";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		clock-frequency = <0>; /* Filled in by zImage */
+
+		SDRAM0: memory-controller {
+			compatible = "ibm,sdram-405gp";
+			dcr-reg = <010 2>;
+		};
+
+		MAL: mcmal {
+			compatible = "ibm,mcmal-405gp", "ibm,mcmal";
+			dcr-reg = <180 62>;
+			num-tx-chans = <2>;
+			num-rx-chans = <1>;
+			interrupt-parent = <&UIC0>;
+			interrupts = <a 4 b 4 c 4 d 4 e 4>;
+		};
+
+		POB0: opb {
+			compatible = "ibm,opb-405gp", "ibm,opb";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <ef600000 ef600000 a00000>;
+			dcr-reg = <0a0 5>;
+			clock-frequency = <0>; /* Filled in by zImage */
+
+			UART0: serial@ef600300 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <ef600300 8>;
+				virtual-reg = <ef600300>;
+				clock-frequency = <0>; /* Filled in by zImage */
+				current-speed = <2580>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <0 4>;
+			};
+
+			UART1: serial@ef600400 {
+				device_type = "serial";
+				compatible = "ns16550";
+				reg = <ef600400 8>;
+				virtual-reg = <ef600400>;
+				clock-frequency = <0>; /* Filled in by zImage */
+				current-speed = <2580>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <1 4>;
+			};
+
+			IIC: i2c@ef600500 {
+				compatible = "ibm,iic-405gp", "ibm,iic";
+				reg = <ef600500 11>;
+				interrupt-parent = <&UIC0>;
+				interrupts = <2 4>;
+			};
+
+			GPIO: gpio@ef600700 {
+				compatible = "ibm,gpio-405gp";
+				reg = <ef600700 20>;
+			};
+
+			EMAC: ethernet@ef600800 {
+				linux,network-index = <0>;
+				device_type = "network";
+				compatible = "ibm,emac-405gp", "ibm,emac";
+				interrupt-parent = <&UIC0>;
+				interrupts = <9 4 f 4>;
+				reg = <ef600800 70>;
+				mal-device = <&MAL>;
+				mal-tx-channel = <0 1>;
+				mal-rx-channel = <0>;
+				cell-index = <0>;
+				max-frame-size = <5dc>;
+				rx-fifo-size = <1000>;
+				tx-fifo-size = <800>;
+				phy-mode = "rmii";
+				phy-map = <00000001>;
+			};
+
+		};
+
+		EBC0: ebc {
+			compatible = "ibm,ebc-405gp", "ibm,ebc";
+			dcr-reg = <012 2>;
+			#address-cells = <2>;
+			#size-cells = <1>;
+			clock-frequency = <0>; /* Filled in by zImage */
+
+			sram@0,0 {
+				reg = <0 0 80000>;
+			};
+
+			flash@0,80000 {
+				device_type = "rom";
+				compatible = "direct-mapped";
+				probe-type = "JEDEC";
+				bank-width = <1>;
+				partitions = <0 80000>;
+				partition-names = "OpenBIOS";
+				reg = <0 80000 80000>;
+			};
+
+			ds1743@1,0 {
+				/* NVRAM and RTC */
+				compatible = "ds1743";
+				reg = <1 0 2000>;
+			};
+
+			keyboard@2,0 {
+				compatible = "intel,82C42PC";
+				reg = <2 0 2>;
+			};
+
+			ir@3,0 {
+				compatible = "ti,TIR2000PAG";
+				reg = <3 0 10>;
+			};
+
+			fpga@7,0 {
+				compatible = "Walnut-FPGA";
+				reg = <7 0 10>;
+				virtual-reg = <f0300005>;
+			};
+		};
+	};
+
+	chosen {
+		linux,stdout-path = "/plb/opb/serial@ef600300";
+	};
+};

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 6/6] Walnut zImage wrapper
  2007-09-02 13:58     ` Josh Boyer
@ 2007-09-05 16:36       ` Josh Boyer
  2007-09-07  1:22         ` David Gibson
  2007-09-24  7:49         ` Wolfgang Grandegger
  0 siblings, 2 replies; 38+ messages in thread
From: Josh Boyer @ 2007-09-05 16:36 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: David Gibson

Updated patch below

Add zImage wrapper for walnut board

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/boot/Makefile          |    3 
 arch/powerpc/boot/dcr.h             |    5 +
 arch/powerpc/boot/treeboot-walnut.c |  131 ++++++++++++++++++++++++++++++++++++
 3 files changed, 138 insertions(+), 1 deletion(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -49,7 +49,7 @@ src-wlib := string.S crt0.S stdio.c main
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
 		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
-		cuboot-pq2.c cuboot-bamboo.c
+		cuboot-pq2.c cuboot-bamboo.c treeboot-walnut.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -147,6 +147,7 @@ image-$(CONFIG_PPC_83xx)		+= cuImage.83x
 image-$(CONFIG_PPC_85xx)		+= cuImage.85xx
 image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
 image-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
+image-$(CONFIG_WALNUT)			+= treeImage.walnut
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/treeboot-walnut.c
@@ -0,0 +1,131 @@
+/*
+ * Old U-boot compatibility for Walnut
+ *
+ * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Copyright 2007 IBM Corporation
+ *   Based on cuboot-83xx.c, which is:
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "dcr.h"
+#include "4xx.h"
+#include "io.h"
+
+BSS_STACK(4096);
+
+void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
+{
+	u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
+	u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
+	u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
+	u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
+	u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
+
+	fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
+	fbdv = (pllmr & 0x1e000000) >> 25;
+	cbdv = ((pllmr & 0x00060000) >> 17) + 1;
+	opdv = ((pllmr & 0x00018000) >> 15) + 1;
+	epdv = ((pllmr & 0x00001800) >> 13) + 2;
+	udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
+
+	m = fwdv * fbdv * cbdv;
+
+	cpu = sysclk * m / fwdv;
+	plb = cpu / cbdv;
+	opb = plb / opdv;
+	ebc = plb / epdv;
+
+	if (cpc0_cr0 & 0x80) {
+		/* uart0 uses the external clock */
+		uart0 = ser_clk;
+	} else {
+		uart0 = cpu / udiv;
+	}
+
+	if (cpc0_cr0 & 0x40) {
+		/* uart1 uses the external clock */
+		uart1 = ser_clk;
+	} else {
+		uart1 = cpu / udiv;
+	}
+
+	/* setup the timebase clock to tick at the cpu frequency */
+	cpc0_cr1 = cpc0_cr1 & ~ 0x00800000;
+	mtdcr(DCRN_CPC0_CR1, cpc0_cr1);
+	tb = cpu;
+
+	dt_fixup_cpu_clocks(cpu, tb, 0);
+	dt_fixup_clock("/plb", plb);
+	dt_fixup_clock("/plb/opb", opb);
+	dt_fixup_clock("/plb/ebc", ebc);
+	dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
+	dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
+}
+
+static void walnut_flashsel_fixup(void)
+{
+	void *devp, *sram;
+	u32 reg_flash[3] = {0x0, 0x0, 0x80000};
+	u32 reg_sram[3] = {0x0, 0x0, 0x80000};
+	u8 *fpga;
+	u8 fpga_brds1 = 0x0;
+
+	devp = finddevice("/plb/ebc/fpga");
+	if (!devp)
+		fatal("Couldn't locate FPGA node\n\r");
+
+	if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
+		fatal("no virtual-reg property\n\r");
+
+	fpga_brds1 = in_8(fpga);
+
+	devp = finddevice("/plb/ebc/flash");
+	if (!devp)
+		fatal("Couldn't locate flash node\n\r");
+
+	if (getprop(devp, "reg", reg_flash, sizeof(reg_flash)) != sizeof(reg_flash))
+		fatal("flash reg property has unexpected size\n\r");
+
+	sram = finddevice("/plb/ebc/sram");
+	if (!sram)
+		fatal("Couldn't locate sram node\n\r");
+
+	if (getprop(sram, "reg", reg_sram, sizeof(reg_sram)) != sizeof(reg_sram))
+		fatal("sram reg property has unexpected size\n\r");
+
+	if (fpga_brds1 & 0x1) {
+		reg_flash[1] ^= 0x80000;
+		reg_sram[1] ^= 0x80000;
+	}
+
+	setprop(devp, "reg", reg_flash, sizeof(reg_flash));
+	setprop(sram, "reg", reg_sram, sizeof(reg_sram));
+}
+
+static void walnut_fixups(void)
+{
+	ibm4xx_fixup_memsize();
+	ibm405gp_fixup_clocks(33330000, 0xa8c000);
+	ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
+	ibm4xx_fixup_ebc_ranges("/plb/ebc");
+	walnut_flashsel_fixup();
+}
+
+void platform_init(void)
+{
+	unsigned long end_of_ram = 0x2000000;
+	unsigned long avail_ram = end_of_ram - (unsigned long) _end;
+
+	simple_alloc_init(_end, avail_ram, 32, 32);
+	platform_ops.fixups = walnut_fixups;
+	platform_ops.exit = ibm40x_dbcr_reset;
+	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
+	serial_console_init();
+}
--- linux-2.6.orig/arch/powerpc/boot/dcr.h
+++ linux-2.6/arch/powerpc/boot/dcr.h
@@ -134,4 +134,9 @@ static const unsigned long sdram_bxcr[] 
 #define CPR0_SCPID	0x120
 #define CPR0_PLLC0	0x40
 
+/* 405GP Clocking/Power Management/Chip Control regs */
+#define DCRN_CPC0_PLLMR 0xb0
+#define DCRN_405_CPC0_CR0 0xb1
+#define DCRN_405_CPC0_CR1 0xb2
+
 #endif	/* _PPC_BOOT_DCR_H_ */

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [patch 2/6] cuimage for Bamboo board
  2007-09-05  5:53             ` Josh Boyer
@ 2007-09-05 16:42               ` Josh Boyer
  2007-09-07  3:26                 ` David Gibson
  2007-09-07  1:06               ` David Gibson
  1 sibling, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-05 16:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: David Gibson

Updated patch below.  NOTE: This relies on Scott Wood's strtoull patch
as PIBS stores the MAC addresses as ASCII strings in flash.


Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
linker declarations that have been moved into ops.h

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

---
 arch/powerpc/boot/44x.h             |    2 +-
 arch/powerpc/boot/Makefile          |    5 +++--
 arch/powerpc/boot/bamboo.c          |    8 +++++---
 arch/powerpc/boot/cuboot-bamboo.c   |   30 ++++++++++++++++++++++++++++++
 arch/powerpc/boot/treeboot-bamboo.c |   22 +++++++++++++++++++---
 5 files changed, 58 insertions(+), 9 deletions(-)

--- linux-2.6.orig/arch/powerpc/boot/Makefile
+++ linux-2.6/arch/powerpc/boot/Makefile
@@ -48,7 +48,8 @@ src-wlib := string.S crt0.S stdio.c main
 		cpm-serial.c stdlib.c
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
-		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c cuboot-pq2.c
+		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
+		cuboot-pq2.c cuboot-bamboo.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -145,7 +146,7 @@ image-$(CONFIG_8260)			+= cuImage.pq2
 image-$(CONFIG_PPC_83xx)		+= cuImage.83xx
 image-$(CONFIG_PPC_85xx)		+= cuImage.85xx
 image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
-image-$(CONFIG_BAMBOO)			+= treeImage.bamboo
+image-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
--- /dev/null
+++ linux-2.6/arch/powerpc/boot/cuboot-bamboo.c
@@ -0,0 +1,30 @@
+/*
+ * Old U-boot compatibility for Ebony
+ *
+ * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Copyright 2007 IBM Corporation
+ *
+ * Based on cuboot-ebony.c
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "44x.h"
+#include "cuboot.h"
+
+#define TARGET_44x
+#include "ppcboot.h"
+
+static bd_t bd;
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+		unsigned long r6, unsigned long r7)
+{
+	CUBOOT_INIT();
+	bamboo_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
+}
--- linux-2.6.orig/arch/powerpc/boot/44x.h
+++ linux-2.6/arch/powerpc/boot/44x.h
@@ -11,6 +11,6 @@
 #define _PPC_BOOT_44X_H_
 
 void ebony_init(void *mac0, void *mac1);
-void bamboo_init(void);
+void bamboo_init(void *mac0, void *mac1);
 
 #endif /* _PPC_BOOT_44X_H_ */
--- linux-2.6.orig/arch/powerpc/boot/bamboo.c
+++ linux-2.6/arch/powerpc/boot/bamboo.c
@@ -24,8 +24,7 @@
 #include "4xx.h"
 #include "44x.h"
 
-extern char _dtb_start[];
-extern char _dtb_end[];
+static u8 *bamboo_mac0, *bamboo_mac1;
 
 static void bamboo_fixups(void)
 {
@@ -34,12 +33,15 @@ static void bamboo_fixups(void)
 	ibm440ep_fixup_clocks(sysclk, 11059200);
 	ibm4xx_fixup_memsize();
 	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
+	dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
 }
 
-void bamboo_init(void)
+void bamboo_init(void *mac0, void *mac1)
 {
 	platform_ops.fixups = bamboo_fixups;
 	platform_ops.exit = ibm44x_dbcr_reset;
+	bamboo_mac0 = mac0;
+	bamboo_mac1 = mac1;
 	ft_init(_dtb_start, 0, 32);
 	serial_console_init();
 }
--- linux-2.6.orig/arch/powerpc/boot/treeboot-bamboo.c
+++ linux-2.6/arch/powerpc/boot/treeboot-bamboo.c
@@ -12,16 +12,32 @@
 #include "ops.h"
 #include "stdio.h"
 #include "44x.h"
-
-extern char _end[];
+#include "stdlib.h"
 
 BSS_STACK(4096);
 
+#define PIBS_MAC0 0xfffc0400
+#define PIBS_MAC1 0xfffc0500
+char pibs_mac0[6];
+char pibs_mac1[6];
+
+static void read_pibs_mac(void)
+{
+	unsigned long long mac64;
+
+	mac64 = strtoull((char *)PIBS_MAC0, 0, 16);
+	memcpy(&pibs_mac0, (char *)&mac64+2, 6);
+
+	mac64 = strtoull((char *)PIBS_MAC1, 0, 16);
+	memcpy(&pibs_mac1, (char *)&mac64+2, 6);
+}
+
 void platform_init(void)
 {
 	unsigned long end_of_ram = 0x8000000;
 	unsigned long avail_ram = end_of_ram - (unsigned long)_end;
 
 	simple_alloc_init(_end, avail_ram, 32, 64);
-	bamboo_init();
+	read_pibs_mac();
+	bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1);
 }

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-05  5:53             ` Josh Boyer
  2007-09-05 16:42               ` Josh Boyer
@ 2007-09-07  1:06               ` David Gibson
  1 sibling, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-07  1:06 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Wed, Sep 05, 2007 at 12:53:54AM -0500, Josh Boyer wrote:
> On Wed, 2007-09-05 at 15:46 +1000, David Gibson wrote:
> > > > > > There must surely be a way to get the MAC addresses out of OpenBIOS...
> > > > > 
> > > > > Probably.  I just need to find out where they are stored.
> > > > 
> > > > It's not buried somewhere in the arch/ppc/boot code?
> > > 
> > > It's not OpenBIOS, it's PIBS.  And the arch/ppc port uses __res, which
> > > I'd rather avoid.  But I did find where it's stored in flash, so I can
> > > read it from there.  I just need to do a little more work to get it in a
> > > manner that can be used.
> > 
> > Hrm.. is that address actually guaranteed to be stable across PIBS
> > versions?  If arch/ppc uses __res, I think we should do that too.  It
> > shouldn't be any worse than what we already do fot cuboot.
> 
> The address should be stable for all versions of PIBS that come on the
> Bamboo boards, yes.  And after looking at it a bit more, the wrapper in
> arch/ppc for PIBS essentially mocks up __res by reading the values out
> of flash.  So the way I'm doing it is the way it was already done.

Ah, ok.  Fine then.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 3/6] Walnut DTS
  2007-09-05 16:33               ` Josh Boyer
@ 2007-09-07  1:07                 ` David Gibson
  0 siblings, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-07  1:07 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Wed, Sep 05, 2007 at 11:33:17AM -0500, Josh Boyer wrote:
> Updated DTS below
> 
> Device tree source file for the PPC405 Walnut evaluation board.
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-09-05 16:36       ` Josh Boyer
@ 2007-09-07  1:22         ` David Gibson
  2007-09-24  7:49         ` Wolfgang Grandegger
  1 sibling, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-07  1:22 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Wed, Sep 05, 2007 at 11:36:04AM -0500, Josh Boyer wrote:
> Updated patch below
> 
> Add zImage wrapper for walnut board
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 2/6] cuimage for Bamboo board
  2007-09-05 16:42               ` Josh Boyer
@ 2007-09-07  3:26                 ` David Gibson
  0 siblings, 0 replies; 38+ messages in thread
From: David Gibson @ 2007-09-07  3:26 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

On Wed, Sep 05, 2007 at 11:42:43AM -0500, Josh Boyer wrote:
> Updated patch below.  NOTE: This relies on Scott Wood's strtoull patch
> as PIBS stores the MAC addresses as ASCII strings in flash.
> 
> 
> Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> linker declarations that have been moved into ops.h
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

Except..
[snip]
> --- linux-2.6.orig/arch/powerpc/boot/treeboot-bamboo.c
> +++ linux-2.6/arch/powerpc/boot/treeboot-bamboo.c

It's not the fault of this patch, but since bamboo actually boots from
PIBS, not OpenBIOS, it probably shouldn't be lumped in with the
treeboot stuff.  PIBS should be able to load ELF images directly,
rather than using the silly treeboot header, for one thing.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-09-05 16:36       ` Josh Boyer
  2007-09-07  1:22         ` David Gibson
@ 2007-09-24  7:49         ` Wolfgang Grandegger
  2007-09-24 12:03           ` Josh Boyer
  1 sibling, 1 reply; 38+ messages in thread
From: Wolfgang Grandegger @ 2007-09-24  7:49 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, David Gibson

Josh Boyer wrote:
> Updated patch below
> 
> Add zImage wrapper for walnut board
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> 
> ---
>  arch/powerpc/boot/Makefile          |    3 
>  arch/powerpc/boot/dcr.h             |    5 +
>  arch/powerpc/boot/treeboot-walnut.c |  131 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 138 insertions(+), 1 deletion(-)
> 
> --- linux-2.6.orig/arch/powerpc/boot/Makefile
> +++ linux-2.6/arch/powerpc/boot/Makefile
> @@ -49,7 +49,7 @@ src-wlib := string.S crt0.S stdio.c main
>  src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
>  		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
>  		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
> -		cuboot-pq2.c cuboot-bamboo.c
> +		cuboot-pq2.c cuboot-bamboo.c treeboot-walnut.c
[deletions]

The addition of treeboot-walnut.c breaks compilation of Linux-2.6 for 
the lite5200 using the ppc_6xx toolchain of the ELDK 4.1:

   MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x14): Section mismatch: reference to 
.init.text:prom_init (between '__start' and '__after_mmu_off')
WARNING: vmlinux.o(.text+0x28): Section mismatch: reference to 
.init.text:early_init (between '__start' and '__after_mmu_off')
WARNING: vmlinux.o(.text+0x340c): Section mismatch: reference to 
.init.text:machine_init (between 'start_here' and 'set_context')
WARNING: vmlinux.o(.text+0x3414): Section mismatch: reference to 
.init.text:MMU_init (between 'start_here' and 'set_context')
WARNING: vmlinux.o(.text+0x343e): Section mismatch: reference to 
.init.text:start_kernel (between 'start_here' and 'set_context')
WARNING: vmlinux.o(.text+0x3442): Section mismatch: reference to 
.init.text:start_kernel (between 'start_here' and 'set_context')
   GEN     .version
   CHK     include/linux/compile.h
   UPD     include/linux/compile.h
   CC      init/version.o
   LD      init/built-in.o
   LD      vmlinux
   SYSMAP  System.map
   BOOTAS  arch/powerpc/boot/string.o
   BOOTAS  arch/powerpc/boot/crt0.o
   BOOTCC  arch/powerpc/boot/stdio.o
   BOOTCC  arch/powerpc/boot/main.o
   BOOTCC  arch/powerpc/boot/flatdevtree.o
   BOOTCC  arch/powerpc/boot/flatdevtree_misc.o
   BOOTCC  arch/powerpc/boot/ns16550.o
   BOOTCC  arch/powerpc/boot/serial.o
   BOOTCC  arch/powerpc/boot/simple_alloc.o
   BOOTAS  arch/powerpc/boot/div64.o
   BOOTAS  arch/powerpc/boot/util.o
   BOOTCC  arch/powerpc/boot/gunzip_util.o
   BOOTCC  arch/powerpc/boot/elf_util.o
   BOOTCC  arch/powerpc/boot/inffast.o
   BOOTCC  arch/powerpc/boot/inflate.o
   BOOTCC  arch/powerpc/boot/inftrees.o
   BOOTCC  arch/powerpc/boot/devtree.o
   BOOTCC  arch/powerpc/boot/oflib.o
   BOOTCC  arch/powerpc/boot/ofconsole.o
   BOOTCC  arch/powerpc/boot/4xx.o
   BOOTCC  arch/powerpc/boot/ebony.o
   BOOTCC  arch/powerpc/boot/mv64x60.o
   BOOTCC  arch/powerpc/boot/mpsc.o
   BOOTCC  arch/powerpc/boot/mv64x60_i2c.o
   BOOTCC  arch/powerpc/boot/cuboot.o
   BOOTCC  arch/powerpc/boot/bamboo.o
   BOOTAR  arch/powerpc/boot/wrapper.a
   BOOTCC  arch/powerpc/boot/of.o
   BOOTCC  arch/powerpc/boot/cuboot-83xx.o
   BOOTCC  arch/powerpc/boot/cuboot-85xx.o
   BOOTCC  arch/powerpc/boot/holly.o
   BOOTCC  arch/powerpc/boot/cuboot-ebony.o
   BOOTCC  arch/powerpc/boot/treeboot-ebony.o
   BOOTCC  arch/powerpc/boot/prpmc2800.o
   BOOTAS  arch/powerpc/boot/ps3-head.o
   BOOTAS  arch/powerpc/boot/ps3-hvcall.o
   BOOTCC  arch/powerpc/boot/ps3.o
   BOOTCC  arch/powerpc/boot/treeboot-bamboo.o
   BOOTCC  arch/powerpc/boot/cuboot-sequoia.o
   BOOTCC  arch/powerpc/boot/treeboot-walnut.o
{standard input}: Assembler messages:
{standard input}:184: Error: Unrecognized opcode: `mfdcr'
{standard input}:185: Error: Unrecognized opcode: `mfdcr'
{standard input}:186: Error: Unrecognized opcode: `mfdcr'
{standard input}:217: Error: Unrecognized opcode: `mtdcr'
make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
make: *** [uImage] Error 2

It looks like the ppc_6xx toolchain does not know the opcode above. I 
wonder why files for other PowerPC sub-archs like 4xx are compiled with 
the wrong compiler. Have I missed something?

And the WARNING above on "Section mismatch" looks strange as well (still 
present in 2.6.23-rc7).

Thanks for help.

Wolfgang.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-09-24  7:49         ` Wolfgang Grandegger
@ 2007-09-24 12:03           ` Josh Boyer
  2007-09-24 12:20             ` Wolfgang Grandegger
  0 siblings, 1 reply; 38+ messages in thread
From: Josh Boyer @ 2007-09-24 12:03 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linuxppc-dev, David Gibson

On Mon, 24 Sep 2007 09:49:33 +0200
Wolfgang Grandegger <wg@grandegger.com> wrote:
> 
> The addition of treeboot-walnut.c breaks compilation of Linux-2.6 for 
> the lite5200 using the ppc_6xx toolchain of the ELDK 4.1:
> 
>    MODPOST vmlinux.o
> WARNING: vmlinux.o(.text+0x14): Section mismatch: reference to 
> .init.text:prom_init (between '__start' and '__after_mmu_off')
> WARNING: vmlinux.o(.text+0x28): Section mismatch: reference to 
> .init.text:early_init (between '__start' and '__after_mmu_off')
> WARNING: vmlinux.o(.text+0x340c): Section mismatch: reference to 
> .init.text:machine_init (between 'start_here' and 'set_context')
> WARNING: vmlinux.o(.text+0x3414): Section mismatch: reference to 
> .init.text:MMU_init (between 'start_here' and 'set_context')
> WARNING: vmlinux.o(.text+0x343e): Section mismatch: reference to 
> .init.text:start_kernel (between 'start_here' and 'set_context')
> WARNING: vmlinux.o(.text+0x3442): Section mismatch: reference to 
> .init.text:start_kernel (between 'start_here' and 'set_context')
>    GEN     .version
>    CHK     include/linux/compile.h
>    UPD     include/linux/compile.h
>    CC      init/version.o
>    LD      init/built-in.o
>    LD      vmlinux
>    SYSMAP  System.map
>    BOOTAS  arch/powerpc/boot/string.o
>    BOOTAS  arch/powerpc/boot/crt0.o
>    BOOTCC  arch/powerpc/boot/stdio.o
>    BOOTCC  arch/powerpc/boot/main.o
>    BOOTCC  arch/powerpc/boot/flatdevtree.o
>    BOOTCC  arch/powerpc/boot/flatdevtree_misc.o
>    BOOTCC  arch/powerpc/boot/ns16550.o
>    BOOTCC  arch/powerpc/boot/serial.o
>    BOOTCC  arch/powerpc/boot/simple_alloc.o
>    BOOTAS  arch/powerpc/boot/div64.o
>    BOOTAS  arch/powerpc/boot/util.o
>    BOOTCC  arch/powerpc/boot/gunzip_util.o
>    BOOTCC  arch/powerpc/boot/elf_util.o
>    BOOTCC  arch/powerpc/boot/inffast.o
>    BOOTCC  arch/powerpc/boot/inflate.o
>    BOOTCC  arch/powerpc/boot/inftrees.o
>    BOOTCC  arch/powerpc/boot/devtree.o
>    BOOTCC  arch/powerpc/boot/oflib.o
>    BOOTCC  arch/powerpc/boot/ofconsole.o
>    BOOTCC  arch/powerpc/boot/4xx.o
>    BOOTCC  arch/powerpc/boot/ebony.o
>    BOOTCC  arch/powerpc/boot/mv64x60.o
>    BOOTCC  arch/powerpc/boot/mpsc.o
>    BOOTCC  arch/powerpc/boot/mv64x60_i2c.o
>    BOOTCC  arch/powerpc/boot/cuboot.o
>    BOOTCC  arch/powerpc/boot/bamboo.o
>    BOOTAR  arch/powerpc/boot/wrapper.a
>    BOOTCC  arch/powerpc/boot/of.o
>    BOOTCC  arch/powerpc/boot/cuboot-83xx.o
>    BOOTCC  arch/powerpc/boot/cuboot-85xx.o
>    BOOTCC  arch/powerpc/boot/holly.o
>    BOOTCC  arch/powerpc/boot/cuboot-ebony.o
>    BOOTCC  arch/powerpc/boot/treeboot-ebony.o
>    BOOTCC  arch/powerpc/boot/prpmc2800.o
>    BOOTAS  arch/powerpc/boot/ps3-head.o
>    BOOTAS  arch/powerpc/boot/ps3-hvcall.o
>    BOOTCC  arch/powerpc/boot/ps3.o
>    BOOTCC  arch/powerpc/boot/treeboot-bamboo.o
>    BOOTCC  arch/powerpc/boot/cuboot-sequoia.o
>    BOOTCC  arch/powerpc/boot/treeboot-walnut.o
> {standard input}: Assembler messages:
> {standard input}:184: Error: Unrecognized opcode: `mfdcr'
> {standard input}:185: Error: Unrecognized opcode: `mfdcr'
> {standard input}:186: Error: Unrecognized opcode: `mfdcr'
> {standard input}:217: Error: Unrecognized opcode: `mtdcr'
> make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
> make: *** [uImage] Error 2
>
> It looks like the ppc_6xx toolchain does not know the opcode above. I 
> wonder why files for other PowerPC sub-archs like 4xx are compiled with 
> the wrong compiler. Have I missed something?

No, you haven't missed anything.  I need a one line patch to fix it.
Could you try the patch below to make sure it works for you?

> And the WARNING above on "Section mismatch" looks strange as well (still 
> present in 2.6.23-rc7).

Those warnings should be gone with Paul's latest tree.  (They will
remain for 2.6.23.)

josh

Pass the correct -mcpu option for treeboot-walnut.o to avoid
unrecognized opcodes.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index c1582b6..8e6d36b 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -33,6 +33,7 @@ BOOTCFLAGS    += -I$(obj) -I$(srctree)/$(obj)
 
 $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
 $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
+$(obj)/treeboot-walnut.o: BOOTFLAGS += -mcpu=405
 
 zlib       := inffast.c inflate.c inftrees.c
 zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-09-24 12:03           ` Josh Boyer
@ 2007-09-24 12:20             ` Wolfgang Grandegger
  2007-09-24 12:25               ` Josh Boyer
  0 siblings, 1 reply; 38+ messages in thread
From: Wolfgang Grandegger @ 2007-09-24 12:20 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, David Gibson

Josh Boyer wrote:
> On Mon, 24 Sep 2007 09:49:33 +0200
> Wolfgang Grandegger <wg@grandegger.com> wrote:
>> The addition of treeboot-walnut.c breaks compilation of Linux-2.6 for 
>> the lite5200 using the ppc_6xx toolchain of the ELDK 4.1:
>>
>>    MODPOST vmlinux.o
>> WARNING: vmlinux.o(.text+0x14): Section mismatch: reference to 
>> .init.text:prom_init (between '__start' and '__after_mmu_off')
>> WARNING: vmlinux.o(.text+0x28): Section mismatch: reference to 
>> .init.text:early_init (between '__start' and '__after_mmu_off')
>> WARNING: vmlinux.o(.text+0x340c): Section mismatch: reference to 
>> .init.text:machine_init (between 'start_here' and 'set_context')
>> WARNING: vmlinux.o(.text+0x3414): Section mismatch: reference to 
>> .init.text:MMU_init (between 'start_here' and 'set_context')
>> WARNING: vmlinux.o(.text+0x343e): Section mismatch: reference to 
>> .init.text:start_kernel (between 'start_here' and 'set_context')
>> WARNING: vmlinux.o(.text+0x3442): Section mismatch: reference to 
>> .init.text:start_kernel (between 'start_here' and 'set_context')
>>    GEN     .version
>>    CHK     include/linux/compile.h
>>    UPD     include/linux/compile.h
>>    CC      init/version.o
>>    LD      init/built-in.o
>>    LD      vmlinux
>>    SYSMAP  System.map
>>    BOOTAS  arch/powerpc/boot/string.o
>>    BOOTAS  arch/powerpc/boot/crt0.o
>>    BOOTCC  arch/powerpc/boot/stdio.o
>>    BOOTCC  arch/powerpc/boot/main.o
>>    BOOTCC  arch/powerpc/boot/flatdevtree.o
>>    BOOTCC  arch/powerpc/boot/flatdevtree_misc.o
>>    BOOTCC  arch/powerpc/boot/ns16550.o
>>    BOOTCC  arch/powerpc/boot/serial.o
>>    BOOTCC  arch/powerpc/boot/simple_alloc.o
>>    BOOTAS  arch/powerpc/boot/div64.o
>>    BOOTAS  arch/powerpc/boot/util.o
>>    BOOTCC  arch/powerpc/boot/gunzip_util.o
>>    BOOTCC  arch/powerpc/boot/elf_util.o
>>    BOOTCC  arch/powerpc/boot/inffast.o
>>    BOOTCC  arch/powerpc/boot/inflate.o
>>    BOOTCC  arch/powerpc/boot/inftrees.o
>>    BOOTCC  arch/powerpc/boot/devtree.o
>>    BOOTCC  arch/powerpc/boot/oflib.o
>>    BOOTCC  arch/powerpc/boot/ofconsole.o
>>    BOOTCC  arch/powerpc/boot/4xx.o
>>    BOOTCC  arch/powerpc/boot/ebony.o
>>    BOOTCC  arch/powerpc/boot/mv64x60.o
>>    BOOTCC  arch/powerpc/boot/mpsc.o
>>    BOOTCC  arch/powerpc/boot/mv64x60_i2c.o
>>    BOOTCC  arch/powerpc/boot/cuboot.o
>>    BOOTCC  arch/powerpc/boot/bamboo.o
>>    BOOTAR  arch/powerpc/boot/wrapper.a
>>    BOOTCC  arch/powerpc/boot/of.o
>>    BOOTCC  arch/powerpc/boot/cuboot-83xx.o
>>    BOOTCC  arch/powerpc/boot/cuboot-85xx.o
>>    BOOTCC  arch/powerpc/boot/holly.o
>>    BOOTCC  arch/powerpc/boot/cuboot-ebony.o
>>    BOOTCC  arch/powerpc/boot/treeboot-ebony.o
>>    BOOTCC  arch/powerpc/boot/prpmc2800.o
>>    BOOTAS  arch/powerpc/boot/ps3-head.o
>>    BOOTAS  arch/powerpc/boot/ps3-hvcall.o
>>    BOOTCC  arch/powerpc/boot/ps3.o
>>    BOOTCC  arch/powerpc/boot/treeboot-bamboo.o
>>    BOOTCC  arch/powerpc/boot/cuboot-sequoia.o
>>    BOOTCC  arch/powerpc/boot/treeboot-walnut.o
>> {standard input}: Assembler messages:
>> {standard input}:184: Error: Unrecognized opcode: `mfdcr'
>> {standard input}:185: Error: Unrecognized opcode: `mfdcr'
>> {standard input}:186: Error: Unrecognized opcode: `mfdcr'
>> {standard input}:217: Error: Unrecognized opcode: `mtdcr'
>> make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
>> make: *** [uImage] Error 2
>>
>> It looks like the ppc_6xx toolchain does not know the opcode above. I 
>> wonder why files for other PowerPC sub-archs like 4xx are compiled with 
>> the wrong compiler. Have I missed something?
> 
> No, you haven't missed anything.  I need a one line patch to fix it.
> Could you try the patch below to make sure it works for you?

It works for me with one typo corrected (see below).

> 
>> And the WARNING above on "Section mismatch" looks strange as well (still 
>> present in 2.6.23-rc7).
> 
> Those warnings should be gone with Paul's latest tree.  (They will
> remain for 2.6.23.)

OK.

> Pass the correct -mcpu option for treeboot-walnut.o to avoid
> unrecognized opcodes.
> 
> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index c1582b6..8e6d36b 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -33,6 +33,7 @@ BOOTCFLAGS    += -I$(obj) -I$(srctree)/$(obj)
>  
>  $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
>  $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
> +$(obj)/treeboot-walnut.o: BOOTFLAGS += -mcpu=405
                              ^^^^^^^^^ typo, should be BOOTCFLAGS

Thanks.

Wolfgang.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [patch 6/6] Walnut zImage wrapper
  2007-09-24 12:20             ` Wolfgang Grandegger
@ 2007-09-24 12:25               ` Josh Boyer
  0 siblings, 0 replies; 38+ messages in thread
From: Josh Boyer @ 2007-09-24 12:25 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: linuxppc-dev, David Gibson

On Mon, 24 Sep 2007 14:20:36 +0200
Wolfgang Grandegger <wg@grandegger.com> wrote:

> Josh Boyer wrote:
> > On Mon, 24 Sep 2007 09:49:33 +0200
> > Wolfgang Grandegger <wg@grandegger.com> wrote:
> >> The addition of treeboot-walnut.c breaks compilation of Linux-2.6 for 
> >> the lite5200 using the ppc_6xx toolchain of the ELDK 4.1:
> >>
> >>    MODPOST vmlinux.o
> >> WARNING: vmlinux.o(.text+0x14): Section mismatch: reference to 
> >> .init.text:prom_init (between '__start' and '__after_mmu_off')
> >> WARNING: vmlinux.o(.text+0x28): Section mismatch: reference to 
> >> .init.text:early_init (between '__start' and '__after_mmu_off')
> >> WARNING: vmlinux.o(.text+0x340c): Section mismatch: reference to 
> >> .init.text:machine_init (between 'start_here' and 'set_context')
> >> WARNING: vmlinux.o(.text+0x3414): Section mismatch: reference to 
> >> .init.text:MMU_init (between 'start_here' and 'set_context')
> >> WARNING: vmlinux.o(.text+0x343e): Section mismatch: reference to 
> >> .init.text:start_kernel (between 'start_here' and 'set_context')
> >> WARNING: vmlinux.o(.text+0x3442): Section mismatch: reference to 
> >> .init.text:start_kernel (between 'start_here' and 'set_context')
> >>    GEN     .version
> >>    CHK     include/linux/compile.h
> >>    UPD     include/linux/compile.h
> >>    CC      init/version.o
> >>    LD      init/built-in.o
> >>    LD      vmlinux
> >>    SYSMAP  System.map
> >>    BOOTAS  arch/powerpc/boot/string.o
> >>    BOOTAS  arch/powerpc/boot/crt0.o
> >>    BOOTCC  arch/powerpc/boot/stdio.o
> >>    BOOTCC  arch/powerpc/boot/main.o
> >>    BOOTCC  arch/powerpc/boot/flatdevtree.o
> >>    BOOTCC  arch/powerpc/boot/flatdevtree_misc.o
> >>    BOOTCC  arch/powerpc/boot/ns16550.o
> >>    BOOTCC  arch/powerpc/boot/serial.o
> >>    BOOTCC  arch/powerpc/boot/simple_alloc.o
> >>    BOOTAS  arch/powerpc/boot/div64.o
> >>    BOOTAS  arch/powerpc/boot/util.o
> >>    BOOTCC  arch/powerpc/boot/gunzip_util.o
> >>    BOOTCC  arch/powerpc/boot/elf_util.o
> >>    BOOTCC  arch/powerpc/boot/inffast.o
> >>    BOOTCC  arch/powerpc/boot/inflate.o
> >>    BOOTCC  arch/powerpc/boot/inftrees.o
> >>    BOOTCC  arch/powerpc/boot/devtree.o
> >>    BOOTCC  arch/powerpc/boot/oflib.o
> >>    BOOTCC  arch/powerpc/boot/ofconsole.o
> >>    BOOTCC  arch/powerpc/boot/4xx.o
> >>    BOOTCC  arch/powerpc/boot/ebony.o
> >>    BOOTCC  arch/powerpc/boot/mv64x60.o
> >>    BOOTCC  arch/powerpc/boot/mpsc.o
> >>    BOOTCC  arch/powerpc/boot/mv64x60_i2c.o
> >>    BOOTCC  arch/powerpc/boot/cuboot.o
> >>    BOOTCC  arch/powerpc/boot/bamboo.o
> >>    BOOTAR  arch/powerpc/boot/wrapper.a
> >>    BOOTCC  arch/powerpc/boot/of.o
> >>    BOOTCC  arch/powerpc/boot/cuboot-83xx.o
> >>    BOOTCC  arch/powerpc/boot/cuboot-85xx.o
> >>    BOOTCC  arch/powerpc/boot/holly.o
> >>    BOOTCC  arch/powerpc/boot/cuboot-ebony.o
> >>    BOOTCC  arch/powerpc/boot/treeboot-ebony.o
> >>    BOOTCC  arch/powerpc/boot/prpmc2800.o
> >>    BOOTAS  arch/powerpc/boot/ps3-head.o
> >>    BOOTAS  arch/powerpc/boot/ps3-hvcall.o
> >>    BOOTCC  arch/powerpc/boot/ps3.o
> >>    BOOTCC  arch/powerpc/boot/treeboot-bamboo.o
> >>    BOOTCC  arch/powerpc/boot/cuboot-sequoia.o
> >>    BOOTCC  arch/powerpc/boot/treeboot-walnut.o
> >> {standard input}: Assembler messages:
> >> {standard input}:184: Error: Unrecognized opcode: `mfdcr'
> >> {standard input}:185: Error: Unrecognized opcode: `mfdcr'
> >> {standard input}:186: Error: Unrecognized opcode: `mfdcr'
> >> {standard input}:217: Error: Unrecognized opcode: `mtdcr'
> >> make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
> >> make: *** [uImage] Error 2
> >>
> >> It looks like the ppc_6xx toolchain does not know the opcode above. I 
> >> wonder why files for other PowerPC sub-archs like 4xx are compiled with 
> >> the wrong compiler. Have I missed something?
> > 
> > No, you haven't missed anything.  I need a one line patch to fix it.
> > Could you try the patch below to make sure it works for you?
> 
> It works for me with one typo corrected (see below).

Ah, yes.  That's what I get for coding before coffee.

Thanks Wolfgang.

josh

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2007-09-24 12:25 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31 20:04 [patch 0/6] Current 4xx patch queue Josh Boyer
2007-08-31 20:04 ` [patch 1/6] Fix bus probe on Bamboo board Josh Boyer
2007-09-03  0:58   ` David Gibson
2007-08-31 20:04 ` [patch 2/6] cuimage for " Josh Boyer
2007-09-03  1:01   ` David Gibson
2007-09-03 13:42     ` Josh Boyer
2007-09-05  1:10       ` David Gibson
2007-09-05  0:40         ` Josh Boyer
2007-09-05  5:46           ` David Gibson
2007-09-05  5:53             ` Josh Boyer
2007-09-05 16:42               ` Josh Boyer
2007-09-07  3:26                 ` David Gibson
2007-09-07  1:06               ` David Gibson
2007-08-31 20:04 ` [patch 3/6] Walnut DTS Josh Boyer
2007-09-03  1:08   ` David Gibson
2007-09-02 13:59     ` Josh Boyer
2007-09-04 12:42       ` Josh Boyer
2007-09-05  2:36         ` David Gibson
2007-09-05  0:39           ` Josh Boyer
2007-09-05 11:38             ` Segher Boessenkool
2007-09-05 16:33               ` Josh Boyer
2007-09-07  1:07                 ` David Gibson
2007-08-31 20:04 ` [patch 4/6] Walnut defconfig Josh Boyer
2007-08-31 20:04 ` [patch 5/6] Walnut board support Josh Boyer
2007-09-03  1:11   ` David Gibson
2007-09-02 13:59     ` Josh Boyer
2007-09-04 12:37       ` Josh Boyer
2007-09-05  1:09         ` David Gibson
2007-09-05  3:01   ` David Gibson
2007-08-31 20:04 ` [patch 6/6] Walnut zImage wrapper Josh Boyer
2007-09-03  1:13   ` David Gibson
2007-09-02 13:58     ` Josh Boyer
2007-09-05 16:36       ` Josh Boyer
2007-09-07  1:22         ` David Gibson
2007-09-24  7:49         ` Wolfgang Grandegger
2007-09-24 12:03           ` Josh Boyer
2007-09-24 12:20             ` Wolfgang Grandegger
2007-09-24 12:25               ` Josh Boyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).