aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/.gitignore3
-rw-r--r--arch/powerpc/boot/Makefile122
-rw-r--r--arch/powerpc/boot/crt0.S37
-rw-r--r--arch/powerpc/boot/cuboot-83xx.c68
-rw-r--r--arch/powerpc/boot/cuboot-85xx.c69
-rw-r--r--arch/powerpc/boot/devtree.c307
-rw-r--r--arch/powerpc/boot/dts/kuroboxHD.dts8
-rw-r--r--arch/powerpc/boot/dts/kuroboxHG.dts8
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts1
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts1
-rw-r--r--arch/powerpc/boot/dts/mpc7448hpc2.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8272ads.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8313erdb.dts63
-rw-r--r--arch/powerpc/boot/dts/mpc832x_mds.dts (renamed from arch/powerpc/boot/dts/mpc8323emds.dts)121
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts291
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitx.dts61
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitxgp.dts40
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts165
-rw-r--r--arch/powerpc/boot/dts/mpc836x_mds.dts (renamed from arch/powerpc/boot/dts/mpc8360emds.dts)125
-rw-r--r--arch/powerpc/boot/dts/mpc8540ads.dts143
-rw-r--r--arch/powerpc/boot/dts/mpc8541cds.dts109
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts136
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts130
-rw-r--r--arch/powerpc/boot/dts/mpc8555cds.dts109
-rw-r--r--arch/powerpc/boot/dts/mpc8560ads.dts159
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts97
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts219
-rw-r--r--arch/powerpc/boot/dts/mpc866ads.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc885ads.dts2
-rw-r--r--arch/powerpc/boot/elf.h8
-rw-r--r--arch/powerpc/boot/elf_util.c76
-rw-r--r--arch/powerpc/boot/flatdevtree.c199
-rw-r--r--arch/powerpc/boot/flatdevtree.h7
-rw-r--r--arch/powerpc/boot/flatdevtree_misc.c42
-rw-r--r--arch/powerpc/boot/gunzip_util.c206
-rw-r--r--arch/powerpc/boot/gunzip_util.h45
-rw-r--r--arch/powerpc/boot/main.c369
-rw-r--r--arch/powerpc/boot/ns16550.c9
-rw-r--r--arch/powerpc/boot/of.c21
-rw-r--r--arch/powerpc/boot/ops.h103
-rw-r--r--arch/powerpc/boot/ppcboot.h108
-rw-r--r--arch/powerpc/boot/reg.h22
-rw-r--r--arch/powerpc/boot/simple_alloc.c31
-rw-r--r--arch/powerpc/boot/stdio.h5
-rwxr-xr-xarch/powerpc/boot/wrapper53
-rw-r--r--arch/powerpc/boot/zImage.coff.lds.S3
-rw-r--r--arch/powerpc/boot/zImage.lds.S1
47 files changed, 2648 insertions, 1260 deletions
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index 0734b2fc1d95..eec7af7e5993 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -18,6 +18,9 @@ kernel-vmlinux.strip.c
18kernel-vmlinux.strip.gz 18kernel-vmlinux.strip.gz
19mktree 19mktree
20uImage 20uImage
21cuImage
22cuImage.bin.gz
23cuImage.elf
21zImage 24zImage
22zImage.chrp 25zImage.chrp
23zImage.coff 26zImage.coff
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index dc779407de14..3716594ea33e 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -40,10 +40,11 @@ zliblinuxheader := zlib.h zconf.h zutil.h
40$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \ 40$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \
41 $(addprefix $(obj)/,$(zlibheader)) 41 $(addprefix $(obj)/,$(zlibheader))
42 42
43src-wlib := string.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 43src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
44 ns16550.c serial.c simple_alloc.c div64.S util.S $(zlib) 44 ns16550.c serial.c simple_alloc.c div64.S util.S \
45src-plat := of.c 45 gunzip_util.c elf_util.c $(zlib) devtree.c
46src-boot := crt0.S $(src-wlib) $(src-plat) empty.c 46src-plat := of.c cuboot-83xx.c cuboot-85xx.c
47src-boot := $(src-wlib) $(src-plat) empty.c
47 48
48src-boot := $(addprefix $(obj)/, $(src-boot)) 49src-boot := $(addprefix $(obj)/, $(src-boot))
49obj-boot := $(addsuffix .o, $(basename $(src-boot))) 50obj-boot := $(addsuffix .o, $(basename $(src-boot)))
@@ -75,7 +76,7 @@ $(obj)/zImage.lds $(obj)/zImage.coff.lds: $(obj)/%: $(srctree)/$(src)/%.S
75 @cp $< $@ 76 @cp $< $@
76 77
77clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \ 78clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \
78 empty.c zImage zImage.coff.lds zImage.lds zImage.sandpoint 79 empty.c zImage.coff.lds zImage.lds
79 80
80quiet_cmd_bootcc = BOOTCC $@ 81quiet_cmd_bootcc = BOOTCC $@
81 cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $< 82 cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
@@ -84,23 +85,25 @@ quiet_cmd_bootas = BOOTAS $@
84 cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $< 85 cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
85 86
86quiet_cmd_bootar = BOOTAR $@ 87quiet_cmd_bootar = BOOTAR $@
87 cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $^; mv $@.$$$$ $@ 88 cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
88 89
89$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c 90$(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
90 $(call if_changed_dep,bootcc) 91 $(call if_changed_dep,bootcc)
91$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S 92$(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
92 $(call if_changed_dep,bootas) 93 $(call if_changed_dep,bootas)
93 94
94$(obj)/wrapper.a: $(obj-wlib) 95$(obj)/wrapper.a: $(obj-wlib) FORCE
95 $(call cmd,bootar) 96 $(call if_changed,bootar)
96 97
97hostprogs-y := addnote addRamDisk hack-coff mktree 98hostprogs-y := addnote addRamDisk hack-coff mktree
98 99
99extra-y := $(obj)/crt0.o $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ 100targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
101extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
100 $(obj)/zImage.lds $(obj)/zImage.coff.lds 102 $(obj)/zImage.lds $(obj)/zImage.coff.lds
101 103
102wrapper :=$(srctree)/$(src)/wrapper 104wrapper :=$(srctree)/$(src)/wrapper
103wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) 105wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
106 $(wrapper) FORCE
104 107
105############# 108#############
106# Bits for building various flavours of zImage 109# Bits for building various flavours of zImage
@@ -113,50 +116,10 @@ CROSSWRAP := -C "$(CROSS_COMPILE)"
113endif 116endif
114endif 117endif
115 118
119# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
116quiet_cmd_wrap = WRAP $@ 120quiet_cmd_wrap = WRAP $@
117 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux 121 cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
118quiet_cmd_wrap_initrd = WRAP $@ 122 $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) vmlinux
119 cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
120 -i $(obj)/ramdisk.image.gz vmlinux
121
122$(obj)/zImage.chrp: vmlinux $(wrapperbits)
123 $(call cmd,wrap,chrp)
124
125$(obj)/zImage.initrd.chrp: vmlinux $(wrapperbits)
126 $(call cmd,wrap_initrd,chrp)
127
128$(obj)/zImage.pseries: vmlinux $(wrapperbits)
129 $(call cmd,wrap,pseries)
130
131$(obj)/zImage.initrd.pseries: vmlinux $(wrapperbits)
132 $(call cmd,wrap_initrd,pseries)
133
134$(obj)/zImage.pmac: vmlinux $(wrapperbits)
135 $(call cmd,wrap,pmac)
136
137$(obj)/zImage.initrd.pmac: vmlinux $(wrapperbits)
138 $(call cmd,wrap_initrd,pmac)
139
140$(obj)/zImage.coff: vmlinux $(wrapperbits)
141 $(call cmd,wrap,pmaccoff)
142
143$(obj)/zImage.initrd.coff: vmlinux $(wrapperbits)
144 $(call cmd,wrap_initrd,pmaccoff)
145
146$(obj)/zImage.miboot: vmlinux $(wrapperbits)
147 $(call cmd,wrap,miboot)
148
149$(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
150 $(call cmd,wrap_initrd,miboot)
151
152$(obj)/zImage.ps3: vmlinux
153 $(STRIP) -s -R .comment $< -o $@
154
155$(obj)/zImage.initrd.ps3: vmlinux
156 @echo " WARNING zImage.initrd.ps3 not supported (yet)"
157
158$(obj)/uImage: vmlinux $(wrapperbits)
159 $(call cmd,wrap,uboot)
160 123
161image-$(CONFIG_PPC_PSERIES) += zImage.pseries 124image-$(CONFIG_PPC_PSERIES) += zImage.pseries
162image-$(CONFIG_PPC_MAPLE) += zImage.pseries 125image-$(CONFIG_PPC_MAPLE) += zImage.pseries
@@ -166,7 +129,7 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries
166image-$(CONFIG_PPC_CHRP) += zImage.chrp 129image-$(CONFIG_PPC_CHRP) += zImage.chrp
167image-$(CONFIG_PPC_EFIKA) += zImage.chrp 130image-$(CONFIG_PPC_EFIKA) += zImage.chrp
168image-$(CONFIG_PPC_PMAC) += zImage.pmac 131image-$(CONFIG_PPC_PMAC) += zImage.pmac
169image-$(CONFIG_DEFAULT_UIMAGE) += uImage 132image-$(CONFIG_DEFAULT_UIMAGE) += uImage cuImage
170 133
171# For 32-bit powermacs, build the COFF and miboot images 134# For 32-bit powermacs, build the COFF and miboot images
172# as well as the ELF images. 135# as well as the ELF images.
@@ -174,16 +137,55 @@ ifeq ($(CONFIG_PPC32),y)
174image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot 137image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot
175endif 138endif
176 139
140initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-))
177initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y)) 141initrd-y := $(patsubst zImage%, zImage.initrd%, $(image-y))
142initrd-y := $(filter-out $(image-y), $(initrd-y))
143targets += $(image-y) $(initrd-y)
144
145$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
146
147# Don't put the ramdisk on the pattern rule; when its missing make will try
148# the pattern rule with less dependencies that also matches (even with the
149# hard dependency listed).
150$(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
151 $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
152
153$(obj)/zImage.%: vmlinux $(wrapperbits)
154 $(call if_changed,wrap,$*)
155
156$(obj)/zImage.ps3: vmlinux
157 $(STRIP) -s -R .comment $< -o $@
158
159$(obj)/zImage.initrd.ps3: vmlinux
160 @echo " WARNING zImage.initrd.ps3 not supported (yet)"
161
162$(obj)/uImage: vmlinux $(wrapperbits)
163 $(call if_changed,wrap,uboot)
164
165cuboot-plat-$(CONFIG_83xx) += 83xx
166cuboot-plat-$(CONFIG_85xx) += 85xx
167cuboot-plat-y += unknown-platform
168
169dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\
170 ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE)
171
172$(obj)/cuImage: vmlinux $(wrapperbits)
173 $(call if_changed,wrap,cuboot-$(word 1,$(cuboot-plat-y)),$(dts))
178 174
179$(obj)/zImage: $(addprefix $(obj)/, $(image-y)) 175$(obj)/zImage: $(addprefix $(obj)/, $(image-y))
180 @rm -f $@; ln $< $@ 176 @rm -f $@; ln $< $@
181$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) 177$(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
182 @rm -f $@; ln $< $@ 178 @rm -f $@; ln $< $@
183 179
184install: $(CONFIGURE) $(image-y) 180install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
185 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< 181 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $<
186 182
187clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.strip.gz) 183# anything not in $(targets)
188clean-files += $(addprefix $(objtree)/, $(obj-boot) vmlinux.bin.gz) 184clean-files += $(image-) $(initrd-) zImage zImage.initrd \
189clean-files += $(image-) 185 cuImage.elf cuImage.bin.gz
186
187# clean up files cached by wrapper
188clean-kernel := vmlinux.strip vmlinux.bin
189clean-kernel += $(addsuffix .gz,$(clean-kernel))
190# If not absolute clean-files are relative to $(obj).
191clean-files += $(addprefix $(objtree)/, $(clean-kernel))
diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S
index 70e65b13e033..5a4215c4b014 100644
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -16,8 +16,11 @@
16_zimage_start_opd: 16_zimage_start_opd:
17 .long _zimage_start, 0, 0, 0 17 .long _zimage_start, 0, 0, 0
18 18
19 .weak _zimage_start
19 .globl _zimage_start 20 .globl _zimage_start
20_zimage_start: 21_zimage_start:
22 .globl _zimage_start_lib
23_zimage_start_lib:
21 /* Work out the offset between the address we were linked at 24 /* Work out the offset between the address we were linked at
22 and the address where we're running. */ 25 and the address where we're running. */
23 bl 1f 26 bl 1f
@@ -44,7 +47,7 @@ _zimage_start:
44 addi r9,r9,4 47 addi r9,r9,4
45 bdnz 2b 48 bdnz 2b
46 49
47 /* Do a cache flush for our text, in case OF didn't */ 50 /* Do a cache flush for our text, in case the loader didn't */
483: lis r9,_start@ha 513: lis r9,_start@ha
49 addi r9,r9,_start@l 52 addi r9,r9,_start@l
50 add r9,r0,r9 53 add r9,r0,r9
@@ -59,6 +62,34 @@ _zimage_start:
59 sync 62 sync
60 isync 63 isync
61 64
62 mr r6,r1 65 /* Clear the BSS */
63 b start 66 lis r9,__bss_start@ha
67 addi r9,r9,__bss_start@l
68 add r9,r0,r9
69 lis r8,_end@ha
70 addi r8,r8,_end@l
71 add r8,r0,r8
72 li r10,0
735: stw r10,0(r9)
74 addi r9,r9,4
75 cmplw cr0,r9,r8
76 blt 5b
64 77
78 /* Possibly set up a custom stack */
79.weak _platform_stack_top
80 lis r8,_platform_stack_top@ha
81 addi r8,r8,_platform_stack_top@l
82 cmpwi r8,0
83 beq 6f
84 add r8,r0,r8
85 lwz r1,0(r8)
86 add r1,r0,r1
87 li r0,0
88 stwu r0,-16(r1) /* establish a stack frame */
896:
90
91 /* Call platform_init() */
92 bl platform_init
93
94 /* Call start */
95 b start
diff --git a/arch/powerpc/boot/cuboot-83xx.c b/arch/powerpc/boot/cuboot-83xx.c
new file mode 100644
index 000000000000..6cbc20afb4d8
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-83xx.c
@@ -0,0 +1,68 @@
1/*
2 * Old U-boot compatibility for 83xx
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 Freescale Semiconductor, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "ops.h"
14#include "stdio.h"
15
16#define TARGET_83xx
17#include "ppcboot.h"
18
19static bd_t bd;
20extern char _end[];
21extern char _dtb_start[], _dtb_end[];
22
23static void platform_fixups(void)
24{
25 void *soc;
26
27 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
28 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
29 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
30
31 /* Unfortunately, the specific model number is encoded in the
32 * soc node name in existing dts files -- once that is fixed,
33 * this can do a simple path lookup.
34 */
35 soc = find_node_by_devtype(NULL, "soc");
36 if (soc) {
37 void *serial = NULL;
38
39 setprop(soc, "bus-frequency", &bd.bi_busfreq,
40 sizeof(bd.bi_busfreq));
41
42 while ((serial = find_node_by_devtype(serial, "serial"))) {
43 if (get_parent(serial) != soc)
44 continue;
45
46 setprop(serial, "clock-frequency", &bd.bi_busfreq,
47 sizeof(bd.bi_busfreq));
48 }
49 }
50}
51
52void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
53 unsigned long r6, unsigned long r7)
54{
55 unsigned long end_of_ram = bd.bi_memstart + bd.bi_memsize;
56 unsigned long avail_ram = end_of_ram - (unsigned long)_end;
57
58 memcpy(&bd, (bd_t *)r3, sizeof(bd));
59 loader_info.initrd_addr = r4;
60 loader_info.initrd_size = r4 ? r5 : 0;
61 loader_info.cmdline = (char *)r6;
62 loader_info.cmdline_len = r7 - r6;
63
64 simple_alloc_init(_end, avail_ram - 1024*1024, 32, 64);
65 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
66 serial_console_init();
67 platform_ops.fixups = platform_fixups;
68}
diff --git a/arch/powerpc/boot/cuboot-85xx.c b/arch/powerpc/boot/cuboot-85xx.c
new file mode 100644
index 000000000000..f88ba00ac122
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-85xx.c
@@ -0,0 +1,69 @@
1/*
2 * Old U-boot compatibility for 85xx
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 Freescale Semiconductor, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "ops.h"
14#include "stdio.h"
15
16#define TARGET_85xx
17#include "ppcboot.h"
18
19static bd_t bd;
20extern char _end[];
21extern char _dtb_start[], _dtb_end[];
22
23static void platform_fixups(void)
24{
25 void *soc;
26
27 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
28 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr,
29 bd.bi_enet2addr);
30 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
31
32 /* Unfortunately, the specific model number is encoded in the
33 * soc node name in existing dts files -- once that is fixed,
34 * this can do a simple path lookup.
35 */
36 soc = find_node_by_devtype(NULL, "soc");
37 if (soc) {
38 void *serial = NULL;
39
40 setprop(soc, "bus-frequency", &bd.bi_busfreq,
41 sizeof(bd.bi_busfreq));
42
43 while ((serial = find_node_by_devtype(serial, "serial"))) {
44 if (get_parent(serial) != soc)
45 continue;
46
47 setprop(serial, "clock-frequency", &bd.bi_busfreq,
48 sizeof(bd.bi_busfreq));
49 }
50 }
51}
52
53void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
54 unsigned long r6, unsigned long r7)
55{
56 unsigned long end_of_ram = bd.bi_memstart + bd.bi_memsize;
57 unsigned long avail_ram = end_of_ram - (unsigned long)_end;
58
59 memcpy(&bd, (bd_t *)r3, sizeof(bd));
60 loader_info.initrd_addr = r4;
61 loader_info.initrd_size = r4 ? r5 : 0;
62 loader_info.cmdline = (char *)r6;
63 loader_info.cmdline_len = r7 - r6;
64
65 simple_alloc_init(_end, avail_ram - 1024*1024, 32, 64);
66 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
67 serial_console_init();
68 platform_ops.fixups = platform_fixups;
69}
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
new file mode 100644
index 000000000000..c9951550ed2c
--- /dev/null
+++ b/arch/powerpc/boot/devtree.c
@@ -0,0 +1,307 @@
1/*
2 * devtree.c - convenience functions for device tree manipulation
3 * Copyright 2007 David Gibson, IBM Corporation.
4 * Copyright (c) 2007 Freescale Semiconductor, Inc.
5 *
6 * Authors: David Gibson <david@gibson.dropbear.id.au>
7 * Scott Wood <scottwood@freescale.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14#include <stdarg.h>
15#include <stddef.h>
16#include "types.h"
17#include "string.h"
18#include "stdio.h"
19#include "ops.h"
20
21void dt_fixup_memory(u64 start, u64 size)
22{
23 void *root, *memory;
24 int naddr, nsize, i;
25 u32 memreg[4];
26
27 root = finddevice("/");
28 if (getprop(root, "#address-cells", &naddr, sizeof(naddr)) < 0)
29 naddr = 2;
30 if (naddr < 1 || naddr > 2)
31 fatal("Can't cope with #address-cells == %d in /\n\r", naddr);
32
33 if (getprop(root, "#size-cells", &nsize, sizeof(nsize)) < 0)
34 nsize = 1;
35 if (nsize < 1 || nsize > 2)
36 fatal("Can't cope with #size-cells == %d in /\n\r", nsize);
37
38 i = 0;
39 if (naddr == 2)
40 memreg[i++] = start >> 32;
41 memreg[i++] = start & 0xffffffff;
42 if (nsize == 2)
43 memreg[i++] = size >> 32;
44 memreg[i++] = size & 0xffffffff;
45
46 memory = finddevice("/memory");
47 if (! memory) {
48 memory = create_node(NULL, "memory");
49 setprop_str(memory, "device_type", "memory");
50 }
51
52 printf("Memory <- <0x%x", memreg[0]);
53 for (i = 1; i < (naddr + nsize); i++)
54 printf(" 0x%x", memreg[i]);
55 printf("> (%ldMB)\n\r", (unsigned long)(size >> 20));
56
57 setprop(memory, "reg", memreg, (naddr + nsize)*sizeof(u32));
58}
59
60#define MHZ(x) ((x + 500000) / 1000000)
61
62void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
63{
64 void *devp = NULL;
65
66 printf("CPU clock-frequency <- 0x%x (%dMHz)\n\r", cpu, MHZ(cpu));
67 printf("CPU timebase-frequency <- 0x%x (%dMHz)\n\r", tb, MHZ(tb));
68 if (bus > 0)
69 printf("CPU bus-frequency <- 0x%x (%dMHz)\n\r", bus, MHZ(bus));
70
71 while ((devp = find_node_by_devtype(devp, "cpu"))) {
72 setprop_val(devp, "clock-frequency", cpu);
73 setprop_val(devp, "timebase-frequency", tb);
74 if (bus > 0)
75 setprop_val(devp, "bus-frequency", bus);
76 }
77}
78
79void dt_fixup_clock(const char *path, u32 freq)
80{
81 void *devp = finddevice(path);
82
83 if (devp) {
84 printf("%s: clock-frequency <- %x (%dMHz)\n\r", path, freq, MHZ(freq));
85 setprop_val(devp, "clock-frequency", freq);
86 }
87}
88
89void __dt_fixup_mac_addresses(u32 startindex, ...)
90{
91 va_list ap;
92 u32 index = startindex;
93 void *devp;
94 const u8 *addr;
95
96 va_start(ap, startindex);
97 while ((addr = va_arg(ap, const u8 *))) {
98 devp = find_node_by_prop_value(NULL, "linux,network-index",
99 (void*)&index, sizeof(index));
100
101 printf("ENET%d: local-mac-address <-"
102 " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
103 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
104
105 if (devp)
106 setprop(devp, "local-mac-address", addr, 6);
107
108 index++;
109 }
110 va_end(ap);
111}
112
113#define MAX_ADDR_CELLS 4
114#define MAX_RANGES 8
115
116static void get_reg_format(void *node, u32 *naddr, u32 *nsize)
117{
118 if (getprop(node, "#address-cells", naddr, 4) != 4)
119 *naddr = 2;
120 if (getprop(node, "#size-cells", nsize, 4) != 4)
121 *nsize = 1;
122}
123
124static void copy_val(u32 *dest, u32 *src, int naddr)
125{
126 int pad = MAX_ADDR_CELLS - naddr;
127
128 memset(dest, 0, pad * 4);
129 memcpy(dest + pad, src, naddr * 4);
130}
131
132static int sub_reg(u32 *reg, u32 *sub)
133{
134 int i, borrow = 0;
135
136 for (i = MAX_ADDR_CELLS - 1; i >= 0; i--) {
137 int prev_borrow = borrow;
138 borrow = reg[i] < sub[i] + prev_borrow;
139 reg[i] -= sub[i] + prev_borrow;
140 }
141
142 return !borrow;
143}
144
145static int add_reg(u32 *reg, u32 *add, int naddr)
146{
147 int i, carry = 0;
148
149 for (i = MAX_ADDR_CELLS - 1; i >= MAX_ADDR_CELLS - naddr; i--) {
150 u64 tmp = (u64)reg[i] + add[i] + carry;
151 carry = tmp >> 32;
152 reg[i] = (u32)tmp;
153 }
154
155 return !carry;
156}
157
158/* It is assumed that if the first byte of reg fits in a
159 * range, then the whole reg block fits.
160 */
161static int compare_reg(u32 *reg, u32 *range, u32 *rangesize)
162{
163 int i;
164 u32 end;
165
166 for (i = 0; i < MAX_ADDR_CELLS; i++) {
167 if (reg[i] < range[i])
168 return 0;
169 if (reg[i] > range[i])
170 break;
171 }
172
173 for (i = 0; i < MAX_ADDR_CELLS; i++) {
174 end = range[i] + rangesize[i];
175
176 if (reg[i] < end)
177 break;
178 if (reg[i] > end)
179 return 0;
180 }
181
182 return reg[i] != end;
183}
184
185/* reg must be MAX_ADDR_CELLS */
186static int find_range(u32 *reg, u32 *ranges, int nregaddr,
187 int naddr, int nsize, int buflen)
188{
189 int nrange = nregaddr + naddr + nsize;
190 int i;
191
192 for (i = 0; i + nrange <= buflen; i += nrange) {
193 u32 range_addr[MAX_ADDR_CELLS];
194 u32 range_size[MAX_ADDR_CELLS];
195
196 copy_val(range_addr, ranges + i, naddr);
197 copy_val(range_size, ranges + i + nregaddr + naddr, nsize);
198
199 if (compare_reg(reg, range_addr, range_size))
200 return i;
201 }
202
203 return -1;
204}
205
206/* Currently only generic buses without special encodings are supported.
207 * In particular, PCI is not supported. Also, only the beginning of the
208 * reg block is tracked; size is ignored except in ranges.
209 */
210static u32 dt_xlate_buf[MAX_ADDR_CELLS * MAX_RANGES * 3];
211
212static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
213 unsigned long *size)
214{
215 u32 last_addr[MAX_ADDR_CELLS];
216 u32 this_addr[MAX_ADDR_CELLS];
217 void *parent;
218 u64 ret_addr, ret_size;
219 u32 naddr, nsize, prev_naddr;
220 int buflen, offset;
221
222 parent = get_parent(node);
223 if (!parent)
224 return 0;
225
226 get_reg_format(parent, &naddr, &nsize);
227
228 if (nsize > 2)
229 return 0;
230
231 offset = (naddr + nsize) * res;
232
233 if (reglen < offset + naddr + nsize ||
234 sizeof(dt_xlate_buf) < offset + naddr + nsize)
235 return 0;
236
237 copy_val(last_addr, dt_xlate_buf + offset, naddr);
238
239 ret_size = dt_xlate_buf[offset + naddr];
240 if (nsize == 2) {
241 ret_size <<= 32;
242 ret_size |= dt_xlate_buf[offset + naddr + 1];
243 }
244
245 while ((node = get_parent(node))) {
246 prev_naddr = naddr;
247
248 get_reg_format(node, &naddr, &nsize);
249
250 buflen = getprop(node, "ranges", dt_xlate_buf,
251 sizeof(dt_xlate_buf));
252 if (buflen < 0)
253 continue;
254 if (buflen > sizeof(dt_xlate_buf))
255 return 0;
256
257 offset = find_range(last_addr, dt_xlate_buf, prev_naddr,
258 naddr, nsize, buflen / 4);
259
260 if (offset < 0)
261 return 0;
262
263 copy_val(this_addr, dt_xlate_buf + offset, prev_naddr);
264
265 if (!sub_reg(last_addr, this_addr))
266 return 0;
267
268 copy_val(this_addr, dt_xlate_buf + offset + prev_naddr, naddr);
269
270 if (!add_reg(last_addr, this_addr, naddr))
271 return 0;
272 }
273
274 if (naddr > 2)
275 return 0;
276
277 ret_addr = ((u64)last_addr[2] << 32) | last_addr[3];
278
279 if (sizeof(void *) == 4 &&
280 (ret_addr >= 0x100000000ULL || ret_size > 0x100000000ULL ||
281 ret_addr + ret_size > 0x100000000ULL))
282 return 0;
283
284 *addr = ret_addr;
285 if (size)
286 *size = ret_size;
287
288 return 1;
289}
290
291int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size)
292{
293 int reglen;
294
295 reglen = getprop(node, "reg", dt_xlate_buf, sizeof(dt_xlate_buf)) / 4;
296 return dt_xlate(node, res, reglen, addr, size);
297}
298
299int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr)
300{
301
302 if (buflen > sizeof(dt_xlate_buf))
303 return 0;
304
305 memcpy(dt_xlate_buf, buf, buflen);
306 return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL);
307}
diff --git a/arch/powerpc/boot/dts/kuroboxHD.dts b/arch/powerpc/boot/dts/kuroboxHD.dts
index 096e94ac415f..157dc98d3988 100644
--- a/arch/powerpc/boot/dts/kuroboxHD.dts
+++ b/arch/powerpc/boot/dts/kuroboxHD.dts
@@ -29,13 +29,11 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
29 29
30 cpus { 30 cpus {
31 linux,phandle = <2000>; 31 linux,phandle = <2000>;
32 #cpus = <1>;
33 #address-cells = <1>; 32 #address-cells = <1>;
34 #size-cells = <0>; 33 #size-cells = <0>;
35 34
36 PowerPC,603e { /* Really 8241 */ 35 PowerPC,603e { /* Really 8241 */
37 linux,phandle = <2100>; 36 linux,phandle = <2100>;
38 linux,boot-cpu;
39 device_type = "cpu"; 37 device_type = "cpu";
40 reg = <0>; 38 reg = <0>;
41 clock-frequency = <bebc200>; /* Fixed by bootwrapper */ 39 clock-frequency = <bebc200>; /* Fixed by bootwrapper */
@@ -127,17 +125,17 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
127 interrupt-parent = <4400>; 125 interrupt-parent = <4400>;
128 interrupt-map-mask = <f800 0 0 7>; 126 interrupt-map-mask = <f800 0 0 7>;
129 interrupt-map = < 127 interrupt-map = <
130 /* IDSEL 0x11 - IRQ0 ETH */ 128 /* IDSEL 11 - IRQ0 ETH */
131 5800 0 0 1 4400 0 1 129 5800 0 0 1 4400 0 1
132 5800 0 0 2 4400 1 1 130 5800 0 0 2 4400 1 1
133 5800 0 0 3 4400 2 1 131 5800 0 0 3 4400 2 1
134 5800 0 0 4 4400 3 1 132 5800 0 0 4 4400 3 1
135 /* IDSEL 0x12 - IRQ1 IDE0 */ 133 /* IDSEL 12 - IRQ1 IDE0 */
136 6000 0 0 1 4400 1 1 134 6000 0 0 1 4400 1 1
137 6000 0 0 2 4400 2 1 135 6000 0 0 2 4400 2 1
138 6000 0 0 3 4400 3 1 136 6000 0 0 3 4400 3 1
139 6000 0 0 4 4400 0 1 137 6000 0 0 4 4400 0 1
140 /* IDSEL 0x14 - IRQ3 USB2.0 */ 138 /* IDSEL 14 - IRQ3 USB2.0 */
141 7000 0 0 1 4400 3 1 139 7000 0 0 1 4400 3 1
142 7000 0 0 2 4400 3 1 140 7000 0 0 2 4400 3 1
143 7000 0 0 3 4400 3 1 141 7000 0 0 3 4400 3 1
diff --git a/arch/powerpc/boot/dts/kuroboxHG.dts b/arch/powerpc/boot/dts/kuroboxHG.dts
index d06b0b018899..919eb29097db 100644
--- a/arch/powerpc/boot/dts/kuroboxHG.dts
+++ b/arch/powerpc/boot/dts/kuroboxHG.dts
@@ -29,13 +29,11 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
29 29
30 cpus { 30 cpus {
31 linux,phandle = <2000>; 31 linux,phandle = <2000>;
32 #cpus = <1>;
33 #address-cells = <1>; 32 #address-cells = <1>;
34 #size-cells = <0>; 33 #size-cells = <0>;
35 34
36 PowerPC,603e { /* Really 8241 */ 35 PowerPC,603e { /* Really 8241 */
37 linux,phandle = <2100>; 36 linux,phandle = <2100>;
38 linux,boot-cpu;
39 device_type = "cpu"; 37 device_type = "cpu";
40 reg = <0>; 38 reg = <0>;
41 clock-frequency = <fdad680>; /* Fixed by bootwrapper */ 39 clock-frequency = <fdad680>; /* Fixed by bootwrapper */
@@ -127,17 +125,17 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
127 interrupt-parent = <4400>; 125 interrupt-parent = <4400>;
128 interrupt-map-mask = <f800 0 0 7>; 126 interrupt-map-mask = <f800 0 0 7>;
129 interrupt-map = < 127 interrupt-map = <
130 /* IDSEL 0x11 - IRQ0 ETH */ 128 /* IDSEL 11 - IRQ0 ETH */
131 5800 0 0 1 4400 0 1 129 5800 0 0 1 4400 0 1
132 5800 0 0 2 4400 1 1 130 5800 0 0 2 4400 1 1
133 5800 0 0 3 4400 2 1 131 5800 0 0 3 4400 2 1
134 5800 0 0 4 4400 3 1 132 5800 0 0 4 4400 3 1
135 /* IDSEL 0x12 - IRQ1 IDE0 */ 133 /* IDSEL 12 - IRQ1 IDE0 */
136 6000 0 0 1 4400 1 1 134 6000 0 0 1 4400 1 1
137 6000 0 0 2 4400 2 1 135 6000 0 0 2 4400 2 1
138 6000 0 0 3 4400 3 1 136 6000 0 0 3 4400 3 1
139 6000 0 0 4 4400 0 1 137 6000 0 0 4 4400 0 1
140 /* IDSEL 0x14 - IRQ3 USB2.0 */ 138 /* IDSEL 14 - IRQ3 USB2.0 */
141 7000 0 0 1 4400 3 1 139 7000 0 0 1 4400 3 1
142 7000 0 0 2 4400 3 1 140 7000 0 0 2 4400 3 1
143 7000 0 0 3 4400 3 1 141 7000 0 0 3 4400 3 1
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index c03103c63285..ba54c6b40a09 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -24,7 +24,6 @@
24 #size-cells = <1>; 24 #size-cells = <1>;
25 25
26 cpus { 26 cpus {
27 #cpus = <1>;
28 #address-cells = <1>; 27 #address-cells = <1>;
29 #size-cells = <0>; 28 #size-cells = <0>;
30 29
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index 3875ca9a9a62..2e003081b0d3 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -24,7 +24,6 @@
24 #size-cells = <1>; 24 #size-cells = <1>;
25 25
26 cpus { 26 cpus {
27 #cpus = <1>;
28 #address-cells = <1>; 27 #address-cells = <1>;
29 #size-cells = <0>; 28 #size-cells = <0>;
30 29
diff --git a/arch/powerpc/boot/dts/mpc7448hpc2.dts b/arch/powerpc/boot/dts/mpc7448hpc2.dts
index c4d9562cbaad..6fa3754f293a 100644
--- a/arch/powerpc/boot/dts/mpc7448hpc2.dts
+++ b/arch/powerpc/boot/dts/mpc7448hpc2.dts
@@ -19,7 +19,6 @@
19 linux,phandle = <100>; 19 linux,phandle = <100>;
20 20
21 cpus { 21 cpus {
22 #cpus = <1>;
23 #address-cells = <1>; 22 #address-cells = <1>;
24 #size-cells =<0>; 23 #size-cells =<0>;
25 linux,phandle = <200>; 24 linux,phandle = <200>;
@@ -36,7 +35,6 @@
36 bus-frequency = <0>; // From U-Boot 35 bus-frequency = <0>; // From U-Boot
37 32-bit; 36 32-bit;
38 linux,phandle = <201>; 37 linux,phandle = <201>;
39 linux,boot-cpu;
40 }; 38 };
41 }; 39 };
42 40
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 26b44f7513dc..423eedcf634f 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -17,7 +17,6 @@
17 linux,phandle = <100>; 17 linux,phandle = <100>;
18 18
19 cpus { 19 cpus {
20 #cpus = <1>;
21 #address-cells = <1>; 20 #address-cells = <1>;
22 #size-cells = <0>; 21 #size-cells = <0>;
23 linux,phandle = <200>; 22 linux,phandle = <200>;
@@ -34,7 +33,6 @@
34 clock-frequency = <0>; 33 clock-frequency = <0>;
35 32-bit; 34 32-bit;
36 linux,phandle = <201>; 35 linux,phandle = <201>;
37 linux,boot-cpu;
38 }; 36 };
39 }; 37 };
40 38
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index 3d2f5a06df3f..a1533cc07d09 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -11,12 +11,11 @@
11 11
12/ { 12/ {
13 model = "MPC8313ERDB"; 13 model = "MPC8313ERDB";
14 compatible = "MPC83xx"; 14 compatible = "MPC8313ERDB", "MPC831xRDB", "MPC83xxRDB";
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 17
18 cpus { 18 cpus {
19 #cpus = <1>;
20 #address-cells = <1>; 19 #address-cells = <1>;
21 #size-cells = <0>; 20 #size-cells = <0>;
22 21
@@ -59,7 +58,7 @@
59 compatible = "fsl-i2c"; 58 compatible = "fsl-i2c";
60 reg = <3000 100>; 59 reg = <3000 100>;
61 interrupts = <e 8>; 60 interrupts = <e 8>;
62 interrupt-parent = <700>; 61 interrupt-parent = < &ipic >;
63 dfsrr; 62 dfsrr;
64 }; 63 };
65 64
@@ -68,7 +67,7 @@
68 compatible = "fsl-i2c"; 67 compatible = "fsl-i2c";
69 reg = <3100 100>; 68 reg = <3100 100>;
70 interrupts = <f 8>; 69 interrupts = <f 8>;
71 interrupt-parent = <700>; 70 interrupt-parent = < &ipic >;
72 dfsrr; 71 dfsrr;
73 }; 72 };
74 73
@@ -77,7 +76,7 @@
77 compatible = "mpc83xx_spi"; 76 compatible = "mpc83xx_spi";
78 reg = <7000 1000>; 77 reg = <7000 1000>;
79 interrupts = <10 8>; 78 interrupts = <10 8>;
80 interrupt-parent = <700>; 79 interrupt-parent = < &ipic >;
81 mode = <0>; 80 mode = <0>;
82 }; 81 };
83 82
@@ -88,8 +87,8 @@
88 reg = <23000 1000>; 87 reg = <23000 1000>;
89 #address-cells = <1>; 88 #address-cells = <1>;
90 #size-cells = <0>; 89 #size-cells = <0>;
91 interrupt-parent = <700>; 90 interrupt-parent = < &ipic >;
92 interrupts = <26 2>; 91 interrupts = <26 8>;
93 phy_type = "utmi_wide"; 92 phy_type = "utmi_wide";
94 }; 93 };
95 94
@@ -99,18 +98,15 @@
99 reg = <24520 20>; 98 reg = <24520 20>;
100 #address-cells = <1>; 99 #address-cells = <1>;
101 #size-cells = <0>; 100 #size-cells = <0>;
102 linux,phandle = <24520>; 101 phy1: ethernet-phy@1 {
103 ethernet-phy@1 { 102 interrupt-parent = < &ipic >;
104 linux,phandle = <2452001>; 103 interrupts = <13 8>;
105 interrupt-parent = <700>;
106 interrupts = <13 2>;
107 reg = <1>; 104 reg = <1>;
108 device_type = "ethernet-phy"; 105 device_type = "ethernet-phy";
109 }; 106 };
110 ethernet-phy@4 { 107 phy4: ethernet-phy@4 {
111 linux,phandle = <2452004>; 108 interrupt-parent = < &ipic >;
112 interrupt-parent = <700>; 109 interrupts = <14 8>;
113 interrupts = <14 2>;
114 reg = <4>; 110 reg = <4>;
115 device_type = "ethernet-phy"; 111 device_type = "ethernet-phy";
116 }; 112 };
@@ -123,8 +119,8 @@
123 reg = <24000 1000>; 119 reg = <24000 1000>;
124 local-mac-address = [ 00 00 00 00 00 00 ]; 120 local-mac-address = [ 00 00 00 00 00 00 ];
125 interrupts = <25 8 24 8 23 8>; 121 interrupts = <25 8 24 8 23 8>;
126 interrupt-parent = <700>; 122 interrupt-parent = < &ipic >;
127 phy-handle = <2452001>; 123 phy-handle = < &phy1 >;
128 }; 124 };
129 125
130 ethernet@25000 { 126 ethernet@25000 {
@@ -134,8 +130,8 @@
134 reg = <25000 1000>; 130 reg = <25000 1000>;
135 local-mac-address = [ 00 00 00 00 00 00 ]; 131 local-mac-address = [ 00 00 00 00 00 00 ];
136 interrupts = <22 8 21 8 20 8>; 132 interrupts = <22 8 21 8 20 8>;
137 interrupt-parent = <700>; 133 interrupt-parent = < &ipic >;
138 phy-handle = <2452004>; 134 phy-handle = < &phy4 >;
139 }; 135 };
140 136
141 serial@4500 { 137 serial@4500 {
@@ -144,7 +140,7 @@
144 reg = <4500 100>; 140 reg = <4500 100>;
145 clock-frequency = <0>; 141 clock-frequency = <0>;
146 interrupts = <9 8>; 142 interrupts = <9 8>;
147 interrupt-parent = <700>; 143 interrupt-parent = < &ipic >;
148 }; 144 };
149 145
150 serial@4600 { 146 serial@4600 {
@@ -153,7 +149,7 @@
153 reg = <4600 100>; 149 reg = <4600 100>;
154 clock-frequency = <0>; 150 clock-frequency = <0>;
155 interrupts = <a 8>; 151 interrupts = <a 8>;
156 interrupt-parent = <700>; 152 interrupt-parent = < &ipic >;
157 }; 153 };
158 154
159 pci@8500 { 155 pci@8500 {
@@ -161,17 +157,17 @@
161 interrupt-map = < 157 interrupt-map = <
162 158
163 /* IDSEL 0x0E -mini PCI */ 159 /* IDSEL 0x0E -mini PCI */
164 7000 0 0 1 700 12 8 160 7000 0 0 1 &ipic 12 8
165 7000 0 0 2 700 12 8 161 7000 0 0 2 &ipic 12 8
166 7000 0 0 3 700 12 8 162 7000 0 0 3 &ipic 12 8
167 7000 0 0 4 700 12 8 163 7000 0 0 4 &ipic 12 8
168 164
169 /* IDSEL 0x0F - PCI slot */ 165 /* IDSEL 0x0F - PCI slot */
170 7800 0 0 1 700 11 8 166 7800 0 0 1 &ipic 11 8
171 7800 0 0 2 700 12 8 167 7800 0 0 2 &ipic 12 8
172 7800 0 0 3 700 11 8 168 7800 0 0 3 &ipic 11 8
173 7800 0 0 4 700 12 8>; 169 7800 0 0 4 &ipic 12 8>;
174 interrupt-parent = <700>; 170 interrupt-parent = < &ipic >;
175 interrupts = <42 8>; 171 interrupts = <42 8>;
176 bus-range = <0 0>; 172 bus-range = <0 0>;
177 ranges = <02000000 0 90000000 90000000 0 10000000 173 ranges = <02000000 0 90000000 90000000 0 10000000
@@ -192,7 +188,7 @@
192 compatible = "talitos"; 188 compatible = "talitos";
193 reg = <30000 7000>; 189 reg = <30000 7000>;
194 interrupts = <b 8>; 190 interrupts = <b 8>;
195 interrupt-parent = <700>; 191 interrupt-parent = < &ipic >;
196 /* Rev. 2.2 */ 192 /* Rev. 2.2 */
197 num-channels = <1>; 193 num-channels = <1>;
198 channel-fifo-len = <18>; 194 channel-fifo-len = <18>;
@@ -206,8 +202,7 @@
206 * sense == 8: Level, low assertion 202 * sense == 8: Level, low assertion
207 * sense == 2: Edge, high-to-low change 203 * sense == 2: Edge, high-to-low change
208 */ 204 */
209 pic@700 { 205 ipic: pic@700 {
210 linux,phandle = <700>;
211 interrupt-controller; 206 interrupt-controller;
212 #address-cells = <0>; 207 #address-cells = <0>;
213 #interrupt-cells = <2>; 208 #interrupt-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8323emds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index fa7ef24d205b..c798491f4cd0 100644
--- a/arch/powerpc/boot/dts/mpc8323emds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -11,16 +11,13 @@
11 11
12/ { 12/ {
13 model = "MPC8323EMDS"; 13 model = "MPC8323EMDS";
14 compatible = "MPC83xx"; 14 compatible = "MPC8323EMDS", "MPC832xMDS", "MPC83xxMDS";
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 linux,phandle = <100>;
18 17
19 cpus { 18 cpus {
20 #cpus = <1>;
21 #address-cells = <1>; 19 #address-cells = <1>;
22 #size-cells = <0>; 20 #size-cells = <0>;
23 linux,phandle = <200>;
24 21
25 PowerPC,8323@0 { 22 PowerPC,8323@0 {
26 device_type = "cpu"; 23 device_type = "cpu";
@@ -33,14 +30,11 @@
33 bus-frequency = <0>; 30 bus-frequency = <0>;
34 clock-frequency = <0>; 31 clock-frequency = <0>;
35 32-bit; 32 32-bit;
36 linux,phandle = <201>;
37 linux,boot-cpu;
38 }; 33 };
39 }; 34 };
40 35
41 memory { 36 memory {
42 device_type = "memory"; 37 device_type = "memory";
43 linux,phandle = <300>;
44 reg = <00000000 08000000>; 38 reg = <00000000 08000000>;
45 }; 39 };
46 40
@@ -69,7 +63,7 @@
69 compatible = "fsl-i2c"; 63 compatible = "fsl-i2c";
70 reg = <3000 100>; 64 reg = <3000 100>;
71 interrupts = <e 8>; 65 interrupts = <e 8>;
72 interrupt-parent = <700>; 66 interrupt-parent = < &ipic >;
73 dfsrr; 67 dfsrr;
74 }; 68 };
75 69
@@ -79,7 +73,7 @@
79 reg = <4500 100>; 73 reg = <4500 100>;
80 clock-frequency = <0>; 74 clock-frequency = <0>;
81 interrupts = <9 8>; 75 interrupts = <9 8>;
82 interrupt-parent = <700>; 76 interrupt-parent = < &ipic >;
83 }; 77 };
84 78
85 serial@4600 { 79 serial@4600 {
@@ -88,7 +82,7 @@
88 reg = <4600 100>; 82 reg = <4600 100>;
89 clock-frequency = <0>; 83 clock-frequency = <0>;
90 interrupts = <a 8>; 84 interrupts = <a 8>;
91 interrupt-parent = <700>; 85 interrupt-parent = < &ipic >;
92 }; 86 };
93 87
94 crypto@30000 { 88 crypto@30000 {
@@ -97,7 +91,7 @@
97 compatible = "talitos"; 91 compatible = "talitos";
98 reg = <30000 7000>; 92 reg = <30000 7000>;
99 interrupts = <b 8>; 93 interrupts = <b 8>;
100 interrupt-parent = <700>; 94 interrupt-parent = < &ipic >;
101 /* Rev. 2.2 */ 95 /* Rev. 2.2 */
102 num-channels = <1>; 96 num-channels = <1>;
103 channel-fifo-len = <18>; 97 channel-fifo-len = <18>;
@@ -106,51 +100,50 @@
106 }; 100 };
107 101
108 pci@8500 { 102 pci@8500 {
109 linux,phandle = <8500>;
110 interrupt-map-mask = <f800 0 0 7>; 103 interrupt-map-mask = <f800 0 0 7>;
111 interrupt-map = < 104 interrupt-map = <
112 /* IDSEL 0x11 AD17 */ 105 /* IDSEL 0x11 AD17 */
113 8800 0 0 1 700 14 8 106 8800 0 0 1 &ipic 14 8
114 8800 0 0 2 700 15 8 107 8800 0 0 2 &ipic 15 8
115 8800 0 0 3 700 16 8 108 8800 0 0 3 &ipic 16 8
116 8800 0 0 4 700 17 8 109 8800 0 0 4 &ipic 17 8
117 110
118 /* IDSEL 0x12 AD18 */ 111 /* IDSEL 0x12 AD18 */
119 9000 0 0 1 700 16 8 112 9000 0 0 1 &ipic 16 8
120 9000 0 0 2 700 17 8 113 9000 0 0 2 &ipic 17 8
121 9000 0 0 3 700 14 8 114 9000 0 0 3 &ipic 14 8
122 9000 0 0 4 700 15 8 115 9000 0 0 4 &ipic 15 8
123 116
124 /* IDSEL 0x13 AD19 */ 117 /* IDSEL 0x13 AD19 */
125 9800 0 0 1 700 17 8 118 9800 0 0 1 &ipic 17 8
126 9800 0 0 2 700 14 8 119 9800 0 0 2 &ipic 14 8
127 9800 0 0 3 700 15 8 120 9800 0 0 3 &ipic 15 8
128 9800 0 0 4 700 16 8 121 9800 0 0 4 &ipic 16 8
129 122
130 /* IDSEL 0x15 AD21*/ 123 /* IDSEL 0x15 AD21*/
131 a800 0 0 1 700 14 8 124 a800 0 0 1 &ipic 14 8
132 a800 0 0 2 700 15 8 125 a800 0 0 2 &ipic 15 8
133 a800 0 0 3 700 16 8 126 a800 0 0 3 &ipic 16 8
134 a800 0 0 4 700 17 8 127 a800 0 0 4 &ipic 17 8
135 128
136 /* IDSEL 0x16 AD22*/ 129 /* IDSEL 0x16 AD22*/
137 b000 0 0 1 700 17 8 130 b000 0 0 1 &ipic 17 8
138 b000 0 0 2 700 14 8 131 b000 0 0 2 &ipic 14 8
139 b000 0 0 3 700 15 8 132 b000 0 0 3 &ipic 15 8
140 b000 0 0 4 700 16 8 133 b000 0 0 4 &ipic 16 8
141 134
142 /* IDSEL 0x17 AD23*/ 135 /* IDSEL 0x17 AD23*/
143 b800 0 0 1 700 16 8 136 b800 0 0 1 &ipic 16 8
144 b800 0 0 2 700 17 8 137 b800 0 0 2 &ipic 17 8
145 b800 0 0 3 700 14 8 138 b800 0 0 3 &ipic 14 8
146 b800 0 0 4 700 15 8 139 b800 0 0 4 &ipic 15 8
147 140
148 /* IDSEL 0x18 AD24*/ 141 /* IDSEL 0x18 AD24*/
149 c000 0 0 1 700 15 8 142 c000 0 0 1 &ipic 15 8
150 c000 0 0 2 700 16 8 143 c000 0 0 2 &ipic 16 8
151 c000 0 0 3 700 17 8 144 c000 0 0 3 &ipic 17 8
152 c000 0 0 4 700 14 8>; 145 c000 0 0 4 &ipic 14 8>;
153 interrupt-parent = <700>; 146 interrupt-parent = < &ipic >;
154 interrupts = <42 8>; 147 interrupts = <42 8>;
155 bus-range = <0 0>; 148 bus-range = <0 0>;
156 ranges = <02000000 0 a0000000 90000000 0 10000000 149 ranges = <02000000 0 a0000000 90000000 0 10000000
@@ -165,8 +158,7 @@
165 device_type = "pci"; 158 device_type = "pci";
166 }; 159 };
167 160
168 pic@700 { 161 ipic: pic@700 {
169 linux,phandle = <700>;
170 interrupt-controller; 162 interrupt-controller;
171 #address-cells = <0>; 163 #address-cells = <0>;
172 #interrupt-cells = <2>; 164 #interrupt-cells = <2>;
@@ -180,8 +172,7 @@
180 device_type = "par_io"; 172 device_type = "par_io";
181 num-ports = <7>; 173 num-ports = <7>;
182 174
183 ucc_pin@03 { 175 pio3: ucc_pin@03 {
184 linux,phandle = <140003>;
185 pio-map = < 176 pio-map = <
186 /* port pin dir open_drain assignment has_irq */ 177 /* port pin dir open_drain assignment has_irq */
187 3 4 3 0 2 0 /* MDIO */ 178 3 4 3 0 2 0 /* MDIO */
@@ -204,8 +195,7 @@
204 1 c 1 0 1 0 /* TX_EN */ 195 1 c 1 0 1 0 /* TX_EN */
205 1 d 2 0 1 0>;/* CRS */ 196 1 d 2 0 1 0>;/* CRS */
206 }; 197 };
207 ucc_pin@04 { 198 pio4: ucc_pin@04 {
208 linux,phandle = <140004>;
209 pio-map = < 199 pio-map = <
210 /* port pin dir open_drain assignment has_irq */ 200 /* port pin dir open_drain assignment has_irq */
211 3 1f 2 0 1 0 /* RX_CLK (CLK7) */ 201 3 1f 2 0 1 0 /* RX_CLK (CLK7) */
@@ -252,7 +242,7 @@
252 compatible = "fsl_spi"; 242 compatible = "fsl_spi";
253 reg = <4c0 40>; 243 reg = <4c0 40>;
254 interrupts = <2>; 244 interrupts = <2>;
255 interrupt-parent = <80>; 245 interrupt-parent = < &qeic >;
256 mode = "cpu"; 246 mode = "cpu";
257 }; 247 };
258 248
@@ -261,7 +251,7 @@
261 compatible = "fsl_spi"; 251 compatible = "fsl_spi";
262 reg = <500 40>; 252 reg = <500 40>;
263 interrupts = <1>; 253 interrupts = <1>;
264 interrupt-parent = <80>; 254 interrupt-parent = < &qeic >;
265 mode = "cpu"; 255 mode = "cpu";
266 }; 256 };
267 257
@@ -270,7 +260,7 @@
270 compatible = "qe_udc"; 260 compatible = "qe_udc";
271 reg = <6c0 40 8B00 100>; 261 reg = <6c0 40 8B00 100>;
272 interrupts = <b>; 262 interrupts = <b>;
273 interrupt-parent = <80>; 263 interrupt-parent = < &qeic >;
274 mode = "slave"; 264 mode = "slave";
275 }; 265 };
276 266
@@ -281,12 +271,12 @@
281 device-id = <3>; 271 device-id = <3>;
282 reg = <2200 200>; 272 reg = <2200 200>;
283 interrupts = <22>; 273 interrupts = <22>;
284 interrupt-parent = <80>; 274 interrupt-parent = < &qeic >;
285 mac-address = [ 00 04 9f 00 23 23 ]; 275 mac-address = [ 00 04 9f 00 23 23 ];
286 rx-clock = <19>; 276 rx-clock = <19>;
287 tx-clock = <1a>; 277 tx-clock = <1a>;
288 phy-handle = <212003>; 278 phy-handle = < &phy3 >;
289 pio-handle = <140003>; 279 pio-handle = < &pio3 >;
290 }; 280 };
291 281
292 ucc@3200 { 282 ucc@3200 {
@@ -296,12 +286,12 @@
296 device-id = <4>; 286 device-id = <4>;
297 reg = <3000 200>; 287 reg = <3000 200>;
298 interrupts = <23>; 288 interrupts = <23>;
299 interrupt-parent = <80>; 289 interrupt-parent = < &qeic >;
300 mac-address = [ 00 11 22 33 44 55 ]; 290 mac-address = [ 00 11 22 33 44 55 ];
301 rx-clock = <17>; 291 rx-clock = <17>;
302 tx-clock = <18>; 292 tx-clock = <18>;
303 phy-handle = <212004>; 293 phy-handle = < &phy4 >;
304 pio-handle = <140004>; 294 pio-handle = < &pio4 >;
305 }; 295 };
306 296
307 mdio@2320 { 297 mdio@2320 {
@@ -311,26 +301,23 @@
311 device_type = "mdio"; 301 device_type = "mdio";
312 compatible = "ucc_geth_phy"; 302 compatible = "ucc_geth_phy";
313 303
314 ethernet-phy@03 { 304 phy3: ethernet-phy@03 {
315 linux,phandle = <212003>; 305 interrupt-parent = < &ipic >;
316 interrupt-parent = <700>; 306 interrupts = <11 8>;
317 interrupts = <11 2>;
318 reg = <3>; 307 reg = <3>;
319 device_type = "ethernet-phy"; 308 device_type = "ethernet-phy";
320 interface = <3>; //ENET_100_MII 309 interface = <3>; //ENET_100_MII
321 }; 310 };
322 ethernet-phy@04 { 311 phy4: ethernet-phy@04 {
323 linux,phandle = <212004>; 312 interrupt-parent = < &ipic >;
324 interrupt-parent = <700>; 313 interrupts = <12 8>;
325 interrupts = <12 2>;
326 reg = <4>; 314 reg = <4>;
327 device_type = "ethernet-phy"; 315 device_type = "ethernet-phy";
328 interface = <3>; 316 interface = <3>;
329 }; 317 };
330 }; 318 };
331 319
332 qeic@80 { 320 qeic: qeic@80 {
333 linux,phandle = <80>;
334 interrupt-controller; 321 interrupt-controller;
335 device_type = "qeic"; 322 device_type = "qeic";
336 #address-cells = <0>; 323 #address-cells = <0>;
@@ -339,7 +326,7 @@
339 built-in; 326 built-in;
340 big-endian; 327 big-endian;
341 interrupts = <20 8 21 8>; //high:32 low:33 328 interrupts = <20 8 21 8>; //high:32 low:33
342 interrupt-parent = <700>; 329 interrupt-parent = < &ipic >;
343 }; 330 };
344 }; 331 };
345}; 332};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
new file mode 100644
index 000000000000..b55bced1593d
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -0,0 +1,291 @@
1/*
2 * MPC832x RDB Device Tree Source
3 *
4 * Copyright 2007 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/ {
13 model = "MPC8323ERDB";
14 compatible = "MPC8323ERDB", "MPC832xRDB", "MPC83xxRDB";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,8323@0 {
23 device_type = "cpu";
24 reg = <0>;
25 d-cache-line-size = <20>; // 32 bytes
26 i-cache-line-size = <20>; // 32 bytes
27 d-cache-size = <4000>; // L1, 16K
28 i-cache-size = <4000>; // L1, 16K
29 timebase-frequency = <0>;
30 bus-frequency = <0>;
31 clock-frequency = <0>;
32 32-bit;
33 };
34 };
35
36 memory {
37 device_type = "memory";
38 reg = <00000000 04000000>;
39 };
40
41 soc8323@e0000000 {
42 #address-cells = <1>;
43 #size-cells = <1>;
44 #interrupt-cells = <2>;
45 device_type = "soc";
46 ranges = <0 e0000000 00100000>;
47 reg = <e0000000 00000200>;
48 bus-frequency = <0>;
49
50 wdt@200 {
51 device_type = "watchdog";
52 compatible = "mpc83xx_wdt";
53 reg = <200 100>;
54 };
55
56 i2c@3000 {
57 device_type = "i2c";
58 compatible = "fsl-i2c";
59 reg = <3000 100>;
60 interrupts = <e 8>;
61 interrupt-parent = <&pic>;
62 dfsrr;
63 };
64
65 serial@4500 {
66 device_type = "serial";
67 compatible = "ns16550";
68 reg = <4500 100>;
69 clock-frequency = <0>;
70 interrupts = <9 8>;
71 interrupt-parent = <&pic>;
72 };
73
74 serial@4600 {
75 device_type = "serial";
76 compatible = "ns16550";
77 reg = <4600 100>;
78 clock-frequency = <0>;
79 interrupts = <a 8>;
80 interrupt-parent = <&pic>;
81 };
82
83 crypto@30000 {
84 device_type = "crypto";
85 model = "SEC2";
86 compatible = "talitos";
87 reg = <30000 7000>;
88 interrupts = <b 8>;
89 interrupt-parent = <&pic>;
90 /* Rev. 2.2 */
91 num-channels = <1>;
92 channel-fifo-len = <18>;
93 exec-units-mask = <0000004c>;
94 descriptor-types-mask = <0122003f>;
95 };
96
97 pci@8500 {
98 interrupt-map-mask = <f800 0 0 7>;
99 interrupt-map = <
100 /* IDSEL 0x10 AD16 (USB) */
101 8000 0 0 1 &pic 11 8
102
103 /* IDSEL 0x11 AD17 (Mini1)*/
104 8800 0 0 1 &pic 12 8
105 8800 0 0 2 &pic 13 8
106 8800 0 0 3 &pic 14 8
107 8800 0 0 4 &pic 30 8
108
109 /* IDSEL 0x12 AD18 (PCI/Mini2) */
110 9000 0 0 1 &pic 13 8
111 9000 0 0 2 &pic 14 8
112 9000 0 0 3 &pic 30 8
113 9000 0 0 4 &pic 11 8>;
114
115 interrupt-parent = <&pic>;
116 interrupts = <42 8>;
117 bus-range = <0 0>;
118 ranges = <42000000 0 80000000 80000000 0 10000000
119 02000000 0 90000000 90000000 0 10000000
120 01000000 0 d0000000 d0000000 0 04000000>;
121 clock-frequency = <0>;
122 #interrupt-cells = <1>;
123 #size-cells = <2>;
124 #address-cells = <3>;
125 reg = <8500 100>;
126 compatible = "83xx";
127 device_type = "pci";
128 };
129
130 pic:pic@700 {
131 interrupt-controller;
132 #address-cells = <0>;
133 #interrupt-cells = <2>;
134 reg = <700 100>;
135 built-in;
136 device_type = "ipic";
137 };
138
139 par_io@1400 {
140 reg = <1400 100>;
141 device_type = "par_io";
142 num-ports = <7>;
143
144 ucc2pio:ucc_pin@02 {
145 pio-map = <
146 /* port pin dir open_drain assignment has_irq */
147 3 4 3 0 2 0 /* MDIO */
148 3 5 1 0 2 0 /* MDC */
149 3 15 2 0 1 0 /* RX_CLK (CLK16) */
150 3 17 2 0 1 0 /* TX_CLK (CLK3) */
151 0 12 1 0 1 0 /* TxD0 */
152 0 13 1 0 1 0 /* TxD1 */
153 0 14 1 0 1 0 /* TxD2 */
154 0 15 1 0 1 0 /* TxD3 */
155 0 16 2 0 1 0 /* RxD0 */
156 0 17 2 0 1 0 /* RxD1 */
157 0 18 2 0 1 0 /* RxD2 */
158 0 19 2 0 1 0 /* RxD3 */
159 0 1a 2 0 1 0 /* RX_ER */
160 0 1b 1 0 1 0 /* TX_ER */
161 0 1c 2 0 1 0 /* RX_DV */
162 0 1d 2 0 1 0 /* COL */
163 0 1e 1 0 1 0 /* TX_EN */
164 0 1f 2 0 1 0>; /* CRS */
165 };
166 ucc3pio:ucc_pin@03 {
167 pio-map = <
168 /* port pin dir open_drain assignment has_irq */
169 0 d 2 0 1 0 /* RX_CLK (CLK9) */
170 3 18 2 0 1 0 /* TX_CLK (CLK10) */
171 1 0 1 0 1 0 /* TxD0 */
172 1 1 1 0 1 0 /* TxD1 */
173 1 2 1 0 1 0 /* TxD2 */
174 1 3 1 0 1 0 /* TxD3 */
175 1 4 2 0 1 0 /* RxD0 */
176 1 5 2 0 1 0 /* RxD1 */
177 1 6 2 0 1 0 /* RxD2 */
178 1 7 2 0 1 0 /* RxD3 */
179 1 8 2 0 1 0 /* RX_ER */
180 1 9 1 0 1 0 /* TX_ER */
181 1 a 2 0 1 0 /* RX_DV */
182 1 b 2 0 1 0 /* COL */
183 1 c 1 0 1 0 /* TX_EN */
184 1 d 2 0 1 0>; /* CRS */
185 };
186 };
187 };
188
189 qe@e0100000 {
190 #address-cells = <1>;
191 #size-cells = <1>;
192 device_type = "qe";
193 model = "QE";
194 ranges = <0 e0100000 00100000>;
195 reg = <e0100000 480>;
196 brg-frequency = <0>;
197 bus-frequency = <BCD3D80>;
198
199 muram@10000 {
200 device_type = "muram";
201 ranges = <0 00010000 00004000>;
202
203 data-only@0 {
204 reg = <0 4000>;
205 };
206 };
207
208 spi@4c0 {
209 device_type = "spi";
210 compatible = "fsl_spi";
211 reg = <4c0 40>;
212 interrupts = <2>;
213 interrupt-parent = <&qeic>;
214 mode = "cpu";
215 };
216
217 spi@500 {
218 device_type = "spi";
219 compatible = "fsl_spi";
220 reg = <500 40>;
221 interrupts = <1>;
222 interrupt-parent = <&qeic>;
223 mode = "cpu";
224 };
225
226 ucc@3000 {
227 device_type = "network";
228 compatible = "ucc_geth";
229 model = "UCC";
230 device-id = <2>;
231 reg = <3000 200>;
232 interrupts = <21>;
233 interrupt-parent = <&qeic>;
234 mac-address = [ 00 04 9f ef 03 02 ];
235 rx-clock = <20>;
236 tx-clock = <13>;
237 phy-handle = <&phy00>;
238 pio-handle = <&ucc2pio>;
239 };
240
241 ucc@2200 {
242 device_type = "network";
243 compatible = "ucc_geth";
244 model = "UCC";
245 device-id = <3>;
246 reg = <2200 200>;
247 interrupts = <22>;
248 interrupt-parent = <&qeic>;
249 mac-address = [ 00 04 9f ef 03 01 ];
250 rx-clock = <19>;
251 tx-clock = <1a>;
252 phy-handle = <&phy04>;
253 pio-handle = <&ucc3pio>;
254 };
255
256 mdio@3120 {
257 #address-cells = <1>;
258 #size-cells = <0>;
259 reg = <3120 18>;
260 device_type = "mdio";
261 compatible = "ucc_geth_phy";
262
263 phy00:ethernet-phy@00 {
264 interrupt-parent = <&pic>;
265 interrupts = <0>;
266 reg = <0>;
267 device_type = "ethernet-phy";
268 interface = <3>; //ENET_100_MII
269 };
270 phy04:ethernet-phy@04 {
271 interrupt-parent = <&pic>;
272 interrupts = <0>;
273 reg = <4>;
274 device_type = "ethernet-phy";
275 interface = <3>;
276 };
277 };
278
279 qeic:qeic@80 {
280 interrupt-controller;
281 device_type = "qeic";
282 #address-cells = <0>;
283 #interrupt-cells = <1>;
284 reg = <80 80>;
285 built-in;
286 big-endian;
287 interrupts = <20 8 21 8>; //high:32 low:33
288 interrupt-parent = <&pic>;
289 };
290 };
291};
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 27807fc45888..db0d00303275 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -10,12 +10,11 @@
10 */ 10 */
11/ { 11/ {
12 model = "MPC8349EMITX"; 12 model = "MPC8349EMITX";
13 compatible = "MPC834xMITX"; 13 compatible = "MPC8349EMITX", "MPC834xMITX", "MPC83xxMITX";
14 #address-cells = <1>; 14 #address-cells = <1>;
15 #size-cells = <1>; 15 #size-cells = <1>;
16 16
17 cpus { 17 cpus {
18 #cpus = <1>;
19 #address-cells = <1>; 18 #address-cells = <1>;
20 #size-cells = <0>; 19 #size-cells = <0>;
21 20
@@ -58,7 +57,7 @@
58 compatible = "fsl-i2c"; 57 compatible = "fsl-i2c";
59 reg = <3000 100>; 58 reg = <3000 100>;
60 interrupts = <e 8>; 59 interrupts = <e 8>;
61 interrupt-parent = <700>; 60 interrupt-parent = < &ipic >;
62 dfsrr; 61 dfsrr;
63 }; 62 };
64 63
@@ -67,7 +66,7 @@
67 compatible = "fsl-i2c"; 66 compatible = "fsl-i2c";
68 reg = <3100 100>; 67 reg = <3100 100>;
69 interrupts = <f 8>; 68 interrupts = <f 8>;
70 interrupt-parent = <700>; 69 interrupt-parent = < &ipic >;
71 dfsrr; 70 dfsrr;
72 }; 71 };
73 72
@@ -76,7 +75,7 @@
76 compatible = "mpc83xx_spi"; 75 compatible = "mpc83xx_spi";
77 reg = <7000 1000>; 76 reg = <7000 1000>;
78 interrupts = <10 8>; 77 interrupts = <10 8>;
79 interrupt-parent = <700>; 78 interrupt-parent = < &ipic >;
80 mode = <0>; 79 mode = <0>;
81 }; 80 };
82 81
@@ -86,8 +85,8 @@
86 reg = <22000 1000>; 85 reg = <22000 1000>;
87 #address-cells = <1>; 86 #address-cells = <1>;
88 #size-cells = <0>; 87 #size-cells = <0>;
89 interrupt-parent = <700>; 88 interrupt-parent = < &ipic >;
90 interrupts = <27 2>; 89 interrupts = <27 8>;
91 phy_type = "ulpi"; 90 phy_type = "ulpi";
92 port1; 91 port1;
93 }; 92 };
@@ -98,8 +97,8 @@
98 reg = <23000 1000>; 97 reg = <23000 1000>;
99 #address-cells = <1>; 98 #address-cells = <1>;
100 #size-cells = <0>; 99 #size-cells = <0>;
101 interrupt-parent = <700>; 100 interrupt-parent = < &ipic >;
102 interrupts = <26 2>; 101 interrupts = <26 8>;
103 phy_type = "ulpi"; 102 phy_type = "ulpi";
104 }; 103 };
105 104
@@ -109,22 +108,19 @@
109 reg = <24520 20>; 108 reg = <24520 20>;
110 #address-cells = <1>; 109 #address-cells = <1>;
111 #size-cells = <0>; 110 #size-cells = <0>;
112 linux,phandle = <24520>;
113 111
114 /* Vitesse 8201 */ 112 /* Vitesse 8201 */
115 ethernet-phy@1c { 113 phy1c: ethernet-phy@1c {
116 linux,phandle = <245201c>; 114 interrupt-parent = < &ipic >;
117 interrupt-parent = <700>; 115 interrupts = <12 8>;
118 interrupts = <12 2>;
119 reg = <1c>; 116 reg = <1c>;
120 device_type = "ethernet-phy"; 117 device_type = "ethernet-phy";
121 }; 118 };
122 119
123 /* Vitesse 7385 */ 120 /* Vitesse 7385 */
124 ethernet-phy@1f { 121 phy1f: ethernet-phy@1f {
125 linux,phandle = <245201f>; 122 interrupt-parent = < &ipic >;
126 interrupt-parent = <700>; 123 interrupts = <12 8>;
127 interrupts = <12 2>;
128 reg = <1f>; 124 reg = <1f>;
129 device_type = "ethernet-phy"; 125 device_type = "ethernet-phy";
130 }; 126 };
@@ -138,8 +134,8 @@
138 address = [ 00 00 00 00 00 00 ]; 134 address = [ 00 00 00 00 00 00 ];
139 local-mac-address = [ 00 00 00 00 00 00 ]; 135 local-mac-address = [ 00 00 00 00 00 00 ];
140 interrupts = <20 8 21 8 22 8>; 136 interrupts = <20 8 21 8 22 8>;
141 interrupt-parent = <700>; 137 interrupt-parent = < &ipic >;
142 phy-handle = <245201c>; 138 phy-handle = < &phy1c >;
143 }; 139 };
144 140
145 ethernet@25000 { 141 ethernet@25000 {
@@ -152,8 +148,8 @@
152 address = [ 00 00 00 00 00 00 ]; 148 address = [ 00 00 00 00 00 00 ];
153 local-mac-address = [ 00 00 00 00 00 00 ]; 149 local-mac-address = [ 00 00 00 00 00 00 ];
154 interrupts = <23 8 24 8 25 8>; 150 interrupts = <23 8 24 8 25 8>;
155 interrupt-parent = <700>; 151 interrupt-parent = < &ipic >;
156 phy-handle = <245201f>; 152 phy-handle = < &phy1f >;
157 }; 153 };
158 154
159 serial@4500 { 155 serial@4500 {
@@ -162,7 +158,7 @@
162 reg = <4500 100>; 158 reg = <4500 100>;
163 clock-frequency = <0>; // from bootloader 159 clock-frequency = <0>; // from bootloader
164 interrupts = <9 8>; 160 interrupts = <9 8>;
165 interrupt-parent = <700>; 161 interrupt-parent = < &ipic >;
166 }; 162 };
167 163
168 serial@4600 { 164 serial@4600 {
@@ -171,16 +167,16 @@
171 reg = <4600 100>; 167 reg = <4600 100>;
172 clock-frequency = <0>; // from bootloader 168 clock-frequency = <0>; // from bootloader
173 interrupts = <a 8>; 169 interrupts = <a 8>;
174 interrupt-parent = <700>; 170 interrupt-parent = < &ipic >;
175 }; 171 };
176 172
177 pci@8500 { 173 pci@8500 {
178 interrupt-map-mask = <f800 0 0 7>; 174 interrupt-map-mask = <f800 0 0 7>;
179 interrupt-map = < 175 interrupt-map = <
180 /* IDSEL 0x10 - SATA */ 176 /* IDSEL 0x10 - SATA */
181 8000 0 0 1 700 16 8 /* SATA_INTA */ 177 8000 0 0 1 &ipic 16 8 /* SATA_INTA */
182 >; 178 >;
183 interrupt-parent = <700>; 179 interrupt-parent = < &ipic >;
184 interrupts = <42 8>; 180 interrupts = <42 8>;
185 bus-range = <0 0>; 181 bus-range = <0 0>;
186 ranges = <42000000 0 80000000 80000000 0 10000000 182 ranges = <42000000 0 80000000 80000000 0 10000000
@@ -199,13 +195,13 @@
199 interrupt-map-mask = <f800 0 0 7>; 195 interrupt-map-mask = <f800 0 0 7>;
200 interrupt-map = < 196 interrupt-map = <
201 /* IDSEL 0x0E - MiniPCI Slot */ 197 /* IDSEL 0x0E - MiniPCI Slot */
202 7000 0 0 1 700 15 8 /* PCI_INTA */ 198 7000 0 0 1 &ipic 15 8 /* PCI_INTA */
203 199
204 /* IDSEL 0x0F - PCI Slot */ 200 /* IDSEL 0x0F - PCI Slot */
205 7800 0 0 1 700 14 8 /* PCI_INTA */ 201 7800 0 0 1 &ipic 14 8 /* PCI_INTA */
206 7800 0 0 2 700 15 8 /* PCI_INTB */ 202 7800 0 0 2 &ipic 15 8 /* PCI_INTB */
207 >; 203 >;
208 interrupt-parent = <700>; 204 interrupt-parent = < &ipic >;
209 interrupts = <43 8>; 205 interrupts = <43 8>;
210 bus-range = <1 1>; 206 bus-range = <1 1>;
211 ranges = <42000000 0 a0000000 a0000000 0 10000000 207 ranges = <42000000 0 a0000000 a0000000 0 10000000
@@ -226,15 +222,14 @@
226 compatible = "talitos"; 222 compatible = "talitos";
227 reg = <30000 10000>; 223 reg = <30000 10000>;
228 interrupts = <b 8>; 224 interrupts = <b 8>;
229 interrupt-parent = <700>; 225 interrupt-parent = < &ipic >;
230 num-channels = <4>; 226 num-channels = <4>;
231 channel-fifo-len = <18>; 227 channel-fifo-len = <18>;
232 exec-units-mask = <0000007e>; 228 exec-units-mask = <0000007e>;
233 descriptor-types-mask = <01010ebf>; 229 descriptor-types-mask = <01010ebf>;
234 }; 230 };
235 231
236 pic@700 { 232 ipic: pic@700 {
237 linux,phandle = <700>;
238 interrupt-controller; 233 interrupt-controller;
239 #address-cells = <0>; 234 #address-cells = <0>;
240 #interrupt-cells = <2>; 235 #interrupt-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index 3190774de1d8..f636528a3c72 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -10,12 +10,11 @@
10 */ 10 */
11/ { 11/ {
12 model = "MPC8349EMITXGP"; 12 model = "MPC8349EMITXGP";
13 compatible = "MPC834xMITXGP"; 13 compatible = "MPC8349EMITXGP", "MPC834xMITX", "MPC83xxMITX";
14 #address-cells = <1>; 14 #address-cells = <1>;
15 #size-cells = <1>; 15 #size-cells = <1>;
16 16
17 cpus { 17 cpus {
18 #cpus = <1>;
19 #address-cells = <1>; 18 #address-cells = <1>;
20 #size-cells = <0>; 19 #size-cells = <0>;
21 20
@@ -58,7 +57,7 @@
58 compatible = "fsl-i2c"; 57 compatible = "fsl-i2c";
59 reg = <3000 100>; 58 reg = <3000 100>;
60 interrupts = <e 8>; 59 interrupts = <e 8>;
61 interrupt-parent = <700>; 60 interrupt-parent = < &ipic >;
62 dfsrr; 61 dfsrr;
63 }; 62 };
64 63
@@ -67,7 +66,7 @@
67 compatible = "fsl-i2c"; 66 compatible = "fsl-i2c";
68 reg = <3100 100>; 67 reg = <3100 100>;
69 interrupts = <f 8>; 68 interrupts = <f 8>;
70 interrupt-parent = <700>; 69 interrupt-parent = < &ipic >;
71 dfsrr; 70 dfsrr;
72 }; 71 };
73 72
@@ -76,7 +75,7 @@
76 compatible = "mpc83xx_spi"; 75 compatible = "mpc83xx_spi";
77 reg = <7000 1000>; 76 reg = <7000 1000>;
78 interrupts = <10 8>; 77 interrupts = <10 8>;
79 interrupt-parent = <700>; 78 interrupt-parent = < &ipic >;
80 mode = <0>; 79 mode = <0>;
81 }; 80 };
82 81
@@ -86,8 +85,8 @@
86 reg = <23000 1000>; 85 reg = <23000 1000>;
87 #address-cells = <1>; 86 #address-cells = <1>;
88 #size-cells = <0>; 87 #size-cells = <0>;
89 interrupt-parent = <700>; 88 interrupt-parent = < &ipic >;
90 interrupts = <26 2>; 89 interrupts = <26 8>;
91 dr_mode = "otg"; 90 dr_mode = "otg";
92 phy_type = "ulpi"; 91 phy_type = "ulpi";
93 }; 92 };
@@ -98,13 +97,11 @@
98 reg = <24520 20>; 97 reg = <24520 20>;
99 #address-cells = <1>; 98 #address-cells = <1>;
100 #size-cells = <0>; 99 #size-cells = <0>;
101 linux,phandle = <24520>;
102 100
103 /* Vitesse 8201 */ 101 /* Vitesse 8201 */
104 ethernet-phy@1c { 102 phy1c: ethernet-phy@1c {
105 linux,phandle = <245201c>; 103 interrupt-parent = < &ipic >;
106 interrupt-parent = <700>; 104 interrupts = <12 8>;
107 interrupts = <12 2>;
108 reg = <1c>; 105 reg = <1c>;
109 device_type = "ethernet-phy"; 106 device_type = "ethernet-phy";
110 }; 107 };
@@ -117,8 +114,8 @@
117 reg = <24000 1000>; 114 reg = <24000 1000>;
118 local-mac-address = [ 00 00 00 00 00 00 ]; 115 local-mac-address = [ 00 00 00 00 00 00 ];
119 interrupts = <20 8 21 8 22 8>; 116 interrupts = <20 8 21 8 22 8>;
120 interrupt-parent = <700>; 117 interrupt-parent = < &ipic >;
121 phy-handle = <245201c>; 118 phy-handle = < &phy1c >;
122 }; 119 };
123 120
124 serial@4500 { 121 serial@4500 {
@@ -127,7 +124,7 @@
127 reg = <4500 100>; 124 reg = <4500 100>;
128 clock-frequency = <0>; // from bootloader 125 clock-frequency = <0>; // from bootloader
129 interrupts = <9 8>; 126 interrupts = <9 8>;
130 interrupt-parent = <700>; 127 interrupt-parent = < &ipic >;
131 }; 128 };
132 129
133 serial@4600 { 130 serial@4600 {
@@ -136,17 +133,17 @@
136 reg = <4600 100>; 133 reg = <4600 100>;
137 clock-frequency = <0>; // from bootloader 134 clock-frequency = <0>; // from bootloader
138 interrupts = <a 8>; 135 interrupts = <a 8>;
139 interrupt-parent = <700>; 136 interrupt-parent = < &ipic >;
140 }; 137 };
141 138
142 pci@8600 { 139 pci@8600 {
143 interrupt-map-mask = <f800 0 0 7>; 140 interrupt-map-mask = <f800 0 0 7>;
144 interrupt-map = < 141 interrupt-map = <
145 /* IDSEL 0x0F - PCI Slot */ 142 /* IDSEL 0x0F - PCI Slot */
146 7800 0 0 1 700 14 8 /* PCI_INTA */ 143 7800 0 0 1 &ipic 14 8 /* PCI_INTA */
147 7800 0 0 2 700 15 8 /* PCI_INTB */ 144 7800 0 0 2 &ipic 15 8 /* PCI_INTB */
148 >; 145 >;
149 interrupt-parent = <700>; 146 interrupt-parent = < &ipic >;
150 interrupts = <43 8>; 147 interrupts = <43 8>;
151 bus-range = <1 1>; 148 bus-range = <1 1>;
152 ranges = <42000000 0 a0000000 a0000000 0 10000000 149 ranges = <42000000 0 a0000000 a0000000 0 10000000
@@ -167,15 +164,14 @@
167 compatible = "talitos"; 164 compatible = "talitos";
168 reg = <30000 10000>; 165 reg = <30000 10000>;
169 interrupts = <b 8>; 166 interrupts = <b 8>;
170 interrupt-parent = <700>; 167 interrupt-parent = < &ipic >;
171 num-channels = <4>; 168 num-channels = <4>;
172 channel-fifo-len = <18>; 169 channel-fifo-len = <18>;
173 exec-units-mask = <0000007e>; 170 exec-units-mask = <0000007e>;
174 descriptor-types-mask = <01010ebf>; 171 descriptor-types-mask = <01010ebf>;
175 }; 172 };
176 173
177 pic@700 { 174 ipic: pic@700 {
178 linux,phandle = <700>;
179 interrupt-controller; 175 interrupt-controller;
180 #address-cells = <0>; 176 #address-cells = <0>;
181 #interrupt-cells = <2>; 177 #interrupt-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index dc121b3cb4a9..07bcc5194d2b 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -11,12 +11,11 @@
11 11
12/ { 12/ {
13 model = "MPC8349EMDS"; 13 model = "MPC8349EMDS";
14 compatible = "MPC834xMDS"; 14 compatible = "MPC8349EMDS", "MPC834xMDS", "MPC83xxMDS";
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 17
18 cpus { 18 cpus {
19 #cpus = <1>;
20 #address-cells = <1>; 19 #address-cells = <1>;
21 #size-cells = <0>; 20 #size-cells = <0>;
22 21
@@ -64,7 +63,7 @@
64 compatible = "fsl-i2c"; 63 compatible = "fsl-i2c";
65 reg = <3000 100>; 64 reg = <3000 100>;
66 interrupts = <e 8>; 65 interrupts = <e 8>;
67 interrupt-parent = <700>; 66 interrupt-parent = < &ipic >;
68 dfsrr; 67 dfsrr;
69 }; 68 };
70 69
@@ -73,7 +72,7 @@
73 compatible = "fsl-i2c"; 72 compatible = "fsl-i2c";
74 reg = <3100 100>; 73 reg = <3100 100>;
75 interrupts = <f 8>; 74 interrupts = <f 8>;
76 interrupt-parent = <700>; 75 interrupt-parent = < &ipic >;
77 dfsrr; 76 dfsrr;
78 }; 77 };
79 78
@@ -82,7 +81,7 @@
82 compatible = "mpc83xx_spi"; 81 compatible = "mpc83xx_spi";
83 reg = <7000 1000>; 82 reg = <7000 1000>;
84 interrupts = <10 8>; 83 interrupts = <10 8>;
85 interrupt-parent = <700>; 84 interrupt-parent = < &ipic >;
86 mode = <0>; 85 mode = <0>;
87 }; 86 };
88 87
@@ -94,8 +93,8 @@
94 reg = <22000 1000>; 93 reg = <22000 1000>;
95 #address-cells = <1>; 94 #address-cells = <1>;
96 #size-cells = <0>; 95 #size-cells = <0>;
97 interrupt-parent = <700>; 96 interrupt-parent = < &ipic >;
98 interrupts = <27 2>; 97 interrupts = <27 8>;
99 phy_type = "ulpi"; 98 phy_type = "ulpi";
100 port1; 99 port1;
101 }; 100 };
@@ -106,8 +105,8 @@
106 reg = <23000 1000>; 105 reg = <23000 1000>;
107 #address-cells = <1>; 106 #address-cells = <1>;
108 #size-cells = <0>; 107 #size-cells = <0>;
109 interrupt-parent = <700>; 108 interrupt-parent = < &ipic >;
110 interrupts = <26 2>; 109 interrupts = <26 8>;
111 dr_mode = "otg"; 110 dr_mode = "otg";
112 phy_type = "ulpi"; 111 phy_type = "ulpi";
113 }; 112 };
@@ -118,18 +117,15 @@
118 reg = <24520 20>; 117 reg = <24520 20>;
119 #address-cells = <1>; 118 #address-cells = <1>;
120 #size-cells = <0>; 119 #size-cells = <0>;
121 linux,phandle = <24520>; 120 phy0: ethernet-phy@0 {
122 ethernet-phy@0 { 121 interrupt-parent = < &ipic >;
123 linux,phandle = <2452000>; 122 interrupts = <11 8>;
124 interrupt-parent = <700>;
125 interrupts = <11 2>;
126 reg = <0>; 123 reg = <0>;
127 device_type = "ethernet-phy"; 124 device_type = "ethernet-phy";
128 }; 125 };
129 ethernet-phy@1 { 126 phy1: ethernet-phy@1 {
130 linux,phandle = <2452001>; 127 interrupt-parent = < &ipic >;
131 interrupt-parent = <700>; 128 interrupts = <12 8>;
132 interrupts = <12 2>;
133 reg = <1>; 129 reg = <1>;
134 device_type = "ethernet-phy"; 130 device_type = "ethernet-phy";
135 }; 131 };
@@ -143,8 +139,8 @@
143 address = [ 00 00 00 00 00 00 ]; 139 address = [ 00 00 00 00 00 00 ];
144 local-mac-address = [ 00 00 00 00 00 00 ]; 140 local-mac-address = [ 00 00 00 00 00 00 ];
145 interrupts = <20 8 21 8 22 8>; 141 interrupts = <20 8 21 8 22 8>;
146 interrupt-parent = <700>; 142 interrupt-parent = < &ipic >;
147 phy-handle = <2452000>; 143 phy-handle = < &phy0 >;
148 }; 144 };
149 145
150 ethernet@25000 { 146 ethernet@25000 {
@@ -157,8 +153,8 @@
157 address = [ 00 00 00 00 00 00 ]; 153 address = [ 00 00 00 00 00 00 ];
158 local-mac-address = [ 00 00 00 00 00 00 ]; 154 local-mac-address = [ 00 00 00 00 00 00 ];
159 interrupts = <23 8 24 8 25 8>; 155 interrupts = <23 8 24 8 25 8>;
160 interrupt-parent = <700>; 156 interrupt-parent = < &ipic >;
161 phy-handle = <2452001>; 157 phy-handle = < &phy1 >;
162 }; 158 };
163 159
164 serial@4500 { 160 serial@4500 {
@@ -167,7 +163,7 @@
167 reg = <4500 100>; 163 reg = <4500 100>;
168 clock-frequency = <0>; 164 clock-frequency = <0>;
169 interrupts = <9 8>; 165 interrupts = <9 8>;
170 interrupt-parent = <700>; 166 interrupt-parent = < &ipic >;
171 }; 167 };
172 168
173 serial@4600 { 169 serial@4600 {
@@ -176,7 +172,7 @@
176 reg = <4600 100>; 172 reg = <4600 100>;
177 clock-frequency = <0>; 173 clock-frequency = <0>;
178 interrupts = <a 8>; 174 interrupts = <a 8>;
179 interrupt-parent = <700>; 175 interrupt-parent = < &ipic >;
180 }; 176 };
181 177
182 pci@8500 { 178 pci@8500 {
@@ -184,47 +180,47 @@
184 interrupt-map = < 180 interrupt-map = <
185 181
186 /* IDSEL 0x11 */ 182 /* IDSEL 0x11 */
187 8800 0 0 1 700 14 8 183 8800 0 0 1 &ipic 14 8
188 8800 0 0 2 700 15 8 184 8800 0 0 2 &ipic 15 8
189 8800 0 0 3 700 16 8 185 8800 0 0 3 &ipic 16 8
190 8800 0 0 4 700 17 8 186 8800 0 0 4 &ipic 17 8
191 187
192 /* IDSEL 0x12 */ 188 /* IDSEL 0x12 */
193 9000 0 0 1 700 16 8 189 9000 0 0 1 &ipic 16 8
194 9000 0 0 2 700 17 8 190 9000 0 0 2 &ipic 17 8
195 9000 0 0 3 700 14 8 191 9000 0 0 3 &ipic 14 8
196 9000 0 0 4 700 15 8 192 9000 0 0 4 &ipic 15 8
197 193
198 /* IDSEL 0x13 */ 194 /* IDSEL 0x13 */
199 9800 0 0 1 700 17 8 195 9800 0 0 1 &ipic 17 8
200 9800 0 0 2 700 14 8 196 9800 0 0 2 &ipic 14 8
201 9800 0 0 3 700 15 8 197 9800 0 0 3 &ipic 15 8
202 9800 0 0 4 700 16 8 198 9800 0 0 4 &ipic 16 8
203 199
204 /* IDSEL 0x15 */ 200 /* IDSEL 0x15 */
205 a800 0 0 1 700 14 8 201 a800 0 0 1 &ipic 14 8
206 a800 0 0 2 700 15 8 202 a800 0 0 2 &ipic 15 8
207 a800 0 0 3 700 16 8 203 a800 0 0 3 &ipic 16 8
208 a800 0 0 4 700 17 8 204 a800 0 0 4 &ipic 17 8
209 205
210 /* IDSEL 0x16 */ 206 /* IDSEL 0x16 */
211 b000 0 0 1 700 17 8 207 b000 0 0 1 &ipic 17 8
212 b000 0 0 2 700 14 8 208 b000 0 0 2 &ipic 14 8
213 b000 0 0 3 700 15 8 209 b000 0 0 3 &ipic 15 8
214 b000 0 0 4 700 16 8 210 b000 0 0 4 &ipic 16 8
215 211
216 /* IDSEL 0x17 */ 212 /* IDSEL 0x17 */
217 b800 0 0 1 700 16 8 213 b800 0 0 1 &ipic 16 8
218 b800 0 0 2 700 17 8 214 b800 0 0 2 &ipic 17 8
219 b800 0 0 3 700 14 8 215 b800 0 0 3 &ipic 14 8
220 b800 0 0 4 700 15 8 216 b800 0 0 4 &ipic 15 8
221 217
222 /* IDSEL 0x18 */ 218 /* IDSEL 0x18 */
223 c000 0 0 1 700 15 8 219 c000 0 0 1 &ipic 15 8
224 c000 0 0 2 700 16 8 220 c000 0 0 2 &ipic 16 8
225 c000 0 0 3 700 17 8 221 c000 0 0 3 &ipic 17 8
226 c000 0 0 4 700 14 8>; 222 c000 0 0 4 &ipic 14 8>;
227 interrupt-parent = <700>; 223 interrupt-parent = < &ipic >;
228 interrupts = <42 8>; 224 interrupts = <42 8>;
229 bus-range = <0 0>; 225 bus-range = <0 0>;
230 ranges = <02000000 0 a0000000 a0000000 0 10000000 226 ranges = <02000000 0 a0000000 a0000000 0 10000000
@@ -244,47 +240,47 @@
244 interrupt-map = < 240 interrupt-map = <
245 241
246 /* IDSEL 0x11 */ 242 /* IDSEL 0x11 */
247 8800 0 0 1 700 14 8 243 8800 0 0 1 &ipic 14 8
248 8800 0 0 2 700 15 8 244 8800 0 0 2 &ipic 15 8
249 8800 0 0 3 700 16 8 245 8800 0 0 3 &ipic 16 8
250 8800 0 0 4 700 17 8 246 8800 0 0 4 &ipic 17 8
251 247
252 /* IDSEL 0x12 */ 248 /* IDSEL 0x12 */
253 9000 0 0 1 700 16 8 249 9000 0 0 1 &ipic 16 8
254 9000 0 0 2 700 17 8 250 9000 0 0 2 &ipic 17 8
255 9000 0 0 3 700 14 8 251 9000 0 0 3 &ipic 14 8
256 9000 0 0 4 700 15 8 252 9000 0 0 4 &ipic 15 8
257 253
258 /* IDSEL 0x13 */ 254 /* IDSEL 0x13 */
259 9800 0 0 1 700 17 8 255 9800 0 0 1 &ipic 17 8
260 9800 0 0 2 700 14 8 256 9800 0 0 2 &ipic 14 8
261 9800 0 0 3 700 15 8 257 9800 0 0 3 &ipic 15 8
262 9800 0 0 4 700 16 8 258 9800 0 0 4 &ipic 16 8
263 259
264 /* IDSEL 0x15 */ 260 /* IDSEL 0x15 */
265 a800 0 0 1 700 14 8 261 a800 0 0 1 &ipic 14 8
266 a800 0 0 2 700 15 8 262 a800 0 0 2 &ipic 15 8
267 a800 0 0 3 700 16 8 263 a800 0 0 3 &ipic 16 8
268 a800 0 0 4 700 17 8 264 a800 0 0 4 &ipic 17 8
269 265
270 /* IDSEL 0x16 */ 266 /* IDSEL 0x16 */
271 b000 0 0 1 700 17 8 267 b000 0 0 1 &ipic 17 8
272 b000 0 0 2 700 14 8 268 b000 0 0 2 &ipic 14 8
273 b000 0 0 3 700 15 8 269 b000 0 0 3 &ipic 15 8
274 b000 0 0 4 700 16 8 270 b000 0 0 4 &ipic 16 8
275 271
276 /* IDSEL 0x17 */ 272 /* IDSEL 0x17 */
277 b800 0 0 1 700 16 8 273 b800 0 0 1 &ipic 16 8
278 b800 0 0 2 700 17 8 274 b800 0 0 2 &ipic 17 8
279 b800 0 0 3 700 14 8 275 b800 0 0 3 &ipic 14 8
280 b800 0 0 4 700 15 8 276 b800 0 0 4 &ipic 15 8
281 277
282 /* IDSEL 0x18 */ 278 /* IDSEL 0x18 */
283 c000 0 0 1 700 15 8 279 c000 0 0 1 &ipic 15 8
284 c000 0 0 2 700 16 8 280 c000 0 0 2 &ipic 16 8
285 c000 0 0 3 700 17 8 281 c000 0 0 3 &ipic 17 8
286 c000 0 0 4 700 14 8>; 282 c000 0 0 4 &ipic 14 8>;
287 interrupt-parent = <700>; 283 interrupt-parent = < &ipic >;
288 interrupts = <42 8>; 284 interrupts = <42 8>;
289 bus-range = <0 0>; 285 bus-range = <0 0>;
290 ranges = <02000000 0 b0000000 b0000000 0 10000000 286 ranges = <02000000 0 b0000000 b0000000 0 10000000
@@ -306,7 +302,7 @@
306 compatible = "talitos"; 302 compatible = "talitos";
307 reg = <30000 10000>; 303 reg = <30000 10000>;
308 interrupts = <b 8>; 304 interrupts = <b 8>;
309 interrupt-parent = <700>; 305 interrupt-parent = < &ipic >;
310 num-channels = <4>; 306 num-channels = <4>;
311 channel-fifo-len = <18>; 307 channel-fifo-len = <18>;
312 exec-units-mask = <0000007e>; 308 exec-units-mask = <0000007e>;
@@ -321,8 +317,7 @@
321 * sense == 8: Level, low assertion 317 * sense == 8: Level, low assertion
322 * sense == 2: Edge, high-to-low change 318 * sense == 2: Edge, high-to-low change
323 */ 319 */
324 pic@700 { 320 ipic: pic@700 {
325 linux,phandle = <700>;
326 interrupt-controller; 321 interrupt-controller;
327 #address-cells = <0>; 322 #address-cells = <0>;
328 #interrupt-cells = <2>; 323 #interrupt-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8360emds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 9022192155b9..7f578eb57082 100644
--- a/arch/powerpc/boot/dts/mpc8360emds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -15,17 +15,14 @@
15*/ 15*/
16 16
17/ { 17/ {
18 model = "MPC8360EPB"; 18 model = "MPC8360MDS";
19 compatible = "MPC83xx"; 19 compatible = "MPC8360EMDS", "MPC836xMDS", "MPC83xxMDS";
20 #address-cells = <1>; 20 #address-cells = <1>;
21 #size-cells = <1>; 21 #size-cells = <1>;
22 linux,phandle = <100>;
23 22
24 cpus { 23 cpus {
25 #cpus = <1>;
26 #address-cells = <1>; 24 #address-cells = <1>;
27 #size-cells = <0>; 25 #size-cells = <0>;
28 linux,phandle = <200>;
29 26
30 PowerPC,8360@0 { 27 PowerPC,8360@0 {
31 device_type = "cpu"; 28 device_type = "cpu";
@@ -38,14 +35,11 @@
38 bus-frequency = <FBC5200>; 35 bus-frequency = <FBC5200>;
39 clock-frequency = <1F78A400>; 36 clock-frequency = <1F78A400>;
40 32-bit; 37 32-bit;
41 linux,phandle = <201>;
42 linux,boot-cpu;
43 }; 38 };
44 }; 39 };
45 40
46 memory { 41 memory {
47 device_type = "memory"; 42 device_type = "memory";
48 linux,phandle = <300>;
49 reg = <00000000 10000000>; 43 reg = <00000000 10000000>;
50 }; 44 };
51 45
@@ -74,7 +68,7 @@
74 compatible = "fsl-i2c"; 68 compatible = "fsl-i2c";
75 reg = <3000 100>; 69 reg = <3000 100>;
76 interrupts = <e 8>; 70 interrupts = <e 8>;
77 interrupt-parent = <700>; 71 interrupt-parent = < &ipic >;
78 dfsrr; 72 dfsrr;
79 }; 73 };
80 74
@@ -83,7 +77,7 @@
83 compatible = "fsl-i2c"; 77 compatible = "fsl-i2c";
84 reg = <3100 100>; 78 reg = <3100 100>;
85 interrupts = <f 8>; 79 interrupts = <f 8>;
86 interrupt-parent = <700>; 80 interrupt-parent = < &ipic >;
87 dfsrr; 81 dfsrr;
88 }; 82 };
89 83
@@ -93,7 +87,7 @@
93 reg = <4500 100>; 87 reg = <4500 100>;
94 clock-frequency = <FBC5200>; 88 clock-frequency = <FBC5200>;
95 interrupts = <9 8>; 89 interrupts = <9 8>;
96 interrupt-parent = <700>; 90 interrupt-parent = < &ipic >;
97 }; 91 };
98 92
99 serial@4600 { 93 serial@4600 {
@@ -102,7 +96,7 @@
102 reg = <4600 100>; 96 reg = <4600 100>;
103 clock-frequency = <FBC5200>; 97 clock-frequency = <FBC5200>;
104 interrupts = <a 8>; 98 interrupts = <a 8>;
105 interrupt-parent = <700>; 99 interrupt-parent = < &ipic >;
106 }; 100 };
107 101
108 crypto@30000 { 102 crypto@30000 {
@@ -111,7 +105,7 @@
111 compatible = "talitos"; 105 compatible = "talitos";
112 reg = <30000 10000>; 106 reg = <30000 10000>;
113 interrupts = <b 8>; 107 interrupts = <b 8>;
114 interrupt-parent = <700>; 108 interrupt-parent = < &ipic >;
115 num-channels = <4>; 109 num-channels = <4>;
116 channel-fifo-len = <18>; 110 channel-fifo-len = <18>;
117 exec-units-mask = <0000007e>; 111 exec-units-mask = <0000007e>;
@@ -120,52 +114,51 @@
120 }; 114 };
121 115
122 pci@8500 { 116 pci@8500 {
123 linux,phandle = <8500>;
124 interrupt-map-mask = <f800 0 0 7>; 117 interrupt-map-mask = <f800 0 0 7>;
125 interrupt-map = < 118 interrupt-map = <
126 119
127 /* IDSEL 0x11 AD17 */ 120 /* IDSEL 0x11 AD17 */
128 8800 0 0 1 700 14 8 121 8800 0 0 1 &ipic 14 8
129 8800 0 0 2 700 15 8 122 8800 0 0 2 &ipic 15 8
130 8800 0 0 3 700 16 8 123 8800 0 0 3 &ipic 16 8
131 8800 0 0 4 700 17 8 124 8800 0 0 4 &ipic 17 8
132 125
133 /* IDSEL 0x12 AD18 */ 126 /* IDSEL 0x12 AD18 */
134 9000 0 0 1 700 16 8 127 9000 0 0 1 &ipic 16 8
135 9000 0 0 2 700 17 8 128 9000 0 0 2 &ipic 17 8
136 9000 0 0 3 700 14 8 129 9000 0 0 3 &ipic 14 8
137 9000 0 0 4 700 15 8 130 9000 0 0 4 &ipic 15 8
138 131
139 /* IDSEL 0x13 AD19 */ 132 /* IDSEL 0x13 AD19 */
140 9800 0 0 1 700 17 8 133 9800 0 0 1 &ipic 17 8
141 9800 0 0 2 700 14 8 134 9800 0 0 2 &ipic 14 8
142 9800 0 0 3 700 15 8 135 9800 0 0 3 &ipic 15 8
143 9800 0 0 4 700 16 8 136 9800 0 0 4 &ipic 16 8
144 137
145 /* IDSEL 0x15 AD21*/ 138 /* IDSEL 0x15 AD21*/
146 a800 0 0 1 700 14 8 139 a800 0 0 1 &ipic 14 8
147 a800 0 0 2 700 15 8 140 a800 0 0 2 &ipic 15 8
148 a800 0 0 3 700 16 8 141 a800 0 0 3 &ipic 16 8
149 a800 0 0 4 700 17 8 142 a800 0 0 4 &ipic 17 8
150 143
151 /* IDSEL 0x16 AD22*/ 144 /* IDSEL 0x16 AD22*/
152 b000 0 0 1 700 17 8 145 b000 0 0 1 &ipic 17 8
153 b000 0 0 2 700 14 8 146 b000 0 0 2 &ipic 14 8
154 b000 0 0 3 700 15 8 147 b000 0 0 3 &ipic 15 8
155 b000 0 0 4 700 16 8 148 b000 0 0 4 &ipic 16 8
156 149
157 /* IDSEL 0x17 AD23*/ 150 /* IDSEL 0x17 AD23*/
158 b800 0 0 1 700 16 8 151 b800 0 0 1 &ipic 16 8
159 b800 0 0 2 700 17 8 152 b800 0 0 2 &ipic 17 8
160 b800 0 0 3 700 14 8 153 b800 0 0 3 &ipic 14 8
161 b800 0 0 4 700 15 8 154 b800 0 0 4 &ipic 15 8
162 155
163 /* IDSEL 0x18 AD24*/ 156 /* IDSEL 0x18 AD24*/
164 c000 0 0 1 700 15 8 157 c000 0 0 1 &ipic 15 8
165 c000 0 0 2 700 16 8 158 c000 0 0 2 &ipic 16 8
166 c000 0 0 3 700 17 8 159 c000 0 0 3 &ipic 17 8
167 c000 0 0 4 700 14 8>; 160 c000 0 0 4 &ipic 14 8>;
168 interrupt-parent = <700>; 161 interrupt-parent = < &ipic >;
169 interrupts = <42 8>; 162 interrupts = <42 8>;
170 bus-range = <0 0>; 163 bus-range = <0 0>;
171 ranges = <02000000 0 a0000000 a0000000 0 10000000 164 ranges = <02000000 0 a0000000 a0000000 0 10000000
@@ -180,8 +173,7 @@
180 device_type = "pci"; 173 device_type = "pci";
181 }; 174 };
182 175
183 pic@700 { 176 ipic: pic@700 {
184 linux,phandle = <700>;
185 interrupt-controller; 177 interrupt-controller;
186 #address-cells = <0>; 178 #address-cells = <0>;
187 #interrupt-cells = <2>; 179 #interrupt-cells = <2>;
@@ -195,8 +187,7 @@
195 device_type = "par_io"; 187 device_type = "par_io";
196 num-ports = <7>; 188 num-ports = <7>;
197 189
198 ucc_pin@01 { 190 pio1: ucc_pin@01 {
199 linux,phandle = <140001>;
200 pio-map = < 191 pio-map = <
201 /* port pin dir open_drain assignment has_irq */ 192 /* port pin dir open_drain assignment has_irq */
202 0 3 1 0 1 0 /* TxD0 */ 193 0 3 1 0 1 0 /* TxD0 */
@@ -223,8 +214,7 @@
223 2 9 1 0 3 0 /* GTX_CLK - CLK10 */ 214 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
224 2 8 2 0 1 0>; /* GTX125 - CLK9 */ 215 2 8 2 0 1 0>; /* GTX125 - CLK9 */
225 }; 216 };
226 ucc_pin@02 { 217 pio2: ucc_pin@02 {
227 linux,phandle = <140002>;
228 pio-map = < 218 pio-map = <
229 /* port pin dir open_drain assignment has_irq */ 219 /* port pin dir open_drain assignment has_irq */
230 0 11 1 0 1 0 /* TxD0 */ 220 0 11 1 0 1 0 /* TxD0 */
@@ -281,7 +271,7 @@
281 compatible = "fsl_spi"; 271 compatible = "fsl_spi";
282 reg = <4c0 40>; 272 reg = <4c0 40>;
283 interrupts = <2>; 273 interrupts = <2>;
284 interrupt-parent = <80>; 274 interrupt-parent = < &qeic >;
285 mode = "cpu"; 275 mode = "cpu";
286 }; 276 };
287 277
@@ -290,7 +280,7 @@
290 compatible = "fsl_spi"; 280 compatible = "fsl_spi";
291 reg = <500 40>; 281 reg = <500 40>;
292 interrupts = <1>; 282 interrupts = <1>;
293 interrupt-parent = <80>; 283 interrupt-parent = < &qeic >;
294 mode = "cpu"; 284 mode = "cpu";
295 }; 285 };
296 286
@@ -299,7 +289,7 @@
299 compatible = "qe_udc"; 289 compatible = "qe_udc";
300 reg = <6c0 40 8B00 100>; 290 reg = <6c0 40 8B00 100>;
301 interrupts = <b>; 291 interrupts = <b>;
302 interrupt-parent = <80>; 292 interrupt-parent = < &qeic >;
303 mode = "slave"; 293 mode = "slave";
304 }; 294 };
305 295
@@ -310,12 +300,12 @@
310 device-id = <1>; 300 device-id = <1>;
311 reg = <2000 200>; 301 reg = <2000 200>;
312 interrupts = <20>; 302 interrupts = <20>;
313 interrupt-parent = <80>; 303 interrupt-parent = < &qeic >;
314 mac-address = [ 00 04 9f 00 23 23 ]; 304 mac-address = [ 00 04 9f 00 23 23 ];
315 rx-clock = <0>; 305 rx-clock = <0>;
316 tx-clock = <19>; 306 tx-clock = <19>;
317 phy-handle = <212000>; 307 phy-handle = < &phy0 >;
318 pio-handle = <140001>; 308 pio-handle = < &pio1 >;
319 }; 309 };
320 310
321 ucc@3000 { 311 ucc@3000 {
@@ -325,12 +315,12 @@
325 device-id = <2>; 315 device-id = <2>;
326 reg = <3000 200>; 316 reg = <3000 200>;
327 interrupts = <21>; 317 interrupts = <21>;
328 interrupt-parent = <80>; 318 interrupt-parent = < &qeic >;
329 mac-address = [ 00 11 22 33 44 55 ]; 319 mac-address = [ 00 11 22 33 44 55 ];
330 rx-clock = <0>; 320 rx-clock = <0>;
331 tx-clock = <14>; 321 tx-clock = <14>;
332 phy-handle = <212001>; 322 phy-handle = < &phy1 >;
333 pio-handle = <140002>; 323 pio-handle = < &pio2 >;
334 }; 324 };
335 325
336 mdio@2120 { 326 mdio@2120 {
@@ -340,26 +330,23 @@
340 device_type = "mdio"; 330 device_type = "mdio";
341 compatible = "ucc_geth_phy"; 331 compatible = "ucc_geth_phy";
342 332
343 ethernet-phy@00 { 333 phy0: ethernet-phy@00 {
344 linux,phandle = <212000>; 334 interrupt-parent = < &ipic >;
345 interrupt-parent = <700>; 335 interrupts = <11 8>;
346 interrupts = <11 2>;
347 reg = <0>; 336 reg = <0>;
348 device_type = "ethernet-phy"; 337 device_type = "ethernet-phy";
349 interface = <6>; //ENET_1000_GMII 338 interface = <6>; //ENET_1000_GMII
350 }; 339 };
351 ethernet-phy@01 { 340 phy1: ethernet-phy@01 {
352 linux,phandle = <212001>; 341 interrupt-parent = < &ipic >;
353 interrupt-parent = <700>; 342 interrupts = <12 8>;
354 interrupts = <12 2>;
355 reg = <1>; 343 reg = <1>;
356 device_type = "ethernet-phy"; 344 device_type = "ethernet-phy";
357 interface = <6>; 345 interface = <6>;
358 }; 346 };
359 }; 347 };
360 348
361 qeic@80 { 349 qeic: qeic@80 {
362 linux,phandle = <80>;
363 interrupt-controller; 350 interrupt-controller;
364 device_type = "qeic"; 351 device_type = "qeic";
365 #address-cells = <0>; 352 #address-cells = <0>;
@@ -368,7 +355,7 @@
368 built-in; 355 built-in;
369 big-endian; 356 big-endian;
370 interrupts = <20 8 21 8>; //high:32 low:33 357 interrupts = <20 8 21 8>; //high:32 low:33
371 interrupt-parent = <700>; 358 interrupt-parent = < &ipic >;
372 }; 359 };
373 360
374 }; 361 };
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index 5f41c1f7a5f3..f261d647ac85 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -12,16 +12,13 @@
12 12
13/ { 13/ {
14 model = "MPC8540ADS"; 14 model = "MPC8540ADS";
15 compatible = "MPC85xxADS"; 15 compatible = "MPC8540ADS", "MPC85xxADS";
16 #address-cells = <1>; 16 #address-cells = <1>;
17 #size-cells = <1>; 17 #size-cells = <1>;
18 linux,phandle = <100>;
19 18
20 cpus { 19 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 20 #address-cells = <1>;
23 #size-cells = <0>; 21 #size-cells = <0>;
24 linux,phandle = <200>;
25 22
26 PowerPC,8540@0 { 23 PowerPC,8540@0 {
27 device_type = "cpu"; 24 device_type = "cpu";
@@ -34,13 +31,11 @@
34 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
35 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
36 32-bit; 33 32-bit;
37 linux,phandle = <201>;
38 }; 34 };
39 }; 35 };
40 36
41 memory { 37 memory {
42 device_type = "memory"; 38 device_type = "memory";
43 linux,phandle = <300>;
44 reg = <00000000 08000000>; // 128M at 0x0 39 reg = <00000000 08000000>; // 128M at 0x0
45 }; 40 };
46 41
@@ -58,7 +53,7 @@
58 compatible = "fsl-i2c"; 53 compatible = "fsl-i2c";
59 reg = <3000 100>; 54 reg = <3000 100>;
60 interrupts = <1b 2>; 55 interrupts = <1b 2>;
61 interrupt-parent = <40000>; 56 interrupt-parent = <&mpic>;
62 dfsrr; 57 dfsrr;
63 }; 58 };
64 59
@@ -68,24 +63,20 @@
68 device_type = "mdio"; 63 device_type = "mdio";
69 compatible = "gianfar"; 64 compatible = "gianfar";
70 reg = <24520 20>; 65 reg = <24520 20>;
71 linux,phandle = <24520>; 66 phy0: ethernet-phy@0 {
72 ethernet-phy@0 { 67 interrupt-parent = <&mpic>;
73 linux,phandle = <2452000>;
74 interrupt-parent = <40000>;
75 interrupts = <35 1>; 68 interrupts = <35 1>;
76 reg = <0>; 69 reg = <0>;
77 device_type = "ethernet-phy"; 70 device_type = "ethernet-phy";
78 }; 71 };
79 ethernet-phy@1 { 72 phy1: ethernet-phy@1 {
80 linux,phandle = <2452001>; 73 interrupt-parent = <&mpic>;
81 interrupt-parent = <40000>;
82 interrupts = <35 1>; 74 interrupts = <35 1>;
83 reg = <1>; 75 reg = <1>;
84 device_type = "ethernet-phy"; 76 device_type = "ethernet-phy";
85 }; 77 };
86 ethernet-phy@3 { 78 phy3: ethernet-phy@3 {
87 linux,phandle = <2452003>; 79 interrupt-parent = <&mpic>;
88 interrupt-parent = <40000>;
89 interrupts = <37 1>; 80 interrupts = <37 1>;
90 reg = <3>; 81 reg = <3>;
91 device_type = "ethernet-phy"; 82 device_type = "ethernet-phy";
@@ -102,8 +93,8 @@
102 address = [ 00 E0 0C 00 73 00 ]; 93 address = [ 00 E0 0C 00 73 00 ];
103 local-mac-address = [ 00 E0 0C 00 73 00 ]; 94 local-mac-address = [ 00 E0 0C 00 73 00 ];
104 interrupts = <d 2 e 2 12 2>; 95 interrupts = <d 2 e 2 12 2>;
105 interrupt-parent = <40000>; 96 interrupt-parent = <&mpic>;
106 phy-handle = <2452000>; 97 phy-handle = <&phy0>;
107 }; 98 };
108 99
109 ethernet@25000 { 100 ethernet@25000 {
@@ -116,8 +107,8 @@
116 address = [ 00 E0 0C 00 73 01 ]; 107 address = [ 00 E0 0C 00 73 01 ];
117 local-mac-address = [ 00 E0 0C 00 73 01 ]; 108 local-mac-address = [ 00 E0 0C 00 73 01 ];
118 interrupts = <13 2 14 2 18 2>; 109 interrupts = <13 2 14 2 18 2>;
119 interrupt-parent = <40000>; 110 interrupt-parent = <&mpic>;
120 phy-handle = <2452001>; 111 phy-handle = <&phy1>;
121 }; 112 };
122 113
123 ethernet@26000 { 114 ethernet@26000 {
@@ -130,8 +121,8 @@
130 address = [ 00 E0 0C 00 73 02 ]; 121 address = [ 00 E0 0C 00 73 02 ];
131 local-mac-address = [ 00 E0 0C 00 73 02 ]; 122 local-mac-address = [ 00 E0 0C 00 73 02 ];
132 interrupts = <19 2>; 123 interrupts = <19 2>;
133 interrupt-parent = <40000>; 124 interrupt-parent = <&mpic>;
134 phy-handle = <2452003>; 125 phy-handle = <&phy3>;
135 }; 126 };
136 127
137 serial@4500 { 128 serial@4500 {
@@ -140,7 +131,7 @@
140 reg = <4500 100>; // reg base, size 131 reg = <4500 100>; // reg base, size
141 clock-frequency = <0>; // should we fill in in uboot? 132 clock-frequency = <0>; // should we fill in in uboot?
142 interrupts = <1a 2>; 133 interrupts = <1a 2>;
143 interrupt-parent = <40000>; 134 interrupt-parent = <&mpic>;
144 }; 135 };
145 136
146 serial@4600 { 137 serial@4600 {
@@ -149,85 +140,84 @@
149 reg = <4600 100>; // reg base, size 140 reg = <4600 100>; // reg base, size
150 clock-frequency = <0>; // should we fill in in uboot? 141 clock-frequency = <0>; // should we fill in in uboot?
151 interrupts = <1a 2>; 142 interrupts = <1a 2>;
152 interrupt-parent = <40000>; 143 interrupt-parent = <&mpic>;
153 }; 144 };
154 pci@8000 { 145 pci@8000 {
155 linux,phandle = <8000>;
156 interrupt-map-mask = <f800 0 0 7>; 146 interrupt-map-mask = <f800 0 0 7>;
157 interrupt-map = < 147 interrupt-map = <
158 148
159 /* IDSEL 0x02 */ 149 /* IDSEL 0x02 */
160 1000 0 0 1 40000 31 1 150 1000 0 0 1 &mpic 31 1
161 1000 0 0 2 40000 32 1 151 1000 0 0 2 &mpic 32 1
162 1000 0 0 3 40000 33 1 152 1000 0 0 3 &mpic 33 1
163 1000 0 0 4 40000 34 1 153 1000 0 0 4 &mpic 34 1
164 154
165 /* IDSEL 0x03 */ 155 /* IDSEL 0x03 */
166 1800 0 0 1 40000 34 1 156 1800 0 0 1 &mpic 34 1
167 1800 0 0 2 40000 31 1 157 1800 0 0 2 &mpic 31 1
168 1800 0 0 3 40000 32 1 158 1800 0 0 3 &mpic 32 1
169 1800 0 0 4 40000 33 1 159 1800 0 0 4 &mpic 33 1
170 160
171 /* IDSEL 0x04 */ 161 /* IDSEL 0x04 */
172 2000 0 0 1 40000 33 1 162 2000 0 0 1 &mpic 33 1
173 2000 0 0 2 40000 34 1 163 2000 0 0 2 &mpic 34 1
174 2000 0 0 3 40000 31 1 164 2000 0 0 3 &mpic 31 1
175 2000 0 0 4 40000 32 1 165 2000 0 0 4 &mpic 32 1
176 166
177 /* IDSEL 0x05 */ 167 /* IDSEL 0x05 */
178 2800 0 0 1 40000 32 1 168 2800 0 0 1 &mpic 32 1
179 2800 0 0 2 40000 33 1 169 2800 0 0 2 &mpic 33 1
180 2800 0 0 3 40000 34 1 170 2800 0 0 3 &mpic 34 1
181 2800 0 0 4 40000 31 1 171 2800 0 0 4 &mpic 31 1
182 172
183 /* IDSEL 0x0c */ 173 /* IDSEL 0x0c */
184 6000 0 0 1 40000 31 1 174 6000 0 0 1 &mpic 31 1
185 6000 0 0 2 40000 32 1 175 6000 0 0 2 &mpic 32 1
186 6000 0 0 3 40000 33 1 176 6000 0 0 3 &mpic 33 1
187 6000 0 0 4 40000 34 1 177 6000 0 0 4 &mpic 34 1
188 178
189 /* IDSEL 0x0d */ 179 /* IDSEL 0x0d */
190 6800 0 0 1 40000 34 1 180 6800 0 0 1 &mpic 34 1
191 6800 0 0 2 40000 31 1 181 6800 0 0 2 &mpic 31 1
192 6800 0 0 3 40000 32 1 182 6800 0 0 3 &mpic 32 1
193 6800 0 0 4 40000 33 1 183 6800 0 0 4 &mpic 33 1
194 184
195 /* IDSEL 0x0e */ 185 /* IDSEL 0x0e */
196 7000 0 0 1 40000 33 1 186 7000 0 0 1 &mpic 33 1
197 7000 0 0 2 40000 34 1 187 7000 0 0 2 &mpic 34 1
198 7000 0 0 3 40000 31 1 188 7000 0 0 3 &mpic 31 1
199 7000 0 0 4 40000 32 1 189 7000 0 0 4 &mpic 32 1
200 190
201 /* IDSEL 0x0f */ 191 /* IDSEL 0x0f */
202 7800 0 0 1 40000 32 1 192 7800 0 0 1 &mpic 32 1
203 7800 0 0 2 40000 33 1 193 7800 0 0 2 &mpic 33 1
204 7800 0 0 3 40000 34 1 194 7800 0 0 3 &mpic 34 1
205 7800 0 0 4 40000 31 1 195 7800 0 0 4 &mpic 31 1
206 196
207 /* IDSEL 0x12 */ 197 /* IDSEL 0x12 */
208 9000 0 0 1 40000 31 1 198 9000 0 0 1 &mpic 31 1
209 9000 0 0 2 40000 32 1 199 9000 0 0 2 &mpic 32 1
210 9000 0 0 3 40000 33 1 200 9000 0 0 3 &mpic 33 1
211 9000 0 0 4 40000 34 1 201 9000 0 0 4 &mpic 34 1
212 202
213 /* IDSEL 0x13 */ 203 /* IDSEL 0x13 */
214 9800 0 0 1 40000 34 1 204 9800 0 0 1 &mpic 34 1
215 9800 0 0 2 40000 31 1 205 9800 0 0 2 &mpic 31 1
216 9800 0 0 3 40000 32 1 206 9800 0 0 3 &mpic 32 1
217 9800 0 0 4 40000 33 1 207 9800 0 0 4 &mpic 33 1
218 208
219 /* IDSEL 0x14 */ 209 /* IDSEL 0x14 */
220 a000 0 0 1 40000 33 1 210 a000 0 0 1 &mpic 33 1
221 a000 0 0 2 40000 34 1 211 a000 0 0 2 &mpic 34 1
222 a000 0 0 3 40000 31 1 212 a000 0 0 3 &mpic 31 1
223 a000 0 0 4 40000 32 1 213 a000 0 0 4 &mpic 32 1
224 214
225 /* IDSEL 0x15 */ 215 /* IDSEL 0x15 */
226 a800 0 0 1 40000 32 1 216 a800 0 0 1 &mpic 32 1
227 a800 0 0 2 40000 33 1 217 a800 0 0 2 &mpic 33 1
228 a800 0 0 3 40000 34 1 218 a800 0 0 3 &mpic 34 1
229 a800 0 0 4 40000 31 1>; 219 a800 0 0 4 &mpic 31 1>;
230 interrupt-parent = <40000>; 220 interrupt-parent = <&mpic>;
231 interrupts = <08 2>; 221 interrupts = <08 2>;
232 bus-range = <0 0>; 222 bus-range = <0 0>;
233 ranges = <02000000 0 80000000 80000000 0 20000000 223 ranges = <02000000 0 80000000 80000000 0 20000000
@@ -241,8 +231,7 @@
241 device_type = "pci"; 231 device_type = "pci";
242 }; 232 };
243 233
244 pic@40000 { 234 mpic: pic@40000 {
245 linux,phandle = <40000>;
246 clock-frequency = <0>; 235 clock-frequency = <0>;
247 interrupt-controller; 236 interrupt-controller;
248 #address-cells = <0>; 237 #address-cells = <0>;
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index 7be0bc659e1c..5fdcb69554f2 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -12,16 +12,13 @@
12 12
13/ { 13/ {
14 model = "MPC8541CDS"; 14 model = "MPC8541CDS";
15 compatible = "MPC85xxCDS"; 15 compatible = "MPC8541CDS", "MPC85xxCDS";
16 #address-cells = <1>; 16 #address-cells = <1>;
17 #size-cells = <1>; 17 #size-cells = <1>;
18 linux,phandle = <100>;
19 18
20 cpus { 19 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 20 #address-cells = <1>;
23 #size-cells = <0>; 21 #size-cells = <0>;
24 linux,phandle = <200>;
25 22
26 PowerPC,8541@0 { 23 PowerPC,8541@0 {
27 device_type = "cpu"; 24 device_type = "cpu";
@@ -34,13 +31,11 @@
34 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
35 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
36 32-bit; 33 32-bit;
37 linux,phandle = <201>;
38 }; 34 };
39 }; 35 };
40 36
41 memory { 37 memory {
42 device_type = "memory"; 38 device_type = "memory";
43 linux,phandle = <300>;
44 reg = <00000000 08000000>; // 128M at 0x0 39 reg = <00000000 08000000>; // 128M at 0x0
45 }; 40 };
46 41
@@ -58,7 +53,7 @@
58 compatible = "fsl-i2c"; 53 compatible = "fsl-i2c";
59 reg = <3000 100>; 54 reg = <3000 100>;
60 interrupts = <1b 2>; 55 interrupts = <1b 2>;
61 interrupt-parent = <40000>; 56 interrupt-parent = <&mpic>;
62 dfsrr; 57 dfsrr;
63 }; 58 };
64 59
@@ -68,17 +63,14 @@
68 device_type = "mdio"; 63 device_type = "mdio";
69 compatible = "gianfar"; 64 compatible = "gianfar";
70 reg = <24520 20>; 65 reg = <24520 20>;
71 linux,phandle = <24520>; 66 phy0: ethernet-phy@0 {
72 ethernet-phy@0 { 67 interrupt-parent = <&mpic>;
73 linux,phandle = <2452000>;
74 interrupt-parent = <40000>;
75 interrupts = <35 0>; 68 interrupts = <35 0>;
76 reg = <0>; 69 reg = <0>;
77 device_type = "ethernet-phy"; 70 device_type = "ethernet-phy";
78 }; 71 };
79 ethernet-phy@1 { 72 phy1: ethernet-phy@1 {
80 linux,phandle = <2452001>; 73 interrupt-parent = <&mpic>;
81 interrupt-parent = <40000>;
82 interrupts = <35 0>; 74 interrupts = <35 0>;
83 reg = <1>; 75 reg = <1>;
84 device_type = "ethernet-phy"; 76 device_type = "ethernet-phy";
@@ -94,8 +86,8 @@
94 reg = <24000 1000>; 86 reg = <24000 1000>;
95 local-mac-address = [ 00 E0 0C 00 73 00 ]; 87 local-mac-address = [ 00 E0 0C 00 73 00 ];
96 interrupts = <d 2 e 2 12 2>; 88 interrupts = <d 2 e 2 12 2>;
97 interrupt-parent = <40000>; 89 interrupt-parent = <&mpic>;
98 phy-handle = <2452000>; 90 phy-handle = <&phy0>;
99 }; 91 };
100 92
101 ethernet@25000 { 93 ethernet@25000 {
@@ -107,8 +99,8 @@
107 reg = <25000 1000>; 99 reg = <25000 1000>;
108 local-mac-address = [ 00 E0 0C 00 73 01 ]; 100 local-mac-address = [ 00 E0 0C 00 73 01 ];
109 interrupts = <13 2 14 2 18 2>; 101 interrupts = <13 2 14 2 18 2>;
110 interrupt-parent = <40000>; 102 interrupt-parent = <&mpic>;
111 phy-handle = <2452001>; 103 phy-handle = <&phy1>;
112 }; 104 };
113 105
114 serial@4500 { 106 serial@4500 {
@@ -117,7 +109,7 @@
117 reg = <4500 100>; // reg base, size 109 reg = <4500 100>; // reg base, size
118 clock-frequency = <0>; // should we fill in in uboot? 110 clock-frequency = <0>; // should we fill in in uboot?
119 interrupts = <1a 2>; 111 interrupts = <1a 2>;
120 interrupt-parent = <40000>; 112 interrupt-parent = <&mpic>;
121 }; 113 };
122 114
123 serial@4600 { 115 serial@4600 {
@@ -126,57 +118,56 @@
126 reg = <4600 100>; // reg base, size 118 reg = <4600 100>; // reg base, size
127 clock-frequency = <0>; // should we fill in in uboot? 119 clock-frequency = <0>; // should we fill in in uboot?
128 interrupts = <1a 2>; 120 interrupts = <1a 2>;
129 interrupt-parent = <40000>; 121 interrupt-parent = <&mpic>;
130 }; 122 };
131 123
132 pci@8000 { 124 pci1: pci@8000 {
133 linux,phandle = <8000>;
134 interrupt-map-mask = <1f800 0 0 7>; 125 interrupt-map-mask = <1f800 0 0 7>;
135 interrupt-map = < 126 interrupt-map = <
136 127
137 /* IDSEL 0x10 */ 128 /* IDSEL 0x10 */
138 08000 0 0 1 40000 30 1 129 08000 0 0 1 &mpic 30 1
139 08000 0 0 2 40000 31 1 130 08000 0 0 2 &mpic 31 1
140 08000 0 0 3 40000 32 1 131 08000 0 0 3 &mpic 32 1
141 08000 0 0 4 40000 33 1 132 08000 0 0 4 &mpic 33 1
142 133
143 /* IDSEL 0x11 */ 134 /* IDSEL 0x11 */
144 08800 0 0 1 40000 30 1 135 08800 0 0 1 &mpic 30 1
145 08800 0 0 2 40000 31 1 136 08800 0 0 2 &mpic 31 1
146 08800 0 0 3 40000 32 1 137 08800 0 0 3 &mpic 32 1
147 08800 0 0 4 40000 33 1 138 08800 0 0 4 &mpic 33 1
148 139
149 /* IDSEL 0x12 (Slot 1) */ 140 /* IDSEL 0x12 (Slot 1) */
150 09000 0 0 1 40000 30 1 141 09000 0 0 1 &mpic 30 1
151 09000 0 0 2 40000 31 1 142 09000 0 0 2 &mpic 31 1
152 09000 0 0 3 40000 32 1 143 09000 0 0 3 &mpic 32 1
153 09000 0 0 4 40000 33 1 144 09000 0 0 4 &mpic 33 1
154 145
155 /* IDSEL 0x13 (Slot 2) */ 146 /* IDSEL 0x13 (Slot 2) */
156 09800 0 0 1 40000 31 1 147 09800 0 0 1 &mpic 31 1
157 09800 0 0 2 40000 32 1 148 09800 0 0 2 &mpic 32 1
158 09800 0 0 3 40000 33 1 149 09800 0 0 3 &mpic 33 1
159 09800 0 0 4 40000 30 1 150 09800 0 0 4 &mpic 30 1
160 151
161 /* IDSEL 0x14 (Slot 3) */ 152 /* IDSEL 0x14 (Slot 3) */
162 0a000 0 0 1 40000 32 1 153 0a000 0 0 1 &mpic 32 1
163 0a000 0 0 2 40000 33 1 154 0a000 0 0 2 &mpic 33 1
164 0a000 0 0 3 40000 30 1 155 0a000 0 0 3 &mpic 30 1
165 0a000 0 0 4 40000 31 1 156 0a000 0 0 4 &mpic 31 1
166 157
167 /* IDSEL 0x15 (Slot 4) */ 158 /* IDSEL 0x15 (Slot 4) */
168 0a800 0 0 1 40000 33 1 159 0a800 0 0 1 &mpic 33 1
169 0a800 0 0 2 40000 30 1 160 0a800 0 0 2 &mpic 30 1
170 0a800 0 0 3 40000 31 1 161 0a800 0 0 3 &mpic 31 1
171 0a800 0 0 4 40000 32 1 162 0a800 0 0 4 &mpic 32 1
172 163
173 /* Bus 1 (Tundra Bridge) */ 164 /* Bus 1 (Tundra Bridge) */
174 /* IDSEL 0x12 (ISA bridge) */ 165 /* IDSEL 0x12 (ISA bridge) */
175 19000 0 0 1 40000 30 1 166 19000 0 0 1 &mpic 30 1
176 19000 0 0 2 40000 31 1 167 19000 0 0 2 &mpic 31 1
177 19000 0 0 3 40000 32 1 168 19000 0 0 3 &mpic 32 1
178 19000 0 0 4 40000 33 1>; 169 19000 0 0 4 &mpic 33 1>;
179 interrupt-parent = <40000>; 170 interrupt-parent = <&mpic>;
180 interrupts = <08 2>; 171 interrupts = <08 2>;
181 bus-range = <0 0>; 172 bus-range = <0 0>;
182 ranges = <02000000 0 80000000 80000000 0 20000000 173 ranges = <02000000 0 80000000 80000000 0 20000000
@@ -200,21 +191,20 @@
200 compatible = "chrp,iic"; 191 compatible = "chrp,iic";
201 big-endian; 192 big-endian;
202 interrupts = <1>; 193 interrupts = <1>;
203 interrupt-parent = <8000>; 194 interrupt-parent = <&pci1>;
204 }; 195 };
205 }; 196 };
206 197
207 pci@9000 { 198 pci@9000 {
208 linux,phandle = <9000>;
209 interrupt-map-mask = <f800 0 0 7>; 199 interrupt-map-mask = <f800 0 0 7>;
210 interrupt-map = < 200 interrupt-map = <
211 201
212 /* IDSEL 0x15 */ 202 /* IDSEL 0x15 */
213 a800 0 0 1 40000 3b 1 203 a800 0 0 1 &mpic 3b 1
214 a800 0 0 2 40000 3b 1 204 a800 0 0 2 &mpic 3b 1
215 a800 0 0 3 40000 3b 1 205 a800 0 0 3 &mpic 3b 1
216 a800 0 0 4 40000 3b 1>; 206 a800 0 0 4 &mpic 3b 1>;
217 interrupt-parent = <40000>; 207 interrupt-parent = <&mpic>;
218 interrupts = <09 2>; 208 interrupts = <09 2>;
219 bus-range = <0 0>; 209 bus-range = <0 0>;
220 ranges = <02000000 0 a0000000 a0000000 0 20000000 210 ranges = <02000000 0 a0000000 a0000000 0 20000000
@@ -228,8 +218,7 @@
228 device_type = "pci"; 218 device_type = "pci";
229 }; 219 };
230 220
231 pic@40000 { 221 mpic: pic@40000 {
232 linux,phandle = <40000>;
233 clock-frequency = <0>; 222 clock-frequency = <0>;
234 interrupt-controller; 223 interrupt-controller;
235 #address-cells = <0>; 224 #address-cells = <0>;
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
new file mode 100644
index 000000000000..6b084605bb4b
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -0,0 +1,136 @@
1/*
2 * MPC8544 DS Device Tree Source
3 *
4 * Copyright 2007 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/ {
13 model = "MPC8544DS";
14 compatible = "MPC8544DS", "MPC85xxDS";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 cpus {
19 #cpus = <1>;
20 #address-cells = <1>;
21 #size-cells = <0>;
22
23 PowerPC,8544@0 {
24 device_type = "cpu";
25 reg = <0>;
26 d-cache-line-size = <20>; // 32 bytes
27 i-cache-line-size = <20>; // 32 bytes
28 d-cache-size = <8000>; // L1, 32K
29 i-cache-size = <8000>; // L1, 32K
30 timebase-frequency = <0>;
31 bus-frequency = <0>;
32 clock-frequency = <0>;
33 32-bit;
34 };
35 };
36
37 memory {
38 device_type = "memory";
39 reg = <00000000 00000000>; // Filled by U-Boot
40 };
41
42 soc8544@e0000000 {
43 #address-cells = <1>;
44 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc";
47 ranges = <0 e0000000 00100000>;
48 reg = <e0000000 00100000>; // CCSRBAR 1M
49 bus-frequency = <0>; // Filled out by uboot.
50
51 i2c@3000 {
52 device_type = "i2c";
53 compatible = "fsl-i2c";
54 reg = <3000 100>;
55 interrupts = <1b 2>;
56 interrupt-parent = <&mpic>;
57 dfsrr;
58 };
59
60 mdio@24520 {
61 #address-cells = <1>;
62 #size-cells = <0>;
63 device_type = "mdio";
64 compatible = "gianfar";
65 reg = <24520 20>;
66 phy0: ethernet-phy@0 {
67 interrupt-parent = <&mpic>;
68 interrupts = <3a 1>;
69 reg = <0>;
70 device_type = "ethernet-phy";
71 };
72 phy1: ethernet-phy@1 {
73 interrupt-parent = <&mpic>;
74 interrupts = <3a 1>;
75 reg = <1>;
76 device_type = "ethernet-phy";
77 };
78 };
79
80 ethernet@24000 {
81 #address-cells = <1>;
82 #size-cells = <0>;
83 device_type = "network";
84 model = "TSEC";
85 compatible = "gianfar";
86 reg = <24000 1000>;
87 local-mac-address = [ 00 00 00 00 00 00 ];
88 interrupts = <d 2 e 2 12 2>;
89 interrupt-parent = <&mpic>;
90 phy-handle = <&phy0>;
91 };
92
93 ethernet@26000 {
94 #address-cells = <1>;
95 #size-cells = <0>;
96 device_type = "network";
97 model = "TSEC";
98 compatible = "gianfar";
99 reg = <26000 1000>;
100 local-mac-address = [ 00 00 00 00 00 00 ];
101 interrupts = <f 2 10 2 11 2>;
102 interrupt-parent = <&mpic>;
103 phy-handle = <&phy1>;
104 };
105
106 serial@4500 {
107 device_type = "serial";
108 compatible = "ns16550";
109 reg = <4500 100>;
110 clock-frequency = <0>;
111 interrupts = <1a 2>;
112 interrupt-parent = <&mpic>;
113 };
114
115 serial@4600 {
116 device_type = "serial";
117 compatible = "ns16550";
118 reg = <4600 100>;
119 clock-frequency = <0>;
120 interrupts = <1a 2>;
121 interrupt-parent = <&mpic>;
122 };
123
124 mpic: pic@40000 {
125 clock-frequency = <0>;
126 interrupt-controller;
127 #address-cells = <0>;
128 #interrupt-cells = <2>;
129 reg = <40000 40000>;
130 built-in;
131 compatible = "chrp,open-pic";
132 device_type = "open-pic";
133 big-endian;
134 };
135 };
136};
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 893d7957c174..b2b2200d0425 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -12,16 +12,13 @@
12 12
13/ { 13/ {
14 model = "MPC8548CDS"; 14 model = "MPC8548CDS";
15 compatible = "MPC85xxCDS"; 15 compatible = "MPC8548CDS", "MPC85xxCDS";
16 #address-cells = <1>; 16 #address-cells = <1>;
17 #size-cells = <1>; 17 #size-cells = <1>;
18 linux,phandle = <100>;
19 18
20 cpus { 19 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 20 #address-cells = <1>;
23 #size-cells = <0>; 21 #size-cells = <0>;
24 linux,phandle = <200>;
25 22
26 PowerPC,8548@0 { 23 PowerPC,8548@0 {
27 device_type = "cpu"; 24 device_type = "cpu";
@@ -34,13 +31,11 @@
34 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
35 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
36 32-bit; 33 32-bit;
37 linux,phandle = <201>;
38 }; 34 };
39 }; 35 };
40 36
41 memory { 37 memory {
42 device_type = "memory"; 38 device_type = "memory";
43 linux,phandle = <300>;
44 reg = <00000000 08000000>; // 128M at 0x0 39 reg = <00000000 08000000>; // 128M at 0x0
45 }; 40 };
46 41
@@ -58,7 +53,7 @@
58 compatible = "fsl-i2c"; 53 compatible = "fsl-i2c";
59 reg = <3000 100>; 54 reg = <3000 100>;
60 interrupts = <1b 2>; 55 interrupts = <1b 2>;
61 interrupt-parent = <40000>; 56 interrupt-parent = <&mpic>;
62 dfsrr; 57 dfsrr;
63 }; 58 };
64 59
@@ -68,32 +63,26 @@
68 device_type = "mdio"; 63 device_type = "mdio";
69 compatible = "gianfar"; 64 compatible = "gianfar";
70 reg = <24520 20>; 65 reg = <24520 20>;
71 linux,phandle = <24520>; 66 phy0: ethernet-phy@0 {
72 ethernet-phy@0 { 67 interrupt-parent = <&mpic>;
73 linux,phandle = <2452000>;
74 interrupt-parent = <40000>;
75 interrupts = <35 0>; 68 interrupts = <35 0>;
76 reg = <0>; 69 reg = <0>;
77 device_type = "ethernet-phy"; 70 device_type = "ethernet-phy";
78 }; 71 };
79 ethernet-phy@1 { 72 phy1: ethernet-phy@1 {
80 linux,phandle = <2452001>; 73 interrupt-parent = <&mpic>;
81 interrupt-parent = <40000>;
82 interrupts = <35 0>; 74 interrupts = <35 0>;
83 reg = <1>; 75 reg = <1>;
84 device_type = "ethernet-phy"; 76 device_type = "ethernet-phy";
85 }; 77 };
86 78 phy2: ethernet-phy@2 {
87 ethernet-phy@2 { 79 interrupt-parent = <&mpic>;
88 linux,phandle = <2452002>;
89 interrupt-parent = <40000>;
90 interrupts = <35 0>; 80 interrupts = <35 0>;
91 reg = <2>; 81 reg = <2>;
92 device_type = "ethernet-phy"; 82 device_type = "ethernet-phy";
93 }; 83 };
94 ethernet-phy@3 { 84 phy3: ethernet-phy@3 {
95 linux,phandle = <2452003>; 85 interrupt-parent = <&mpic>;
96 interrupt-parent = <40000>;
97 interrupts = <35 0>; 86 interrupts = <35 0>;
98 reg = <3>; 87 reg = <3>;
99 device_type = "ethernet-phy"; 88 device_type = "ethernet-phy";
@@ -109,8 +98,8 @@
109 reg = <24000 1000>; 98 reg = <24000 1000>;
110 local-mac-address = [ 00 E0 0C 00 73 00 ]; 99 local-mac-address = [ 00 E0 0C 00 73 00 ];
111 interrupts = <d 2 e 2 12 2>; 100 interrupts = <d 2 e 2 12 2>;
112 interrupt-parent = <40000>; 101 interrupt-parent = <&mpic>;
113 phy-handle = <2452000>; 102 phy-handle = <&phy0>;
114 }; 103 };
115 104
116 ethernet@25000 { 105 ethernet@25000 {
@@ -122,10 +111,11 @@
122 reg = <25000 1000>; 111 reg = <25000 1000>;
123 local-mac-address = [ 00 E0 0C 00 73 01 ]; 112 local-mac-address = [ 00 E0 0C 00 73 01 ];
124 interrupts = <13 2 14 2 18 2>; 113 interrupts = <13 2 14 2 18 2>;
125 interrupt-parent = <40000>; 114 interrupt-parent = <&mpic>;
126 phy-handle = <2452001>; 115 phy-handle = <&phy1>;
127 }; 116 };
128 117
118/* eTSEC 3/4 are currently broken
129 ethernet@26000 { 119 ethernet@26000 {
130 #address-cells = <1>; 120 #address-cells = <1>;
131 #size-cells = <0>; 121 #size-cells = <0>;
@@ -135,11 +125,10 @@
135 reg = <26000 1000>; 125 reg = <26000 1000>;
136 local-mac-address = [ 00 E0 0C 00 73 02 ]; 126 local-mac-address = [ 00 E0 0C 00 73 02 ];
137 interrupts = <f 2 10 2 11 2>; 127 interrupts = <f 2 10 2 11 2>;
138 interrupt-parent = <40000>; 128 interrupt-parent = <&mpic>;
139 phy-handle = <2452001>; 129 phy-handle = <&phy2>;
140 }; 130 };
141 131
142/* eTSEC 4 is currently broken
143 ethernet@27000 { 132 ethernet@27000 {
144 #address-cells = <1>; 133 #address-cells = <1>;
145 #size-cells = <0>; 134 #size-cells = <0>;
@@ -149,8 +138,8 @@
149 reg = <27000 1000>; 138 reg = <27000 1000>;
150 local-mac-address = [ 00 E0 0C 00 73 03 ]; 139 local-mac-address = [ 00 E0 0C 00 73 03 ];
151 interrupts = <15 2 16 2 17 2>; 140 interrupts = <15 2 16 2 17 2>;
152 interrupt-parent = <40000>; 141 interrupt-parent = <&mpic>;
153 phy-handle = <2452001>; 142 phy-handle = <&phy3>;
154 }; 143 };
155 */ 144 */
156 145
@@ -160,7 +149,7 @@
160 reg = <4500 100>; // reg base, size 149 reg = <4500 100>; // reg base, size
161 clock-frequency = <0>; // should we fill in in uboot? 150 clock-frequency = <0>; // should we fill in in uboot?
162 interrupts = <1a 2>; 151 interrupts = <1a 2>;
163 interrupt-parent = <40000>; 152 interrupt-parent = <&mpic>;
164 }; 153 };
165 154
166 serial@4600 { 155 serial@4600 {
@@ -169,57 +158,56 @@
169 reg = <4600 100>; // reg base, size 158 reg = <4600 100>; // reg base, size
170 clock-frequency = <0>; // should we fill in in uboot? 159 clock-frequency = <0>; // should we fill in in uboot?
171 interrupts = <1a 2>; 160 interrupts = <1a 2>;
172 interrupt-parent = <40000>; 161 interrupt-parent = <&mpic>;
173 }; 162 };
174 163
175 pci@8000 { 164 pci1: pci@8000 {
176 linux,phandle = <8000>;
177 interrupt-map-mask = <1f800 0 0 7>; 165 interrupt-map-mask = <1f800 0 0 7>;
178 interrupt-map = < 166 interrupt-map = <
179 167
180 /* IDSEL 0x10 */ 168 /* IDSEL 0x10 */
181 08000 0 0 1 40000 30 1 169 08000 0 0 1 &mpic 30 1
182 08000 0 0 2 40000 31 1 170 08000 0 0 2 &mpic 31 1
183 08000 0 0 3 40000 32 1 171 08000 0 0 3 &mpic 32 1
184 08000 0 0 4 40000 33 1 172 08000 0 0 4 &mpic 33 1
185 173
186 /* IDSEL 0x11 */ 174 /* IDSEL 0x11 */
187 08800 0 0 1 40000 30 1 175 08800 0 0 1 &mpic 30 1
188 08800 0 0 2 40000 31 1 176 08800 0 0 2 &mpic 31 1
189 08800 0 0 3 40000 32 1 177 08800 0 0 3 &mpic 32 1
190 08800 0 0 4 40000 33 1 178 08800 0 0 4 &mpic 33 1
191 179
192 /* IDSEL 0x12 (Slot 1) */ 180 /* IDSEL 0x12 (Slot 1) */
193 09000 0 0 1 40000 30 1 181 09000 0 0 1 &mpic 30 1
194 09000 0 0 2 40000 31 1 182 09000 0 0 2 &mpic 31 1
195 09000 0 0 3 40000 32 1 183 09000 0 0 3 &mpic 32 1
196 09000 0 0 4 40000 33 1 184 09000 0 0 4 &mpic 33 1
197 185
198 /* IDSEL 0x13 (Slot 2) */ 186 /* IDSEL 0x13 (Slot 2) */
199 09800 0 0 1 40000 31 1 187 09800 0 0 1 &mpic 31 1
200 09800 0 0 2 40000 32 1 188 09800 0 0 2 &mpic 32 1
201 09800 0 0 3 40000 33 1 189 09800 0 0 3 &mpic 33 1
202 09800 0 0 4 40000 30 1 190 09800 0 0 4 &mpic 30 1
203 191
204 /* IDSEL 0x14 (Slot 3) */ 192 /* IDSEL 0x14 (Slot 3) */
205 0a000 0 0 1 40000 32 1 193 0a000 0 0 1 &mpic 32 1
206 0a000 0 0 2 40000 33 1 194 0a000 0 0 2 &mpic 33 1
207 0a000 0 0 3 40000 30 1 195 0a000 0 0 3 &mpic 30 1
208 0a000 0 0 4 40000 31 1 196 0a000 0 0 4 &mpic 31 1
209 197
210 /* IDSEL 0x15 (Slot 4) */ 198 /* IDSEL 0x15 (Slot 4) */
211 0a800 0 0 1 40000 33 1 199 0a800 0 0 1 &mpic 33 1
212 0a800 0 0 2 40000 30 1 200 0a800 0 0 2 &mpic 30 1
213 0a800 0 0 3 40000 31 1 201 0a800 0 0 3 &mpic 31 1
214 0a800 0 0 4 40000 32 1 202 0a800 0 0 4 &mpic 32 1
215 203
216 /* Bus 1 (Tundra Bridge) */ 204 /* Bus 1 (Tundra Bridge) */
217 /* IDSEL 0x12 (ISA bridge) */ 205 /* IDSEL 0x12 (ISA bridge) */
218 19000 0 0 1 40000 30 1 206 19000 0 0 1 &mpic 30 1
219 19000 0 0 2 40000 31 1 207 19000 0 0 2 &mpic 31 1
220 19000 0 0 3 40000 32 1 208 19000 0 0 3 &mpic 32 1
221 19000 0 0 4 40000 33 1>; 209 19000 0 0 4 &mpic 33 1>;
222 interrupt-parent = <40000>; 210 interrupt-parent = <&mpic>;
223 interrupts = <08 2>; 211 interrupts = <08 2>;
224 bus-range = <0 0>; 212 bus-range = <0 0>;
225 ranges = <02000000 0 80000000 80000000 0 20000000 213 ranges = <02000000 0 80000000 80000000 0 20000000
@@ -243,21 +231,20 @@
243 compatible = "chrp,iic"; 231 compatible = "chrp,iic";
244 big-endian; 232 big-endian;
245 interrupts = <1>; 233 interrupts = <1>;
246 interrupt-parent = <8000>; 234 interrupt-parent = <&pci1>;
247 }; 235 };
248 }; 236 };
249 237
250 pci@9000 { 238 pci@9000 {
251 linux,phandle = <9000>;
252 interrupt-map-mask = <f800 0 0 7>; 239 interrupt-map-mask = <f800 0 0 7>;
253 interrupt-map = < 240 interrupt-map = <
254 241
255 /* IDSEL 0x15 */ 242 /* IDSEL 0x15 */
256 a800 0 0 1 40000 3b 1 243 a800 0 0 1 &mpic 3b 1
257 a800 0 0 2 40000 3b 1 244 a800 0 0 2 &mpic 3b 1
258 a800 0 0 3 40000 3b 1 245 a800 0 0 3 &mpic 3b 1
259 a800 0 0 4 40000 3b 1>; 246 a800 0 0 4 &mpic 3b 1>;
260 interrupt-parent = <40000>; 247 interrupt-parent = <&mpic>;
261 interrupts = <09 2>; 248 interrupts = <09 2>;
262 bus-range = <0 0>; 249 bus-range = <0 0>;
263 ranges = <02000000 0 a0000000 a0000000 0 20000000 250 ranges = <02000000 0 a0000000 a0000000 0 20000000
@@ -271,8 +258,7 @@
271 device_type = "pci"; 258 device_type = "pci";
272 }; 259 };
273 260
274 pic@40000 { 261 mpic: pic@40000 {
275 linux,phandle = <40000>;
276 clock-frequency = <0>; 262 clock-frequency = <0>;
277 interrupt-controller; 263 interrupt-controller;
278 #address-cells = <0>; 264 #address-cells = <0>;
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 118f5a887651..68a4795720dc 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -12,16 +12,13 @@
12 12
13/ { 13/ {
14 model = "MPC8555CDS"; 14 model = "MPC8555CDS";
15 compatible = "MPC85xxCDS"; 15 compatible = "MPC8555CDS", "MPC85xxCDS";
16 #address-cells = <1>; 16 #address-cells = <1>;
17 #size-cells = <1>; 17 #size-cells = <1>;
18 linux,phandle = <100>;
19 18
20 cpus { 19 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 20 #address-cells = <1>;
23 #size-cells = <0>; 21 #size-cells = <0>;
24 linux,phandle = <200>;
25 22
26 PowerPC,8555@0 { 23 PowerPC,8555@0 {
27 device_type = "cpu"; 24 device_type = "cpu";
@@ -34,13 +31,11 @@
34 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
35 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
36 32-bit; 33 32-bit;
37 linux,phandle = <201>;
38 }; 34 };
39 }; 35 };
40 36
41 memory { 37 memory {
42 device_type = "memory"; 38 device_type = "memory";
43 linux,phandle = <300>;
44 reg = <00000000 08000000>; // 128M at 0x0 39 reg = <00000000 08000000>; // 128M at 0x0
45 }; 40 };
46 41
@@ -58,7 +53,7 @@
58 compatible = "fsl-i2c"; 53 compatible = "fsl-i2c";
59 reg = <3000 100>; 54 reg = <3000 100>;
60 interrupts = <1b 2>; 55 interrupts = <1b 2>;
61 interrupt-parent = <40000>; 56 interrupt-parent = <&mpic>;
62 dfsrr; 57 dfsrr;
63 }; 58 };
64 59
@@ -68,17 +63,14 @@
68 device_type = "mdio"; 63 device_type = "mdio";
69 compatible = "gianfar"; 64 compatible = "gianfar";
70 reg = <24520 20>; 65 reg = <24520 20>;
71 linux,phandle = <24520>; 66 phy0: ethernet-phy@0 {
72 ethernet-phy@0 { 67 interrupt-parent = <&mpic>;
73 linux,phandle = <2452000>;
74 interrupt-parent = <40000>;
75 interrupts = <35 0>; 68 interrupts = <35 0>;
76 reg = <0>; 69 reg = <0>;
77 device_type = "ethernet-phy"; 70 device_type = "ethernet-phy";
78 }; 71 };
79 ethernet-phy@1 { 72 phy1: ethernet-phy@1 {
80 linux,phandle = <2452001>; 73 interrupt-parent = <&mpic>;
81 interrupt-parent = <40000>;
82 interrupts = <35 0>; 74 interrupts = <35 0>;
83 reg = <1>; 75 reg = <1>;
84 device_type = "ethernet-phy"; 76 device_type = "ethernet-phy";
@@ -94,8 +86,8 @@
94 reg = <24000 1000>; 86 reg = <24000 1000>;
95 local-mac-address = [ 00 E0 0C 00 73 00 ]; 87 local-mac-address = [ 00 E0 0C 00 73 00 ];
96 interrupts = <0d 2 0e 2 12 2>; 88 interrupts = <0d 2 0e 2 12 2>;
97 interrupt-parent = <40000>; 89 interrupt-parent = <&mpic>;
98 phy-handle = <2452000>; 90 phy-handle = <&phy0>;
99 }; 91 };
100 92
101 ethernet@25000 { 93 ethernet@25000 {
@@ -107,8 +99,8 @@
107 reg = <25000 1000>; 99 reg = <25000 1000>;
108 local-mac-address = [ 00 E0 0C 00 73 01 ]; 100 local-mac-address = [ 00 E0 0C 00 73 01 ];
109 interrupts = <13 2 14 2 18 2>; 101 interrupts = <13 2 14 2 18 2>;
110 interrupt-parent = <40000>; 102 interrupt-parent = <&mpic>;
111 phy-handle = <2452001>; 103 phy-handle = <&phy1>;
112 }; 104 };
113 105
114 serial@4500 { 106 serial@4500 {
@@ -117,7 +109,7 @@
117 reg = <4500 100>; // reg base, size 109 reg = <4500 100>; // reg base, size
118 clock-frequency = <0>; // should we fill in in uboot? 110 clock-frequency = <0>; // should we fill in in uboot?
119 interrupts = <1a 2>; 111 interrupts = <1a 2>;
120 interrupt-parent = <40000>; 112 interrupt-parent = <&mpic>;
121 }; 113 };
122 114
123 serial@4600 { 115 serial@4600 {
@@ -126,57 +118,56 @@
126 reg = <4600 100>; // reg base, size 118 reg = <4600 100>; // reg base, size
127 clock-frequency = <0>; // should we fill in in uboot? 119 clock-frequency = <0>; // should we fill in in uboot?
128 interrupts = <1a 2>; 120 interrupts = <1a 2>;
129 interrupt-parent = <40000>; 121 interrupt-parent = <&mpic>;
130 }; 122 };
131 123
132 pci@8000 { 124 pci1: pci@8000 {
133 linux,phandle = <8000>;
134 interrupt-map-mask = <1f800 0 0 7>; 125 interrupt-map-mask = <1f800 0 0 7>;
135 interrupt-map = < 126 interrupt-map = <
136 127
137 /* IDSEL 0x10 */ 128 /* IDSEL 0x10 */
138 08000 0 0 1 40000 30 1 129 08000 0 0 1 &mpic 30 1
139 08000 0 0 2 40000 31 1 130 08000 0 0 2 &mpic 31 1
140 08000 0 0 3 40000 32 1 131 08000 0 0 3 &mpic 32 1
141 08000 0 0 4 40000 33 1 132 08000 0 0 4 &mpic 33 1
142 133
143 /* IDSEL 0x11 */ 134 /* IDSEL 0x11 */
144 08800 0 0 1 40000 30 1 135 08800 0 0 1 &mpic 30 1
145 08800 0 0 2 40000 31 1 136 08800 0 0 2 &mpic 31 1
146 08800 0 0 3 40000 32 1 137 08800 0 0 3 &mpic 32 1
147 08800 0 0 4 40000 33 1 138 08800 0 0 4 &mpic 33 1
148 139
149 /* IDSEL 0x12 (Slot 1) */ 140 /* IDSEL 0x12 (Slot 1) */
150 09000 0 0 1 40000 30 1 141 09000 0 0 1 &mpic 30 1
151 09000 0 0 2 40000 31 1 142 09000 0 0 2 &mpic 31 1
152 09000 0 0 3 40000 32 1 143 09000 0 0 3 &mpic 32 1
153 09000 0 0 4 40000 33 1 144 09000 0 0 4 &mpic 33 1
154 145
155 /* IDSEL 0x13 (Slot 2) */ 146 /* IDSEL 0x13 (Slot 2) */
156 09800 0 0 1 40000 31 1 147 09800 0 0 1 &mpic 31 1
157 09800 0 0 2 40000 32 1 148 09800 0 0 2 &mpic 32 1
158 09800 0 0 3 40000 33 1 149 09800 0 0 3 &mpic 33 1
159 09800 0 0 4 40000 30 1 150 09800 0 0 4 &mpic 30 1
160 151
161 /* IDSEL 0x14 (Slot 3) */ 152 /* IDSEL 0x14 (Slot 3) */
162 0a000 0 0 1 40000 32 1 153 0a000 0 0 1 &mpic 32 1
163 0a000 0 0 2 40000 33 1 154 0a000 0 0 2 &mpic 33 1
164 0a000 0 0 3 40000 30 1 155 0a000 0 0 3 &mpic 30 1
165 0a000 0 0 4 40000 31 1 156 0a000 0 0 4 &mpic 31 1
166 157
167 /* IDSEL 0x15 (Slot 4) */ 158 /* IDSEL 0x15 (Slot 4) */
168 0a800 0 0 1 40000 33 1 159 0a800 0 0 1 &mpic 33 1
169 0a800 0 0 2 40000 30 1 160 0a800 0 0 2 &mpic 30 1
170 0a800 0 0 3 40000 31 1 161 0a800 0 0 3 &mpic 31 1
171 0a800 0 0 4 40000 32 1 162 0a800 0 0 4 &mpic 32 1
172 163
173 /* Bus 1 (Tundra Bridge) */ 164 /* Bus 1 (Tundra Bridge) */
174 /* IDSEL 0x12 (ISA bridge) */ 165 /* IDSEL 0x12 (ISA bridge) */
175 19000 0 0 1 40000 30 1 166 19000 0 0 1 &mpic 30 1
176 19000 0 0 2 40000 31 1 167 19000 0 0 2 &mpic 31 1
177 19000 0 0 3 40000 32 1 168 19000 0 0 3 &mpic 32 1
178 19000 0 0 4 40000 33 1>; 169 19000 0 0 4 &mpic 33 1>;
179 interrupt-parent = <40000>; 170 interrupt-parent = <&mpic>;
180 interrupts = <08 2>; 171 interrupts = <08 2>;
181 bus-range = <0 0>; 172 bus-range = <0 0>;
182 ranges = <02000000 0 80000000 80000000 0 20000000 173 ranges = <02000000 0 80000000 80000000 0 20000000
@@ -200,21 +191,20 @@
200 compatible = "chrp,iic"; 191 compatible = "chrp,iic";
201 big-endian; 192 big-endian;
202 interrupts = <1>; 193 interrupts = <1>;
203 interrupt-parent = <8000>; 194 interrupt-parent = <&pci1>;
204 }; 195 };
205 }; 196 };
206 197
207 pci@9000 { 198 pci@9000 {
208 linux,phandle = <9000>;
209 interrupt-map-mask = <f800 0 0 7>; 199 interrupt-map-mask = <f800 0 0 7>;
210 interrupt-map = < 200 interrupt-map = <
211 201
212 /* IDSEL 0x15 */ 202 /* IDSEL 0x15 */
213 a800 0 0 1 40000 3b 1 203 a800 0 0 1 &mpic 3b 1
214 a800 0 0 2 40000 3b 1 204 a800 0 0 2 &mpic 3b 1
215 a800 0 0 3 40000 3b 1 205 a800 0 0 3 &mpic 3b 1
216 a800 0 0 4 40000 3b 1>; 206 a800 0 0 4 &mpic 3b 1>;
217 interrupt-parent = <40000>; 207 interrupt-parent = <&mpic>;
218 interrupts = <09 2>; 208 interrupts = <09 2>;
219 bus-range = <0 0>; 209 bus-range = <0 0>;
220 ranges = <02000000 0 a0000000 a0000000 0 20000000 210 ranges = <02000000 0 a0000000 a0000000 0 20000000
@@ -228,8 +218,7 @@
228 device_type = "pci"; 218 device_type = "pci";
229 }; 219 };
230 220
231 pic@40000 { 221 mpic: pic@40000 {
232 linux,phandle = <40000>;
233 clock-frequency = <0>; 222 clock-frequency = <0>;
234 interrupt-controller; 223 interrupt-controller;
235 #address-cells = <0>; 224 #address-cells = <0>;
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 119bd5d3a834..1f2afe9291d2 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -12,16 +12,13 @@
12 12
13/ { 13/ {
14 model = "MPC8560ADS"; 14 model = "MPC8560ADS";
15 compatible = "MPC85xxADS"; 15 compatible = "MPC8560ADS", "MPC85xxADS";
16 #address-cells = <1>; 16 #address-cells = <1>;
17 #size-cells = <1>; 17 #size-cells = <1>;
18 linux,phandle = <100>;
19 18
20 cpus { 19 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 20 #address-cells = <1>;
23 #size-cells = <0>; 21 #size-cells = <0>;
24 linux,phandle = <200>;
25 22
26 PowerPC,8560@0 { 23 PowerPC,8560@0 {
27 device_type = "cpu"; 24 device_type = "cpu";
@@ -34,14 +31,11 @@
34 bus-frequency = <13ab6680>; 31 bus-frequency = <13ab6680>;
35 clock-frequency = <312c8040>; 32 clock-frequency = <312c8040>;
36 32-bit; 33 32-bit;
37 linux,phandle = <201>;
38 linux,boot-cpu;
39 }; 34 };
40 }; 35 };
41 36
42 memory { 37 memory {
43 device_type = "memory"; 38 device_type = "memory";
44 linux,phandle = <300>;
45 reg = <00000000 10000000>; 39 reg = <00000000 10000000>;
46 }; 40 };
47 41
@@ -58,33 +52,28 @@
58 device_type = "mdio"; 52 device_type = "mdio";
59 compatible = "gianfar"; 53 compatible = "gianfar";
60 reg = <24520 20>; 54 reg = <24520 20>;
61 linux,phandle = <24520>;
62 #address-cells = <1>; 55 #address-cells = <1>;
63 #size-cells = <0>; 56 #size-cells = <0>;
64 ethernet-phy@0 { 57 phy0: ethernet-phy@0 {
65 linux,phandle = <2452000>; 58 interrupt-parent = <&mpic>;
66 interrupt-parent = <40000>;
67 interrupts = <35 1>; 59 interrupts = <35 1>;
68 reg = <0>; 60 reg = <0>;
69 device_type = "ethernet-phy"; 61 device_type = "ethernet-phy";
70 }; 62 };
71 ethernet-phy@1 { 63 phy1: ethernet-phy@1 {
72 linux,phandle = <2452001>; 64 interrupt-parent = <&mpic>;
73 interrupt-parent = <40000>;
74 interrupts = <35 1>; 65 interrupts = <35 1>;
75 reg = <1>; 66 reg = <1>;
76 device_type = "ethernet-phy"; 67 device_type = "ethernet-phy";
77 }; 68 };
78 ethernet-phy@2 { 69 phy2: ethernet-phy@2 {
79 linux,phandle = <2452002>; 70 interrupt-parent = <&mpic>;
80 interrupt-parent = <40000>;
81 interrupts = <37 1>; 71 interrupts = <37 1>;
82 reg = <2>; 72 reg = <2>;
83 device_type = "ethernet-phy"; 73 device_type = "ethernet-phy";
84 }; 74 };
85 ethernet-phy@3 { 75 phy3: ethernet-phy@3 {
86 linux,phandle = <2452003>; 76 interrupt-parent = <&mpic>;
87 interrupt-parent = <40000>;
88 interrupts = <37 1>; 77 interrupts = <37 1>;
89 reg = <3>; 78 reg = <3>;
90 device_type = "ethernet-phy"; 79 device_type = "ethernet-phy";
@@ -98,8 +87,8 @@
98 reg = <24000 1000>; 87 reg = <24000 1000>;
99 address = [ 00 00 0C 00 00 FD ]; 88 address = [ 00 00 0C 00 00 FD ];
100 interrupts = <d 2 e 2 12 2>; 89 interrupts = <d 2 e 2 12 2>;
101 interrupt-parent = <40000>; 90 interrupt-parent = <&mpic>;
102 phy-handle = <2452000>; 91 phy-handle = <&phy0>;
103 }; 92 };
104 93
105 ethernet@25000 { 94 ethernet@25000 {
@@ -111,12 +100,11 @@
111 reg = <25000 1000>; 100 reg = <25000 1000>;
112 address = [ 00 00 0C 00 01 FD ]; 101 address = [ 00 00 0C 00 01 FD ];
113 interrupts = <13 2 14 2 18 2>; 102 interrupts = <13 2 14 2 18 2>;
114 interrupt-parent = <40000>; 103 interrupt-parent = <&mpic>;
115 phy-handle = <2452001>; 104 phy-handle = <&phy1>;
116 }; 105 };
117 106
118 pci@8000 { 107 pci@8000 {
119 linux,phandle = <8000>;
120 #interrupt-cells = <1>; 108 #interrupt-cells = <1>;
121 #size-cells = <2>; 109 #size-cells = <2>;
122 #address-cells = <3>; 110 #address-cells = <3>;
@@ -128,96 +116,94 @@
128 interrupt-map = < 116 interrupt-map = <
129 117
130 /* IDSEL 0x2 */ 118 /* IDSEL 0x2 */
131 1000 0 0 1 40000 31 1 119 1000 0 0 1 &mpic 31 1
132 1000 0 0 2 40000 32 1 120 1000 0 0 2 &mpic 32 1
133 1000 0 0 3 40000 33 1 121 1000 0 0 3 &mpic 33 1
134 1000 0 0 4 40000 34 1 122 1000 0 0 4 &mpic 34 1
135 123
136 /* IDSEL 0x3 */ 124 /* IDSEL 0x3 */
137 1800 0 0 1 40000 34 1 125 1800 0 0 1 &mpic 34 1
138 1800 0 0 2 40000 31 1 126 1800 0 0 2 &mpic 31 1
139 1800 0 0 3 40000 32 1 127 1800 0 0 3 &mpic 32 1
140 1800 0 0 4 40000 33 1 128 1800 0 0 4 &mpic 33 1
141 129
142 /* IDSEL 0x4 */ 130 /* IDSEL 0x4 */
143 2000 0 0 1 40000 33 1 131 2000 0 0 1 &mpic 33 1
144 2000 0 0 2 40000 34 1 132 2000 0 0 2 &mpic 34 1
145 2000 0 0 3 40000 31 1 133 2000 0 0 3 &mpic 31 1
146 2000 0 0 4 40000 32 1 134 2000 0 0 4 &mpic 32 1
147 135
148 /* IDSEL 0x5 */ 136 /* IDSEL 0x5 */
149 2800 0 0 1 40000 32 1 137 2800 0 0 1 &mpic 32 1
150 2800 0 0 2 40000 33 1 138 2800 0 0 2 &mpic 33 1
151 2800 0 0 3 40000 34 1 139 2800 0 0 3 &mpic 34 1
152 2800 0 0 4 40000 31 1 140 2800 0 0 4 &mpic 31 1
153 141
154 /* IDSEL 12 */ 142 /* IDSEL 12 */
155 6000 0 0 1 40000 31 1 143 6000 0 0 1 &mpic 31 1
156 6000 0 0 2 40000 32 1 144 6000 0 0 2 &mpic 32 1
157 6000 0 0 3 40000 33 1 145 6000 0 0 3 &mpic 33 1
158 6000 0 0 4 40000 34 1 146 6000 0 0 4 &mpic 34 1
159 147
160 /* IDSEL 13 */ 148 /* IDSEL 13 */
161 6800 0 0 1 40000 34 1 149 6800 0 0 1 &mpic 34 1
162 6800 0 0 2 40000 31 1 150 6800 0 0 2 &mpic 31 1
163 6800 0 0 3 40000 32 1 151 6800 0 0 3 &mpic 32 1
164 6800 0 0 4 40000 33 1 152 6800 0 0 4 &mpic 33 1
165 153
166 /* IDSEL 14*/ 154 /* IDSEL 14*/
167 7000 0 0 1 40000 33 1 155 7000 0 0 1 &mpic 33 1
168 7000 0 0 2 40000 34 1 156 7000 0 0 2 &mpic 34 1
169 7000 0 0 3 40000 31 1 157 7000 0 0 3 &mpic 31 1
170 7000 0 0 4 40000 32 1 158 7000 0 0 4 &mpic 32 1
171 159
172 /* IDSEL 15 */ 160 /* IDSEL 15 */
173 7800 0 0 1 40000 32 1 161 7800 0 0 1 &mpic 32 1
174 7800 0 0 2 40000 33 1 162 7800 0 0 2 &mpic 33 1
175 7800 0 0 3 40000 34 1 163 7800 0 0 3 &mpic 34 1
176 7800 0 0 4 40000 31 1 164 7800 0 0 4 &mpic 31 1
177 165
178 /* IDSEL 18 */ 166 /* IDSEL 18 */
179 9000 0 0 1 40000 31 1 167 9000 0 0 1 &mpic 31 1
180 9000 0 0 2 40000 32 1 168 9000 0 0 2 &mpic 32 1
181 9000 0 0 3 40000 33 1 169 9000 0 0 3 &mpic 33 1
182 9000 0 0 4 40000 34 1 170 9000 0 0 4 &mpic 34 1
183 171
184 /* IDSEL 19 */ 172 /* IDSEL 19 */
185 9800 0 0 1 40000 34 1 173 9800 0 0 1 &mpic 34 1
186 9800 0 0 2 40000 31 1 174 9800 0 0 2 &mpic 31 1
187 9800 0 0 3 40000 32 1 175 9800 0 0 3 &mpic 32 1
188 9800 0 0 4 40000 33 1 176 9800 0 0 4 &mpic 33 1
189 177
190 /* IDSEL 20 */ 178 /* IDSEL 20 */
191 a000 0 0 1 40000 33 1 179 a000 0 0 1 &mpic 33 1
192 a000 0 0 2 40000 34 1 180 a000 0 0 2 &mpic 34 1
193 a000 0 0 3 40000 31 1 181 a000 0 0 3 &mpic 31 1
194 a000 0 0 4 40000 32 1 182 a000 0 0 4 &mpic 32 1
195 183
196 /* IDSEL 21 */ 184 /* IDSEL 21 */
197 a800 0 0 1 40000 32 1 185 a800 0 0 1 &mpic 32 1
198 a800 0 0 2 40000 33 1 186 a800 0 0 2 &mpic 33 1
199 a800 0 0 3 40000 34 1 187 a800 0 0 3 &mpic 34 1
200 a800 0 0 4 40000 31 1>; 188 a800 0 0 4 &mpic 31 1>;
201 189
202 interrupt-parent = <40000>; 190 interrupt-parent = <&mpic>;
203 interrupts = <8 0>; 191 interrupts = <8 0>;
204 bus-range = <0 0>; 192 bus-range = <0 0>;
205 ranges = <02000000 0 80000000 80000000 0 20000000 193 ranges = <02000000 0 80000000 80000000 0 20000000
206 01000000 0 00000000 e2000000 0 01000000>; 194 01000000 0 00000000 e2000000 0 01000000>;
207 }; 195 };
208 196
209 pic@40000 { 197 mpic: pic@40000 {
210 linux,phandle = <40000>;
211 interrupt-controller; 198 interrupt-controller;
212 #address-cells = <0>; 199 #address-cells = <0>;
213 #interrupt-cells = <2>; 200 #interrupt-cells = <2>;
214 reg = <40000 20100>; 201 reg = <40000 40000>;
215 built-in; 202 built-in;
216 device_type = "open-pic"; 203 device_type = "open-pic";
217 }; 204 };
218 205
219 cpm@e0000000 { 206 cpm@e0000000 {
220 linux,phandle = <e0000000>;
221 #address-cells = <1>; 207 #address-cells = <1>;
222 #size-cells = <1>; 208 #size-cells = <1>;
223 #interrupt-cells = <2>; 209 #interrupt-cells = <2>;
@@ -228,13 +214,12 @@
228 command-proc = <919c0>; 214 command-proc = <919c0>;
229 brg-frequency = <9d5b340>; 215 brg-frequency = <9d5b340>;
230 216
231 pic@90c00 { 217 cpmpic: pic@90c00 {
232 linux,phandle = <90c00>;
233 interrupt-controller; 218 interrupt-controller;
234 #address-cells = <0>; 219 #address-cells = <0>;
235 #interrupt-cells = <2>; 220 #interrupt-cells = <2>;
236 interrupts = <1e 0>; 221 interrupts = <1e 0>;
237 interrupt-parent = <40000>; 222 interrupt-parent = <&mpic>;
238 reg = <90c00 80>; 223 reg = <90c00 80>;
239 built-in; 224 built-in;
240 device_type = "cpm-pic"; 225 device_type = "cpm-pic";
@@ -251,7 +236,7 @@
251 tx-clock = <1>; 236 tx-clock = <1>;
252 current-speed = <1c200>; 237 current-speed = <1c200>;
253 interrupts = <28 8>; 238 interrupts = <28 8>;
254 interrupt-parent = <90c00>; 239 interrupt-parent = <&cpmpic>;
255 }; 240 };
256 241
257 scc@91a20 { 242 scc@91a20 {
@@ -265,7 +250,7 @@
265 tx-clock = <2>; 250 tx-clock = <2>;
266 current-speed = <1c200>; 251 current-speed = <1c200>;
267 interrupts = <29 8>; 252 interrupts = <29 8>;
268 interrupt-parent = <90c00>; 253 interrupt-parent = <&cpmpic>;
269 }; 254 };
270 255
271 fcc@91320 { 256 fcc@91320 {
@@ -279,8 +264,8 @@
279 rx-clock = <15>; 264 rx-clock = <15>;
280 tx-clock = <16>; 265 tx-clock = <16>;
281 interrupts = <21 8>; 266 interrupts = <21 8>;
282 interrupt-parent = <90c00>; 267 interrupt-parent = <&cpmpic>;
283 phy-handle = <2452002>; 268 phy-handle = <&phy2>;
284 }; 269 };
285 270
286 fcc@91340 { 271 fcc@91340 {
@@ -294,8 +279,8 @@
294 rx-clock = <17>; 279 rx-clock = <17>;
295 tx-clock = <18>; 280 tx-clock = <18>;
296 interrupts = <22 8>; 281 interrupts = <22 8>;
297 interrupt-parent = <90c00>; 282 interrupt-parent = <&cpmpic>;
298 phy-handle = <2452003>; 283 phy-handle = <&phy3>;
299 }; 284 };
300 }; 285 };
301 }; 286 };
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 06d24653e422..7361b36749cb 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -16,16 +16,13 @@
16 16
17/ { 17/ {
18 model = "MPC8568EMDS"; 18 model = "MPC8568EMDS";
19 compatible = "MPC85xxMDS"; 19 compatible = "MPC8568EMDS", "MPC85xxMDS";
20 #address-cells = <1>; 20 #address-cells = <1>;
21 #size-cells = <1>; 21 #size-cells = <1>;
22 linux,phandle = <100>;
23 22
24 cpus { 23 cpus {
25 #cpus = <1>;
26 #address-cells = <1>; 24 #address-cells = <1>;
27 #size-cells = <0>; 25 #size-cells = <0>;
28 linux,phandle = <200>;
29 26
30 PowerPC,8568@0 { 27 PowerPC,8568@0 {
31 device_type = "cpu"; 28 device_type = "cpu";
@@ -38,13 +35,11 @@
38 bus-frequency = <0>; 35 bus-frequency = <0>;
39 clock-frequency = <0>; 36 clock-frequency = <0>;
40 32-bit; 37 32-bit;
41 linux,phandle = <201>;
42 }; 38 };
43 }; 39 };
44 40
45 memory { 41 memory {
46 device_type = "memory"; 42 device_type = "memory";
47 linux,phandle = <300>;
48 reg = <00000000 10000000>; 43 reg = <00000000 10000000>;
49 }; 44 };
50 45
@@ -67,7 +62,7 @@
67 compatible = "fsl-i2c"; 62 compatible = "fsl-i2c";
68 reg = <3000 100>; 63 reg = <3000 100>;
69 interrupts = <1b 2>; 64 interrupts = <1b 2>;
70 interrupt-parent = <40000>; 65 interrupt-parent = <&mpic>;
71 dfsrr; 66 dfsrr;
72 }; 67 };
73 68
@@ -76,7 +71,7 @@
76 compatible = "fsl-i2c"; 71 compatible = "fsl-i2c";
77 reg = <3100 100>; 72 reg = <3100 100>;
78 interrupts = <1b 2>; 73 interrupts = <1b 2>;
79 interrupt-parent = <40000>; 74 interrupt-parent = <&mpic>;
80 dfsrr; 75 dfsrr;
81 }; 76 };
82 77
@@ -86,32 +81,26 @@
86 device_type = "mdio"; 81 device_type = "mdio";
87 compatible = "gianfar"; 82 compatible = "gianfar";
88 reg = <24520 20>; 83 reg = <24520 20>;
89 linux,phandle = <24520>; 84 phy0: ethernet-phy@0 {
90 ethernet-phy@0 { 85 interrupt-parent = <&mpic>;
91 linux,phandle = <2452000>;
92 interrupt-parent = <40000>;
93 interrupts = <31 1>; 86 interrupts = <31 1>;
94 reg = <0>; 87 reg = <0>;
95 device_type = "ethernet-phy"; 88 device_type = "ethernet-phy";
96 }; 89 };
97 ethernet-phy@1 { 90 phy1: ethernet-phy@1 {
98 linux,phandle = <2452001>; 91 interrupt-parent = <&mpic>;
99 interrupt-parent = <40000>;
100 interrupts = <32 1>; 92 interrupts = <32 1>;
101 reg = <1>; 93 reg = <1>;
102 device_type = "ethernet-phy"; 94 device_type = "ethernet-phy";
103 }; 95 };
104 96 phy2: ethernet-phy@2 {
105 ethernet-phy@2 { 97 interrupt-parent = <&mpic>;
106 linux,phandle = <2452002>;
107 interrupt-parent = <40000>;
108 interrupts = <31 1>; 98 interrupts = <31 1>;
109 reg = <2>; 99 reg = <2>;
110 device_type = "ethernet-phy"; 100 device_type = "ethernet-phy";
111 }; 101 };
112 ethernet-phy@3 { 102 phy3: ethernet-phy@3 {
113 linux,phandle = <2452003>; 103 interrupt-parent = <&mpic>;
114 interrupt-parent = <40000>;
115 interrupts = <32 1>; 104 interrupts = <32 1>;
116 reg = <3>; 105 reg = <3>;
117 device_type = "ethernet-phy"; 106 device_type = "ethernet-phy";
@@ -127,8 +116,8 @@
127 reg = <24000 1000>; 116 reg = <24000 1000>;
128 mac-address = [ 00 00 00 00 00 00 ]; 117 mac-address = [ 00 00 00 00 00 00 ];
129 interrupts = <d 2 e 2 12 2>; 118 interrupts = <d 2 e 2 12 2>;
130 interrupt-parent = <40000>; 119 interrupt-parent = <&mpic>;
131 phy-handle = <2452002>; 120 phy-handle = <&phy2>;
132 }; 121 };
133 122
134 ethernet@25000 { 123 ethernet@25000 {
@@ -140,8 +129,8 @@
140 reg = <25000 1000>; 129 reg = <25000 1000>;
141 mac-address = [ 00 00 00 00 00 00]; 130 mac-address = [ 00 00 00 00 00 00];
142 interrupts = <13 2 14 2 18 2>; 131 interrupts = <13 2 14 2 18 2>;
143 interrupt-parent = <40000>; 132 interrupt-parent = <&mpic>;
144 phy-handle = <2452003>; 133 phy-handle = <&phy3>;
145 }; 134 };
146 135
147 serial@4500 { 136 serial@4500 {
@@ -150,7 +139,7 @@
150 reg = <4500 100>; 139 reg = <4500 100>;
151 clock-frequency = <0>; 140 clock-frequency = <0>;
152 interrupts = <1a 2>; 141 interrupts = <1a 2>;
153 interrupt-parent = <40000>; 142 interrupt-parent = <&mpic>;
154 }; 143 };
155 144
156 serial@4600 { 145 serial@4600 {
@@ -159,7 +148,7 @@
159 reg = <4600 100>; 148 reg = <4600 100>;
160 clock-frequency = <0>; 149 clock-frequency = <0>;
161 interrupts = <1a 2>; 150 interrupts = <1a 2>;
162 interrupt-parent = <40000>; 151 interrupt-parent = <&mpic>;
163 }; 152 };
164 153
165 crypto@30000 { 154 crypto@30000 {
@@ -168,15 +157,14 @@
168 compatible = "talitos"; 157 compatible = "talitos";
169 reg = <30000 f000>; 158 reg = <30000 f000>;
170 interrupts = <1d 2>; 159 interrupts = <1d 2>;
171 interrupt-parent = <40000>; 160 interrupt-parent = <&mpic>;
172 num-channels = <4>; 161 num-channels = <4>;
173 channel-fifo-len = <18>; 162 channel-fifo-len = <18>;
174 exec-units-mask = <000000fe>; 163 exec-units-mask = <000000fe>;
175 descriptor-types-mask = <012b0ebf>; 164 descriptor-types-mask = <012b0ebf>;
176 }; 165 };
177 166
178 pic@40000 { 167 mpic: pic@40000 {
179 linux,phandle = <40000>;
180 clock-frequency = <0>; 168 clock-frequency = <0>;
181 interrupt-controller; 169 interrupt-controller;
182 #address-cells = <0>; 170 #address-cells = <0>;
@@ -192,8 +180,7 @@
192 device_type = "par_io"; 180 device_type = "par_io";
193 num-ports = <7>; 181 num-ports = <7>;
194 182
195 ucc_pin@01 { 183 pio1: ucc_pin@01 {
196 linux,phandle = <e010001>;
197 pio-map = < 184 pio-map = <
198 /* port pin dir open_drain assignment has_irq */ 185 /* port pin dir open_drain assignment has_irq */
199 4 0a 1 0 2 0 /* TxD0 */ 186 4 0a 1 0 2 0 /* TxD0 */
@@ -220,8 +207,7 @@
220 4 13 1 0 2 0 /* GTX_CLK */ 207 4 13 1 0 2 0 /* GTX_CLK */
221 1 1f 2 0 3 0>; /* GTX125 */ 208 1 1f 2 0 3 0>; /* GTX125 */
222 }; 209 };
223 ucc_pin@02 { 210 pio2: ucc_pin@02 {
224 linux,phandle = <e010002>;
225 pio-map = < 211 pio-map = <
226 /* port pin dir open_drain assignment has_irq */ 212 /* port pin dir open_drain assignment has_irq */
227 5 0a 1 0 2 0 /* TxD0 */ 213 5 0a 1 0 2 0 /* TxD0 */
@@ -277,7 +263,7 @@
277 compatible = "fsl_spi"; 263 compatible = "fsl_spi";
278 reg = <4c0 40>; 264 reg = <4c0 40>;
279 interrupts = <2>; 265 interrupts = <2>;
280 interrupt-parent = <80>; 266 interrupt-parent = <&qeic>;
281 mode = "cpu"; 267 mode = "cpu";
282 }; 268 };
283 269
@@ -286,7 +272,7 @@
286 compatible = "fsl_spi"; 272 compatible = "fsl_spi";
287 reg = <500 40>; 273 reg = <500 40>;
288 interrupts = <1>; 274 interrupts = <1>;
289 interrupt-parent = <80>; 275 interrupt-parent = <&qeic>;
290 mode = "cpu"; 276 mode = "cpu";
291 }; 277 };
292 278
@@ -297,12 +283,12 @@
297 device-id = <1>; 283 device-id = <1>;
298 reg = <2000 200>; 284 reg = <2000 200>;
299 interrupts = <20>; 285 interrupts = <20>;
300 interrupt-parent = <80>; 286 interrupt-parent = <&qeic>;
301 mac-address = [ 00 04 9f 00 23 23 ]; 287 mac-address = [ 00 04 9f 00 23 23 ];
302 rx-clock = <0>; 288 rx-clock = <0>;
303 tx-clock = <19>; 289 tx-clock = <19>;
304 phy-handle = <212000>; 290 phy-handle = <&qe_phy0>;
305 pio-handle = <e010001>; 291 pio-handle = <&pio1>;
306 }; 292 };
307 293
308 ucc@3000 { 294 ucc@3000 {
@@ -312,12 +298,12 @@
312 device-id = <2>; 298 device-id = <2>;
313 reg = <3000 200>; 299 reg = <3000 200>;
314 interrupts = <21>; 300 interrupts = <21>;
315 interrupt-parent = <80>; 301 interrupt-parent = <&qeic>;
316 mac-address = [ 00 11 22 33 44 55 ]; 302 mac-address = [ 00 11 22 33 44 55 ];
317 rx-clock = <0>; 303 rx-clock = <0>;
318 tx-clock = <14>; 304 tx-clock = <14>;
319 phy-handle = <212001>; 305 phy-handle = <&qe_phy1>;
320 pio-handle = <e010002>; 306 pio-handle = <&pio2>;
321 }; 307 };
322 308
323 mdio@2120 { 309 mdio@2120 {
@@ -329,33 +315,29 @@
329 315
330 /* These are the same PHYs as on 316 /* These are the same PHYs as on
331 * gianfar's MDIO bus */ 317 * gianfar's MDIO bus */
332 ethernet-phy@00 { 318 qe_phy0: ethernet-phy@00 {
333 linux,phandle = <212000>; 319 interrupt-parent = <&mpic>;
334 interrupt-parent = <40000>;
335 interrupts = <31 1>; 320 interrupts = <31 1>;
336 reg = <0>; 321 reg = <0>;
337 device_type = "ethernet-phy"; 322 device_type = "ethernet-phy";
338 interface = <6>; //ENET_1000_GMII 323 interface = <6>; //ENET_1000_GMII
339 }; 324 };
340 ethernet-phy@01 { 325 qe_phy1: ethernet-phy@01 {
341 linux,phandle = <212001>; 326 interrupt-parent = <&mpic>;
342 interrupt-parent = <40000>;
343 interrupts = <32 1>; 327 interrupts = <32 1>;
344 reg = <1>; 328 reg = <1>;
345 device_type = "ethernet-phy"; 329 device_type = "ethernet-phy";
346 interface = <6>; 330 interface = <6>;
347 }; 331 };
348 ethernet-phy@02 { 332 qe_phy2: ethernet-phy@02 {
349 linux,phandle = <212002>; 333 interrupt-parent = <&mpic>;
350 interrupt-parent = <40000>;
351 interrupts = <31 1>; 334 interrupts = <31 1>;
352 reg = <2>; 335 reg = <2>;
353 device_type = "ethernet-phy"; 336 device_type = "ethernet-phy";
354 interface = <6>; //ENET_1000_GMII 337 interface = <6>; //ENET_1000_GMII
355 }; 338 };
356 ethernet-phy@03 { 339 qe_phy3: ethernet-phy@03 {
357 linux,phandle = <212003>; 340 interrupt-parent = <&mpic>;
358 interrupt-parent = <40000>;
359 interrupts = <32 1>; 341 interrupts = <32 1>;
360 reg = <3>; 342 reg = <3>;
361 device_type = "ethernet-phy"; 343 device_type = "ethernet-phy";
@@ -363,8 +345,7 @@
363 }; 345 };
364 }; 346 };
365 347
366 qeic@80 { 348 qeic: qeic@80 {
367 linux,phandle = <80>;
368 interrupt-controller; 349 interrupt-controller;
369 device_type = "qeic"; 350 device_type = "qeic";
370 #address-cells = <0>; 351 #address-cells = <0>;
@@ -373,7 +354,7 @@
373 built-in; 354 built-in;
374 big-endian; 355 big-endian;
375 interrupts = <1e 2 1e 2>; //high:30 low:30 356 interrupts = <1e 2 1e 2>; //high:30 low:30
376 interrupt-parent = <40000>; 357 interrupt-parent = <&mpic>;
377 }; 358 };
378 359
379 }; 360 };
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index f0c7731743ea..260b264c869e 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -17,7 +17,6 @@
17 #size-cells = <1>; 17 #size-cells = <1>;
18 18
19 cpus { 19 cpus {
20 #cpus = <2>;
21 #address-cells = <1>; 20 #address-cells = <1>;
22 #size-cells = <0>; 21 #size-cells = <0>;
23 22
@@ -32,7 +31,6 @@
32 bus-frequency = <0>; // From uboot 31 bus-frequency = <0>; // From uboot
33 clock-frequency = <0>; // From uboot 32 clock-frequency = <0>; // From uboot
34 32-bit; 33 32-bit;
35 linux,boot-cpu;
36 }; 34 };
37 PowerPC,8641@1 { 35 PowerPC,8641@1 {
38 device_type = "cpu"; 36 device_type = "cpu";
@@ -67,7 +65,7 @@
67 compatible = "fsl-i2c"; 65 compatible = "fsl-i2c";
68 reg = <3000 100>; 66 reg = <3000 100>;
69 interrupts = <2b 2>; 67 interrupts = <2b 2>;
70 interrupt-parent = <40000>; 68 interrupt-parent = <&mpic>;
71 dfsrr; 69 dfsrr;
72 }; 70 };
73 71
@@ -76,7 +74,7 @@
76 compatible = "fsl-i2c"; 74 compatible = "fsl-i2c";
77 reg = <3100 100>; 75 reg = <3100 100>;
78 interrupts = <2b 2>; 76 interrupts = <2b 2>;
79 interrupt-parent = <40000>; 77 interrupt-parent = <&mpic>;
80 dfsrr; 78 dfsrr;
81 }; 79 };
82 80
@@ -86,31 +84,26 @@
86 device_type = "mdio"; 84 device_type = "mdio";
87 compatible = "gianfar"; 85 compatible = "gianfar";
88 reg = <24520 20>; 86 reg = <24520 20>;
89 linux,phandle = <24520>; 87 phy0: ethernet-phy@0 {
90 ethernet-phy@0 { 88 interrupt-parent = <&mpic>;
91 linux,phandle = <2452000>;
92 interrupt-parent = <40000>;
93 interrupts = <4a 1>; 89 interrupts = <4a 1>;
94 reg = <0>; 90 reg = <0>;
95 device_type = "ethernet-phy"; 91 device_type = "ethernet-phy";
96 }; 92 };
97 ethernet-phy@1 { 93 phy1: ethernet-phy@1 {
98 linux,phandle = <2452001>; 94 interrupt-parent = <&mpic>;
99 interrupt-parent = <40000>;
100 interrupts = <4a 1>; 95 interrupts = <4a 1>;
101 reg = <1>; 96 reg = <1>;
102 device_type = "ethernet-phy"; 97 device_type = "ethernet-phy";
103 }; 98 };
104 ethernet-phy@2 { 99 phy2: ethernet-phy@2 {
105 linux,phandle = <2452002>; 100 interrupt-parent = <&mpic>;
106 interrupt-parent = <40000>;
107 interrupts = <4a 1>; 101 interrupts = <4a 1>;
108 reg = <2>; 102 reg = <2>;
109 device_type = "ethernet-phy"; 103 device_type = "ethernet-phy";
110 }; 104 };
111 ethernet-phy@3 { 105 phy3: ethernet-phy@3 {
112 linux,phandle = <2452003>; 106 interrupt-parent = <&mpic>;
113 interrupt-parent = <40000>;
114 interrupts = <4a 1>; 107 interrupts = <4a 1>;
115 reg = <3>; 108 reg = <3>;
116 device_type = "ethernet-phy"; 109 device_type = "ethernet-phy";
@@ -126,8 +119,8 @@
126 reg = <24000 1000>; 119 reg = <24000 1000>;
127 mac-address = [ 00 E0 0C 00 73 00 ]; 120 mac-address = [ 00 E0 0C 00 73 00 ];
128 interrupts = <1d 2 1e 2 22 2>; 121 interrupts = <1d 2 1e 2 22 2>;
129 interrupt-parent = <40000>; 122 interrupt-parent = <&mpic>;
130 phy-handle = <2452000>; 123 phy-handle = <&phy0>;
131 }; 124 };
132 125
133 ethernet@25000 { 126 ethernet@25000 {
@@ -139,8 +132,8 @@
139 reg = <25000 1000>; 132 reg = <25000 1000>;
140 mac-address = [ 00 E0 0C 00 73 01 ]; 133 mac-address = [ 00 E0 0C 00 73 01 ];
141 interrupts = <23 2 24 2 28 2>; 134 interrupts = <23 2 24 2 28 2>;
142 interrupt-parent = <40000>; 135 interrupt-parent = <&mpic>;
143 phy-handle = <2452001>; 136 phy-handle = <&phy1>;
144 }; 137 };
145 138
146 ethernet@26000 { 139 ethernet@26000 {
@@ -152,8 +145,8 @@
152 reg = <26000 1000>; 145 reg = <26000 1000>;
153 mac-address = [ 00 E0 0C 00 02 FD ]; 146 mac-address = [ 00 E0 0C 00 02 FD ];
154 interrupts = <1F 2 20 2 21 2>; 147 interrupts = <1F 2 20 2 21 2>;
155 interrupt-parent = <40000>; 148 interrupt-parent = <&mpic>;
156 phy-handle = <2452002>; 149 phy-handle = <&phy2>;
157 }; 150 };
158 151
159 ethernet@27000 { 152 ethernet@27000 {
@@ -165,8 +158,8 @@
165 reg = <27000 1000>; 158 reg = <27000 1000>;
166 mac-address = [ 00 E0 0C 00 03 FD ]; 159 mac-address = [ 00 E0 0C 00 03 FD ];
167 interrupts = <25 2 26 2 27 2>; 160 interrupts = <25 2 26 2 27 2>;
168 interrupt-parent = <40000>; 161 interrupt-parent = <&mpic>;
169 phy-handle = <2452003>; 162 phy-handle = <&phy3>;
170 }; 163 };
171 serial@4500 { 164 serial@4500 {
172 device_type = "serial"; 165 device_type = "serial";
@@ -174,7 +167,7 @@
174 reg = <4500 100>; 167 reg = <4500 100>;
175 clock-frequency = <0>; 168 clock-frequency = <0>;
176 interrupts = <2a 2>; 169 interrupts = <2a 2>;
177 interrupt-parent = <40000>; 170 interrupt-parent = <&mpic>;
178 }; 171 };
179 172
180 serial@4600 { 173 serial@4600 {
@@ -183,7 +176,7 @@
183 reg = <4600 100>; 176 reg = <4600 100>;
184 clock-frequency = <0>; 177 clock-frequency = <0>;
185 interrupts = <1c 2>; 178 interrupts = <1c 2>;
186 interrupt-parent = <40000>; 179 interrupt-parent = <&mpic>;
187 }; 180 };
188 181
189 pci@8000 { 182 pci@8000 {
@@ -197,103 +190,102 @@
197 ranges = <02000000 0 80000000 80000000 0 20000000 190 ranges = <02000000 0 80000000 80000000 0 20000000
198 01000000 0 00000000 e2000000 0 00100000>; 191 01000000 0 00000000 e2000000 0 00100000>;
199 clock-frequency = <1fca055>; 192 clock-frequency = <1fca055>;
200 interrupt-parent = <40000>; 193 interrupt-parent = <&mpic>;
201 interrupts = <18 2>; 194 interrupts = <18 2>;
202 interrupt-map-mask = <f800 0 0 7>; 195 interrupt-map-mask = <f800 0 0 7>;
203 interrupt-map = < 196 interrupt-map = <
204 /* IDSEL 0x11 */ 197 /* IDSEL 0x11 */
205 8800 0 0 1 4d0 3 2 198 8800 0 0 1 &i8259 3 2
206 8800 0 0 2 4d0 4 2 199 8800 0 0 2 &i8259 4 2
207 8800 0 0 3 4d0 5 2 200 8800 0 0 3 &i8259 5 2
208 8800 0 0 4 4d0 6 2 201 8800 0 0 4 &i8259 6 2
209 202
210 /* IDSEL 0x12 */ 203 /* IDSEL 0x12 */
211 9000 0 0 1 4d0 4 2 204 9000 0 0 1 &i8259 4 2
212 9000 0 0 2 4d0 5 2 205 9000 0 0 2 &i8259 5 2
213 9000 0 0 3 4d0 6 2 206 9000 0 0 3 &i8259 6 2
214 9000 0 0 4 4d0 3 2 207 9000 0 0 4 &i8259 3 2
215 208
216 /* IDSEL 0x13 */ 209 /* IDSEL 0x13 */
217 9800 0 0 1 4d0 0 0 210 9800 0 0 1 &i8259 0 0
218 9800 0 0 2 4d0 0 0 211 9800 0 0 2 &i8259 0 0
219 9800 0 0 3 4d0 0 0 212 9800 0 0 3 &i8259 0 0
220 9800 0 0 4 4d0 0 0 213 9800 0 0 4 &i8259 0 0
221 214
222 /* IDSEL 0x14 */ 215 /* IDSEL 0x14 */
223 a000 0 0 1 4d0 0 0 216 a000 0 0 1 &i8259 0 0
224 a000 0 0 2 4d0 0 0 217 a000 0 0 2 &i8259 0 0
225 a000 0 0 3 4d0 0 0 218 a000 0 0 3 &i8259 0 0
226 a000 0 0 4 4d0 0 0 219 a000 0 0 4 &i8259 0 0
227 220
228 /* IDSEL 0x15 */ 221 /* IDSEL 0x15 */
229 a800 0 0 1 4d0 0 0 222 a800 0 0 1 &i8259 0 0
230 a800 0 0 2 4d0 0 0 223 a800 0 0 2 &i8259 0 0
231 a800 0 0 3 4d0 0 0 224 a800 0 0 3 &i8259 0 0
232 a800 0 0 4 4d0 0 0 225 a800 0 0 4 &i8259 0 0
233 226
234 /* IDSEL 0x16 */ 227 /* IDSEL 0x16 */
235 b000 0 0 1 4d0 0 0 228 b000 0 0 1 &i8259 0 0
236 b000 0 0 2 4d0 0 0 229 b000 0 0 2 &i8259 0 0
237 b000 0 0 3 4d0 0 0 230 b000 0 0 3 &i8259 0 0
238 b000 0 0 4 4d0 0 0 231 b000 0 0 4 &i8259 0 0
239 232
240 /* IDSEL 0x17 */ 233 /* IDSEL 0x17 */
241 b800 0 0 1 4d0 0 0 234 b800 0 0 1 &i8259 0 0
242 b800 0 0 2 4d0 0 0 235 b800 0 0 2 &i8259 0 0
243 b800 0 0 3 4d0 0 0 236 b800 0 0 3 &i8259 0 0
244 b800 0 0 4 4d0 0 0 237 b800 0 0 4 &i8259 0 0
245 238
246 /* IDSEL 0x18 */ 239 /* IDSEL 0x18 */
247 c000 0 0 1 4d0 0 0 240 c000 0 0 1 &i8259 0 0
248 c000 0 0 2 4d0 0 0 241 c000 0 0 2 &i8259 0 0
249 c000 0 0 3 4d0 0 0 242 c000 0 0 3 &i8259 0 0
250 c000 0 0 4 4d0 0 0 243 c000 0 0 4 &i8259 0 0
251 244
252 /* IDSEL 0x19 */ 245 /* IDSEL 0x19 */
253 c800 0 0 1 4d0 0 0 246 c800 0 0 1 &i8259 0 0
254 c800 0 0 2 4d0 0 0 247 c800 0 0 2 &i8259 0 0
255 c800 0 0 3 4d0 0 0 248 c800 0 0 3 &i8259 0 0
256 c800 0 0 4 4d0 0 0 249 c800 0 0 4 &i8259 0 0
257 250
258 /* IDSEL 0x1a */ 251 /* IDSEL 0x1a */
259 d000 0 0 1 4d0 6 2 252 d000 0 0 1 &i8259 6 2
260 d000 0 0 2 4d0 3 2 253 d000 0 0 2 &i8259 3 2
261 d000 0 0 3 4d0 4 2 254 d000 0 0 3 &i8259 4 2
262 d000 0 0 4 4d0 5 2 255 d000 0 0 4 &i8259 5 2
263 256
264 257
265 /* IDSEL 0x1b */ 258 /* IDSEL 0x1b */
266 d800 0 0 1 4d0 5 2 259 d800 0 0 1 &i8259 5 2
267 d800 0 0 2 4d0 0 0 260 d800 0 0 2 &i8259 0 0
268 d800 0 0 3 4d0 0 0 261 d800 0 0 3 &i8259 0 0
269 d800 0 0 4 4d0 0 0 262 d800 0 0 4 &i8259 0 0
270 263
271 /* IDSEL 0x1c */ 264 /* IDSEL 0x1c */
272 e000 0 0 1 4d0 9 2 265 e000 0 0 1 &i8259 9 2
273 e000 0 0 2 4d0 a 2 266 e000 0 0 2 &i8259 a 2
274 e000 0 0 3 4d0 c 2 267 e000 0 0 3 &i8259 c 2
275 e000 0 0 4 4d0 7 2 268 e000 0 0 4 &i8259 7 2
276 269
277 /* IDSEL 0x1d */ 270 /* IDSEL 0x1d */
278 e800 0 0 1 4d0 9 2 271 e800 0 0 1 &i8259 9 2
279 e800 0 0 2 4d0 a 2 272 e800 0 0 2 &i8259 a 2
280 e800 0 0 3 4d0 b 2 273 e800 0 0 3 &i8259 b 2
281 e800 0 0 4 4d0 0 0 274 e800 0 0 4 &i8259 0 0
282 275
283 /* IDSEL 0x1e */ 276 /* IDSEL 0x1e */
284 f000 0 0 1 4d0 c 2 277 f000 0 0 1 &i8259 c 2
285 f000 0 0 2 4d0 0 0 278 f000 0 0 2 &i8259 0 0
286 f000 0 0 3 4d0 0 0 279 f000 0 0 3 &i8259 0 0
287 f000 0 0 4 4d0 0 0 280 f000 0 0 4 &i8259 0 0
288 281
289 /* IDSEL 0x1f */ 282 /* IDSEL 0x1f */
290 f800 0 0 1 4d0 6 2 283 f800 0 0 1 &i8259 6 2
291 f800 0 0 2 4d0 0 0 284 f800 0 0 2 &i8259 0 0
292 f800 0 0 3 4d0 0 0 285 f800 0 0 3 &i8259 0 0
293 f800 0 0 4 4d0 0 0 286 f800 0 0 4 &i8259 0 0
294 >; 287 >;
295 i8259@4d0 { 288 i8259: i8259@4d0 {
296 linux,phandle = <4d0>;
297 clock-frequency = <0>; 289 clock-frequency = <0>;
298 interrupt-controller; 290 interrupt-controller;
299 device_type = "interrupt-controller"; 291 device_type = "interrupt-controller";
@@ -303,12 +295,35 @@
303 compatible = "chrp,iic"; 295 compatible = "chrp,iic";
304 big-endian; 296 big-endian;
305 interrupts = <49 2>; 297 interrupts = <49 2>;
306 interrupt-parent = <40000>; 298 interrupt-parent = <&mpic>;
307 }; 299 };
308 300
309 }; 301 };
310 pic@40000 { 302
311 linux,phandle = <40000>; 303 pci@9000 {
304 compatible = "86xx";
305 device_type = "pci";
306 #interrupt-cells = <1>;
307 #size-cells = <2>;
308 #address-cells = <3>;
309 reg = <9000 1000>;
310 bus-range = <0 ff>;
311 ranges = <02000000 0 a0000000 a0000000 0 20000000
312 01000000 0 00000000 e3000000 0 00100000>;
313 clock-frequency = <1fca055>;
314 interrupt-parent = <&mpic>;
315 interrupts = <19 2>;
316 interrupt-map-mask = <f800 0 0 7>;
317 interrupt-map = <
318 /* IDSEL 0x0 */
319 0000 0 0 1 &mpic 44 1
320 0000 0 0 2 &mpic 45 1
321 0000 0 0 3 &mpic 46 1
322 0000 0 0 4 &mpic 47 1
323 >;
324 };
325
326 mpic: pic@40000 {
312 clock-frequency = <0>; 327 clock-frequency = <0>;
313 interrupt-controller; 328 interrupt-controller;
314 #address-cells = <0>; 329 #address-cells = <0>;
@@ -317,23 +332,7 @@
317 built-in; 332 built-in;
318 compatible = "chrp,open-pic"; 333 compatible = "chrp,open-pic";
319 device_type = "open-pic"; 334 device_type = "open-pic";
320 big-endian; 335 big-endian;
321 interrupts = <
322 10 2 11 2 12 2 13 2
323 14 2 15 2 16 2 17 2
324 18 2 19 2 1a 2 1b 2
325 1c 2 1d 2 1e 2 1f 2
326 20 2 21 2 22 2 23 2
327 24 2 25 2 26 2 27 2
328 28 2 29 2 2a 2 2b 2
329 2c 2 2d 2 2e 2 2f 2
330 30 2 31 2 32 2 33 2
331 34 2 35 2 36 2 37 2
332 38 2 39 2 2a 2 3b 2
333 3c 2 3d 2 3e 2 3f 2
334 48 1 49 2 4a 1
335 >;
336 interrupt-parent = <40000>;
337 }; 336 };
338 }; 337 };
339}; 338};
diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts
index 5d4005239b83..c0d06fd12927 100644
--- a/arch/powerpc/boot/dts/mpc866ads.dts
+++ b/arch/powerpc/boot/dts/mpc866ads.dts
@@ -18,7 +18,6 @@
18 linux,phandle = <100>; 18 linux,phandle = <100>;
19 19
20 cpus { 20 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 21 #address-cells = <1>;
23 #size-cells = <0>; 22 #size-cells = <0>;
24 linux,phandle = <200>; 23 linux,phandle = <200>;
@@ -37,7 +36,6 @@
37 interrupts = <f 2>; // decrementer interrupt 36 interrupts = <f 2>; // decrementer interrupt
38 interrupt-parent = <ff000000>; 37 interrupt-parent = <ff000000>;
39 linux,phandle = <201>; 38 linux,phandle = <201>;
40 linux,boot-cpu;
41 }; 39 };
42 }; 40 };
43 41
diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index cf1a19f962c5..110bf6170603 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -18,7 +18,6 @@
18 linux,phandle = <100>; 18 linux,phandle = <100>;
19 19
20 cpus { 20 cpus {
21 #cpus = <1>;
22 #address-cells = <1>; 21 #address-cells = <1>;
23 #size-cells = <0>; 22 #size-cells = <0>;
24 linux,phandle = <200>; 23 linux,phandle = <200>;
@@ -37,7 +36,6 @@
37 interrupts = <f 2>; // decrementer interrupt 36 interrupts = <f 2>; // decrementer interrupt
38 interrupt-parent = <ff000000>; 37 interrupt-parent = <ff000000>;
39 linux,phandle = <201>; 38 linux,phandle = <201>;
40 linux,boot-cpu;
41 }; 39 };
42 }; 40 };
43 41
diff --git a/arch/powerpc/boot/elf.h b/arch/powerpc/boot/elf.h
index d4828fcf1cb9..1941bc50d4c5 100644
--- a/arch/powerpc/boot/elf.h
+++ b/arch/powerpc/boot/elf.h
@@ -146,4 +146,12 @@ typedef struct elf64_phdr {
146#define ELFOSABI_NONE 0 146#define ELFOSABI_NONE 0
147#define ELFOSABI_LINUX 3 147#define ELFOSABI_LINUX 3
148 148
149struct elf_info {
150 unsigned long loadsize;
151 unsigned long memsize;
152 unsigned long elfoffset;
153};
154int parse_elf64(void *hdr, struct elf_info *info);
155int parse_elf32(void *hdr, struct elf_info *info);
156
149#endif /* _PPC_BOOT_ELF_H_ */ 157#endif /* _PPC_BOOT_ELF_H_ */
diff --git a/arch/powerpc/boot/elf_util.c b/arch/powerpc/boot/elf_util.c
new file mode 100644
index 000000000000..7454aa4cc20c
--- /dev/null
+++ b/arch/powerpc/boot/elf_util.c
@@ -0,0 +1,76 @@
1/*
2 * Copyright (C) Paul Mackerras 1997.
3 *
4 * Updates for PPC64 by Todd Inglett, Dave Engebretsen & Peter Bergner.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <stdarg.h>
12#include <stddef.h>
13#include "elf.h"
14#include "page.h"
15#include "string.h"
16#include "stdio.h"
17
18int parse_elf64(void *hdr, struct elf_info *info)
19{
20 Elf64_Ehdr *elf64 = hdr;
21 Elf64_Phdr *elf64ph;
22 unsigned int i;
23
24 if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 &&
25 elf64->e_ident[EI_MAG1] == ELFMAG1 &&
26 elf64->e_ident[EI_MAG2] == ELFMAG2 &&
27 elf64->e_ident[EI_MAG3] == ELFMAG3 &&
28 elf64->e_ident[EI_CLASS] == ELFCLASS64 &&
29 elf64->e_ident[EI_DATA] == ELFDATA2MSB &&
30 elf64->e_type == ET_EXEC &&
31 elf64->e_machine == EM_PPC64))
32 return 0;
33
34 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
35 (unsigned long)elf64->e_phoff);
36 for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++)
37 if (elf64ph->p_type == PT_LOAD)
38 break;
39 if (i >= (unsigned int)elf64->e_phnum)
40 return 0;
41
42 info->loadsize = (unsigned long)elf64ph->p_filesz;
43 info->memsize = (unsigned long)elf64ph->p_memsz;
44 info->elfoffset = (unsigned long)elf64ph->p_offset;
45
46 return 1;
47}
48
49int parse_elf32(void *hdr, struct elf_info *info)
50{
51 Elf32_Ehdr *elf32 = hdr;
52 Elf32_Phdr *elf32ph;
53 unsigned int i;
54
55 if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 &&
56 elf32->e_ident[EI_MAG1] == ELFMAG1 &&
57 elf32->e_ident[EI_MAG2] == ELFMAG2 &&
58 elf32->e_ident[EI_MAG3] == ELFMAG3 &&
59 elf32->e_ident[EI_CLASS] == ELFCLASS32 &&
60 elf32->e_ident[EI_DATA] == ELFDATA2MSB &&
61 elf32->e_type == ET_EXEC &&
62 elf32->e_machine == EM_PPC))
63 return 0;
64
65 elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff);
66 for (i = 0; i < elf32->e_phnum; i++, elf32ph++)
67 if (elf32ph->p_type == PT_LOAD)
68 break;
69 if (i >= elf32->e_phnum)
70 return 0;
71
72 info->loadsize = elf32ph->p_filesz;
73 info->memsize = elf32ph->p_memsz;
74 info->elfoffset = elf32ph->p_offset;
75 return 1;
76}
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index c76c194715b2..d00fbd92a458 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -29,12 +29,20 @@
29 29
30#define _ALIGN(x, al) (((x) + (al) - 1) & ~((al) - 1)) 30#define _ALIGN(x, al) (((x) + (al) - 1) & ~((al) - 1))
31 31
32static char *ft_root_node(struct ft_cxt *cxt)
33{
34 return cxt->rgn[FT_STRUCT].start;
35}
36
32/* Routines for keeping node ptrs returned by ft_find_device current */ 37/* Routines for keeping node ptrs returned by ft_find_device current */
33/* First entry not used b/c it would return 0 and be taken as NULL/error */ 38/* First entry not used b/c it would return 0 and be taken as NULL/error */
34static void *ft_node_add(struct ft_cxt *cxt, char *node) 39static void *ft_get_phandle(struct ft_cxt *cxt, char *node)
35{ 40{
36 unsigned int i; 41 unsigned int i;
37 42
43 if (!node)
44 return NULL;
45
38 for (i = 1; i < cxt->nodes_used; i++) /* already there? */ 46 for (i = 1; i < cxt->nodes_used; i++) /* already there? */
39 if (cxt->node_tbl[i] == node) 47 if (cxt->node_tbl[i] == node)
40 return (void *)i; 48 return (void *)i;
@@ -238,7 +246,7 @@ static int ft_shuffle(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
238 if (rgn == FT_STRUCT) 246 if (rgn == FT_STRUCT)
239 ft_node_update_before(cxt, p, -nextra); 247 ft_node_update_before(cxt, p, -nextra);
240 } 248 }
241 *p -= nextra; 249 *pp -= nextra;
242 cxt->rgn[rgn].start -= nextra; 250 cxt->rgn[rgn].start -= nextra;
243 cxt->rgn[rgn].size += nextra; 251 cxt->rgn[rgn].size += nextra;
244 return 1; 252 return 1;
@@ -253,8 +261,14 @@ static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
253 char *str, *next; 261 char *str, *next;
254 enum ft_rgn_id r; 262 enum ft_rgn_id r;
255 263
256 if (!cxt->isordered && !ft_reorder(cxt, nextra)) 264 if (!cxt->isordered) {
257 return 0; 265 unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
266
267 if (!ft_reorder(cxt, nextra))
268 return 0;
269
270 *pp = cxt->rgn[rgn].start + rgn_off;
271 }
258 if (ft_shuffle(cxt, pp, rgn, nextra)) 272 if (ft_shuffle(cxt, pp, rgn, nextra))
259 return 1; 273 return 1;
260 274
@@ -415,7 +429,7 @@ int ft_prop(struct ft_cxt *cxt, const char *name, const void *data,
415{ 429{
416 int off, len; 430 int off, len;
417 431
418 off = lookup_string(cxt, name); 432 off = map_string(cxt, name);
419 if (off == NO_STRING) 433 if (off == NO_STRING)
420 return -1; 434 return -1;
421 435
@@ -590,7 +604,7 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size)
590 604
591void ft_begin_tree(struct ft_cxt *cxt) 605void ft_begin_tree(struct ft_cxt *cxt)
592{ 606{
593 cxt->p = cxt->rgn[FT_STRUCT].start; 607 cxt->p = ft_root_node(cxt);
594} 608}
595 609
596void ft_end_tree(struct ft_cxt *cxt) 610void ft_end_tree(struct ft_cxt *cxt)
@@ -636,8 +650,21 @@ void *ft_find_device(struct ft_cxt *cxt, const char *srch_path)
636 /* require absolute path */ 650 /* require absolute path */
637 if (srch_path[0] != '/') 651 if (srch_path[0] != '/')
638 return NULL; 652 return NULL;
639 node = ft_find_descendent(cxt, cxt->rgn[FT_STRUCT].start, srch_path); 653 node = ft_find_descendent(cxt, ft_root_node(cxt), srch_path);
640 return ft_node_add(cxt, node); 654 return ft_get_phandle(cxt, node);
655}
656
657void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
658 const char *srch_path)
659{
660 char *node;
661
662 node = ft_node_ph2node(cxt, top);
663 if (node == NULL)
664 return NULL;
665
666 node = ft_find_descendent(cxt, node, srch_path);
667 return ft_get_phandle(cxt, node);
641} 668}
642 669
643void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path) 670void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
@@ -701,23 +728,18 @@ void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
701 return NULL; 728 return NULL;
702} 729}
703 730
704void *ft_get_parent(struct ft_cxt *cxt, const void *phandle) 731void *__ft_get_parent(struct ft_cxt *cxt, void *node)
705{ 732{
706 void *node;
707 int d; 733 int d;
708 struct ft_atom atom; 734 struct ft_atom atom;
709 char *p; 735 char *p;
710 736
711 node = ft_node_ph2node(cxt, phandle);
712 if (node == NULL)
713 return NULL;
714
715 for (d = 0; cxt->genealogy[d] != NULL; ++d) 737 for (d = 0; cxt->genealogy[d] != NULL; ++d)
716 if (cxt->genealogy[d] == node) 738 if (cxt->genealogy[d] == node)
717 return cxt->genealogy[d > 0 ? d - 1 : 0]; 739 return d > 0 ? cxt->genealogy[d - 1] : NULL;
718 740
719 /* have to do it the hard way... */ 741 /* have to do it the hard way... */
720 p = cxt->rgn[FT_STRUCT].start; 742 p = ft_root_node(cxt);
721 d = 0; 743 d = 0;
722 while ((p = ft_next(cxt, p, &atom)) != NULL) { 744 while ((p = ft_next(cxt, p, &atom)) != NULL) {
723 switch (atom.tag) { 745 switch (atom.tag) {
@@ -726,7 +748,7 @@ void *ft_get_parent(struct ft_cxt *cxt, const void *phandle)
726 if (node == atom.data) { 748 if (node == atom.data) {
727 /* found it */ 749 /* found it */
728 cxt->genealogy[d + 1] = NULL; 750 cxt->genealogy[d + 1] = NULL;
729 return d > 0 ? cxt->genealogy[d - 1] : node; 751 return d > 0 ? cxt->genealogy[d - 1] : NULL;
730 } 752 }
731 ++d; 753 ++d;
732 break; 754 break;
@@ -738,41 +760,131 @@ void *ft_get_parent(struct ft_cxt *cxt, const void *phandle)
738 return NULL; 760 return NULL;
739} 761}
740 762
741int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, 763void *ft_get_parent(struct ft_cxt *cxt, const void *phandle)
742 void *buf, const unsigned int buflen)
743{ 764{
744 struct ft_atom atom; 765 void *node = ft_node_ph2node(cxt, phandle);
745 void *node;
746 char *p;
747 int depth;
748 unsigned int size;
749
750 node = ft_node_ph2node(cxt, phandle);
751 if (node == NULL) 766 if (node == NULL)
752 return -1; 767 return NULL;
753 768
754 depth = 0; 769 node = __ft_get_parent(cxt, node);
755 p = (char *)node; 770 return ft_get_phandle(cxt, node);
771}
756 772
757 while ((p = ft_next(cxt, p, &atom)) != NULL) { 773static const void *__ft_get_prop(struct ft_cxt *cxt, void *node,
774 const char *propname, unsigned int *len)
775{
776 struct ft_atom atom;
777 int depth = 0;
778
779 while ((node = ft_next(cxt, node, &atom)) != NULL) {
758 switch (atom.tag) { 780 switch (atom.tag) {
759 case OF_DT_BEGIN_NODE: 781 case OF_DT_BEGIN_NODE:
760 ++depth; 782 ++depth;
761 break; 783 break;
784
762 case OF_DT_PROP: 785 case OF_DT_PROP:
763 if ((depth != 1) || strcmp(atom.name, propname)) 786 if (depth != 1 || strcmp(atom.name, propname))
764 break; 787 break;
765 size = min(atom.size, buflen); 788
766 memcpy(buf, atom.data, size); 789 if (len)
767 return atom.size; 790 *len = atom.size;
791
792 return atom.data;
793
768 case OF_DT_END_NODE: 794 case OF_DT_END_NODE:
769 if (--depth <= 0) 795 if (--depth <= 0)
770 return -1; 796 return NULL;
771 } 797 }
772 } 798 }
799
800 return NULL;
801}
802
803int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
804 void *buf, const unsigned int buflen)
805{
806 const void *data;
807 unsigned int size;
808
809 void *node = ft_node_ph2node(cxt, phandle);
810 if (!node)
811 return -1;
812
813 data = __ft_get_prop(cxt, node, propname, &size);
814 if (data) {
815 unsigned int clipped_size = min(size, buflen);
816 memcpy(buf, data, clipped_size);
817 return size;
818 }
819
773 return -1; 820 return -1;
774} 821}
775 822
823void *__ft_find_node_by_prop_value(struct ft_cxt *cxt, void *prev,
824 const char *propname, const char *propval,
825 unsigned int proplen)
826{
827 struct ft_atom atom;
828 char *p = ft_root_node(cxt);
829 char *next;
830 int past_prev = prev ? 0 : 1;
831 int depth = -1;
832
833 while ((next = ft_next(cxt, p, &atom)) != NULL) {
834 const void *data;
835 unsigned int size;
836
837 switch (atom.tag) {
838 case OF_DT_BEGIN_NODE:
839 depth++;
840
841 if (prev == p) {
842 past_prev = 1;
843 break;
844 }
845
846 if (!past_prev || depth < 1)
847 break;
848
849 data = __ft_get_prop(cxt, p, propname, &size);
850 if (!data || size != proplen)
851 break;
852 if (memcmp(data, propval, size))
853 break;
854
855 return p;
856
857 case OF_DT_END_NODE:
858 if (depth-- == 0)
859 return NULL;
860
861 break;
862 }
863
864 p = next;
865 }
866
867 return NULL;
868}
869
870void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
871 const char *propname, const char *propval,
872 int proplen)
873{
874 void *node = NULL;
875
876 if (prev) {
877 node = ft_node_ph2node(cxt, prev);
878
879 if (!node)
880 return NULL;
881 }
882
883 node = __ft_find_node_by_prop_value(cxt, node, propname,
884 propval, proplen);
885 return ft_get_phandle(cxt, node);
886}
887
776int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, 888int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
777 const void *buf, const unsigned int buflen) 889 const void *buf, const unsigned int buflen)
778{ 890{
@@ -849,19 +961,26 @@ int ft_del_prop(struct ft_cxt *cxt, const void *phandle, const char *propname)
849 return -1; 961 return -1;
850} 962}
851 963
852void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *path) 964void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name)
853{ 965{
854 struct ft_atom atom; 966 struct ft_atom atom;
855 char *p, *next; 967 char *p, *next;
856 int depth = 0; 968 int depth = 0;
857 969
858 p = cxt->rgn[FT_STRUCT].start; 970 if (parent) {
971 p = ft_node_ph2node(cxt, parent);
972 if (!p)
973 return NULL;
974 } else {
975 p = ft_root_node(cxt);
976 }
977
859 while ((next = ft_next(cxt, p, &atom)) != NULL) { 978 while ((next = ft_next(cxt, p, &atom)) != NULL) {
860 switch (atom.tag) { 979 switch (atom.tag) {
861 case OF_DT_BEGIN_NODE: 980 case OF_DT_BEGIN_NODE:
862 ++depth; 981 ++depth;
863 if (depth == 1 && strcmp(atom.name, path) == 0) 982 if (depth == 1 && strcmp(atom.name, name) == 0)
864 /* duplicate node path, return error */ 983 /* duplicate node name, return error */
865 return NULL; 984 return NULL;
866 break; 985 break;
867 case OF_DT_END_NODE: 986 case OF_DT_END_NODE:
@@ -870,7 +989,7 @@ void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *path)
870 break; 989 break;
871 /* end of node, insert here */ 990 /* end of node, insert here */
872 cxt->p = p; 991 cxt->p = p;
873 ft_begin_node(cxt, path); 992 ft_begin_node(cxt, name);
874 ft_end_node(cxt); 993 ft_end_node(cxt);
875 return p; 994 return p;
876 } 995 }
diff --git a/arch/powerpc/boot/flatdevtree.h b/arch/powerpc/boot/flatdevtree.h
index b9cd9f61f351..cb26325d72db 100644
--- a/arch/powerpc/boot/flatdevtree.h
+++ b/arch/powerpc/boot/flatdevtree.h
@@ -97,10 +97,17 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
97void ft_dump_blob(const void *bphp); 97void ft_dump_blob(const void *bphp);
98void ft_merge_blob(struct ft_cxt *cxt, void *blob); 98void ft_merge_blob(struct ft_cxt *cxt, void *blob);
99void *ft_find_device(struct ft_cxt *cxt, const char *srch_path); 99void *ft_find_device(struct ft_cxt *cxt, const char *srch_path);
100void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
101 const char *srch_path);
100void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path); 102void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
101int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, 103int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
102 void *buf, const unsigned int buflen); 104 void *buf, const unsigned int buflen);
103int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, 105int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
104 const void *buf, const unsigned int buflen); 106 const void *buf, const unsigned int buflen);
107void *ft_get_parent(struct ft_cxt *cxt, const void *phandle);
108void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
109 const char *propname, const char *propval,
110 int proplen);
111void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name);
105 112
106#endif /* FLATDEVTREE_H */ 113#endif /* FLATDEVTREE_H */
diff --git a/arch/powerpc/boot/flatdevtree_misc.c b/arch/powerpc/boot/flatdevtree_misc.c
index 04da38fa477f..4341e6558c1a 100644
--- a/arch/powerpc/boot/flatdevtree_misc.c
+++ b/arch/powerpc/boot/flatdevtree_misc.c
@@ -16,24 +16,43 @@
16 16
17static struct ft_cxt cxt; 17static struct ft_cxt cxt;
18 18
19static void *ft_finddevice(const char *name) 19static void *fdtm_finddevice(const char *name)
20{ 20{
21 return ft_find_device(&cxt, name); 21 return ft_find_device(&cxt, name);
22} 22}
23 23
24static int ft_getprop(const void *phandle, const char *propname, void *buf, 24static int fdtm_getprop(const void *phandle, const char *propname,
25 const int buflen) 25 void *buf, const int buflen)
26{ 26{
27 return ft_get_prop(&cxt, phandle, propname, buf, buflen); 27 return ft_get_prop(&cxt, phandle, propname, buf, buflen);
28} 28}
29 29
30static int ft_setprop(const void *phandle, const char *propname, 30static int fdtm_setprop(const void *phandle, const char *propname,
31 const void *buf, const int buflen) 31 const void *buf, const int buflen)
32{ 32{
33 return ft_set_prop(&cxt, phandle, propname, buf, buflen); 33 return ft_set_prop(&cxt, phandle, propname, buf, buflen);
34} 34}
35 35
36static unsigned long ft_finalize(void) 36static void *fdtm_get_parent(const void *phandle)
37{
38 return ft_get_parent(&cxt, phandle);
39}
40
41static void *fdtm_create_node(const void *phandle, const char *name)
42{
43 return ft_create_node(&cxt, phandle, name);
44}
45
46static void *fdtm_find_node_by_prop_value(const void *prev,
47 const char *propname,
48 const char *propval,
49 int proplen)
50{
51 return ft_find_node_by_prop_value(&cxt, prev, propname,
52 propval, proplen);
53}
54
55static unsigned long fdtm_finalize(void)
37{ 56{
38 ft_end_tree(&cxt); 57 ft_end_tree(&cxt);
39 return (unsigned long)cxt.bph; 58 return (unsigned long)cxt.bph;
@@ -41,10 +60,13 @@ static unsigned long ft_finalize(void)
41 60
42int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device) 61int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
43{ 62{
44 dt_ops.finddevice = ft_finddevice; 63 dt_ops.finddevice = fdtm_finddevice;
45 dt_ops.getprop = ft_getprop; 64 dt_ops.getprop = fdtm_getprop;
46 dt_ops.setprop = ft_setprop; 65 dt_ops.setprop = fdtm_setprop;
47 dt_ops.finalize = ft_finalize; 66 dt_ops.get_parent = fdtm_get_parent;
67 dt_ops.create_node = fdtm_create_node;
68 dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value;
69 dt_ops.finalize = fdtm_finalize;
48 70
49 return ft_open(&cxt, dt_blob, max_size, max_find_device, 71 return ft_open(&cxt, dt_blob, max_size, max_find_device,
50 platform_ops.realloc); 72 platform_ops.realloc);
diff --git a/arch/powerpc/boot/gunzip_util.c b/arch/powerpc/boot/gunzip_util.c
new file mode 100644
index 000000000000..df8ab07e9ff4
--- /dev/null
+++ b/arch/powerpc/boot/gunzip_util.c
@@ -0,0 +1,206 @@
1/*
2 * Copyright 2007 David Gibson, IBM Corporation.
3 * Based on earlier work, Copyright (C) Paul Mackerras 1997.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include <stddef.h>
12#include "string.h"
13#include "stdio.h"
14#include "ops.h"
15#include "gunzip_util.h"
16
17#define HEAD_CRC 2
18#define EXTRA_FIELD 4
19#define ORIG_NAME 8
20#define COMMENT 0x10
21#define RESERVED 0xe0
22
23/**
24 * gunzip_start - prepare to decompress gzip data
25 * @state: decompressor state structure to be initialized
26 * @src: buffer containing gzip compressed or uncompressed data
27 * @srclen: size in bytes of the buffer at src
28 *
29 * If the buffer at @src contains a gzip header, this function
30 * initializes zlib to decompress the data, storing the decompression
31 * state in @state. The other functions in this file can then be used
32 * to decompress data from the gzipped stream.
33 *
34 * If the buffer at @src does not contain a gzip header, it is assumed
35 * to contain uncompressed data. The buffer information is recorded
36 * in @state and the other functions in this file will simply copy
37 * data from the uncompressed data stream at @src.
38 *
39 * Any errors, such as bad compressed data, cause an error to be
40 * printed an the platform's exit() function to be called.
41 */
42void gunzip_start(struct gunzip_state *state, void *src, int srclen)
43{
44 char *hdr = src;
45 int hdrlen = 0;
46
47 memset(state, 0, sizeof(*state));
48
49 /* Check for gzip magic number */
50 if ((hdr[0] == 0x1f) && (hdr[1] == 0x8b)) {
51 /* gzip data, initialize zlib parameters */
52 int r, flags;
53
54 state->s.workspace = state->scratch;
55 if (zlib_inflate_workspacesize() > sizeof(state->scratch))
56 fatal("insufficient scratch space for gunzip\n\r");
57
58 /* skip header */
59 hdrlen = 10;
60 flags = hdr[3];
61 if (hdr[2] != Z_DEFLATED || (flags & RESERVED) != 0)
62 fatal("bad gzipped data\n\r");
63 if ((flags & EXTRA_FIELD) != 0)
64 hdrlen = 12 + hdr[10] + (hdr[11] << 8);
65 if ((flags & ORIG_NAME) != 0)
66 while (hdr[hdrlen++] != 0)
67 ;
68 if ((flags & COMMENT) != 0)
69 while (hdr[hdrlen++] != 0)
70 ;
71 if ((flags & HEAD_CRC) != 0)
72 hdrlen += 2;
73 if (hdrlen >= srclen)
74 fatal("gunzip_start: ran out of data in header\n\r");
75
76 r = zlib_inflateInit2(&state->s, -MAX_WBITS);
77 if (r != Z_OK)
78 fatal("inflateInit2 returned %d\n\r", r);
79 }
80
81 state->s.next_in = src + hdrlen;
82 state->s.avail_in = srclen - hdrlen;
83}
84
85/**
86 * gunzip_partial - extract bytes from a gzip data stream
87 * @state: gzip state structure previously initialized by gunzip_start()
88 * @dst: buffer to store extracted data
89 * @dstlen: maximum number of bytes to extract
90 *
91 * This function extracts at most @dstlen bytes from the data stream
92 * previously associated with @state by gunzip_start(), decompressing
93 * if necessary. Exactly @dstlen bytes are extracted unless the data
94 * stream doesn't contain enough bytes, in which case the entire
95 * remainder of the stream is decompressed.
96 *
97 * Returns the actual number of bytes extracted. If any errors occur,
98 * such as a corrupted compressed stream, an error is printed an the
99 * platform's exit() function is called.
100 */
101int gunzip_partial(struct gunzip_state *state, void *dst, int dstlen)
102{
103 int len;
104
105 if (state->s.workspace) {
106 /* gunzipping */
107 int r;
108
109 state->s.next_out = dst;
110 state->s.avail_out = dstlen;
111 r = zlib_inflate(&state->s, Z_FULL_FLUSH);
112 if (r != Z_OK && r != Z_STREAM_END)
113 fatal("inflate returned %d msg: %s\n\r", r, state->s.msg);
114 len = state->s.next_out - (unsigned char *)dst;
115 } else {
116 /* uncompressed image */
117 len = min(state->s.avail_in, (unsigned)dstlen);
118 memcpy(dst, state->s.next_in, len);
119 state->s.next_in += len;
120 state->s.avail_in -= len;
121 }
122 return len;
123}
124
125/**
126 * gunzip_exactly - extract a fixed number of bytes from a gzip data stream
127 * @state: gzip state structure previously initialized by gunzip_start()
128 * @dst: buffer to store extracted data
129 * @dstlen: number of bytes to extract
130 *
131 * This function extracts exactly @dstlen bytes from the data stream
132 * previously associated with @state by gunzip_start(), decompressing
133 * if necessary.
134 *
135 * If there are less @dstlen bytes available in the data stream, or if
136 * any other errors occur, such as a corrupted compressed stream, an
137 * error is printed an the platform's exit() function is called.
138 */
139void gunzip_exactly(struct gunzip_state *state, void *dst, int dstlen)
140{
141 int len;
142
143 len = gunzip_partial(state, dst, dstlen);
144 if (len < dstlen)
145 fatal("\n\rgunzip_exactly: ran out of data!"
146 " Wanted %d, got %d.\n\r", dstlen, len);
147}
148
149/**
150 * gunzip_discard - discard bytes from a gzip data stream
151 * @state: gzip state structure previously initialized by gunzip_start()
152 * @len: number of bytes to discard
153 *
154 * This function extracts, then discards exactly @len bytes from the
155 * data stream previously associated with @state by gunzip_start().
156 * Subsequent gunzip_partial(), gunzip_exactly() or gunzip_finish()
157 * calls will extract the data following the discarded bytes in the
158 * data stream.
159 *
160 * If there are less @len bytes available in the data stream, or if
161 * any other errors occur, such as a corrupted compressed stream, an
162 * error is printed an the platform's exit() function is called.
163 */
164void gunzip_discard(struct gunzip_state *state, int len)
165{
166 static char discard_buf[128];
167
168 while (len > sizeof(discard_buf)) {
169 gunzip_exactly(state, discard_buf, sizeof(discard_buf));
170 len -= sizeof(discard_buf);
171 }
172
173 if (len > 0)
174 gunzip_exactly(state, discard_buf, len);
175}
176
177/**
178 * gunzip_finish - extract all remaining bytes from a gzip data stream
179 * @state: gzip state structure previously initialized by gunzip_start()
180 * @dst: buffer to store extracted data
181 * @dstlen: maximum number of bytes to extract
182 *
183 * This function extracts all remaining data, or at most @dstlen
184 * bytes, from the stream previously associated with @state by
185 * gunzip_start(). zlib is then shut down, so it is an error to use
186 * any of the functions in this file on @state until it is
187 * re-initialized with another call to gunzip_start().
188 *
189 * If any errors occur, such as a corrupted compressed stream, an
190 * error is printed an the platform's exit() function is called.
191 */
192int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen)
193{
194 int len;
195
196 if (state->s.workspace) {
197 len = gunzip_partial(state, dst, dstlen);
198 zlib_inflateEnd(&state->s);
199 } else {
200 /* uncompressed image */
201 len = min(state->s.avail_in, (unsigned)dstlen);
202 memcpy(dst, state->s.next_in, len);
203 }
204
205 return len;
206}
diff --git a/arch/powerpc/boot/gunzip_util.h b/arch/powerpc/boot/gunzip_util.h
new file mode 100644
index 000000000000..b3dfa6e87b3a
--- /dev/null
+++ b/arch/powerpc/boot/gunzip_util.h
@@ -0,0 +1,45 @@
1/*
2 * Decompression convenience functions
3 *
4 * Copyright 2007 David Gibson, IBM Corporation.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#ifndef _PPC_BOOT_GUNZIP_UTIL_H_
11#define _PPC_BOOT_GUNZIP_UTIL_H_
12
13#include "zlib.h"
14
15/*
16 * These functions are designed to make life easy for decompressing
17 * kernel images, initrd images or any other gzip compressed image,
18 * particularly if its useful to decompress part of the image (e.g. to
19 * examine headers) before decompressing the remainder.
20 *
21 * To use:
22 * - declare a gunzip_state structure
23 * - use gunzip_start() to initialize the state, associating it
24 * with a stream of compressed data
25 * - use gunzip_partial(), gunzip_exactly() and gunzip_discard()
26 * in any combination to extract pieces of data from the stream
27 * - Finally use gunzip_finish() to extract the tail of the
28 * compressed stream and wind up zlib
29 */
30
31/* scratch space for gunzip; 46912 is from zlib_inflate_workspacesize() */
32#define GUNZIP_SCRATCH_SIZE 46912
33
34struct gunzip_state {
35 z_stream s;
36 char scratch[46912];
37};
38
39void gunzip_start(struct gunzip_state *state, void *src, int srclen);
40int gunzip_partial(struct gunzip_state *state, void *dst, int dstlen);
41void gunzip_exactly(struct gunzip_state *state, void *dst, int len);
42void gunzip_discard(struct gunzip_state *state, int len);
43int gunzip_finish(struct gunzip_state *state, void *dst, int len);
44
45#endif /* _PPC_BOOT_GUNZIP_UTIL_H_ */
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 6f6b50d238b6..56b56a8d4b23 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -14,11 +14,10 @@
14#include "page.h" 14#include "page.h"
15#include "string.h" 15#include "string.h"
16#include "stdio.h" 16#include "stdio.h"
17#include "zlib.h"
18#include "ops.h" 17#include "ops.h"
18#include "gunzip_util.h"
19#include "flatdevtree.h" 19#include "flatdevtree.h"
20 20#include "reg.h"
21extern void flush_cache(void *, unsigned long);
22 21
23extern char _start[]; 22extern char _start[];
24extern char __bss_start[]; 23extern char __bss_start[];
@@ -30,304 +29,173 @@ extern char _initrd_end[];
30extern char _dtb_start[]; 29extern char _dtb_start[];
31extern char _dtb_end[]; 30extern char _dtb_end[];
32 31
32static struct gunzip_state gzstate;
33
33struct addr_range { 34struct addr_range {
34 unsigned long addr; 35 void *addr;
35 unsigned long size; 36 unsigned long size;
36 unsigned long memsize;
37}; 37};
38static struct addr_range vmlinux;
39static struct addr_range vmlinuz;
40static struct addr_range initrd;
41
42static unsigned long elfoffset;
43static int is_64bit;
44
45/* scratch space for gunzip; 46912 is from zlib_inflate_workspacesize() */
46static char scratch[46912];
47static char elfheader[256];
48 38
49typedef void (*kernel_entry_t)(unsigned long, unsigned long, void *); 39typedef void (*kernel_entry_t)(unsigned long, unsigned long, void *);
50 40
51#undef DEBUG 41#undef DEBUG
52 42
53#define HEAD_CRC 2 43static struct addr_range prep_kernel(void)
54#define EXTRA_FIELD 4
55#define ORIG_NAME 8
56#define COMMENT 0x10
57#define RESERVED 0xe0
58
59static void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
60{ 44{
61 z_stream s; 45 char elfheader[256];
62 int r, i, flags; 46 void *vmlinuz_addr = _vmlinux_start;
63 47 unsigned long vmlinuz_size = _vmlinux_end - _vmlinux_start;
64 /* skip header */ 48 void *addr = 0;
65 i = 10; 49 struct elf_info ei;
66 flags = src[3]; 50 int len;
67 if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) {
68 printf("bad gzipped data\n\r");
69 exit();
70 }
71 if ((flags & EXTRA_FIELD) != 0)
72 i = 12 + src[10] + (src[11] << 8);
73 if ((flags & ORIG_NAME) != 0)
74 while (src[i++] != 0)
75 ;
76 if ((flags & COMMENT) != 0)
77 while (src[i++] != 0)
78 ;
79 if ((flags & HEAD_CRC) != 0)
80 i += 2;
81 if (i >= *lenp) {
82 printf("gunzip: ran out of data in header\n\r");
83 exit();
84 }
85 51
86 if (zlib_inflate_workspacesize() > sizeof(scratch)) { 52 /* gunzip the ELF header of the kernel */
87 printf("gunzip needs more mem\n"); 53 gunzip_start(&gzstate, vmlinuz_addr, vmlinuz_size);
88 exit(); 54 gunzip_exactly(&gzstate, elfheader, sizeof(elfheader));
89 } 55
90 memset(&s, 0, sizeof(s)); 56 if (!parse_elf64(elfheader, &ei) && !parse_elf32(elfheader, &ei))
91 s.workspace = scratch; 57 fatal("Error: not a valid PPC32 or PPC64 ELF file!\n\r");
92 r = zlib_inflateInit2(&s, -MAX_WBITS); 58
93 if (r != Z_OK) { 59 if (platform_ops.image_hdr)
94 printf("inflateInit2 returned %d\n\r", r); 60 platform_ops.image_hdr(elfheader);
95 exit(); 61
96 } 62 /* We need to alloc the memsize: gzip will expand the kernel
97 s.next_in = src + i; 63 * text/data, then possible rubbish we don't care about. But
98 s.avail_in = *lenp - i; 64 * the kernel bss must be claimed (it will be zero'd by the
99 s.next_out = dst; 65 * kernel itself)
100 s.avail_out = dstlen; 66 */
101 r = zlib_inflate(&s, Z_FULL_FLUSH); 67 printf("Allocating 0x%lx bytes for kernel ...\n\r", ei.memsize);
102 if (r != Z_OK && r != Z_STREAM_END) { 68
103 printf("inflate returned %d msg: %s\n\r", r, s.msg); 69 if (platform_ops.vmlinux_alloc) {
104 exit(); 70 addr = platform_ops.vmlinux_alloc(ei.memsize);
71 } else {
72 if ((unsigned long)_start < ei.memsize)
73 fatal("Insufficient memory for kernel at address 0!"
74 " (_start=%p)\n\r", _start);
105 } 75 }
106 *lenp = s.next_out - (unsigned char *) dst;
107 zlib_inflateEnd(&s);
108}
109 76
110static int is_elf64(void *hdr) 77 /* Finally, gunzip the kernel */
111{ 78 printf("gunzipping (0x%p <- 0x%p:0x%p)...", addr,
112 Elf64_Ehdr *elf64 = hdr; 79 vmlinuz_addr, vmlinuz_addr+vmlinuz_size);
113 Elf64_Phdr *elf64ph; 80 /* discard up to the actual load data */
114 unsigned int i; 81 gunzip_discard(&gzstate, ei.elfoffset - sizeof(elfheader));
115 82 len = gunzip_finish(&gzstate, addr, ei.loadsize);
116 if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 && 83 if (len != ei.loadsize)
117 elf64->e_ident[EI_MAG1] == ELFMAG1 && 84 fatal("ran out of data! only got 0x%x of 0x%lx bytes.\n\r",
118 elf64->e_ident[EI_MAG2] == ELFMAG2 && 85 len, ei.loadsize);
119 elf64->e_ident[EI_MAG3] == ELFMAG3 && 86 printf("done 0x%x bytes\n\r", len);
120 elf64->e_ident[EI_CLASS] == ELFCLASS64 &&
121 elf64->e_ident[EI_DATA] == ELFDATA2MSB &&
122 elf64->e_type == ET_EXEC &&
123 elf64->e_machine == EM_PPC64))
124 return 0;
125
126 elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
127 (unsigned long)elf64->e_phoff);
128 for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++)
129 if (elf64ph->p_type == PT_LOAD)
130 break;
131 if (i >= (unsigned int)elf64->e_phnum)
132 return 0;
133
134 elfoffset = (unsigned long)elf64ph->p_offset;
135 vmlinux.size = (unsigned long)elf64ph->p_filesz + elfoffset;
136 vmlinux.memsize = (unsigned long)elf64ph->p_memsz + elfoffset;
137
138 is_64bit = 1;
139 return 1;
140}
141 87
142static int is_elf32(void *hdr) 88 flush_cache(addr, ei.loadsize);
143{ 89
144 Elf32_Ehdr *elf32 = hdr; 90 return (struct addr_range){addr, ei.memsize};
145 Elf32_Phdr *elf32ph;
146 unsigned int i;
147
148 if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 &&
149 elf32->e_ident[EI_MAG1] == ELFMAG1 &&
150 elf32->e_ident[EI_MAG2] == ELFMAG2 &&
151 elf32->e_ident[EI_MAG3] == ELFMAG3 &&
152 elf32->e_ident[EI_CLASS] == ELFCLASS32 &&
153 elf32->e_ident[EI_DATA] == ELFDATA2MSB &&
154 elf32->e_type == ET_EXEC &&
155 elf32->e_machine == EM_PPC))
156 return 0;
157
158 elf32 = (Elf32_Ehdr *)elfheader;
159 elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff);
160 for (i = 0; i < elf32->e_phnum; i++, elf32ph++)
161 if (elf32ph->p_type == PT_LOAD)
162 break;
163 if (i >= elf32->e_phnum)
164 return 0;
165
166 elfoffset = elf32ph->p_offset;
167 vmlinux.size = elf32ph->p_filesz + elf32ph->p_offset;
168 vmlinux.memsize = elf32ph->p_memsz + elf32ph->p_offset;
169 return 1;
170} 91}
171 92
172static void prep_kernel(unsigned long a1, unsigned long a2) 93static struct addr_range prep_initrd(struct addr_range vmlinux, void *chosen,
94 unsigned long initrd_addr,
95 unsigned long initrd_size)
173{ 96{
174 int len; 97 /* If we have an image attached to us, it overrides anything
175 98 * supplied by the loader. */
176 vmlinuz.addr = (unsigned long)_vmlinux_start; 99 if (_initrd_end > _initrd_start) {
177 vmlinuz.size = (unsigned long)(_vmlinux_end - _vmlinux_start); 100 printf("Attached initrd image at 0x%p-0x%p\n\r",
178 101 _initrd_start, _initrd_end);
179 /* gunzip the ELF header of the kernel */ 102 initrd_addr = (unsigned long)_initrd_start;
180 if (*(unsigned short *)vmlinuz.addr == 0x1f8b) { 103 initrd_size = _initrd_end - _initrd_start;
181 len = vmlinuz.size; 104 } else if (initrd_size > 0) {
182 gunzip(elfheader, sizeof(elfheader), 105 printf("Using loader supplied ramdisk at 0x%lx-0x%lx\n\r",
183 (unsigned char *)vmlinuz.addr, &len); 106 initrd_addr, initrd_addr + initrd_size);
184 } else
185 memcpy(elfheader, (const void *)vmlinuz.addr,
186 sizeof(elfheader));
187
188 if (!is_elf64(elfheader) && !is_elf32(elfheader)) {
189 printf("Error: not a valid PPC32 or PPC64 ELF file!\n\r");
190 exit();
191 } 107 }
192 if (platform_ops.image_hdr)
193 platform_ops.image_hdr(elfheader);
194 108
195 /* We need to alloc the memsize plus the file offset since gzip 109 /* If there's no initrd at all, we're done */
196 * will expand the header (file offset), then the kernel, then 110 if (! initrd_size)
197 * possible rubbish we don't care about. But the kernel bss must 111 return (struct addr_range){0, 0};
198 * be claimed (it will be zero'd by the kernel itself)
199 */
200 printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux.memsize);
201 vmlinux.addr = (unsigned long)malloc(vmlinux.memsize);
202 if (vmlinux.addr == 0) {
203 printf("Can't allocate memory for kernel image !\n\r");
204 exit();
205 }
206 112
207 /* 113 /*
208 * Now find the initrd 114 * If the initrd is too low it will be clobbered when the
209 * 115 * kernel relocates to its final location. In this case,
210 * First see if we have an image attached to us. If so 116 * allocate a safer place and move it.
211 * allocate memory for it and copy it there.
212 */ 117 */
213 initrd.size = (unsigned long)(_initrd_end - _initrd_start); 118 if (initrd_addr < vmlinux.size) {
214 initrd.memsize = initrd.size; 119 void *old_addr = (void *)initrd_addr;
215 if (initrd.size > 0) { 120
216 printf("Allocating 0x%lx bytes for initrd ...\n\r", 121 printf("Allocating 0x%lx bytes for initrd ...\n\r",
217 initrd.size); 122 initrd_size);
218 initrd.addr = (unsigned long)malloc((u32)initrd.size); 123 initrd_addr = (unsigned long)malloc(initrd_size);
219 if (initrd.addr == 0) { 124 if (! initrd_addr)
220 printf("Can't allocate memory for initial " 125 fatal("Can't allocate memory for initial "
221 "ramdisk !\n\r"); 126 "ramdisk !\n\r");
222 exit(); 127 printf("Relocating initrd 0x%lx <- 0x%p (0x%lx bytes)\n\r",
223 } 128 initrd_addr, old_addr, initrd_size);
224 printf("initial ramdisk moving 0x%lx <- 0x%lx " 129 memmove((void *)initrd_addr, old_addr, initrd_size);
225 "(0x%lx bytes)\n\r", initrd.addr,
226 (unsigned long)_initrd_start, initrd.size);
227 memmove((void *)initrd.addr, (void *)_initrd_start,
228 initrd.size);
229 printf("initrd head: 0x%lx\n\r",
230 *((unsigned long *)initrd.addr));
231 } else if (a2 != 0) {
232 /* Otherwise, see if yaboot or another loader gave us an initrd */
233 initrd.addr = a1;
234 initrd.memsize = initrd.size = a2;
235 printf("Using loader supplied initrd at 0x%lx (0x%lx bytes)\n\r",
236 initrd.addr, initrd.size);
237 } 130 }
238 131
239 /* Eventually gunzip the kernel */ 132 printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd_addr));
240 if (*(unsigned short *)vmlinuz.addr == 0x1f8b) {
241 printf("gunzipping (0x%lx <- 0x%lx:0x%0lx)...",
242 vmlinux.addr, vmlinuz.addr, vmlinuz.addr+vmlinuz.size);
243 len = vmlinuz.size;
244 gunzip((void *)vmlinux.addr, vmlinux.memsize,
245 (unsigned char *)vmlinuz.addr, &len);
246 printf("done 0x%lx bytes\n\r", len);
247 } else {
248 memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,
249 vmlinuz.size);
250 }
251 133
252 /* Skip over the ELF header */ 134 /* Tell the kernel initrd address via device tree */
253#ifdef DEBUG 135 setprop_val(chosen, "linux,initrd-start", (u32)(initrd_addr));
254 printf("... skipping 0x%lx bytes of ELF header\n\r", 136 setprop_val(chosen, "linux,initrd-end", (u32)(initrd_addr+initrd_size));
255 elfoffset);
256#endif
257 vmlinux.addr += elfoffset;
258 137
259 flush_cache((void *)vmlinux.addr, vmlinux.size); 138 return (struct addr_range){(void *)initrd_addr, initrd_size};
260} 139}
261 140
262/* A buffer that may be edited by tools operating on a zImage binary so as to 141/* A buffer that may be edited by tools operating on a zImage binary so as to
263 * edit the command line passed to vmlinux (by setting /chosen/bootargs). 142 * edit the command line passed to vmlinux (by setting /chosen/bootargs).
264 * The buffer is put in it's own section so that tools may locate it easier. 143 * The buffer is put in it's own section so that tools may locate it easier.
265 */ 144 */
266static char builtin_cmdline[COMMAND_LINE_SIZE] 145static char cmdline[COMMAND_LINE_SIZE]
267 __attribute__((__section__("__builtin_cmdline"))); 146 __attribute__((__section__("__builtin_cmdline")));
268 147
269static void get_cmdline(char *buf, int size) 148static void prep_cmdline(void *chosen)
270{ 149{
271 void *devp; 150 if (cmdline[0] == '\0')
272 int len = strlen(builtin_cmdline); 151 getprop(chosen, "bootargs", cmdline, COMMAND_LINE_SIZE-1);
273
274 buf[0] = '\0';
275
276 if (len > 0) { /* builtin_cmdline overrides dt's /chosen/bootargs */
277 len = min(len, size-1);
278 strncpy(buf, builtin_cmdline, len);
279 buf[len] = '\0';
280 }
281 else if ((devp = finddevice("/chosen")))
282 getprop(devp, "bootargs", buf, size);
283}
284 152
285static void set_cmdline(char *buf) 153 printf("\n\rLinux/PowerPC load: %s", cmdline);
286{ 154 /* If possible, edit the command line */
287 void *devp; 155 if (console_ops.edit_cmdline)
156 console_ops.edit_cmdline(cmdline, COMMAND_LINE_SIZE);
157 printf("\n\r");
288 158
289 if ((devp = finddevice("/chosen"))) 159 /* Put the command line back into the devtree for the kernel */
290 setprop(devp, "bootargs", buf, strlen(buf) + 1); 160 setprop_str(chosen, "bootargs", cmdline);
291} 161}
292 162
293struct platform_ops platform_ops; 163struct platform_ops platform_ops;
294struct dt_ops dt_ops; 164struct dt_ops dt_ops;
295struct console_ops console_ops; 165struct console_ops console_ops;
166struct loader_info loader_info;
296 167
297void start(unsigned long a1, unsigned long a2, void *promptr, void *sp) 168void start(void)
298{ 169{
170 struct addr_range vmlinux, initrd;
299 kernel_entry_t kentry; 171 kernel_entry_t kentry;
300 char cmdline[COMMAND_LINE_SIZE];
301 unsigned long ft_addr = 0; 172 unsigned long ft_addr = 0;
173 void *chosen;
302 174
303 memset(__bss_start, 0, _end - __bss_start); 175 /* Do this first, because malloc() could clobber the loader's
304 memset(&platform_ops, 0, sizeof(platform_ops)); 176 * command line. Only use the loader command line if a
305 memset(&dt_ops, 0, sizeof(dt_ops)); 177 * built-in command line wasn't set by an external tool */
306 memset(&console_ops, 0, sizeof(console_ops)); 178 if ((loader_info.cmdline_len > 0) && (cmdline[0] == '\0'))
179 memmove(cmdline, loader_info.cmdline,
180 min(loader_info.cmdline_len, COMMAND_LINE_SIZE-1));
307 181
308 if (platform_init(promptr, _dtb_start, _dtb_end))
309 exit();
310 if (console_ops.open && (console_ops.open() < 0)) 182 if (console_ops.open && (console_ops.open() < 0))
311 exit(); 183 exit();
312 if (platform_ops.fixups) 184 if (platform_ops.fixups)
313 platform_ops.fixups(); 185 platform_ops.fixups();
314 186
315 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r", 187 printf("\n\rzImage starting: loaded at 0x%p (sp: 0x%p)\n\r",
316 _start, sp); 188 _start, get_sp());
317 189
318 prep_kernel(a1, a2); 190 /* Ensure that the device tree has a /chosen node */
191 chosen = finddevice("/chosen");
192 if (!chosen)
193 chosen = create_node(NULL, "chosen");
319 194
320 /* If cmdline came from zimage wrapper or if we can edit the one 195 vmlinux = prep_kernel();
321 * in the dt, print it out and edit it, if possible. 196 initrd = prep_initrd(vmlinux, chosen,
322 */ 197 loader_info.initrd_addr, loader_info.initrd_size);
323 if ((strlen(builtin_cmdline) > 0) || console_ops.edit_cmdline) { 198 prep_cmdline(chosen);
324 get_cmdline(cmdline, COMMAND_LINE_SIZE);
325 printf("\n\rLinux/PowerPC load: %s", cmdline);
326 if (console_ops.edit_cmdline)
327 console_ops.edit_cmdline(cmdline, COMMAND_LINE_SIZE);
328 printf("\n\r");
329 set_cmdline(cmdline);
330 }
331 199
332 printf("Finalizing device tree..."); 200 printf("Finalizing device tree...");
333 if (dt_ops.finalize) 201 if (dt_ops.finalize)
@@ -335,7 +203,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
335 if (ft_addr) 203 if (ft_addr)
336 printf(" flat tree at 0x%lx\n\r", ft_addr); 204 printf(" flat tree at 0x%lx\n\r", ft_addr);
337 else 205 else
338 printf(" using OF tree (promptr=%p)\n\r", promptr); 206 printf(" using OF tree (promptr=%p)\n\r", loader_info.promptr);
339 207
340 if (console_ops.close) 208 if (console_ops.close)
341 console_ops.close(); 209 console_ops.close();
@@ -344,10 +212,9 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
344 if (ft_addr) 212 if (ft_addr)
345 kentry(ft_addr, 0, NULL); 213 kentry(ft_addr, 0, NULL);
346 else 214 else
347 /* XXX initrd addr/size should be passed in properties */ 215 kentry((unsigned long)initrd.addr, initrd.size,
348 kentry(initrd.addr, initrd.size, promptr); 216 loader_info.promptr);
349 217
350 /* console closed so printf below may not work */ 218 /* console closed so printf in fatal below may not work */
351 printf("Error: Linux kernel returned to zImage boot wrapper!\n\r"); 219 fatal("Error: Linux kernel returned to zImage boot wrapper!\n\r");
352 exit();
353} 220}
diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
index 1ffe72e35cdc..f8f1b2f31412 100644
--- a/arch/powerpc/boot/ns16550.c
+++ b/arch/powerpc/boot/ns16550.c
@@ -55,10 +55,15 @@ static u8 ns16550_tstc(void)
55int ns16550_console_init(void *devp, struct serial_console_data *scdp) 55int ns16550_console_init(void *devp, struct serial_console_data *scdp)
56{ 56{
57 int n; 57 int n;
58 unsigned long reg_phys;
58 59
59 n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base)); 60 n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
60 if (n != sizeof(reg_base)) 61 if (n != sizeof(reg_base)) {
61 return -1; 62 if (!dt_xlate_reg(devp, 0, &reg_phys, NULL))
63 return -1;
64
65 reg_base = (void *)reg_phys;
66 }
62 67
63 n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift)); 68 n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
64 if (n != sizeof(reg_shift)) 69 if (n != sizeof(reg_shift))
diff --git a/arch/powerpc/boot/of.c b/arch/powerpc/boot/of.c
index 0182f384f3e6..d16ee3e3f868 100644
--- a/arch/powerpc/boot/of.c
+++ b/arch/powerpc/boot/of.c
@@ -173,7 +173,7 @@ static void *claim(unsigned long virt, unsigned long size, unsigned long align)
173 return (void *) virt; 173 return (void *) virt;
174} 174}
175 175
176static void *of_try_claim(u32 size) 176static void *of_try_claim(unsigned long size)
177{ 177{
178 unsigned long addr = 0; 178 unsigned long addr = 0;
179 179
@@ -208,6 +208,16 @@ static void of_image_hdr(const void *hdr)
208 } 208 }
209} 209}
210 210
211static void *of_vmlinux_alloc(unsigned long size)
212{
213 void *p = malloc(size);
214
215 if (!p)
216 fatal("Can't allocate memory for kernel image!\n\r");
217
218 return p;
219}
220
211static void of_exit(void) 221static void of_exit(void)
212{ 222{
213 call_prom("exit", 0, 0); 223 call_prom("exit", 0, 0);
@@ -256,11 +266,12 @@ static void of_console_write(char *buf, int len)
256 call_prom("write", 3, 1, of_stdout_handle, buf, len); 266 call_prom("write", 3, 1, of_stdout_handle, buf, len);
257} 267}
258 268
259int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end) 269void platform_init(unsigned long a1, unsigned long a2, void *promptr)
260{ 270{
261 platform_ops.image_hdr = of_image_hdr; 271 platform_ops.image_hdr = of_image_hdr;
262 platform_ops.malloc = of_try_claim; 272 platform_ops.malloc = of_try_claim;
263 platform_ops.exit = of_exit; 273 platform_ops.exit = of_exit;
274 platform_ops.vmlinux_alloc = of_vmlinux_alloc;
264 275
265 dt_ops.finddevice = of_finddevice; 276 dt_ops.finddevice = of_finddevice;
266 dt_ops.getprop = of_getprop; 277 dt_ops.getprop = of_getprop;
@@ -270,5 +281,9 @@ int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end)
270 console_ops.write = of_console_write; 281 console_ops.write = of_console_write;
271 282
272 prom = (int (*)(void *))promptr; 283 prom = (int (*)(void *))promptr;
273 return 0; 284 loader_info.promptr = promptr;
285 if (a1 && a2 && a2 != 0xdeadbeef) {
286 loader_info.initrd_addr = a1;
287 loader_info.initrd_size = a2;
288 }
274} 289}
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 8abb6516bb7c..73bd47a3a079 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -11,7 +11,9 @@
11#ifndef _PPC_BOOT_OPS_H_ 11#ifndef _PPC_BOOT_OPS_H_
12#define _PPC_BOOT_OPS_H_ 12#define _PPC_BOOT_OPS_H_
13 13
14#include <stddef.h>
14#include "types.h" 15#include "types.h"
16#include "string.h"
15 17
16#define COMMAND_LINE_SIZE 512 18#define COMMAND_LINE_SIZE 512
17#define MAX_PATH_LEN 256 19#define MAX_PATH_LEN 256
@@ -21,10 +23,11 @@
21struct platform_ops { 23struct platform_ops {
22 void (*fixups)(void); 24 void (*fixups)(void);
23 void (*image_hdr)(const void *); 25 void (*image_hdr)(const void *);
24 void * (*malloc)(u32 size); 26 void * (*malloc)(unsigned long size);
25 void (*free)(void *ptr); 27 void (*free)(void *ptr);
26 void * (*realloc)(void *ptr, unsigned long size); 28 void * (*realloc)(void *ptr, unsigned long size);
27 void (*exit)(void); 29 void (*exit)(void);
30 void * (*vmlinux_alloc)(unsigned long size);
28}; 31};
29extern struct platform_ops platform_ops; 32extern struct platform_ops platform_ops;
30 33
@@ -35,6 +38,12 @@ struct dt_ops {
35 const int buflen); 38 const int buflen);
36 int (*setprop)(const void *phandle, const char *name, 39 int (*setprop)(const void *phandle, const char *name,
37 const void *buf, const int buflen); 40 const void *buf, const int buflen);
41 void *(*get_parent)(const void *phandle);
42 /* The node must not already exist. */
43 void *(*create_node)(const void *parent, const char *name);
44 void *(*find_node_by_prop_value)(const void *prev,
45 const char *propname,
46 const char *propval, int proplen);
38 unsigned long (*finalize)(void); 47 unsigned long (*finalize)(void);
39}; 48};
40extern struct dt_ops dt_ops; 49extern struct dt_ops dt_ops;
@@ -58,13 +67,23 @@ struct serial_console_data {
58 void (*close)(void); 67 void (*close)(void);
59}; 68};
60 69
61int platform_init(void *promptr, char *dt_blob_start, char *dt_blob_end); 70struct loader_info {
71 void *promptr;
72 unsigned long initrd_addr, initrd_size;
73 char *cmdline;
74 int cmdline_len;
75};
76extern struct loader_info loader_info;
77
78void start(void);
62int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device); 79int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
63int serial_console_init(void); 80int serial_console_init(void);
64int ns16550_console_init(void *devp, struct serial_console_data *scdp); 81int ns16550_console_init(void *devp, struct serial_console_data *scdp);
65void *simple_alloc_init(char *base, u32 heap_size, u32 granularity, 82void *simple_alloc_init(char *base, unsigned long heap_size,
66 u32 max_allocs); 83 unsigned long granularity, unsigned long max_allocs);
67 84extern void flush_cache(void *, unsigned long);
85int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
86int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
68 87
69static inline void *finddevice(const char *name) 88static inline void *finddevice(const char *name)
70{ 89{
@@ -76,12 +95,76 @@ static inline int getprop(void *devp, const char *name, void *buf, int buflen)
76 return (dt_ops.getprop) ? dt_ops.getprop(devp, name, buf, buflen) : -1; 95 return (dt_ops.getprop) ? dt_ops.getprop(devp, name, buf, buflen) : -1;
77} 96}
78 97
79static inline int setprop(void *devp, const char *name, void *buf, int buflen) 98static inline int setprop(void *devp, const char *name,
99 const void *buf, int buflen)
80{ 100{
81 return (dt_ops.setprop) ? dt_ops.setprop(devp, name, buf, buflen) : -1; 101 return (dt_ops.setprop) ? dt_ops.setprop(devp, name, buf, buflen) : -1;
82} 102}
103#define setprop_val(devp, name, val) \
104 do { \
105 typeof(val) x = (val); \
106 setprop((devp), (name), &x, sizeof(x)); \
107 } while (0)
108
109static inline int setprop_str(void *devp, const char *name, const char *buf)
110{
111 if (dt_ops.setprop)
112 return dt_ops.setprop(devp, name, buf, strlen(buf) + 1);
113
114 return -1;
115}
116
117static inline void *get_parent(const char *devp)
118{
119 return dt_ops.get_parent ? dt_ops.get_parent(devp) : NULL;
120}
121
122static inline void *create_node(const void *parent, const char *name)
123{
124 return dt_ops.create_node ? dt_ops.create_node(parent, name) : NULL;
125}
126
83 127
84static inline void *malloc(u32 size) 128static inline void *find_node_by_prop_value(const void *prev,
129 const char *propname,
130 const char *propval, int proplen)
131{
132 if (dt_ops.find_node_by_prop_value)
133 return dt_ops.find_node_by_prop_value(prev, propname,
134 propval, proplen);
135
136 return NULL;
137}
138
139static inline void *find_node_by_prop_value_str(const void *prev,
140 const char *propname,
141 const char *propval)
142{
143 return find_node_by_prop_value(prev, propname, propval,
144 strlen(propval) + 1);
145}
146
147static inline void *find_node_by_devtype(const void *prev,
148 const char *type)
149{
150 return find_node_by_prop_value_str(prev, "device_type", type);
151}
152
153void dt_fixup_memory(u64 start, u64 size);
154void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
155void dt_fixup_clock(const char *path, u32 freq);
156void __dt_fixup_mac_addresses(u32 startindex, ...);
157#define dt_fixup_mac_addresses(...) \
158 __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL)
159
160
161static inline void *find_node_by_linuxphandle(const u32 linuxphandle)
162{
163 return find_node_by_prop_value(NULL, "linux,phandle",
164 (char *)&linuxphandle, sizeof(u32));
165}
166
167static inline void *malloc(unsigned long size)
85{ 168{
86 return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL; 169 return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL;
87} 170}
@@ -98,5 +181,11 @@ static inline void exit(void)
98 platform_ops.exit(); 181 platform_ops.exit();
99 for(;;); 182 for(;;);
100} 183}
184#define fatal(args...) { printf(args); exit(); }
185
186
187#define BSS_STACK(size) \
188 static char _bss_stack[size]; \
189 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack);
101 190
102#endif /* _PPC_BOOT_OPS_H_ */ 191#endif /* _PPC_BOOT_OPS_H_ */
diff --git a/arch/powerpc/boot/ppcboot.h b/arch/powerpc/boot/ppcboot.h
new file mode 100644
index 000000000000..5290ff2c2b2b
--- /dev/null
+++ b/arch/powerpc/boot/ppcboot.h
@@ -0,0 +1,108 @@
1/*
2 * This interface is used for compatibility with old U-boots *ONLY*.
3 * Please do not imitate or extend this.
4 */
5
6/*
7 * (C) Copyright 2000, 2001
8 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25
26#ifndef __PPCBOOT_H__
27#define __PPCBOOT_H__
28
29/*
30 * Board information passed to kernel from PPCBoot
31 *
32 * include/asm-ppc/ppcboot.h
33 */
34
35#include "types.h"
36
37typedef struct bd_info {
38 unsigned long bi_memstart; /* start of DRAM memory */
39 unsigned long bi_memsize; /* size of DRAM memory in bytes */
40 unsigned long bi_flashstart; /* start of FLASH memory */
41 unsigned long bi_flashsize; /* size of FLASH memory */
42 unsigned long bi_flashoffset; /* reserved area for startup monitor */
43 unsigned long bi_sramstart; /* start of SRAM memory */
44 unsigned long bi_sramsize; /* size of SRAM memory */
45#if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\
46 defined(TARGET_83xx)
47 unsigned long bi_immr_base; /* base of IMMR register */
48#endif
49#if defined(TARGET_PPC_MPC52xx)
50 unsigned long bi_mbar_base; /* base of internal registers */
51#endif
52 unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
53 unsigned long bi_ip_addr; /* IP Address */
54 unsigned char bi_enetaddr[6]; /* Ethernet address */
55 unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
56 unsigned long bi_intfreq; /* Internal Freq, in MHz */
57 unsigned long bi_busfreq; /* Bus Freq, in MHz */
58#if defined(TARGET_CPM2)
59 unsigned long bi_cpmfreq; /* CPM_CLK Freq, in MHz */
60 unsigned long bi_brgfreq; /* BRG_CLK Freq, in MHz */
61 unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */
62 unsigned long bi_vco; /* VCO Out from PLL, in MHz */
63#endif
64#if defined(TARGET_PPC_MPC52xx)
65 unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */
66 unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */
67#endif
68 unsigned long bi_baudrate; /* Console Baudrate */
69#if defined(TARGET_4xx)
70 unsigned char bi_s_version[4]; /* Version of this structure */
71 unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */
72 unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */
73 unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */
74 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
75 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
76#endif
77#if defined(TARGET_HYMOD)
78 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
79#endif
80#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \
81 defined(TARGET_85xx) || defined(TARGET_83xx)
82 /* second onboard ethernet port */
83 unsigned char bi_enet1addr[6];
84#define HAVE_ENET1ADDR
85#endif
86#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || defined(TARGET_85xx)
87 /* third onboard ethernet ports */
88 unsigned char bi_enet2addr[6];
89#define HAVE_ENET2ADDR
90#endif
91#if defined(TARGET_440GX)
92 /* fourth onboard ethernet ports */
93 unsigned char bi_enet3addr[6];
94#define HAVE_ENET3ADDR
95#endif
96#if defined(TARGET_4xx)
97 unsigned int bi_opbfreq; /* OB clock in Hz */
98 int bi_iic_fast[2]; /* Use fast i2c mode */
99#endif
100#if defined(TARGET_440GX)
101 int bi_phynum[4]; /* phy mapping */
102 int bi_phymode[4]; /* phy mode */
103#endif
104} bd_t;
105
106#define bi_tbfreq bi_intfreq
107
108#endif /* __PPCBOOT_H__ */
diff --git a/arch/powerpc/boot/reg.h b/arch/powerpc/boot/reg.h
new file mode 100644
index 000000000000..d3cd9ee98afb
--- /dev/null
+++ b/arch/powerpc/boot/reg.h
@@ -0,0 +1,22 @@
1#ifndef _PPC_BOOT_REG_H
2#define _PPC_BOOT_REG_H
3/*
4 * Copyright 2007 Davud Gibson, IBM Corporation.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12static inline u32 mfpvr(void)
13{
14 u32 pvr;
15 asm volatile ("mfpvr %0" : "=r"(pvr));
16 return pvr;
17}
18
19register void *__stack_pointer asm("r1");
20#define get_sp() (__stack_pointer)
21
22#endif /* _PPC_BOOT_REG_H */
diff --git a/arch/powerpc/boot/simple_alloc.c b/arch/powerpc/boot/simple_alloc.c
index cfe3a7505ba0..65ec135d0157 100644
--- a/arch/powerpc/boot/simple_alloc.c
+++ b/arch/powerpc/boot/simple_alloc.c
@@ -19,24 +19,24 @@
19#define ENTRY_IN_USE 0x02 19#define ENTRY_IN_USE 0x02
20 20
21static struct alloc_info { 21static struct alloc_info {
22 u32 flags; 22 unsigned long flags;
23 u32 base; 23 unsigned long base;
24 u32 size; 24 unsigned long size;
25} *alloc_tbl; 25} *alloc_tbl;
26 26
27static u32 tbl_entries; 27static unsigned long tbl_entries;
28static u32 alloc_min; 28static unsigned long alloc_min;
29static u32 next_base; 29static unsigned long next_base;
30static u32 space_left; 30static unsigned long space_left;
31 31
32/* 32/*
33 * First time an entry is used, its base and size are set. 33 * First time an entry is used, its base and size are set.
34 * An entry can be freed and re-malloc'd but its base & size don't change. 34 * An entry can be freed and re-malloc'd but its base & size don't change.
35 * Should be smart enough for needs of bootwrapper. 35 * Should be smart enough for needs of bootwrapper.
36 */ 36 */
37static void *simple_malloc(u32 size) 37static void *simple_malloc(unsigned long size)
38{ 38{
39 u32 i; 39 unsigned long i;
40 struct alloc_info *p = alloc_tbl; 40 struct alloc_info *p = alloc_tbl;
41 41
42 if (size == 0) 42 if (size == 0)
@@ -67,13 +67,14 @@ err_out:
67 67
68static struct alloc_info *simple_find_entry(void *ptr) 68static struct alloc_info *simple_find_entry(void *ptr)
69{ 69{
70 u32 i; 70 unsigned long i;
71 struct alloc_info *p = alloc_tbl; 71 struct alloc_info *p = alloc_tbl;
72 72
73 for (i=0; i<tbl_entries; i++,p++) { 73 for (i=0; i<tbl_entries; i++,p++) {
74 if (!(p->flags & ENTRY_BEEN_USED)) 74 if (!(p->flags & ENTRY_BEEN_USED))
75 break; 75 break;
76 if ((p->flags & ENTRY_IN_USE) && (p->base == (u32)ptr)) 76 if ((p->flags & ENTRY_IN_USE) &&
77 (p->base == (unsigned long)ptr))
77 return p; 78 return p;
78 } 79 }
79 return NULL; 80 return NULL;
@@ -122,10 +123,10 @@ static void *simple_realloc(void *ptr, unsigned long size)
122 * Returns addr of first byte after heap so caller can see if it took 123 * Returns addr of first byte after heap so caller can see if it took
123 * too much space. If so, change args & try again. 124 * too much space. If so, change args & try again.
124 */ 125 */
125void *simple_alloc_init(char *base, u32 heap_size, u32 granularity, 126void *simple_alloc_init(char *base, unsigned long heap_size,
126 u32 max_allocs) 127 unsigned long granularity, unsigned long max_allocs)
127{ 128{
128 u32 heap_base, tbl_size; 129 unsigned long heap_base, tbl_size;
129 130
130 heap_size = _ALIGN_UP(heap_size, granularity); 131 heap_size = _ALIGN_UP(heap_size, granularity);
131 alloc_min = granularity; 132 alloc_min = granularity;
@@ -136,7 +137,7 @@ void *simple_alloc_init(char *base, u32 heap_size, u32 granularity,
136 alloc_tbl = (struct alloc_info *)_ALIGN_UP((unsigned long)base, 8); 137 alloc_tbl = (struct alloc_info *)_ALIGN_UP((unsigned long)base, 8);
137 memset(alloc_tbl, 0, tbl_size); 138 memset(alloc_tbl, 0, tbl_size);
138 139
139 heap_base = _ALIGN_UP((u32)alloc_tbl + tbl_size, alloc_min); 140 heap_base = _ALIGN_UP((unsigned long)alloc_tbl + tbl_size, alloc_min);
140 141
141 next_base = heap_base; 142 next_base = heap_base;
142 space_left = heap_size; 143 space_left = heap_size;
diff --git a/arch/powerpc/boot/stdio.h b/arch/powerpc/boot/stdio.h
index 73b8a91bfb34..adffc58412d4 100644
--- a/arch/powerpc/boot/stdio.h
+++ b/arch/powerpc/boot/stdio.h
@@ -7,11 +7,12 @@
7#define EINVAL 22 /* Invalid argument */ 7#define EINVAL 22 /* Invalid argument */
8#define ENOSPC 28 /* No space left on device */ 8#define ENOSPC 28 /* No space left on device */
9 9
10extern int printf(const char *fmt, ...); 10extern int printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
11 11
12#define fprintf(fmt, args...) printf(args) 12#define fprintf(fmt, args...) printf(args)
13 13
14extern int sprintf(char *buf, const char *fmt, ...); 14extern int sprintf(char *buf, const char *fmt, ...)
15 __attribute__((format(printf, 2, 3)));
15 16
16extern int vsprintf(char *buf, const char *fmt, va_list args); 17extern int vsprintf(char *buf, const char *fmt, va_list args);
17 18
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 024e4d425c59..5cedd901201f 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -29,6 +29,7 @@ initrd=
29dtb= 29dtb=
30dts= 30dts=
31cacheit= 31cacheit=
32gzip=.gz
32 33
33# cross-compilation prefix 34# cross-compilation prefix
34CROSS= 35CROSS=
@@ -42,7 +43,7 @@ tmpdir=.
42usage() { 43usage() {
43 echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2 44 echo 'Usage: wrapper [-o output] [-p platform] [-i initrd]' >&2
44 echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2 45 echo ' [-d devtree] [-s tree.dts] [-c] [-C cross-prefix]' >&2
45 echo ' [-D datadir] [-W workingdir] [vmlinux]' >&2 46 echo ' [-D datadir] [-W workingdir] [--no-gzip] [vmlinux]' >&2
46 exit 1 47 exit 1
47} 48}
48 49
@@ -91,6 +92,9 @@ while [ "$#" -gt 0 ]; do
91 [ "$#" -gt 0 ] || usage 92 [ "$#" -gt 0 ] || usage
92 tmpdir="$1" 93 tmpdir="$1"
93 ;; 94 ;;
95 --no-gzip)
96 gzip=
97 ;;
94 -?) 98 -?)
95 usage 99 usage
96 ;; 100 ;;
@@ -137,31 +141,44 @@ miboot|uboot)
137 ksection=image 141 ksection=image
138 isection=initrd 142 isection=initrd
139 ;; 143 ;;
144cuboot*)
145 gzip=
146 ;;
140esac 147esac
141 148
142vmz="$tmpdir/`basename \"$kernel\"`.$ext" 149vmz="$tmpdir/`basename \"$kernel\"`.$ext"
143if [ -z "$cacheit" -o ! -f "$vmz.gz" -o "$vmz.gz" -ot "$kernel" ]; then 150if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
144 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" 151 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
145 gzip -f -9 "$vmz.$$" 152
153 if [ -n "$gzip" ]; then
154 gzip -f -9 "$vmz.$$"
155 fi
156
146 if [ -n "$cacheit" ]; then 157 if [ -n "$cacheit" ]; then
147 mv -f "$vmz.$$.gz" "$vmz.gz" 158 mv -f "$vmz.$$$gzip" "$vmz$gzip"
148 else 159 else
149 vmz="$vmz.$$" 160 vmz="$vmz.$$"
150 fi 161 fi
151fi 162fi
152 163
164vmz="$vmz$gzip"
165
153case "$platform" in 166case "$platform" in
154uboot) 167uboot|cuboot*)
155 rm -f "$ofile"
156 version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ 168 version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \
157 cut -d' ' -f3` 169 cut -d' ' -f3`
158 if [ -n "$version" ]; then 170 if [ -n "$version" ]; then
159 version="-n Linux-$version" 171 version="-n Linux-$version"
160 fi 172 fi
173esac
174
175case "$platform" in
176uboot)
177 rm -f "$ofile"
161 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ 178 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
162 $version -d "$vmz.gz" "$ofile" 179 $version -d "$vmz" "$ofile"
163 if [ -z "$cacheit" ]; then 180 if [ -z "$cacheit" ]; then
164 rm -f $vmz.gz 181 rm -f "$vmz"
165 fi 182 fi
166 exit 0 183 exit 0
167 ;; 184 ;;
@@ -173,9 +190,9 @@ addsec() {
173 --set-section-flags=$3=contents,alloc,load,readonly,data 190 --set-section-flags=$3=contents,alloc,load,readonly,data
174} 191}
175 192
176addsec $tmp "$vmz.gz" $ksection $object/empty.o 193addsec $tmp "$vmz" $ksection $object/empty.o
177if [ -z "$cacheit" ]; then 194if [ -z "$cacheit" ]; then
178 rm -f "$vmz.gz" 195 rm -f "$vmz"
179fi 196fi
180 197
181if [ -n "$initrd" ]; then 198if [ -n "$initrd" ]; then
@@ -191,7 +208,7 @@ fi
191 208
192if [ "$platform" != "miboot" ]; then 209if [ "$platform" != "miboot" ]; then
193 ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \ 210 ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
194 $object/crt0.o $platformo $tmp $object/wrapper.a 211 $platformo $tmp $object/wrapper.a
195 rm $tmp 212 rm $tmp
196fi 213fi
197 214
@@ -201,7 +218,19 @@ pseries|chrp)
201 $object/addnote "$ofile" 218 $object/addnote "$ofile"
202 ;; 219 ;;
203pmaccoff) 220pmaccoff)
204 ${CROSS}objcopy -O aixcoff-rs6000 --set-start 0x500000 "$ofile" 221 entry=`objdump -f "$ofile" | grep '^start address ' | \
222 cut -d' ' -f3`
223 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
205 $object/hack-coff "$ofile" 224 $object/hack-coff "$ofile"
206 ;; 225 ;;
226cuboot*)
227 base=`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
228 entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | \
229 cut -d' ' -f3`
230 mv "$ofile" "$ofile".elf
231 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
232 gzip -f -9 "$ofile".bin
233 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
234 $version -d "$ofile".bin.gz "$ofile"
235 ;;
207esac 236esac
diff --git a/arch/powerpc/boot/zImage.coff.lds.S b/arch/powerpc/boot/zImage.coff.lds.S
index a360905e5428..fe87a90ce7f1 100644
--- a/arch/powerpc/boot/zImage.coff.lds.S
+++ b/arch/powerpc/boot/zImage.coff.lds.S
@@ -1,5 +1,6 @@
1OUTPUT_ARCH(powerpc:common) 1OUTPUT_ARCH(powerpc:common)
2ENTRY(_start) 2ENTRY(_zimage_start_opd)
3EXTERN(_zimage_start_opd)
3SECTIONS 4SECTIONS
4{ 5{
5 . = (5*1024*1024); 6 . = (5*1024*1024);
diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
index 4be3c6414b04..f6e380fdb388 100644
--- a/arch/powerpc/boot/zImage.lds.S
+++ b/arch/powerpc/boot/zImage.lds.S
@@ -1,5 +1,6 @@
1OUTPUT_ARCH(powerpc:common) 1OUTPUT_ARCH(powerpc:common)
2ENTRY(_zimage_start) 2ENTRY(_zimage_start)
3EXTERN(_zimage_start)
3SECTIONS 4SECTIONS
4{ 5{
5 . = (4*1024*1024); 6 . = (4*1024*1024);