aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-26 23:38:58 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-26 23:38:58 -0400
commit5696c1944a33b4434a9a1ebb6383b906afd43a10 (patch)
tree16fbe6ba431bcf949ee8645510b0c2fd39b5810f /arch/ppc
parent66b04a80eea60cabf9d89fd34deb3234a740052f (diff)
parent020f46a39eb7b99a575b9f4d105fce2b142acdf1 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/Kconfig65
-rw-r--r--arch/ppc/Kconfig.debug2
-rw-r--r--arch/ppc/Makefile3
-rw-r--r--arch/ppc/boot/images/Makefile3
-rw-r--r--arch/ppc/boot/ld.script3
-rw-r--r--arch/ppc/boot/openfirmware/Makefile5
-rw-r--r--arch/ppc/boot/openfirmware/chrpmain.c2
-rw-r--r--arch/ppc/boot/openfirmware/common.c16
-rw-r--r--arch/ppc/boot/simple/Makefile4
-rw-r--r--arch/ppc/boot/simple/misc.c2
-rw-r--r--arch/ppc/boot/simple/mpc10x_memory.c2
-rw-r--r--arch/ppc/boot/utils/addSystemMap.c186
-rw-r--r--arch/ppc/configs/mpc8548_cds_defconfig659
-rw-r--r--arch/ppc/configs/mpc8555_cds_defconfig117
-rw-r--r--arch/ppc/kernel/Makefile3
-rw-r--r--arch/ppc/kernel/cputable.c50
-rw-r--r--arch/ppc/kernel/entry.S189
-rw-r--r--arch/ppc/kernel/head_4xx.S15
-rw-r--r--arch/ppc/kernel/head_booke.h158
-rw-r--r--arch/ppc/kernel/head_fsl_booke.S66
-rw-r--r--arch/ppc/kernel/machine_kexec.c118
-rw-r--r--arch/ppc/kernel/misc.S16
-rw-r--r--arch/ppc/kernel/pci.c2
-rw-r--r--arch/ppc/kernel/perfmon.c2
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c2
-rw-r--r--arch/ppc/kernel/ptrace.c40
-rw-r--r--arch/ppc/kernel/relocate_kernel.S123
-rw-r--r--arch/ppc/kernel/setup.c11
-rw-r--r--arch/ppc/kernel/signal.c3
-rw-r--r--arch/ppc/kernel/traps.c37
-rw-r--r--arch/ppc/lib/locks.c4
-rw-r--r--arch/ppc/mm/44x_mmu.c1
-rw-r--r--arch/ppc/mm/4xx_mmu.c1
-rw-r--r--arch/ppc/mm/fsl_booke_mmu.c5
-rw-r--r--arch/ppc/mm/init.c17
-rw-r--r--arch/ppc/mm/mmu_decl.h2
-rw-r--r--arch/ppc/mm/pgtable.c1
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.c50
-rw-r--r--arch/ppc/platforms/83xx/mpc834x_sys.h7
-rw-r--r--arch/ppc/platforms/85xx/Kconfig10
-rw-r--r--arch/ppc/platforms/85xx/Makefile1
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c54
-rw-r--r--arch/ppc/platforms/85xx/mpc8560_ads.c29
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_ads_common.c37
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.c238
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.h3
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.c36
-rw-r--r--arch/ppc/platforms/85xx/sbc85xx.c37
-rw-r--r--arch/ppc/platforms/85xx/stx_gp3.c63
-rw-r--r--arch/ppc/platforms/chrp_pci.c1
-rw-r--r--arch/ppc/platforms/katana.c2
-rw-r--r--arch/ppc/platforms/pmac_cpufreq.c43
-rw-r--r--arch/ppc/platforms/pmac_pci.c1
-rw-r--r--arch/ppc/platforms/pq2ads.h41
-rw-r--r--arch/ppc/platforms/sandpoint.c20
-rw-r--r--arch/ppc/syslib/Makefile7
-rw-r--r--arch/ppc/syslib/cpm2_common.c2
-rw-r--r--arch/ppc/syslib/indirect_pci.c1
-rw-r--r--arch/ppc/syslib/ipic.c14
-rw-r--r--arch/ppc/syslib/m8260_pci.c193
-rw-r--r--arch/ppc/syslib/m8260_pci.h76
-rw-r--r--arch/ppc/syslib/m8260_pci_erratum9.c10
-rw-r--r--arch/ppc/syslib/m8260_setup.c11
-rw-r--r--arch/ppc/syslib/m82xx_pci.c383
-rw-r--r--arch/ppc/syslib/m82xx_pci.h92
-rw-r--r--arch/ppc/syslib/mpc10x_common.c203
-rw-r--r--arch/ppc/syslib/mpc85xx_devices.c187
-rw-r--r--arch/ppc/syslib/mpc85xx_sys.c105
-rw-r--r--arch/ppc/syslib/mv64x60.c1
-rw-r--r--arch/ppc/syslib/mv64x60_win.c1
-rw-r--r--arch/ppc/syslib/ocp.c2
-rw-r--r--arch/ppc/syslib/of_device.c2
-rw-r--r--arch/ppc/syslib/open_pic.c5
-rw-r--r--arch/ppc/syslib/open_pic2.c1
-rw-r--r--arch/ppc/syslib/ppc4xx_kgdb.c124
-rw-r--r--arch/ppc/syslib/ppc83xx_setup.c29
-rw-r--r--arch/ppc/syslib/ppc85xx_setup.c19
-rw-r--r--arch/ppc/syslib/prom_init.c10
-rw-r--r--arch/ppc/xmon/xmon.c270
79 files changed, 2913 insertions, 1443 deletions
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 600f23d7fd..a7835cd3f5 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -88,6 +88,9 @@ config 8xx
88 depends on BROKEN 88 depends on BROKEN
89 bool "8xx" 89 bool "8xx"
90 90
91config E200
92 bool "e200"
93
91config E500 94config E500
92 bool "e500" 95 bool "e500"
93 96
@@ -98,12 +101,12 @@ config PPC_FPU
98 101
99config BOOKE 102config BOOKE
100 bool 103 bool
101 depends on E500 104 depends on E200 || E500
102 default y 105 default y
103 106
104config FSL_BOOKE 107config FSL_BOOKE
105 bool 108 bool
106 depends on E500 109 depends on E200 || E500
107 default y 110 default y
108 111
109config PTE_64BIT 112config PTE_64BIT
@@ -141,16 +144,16 @@ config ALTIVEC
141 144
142config SPE 145config SPE
143 bool "SPE Support" 146 bool "SPE Support"
144 depends on E500 147 depends on E200 || E500
145 ---help--- 148 ---help---
146 This option enables kernel support for the Signal Processing 149 This option enables kernel support for the Signal Processing
147 Extensions (SPE) to the PowerPC processor. The kernel currently 150 Extensions (SPE) to the PowerPC processor. The kernel currently
148 supports saving and restoring SPE registers, and turning on the 151 supports saving and restoring SPE registers, and turning on the
149 'spe enable' bit so user processes can execute SPE instructions. 152 'spe enable' bit so user processes can execute SPE instructions.
150 153
151 This option is only usefully if you have a processor that supports 154 This option is only useful if you have a processor that supports
152 SPE (e500, otherwise known as 85xx series), but does not have any 155 SPE (e500, otherwise known as 85xx series), but does not have any
153 affect on a non-spe cpu (it does, however add code to the kernel). 156 effect on a non-spe cpu (it does, however add code to the kernel).
154 157
155 If in doubt, say Y here. 158 If in doubt, say Y here.
156 159
@@ -200,7 +203,7 @@ config TAU_AVERAGE
200 203
201config MATH_EMULATION 204config MATH_EMULATION
202 bool "Math emulation" 205 bool "Math emulation"
203 depends on 4xx || 8xx || E500 206 depends on 4xx || 8xx || E200 || E500
204 ---help--- 207 ---help---
205 Some PowerPC chips designed for embedded applications do not have 208 Some PowerPC chips designed for embedded applications do not have
206 a floating-point unit and therefore do not implement the 209 a floating-point unit and therefore do not implement the
@@ -214,6 +217,26 @@ config MATH_EMULATION
214 here. Saying Y here will not hurt performance (on any machine) but 217 here. Saying Y here will not hurt performance (on any machine) but
215 will increase the size of the kernel. 218 will increase the size of the kernel.
216 219
220config KEXEC
221 bool "kexec system call (EXPERIMENTAL)"
222 depends on EXPERIMENTAL
223 help
224 kexec is a system call that implements the ability to shutdown your
225 current kernel, and to start another kernel. It is like a reboot
226 but it is indepedent of the system firmware. And like a reboot
227 you can start any kernel with it, not just Linux.
228
229 The name comes from the similiarity to the exec system call.
230
231 It is an ongoing process to be certain the hardware in a machine
232 is properly shutdown, so do not be surprised if this code does not
233 initially work for you. It may help to enable device hotplugging
234 support. As of this writing the exact hardware interface is
235 strongly in flux, so no good recommendation can be made.
236
237 In the GameCube implementation, kexec allows you to load and
238 run DOL files, including kernel and homebrew DOLs.
239
217source "drivers/cpufreq/Kconfig" 240source "drivers/cpufreq/Kconfig"
218 241
219config CPU_FREQ_PMAC 242config CPU_FREQ_PMAC
@@ -254,7 +277,7 @@ config PPC_STD_MMU
254 277
255config NOT_COHERENT_CACHE 278config NOT_COHERENT_CACHE
256 bool 279 bool
257 depends on 4xx || 8xx 280 depends on 4xx || 8xx || E200
258 default y 281 default y
259 282
260endmenu 283endmenu
@@ -826,11 +849,6 @@ config MPC10X_BRIDGE
826 depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT 849 depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT
827 default y 850 default y
828 851
829config FSL_OCP
830 bool
831 depends on MPC10X_BRIDGE
832 default y
833
834config MPC10X_OPENPIC 852config MPC10X_OPENPIC
835 bool 853 bool
836 depends on POWERPMC250 || LOPEC || SANDPOINT 854 depends on POWERPMC250 || LOPEC || SANDPOINT
@@ -910,6 +928,8 @@ config PREEMPT
910config HIGHMEM 928config HIGHMEM
911 bool "High memory support" 929 bool "High memory support"
912 930
931source "mm/Kconfig"
932
913source "fs/Kconfig.binfmt" 933source "fs/Kconfig.binfmt"
914 934
915config PROC_DEVICETREE 935config PROC_DEVICETREE
@@ -1083,6 +1103,23 @@ source "drivers/zorro/Kconfig"
1083 1103
1084source kernel/power/Kconfig 1104source kernel/power/Kconfig
1085 1105
1106config SECCOMP
1107 bool "Enable seccomp to safely compute untrusted bytecode"
1108 depends on PROC_FS
1109 default y
1110 help
1111 This kernel feature is useful for number crunching applications
1112 that may need to compute untrusted bytecode during their
1113 execution. By using pipes or other transports made available to
1114 the process as file descriptors supporting the read/write
1115 syscalls, it's possible to isolate those applications in
1116 their own address space using seccomp. Once seccomp is
1117 enabled via /proc/<pid>/seccomp, it cannot be disabled
1118 and the task is only allowed to execute a few safe syscalls
1119 defined by each seccomp mode.
1120
1121 If unsure, say Y. Only embedded should say N here.
1122
1086endmenu 1123endmenu
1087 1124
1088config ISA_DMA_API 1125config ISA_DMA_API
@@ -1143,12 +1180,12 @@ config PCI_QSPAN
1143 1180
1144config PCI_8260 1181config PCI_8260
1145 bool 1182 bool
1146 depends on PCI && 8260 && !8272 1183 depends on PCI && 8260
1147 default y 1184 default y
1148 1185
1149config 8260_PCI9 1186config 8260_PCI9
1150 bool " Enable workaround for MPC826x erratum PCI 9" 1187 bool " Enable workaround for MPC826x erratum PCI 9"
1151 depends on PCI_8260 1188 depends on PCI_8260 && !ADS8272
1152 default y 1189 default y
1153 1190
1154choice 1191choice
diff --git a/arch/ppc/Kconfig.debug b/arch/ppc/Kconfig.debug
index d2e1eea8e8..e16c7710d4 100644
--- a/arch/ppc/Kconfig.debug
+++ b/arch/ppc/Kconfig.debug
@@ -66,7 +66,7 @@ config SERIAL_TEXT_DEBUG
66 66
67config PPC_OCP 67config PPC_OCP
68 bool 68 bool
69 depends on IBM_OCP || FSL_OCP || XILINX_OCP 69 depends on IBM_OCP || XILINX_OCP
70 default y 70 default y
71 71
72endmenu 72endmenu
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 0432a25b47..f9b0d778dd 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -29,7 +29,7 @@ CPP = $(CC) -E $(CFLAGS)
29 29
30CHECKFLAGS += -D__powerpc__ 30CHECKFLAGS += -D__powerpc__
31 31
32ifndef CONFIG_E500 32ifndef CONFIG_FSL_BOOKE
33CFLAGS += -mstring 33CFLAGS += -mstring
34endif 34endif
35 35
@@ -38,6 +38,7 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405
38cpu-as-$(CONFIG_6xx) += -Wa,-maltivec 38cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
39cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec 39cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
40cpu-as-$(CONFIG_E500) += -Wa,-me500 40cpu-as-$(CONFIG_E500) += -Wa,-me500
41cpu-as-$(CONFIG_E200) += -Wa,-me200
41 42
42AFLAGS += $(cpu-as-y) 43AFLAGS += $(cpu-as-y)
43CFLAGS += $(cpu-as-y) 44CFLAGS += $(cpu-as-y)
diff --git a/arch/ppc/boot/images/Makefile b/arch/ppc/boot/images/Makefile
index f850fb0fb5..c9ac5f5fa9 100644
--- a/arch/ppc/boot/images/Makefile
+++ b/arch/ppc/boot/images/Makefile
@@ -22,7 +22,8 @@ targets += uImage
22$(obj)/uImage: $(obj)/vmlinux.gz 22$(obj)/uImage: $(obj)/vmlinux.gz
23 $(Q)rm -f $@ 23 $(Q)rm -f $@
24 $(call if_changed,uimage) 24 $(call if_changed,uimage)
25 @echo ' Image: $@' $(if $(wildcard $@),'is ready','not made') 25 @echo -n ' Image: $@ '
26 @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
26 27
27# Files generated that shall be removed upon make clean 28# Files generated that shall be removed upon make clean
28clean-files := sImage vmapus vmlinux* miboot* zImage* uImage 29clean-files := sImage vmapus vmlinux* miboot* zImage* uImage
diff --git a/arch/ppc/boot/ld.script b/arch/ppc/boot/ld.script
index 6ee602d8b6..9362193742 100644
--- a/arch/ppc/boot/ld.script
+++ b/arch/ppc/boot/ld.script
@@ -58,9 +58,6 @@ SECTIONS
58 *(.ramdisk) 58 *(.ramdisk)
59 __ramdisk_end = .; 59 __ramdisk_end = .;
60 . = ALIGN(4096); 60 . = ALIGN(4096);
61 __sysmap_begin = .;
62 *(.sysmap)
63 __sysmap_end = .;
64 CONSTRUCTORS 61 CONSTRUCTORS
65 } 62 }
66 _edata = .; 63 _edata = .;
diff --git a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
index 4eacbd8c77..03415238fa 100644
--- a/arch/ppc/boot/openfirmware/Makefile
+++ b/arch/ppc/boot/openfirmware/Makefile
@@ -54,13 +54,10 @@ $(images)/ramdisk.image.gz:
54 @echo ' RAM disk image must be provided separately' 54 @echo ' RAM disk image must be provided separately'
55 @/bin/false 55 @/bin/false
56 56
57objcpxmon-$(CONFIG_XMON) := --add-section=.sysmap=System.map \
58 --set-section-flags=.sysmap=contents,alloc,load,readonly,data
59quiet_cmd_genimage = GEN $@ 57quiet_cmd_genimage = GEN $@
60 cmd_genimage = $(OBJCOPY) -R .comment \ 58 cmd_genimage = $(OBJCOPY) -R .comment \
61 --add-section=.image=$(images)/vmlinux.gz \ 59 --add-section=.image=$(images)/vmlinux.gz \
62 --set-section-flags=.image=contents,alloc,load,readonly,data \ 60 --set-section-flags=.image=contents,alloc,load,readonly,data $< $@
63 $(objcpxmon-y) $< $@
64 61
65targets += image.o 62targets += image.o
66$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE 63$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
diff --git a/arch/ppc/boot/openfirmware/chrpmain.c b/arch/ppc/boot/openfirmware/chrpmain.c
index 6fb4f73872..effe4a0624 100644
--- a/arch/ppc/boot/openfirmware/chrpmain.c
+++ b/arch/ppc/boot/openfirmware/chrpmain.c
@@ -39,7 +39,7 @@ char *avail_high;
39 39
40#define SCRATCH_SIZE (128 << 10) 40#define SCRATCH_SIZE (128 << 10)
41 41
42static char scratch[SCRATCH_SIZE]; /* 1MB of scratch space for gunzip */ 42static char scratch[SCRATCH_SIZE]; /* 128k of scratch space for gunzip */
43 43
44typedef void (*kernel_start_t)(int, int, void *, unsigned int, unsigned int); 44typedef void (*kernel_start_t)(int, int, void *, unsigned int, unsigned int);
45 45
diff --git a/arch/ppc/boot/openfirmware/common.c b/arch/ppc/boot/openfirmware/common.c
index 9e6952781f..0f46756a90 100644
--- a/arch/ppc/boot/openfirmware/common.c
+++ b/arch/ppc/boot/openfirmware/common.c
@@ -15,7 +15,6 @@
15#include <asm/page.h> 15#include <asm/page.h>
16 16
17/* Information from the linker */ 17/* Information from the linker */
18extern char __sysmap_begin, __sysmap_end;
19 18
20extern int strcmp(const char *s1, const char *s2); 19extern int strcmp(const char *s1, const char *s2);
21extern char *avail_ram, *avail_high; 20extern char *avail_ram, *avail_high;
@@ -116,14 +115,8 @@ void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
116void make_bi_recs(unsigned long addr, char *name, unsigned int mach, 115void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
117 unsigned long progend) 116 unsigned long progend)
118{ 117{
119 unsigned long sysmap_size;
120 struct bi_record *rec; 118 struct bi_record *rec;
121 119
122 /* Figure out the size of a possible System.map we're going to
123 * pass along.
124 * */
125 sysmap_size = (unsigned long)(&__sysmap_end) -
126 (unsigned long)(&__sysmap_begin);
127 120
128 /* leave a 1MB gap then align to the next 1MB boundary */ 121 /* leave a 1MB gap then align to the next 1MB boundary */
129 addr = _ALIGN(addr+ (1<<20) - 1, (1<<20)); 122 addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
@@ -147,15 +140,6 @@ void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
147 rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long); 140 rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
148 rec = (struct bi_record *)((unsigned long)rec + rec->size); 141 rec = (struct bi_record *)((unsigned long)rec + rec->size);
149 142
150 if (sysmap_size) {
151 rec->tag = BI_SYSMAP;
152 rec->data[0] = (unsigned long)(&__sysmap_begin);
153 rec->data[1] = sysmap_size;
154 rec->size = sizeof(struct bi_record) + 2 *
155 sizeof(unsigned long);
156 rec = (struct bi_record *)((unsigned long)rec + rec->size);
157 }
158
159 rec->tag = BI_LAST; 143 rec->tag = BI_LAST;
160 rec->size = sizeof(struct bi_record); 144 rec->size = sizeof(struct bi_record);
161 rec = (struct bi_record *)((unsigned long)rec + rec->size); 145 rec = (struct bi_record *)((unsigned long)rec + rec->size);
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index c28061ad59..991b4cbb83 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -203,7 +203,7 @@ $(obj)/zvmlinux: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
203 $(obj)/dummy.o $(obj)/image.o 203 $(obj)/dummy.o $(obj)/image.o
204 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS) 204 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
205 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \ 205 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
206 -R .stabstr -R .ramdisk -R .sysmap 206 -R .stabstr -R .ramdisk
207 207
208$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \ 208$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
209 $(images)/vmlinux.gz $(obj)/dummy.o 209 $(images)/vmlinux.gz $(obj)/dummy.o
@@ -215,7 +215,7 @@ $(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
215 $(obj)/dummy.o $(obj)/image.o 215 $(obj)/dummy.o $(obj)/image.o
216 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS) 216 $(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
217 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \ 217 $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
218 -R .stabstr -R .sysmap 218 -R .stabstr
219 219
220# Sort-of dummy rules, that let us format the image we want. 220# Sort-of dummy rules, that let us format the image we want.
221zImage: $(images)/$(zimage-y) $(obj)/zvmlinux 221zImage: $(images)/$(zimage-y) $(obj)/zvmlinux
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
index ab0f9902cb..e02de5b467 100644
--- a/arch/ppc/boot/simple/misc.c
+++ b/arch/ppc/boot/simple/misc.c
@@ -222,7 +222,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
222 puts("\n"); 222 puts("\n");
223 223
224 puts("Uncompressing Linux..."); 224 puts("Uncompressing Linux...");
225 gunzip(0x0, 0x400000, zimage_start, &zimage_size); 225 gunzip(NULL, 0x400000, zimage_start, &zimage_size);
226 puts("done.\n"); 226 puts("done.\n");
227 227
228 /* get the bi_rec address */ 228 /* get the bi_rec address */
diff --git a/arch/ppc/boot/simple/mpc10x_memory.c b/arch/ppc/boot/simple/mpc10x_memory.c
index 977daedc14..20d92a34ce 100644
--- a/arch/ppc/boot/simple/mpc10x_memory.c
+++ b/arch/ppc/boot/simple/mpc10x_memory.c
@@ -33,7 +33,7 @@
33 33
34#define MPC10X_PCI_OP(rw, size, type, op, mask) \ 34#define MPC10X_PCI_OP(rw, size, type, op, mask) \
35static void \ 35static void \
36mpc10x_##rw##_config_##size(unsigned int *cfg_addr, \ 36mpc10x_##rw##_config_##size(unsigned int __iomem *cfg_addr, \
37 unsigned int *cfg_data, int devfn, int offset, \ 37 unsigned int *cfg_data, int devfn, int offset, \
38 type val) \ 38 type val) \
39{ \ 39{ \
diff --git a/arch/ppc/boot/utils/addSystemMap.c b/arch/ppc/boot/utils/addSystemMap.c
deleted file mode 100644
index 4654f891b2..0000000000
--- a/arch/ppc/boot/utils/addSystemMap.c
+++ /dev/null
@@ -1,186 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <byteswap.h>
4#include <sys/types.h>
5#include <sys/stat.h>
6
7void xlate( char * inb, char * trb, unsigned len )
8{
9 unsigned i;
10 for ( i=0; i<len; ++i ) {
11 char c = *inb++;
12 char c1 = c >> 4;
13 char c2 = c & 0xf;
14 if ( c1 > 9 )
15 c1 = c1 + 'A' - 10;
16 else
17 c1 = c1 + '0';
18 if ( c2 > 9 )
19 c2 = c2 + 'A' - 10;
20 else
21 c2 = c2 + '0';
22 *trb++ = c1;
23 *trb++ = c2;
24 }
25 *trb = 0;
26}
27
28#define ElfHeaderSize (64 * 1024)
29#define ElfPages (ElfHeaderSize / 4096)
30#define KERNELBASE (0xc0000000)
31
32void get4k( /*istream *inf*/FILE *file, char *buf )
33{
34 unsigned j;
35 unsigned num = fread(buf, 1, 4096, file);
36 for ( j=num; j<4096; ++j )
37 buf[j] = 0;
38}
39
40void put4k( /*ostream *outf*/FILE *file, char *buf )
41{
42 fwrite(buf, 1, 4096, file);
43}
44
45int main(int argc, char **argv)
46{
47 char inbuf[4096];
48 FILE *ramDisk = NULL;
49 FILE *inputVmlinux = NULL;
50 FILE *outputVmlinux = NULL;
51 unsigned i = 0;
52 unsigned long ramFileLen = 0;
53 unsigned long ramLen = 0;
54 unsigned long roundR = 0;
55 unsigned long kernelLen = 0;
56 unsigned long actualKernelLen = 0;
57 unsigned long round = 0;
58 unsigned long roundedKernelLen = 0;
59 unsigned long ramStartOffs = 0;
60 unsigned long ramPages = 0;
61 unsigned long roundedKernelPages = 0;
62 if ( argc < 2 ) {
63 printf("Name of System Map file missing.\n");
64 exit(1);
65 }
66
67 if ( argc < 3 ) {
68 printf("Name of vmlinux file missing.\n");
69 exit(1);
70 }
71
72 if ( argc < 4 ) {
73 printf("Name of vmlinux output file missing.\n");
74 exit(1);
75 }
76
77 ramDisk = fopen(argv[1], "r");
78 if ( ! ramDisk ) {
79 printf("System Map file \"%s\" failed to open.\n", argv[1]);
80 exit(1);
81 }
82 inputVmlinux = fopen(argv[2], "r");
83 if ( ! inputVmlinux ) {
84 printf("vmlinux file \"%s\" failed to open.\n", argv[2]);
85 exit(1);
86 }
87 outputVmlinux = fopen(argv[3], "w");
88 if ( ! outputVmlinux ) {
89 printf("output vmlinux file \"%s\" failed to open.\n", argv[3]);
90 exit(1);
91 }
92 fseek(ramDisk, 0, SEEK_END);
93 ramFileLen = ftell(ramDisk);
94 fseek(ramDisk, 0, SEEK_SET);
95 printf("%s file size = %ld\n", argv[1], ramFileLen);
96
97 ramLen = ramFileLen;
98
99 roundR = 4096 - (ramLen % 4096);
100 if ( roundR ) {
101 printf("Rounding System Map file up to a multiple of 4096, adding %ld\n", roundR);
102 ramLen += roundR;
103 }
104
105 printf("Rounded System Map size is %ld\n", ramLen);
106 fseek(inputVmlinux, 0, SEEK_END);
107 kernelLen = ftell(inputVmlinux);
108 fseek(inputVmlinux, 0, SEEK_SET);
109 printf("kernel file size = %ld\n", kernelLen);
110 if ( kernelLen == 0 ) {
111 printf("You must have a linux kernel specified as argv[2]\n");
112 exit(1);
113 }
114
115 actualKernelLen = kernelLen - ElfHeaderSize;
116
117 printf("actual kernel length (minus ELF header) = %ld\n", actualKernelLen);
118
119 round = actualKernelLen % 4096;
120 roundedKernelLen = actualKernelLen;
121 if ( round )
122 roundedKernelLen += (4096 - round);
123
124 printf("actual kernel length rounded up to a 4k multiple = %ld\n", roundedKernelLen);
125
126 ramStartOffs = roundedKernelLen;
127 ramPages = ramLen / 4096;
128
129 printf("System map pages to copy = %ld\n", ramPages);
130
131 // Copy 64K ELF header
132 for (i=0; i<(ElfPages); ++i) {
133 get4k( inputVmlinux, inbuf );
134 put4k( outputVmlinux, inbuf );
135 }
136
137
138
139 roundedKernelPages = roundedKernelLen / 4096;
140
141 fseek(inputVmlinux, ElfHeaderSize, SEEK_SET);
142
143 {
144 for ( i=0; i<roundedKernelPages; ++i ) {
145 get4k( inputVmlinux, inbuf );
146 if ( i == 0 ) {
147 unsigned long * p;
148 printf("Storing embedded_sysmap_start at 0x3c\n");
149 p = (unsigned long *)(inbuf + 0x3c);
150
151#if (BYTE_ORDER == __BIG_ENDIAN)
152 *p = ramStartOffs;
153#else
154 *p = bswap_32(ramStartOffs);
155#endif
156
157 printf("Storing embedded_sysmap_end at 0x44\n");
158 p = (unsigned long *)(inbuf + 0x44);
159#if (BYTE_ORDER == __BIG_ENDIAN)
160 *p = ramStartOffs + ramFileLen;
161#else
162 *p = bswap_32(ramStartOffs + ramFileLen);
163#endif
164 }
165 put4k( outputVmlinux, inbuf );
166 }
167 }
168
169 {
170 for ( i=0; i<ramPages; ++i ) {
171 get4k( ramDisk, inbuf );
172 put4k( outputVmlinux, inbuf );
173 }
174 }
175
176
177 fclose(ramDisk);
178 fclose(inputVmlinux);
179 fclose(outputVmlinux);
180 /* Set permission to executable */
181 chmod(argv[3], S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
182
183 return 0;
184
185}
186
diff --git a/arch/ppc/configs/mpc8548_cds_defconfig b/arch/ppc/configs/mpc8548_cds_defconfig
new file mode 100644
index 0000000000..abe034f24b
--- /dev/null
+++ b/arch/ppc/configs/mpc8548_cds_defconfig
@@ -0,0 +1,659 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc4
4# Tue May 24 22:36:27 2005
5#
6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y
12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
15
16#
17# Code maturity level options
18#
19CONFIG_EXPERIMENTAL=y
20CONFIG_CLEAN_COMPILE=y
21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
23
24#
25# General setup
26#
27CONFIG_LOCALVERSION=""
28CONFIG_SWAP=y
29CONFIG_SYSVIPC=y
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32CONFIG_SYSCTL=y
33# CONFIG_AUDIT is not set
34# CONFIG_HOTPLUG is not set
35CONFIG_KOBJECT_UEVENT=y
36# CONFIG_IKCONFIG is not set
37CONFIG_EMBEDDED=y
38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
42CONFIG_FUTEX=y
43# CONFIG_EPOLL is not set
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SHMEM=y
46CONFIG_CC_ALIGN_FUNCTIONS=0
47CONFIG_CC_ALIGN_LABELS=0
48CONFIG_CC_ALIGN_LOOPS=0
49CONFIG_CC_ALIGN_JUMPS=0
50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
52
53#
54# Loadable module support
55#
56# CONFIG_MODULES is not set
57
58#
59# Processor
60#
61# CONFIG_6xx is not set
62# CONFIG_40x is not set
63# CONFIG_44x is not set
64# CONFIG_POWER3 is not set
65# CONFIG_POWER4 is not set
66# CONFIG_8xx is not set
67CONFIG_E500=y
68CONFIG_BOOKE=y
69CONFIG_FSL_BOOKE=y
70# CONFIG_PHYS_64BIT is not set
71CONFIG_SPE=y
72CONFIG_MATH_EMULATION=y
73# CONFIG_CPU_FREQ is not set
74# CONFIG_PM is not set
75CONFIG_85xx=y
76CONFIG_PPC_INDIRECT_PCI_BE=y
77
78#
79# Freescale 85xx options
80#
81# CONFIG_MPC8540_ADS is not set
82CONFIG_MPC8548_CDS=y
83# CONFIG_MPC8555_CDS is not set
84# CONFIG_MPC8560_ADS is not set
85# CONFIG_SBC8560 is not set
86# CONFIG_STX_GP3 is not set
87CONFIG_MPC8548=y
88
89#
90# Platform options
91#
92# CONFIG_SMP is not set
93# CONFIG_PREEMPT is not set
94# CONFIG_HIGHMEM is not set
95CONFIG_BINFMT_ELF=y
96# CONFIG_BINFMT_MISC is not set
97# CONFIG_CMDLINE_BOOL is not set
98CONFIG_ISA_DMA_API=y
99
100#
101# Bus options
102#
103# CONFIG_PCI is not set
104# CONFIG_PCI_DOMAINS is not set
105
106#
107# PCCARD (PCMCIA/CardBus) support
108#
109# CONFIG_PCCARD is not set
110
111#
112# Advanced setup
113#
114# CONFIG_ADVANCED_OPTIONS is not set
115
116#
117# Default settings for advanced configuration options are used
118#
119CONFIG_HIGHMEM_START=0xfe000000
120CONFIG_LOWMEM_SIZE=0x30000000
121CONFIG_KERNEL_START=0xc0000000
122CONFIG_TASK_SIZE=0x80000000
123CONFIG_BOOT_LOAD=0x00800000
124
125#
126# Device Drivers
127#
128
129#
130# Generic Driver Options
131#
132CONFIG_STANDALONE=y
133CONFIG_PREVENT_FIRMWARE_BUILD=y
134# CONFIG_FW_LOADER is not set
135
136#
137# Memory Technology Devices (MTD)
138#
139# CONFIG_MTD is not set
140
141#
142# Parallel port support
143#
144# CONFIG_PARPORT is not set
145
146#
147# Plug and Play support
148#
149
150#
151# Block devices
152#
153# CONFIG_BLK_DEV_FD is not set
154# CONFIG_BLK_DEV_COW_COMMON is not set
155CONFIG_BLK_DEV_LOOP=y
156# CONFIG_BLK_DEV_CRYPTOLOOP is not set
157# CONFIG_BLK_DEV_NBD is not set
158CONFIG_BLK_DEV_RAM=y
159CONFIG_BLK_DEV_RAM_COUNT=16
160CONFIG_BLK_DEV_RAM_SIZE=32768
161CONFIG_BLK_DEV_INITRD=y
162CONFIG_INITRAMFS_SOURCE=""
163# CONFIG_LBD is not set
164# CONFIG_CDROM_PKTCDVD is not set
165
166#
167# IO Schedulers
168#
169CONFIG_IOSCHED_NOOP=y
170CONFIG_IOSCHED_AS=y
171CONFIG_IOSCHED_DEADLINE=y
172CONFIG_IOSCHED_CFQ=y
173# CONFIG_ATA_OVER_ETH is not set
174
175#
176# ATA/ATAPI/MFM/RLL support
177#
178# CONFIG_IDE is not set
179
180#
181# SCSI device support
182#
183# CONFIG_SCSI is not set
184
185#
186# Multi-device support (RAID and LVM)
187#
188# CONFIG_MD is not set
189
190#
191# Fusion MPT device support
192#
193
194#
195# IEEE 1394 (FireWire) support
196#
197
198#
199# I2O device support
200#
201
202#
203# Macintosh device drivers
204#
205
206#
207# Networking support
208#
209CONFIG_NET=y
210
211#
212# Networking options
213#
214CONFIG_PACKET=y
215# CONFIG_PACKET_MMAP is not set
216CONFIG_UNIX=y
217# CONFIG_NET_KEY is not set
218CONFIG_INET=y
219CONFIG_IP_MULTICAST=y
220# CONFIG_IP_ADVANCED_ROUTER is not set
221CONFIG_IP_PNP=y
222CONFIG_IP_PNP_DHCP=y
223CONFIG_IP_PNP_BOOTP=y
224# CONFIG_IP_PNP_RARP is not set
225# CONFIG_NET_IPIP is not set
226# CONFIG_NET_IPGRE is not set
227# CONFIG_IP_MROUTE is not set
228# CONFIG_ARPD is not set
229CONFIG_SYN_COOKIES=y
230# CONFIG_INET_AH is not set
231# CONFIG_INET_ESP is not set
232# CONFIG_INET_IPCOMP is not set
233# CONFIG_INET_TUNNEL is not set
234CONFIG_IP_TCPDIAG=y
235# CONFIG_IP_TCPDIAG_IPV6 is not set
236# CONFIG_IPV6 is not set
237# CONFIG_NETFILTER is not set
238
239#
240# SCTP Configuration (EXPERIMENTAL)
241#
242# CONFIG_IP_SCTP is not set
243# CONFIG_ATM is not set
244# CONFIG_BRIDGE is not set
245# CONFIG_VLAN_8021Q is not set
246# CONFIG_DECNET is not set
247# CONFIG_LLC2 is not set
248# CONFIG_IPX is not set
249# CONFIG_ATALK is not set
250# CONFIG_X25 is not set
251# CONFIG_LAPB is not set
252# CONFIG_NET_DIVERT is not set
253# CONFIG_ECONET is not set
254# CONFIG_WAN_ROUTER is not set
255
256#
257# QoS and/or fair queueing
258#
259# CONFIG_NET_SCHED is not set
260# CONFIG_NET_CLS_ROUTE is not set
261
262#
263# Network testing
264#
265# CONFIG_NET_PKTGEN is not set
266# CONFIG_NETPOLL is not set
267# CONFIG_NET_POLL_CONTROLLER is not set
268# CONFIG_HAMRADIO is not set
269# CONFIG_IRDA is not set
270# CONFIG_BT is not set
271CONFIG_NETDEVICES=y
272# CONFIG_DUMMY is not set
273# CONFIG_BONDING is not set
274# CONFIG_EQUALIZER is not set
275# CONFIG_TUN is not set
276
277#
278# Ethernet (10 or 100Mbit)
279#
280CONFIG_NET_ETHERNET=y
281CONFIG_MII=y
282
283#
284# Ethernet (1000 Mbit)
285#
286CONFIG_GIANFAR=y
287CONFIG_GFAR_NAPI=y
288
289#
290# Ethernet (10000 Mbit)
291#
292
293#
294# Token Ring devices
295#
296
297#
298# Wireless LAN (non-hamradio)
299#
300# CONFIG_NET_RADIO is not set
301
302#
303# Wan interfaces
304#
305# CONFIG_WAN is not set
306# CONFIG_PPP is not set
307# CONFIG_SLIP is not set
308# CONFIG_SHAPER is not set
309# CONFIG_NETCONSOLE is not set
310
311#
312# ISDN subsystem
313#
314# CONFIG_ISDN is not set
315
316#
317# Telephony Support
318#
319# CONFIG_PHONE is not set
320
321#
322# Input device support
323#
324CONFIG_INPUT=y
325
326#
327# Userland interfaces
328#
329# CONFIG_INPUT_MOUSEDEV is not set
330# CONFIG_INPUT_JOYDEV is not set
331# CONFIG_INPUT_TSDEV is not set
332# CONFIG_INPUT_EVDEV is not set
333# CONFIG_INPUT_EVBUG is not set
334
335#
336# Input Device Drivers
337#
338# CONFIG_INPUT_KEYBOARD is not set
339# CONFIG_INPUT_MOUSE is not set
340# CONFIG_INPUT_JOYSTICK is not set
341# CONFIG_INPUT_TOUCHSCREEN is not set
342# CONFIG_INPUT_MISC is not set
343
344#
345# Hardware I/O ports
346#
347# CONFIG_SERIO is not set
348# CONFIG_GAMEPORT is not set
349CONFIG_SOUND_GAMEPORT=y
350
351#
352# Character devices
353#
354# CONFIG_VT is not set
355# CONFIG_SERIAL_NONSTANDARD is not set
356
357#
358# Serial drivers
359#
360CONFIG_SERIAL_8250=y
361CONFIG_SERIAL_8250_CONSOLE=y
362CONFIG_SERIAL_8250_NR_UARTS=4
363# CONFIG_SERIAL_8250_EXTENDED is not set
364
365#
366# Non-8250 serial port support
367#
368CONFIG_SERIAL_CORE=y
369CONFIG_SERIAL_CORE_CONSOLE=y
370CONFIG_UNIX98_PTYS=y
371CONFIG_LEGACY_PTYS=y
372CONFIG_LEGACY_PTY_COUNT=256
373
374#
375# IPMI
376#
377# CONFIG_IPMI_HANDLER is not set
378
379#
380# Watchdog Cards
381#
382# CONFIG_WATCHDOG is not set
383# CONFIG_NVRAM is not set
384CONFIG_GEN_RTC=y
385# CONFIG_GEN_RTC_X is not set
386# CONFIG_DTLK is not set
387# CONFIG_R3964 is not set
388
389#
390# Ftape, the floppy tape device driver
391#
392# CONFIG_AGP is not set
393# CONFIG_DRM is not set
394# CONFIG_RAW_DRIVER is not set
395
396#
397# TPM devices
398#
399
400#
401# I2C support
402#
403CONFIG_I2C=y
404CONFIG_I2C_CHARDEV=y
405
406#
407# I2C Algorithms
408#
409# CONFIG_I2C_ALGOBIT is not set
410# CONFIG_I2C_ALGOPCF is not set
411# CONFIG_I2C_ALGOPCA is not set
412
413#
414# I2C Hardware Bus support
415#
416# CONFIG_I2C_ISA is not set
417CONFIG_I2C_MPC=y
418# CONFIG_I2C_PARPORT_LIGHT is not set
419# CONFIG_I2C_PCA_ISA is not set
420
421#
422# Hardware Sensors Chip support
423#
424# CONFIG_I2C_SENSOR is not set
425# CONFIG_SENSORS_ADM1021 is not set
426# CONFIG_SENSORS_ADM1025 is not set
427# CONFIG_SENSORS_ADM1026 is not set
428# CONFIG_SENSORS_ADM1031 is not set
429# CONFIG_SENSORS_ASB100 is not set
430# CONFIG_SENSORS_DS1621 is not set
431# CONFIG_SENSORS_FSCHER is not set
432# CONFIG_SENSORS_FSCPOS is not set
433# CONFIG_SENSORS_GL518SM is not set
434# CONFIG_SENSORS_GL520SM is not set
435# CONFIG_SENSORS_IT87 is not set
436# CONFIG_SENSORS_LM63 is not set
437# CONFIG_SENSORS_LM75 is not set
438# CONFIG_SENSORS_LM77 is not set
439# CONFIG_SENSORS_LM78 is not set
440# CONFIG_SENSORS_LM80 is not set
441# CONFIG_SENSORS_LM83 is not set
442# CONFIG_SENSORS_LM85 is not set
443# CONFIG_SENSORS_LM87 is not set
444# CONFIG_SENSORS_LM90 is not set
445# CONFIG_SENSORS_LM92 is not set
446# CONFIG_SENSORS_MAX1619 is not set
447# CONFIG_SENSORS_PC87360 is not set
448# CONFIG_SENSORS_SMSC47B397 is not set
449# CONFIG_SENSORS_SMSC47M1 is not set
450# CONFIG_SENSORS_W83781D is not set
451# CONFIG_SENSORS_W83L785TS is not set
452# CONFIG_SENSORS_W83627HF is not set
453
454#
455# Other I2C Chip support
456#
457# CONFIG_SENSORS_DS1337 is not set
458# CONFIG_SENSORS_EEPROM is not set
459# CONFIG_SENSORS_PCF8574 is not set
460# CONFIG_SENSORS_PCF8591 is not set
461# CONFIG_SENSORS_RTC8564 is not set
462# CONFIG_SENSORS_M41T00 is not set
463# CONFIG_I2C_DEBUG_CORE is not set
464# CONFIG_I2C_DEBUG_ALGO is not set
465# CONFIG_I2C_DEBUG_BUS is not set
466# CONFIG_I2C_DEBUG_CHIP is not set
467
468#
469# Dallas's 1-wire bus
470#
471# CONFIG_W1 is not set
472
473#
474# Misc devices
475#
476
477#
478# Multimedia devices
479#
480# CONFIG_VIDEO_DEV is not set
481
482#
483# Digital Video Broadcasting Devices
484#
485# CONFIG_DVB is not set
486
487#
488# Graphics support
489#
490# CONFIG_FB is not set
491
492#
493# Sound
494#
495# CONFIG_SOUND is not set
496
497#
498# USB support
499#
500# CONFIG_USB_ARCH_HAS_HCD is not set
501# CONFIG_USB_ARCH_HAS_OHCI is not set
502
503#
504# USB Gadget Support
505#
506# CONFIG_USB_GADGET is not set
507
508#
509# MMC/SD Card support
510#
511# CONFIG_MMC is not set
512
513#
514# InfiniBand support
515#
516# CONFIG_INFINIBAND is not set
517
518#
519# File systems
520#
521CONFIG_EXT2_FS=y
522# CONFIG_EXT2_FS_XATTR is not set
523CONFIG_EXT3_FS=y
524CONFIG_EXT3_FS_XATTR=y
525# CONFIG_EXT3_FS_POSIX_ACL is not set
526# CONFIG_EXT3_FS_SECURITY is not set
527CONFIG_JBD=y
528# CONFIG_JBD_DEBUG is not set
529CONFIG_FS_MBCACHE=y
530# CONFIG_REISERFS_FS is not set
531# CONFIG_JFS_FS is not set
532
533#
534# XFS support
535#
536# CONFIG_XFS_FS is not set
537# CONFIG_MINIX_FS is not set
538# CONFIG_ROMFS_FS is not set
539# CONFIG_QUOTA is not set
540CONFIG_DNOTIFY=y
541# CONFIG_AUTOFS_FS is not set
542# CONFIG_AUTOFS4_FS is not set
543
544#
545# CD-ROM/DVD Filesystems
546#
547# CONFIG_ISO9660_FS is not set
548# CONFIG_UDF_FS is not set
549
550#
551# DOS/FAT/NT Filesystems
552#
553# CONFIG_MSDOS_FS is not set
554# CONFIG_VFAT_FS is not set
555# CONFIG_NTFS_FS is not set
556
557#
558# Pseudo filesystems
559#
560CONFIG_PROC_FS=y
561CONFIG_PROC_KCORE=y
562CONFIG_SYSFS=y
563# CONFIG_DEVFS_FS is not set
564# CONFIG_DEVPTS_FS_XATTR is not set
565CONFIG_TMPFS=y
566# CONFIG_TMPFS_XATTR is not set
567# CONFIG_HUGETLB_PAGE is not set
568CONFIG_RAMFS=y
569
570#
571# Miscellaneous filesystems
572#
573# CONFIG_ADFS_FS is not set
574# CONFIG_AFFS_FS is not set
575# CONFIG_HFS_FS is not set
576# CONFIG_HFSPLUS_FS is not set
577# CONFIG_BEFS_FS is not set
578# CONFIG_BFS_FS is not set
579# CONFIG_EFS_FS is not set
580# CONFIG_CRAMFS is not set
581# CONFIG_VXFS_FS is not set
582# CONFIG_HPFS_FS is not set
583# CONFIG_QNX4FS_FS is not set
584# CONFIG_SYSV_FS is not set
585# CONFIG_UFS_FS is not set
586
587#
588# Network File Systems
589#
590CONFIG_NFS_FS=y
591# CONFIG_NFS_V3 is not set
592# CONFIG_NFS_V4 is not set
593# CONFIG_NFS_DIRECTIO is not set
594# CONFIG_NFSD is not set
595CONFIG_ROOT_NFS=y
596CONFIG_LOCKD=y
597CONFIG_SUNRPC=y
598# CONFIG_RPCSEC_GSS_KRB5 is not set
599# CONFIG_RPCSEC_GSS_SPKM3 is not set
600# CONFIG_SMB_FS is not set
601# CONFIG_CIFS is not set
602# CONFIG_NCP_FS is not set
603# CONFIG_CODA_FS is not set
604# CONFIG_AFS_FS is not set
605
606#
607# Partition Types
608#
609CONFIG_PARTITION_ADVANCED=y
610# CONFIG_ACORN_PARTITION is not set
611# CONFIG_OSF_PARTITION is not set
612# CONFIG_AMIGA_PARTITION is not set
613# CONFIG_ATARI_PARTITION is not set
614# CONFIG_MAC_PARTITION is not set
615# CONFIG_MSDOS_PARTITION is not set
616# CONFIG_LDM_PARTITION is not set
617# CONFIG_SGI_PARTITION is not set
618# CONFIG_ULTRIX_PARTITION is not set
619# CONFIG_SUN_PARTITION is not set
620# CONFIG_EFI_PARTITION is not set
621
622#
623# Native Language Support
624#
625# CONFIG_NLS is not set
626
627#
628# Library routines
629#
630# CONFIG_CRC_CCITT is not set
631CONFIG_CRC32=y
632# CONFIG_LIBCRC32C is not set
633
634#
635# Profiling support
636#
637# CONFIG_PROFILING is not set
638
639#
640# Kernel hacking
641#
642# CONFIG_PRINTK_TIME is not set
643# CONFIG_DEBUG_KERNEL is not set
644CONFIG_LOG_BUF_SHIFT=14
645
646#
647# Security options
648#
649# CONFIG_KEYS is not set
650# CONFIG_SECURITY is not set
651
652#
653# Cryptographic options
654#
655# CONFIG_CRYPTO is not set
656
657#
658# Hardware crypto devices
659#
diff --git a/arch/ppc/configs/mpc8555_cds_defconfig b/arch/ppc/configs/mpc8555_cds_defconfig
index 728bd9e1a8..15abebf46b 100644
--- a/arch/ppc/configs/mpc8555_cds_defconfig
+++ b/arch/ppc/configs/mpc8555_cds_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11-rc1 3# Linux kernel version: 2.6.12-rc4
4# Thu Jan 20 01:25:35 2005 4# Tue May 17 11:56:01 2005
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_GENERIC_HARDIRQS=y 7CONFIG_GENERIC_HARDIRQS=y
@@ -11,6 +11,7 @@ CONFIG_HAVE_DEC_LOCK=y
11CONFIG_PPC=y 11CONFIG_PPC=y
12CONFIG_PPC32=y 12CONFIG_PPC32=y
13CONFIG_GENERIC_NVRAM=y 13CONFIG_GENERIC_NVRAM=y
14CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14 15
15# 16#
16# Code maturity level options 17# Code maturity level options
@@ -18,6 +19,7 @@ CONFIG_GENERIC_NVRAM=y
18CONFIG_EXPERIMENTAL=y 19CONFIG_EXPERIMENTAL=y
19CONFIG_CLEAN_COMPILE=y 20CONFIG_CLEAN_COMPILE=y
20CONFIG_BROKEN_ON_SMP=y 21CONFIG_BROKEN_ON_SMP=y
22CONFIG_INIT_ENV_ARG_LIMIT=32
21 23
22# 24#
23# General setup 25# General setup
@@ -29,12 +31,14 @@ CONFIG_SYSVIPC=y
29# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
30CONFIG_SYSCTL=y 32CONFIG_SYSCTL=y
31# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
32CONFIG_LOG_BUF_SHIFT=14
33# CONFIG_HOTPLUG is not set 34# CONFIG_HOTPLUG is not set
34CONFIG_KOBJECT_UEVENT=y 35CONFIG_KOBJECT_UEVENT=y
35# CONFIG_IKCONFIG is not set 36# CONFIG_IKCONFIG is not set
36CONFIG_EMBEDDED=y 37CONFIG_EMBEDDED=y
37# CONFIG_KALLSYMS is not set 38# CONFIG_KALLSYMS is not set
39CONFIG_PRINTK=y
40CONFIG_BUG=y
41CONFIG_BASE_FULL=y
38CONFIG_FUTEX=y 42CONFIG_FUTEX=y
39# CONFIG_EPOLL is not set 43# CONFIG_EPOLL is not set
40# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -44,6 +48,7 @@ CONFIG_CC_ALIGN_LABELS=0
44CONFIG_CC_ALIGN_LOOPS=0 48CONFIG_CC_ALIGN_LOOPS=0
45CONFIG_CC_ALIGN_JUMPS=0 49CONFIG_CC_ALIGN_JUMPS=0
46# CONFIG_TINY_SHMEM is not set 50# CONFIG_TINY_SHMEM is not set
51CONFIG_BASE_SMALL=0
47 52
48# 53#
49# Loadable module support 54# Loadable module support
@@ -62,10 +67,12 @@ CONFIG_CC_ALIGN_JUMPS=0
62CONFIG_E500=y 67CONFIG_E500=y
63CONFIG_BOOKE=y 68CONFIG_BOOKE=y
64CONFIG_FSL_BOOKE=y 69CONFIG_FSL_BOOKE=y
70# CONFIG_PHYS_64BIT is not set
65CONFIG_SPE=y 71CONFIG_SPE=y
66CONFIG_MATH_EMULATION=y 72CONFIG_MATH_EMULATION=y
67# CONFIG_CPU_FREQ is not set 73# CONFIG_CPU_FREQ is not set
68CONFIG_PPC_GEN550=y 74CONFIG_PPC_GEN550=y
75# CONFIG_PM is not set
69CONFIG_85xx=y 76CONFIG_85xx=y
70CONFIG_PPC_INDIRECT_PCI_BE=y 77CONFIG_PPC_INDIRECT_PCI_BE=y
71 78
@@ -76,6 +83,7 @@ CONFIG_PPC_INDIRECT_PCI_BE=y
76CONFIG_MPC8555_CDS=y 83CONFIG_MPC8555_CDS=y
77# CONFIG_MPC8560_ADS is not set 84# CONFIG_MPC8560_ADS is not set
78# CONFIG_SBC8560 is not set 85# CONFIG_SBC8560 is not set
86# CONFIG_STX_GP3 is not set
79CONFIG_MPC8555=y 87CONFIG_MPC8555=y
80CONFIG_85xx_PCI2=y 88CONFIG_85xx_PCI2=y
81 89
@@ -90,6 +98,7 @@ CONFIG_CPM2=y
90CONFIG_BINFMT_ELF=y 98CONFIG_BINFMT_ELF=y
91# CONFIG_BINFMT_MISC is not set 99# CONFIG_BINFMT_MISC is not set
92# CONFIG_CMDLINE_BOOL is not set 100# CONFIG_CMDLINE_BOOL is not set
101CONFIG_ISA_DMA_API=y
93 102
94# 103#
95# Bus options 104# Bus options
@@ -105,10 +114,6 @@ CONFIG_PCI_NAMES=y
105# CONFIG_PCCARD is not set 114# CONFIG_PCCARD is not set
106 115
107# 116#
108# PC-card bridges
109#
110
111#
112# Advanced setup 117# Advanced setup
113# 118#
114# CONFIG_ADVANCED_OPTIONS is not set 119# CONFIG_ADVANCED_OPTIONS is not set
@@ -180,7 +185,59 @@ CONFIG_IOSCHED_CFQ=y
180# 185#
181# ATA/ATAPI/MFM/RLL support 186# ATA/ATAPI/MFM/RLL support
182# 187#
183# CONFIG_IDE is not set 188CONFIG_IDE=y
189CONFIG_BLK_DEV_IDE=y
190
191#
192# Please see Documentation/ide.txt for help/info on IDE drives
193#
194# CONFIG_BLK_DEV_IDE_SATA is not set
195CONFIG_BLK_DEV_IDEDISK=y
196# CONFIG_IDEDISK_MULTI_MODE is not set
197# CONFIG_BLK_DEV_IDECD is not set
198# CONFIG_BLK_DEV_IDETAPE is not set
199# CONFIG_BLK_DEV_IDEFLOPPY is not set
200# CONFIG_IDE_TASK_IOCTL is not set
201
202#
203# IDE chipset support/bugfixes
204#
205CONFIG_IDE_GENERIC=y
206CONFIG_BLK_DEV_IDEPCI=y
207CONFIG_IDEPCI_SHARE_IRQ=y
208# CONFIG_BLK_DEV_OFFBOARD is not set
209CONFIG_BLK_DEV_GENERIC=y
210# CONFIG_BLK_DEV_OPTI621 is not set
211# CONFIG_BLK_DEV_SL82C105 is not set
212CONFIG_BLK_DEV_IDEDMA_PCI=y
213# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
214CONFIG_IDEDMA_PCI_AUTO=y
215# CONFIG_IDEDMA_ONLYDISK is not set
216# CONFIG_BLK_DEV_AEC62XX is not set
217# CONFIG_BLK_DEV_ALI15X3 is not set
218# CONFIG_BLK_DEV_AMD74XX is not set
219# CONFIG_BLK_DEV_CMD64X is not set
220# CONFIG_BLK_DEV_TRIFLEX is not set
221# CONFIG_BLK_DEV_CY82C693 is not set
222# CONFIG_BLK_DEV_CS5520 is not set
223# CONFIG_BLK_DEV_CS5530 is not set
224# CONFIG_BLK_DEV_HPT34X is not set
225# CONFIG_BLK_DEV_HPT366 is not set
226# CONFIG_BLK_DEV_SC1200 is not set
227# CONFIG_BLK_DEV_PIIX is not set
228# CONFIG_BLK_DEV_NS87415 is not set
229# CONFIG_BLK_DEV_PDC202XX_OLD is not set
230# CONFIG_BLK_DEV_PDC202XX_NEW is not set
231# CONFIG_BLK_DEV_SVWKS is not set
232# CONFIG_BLK_DEV_SIIMAGE is not set
233# CONFIG_BLK_DEV_SLC90E66 is not set
234# CONFIG_BLK_DEV_TRM290 is not set
235CONFIG_BLK_DEV_VIA82CXXX=y
236# CONFIG_IDE_ARM is not set
237CONFIG_BLK_DEV_IDEDMA=y
238# CONFIG_IDEDMA_IVB is not set
239CONFIG_IDEDMA_AUTO=y
240# CONFIG_BLK_DEV_HD is not set
184 241
185# 242#
186# SCSI device support 243# SCSI device support
@@ -220,7 +277,6 @@ CONFIG_NET=y
220# 277#
221CONFIG_PACKET=y 278CONFIG_PACKET=y
222# CONFIG_PACKET_MMAP is not set 279# CONFIG_PACKET_MMAP is not set
223# CONFIG_NETLINK_DEV is not set
224CONFIG_UNIX=y 280CONFIG_UNIX=y
225# CONFIG_NET_KEY is not set 281# CONFIG_NET_KEY is not set
226CONFIG_INET=y 282CONFIG_INET=y
@@ -370,14 +426,6 @@ CONFIG_INPUT=y
370# CONFIG_INPUT_EVBUG is not set 426# CONFIG_INPUT_EVBUG is not set
371 427
372# 428#
373# Input I/O drivers
374#
375# CONFIG_GAMEPORT is not set
376CONFIG_SOUND_GAMEPORT=y
377# CONFIG_SERIO is not set
378# CONFIG_SERIO_I8042 is not set
379
380#
381# Input Device Drivers 429# Input Device Drivers
382# 430#
383# CONFIG_INPUT_KEYBOARD is not set 431# CONFIG_INPUT_KEYBOARD is not set
@@ -387,6 +435,13 @@ CONFIG_SOUND_GAMEPORT=y
387# CONFIG_INPUT_MISC is not set 435# CONFIG_INPUT_MISC is not set
388 436
389# 437#
438# Hardware I/O ports
439#
440# CONFIG_SERIO is not set
441# CONFIG_GAMEPORT is not set
442CONFIG_SOUND_GAMEPORT=y
443
444#
390# Character devices 445# Character devices
391# 446#
392# CONFIG_VT is not set 447# CONFIG_VT is not set
@@ -406,6 +461,7 @@ CONFIG_SERIAL_8250_NR_UARTS=4
406CONFIG_SERIAL_CORE=y 461CONFIG_SERIAL_CORE=y
407CONFIG_SERIAL_CORE_CONSOLE=y 462CONFIG_SERIAL_CORE_CONSOLE=y
408# CONFIG_SERIAL_CPM is not set 463# CONFIG_SERIAL_CPM is not set
464# CONFIG_SERIAL_JSM is not set
409CONFIG_UNIX98_PTYS=y 465CONFIG_UNIX98_PTYS=y
410CONFIG_LEGACY_PTYS=y 466CONFIG_LEGACY_PTYS=y
411CONFIG_LEGACY_PTY_COUNT=256 467CONFIG_LEGACY_PTY_COUNT=256
@@ -434,6 +490,11 @@ CONFIG_GEN_RTC=y
434# CONFIG_RAW_DRIVER is not set 490# CONFIG_RAW_DRIVER is not set
435 491
436# 492#
493# TPM devices
494#
495# CONFIG_TCG_TPM is not set
496
497#
437# I2C support 498# I2C support
438# 499#
439CONFIG_I2C=y 500CONFIG_I2C=y
@@ -456,11 +517,11 @@ CONFIG_I2C_CHARDEV=y
456# CONFIG_I2C_AMD8111 is not set 517# CONFIG_I2C_AMD8111 is not set
457# CONFIG_I2C_I801 is not set 518# CONFIG_I2C_I801 is not set
458# CONFIG_I2C_I810 is not set 519# CONFIG_I2C_I810 is not set
520# CONFIG_I2C_PIIX4 is not set
459# CONFIG_I2C_ISA is not set 521# CONFIG_I2C_ISA is not set
460CONFIG_I2C_MPC=y 522CONFIG_I2C_MPC=y
461# CONFIG_I2C_NFORCE2 is not set 523# CONFIG_I2C_NFORCE2 is not set
462# CONFIG_I2C_PARPORT_LIGHT is not set 524# CONFIG_I2C_PARPORT_LIGHT is not set
463# CONFIG_I2C_PIIX4 is not set
464# CONFIG_I2C_PROSAVAGE is not set 525# CONFIG_I2C_PROSAVAGE is not set
465# CONFIG_I2C_SAVAGE4 is not set 526# CONFIG_I2C_SAVAGE4 is not set
466# CONFIG_SCx200_ACB is not set 527# CONFIG_SCx200_ACB is not set
@@ -483,7 +544,9 @@ CONFIG_I2C_MPC=y
483# CONFIG_SENSORS_ASB100 is not set 544# CONFIG_SENSORS_ASB100 is not set
484# CONFIG_SENSORS_DS1621 is not set 545# CONFIG_SENSORS_DS1621 is not set
485# CONFIG_SENSORS_FSCHER is not set 546# CONFIG_SENSORS_FSCHER is not set
547# CONFIG_SENSORS_FSCPOS is not set
486# CONFIG_SENSORS_GL518SM is not set 548# CONFIG_SENSORS_GL518SM is not set
549# CONFIG_SENSORS_GL520SM is not set
487# CONFIG_SENSORS_IT87 is not set 550# CONFIG_SENSORS_IT87 is not set
488# CONFIG_SENSORS_LM63 is not set 551# CONFIG_SENSORS_LM63 is not set
489# CONFIG_SENSORS_LM75 is not set 552# CONFIG_SENSORS_LM75 is not set
@@ -494,9 +557,11 @@ CONFIG_I2C_MPC=y
494# CONFIG_SENSORS_LM85 is not set 557# CONFIG_SENSORS_LM85 is not set
495# CONFIG_SENSORS_LM87 is not set 558# CONFIG_SENSORS_LM87 is not set
496# CONFIG_SENSORS_LM90 is not set 559# CONFIG_SENSORS_LM90 is not set
560# CONFIG_SENSORS_LM92 is not set
497# CONFIG_SENSORS_MAX1619 is not set 561# CONFIG_SENSORS_MAX1619 is not set
498# CONFIG_SENSORS_PC87360 is not set 562# CONFIG_SENSORS_PC87360 is not set
499# CONFIG_SENSORS_SMSC47B397 is not set 563# CONFIG_SENSORS_SMSC47B397 is not set
564# CONFIG_SENSORS_SIS5595 is not set
500# CONFIG_SENSORS_SMSC47M1 is not set 565# CONFIG_SENSORS_SMSC47M1 is not set
501# CONFIG_SENSORS_VIA686A is not set 566# CONFIG_SENSORS_VIA686A is not set
502# CONFIG_SENSORS_W83781D is not set 567# CONFIG_SENSORS_W83781D is not set
@@ -506,10 +571,12 @@ CONFIG_I2C_MPC=y
506# 571#
507# Other I2C Chip support 572# Other I2C Chip support
508# 573#
574# CONFIG_SENSORS_DS1337 is not set
509# CONFIG_SENSORS_EEPROM is not set 575# CONFIG_SENSORS_EEPROM is not set
510# CONFIG_SENSORS_PCF8574 is not set 576# CONFIG_SENSORS_PCF8574 is not set
511# CONFIG_SENSORS_PCF8591 is not set 577# CONFIG_SENSORS_PCF8591 is not set
512# CONFIG_SENSORS_RTC8564 is not set 578# CONFIG_SENSORS_RTC8564 is not set
579# CONFIG_SENSORS_M41T00 is not set
513# CONFIG_I2C_DEBUG_CORE is not set 580# CONFIG_I2C_DEBUG_CORE is not set
514# CONFIG_I2C_DEBUG_ALGO is not set 581# CONFIG_I2C_DEBUG_ALGO is not set
515# CONFIG_I2C_DEBUG_BUS is not set 582# CONFIG_I2C_DEBUG_BUS is not set
@@ -538,7 +605,6 @@ CONFIG_I2C_MPC=y
538# Graphics support 605# Graphics support
539# 606#
540# CONFIG_FB is not set 607# CONFIG_FB is not set
541# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
542 608
543# 609#
544# Sound 610# Sound
@@ -548,13 +614,9 @@ CONFIG_I2C_MPC=y
548# 614#
549# USB support 615# USB support
550# 616#
551# CONFIG_USB is not set
552CONFIG_USB_ARCH_HAS_HCD=y 617CONFIG_USB_ARCH_HAS_HCD=y
553CONFIG_USB_ARCH_HAS_OHCI=y 618CONFIG_USB_ARCH_HAS_OHCI=y
554 619# CONFIG_USB is not set
555#
556# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
557#
558 620
559# 621#
560# USB Gadget Support 622# USB Gadget Support
@@ -585,6 +647,10 @@ CONFIG_JBD=y
585CONFIG_FS_MBCACHE=y 647CONFIG_FS_MBCACHE=y
586# CONFIG_REISERFS_FS is not set 648# CONFIG_REISERFS_FS is not set
587# CONFIG_JFS_FS is not set 649# CONFIG_JFS_FS is not set
650
651#
652# XFS support
653#
588# CONFIG_XFS_FS is not set 654# CONFIG_XFS_FS is not set
589# CONFIG_MINIX_FS is not set 655# CONFIG_MINIX_FS is not set
590# CONFIG_ROMFS_FS is not set 656# CONFIG_ROMFS_FS is not set
@@ -646,7 +712,6 @@ CONFIG_NFS_FS=y
646# CONFIG_NFSD is not set 712# CONFIG_NFSD is not set
647CONFIG_ROOT_NFS=y 713CONFIG_ROOT_NFS=y
648CONFIG_LOCKD=y 714CONFIG_LOCKD=y
649# CONFIG_EXPORTFS is not set
650CONFIG_SUNRPC=y 715CONFIG_SUNRPC=y
651# CONFIG_RPCSEC_GSS_KRB5 is not set 716# CONFIG_RPCSEC_GSS_KRB5 is not set
652# CONFIG_RPCSEC_GSS_SPKM3 is not set 717# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -698,7 +763,9 @@ CONFIG_CRC32=y
698# 763#
699# Kernel hacking 764# Kernel hacking
700# 765#
766# CONFIG_PRINTK_TIME is not set
701# CONFIG_DEBUG_KERNEL is not set 767# CONFIG_DEBUG_KERNEL is not set
768CONFIG_LOG_BUF_SHIFT=14
702# CONFIG_KGDB_CONSOLE is not set 769# CONFIG_KGDB_CONSOLE is not set
703# CONFIG_SERIAL_TEXT_DEBUG is not set 770# CONFIG_SERIAL_TEXT_DEBUG is not set
704 771
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index b284451802..b1457a8a9c 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -26,7 +26,10 @@ obj-$(CONFIG_KGDB) += ppc-stub.o
26obj-$(CONFIG_SMP) += smp.o smp-tbsync.o 26obj-$(CONFIG_SMP) += smp.o smp-tbsync.o
27obj-$(CONFIG_TAU) += temp.o 27obj-$(CONFIG_TAU) += temp.o
28obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 28obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
29ifndef CONFIG_E200
29obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o 30obj-$(CONFIG_FSL_BOOKE) += perfmon_fsl_booke.o
31endif
32obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
30 33
31ifndef CONFIG_MATH_EMULATION 34ifndef CONFIG_MATH_EMULATION
32obj-$(CONFIG_8xx) += softemu8xx.o 35obj-$(CONFIG_8xx) += softemu8xx.o
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 8aa5e8c690..50936cda0a 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -838,6 +838,17 @@ struct cpu_spec cpu_specs[] = {
838 .icache_bsize = 32, 838 .icache_bsize = 32,
839 .dcache_bsize = 32, 839 .dcache_bsize = 32,
840 }, 840 },
841 { /* 405EP */
842 .pvr_mask = 0xffff0000,
843 .pvr_value = 0x51210000,
844 .cpu_name = "405EP",
845 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
846 CPU_FTR_USE_TB,
847 .cpu_user_features = PPC_FEATURE_32 |
848 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
849 .icache_bsize = 32,
850 .dcache_bsize = 32,
851 },
841 852
842#endif /* CONFIG_40x */ 853#endif /* CONFIG_40x */
843#ifdef CONFIG_44x 854#ifdef CONFIG_44x
@@ -892,7 +903,30 @@ struct cpu_spec cpu_specs[] = {
892 .dcache_bsize = 32, 903 .dcache_bsize = 32,
893 }, 904 },
894#endif /* CONFIG_44x */ 905#endif /* CONFIG_44x */
895#ifdef CONFIG_E500 906#ifdef CONFIG_FSL_BOOKE
907 { /* e200z5 */
908 .pvr_mask = 0xfff00000,
909 .pvr_value = 0x81000000,
910 .cpu_name = "e200z5",
911 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
912 .cpu_features = CPU_FTR_USE_TB,
913 .cpu_user_features = PPC_FEATURE_32 |
914 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_EFP_SINGLE |
915 PPC_FEATURE_UNIFIED_CACHE,
916 .dcache_bsize = 32,
917 },
918 { /* e200z6 */
919 .pvr_mask = 0xfff00000,
920 .pvr_value = 0x81100000,
921 .cpu_name = "e200z6",
922 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
923 .cpu_features = CPU_FTR_USE_TB,
924 .cpu_user_features = PPC_FEATURE_32 |
925 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP |
926 PPC_FEATURE_HAS_EFP_SINGLE |
927 PPC_FEATURE_UNIFIED_CACHE,
928 .dcache_bsize = 32,
929 },
896 { /* e500 */ 930 { /* e500 */
897 .pvr_mask = 0xffff0000, 931 .pvr_mask = 0xffff0000,
898 .pvr_value = 0x80200000, 932 .pvr_value = 0x80200000,
@@ -907,6 +941,20 @@ struct cpu_spec cpu_specs[] = {
907 .dcache_bsize = 32, 941 .dcache_bsize = 32,
908 .num_pmcs = 4, 942 .num_pmcs = 4,
909 }, 943 },
944 { /* e500v2 */
945 .pvr_mask = 0xffff0000,
946 .pvr_value = 0x80210000,
947 .cpu_name = "e500v2",
948 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
949 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
950 CPU_FTR_USE_TB | CPU_FTR_BIG_PHYS,
951 .cpu_user_features = PPC_FEATURE_32 |
952 PPC_FEATURE_HAS_MMU | PPC_FEATURE_SPE_COMP |
953 PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE,
954 .icache_bsize = 32,
955 .dcache_bsize = 32,
956 .num_pmcs = 4,
957 },
910#endif 958#endif
911#if !CLASSIC_PPC 959#if !CLASSIC_PPC
912 { /* default match */ 960 { /* default match */
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 5f075dbc4e..d4df68629c 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -46,26 +46,28 @@
46 46
47#ifdef CONFIG_BOOKE 47#ifdef CONFIG_BOOKE
48#include "head_booke.h" 48#include "head_booke.h"
49#define TRANSFER_TO_HANDLER_EXC_LEVEL(exc_level) \
50 mtspr exc_level##_SPRG,r8; \
51 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level); \
52 lwz r0,GPR10-INT_FRAME_SIZE(r8); \
53 stw r0,GPR10(r11); \
54 lwz r0,GPR11-INT_FRAME_SIZE(r8); \
55 stw r0,GPR11(r11); \
56 mfspr r8,exc_level##_SPRG
57
49 .globl mcheck_transfer_to_handler 58 .globl mcheck_transfer_to_handler
50mcheck_transfer_to_handler: 59mcheck_transfer_to_handler:
51 mtspr MCHECK_SPRG,r8 60 TRANSFER_TO_HANDLER_EXC_LEVEL(MCHECK)
52 BOOKE_LOAD_MCHECK_STACK 61 b transfer_to_handler_full
53 lwz r0,GPR10-INT_FRAME_SIZE(r8) 62
54 stw r0,GPR10(r11) 63 .globl debug_transfer_to_handler
55 lwz r0,GPR11-INT_FRAME_SIZE(r8) 64debug_transfer_to_handler:
56 stw r0,GPR11(r11) 65 TRANSFER_TO_HANDLER_EXC_LEVEL(DEBUG)
57 mfspr r8,MCHECK_SPRG
58 b transfer_to_handler_full 66 b transfer_to_handler_full
59 67
60 .globl crit_transfer_to_handler 68 .globl crit_transfer_to_handler
61crit_transfer_to_handler: 69crit_transfer_to_handler:
62 mtspr CRIT_SPRG,r8 70 TRANSFER_TO_HANDLER_EXC_LEVEL(CRIT)
63 BOOKE_LOAD_CRIT_STACK
64 lwz r0,GPR10-INT_FRAME_SIZE(r8)
65 stw r0,GPR10(r11)
66 lwz r0,GPR11-INT_FRAME_SIZE(r8)
67 stw r0,GPR11(r11)
68 mfspr r8,CRIT_SPRG
69 /* fall through */ 71 /* fall through */
70#endif 72#endif
71 73
@@ -202,7 +204,7 @@ _GLOBAL(DoSyscall)
202 rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR 204 rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR
203 stw r11,TI_LOCAL_FLAGS(r10) 205 stw r11,TI_LOCAL_FLAGS(r10)
204 lwz r11,TI_FLAGS(r10) 206 lwz r11,TI_FLAGS(r10)
205 andi. r11,r11,_TIF_SYSCALL_TRACE 207 andi. r11,r11,_TIF_SYSCALL_T_OR_A
206 bne- syscall_dotrace 208 bne- syscall_dotrace
207syscall_dotrace_cont: 209syscall_dotrace_cont:
208 cmplwi 0,r0,NR_syscalls 210 cmplwi 0,r0,NR_syscalls
@@ -237,7 +239,7 @@ ret_from_syscall:
237 SYNC 239 SYNC
238 MTMSRD(r10) 240 MTMSRD(r10)
239 lwz r9,TI_FLAGS(r12) 241 lwz r9,TI_FLAGS(r12)
240 andi. r0,r9,(_TIF_SYSCALL_TRACE|_TIF_SIGPENDING|_TIF_NEED_RESCHED) 242 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
241 bne- syscall_exit_work 243 bne- syscall_exit_work
242syscall_exit_cont: 244syscall_exit_cont:
243#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 245#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
@@ -277,7 +279,8 @@ syscall_dotrace:
277 SAVE_NVGPRS(r1) 279 SAVE_NVGPRS(r1)
278 li r0,0xc00 280 li r0,0xc00
279 stw r0,TRAP(r1) 281 stw r0,TRAP(r1)
280 bl do_syscall_trace 282 addi r3,r1,STACK_FRAME_OVERHEAD
283 bl do_syscall_trace_enter
281 lwz r0,GPR0(r1) /* Restore original registers */ 284 lwz r0,GPR0(r1) /* Restore original registers */
282 lwz r3,GPR3(r1) 285 lwz r3,GPR3(r1)
283 lwz r4,GPR4(r1) 286 lwz r4,GPR4(r1)
@@ -291,7 +294,7 @@ syscall_dotrace:
291syscall_exit_work: 294syscall_exit_work:
292 stw r6,RESULT(r1) /* Save result */ 295 stw r6,RESULT(r1) /* Save result */
293 stw r3,GPR3(r1) /* Update return value */ 296 stw r3,GPR3(r1) /* Update return value */
294 andi. r0,r9,_TIF_SYSCALL_TRACE 297 andi. r0,r9,_TIF_SYSCALL_T_OR_A
295 beq 5f 298 beq 5f
296 ori r10,r10,MSR_EE 299 ori r10,r10,MSR_EE
297 SYNC 300 SYNC
@@ -303,7 +306,8 @@ syscall_exit_work:
303 li r4,0xc00 306 li r4,0xc00
304 stw r4,TRAP(r1) 307 stw r4,TRAP(r1)
3054: 3084:
306 bl do_syscall_trace 309 addi r3,r1,STACK_FRAME_OVERHEAD
310 bl do_syscall_trace_leave
307 REST_NVGPRS(r1) 311 REST_NVGPRS(r1)
3082: 3122:
309 lwz r3,GPR3(r1) 313 lwz r3,GPR3(r1)
@@ -627,8 +631,8 @@ sigreturn_exit:
627 subi r1,r3,STACK_FRAME_OVERHEAD 631 subi r1,r3,STACK_FRAME_OVERHEAD
628 rlwinm r12,r1,0,0,18 /* current_thread_info() */ 632 rlwinm r12,r1,0,0,18 /* current_thread_info() */
629 lwz r9,TI_FLAGS(r12) 633 lwz r9,TI_FLAGS(r12)
630 andi. r0,r9,_TIF_SYSCALL_TRACE 634 andi. r0,r9,_TIF_SYSCALL_T_OR_A
631 bnel- do_syscall_trace 635 bnel- do_syscall_trace_leave
632 /* fall through */ 636 /* fall through */
633 637
634 .globl ret_from_except_full 638 .globl ret_from_except_full
@@ -781,99 +785,68 @@ exc_exit_restart_end:
781 * time of the critical interrupt. 785 * time of the critical interrupt.
782 * 786 *
783 */ 787 */
784 .globl ret_from_crit_exc
785ret_from_crit_exc:
786 REST_NVGPRS(r1)
787 lwz r3,_MSR(r1)
788 andi. r3,r3,MSR_PR
789 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
790 bne user_exc_return
791
792 lwz r0,GPR0(r1)
793 lwz r2,GPR2(r1)
794 REST_4GPRS(3, r1)
795 REST_2GPRS(7, r1)
796
797 lwz r10,_XER(r1)
798 lwz r11,_CTR(r1)
799 mtspr SPRN_XER,r10
800 mtctr r11
801
802 PPC405_ERR77(0,r1)
803 stwcx. r0,0,r1 /* to clear the reservation */
804
805 lwz r11,_LINK(r1)
806 mtlr r11
807 lwz r10,_CCR(r1)
808 mtcrf 0xff,r10
809#ifdef CONFIG_40x 788#ifdef CONFIG_40x
810 /* avoid any possible TLB misses here by turning off MSR.DR, we 789#define PPC_40x_TURN_OFF_MSR_DR \
811 * assume the instructions here are mapped by a pinned TLB entry */ 790 /* avoid any possible TLB misses here by turning off MSR.DR, we \
812 li r10,MSR_IR 791 * assume the instructions here are mapped by a pinned TLB entry */ \
813 mtmsr r10 792 li r10,MSR_IR; \
814 isync 793 mtmsr r10; \
815 tophys(r1, r1) 794 isync; \
795 tophys(r1, r1);
796#else
797#define PPC_40x_TURN_OFF_MSR_DR
816#endif 798#endif
817 lwz r9,_DEAR(r1)
818 lwz r10,_ESR(r1)
819 mtspr SPRN_DEAR,r9
820 mtspr SPRN_ESR,r10
821 lwz r11,_NIP(r1)
822 lwz r12,_MSR(r1)
823 mtspr SPRN_CSRR0,r11
824 mtspr SPRN_CSRR1,r12
825 lwz r9,GPR9(r1)
826 lwz r12,GPR12(r1)
827 lwz r10,GPR10(r1)
828 lwz r11,GPR11(r1)
829 lwz r1,GPR1(r1)
830 PPC405_ERR77_SYNC
831 rfci
832 b . /* prevent prefetch past rfci */
833 799
834#ifdef CONFIG_BOOKE 800#define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \
835/* 801 REST_NVGPRS(r1); \
836 * Return from a machine check interrupt, similar to a critical 802 lwz r3,_MSR(r1); \
837 * interrupt. 803 andi. r3,r3,MSR_PR; \
838 */ 804 LOAD_MSR_KERNEL(r10,MSR_KERNEL); \
839 .globl ret_from_mcheck_exc 805 bne user_exc_return; \
840ret_from_mcheck_exc: 806 lwz r0,GPR0(r1); \
841 REST_NVGPRS(r1) 807 lwz r2,GPR2(r1); \
842 lwz r3,_MSR(r1) 808 REST_4GPRS(3, r1); \
843 andi. r3,r3,MSR_PR 809 REST_2GPRS(7, r1); \
844 LOAD_MSR_KERNEL(r10,MSR_KERNEL) 810 lwz r10,_XER(r1); \
845 bne user_exc_return 811 lwz r11,_CTR(r1); \
846 812 mtspr SPRN_XER,r10; \
847 lwz r0,GPR0(r1) 813 mtctr r11; \
848 lwz r2,GPR2(r1) 814 PPC405_ERR77(0,r1); \
849 REST_4GPRS(3, r1) 815 stwcx. r0,0,r1; /* to clear the reservation */ \
850 REST_2GPRS(7, r1) 816 lwz r11,_LINK(r1); \
817 mtlr r11; \
818 lwz r10,_CCR(r1); \
819 mtcrf 0xff,r10; \
820 PPC_40x_TURN_OFF_MSR_DR; \
821 lwz r9,_DEAR(r1); \
822 lwz r10,_ESR(r1); \
823 mtspr SPRN_DEAR,r9; \
824 mtspr SPRN_ESR,r10; \
825 lwz r11,_NIP(r1); \
826 lwz r12,_MSR(r1); \
827 mtspr exc_lvl_srr0,r11; \
828 mtspr exc_lvl_srr1,r12; \
829 lwz r9,GPR9(r1); \
830 lwz r12,GPR12(r1); \
831 lwz r10,GPR10(r1); \
832 lwz r11,GPR11(r1); \
833 lwz r1,GPR1(r1); \
834 PPC405_ERR77_SYNC; \
835 exc_lvl_rfi; \
836 b .; /* prevent prefetch past exc_lvl_rfi */
851 837
852 lwz r10,_XER(r1) 838 .globl ret_from_crit_exc
853 lwz r11,_CTR(r1) 839ret_from_crit_exc:
854 mtspr SPRN_XER,r10 840 RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI)
855 mtctr r11
856 841
857 stwcx. r0,0,r1 /* to clear the reservation */ 842#ifdef CONFIG_BOOKE
843 .globl ret_from_debug_exc
844ret_from_debug_exc:
845 RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, RFDI)
858 846
859 lwz r11,_LINK(r1) 847 .globl ret_from_mcheck_exc
860 mtlr r11 848ret_from_mcheck_exc:
861 lwz r10,_CCR(r1) 849 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, RFMCI)
862 mtcrf 0xff,r10
863 lwz r9,_DEAR(r1)
864 lwz r10,_ESR(r1)
865 mtspr SPRN_DEAR,r9
866 mtspr SPRN_ESR,r10
867 lwz r11,_NIP(r1)
868 lwz r12,_MSR(r1)
869 mtspr SPRN_MCSRR0,r11
870 mtspr SPRN_MCSRR1,r12
871 lwz r9,GPR9(r1)
872 lwz r12,GPR12(r1)
873 lwz r10,GPR10(r1)
874 lwz r11,GPR11(r1)
875 lwz r1,GPR1(r1)
876 RFMCI
877#endif /* CONFIG_BOOKE */ 850#endif /* CONFIG_BOOKE */
878 851
879/* 852/*
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index 6f5d380e23..23fb51819b 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -291,8 +291,9 @@ label:
291 /* If we are faulting a kernel address, we have to use the 291 /* If we are faulting a kernel address, we have to use the
292 * kernel page tables. 292 * kernel page tables.
293 */ 293 */
294 andis. r11, r10, 0x8000 294 lis r11, TASK_SIZE@h
295 beq 3f 295 cmplw r10, r11
296 blt+ 3f
296 lis r11, swapper_pg_dir@h 297 lis r11, swapper_pg_dir@h
297 ori r11, r11, swapper_pg_dir@l 298 ori r11, r11, swapper_pg_dir@l
298 li r9, 0 299 li r9, 0
@@ -479,8 +480,9 @@ label:
479 /* If we are faulting a kernel address, we have to use the 480 /* If we are faulting a kernel address, we have to use the
480 * kernel page tables. 481 * kernel page tables.
481 */ 482 */
482 andis. r11, r10, 0x8000 483 lis r11, TASK_SIZE@h
483 beq 3f 484 cmplw r10, r11
485 blt+ 3f
484 lis r11, swapper_pg_dir@h 486 lis r11, swapper_pg_dir@h
485 ori r11, r11, swapper_pg_dir@l 487 ori r11, r11, swapper_pg_dir@l
486 li r9, 0 488 li r9, 0
@@ -578,8 +580,9 @@ label:
578 /* If we are faulting a kernel address, we have to use the 580 /* If we are faulting a kernel address, we have to use the
579 * kernel page tables. 581 * kernel page tables.
580 */ 582 */
581 andis. r11, r10, 0x8000 583 lis r11, TASK_SIZE@h
582 beq 3f 584 cmplw r10, r11
585 blt+ 3f
583 lis r11, swapper_pg_dir@h 586 lis r11, swapper_pg_dir@h
584 ori r11, r11, swapper_pg_dir@l 587 ori r11, r11, swapper_pg_dir@l
585 li r9, 0 588 li r9, 0
diff --git a/arch/ppc/kernel/head_booke.h b/arch/ppc/kernel/head_booke.h
index f213d12eec..9342acf12e 100644
--- a/arch/ppc/kernel/head_booke.h
+++ b/arch/ppc/kernel/head_booke.h
@@ -49,6 +49,7 @@
49 * 49 *
50 * On 40x critical is the only additional level 50 * On 40x critical is the only additional level
51 * On 44x/e500 we have critical and machine check 51 * On 44x/e500 we have critical and machine check
52 * On e200 we have critical and debug (machine check occurs via critical)
52 * 53 *
53 * Additionally we reserve a SPRG for each priority level so we can free up a 54 * Additionally we reserve a SPRG for each priority level so we can free up a
54 * GPR to use as the base for indirect access to the exception stacks. This 55 * GPR to use as the base for indirect access to the exception stacks. This
@@ -60,53 +61,47 @@
60 61
61/* CRIT_SPRG only used in critical exception handling */ 62/* CRIT_SPRG only used in critical exception handling */
62#define CRIT_SPRG SPRN_SPRG2 63#define CRIT_SPRG SPRN_SPRG2
63/* MCHECK_SPRG only used in critical exception handling */ 64/* MCHECK_SPRG only used in machine check exception handling */
64#define MCHECK_SPRG SPRN_SPRG6W 65#define MCHECK_SPRG SPRN_SPRG6W
65 66
66#define MCHECK_STACK_TOP (exception_stack_top - 4096) 67#define MCHECK_STACK_TOP (exception_stack_top - 4096)
67#define CRIT_STACK_TOP (exception_stack_top) 68#define CRIT_STACK_TOP (exception_stack_top)
68 69
70/* only on e200 for now */
71#define DEBUG_STACK_TOP (exception_stack_top - 4096)
72#define DEBUG_SPRG SPRN_SPRG6W
73
69#ifdef CONFIG_SMP 74#ifdef CONFIG_SMP
70#define BOOKE_LOAD_CRIT_STACK \ 75#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
71 mfspr r8,SPRN_PIR; \ 76 mfspr r8,SPRN_PIR; \
72 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \ 77 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
73 neg r8,r8; \ 78 neg r8,r8; \
74 addis r8,r8,CRIT_STACK_TOP@ha; \ 79 addis r8,r8,level##_STACK_TOP@ha; \
75 addi r8,r8,CRIT_STACK_TOP@l 80 addi r8,r8,level##_STACK_TOP@l
76#define BOOKE_LOAD_MCHECK_STACK \
77 mfspr r8,SPRN_PIR; \
78 mulli r8,r8,BOOKE_EXCEPTION_STACK_SIZE; \
79 neg r8,r8; \
80 addis r8,r8,MCHECK_STACK_TOP@ha; \
81 addi r8,r8,MCHECK_STACK_TOP@l
82#else 81#else
83#define BOOKE_LOAD_CRIT_STACK \ 82#define BOOKE_LOAD_EXC_LEVEL_STACK(level) \
84 lis r8,CRIT_STACK_TOP@h; \ 83 lis r8,level##_STACK_TOP@h; \
85 ori r8,r8,CRIT_STACK_TOP@l 84 ori r8,r8,level##_STACK_TOP@l
86#define BOOKE_LOAD_MCHECK_STACK \
87 lis r8,MCHECK_STACK_TOP@h; \
88 ori r8,r8,MCHECK_STACK_TOP@l
89#endif 85#endif
90 86
91/* 87/*
92 * Exception prolog for critical exceptions. This is a little different 88 * Exception prolog for critical/machine check exceptions. This is a
93 * from the normal exception prolog above since a critical exception 89 * little different from the normal exception prolog above since a
94 * can potentially occur at any point during normal exception processing. 90 * critical/machine check exception can potentially occur at any point
95 * Thus we cannot use the same SPRG registers as the normal prolog above. 91 * during normal exception processing. Thus we cannot use the same SPRG
96 * Instead we use a portion of the critical exception stack at low physical 92 * registers as the normal prolog above. Instead we use a portion of the
97 * addresses. 93 * critical/machine check exception stack at low physical addresses.
98 */ 94 */
99 95#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
100#define CRITICAL_EXCEPTION_PROLOG \ 96 mtspr exc_level##_SPRG,r8; \
101 mtspr CRIT_SPRG,r8; \ 97 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
102 BOOKE_LOAD_CRIT_STACK; /* r8 points to the crit stack */ \
103 stw r10,GPR10-INT_FRAME_SIZE(r8); \ 98 stw r10,GPR10-INT_FRAME_SIZE(r8); \
104 stw r11,GPR11-INT_FRAME_SIZE(r8); \ 99 stw r11,GPR11-INT_FRAME_SIZE(r8); \
105 mfcr r10; /* save CR in r10 for now */\ 100 mfcr r10; /* save CR in r10 for now */\
106 mfspr r11,SPRN_CSRR1; /* check whether user or kernel */\ 101 mfspr r11,exc_level_srr1; /* check whether user or kernel */\
107 andi. r11,r11,MSR_PR; \ 102 andi. r11,r11,MSR_PR; \
108 mr r11,r8; \ 103 mr r11,r8; \
109 mfspr r8,CRIT_SPRG; \ 104 mfspr r8,exc_level##_SPRG; \
110 beq 1f; \ 105 beq 1f; \
111 /* COMING FROM USER MODE */ \ 106 /* COMING FROM USER MODE */ \
112 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\ 107 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
@@ -122,9 +117,9 @@
122 stw r12,_DEAR(r11); /* since they may have had stuff */\ 117 stw r12,_DEAR(r11); /* since they may have had stuff */\
123 mfspr r9,SPRN_ESR; /* in them at the point where the */\ 118 mfspr r9,SPRN_ESR; /* in them at the point where the */\
124 stw r9,_ESR(r11); /* exception was taken */\ 119 stw r9,_ESR(r11); /* exception was taken */\
125 mfspr r12,SPRN_CSRR0; \ 120 mfspr r12,exc_level_srr0; \
126 stw r1,GPR1(r11); \ 121 stw r1,GPR1(r11); \
127 mfspr r9,SPRN_CSRR1; \ 122 mfspr r9,exc_level_srr1; \
128 stw r1,0(r11); \ 123 stw r1,0(r11); \
129 mr r1,r11; \ 124 mr r1,r11; \
130 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ 125 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
@@ -132,45 +127,12 @@
132 SAVE_4GPRS(3, r11); \ 127 SAVE_4GPRS(3, r11); \
133 SAVE_2GPRS(7, r11) 128 SAVE_2GPRS(7, r11)
134 129
135/* 130#define CRITICAL_EXCEPTION_PROLOG \
136 * Exception prolog for machine check exceptions. This is similar to 131 EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
137 * the critical exception prolog, except that machine check exceptions 132#define DEBUG_EXCEPTION_PROLOG \
138 * have their stack. 133 EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1)
139 */ 134#define MCHECK_EXCEPTION_PROLOG \
140#define MCHECK_EXCEPTION_PROLOG \ 135 EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1)
141 mtspr MCHECK_SPRG,r8; \
142 BOOKE_LOAD_MCHECK_STACK; /* r8 points to the mcheck stack */\
143 stw r10,GPR10-INT_FRAME_SIZE(r8); \
144 stw r11,GPR11-INT_FRAME_SIZE(r8); \
145 mfcr r10; /* save CR in r10 for now */\
146 mfspr r11,SPRN_MCSRR1; /* check whether user or kernel */\
147 andi. r11,r11,MSR_PR; \
148 mr r11,r8; \
149 mfspr r8,MCHECK_SPRG; \
150 beq 1f; \
151 /* COMING FROM USER MODE */ \
152 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\
153 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
154 addi r11,r11,THREAD_SIZE; \
1551: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\
156 stw r10,_CCR(r11); /* save various registers */\
157 stw r12,GPR12(r11); \
158 stw r9,GPR9(r11); \
159 mflr r10; \
160 stw r10,_LINK(r11); \
161 mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\
162 stw r12,_DEAR(r11); /* since they may have had stuff */\
163 mfspr r9,SPRN_ESR; /* in them at the point where the */\
164 stw r9,_ESR(r11); /* exception was taken */\
165 mfspr r12,SPRN_MCSRR0; \
166 stw r1,GPR1(r11); \
167 mfspr r9,SPRN_MCSRR1; \
168 stw r1,0(r11); \
169 mr r1,r11; \
170 rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\
171 stw r0,GPR0(r11); \
172 SAVE_4GPRS(3, r11); \
173 SAVE_2GPRS(7, r11)
174 136
175/* 137/*
176 * Exception vectors. 138 * Exception vectors.
@@ -237,7 +199,6 @@ label:
237 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \ 199 EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \
238 ret_from_except) 200 ret_from_except)
239 201
240
241/* Check for a single step debug exception while in an exception 202/* Check for a single step debug exception while in an exception
242 * handler before state has been saved. This is to catch the case 203 * handler before state has been saved. This is to catch the case
243 * where an instruction that we are trying to single step causes 204 * where an instruction that we are trying to single step causes
@@ -251,6 +212,60 @@ label:
251 * save (and later restore) the MSR via SPRN_CSRR1, which will still have 212 * save (and later restore) the MSR via SPRN_CSRR1, which will still have
252 * the MSR_DE bit set. 213 * the MSR_DE bit set.
253 */ 214 */
215#ifdef CONFIG_E200
216#define DEBUG_EXCEPTION \
217 START_EXCEPTION(Debug); \
218 DEBUG_EXCEPTION_PROLOG; \
219 \
220 /* \
221 * If there is a single step or branch-taken exception in an \
222 * exception entry sequence, it was probably meant to apply to \
223 * the code where the exception occurred (since exception entry \
224 * doesn't turn off DE automatically). We simulate the effect \
225 * of turning off DE on entry to an exception handler by turning \
226 * off DE in the CSRR1 value and clearing the debug status. \
227 */ \
228 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
229 andis. r10,r10,DBSR_IC@h; \
230 beq+ 2f; \
231 \
232 lis r10,KERNELBASE@h; /* check if exception in vectors */ \
233 ori r10,r10,KERNELBASE@l; \
234 cmplw r12,r10; \
235 blt+ 2f; /* addr below exception vectors */ \
236 \
237 lis r10,Debug@h; \
238 ori r10,r10,Debug@l; \
239 cmplw r12,r10; \
240 bgt+ 2f; /* addr above exception vectors */ \
241 \
242 /* here it looks like we got an inappropriate debug exception. */ \
2431: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CDRR1 value */ \
244 lis r10,DBSR_IC@h; /* clear the IC event */ \
245 mtspr SPRN_DBSR,r10; \
246 /* restore state and get out */ \
247 lwz r10,_CCR(r11); \
248 lwz r0,GPR0(r11); \
249 lwz r1,GPR1(r11); \
250 mtcrf 0x80,r10; \
251 mtspr SPRN_DSRR0,r12; \
252 mtspr SPRN_DSRR1,r9; \
253 lwz r9,GPR9(r11); \
254 lwz r12,GPR12(r11); \
255 mtspr DEBUG_SPRG,r8; \
256 BOOKE_LOAD_EXC_LEVEL_STACK(DEBUG); /* r8 points to the debug stack */ \
257 lwz r10,GPR10-INT_FRAME_SIZE(r8); \
258 lwz r11,GPR11-INT_FRAME_SIZE(r8); \
259 mfspr r8,DEBUG_SPRG; \
260 \
261 RFDI; \
262 b .; \
263 \
264 /* continue normal handling for a critical exception... */ \
2652: mfspr r4,SPRN_DBSR; \
266 addi r3,r1,STACK_FRAME_OVERHEAD; \
267 EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc)
268#else
254#define DEBUG_EXCEPTION \ 269#define DEBUG_EXCEPTION \
255 START_EXCEPTION(Debug); \ 270 START_EXCEPTION(Debug); \
256 CRITICAL_EXCEPTION_PROLOG; \ 271 CRITICAL_EXCEPTION_PROLOG; \
@@ -291,7 +306,7 @@ label:
291 lwz r9,GPR9(r11); \ 306 lwz r9,GPR9(r11); \
292 lwz r12,GPR12(r11); \ 307 lwz r12,GPR12(r11); \
293 mtspr CRIT_SPRG,r8; \ 308 mtspr CRIT_SPRG,r8; \
294 BOOKE_LOAD_CRIT_STACK; /* r8 points to the crit stack */ \ 309 BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
295 lwz r10,GPR10-INT_FRAME_SIZE(r8); \ 310 lwz r10,GPR10-INT_FRAME_SIZE(r8); \
296 lwz r11,GPR11-INT_FRAME_SIZE(r8); \ 311 lwz r11,GPR11-INT_FRAME_SIZE(r8); \
297 mfspr r8,CRIT_SPRG; \ 312 mfspr r8,CRIT_SPRG; \
@@ -303,6 +318,7 @@ label:
3032: mfspr r4,SPRN_DBSR; \ 3182: mfspr r4,SPRN_DBSR; \
304 addi r3,r1,STACK_FRAME_OVERHEAD; \ 319 addi r3,r1,STACK_FRAME_OVERHEAD; \
305 EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) 320 EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
321#endif
306 322
307#define INSTRUCTION_STORAGE_EXCEPTION \ 323#define INSTRUCTION_STORAGE_EXCEPTION \
308 START_EXCEPTION(InstructionStorage) \ 324 START_EXCEPTION(InstructionStorage) \
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S
index f22ddce361..eb804b7a3c 100644
--- a/arch/ppc/kernel/head_fsl_booke.S
+++ b/arch/ppc/kernel/head_fsl_booke.S
@@ -102,6 +102,7 @@ invstr: mflr r6 /* Make it accessible */
102 or r7,r7,r4 102 or r7,r7,r4
103 mtspr SPRN_MAS6,r7 103 mtspr SPRN_MAS6,r7
104 tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ 104 tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */
105#ifndef CONFIG_E200
105 mfspr r7,SPRN_MAS1 106 mfspr r7,SPRN_MAS1
106 andis. r7,r7,MAS1_VALID@h 107 andis. r7,r7,MAS1_VALID@h
107 bne match_TLB 108 bne match_TLB
@@ -118,6 +119,7 @@ invstr: mflr r6 /* Make it accessible */
118 or r7,r7,r4 119 or r7,r7,r4
119 mtspr SPRN_MAS6,r7 120 mtspr SPRN_MAS6,r7
120 tlbsx 0,r6 /* Fall through, we had to match */ 121 tlbsx 0,r6 /* Fall through, we had to match */
122#endif
121match_TLB: 123match_TLB:
122 mfspr r7,SPRN_MAS0 124 mfspr r7,SPRN_MAS0
123 rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ 125 rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */
@@ -196,8 +198,10 @@ skpinv: addi r6,r6,1 /* Increment */
196/* 4. Clear out PIDs & Search info */ 198/* 4. Clear out PIDs & Search info */
197 li r6,0 199 li r6,0
198 mtspr SPRN_PID0,r6 200 mtspr SPRN_PID0,r6
201#ifndef CONFIG_E200
199 mtspr SPRN_PID1,r6 202 mtspr SPRN_PID1,r6
200 mtspr SPRN_PID2,r6 203 mtspr SPRN_PID2,r6
204#endif
201 mtspr SPRN_MAS6,r6 205 mtspr SPRN_MAS6,r6
202 206
203/* 5. Invalidate mapping we started in */ 207/* 5. Invalidate mapping we started in */
@@ -232,7 +236,8 @@ skpinv: addi r6,r6,1 /* Increment */
232 tlbwe 236 tlbwe
233 237
234/* 7. Jump to KERNELBASE mapping */ 238/* 7. Jump to KERNELBASE mapping */
235 li r7,0 239 lis r7,MSR_KERNEL@h
240 ori r7,r7,MSR_KERNEL@l
236 bl 1f /* Find our address */ 241 bl 1f /* Find our address */
2371: mflr r9 2421: mflr r9
238 rlwimi r6,r9,0,20,31 243 rlwimi r6,r9,0,20,31
@@ -276,7 +281,9 @@ skpinv: addi r6,r6,1 /* Increment */
276 SET_IVOR(32, SPEUnavailable); 281 SET_IVOR(32, SPEUnavailable);
277 SET_IVOR(33, SPEFloatingPointData); 282 SET_IVOR(33, SPEFloatingPointData);
278 SET_IVOR(34, SPEFloatingPointRound); 283 SET_IVOR(34, SPEFloatingPointRound);
284#ifndef CONFIG_E200
279 SET_IVOR(35, PerformanceMonitor); 285 SET_IVOR(35, PerformanceMonitor);
286#endif
280 287
281 /* Establish the interrupt vector base */ 288 /* Establish the interrupt vector base */
282 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 289 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
@@ -284,6 +291,9 @@ skpinv: addi r6,r6,1 /* Increment */
284 291
285 /* Setup the defaults for TLB entries */ 292 /* Setup the defaults for TLB entries */
286 li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l 293 li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l
294#ifdef CONFIG_E200
295 oris r2,r2,MAS4_TLBSELD(1)@h
296#endif
287 mtspr SPRN_MAS4, r2 297 mtspr SPRN_MAS4, r2
288 298
289#if 0 299#if 0
@@ -292,6 +302,24 @@ skpinv: addi r6,r6,1 /* Increment */
292 oris r2,r2,HID0_DOZE@h 302 oris r2,r2,HID0_DOZE@h
293 mtspr SPRN_HID0, r2 303 mtspr SPRN_HID0, r2
294#endif 304#endif
305#ifdef CONFIG_E200
306 /* enable dedicated debug exception handling resources (Debug APU) */
307 mfspr r2,SPRN_HID0
308 ori r2,r2,HID0_DAPUEN@l
309 mtspr SPRN_HID0,r2
310#endif
311
312#if !defined(CONFIG_BDI_SWITCH)
313 /*
314 * The Abatron BDI JTAG debugger does not tolerate others
315 * mucking with the debug registers.
316 */
317 lis r2,DBCR0_IDM@h
318 mtspr SPRN_DBCR0,r2
319 /* clear any residual debug events */
320 li r2,-1
321 mtspr SPRN_DBSR,r2
322#endif
295 323
296 /* 324 /*
297 * This is where the main kernel code starts. 325 * This is where the main kernel code starts.
@@ -401,7 +429,12 @@ interrupt_base:
401 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) 429 CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException)
402 430
403 /* Machine Check Interrupt */ 431 /* Machine Check Interrupt */
432#ifdef CONFIG_E200
433 /* no RFMCI, MCSRRs on E200 */
434 CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException)
435#else
404 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) 436 MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException)
437#endif
405 438
406 /* Data Storage Interrupt */ 439 /* Data Storage Interrupt */
407 START_EXCEPTION(DataStorage) 440 START_EXCEPTION(DataStorage)
@@ -507,8 +540,13 @@ interrupt_base:
507#ifdef CONFIG_PPC_FPU 540#ifdef CONFIG_PPC_FPU
508 FP_UNAVAILABLE_EXCEPTION 541 FP_UNAVAILABLE_EXCEPTION
509#else 542#else
543#ifdef CONFIG_E200
544 /* E200 treats 'normal' floating point instructions as FP Unavail exception */
545 EXCEPTION(0x0800, FloatingPointUnavailable, ProgramCheckException, EXC_XFER_EE)
546#else
510 EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) 547 EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE)
511#endif 548#endif
549#endif
512 550
513 /* System Call Interrupt */ 551 /* System Call Interrupt */
514 START_EXCEPTION(SystemCall) 552 START_EXCEPTION(SystemCall)
@@ -678,6 +716,7 @@ interrupt_base:
678/* 716/*
679 * Local functions 717 * Local functions
680 */ 718 */
719
681 /* 720 /*
682 * Data TLB exceptions will bail out to this point 721 * Data TLB exceptions will bail out to this point
683 * if they can't resolve the lightweight TLB fault. 722 * if they can't resolve the lightweight TLB fault.
@@ -748,6 +787,31 @@ END_FTR_SECTION_IFSET(CPU_FTR_BIG_PHYS)
7482: rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */ 7872: rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */
749 mtspr SPRN_MAS3, r11 788 mtspr SPRN_MAS3, r11
750#endif 789#endif
790#ifdef CONFIG_E200
791 /* Round robin TLB1 entries assignment */
792 mfspr r12, SPRN_MAS0
793
794 /* Extract TLB1CFG(NENTRY) */
795 mfspr r11, SPRN_TLB1CFG
796 andi. r11, r11, 0xfff
797
798 /* Extract MAS0(NV) */
799 andi. r13, r12, 0xfff
800 addi r13, r13, 1
801 cmpw 0, r13, r11
802 addi r12, r12, 1
803
804 /* check if we need to wrap */
805 blt 7f
806
807 /* wrap back to first free tlbcam entry */
808 lis r13, tlbcam_index@ha
809 lwz r13, tlbcam_index@l(r13)
810 rlwimi r12, r13, 0, 20, 31
8117:
812 mtspr SPRN_MAS0,r12
813#endif /* CONFIG_E200 */
814
751 tlbwe 815 tlbwe
752 816
753 /* Done...restore registers and get out of here. */ 817 /* Done...restore registers and get out of here. */
diff --git a/arch/ppc/kernel/machine_kexec.c b/arch/ppc/kernel/machine_kexec.c
new file mode 100644
index 0000000000..84d65a8719
--- /dev/null
+++ b/arch/ppc/kernel/machine_kexec.c
@@ -0,0 +1,118 @@
1/*
2 * machine_kexec.c - handle transition of Linux booting another kernel
3 * Copyright (C) 2002-2003 Eric Biederman <ebiederm@xmission.com>
4 *
5 * GameCube/ppc32 port Copyright (C) 2004 Albert Herranz
6 *
7 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details.
9 */
10
11#include <linux/mm.h>
12#include <linux/kexec.h>
13#include <linux/delay.h>
14#include <linux/reboot.h>
15#include <asm/pgtable.h>
16#include <asm/pgalloc.h>
17#include <asm/mmu_context.h>
18#include <asm/io.h>
19#include <asm/hw_irq.h>
20#include <asm/cacheflush.h>
21#include <asm/machdep.h>
22
23typedef NORET_TYPE void (*relocate_new_kernel_t)(
24 unsigned long indirection_page,
25 unsigned long reboot_code_buffer,
26 unsigned long start_address) ATTRIB_NORET;
27
28const extern unsigned char relocate_new_kernel[];
29const extern unsigned int relocate_new_kernel_size;
30
31void machine_shutdown(void)
32{
33 if (ppc_md.machine_shutdown)
34 ppc_md.machine_shutdown();
35}
36
37void machine_crash_shutdown(struct pt_regs *regs)
38{
39 if (ppc_md.machine_crash_shutdown)
40 ppc_md.machine_crash_shutdown();
41}
42
43/*
44 * Do what every setup is needed on image and the
45 * reboot code buffer to allow us to avoid allocations
46 * later.
47 */
48int machine_kexec_prepare(struct kimage *image)
49{
50 if (ppc_md.machine_kexec_prepare)
51 return ppc_md.machine_kexec_prepare(image);
52 /*
53 * Fail if platform doesn't provide its own machine_kexec_prepare
54 * implementation.
55 */
56 return -ENOSYS;
57}
58
59void machine_kexec_cleanup(struct kimage *image)
60{
61 if (ppc_md.machine_kexec_cleanup)
62 ppc_md.machine_kexec_cleanup(image);
63}
64
65/*
66 * Do not allocate memory (or fail in any way) in machine_kexec().
67 * We are past the point of no return, committed to rebooting now.
68 */
69NORET_TYPE void machine_kexec(struct kimage *image)
70{
71 if (ppc_md.machine_kexec)
72 ppc_md.machine_kexec(image);
73 else {
74 /*
75 * Fall back to normal restart if platform doesn't provide
76 * its own kexec function, and user insist to kexec...
77 */
78 machine_restart(NULL);
79 }
80 for(;;);
81}
82
83/*
84 * This is a generic machine_kexec function suitable at least for
85 * non-OpenFirmware embedded platforms.
86 * It merely copies the image relocation code to the control page and
87 * jumps to it.
88 * A platform specific function may just call this one.
89 */
90void machine_kexec_simple(struct kimage *image)
91{
92 unsigned long page_list;
93 unsigned long reboot_code_buffer, reboot_code_buffer_phys;
94 relocate_new_kernel_t rnk;
95
96 /* Interrupts aren't acceptable while we reboot */
97 local_irq_disable();
98
99 page_list = image->head;
100
101 /* we need both effective and real address here */
102 reboot_code_buffer =
103 (unsigned long)page_address(image->control_code_page);
104 reboot_code_buffer_phys = virt_to_phys((void *)reboot_code_buffer);
105
106 /* copy our kernel relocation code to the control code page */
107 memcpy((void *)reboot_code_buffer, relocate_new_kernel,
108 relocate_new_kernel_size);
109
110 flush_icache_range(reboot_code_buffer,
111 reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
112 printk(KERN_INFO "Bye!\n");
113
114 /* now call it */
115 rnk = (relocate_new_kernel_t) reboot_code_buffer;
116 (*rnk)(page_list, reboot_code_buffer_phys, image->start);
117}
118
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index e4f1615ec1..b6a63a49a2 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -593,6 +593,14 @@ _GLOBAL(flush_instruction_cache)
593 iccci 0,r3 593 iccci 0,r3
594#endif 594#endif
595#elif CONFIG_FSL_BOOKE 595#elif CONFIG_FSL_BOOKE
596BEGIN_FTR_SECTION
597 mfspr r3,SPRN_L1CSR0
598 ori r3,r3,L1CSR0_CFI|L1CSR0_CLFC
599 /* msync; isync recommended here */
600 mtspr SPRN_L1CSR0,r3
601 isync
602 blr
603END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
596 mfspr r3,SPRN_L1CSR1 604 mfspr r3,SPRN_L1CSR1
597 ori r3,r3,L1CSR1_ICFI|L1CSR1_ICLFR 605 ori r3,r3,L1CSR1_ICFI|L1CSR1_ICLFR
598 mtspr SPRN_L1CSR1,r3 606 mtspr SPRN_L1CSR1,r3
@@ -619,7 +627,7 @@ _GLOBAL(flush_instruction_cache)
619_GLOBAL(flush_icache_range) 627_GLOBAL(flush_icache_range)
620BEGIN_FTR_SECTION 628BEGIN_FTR_SECTION
621 blr /* for 601, do nothing */ 629 blr /* for 601, do nothing */
622END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 630END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
623 li r5,L1_CACHE_LINE_SIZE-1 631 li r5,L1_CACHE_LINE_SIZE-1
624 andc r3,r3,r5 632 andc r3,r3,r5
625 subf r4,r3,r4 633 subf r4,r3,r4
@@ -736,7 +744,7 @@ _GLOBAL(flush_dcache_all)
736_GLOBAL(__flush_dcache_icache) 744_GLOBAL(__flush_dcache_icache)
737BEGIN_FTR_SECTION 745BEGIN_FTR_SECTION
738 blr /* for 601, do nothing */ 746 blr /* for 601, do nothing */
739END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 747END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
740 rlwinm r3,r3,0,0,19 /* Get page base address */ 748 rlwinm r3,r3,0,0,19 /* Get page base address */
741 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */ 749 li r4,4096/L1_CACHE_LINE_SIZE /* Number of lines in a page */
742 mtctr r4 750 mtctr r4
@@ -764,7 +772,7 @@ END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE)
764_GLOBAL(__flush_dcache_icache_phys) 772_GLOBAL(__flush_dcache_icache_phys)
765BEGIN_FTR_SECTION 773BEGIN_FTR_SECTION
766 blr /* for 601, do nothing */ 774 blr /* for 601, do nothing */
767END_FTR_SECTION_IFSET(PPC_FEATURE_UNIFIED_CACHE) 775END_FTR_SECTION_IFCLR(CPU_FTR_SPLIT_ID_CACHE)
768 mfmsr r10 776 mfmsr r10
769 rlwinm r0,r10,0,28,26 /* clear DR */ 777 rlwinm r0,r10,0,28,26 /* clear DR */
770 mtmsr r0 778 mtmsr r0
@@ -1436,7 +1444,7 @@ _GLOBAL(sys_call_table)
1436 .long sys_mq_timedreceive /* 265 */ 1444 .long sys_mq_timedreceive /* 265 */
1437 .long sys_mq_notify 1445 .long sys_mq_notify
1438 .long sys_mq_getsetattr 1446 .long sys_mq_getsetattr
1439 .long sys_ni_syscall /* 268 reserved for sys_kexec_load */ 1447 .long sys_kexec_load
1440 .long sys_add_key 1448 .long sys_add_key
1441 .long sys_request_key /* 270 */ 1449 .long sys_request_key /* 270 */
1442 .long sys_keyctl 1450 .long sys_keyctl
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 47a1530682..6d7b92d724 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -1003,7 +1003,7 @@ pci_create_OF_bus_map(void)
1003 } 1003 }
1004} 1004}
1005 1005
1006static ssize_t pci_show_devspec(struct device *dev, char *buf) 1006static ssize_t pci_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
1007{ 1007{
1008 struct pci_dev *pdev; 1008 struct pci_dev *pdev;
1009 struct device_node *np; 1009 struct device_node *np;
diff --git a/arch/ppc/kernel/perfmon.c b/arch/ppc/kernel/perfmon.c
index 918f6b252e..fa1dad96b8 100644
--- a/arch/ppc/kernel/perfmon.c
+++ b/arch/ppc/kernel/perfmon.c
@@ -36,7 +36,7 @@
36/* A lock to regulate grabbing the interrupt */ 36/* A lock to regulate grabbing the interrupt */
37DEFINE_SPINLOCK(perfmon_lock); 37DEFINE_SPINLOCK(perfmon_lock);
38 38
39#ifdef CONFIG_FSL_BOOKE 39#if defined (CONFIG_FSL_BOOKE) && !defined (CONFIG_E200)
40static void dummy_perf(struct pt_regs *regs) 40static void dummy_perf(struct pt_regs *regs)
41{ 41{
42 unsigned int pmgc0 = mfpmr(PMRN_PMGC0); 42 unsigned int pmgc0 = mfpmr(PMRN_PMGC0);
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 2ccb58fe4f..d59ad07de8 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -55,7 +55,6 @@
55#define EXPORT_SYMTAB_STROPS 55#define EXPORT_SYMTAB_STROPS
56 56
57extern void transfer_to_handler(void); 57extern void transfer_to_handler(void);
58extern void do_syscall_trace(void);
59extern void do_IRQ(struct pt_regs *regs); 58extern void do_IRQ(struct pt_regs *regs);
60extern void MachineCheckException(struct pt_regs *regs); 59extern void MachineCheckException(struct pt_regs *regs);
61extern void AlignmentException(struct pt_regs *regs); 60extern void AlignmentException(struct pt_regs *regs);
@@ -74,7 +73,6 @@ extern unsigned long mm_ptov (unsigned long paddr);
74EXPORT_SYMBOL(clear_pages); 73EXPORT_SYMBOL(clear_pages);
75EXPORT_SYMBOL(clear_user_page); 74EXPORT_SYMBOL(clear_user_page);
76EXPORT_SYMBOL(do_signal); 75EXPORT_SYMBOL(do_signal);
77EXPORT_SYMBOL(do_syscall_trace);
78EXPORT_SYMBOL(transfer_to_handler); 76EXPORT_SYMBOL(transfer_to_handler);
79EXPORT_SYMBOL(do_IRQ); 77EXPORT_SYMBOL(do_IRQ);
80EXPORT_SYMBOL(MachineCheckException); 78EXPORT_SYMBOL(MachineCheckException);
diff --git a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c
index 59d59a8dc2..e7aee4108d 100644
--- a/arch/ppc/kernel/ptrace.c
+++ b/arch/ppc/kernel/ptrace.c
@@ -27,6 +27,9 @@
27#include <linux/user.h> 27#include <linux/user.h>
28#include <linux/security.h> 28#include <linux/security.h>
29#include <linux/signal.h> 29#include <linux/signal.h>
30#include <linux/seccomp.h>
31#include <linux/audit.h>
32#include <linux/module.h>
30 33
31#include <asm/uaccess.h> 34#include <asm/uaccess.h>
32#include <asm/page.h> 35#include <asm/page.h>
@@ -455,11 +458,10 @@ out:
455 return ret; 458 return ret;
456} 459}
457 460
458void do_syscall_trace(void) 461static void do_syscall_trace(void)
459{ 462{
460 if (!test_thread_flag(TIF_SYSCALL_TRACE) 463 /* the 0x80 provides a way for the tracing parent to distinguish
461 || !(current->ptrace & PT_PTRACED)) 464 between a syscall stop and SIGTRAP delivery */
462 return;
463 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 465 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
464 ? 0x80 : 0)); 466 ? 0x80 : 0));
465 467
@@ -473,3 +475,33 @@ void do_syscall_trace(void)
473 current->exit_code = 0; 475 current->exit_code = 0;
474 } 476 }
475} 477}
478
479void do_syscall_trace_enter(struct pt_regs *regs)
480{
481 if (test_thread_flag(TIF_SYSCALL_TRACE)
482 && (current->ptrace & PT_PTRACED))
483 do_syscall_trace();
484
485 if (unlikely(current->audit_context))
486 audit_syscall_entry(current, AUDIT_ARCH_PPC,
487 regs->gpr[0],
488 regs->gpr[3], regs->gpr[4],
489 regs->gpr[5], regs->gpr[6]);
490}
491
492void do_syscall_trace_leave(struct pt_regs *regs)
493{
494 secure_computing(regs->gpr[0]);
495
496 if (unlikely(current->audit_context))
497 audit_syscall_exit(current,
498 (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
499 regs->result);
500
501 if ((test_thread_flag(TIF_SYSCALL_TRACE))
502 && (current->ptrace & PT_PTRACED))
503 do_syscall_trace();
504}
505
506EXPORT_SYMBOL(do_syscall_trace_enter);
507EXPORT_SYMBOL(do_syscall_trace_leave);
diff --git a/arch/ppc/kernel/relocate_kernel.S b/arch/ppc/kernel/relocate_kernel.S
new file mode 100644
index 0000000000..7ff69c4af9
--- /dev/null
+++ b/arch/ppc/kernel/relocate_kernel.S
@@ -0,0 +1,123 @@
1/*
2 * relocate_kernel.S - put the kernel image in place to boot
3 * Copyright (C) 2002-2003 Eric Biederman <ebiederm@xmission.com>
4 *
5 * GameCube/ppc32 port Copyright (C) 2004 Albert Herranz
6 *
7 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details.
9 */
10
11#include <asm/reg.h>
12#include <asm/ppc_asm.h>
13#include <asm/processor.h>
14
15#include <asm/kexec.h>
16
17#define PAGE_SIZE 4096 /* must be same value as in <asm/page.h> */
18
19 /*
20 * Must be relocatable PIC code callable as a C function.
21 */
22 .globl relocate_new_kernel
23relocate_new_kernel:
24 /* r3 = page_list */
25 /* r4 = reboot_code_buffer */
26 /* r5 = start_address */
27
28 li r0, 0
29
30 /*
31 * Set Machine Status Register to a known status,
32 * switch the MMU off and jump to 1: in a single step.
33 */
34
35 mr r8, r0
36 ori r8, r8, MSR_RI|MSR_ME
37 mtspr SRR1, r8
38 addi r8, r4, 1f - relocate_new_kernel
39 mtspr SRR0, r8
40 sync
41 rfi
42
431:
44 /* from this point address translation is turned off */
45 /* and interrupts are disabled */
46
47 /* set a new stack at the bottom of our page... */
48 /* (not really needed now) */
49 addi r1, r4, KEXEC_CONTROL_CODE_SIZE - 8 /* for LR Save+Back Chain */
50 stw r0, 0(r1)
51
52 /* Do the copies */
53 li r6, 0 /* checksum */
54 mr r0, r3
55 b 1f
56
570: /* top, read another word for the indirection page */
58 lwzu r0, 4(r3)
59
601:
61 /* is it a destination page? (r8) */
62 rlwinm. r7, r0, 0, 31, 31 /* IND_DESTINATION (1<<0) */
63 beq 2f
64
65 rlwinm r8, r0, 0, 0, 19 /* clear kexec flags, page align */
66 b 0b
67
682: /* is it an indirection page? (r3) */
69 rlwinm. r7, r0, 0, 30, 30 /* IND_INDIRECTION (1<<1) */
70 beq 2f
71
72 rlwinm r3, r0, 0, 0, 19 /* clear kexec flags, page align */
73 subi r3, r3, 4
74 b 0b
75
762: /* are we done? */
77 rlwinm. r7, r0, 0, 29, 29 /* IND_DONE (1<<2) */
78 beq 2f
79 b 3f
80
812: /* is it a source page? (r9) */
82 rlwinm. r7, r0, 0, 28, 28 /* IND_SOURCE (1<<3) */
83 beq 0b
84
85 rlwinm r9, r0, 0, 0, 19 /* clear kexec flags, page align */
86
87 li r7, PAGE_SIZE / 4
88 mtctr r7
89 subi r9, r9, 4
90 subi r8, r8, 4
919:
92 lwzu r0, 4(r9) /* do the copy */
93 xor r6, r6, r0
94 stwu r0, 4(r8)
95 dcbst 0, r8
96 sync
97 icbi 0, r8
98 bdnz 9b
99
100 addi r9, r9, 4
101 addi r8, r8, 4
102 b 0b
103
1043:
105
106 /* To be certain of avoiding problems with self-modifying code
107 * execute a serializing instruction here.
108 */
109 isync
110 sync
111
112 /* jump to the entry point, usually the setup routine */
113 mtlr r5
114 blrl
115
1161: b 1b
117
118relocate_new_kernel_end:
119
120 .globl relocate_new_kernel_size
121relocate_new_kernel_size:
122 .long relocate_new_kernel_end - relocate_new_kernel
123
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 5c20266e3b..c42f753269 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -41,7 +41,7 @@
41#include <asm/xmon.h> 41#include <asm/xmon.h>
42#include <asm/ocp.h> 42#include <asm/ocp.h>
43 43
44#if defined(CONFIG_85xx) || defined(CONFIG_83xx) 44#if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE)
45#include <asm/ppc_sys.h> 45#include <asm/ppc_sys.h>
46#endif 46#endif
47 47
@@ -61,8 +61,6 @@ extern void power4_idle(void);
61 61
62extern boot_infos_t *boot_infos; 62extern boot_infos_t *boot_infos;
63struct ide_machdep_calls ppc_ide_md; 63struct ide_machdep_calls ppc_ide_md;
64char *sysmap;
65unsigned long sysmap_size;
66 64
67/* Used with the BI_MEMSIZE bootinfo parameter to store the memory 65/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
68 size value reported by the boot loader. */ 66 size value reported by the boot loader. */
@@ -249,7 +247,7 @@ int show_cpuinfo(struct seq_file *m, void *v)
249 seq_printf(m, "bogomips\t: %lu.%02lu\n", 247 seq_printf(m, "bogomips\t: %lu.%02lu\n",
250 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100); 248 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100);
251 249
252#if defined(CONFIG_85xx) || defined(CONFIG_83xx) 250#if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE)
253 if (cur_ppc_sys_spec->ppc_sys_name) 251 if (cur_ppc_sys_spec->ppc_sys_name)
254 seq_printf(m, "chipset\t\t: %s\n", 252 seq_printf(m, "chipset\t\t: %s\n",
255 cur_ppc_sys_spec->ppc_sys_name); 253 cur_ppc_sys_spec->ppc_sys_name);
@@ -578,11 +576,6 @@ void parse_bootinfo(struct bi_record *rec)
578 case BI_CMD_LINE: 576 case BI_CMD_LINE:
579 strlcpy(cmd_line, (void *)data, sizeof(cmd_line)); 577 strlcpy(cmd_line, (void *)data, sizeof(cmd_line));
580 break; 578 break;
581 case BI_SYSMAP:
582 sysmap = (char *)((data[0] >= (KERNELBASE)) ? data[0] :
583 (data[0]+KERNELBASE));
584 sysmap_size = data[1];
585 break;
586#ifdef CONFIG_BLK_DEV_INITRD 579#ifdef CONFIG_BLK_DEV_INITRD
587 case BI_INITRD: 580 case BI_INITRD:
588 initrd_start = data[0] + KERNELBASE; 581 initrd_start = data[0] + KERNELBASE;
diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
index 7c8437da09..8aaeb6f4e7 100644
--- a/arch/ppc/kernel/signal.c
+++ b/arch/ppc/kernel/signal.c
@@ -705,8 +705,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
705 unsigned long frame, newsp; 705 unsigned long frame, newsp;
706 int signr, ret; 706 int signr, ret;
707 707
708 if (current->flags & PF_FREEZE) { 708 if (try_to_freeze()) {
709 refrigerator(PF_FREEZE);
710 signr = 0; 709 signr = 0;
711 if (!signal_pending(current)) 710 if (!signal_pending(current))
712 goto no_signal; 711 goto no_signal;
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index f8e7e324a1..9e6ae56966 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -81,8 +81,10 @@ void die(const char * str, struct pt_regs * fp, long err)
81 console_verbose(); 81 console_verbose();
82 spin_lock_irq(&die_lock); 82 spin_lock_irq(&die_lock);
83#ifdef CONFIG_PMAC_BACKLIGHT 83#ifdef CONFIG_PMAC_BACKLIGHT
84 set_backlight_enable(1); 84 if (_machine == _MACH_Pmac) {
85 set_backlight_level(BACKLIGHT_MAX); 85 set_backlight_enable(1);
86 set_backlight_level(BACKLIGHT_MAX);
87 }
86#endif 88#endif
87 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); 89 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
88#ifdef CONFIG_PREEMPT 90#ifdef CONFIG_PREEMPT
@@ -171,13 +173,13 @@ static inline int check_io_access(struct pt_regs *regs)
171/* On 4xx, the reason for the machine check or program exception 173/* On 4xx, the reason for the machine check or program exception
172 is in the ESR. */ 174 is in the ESR. */
173#define get_reason(regs) ((regs)->dsisr) 175#define get_reason(regs) ((regs)->dsisr)
174#ifndef CONFIG_E500 176#ifndef CONFIG_FSL_BOOKE
175#define get_mc_reason(regs) ((regs)->dsisr) 177#define get_mc_reason(regs) ((regs)->dsisr)
176#else 178#else
177#define get_mc_reason(regs) (mfspr(SPRN_MCSR)) 179#define get_mc_reason(regs) (mfspr(SPRN_MCSR))
178#endif 180#endif
179#define REASON_FP ESR_FP 181#define REASON_FP ESR_FP
180#define REASON_ILLEGAL ESR_PIL 182#define REASON_ILLEGAL (ESR_PIL | ESR_PUO)
181#define REASON_PRIVILEGED ESR_PPR 183#define REASON_PRIVILEGED ESR_PPR
182#define REASON_TRAP ESR_PTR 184#define REASON_TRAP ESR_PTR
183 185
@@ -300,7 +302,25 @@ void MachineCheckException(struct pt_regs *regs)
300 printk("Bus - Instruction Parity Error\n"); 302 printk("Bus - Instruction Parity Error\n");
301 if (reason & MCSR_BUS_RPERR) 303 if (reason & MCSR_BUS_RPERR)
302 printk("Bus - Read Parity Error\n"); 304 printk("Bus - Read Parity Error\n");
303#else /* !CONFIG_4xx && !CONFIG_E500 */ 305#elif defined (CONFIG_E200)
306 printk("Machine check in kernel mode.\n");
307 printk("Caused by (from MCSR=%lx): ", reason);
308
309 if (reason & MCSR_MCP)
310 printk("Machine Check Signal\n");
311 if (reason & MCSR_CP_PERR)
312 printk("Cache Push Parity Error\n");
313 if (reason & MCSR_CPERR)
314 printk("Cache Parity Error\n");
315 if (reason & MCSR_EXCP_ERR)
316 printk("ISI, ITLB, or Bus Error on first instruction fetch for an exception handler\n");
317 if (reason & MCSR_BUS_IRERR)
318 printk("Bus - Read Bus Error on instruction fetch\n");
319 if (reason & MCSR_BUS_DRERR)
320 printk("Bus - Read Bus Error on data load\n");
321 if (reason & MCSR_BUS_WRERR)
322 printk("Bus - Write Bus Error on buffered store or cache line push\n");
323#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
304 printk("Machine check in kernel mode.\n"); 324 printk("Machine check in kernel mode.\n");
305 printk("Caused by (from SRR1=%lx): ", reason); 325 printk("Caused by (from SRR1=%lx): ", reason);
306 switch (reason & 0x601F0000) { 326 switch (reason & 0x601F0000) {
@@ -408,12 +428,7 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
408 428
409 /* Early out if we are an invalid form of lswx */ 429 /* Early out if we are an invalid form of lswx */
410 if ((instword & INST_STRING_MASK) == INST_LSWX) 430 if ((instword & INST_STRING_MASK) == INST_LSWX)
411 if ((rA >= rT) || (NB_RB >= rT) || (rT == rA) || (rT == NB_RB)) 431 if ((rT == rA) || (rT == NB_RB))
412 return -EINVAL;
413
414 /* Early out if we are an invalid form of lswi */
415 if ((instword & INST_STRING_MASK) == INST_LSWI)
416 if ((rA >= rT) || (rT == rA))
417 return -EINVAL; 432 return -EINVAL;
418 433
419 EA = (rA == 0) ? 0 : regs->gpr[rA]; 434 EA = (rA == 0) ? 0 : regs->gpr[rA];
diff --git a/arch/ppc/lib/locks.c b/arch/ppc/lib/locks.c
index 694163d696..c450dc4b76 100644
--- a/arch/ppc/lib/locks.c
+++ b/arch/ppc/lib/locks.c
@@ -130,7 +130,7 @@ void _raw_read_lock(rwlock_t *rw)
130 while (!read_can_lock(rw)) { 130 while (!read_can_lock(rw)) {
131 if (--stuck == 0) { 131 if (--stuck == 0) {
132 printk("_read_lock(%p) CPU#%d lock %d\n", 132 printk("_read_lock(%p) CPU#%d lock %d\n",
133 rw, _smp_processor_id(), rw->lock); 133 rw, raw_smp_processor_id(), rw->lock);
134 stuck = INIT_STUCK; 134 stuck = INIT_STUCK;
135 } 135 }
136 } 136 }
@@ -158,7 +158,7 @@ void _raw_write_lock(rwlock_t *rw)
158 while (!write_can_lock(rw)) { 158 while (!write_can_lock(rw)) {
159 if (--stuck == 0) { 159 if (--stuck == 0) {
160 printk("write_lock(%p) CPU#%d lock %d)\n", 160 printk("write_lock(%p) CPU#%d lock %d)\n",
161 rw, _smp_processor_id(), rw->lock); 161 rw, raw_smp_processor_id(), rw->lock);
162 stuck = INIT_STUCK; 162 stuck = INIT_STUCK;
163 } 163 }
164 } 164 }
diff --git a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c
index 72f7c0d1c0..3d79ce281b 100644
--- a/arch/ppc/mm/44x_mmu.c
+++ b/arch/ppc/mm/44x_mmu.c
@@ -39,7 +39,6 @@
39#include <linux/vmalloc.h> 39#include <linux/vmalloc.h>
40#include <linux/init.h> 40#include <linux/init.h>
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/bootmem.h>
43#include <linux/highmem.h> 42#include <linux/highmem.h>
44 43
45#include <asm/pgalloc.h> 44#include <asm/pgalloc.h>
diff --git a/arch/ppc/mm/4xx_mmu.c b/arch/ppc/mm/4xx_mmu.c
index a7f6161403..b7bcbc232f 100644
--- a/arch/ppc/mm/4xx_mmu.c
+++ b/arch/ppc/mm/4xx_mmu.c
@@ -36,7 +36,6 @@
36#include <linux/vmalloc.h> 36#include <linux/vmalloc.h>
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/bootmem.h>
40#include <linux/highmem.h> 39#include <linux/highmem.h>
41 40
42#include <asm/pgalloc.h> 41#include <asm/pgalloc.h>
diff --git a/arch/ppc/mm/fsl_booke_mmu.c b/arch/ppc/mm/fsl_booke_mmu.c
index 36233bdcdf..af9ca0eb6d 100644
--- a/arch/ppc/mm/fsl_booke_mmu.c
+++ b/arch/ppc/mm/fsl_booke_mmu.c
@@ -41,7 +41,6 @@
41#include <linux/vmalloc.h> 41#include <linux/vmalloc.h>
42#include <linux/init.h> 42#include <linux/init.h>
43#include <linux/delay.h> 43#include <linux/delay.h>
44#include <linux/bootmem.h>
45#include <linux/highmem.h> 44#include <linux/highmem.h>
46 45
47#include <asm/pgalloc.h> 46#include <asm/pgalloc.h>
@@ -64,6 +63,8 @@ extern unsigned long total_lowmem;
64extern unsigned long __max_low_memory; 63extern unsigned long __max_low_memory;
65#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE 64#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
66 65
66#define NUM_TLBCAMS (16)
67
67struct tlbcam { 68struct tlbcam {
68 u32 MAS0; 69 u32 MAS0;
69 u32 MAS1; 70 u32 MAS1;
@@ -124,7 +125,7 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys,
124 flags |= _PAGE_COHERENT; 125 flags |= _PAGE_COHERENT;
125#endif 126#endif
126 127
127 TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index); 128 TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index) | MAS0_NV(index+1);
128 TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | MAS1_TID(pid); 129 TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | MAS1_TID(pid);
129 TLBCAM[index].MAS2 = virt & PAGE_MASK; 130 TLBCAM[index].MAS2 = virt & PAGE_MASK;
130 131
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 363c157e36..334ef4150d 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -96,9 +96,6 @@ extern struct task_struct *current_set[NR_CPUS];
96char *klimit = _end; 96char *klimit = _end;
97struct mem_pieces phys_avail; 97struct mem_pieces phys_avail;
98 98
99extern char *sysmap;
100extern unsigned long sysmap_size;
101
102/* 99/*
103 * this tells the system to map all of ram with the segregs 100 * this tells the system to map all of ram with the segregs
104 * (i.e. page tables) instead of the bats. 101 * (i.e. page tables) instead of the bats.
@@ -442,12 +439,6 @@ void __init mem_init(void)
442 if (agp_special_page) 439 if (agp_special_page)
443 SetPageReserved(virt_to_page(agp_special_page)); 440 SetPageReserved(virt_to_page(agp_special_page));
444#endif 441#endif
445 if ( sysmap )
446 for (addr = (unsigned long)sysmap;
447 addr < PAGE_ALIGN((unsigned long)sysmap+sysmap_size) ;
448 addr += PAGE_SIZE)
449 SetPageReserved(virt_to_page(addr));
450
451 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory; 442 for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
452 addr += PAGE_SIZE) { 443 addr += PAGE_SIZE) {
453 if (!PageReserved(virt_to_page(addr))) 444 if (!PageReserved(virt_to_page(addr)))
@@ -469,7 +460,6 @@ void __init mem_init(void)
469 struct page *page = mem_map + pfn; 460 struct page *page = mem_map + pfn;
470 461
471 ClearPageReserved(page); 462 ClearPageReserved(page);
472 set_bit(PG_highmem, &page->flags);
473 set_page_count(page, 1); 463 set_page_count(page, 1);
474 __free_page(page); 464 __free_page(page);
475 totalhigh_pages++; 465 totalhigh_pages++;
@@ -483,9 +473,7 @@ void __init mem_init(void)
483 codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10), 473 codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10),
484 initpages<< (PAGE_SHIFT-10), 474 initpages<< (PAGE_SHIFT-10),
485 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))); 475 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
486 if (sysmap) 476
487 printk("System.map loaded at 0x%08x for debugger, size: %ld bytes\n",
488 (unsigned int)sysmap, sysmap_size);
489#ifdef CONFIG_PPC_PMAC 477#ifdef CONFIG_PPC_PMAC
490 if (agp_special_page) 478 if (agp_special_page)
491 printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page); 479 printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page);
@@ -535,9 +523,6 @@ set_phys_avail(unsigned long total_memory)
535 if (rtas_data) 523 if (rtas_data)
536 mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1); 524 mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
537#endif 525#endif
538 /* remove the sysmap pages from the available memory */
539 if (sysmap)
540 mem_pieces_remove(&phys_avail, __pa(sysmap), sysmap_size, 1);
541#ifdef CONFIG_PPC_PMAC 526#ifdef CONFIG_PPC_PMAC
542 /* Because of some uninorth weirdness, we need a page of 527 /* Because of some uninorth weirdness, we need a page of
543 * memory as high as possible (it must be outside of the 528 * memory as high as possible (it must be outside of the
diff --git a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h
index ffcdb46997..540f3292b2 100644
--- a/arch/ppc/mm/mmu_decl.h
+++ b/arch/ppc/mm/mmu_decl.h
@@ -43,6 +43,8 @@ extern int mem_init_done;
43extern PTE *Hash, *Hash_end; 43extern PTE *Hash, *Hash_end;
44extern unsigned long Hash_size, Hash_mask; 44extern unsigned long Hash_size, Hash_mask;
45 45
46extern unsigned int num_tlbcam_entries;
47
46/* ...and now those things that may be slightly different between processor 48/* ...and now those things that may be slightly different between processor
47 * architectures. -- Dan 49 * architectures. -- Dan
48 */ 50 */
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 5d2f3f66ae..81a3d7446d 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -66,7 +66,6 @@ void setbat(int index, unsigned long virt, unsigned long phys,
66 66
67#ifdef HAVE_TLBCAM 67#ifdef HAVE_TLBCAM
68extern unsigned int tlbcam_index; 68extern unsigned int tlbcam_index;
69extern unsigned int num_tlbcam_entries;
70extern unsigned long v_mapped_by_tlbcam(unsigned long va); 69extern unsigned long v_mapped_by_tlbcam(unsigned long va);
71extern unsigned long p_mapped_by_tlbcam(unsigned long pa); 70extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
72#else /* !HAVE_TLBCAM */ 71#else /* !HAVE_TLBCAM */
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c
index b3b0f51979..ddd04d4c1e 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/ipic.h> 44#include <asm/ipic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -95,20 +94,24 @@ mpc834x_sys_setup_arch(void)
95 94
96 /* setup the board related information for the enet controllers */ 95 /* setup the board related information for the enet controllers */
97 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1); 96 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1);
98 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 97 if (pdata) {
99 pdata->interruptPHY = MPC83xx_IRQ_EXT1; 98 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
100 pdata->phyid = 0; 99 pdata->interruptPHY = MPC83xx_IRQ_EXT1;
101 /* fixup phy address */ 100 pdata->phyid = 0;
102 pdata->phy_reg_addr += binfo->bi_immr_base; 101 /* fixup phy address */
103 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 102 pdata->phy_reg_addr += binfo->bi_immr_base;
103 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
104 }
104 105
105 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2); 106 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2);
106 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 107 if (pdata) {
107 pdata->interruptPHY = MPC83xx_IRQ_EXT2; 108 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
108 pdata->phyid = 1; 109 pdata->interruptPHY = MPC83xx_IRQ_EXT2;
109 /* fixup phy address */ 110 pdata->phyid = 1;
110 pdata->phy_reg_addr += binfo->bi_immr_base; 111 /* fixup phy address */
111 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 112 pdata->phy_reg_addr += binfo->bi_immr_base;
113 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
114 }
112 115
113#ifdef CONFIG_BLK_DEV_INITRD 116#ifdef CONFIG_BLK_DEV_INITRD
114 if (initrd_start) 117 if (initrd_start)
@@ -127,7 +130,6 @@ mpc834x_sys_map_io(void)
127{ 130{
128 /* we steal the lowest ioremap addr for virt space */ 131 /* we steal the lowest ioremap addr for virt space */
129 io_block_mapping(VIRT_IMMRBAR, immrbar, 1024*1024, _PAGE_IO); 132 io_block_mapping(VIRT_IMMRBAR, immrbar, 1024*1024, _PAGE_IO);
130 io_block_mapping(BCSR_VIRT_ADDR, BCSR_PHYS_ADDR, BCSR_SIZE, _PAGE_IO);
131} 133}
132 134
133int 135int
@@ -187,6 +189,26 @@ mpc834x_sys_init_IRQ(void)
187 ipic_set_default_priority(); 189 ipic_set_default_priority();
188} 190}
189 191
192#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
193extern ulong ds1374_get_rtc_time(void);
194extern int ds1374_set_rtc_time(ulong);
195
196static int __init
197mpc834x_rtc_hookup(void)
198{
199 struct timespec tv;
200
201 ppc_md.get_rtc_time = ds1374_get_rtc_time;
202 ppc_md.set_rtc_time = ds1374_set_rtc_time;
203
204 tv.tv_nsec = 0;
205 tv.tv_sec = (ppc_md.get_rtc_time)();
206 do_settimeofday(&tv);
207
208 return 0;
209}
210late_initcall(mpc834x_rtc_hookup);
211#endif
190static __inline__ void 212static __inline__ void
191mpc834x_sys_set_bat(void) 213mpc834x_sys_set_bat(void)
192{ 214{
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
index f4d055ae19..a2f6e49d71 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -26,9 +26,14 @@
26#define VIRT_IMMRBAR ((uint)0xfe000000) 26#define VIRT_IMMRBAR ((uint)0xfe000000)
27 27
28#define BCSR_PHYS_ADDR ((uint)0xf8000000) 28#define BCSR_PHYS_ADDR ((uint)0xf8000000)
29#define BCSR_VIRT_ADDR ((uint)0xfe100000)
30#define BCSR_SIZE ((uint)(32 * 1024)) 29#define BCSR_SIZE ((uint)(32 * 1024))
31 30
31#define BCSR_MISC_REG2_OFF 0x07
32#define BCSR_MISC_REG2_PORESET 0x01
33
34#define BCSR_MISC_REG3_OFF 0x08
35#define BCSR_MISC_REG3_CNFLOCK 0x80
36
32#ifdef CONFIG_PCI 37#ifdef CONFIG_PCI
33/* PCI interrupt controller */ 38/* PCI interrupt controller */
34#define PIRQA MPC83xx_IRQ_IRQ4 39#define PIRQA MPC83xx_IRQ_IRQ4
diff --git a/arch/ppc/platforms/85xx/Kconfig b/arch/ppc/platforms/85xx/Kconfig
index ff92e38e7d..c5bc2821d9 100644
--- a/arch/ppc/platforms/85xx/Kconfig
+++ b/arch/ppc/platforms/85xx/Kconfig
@@ -21,6 +21,11 @@ config MPC8540_ADS
21 help 21 help
22 This option enables support for the MPC 8540 ADS evaluation board. 22 This option enables support for the MPC 8540 ADS evaluation board.
23 23
24config MPC8548_CDS
25 bool "Freescale MPC8548 CDS"
26 help
27 This option enablese support for the MPC8548 CDS evaluation board.
28
24config MPC8555_CDS 29config MPC8555_CDS
25 bool "Freescale MPC8555 CDS" 30 bool "Freescale MPC8555 CDS"
26 help 31 help
@@ -53,6 +58,11 @@ config MPC8540
53 depends on MPC8540_ADS 58 depends on MPC8540_ADS
54 default y 59 default y
55 60
61config MPC8548
62 bool
63 depends on MPC8548_CDS
64 default y
65
56config MPC8555 66config MPC8555
57 bool 67 bool
58 depends on MPC8555_CDS 68 depends on MPC8555_CDS
diff --git a/arch/ppc/platforms/85xx/Makefile b/arch/ppc/platforms/85xx/Makefile
index 854fbd298b..efdf813108 100644
--- a/arch/ppc/platforms/85xx/Makefile
+++ b/arch/ppc/platforms/85xx/Makefile
@@ -2,6 +2,7 @@
2# Makefile for the PowerPC 85xx linux kernel. 2# Makefile for the PowerPC 85xx linux kernel.
3# 3#
4obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads_common.o mpc8540_ads.o 4obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads_common.o mpc8540_ads.o
5obj-$(CONFIG_MPC8548_CDS) += mpc85xx_cds_common.o
5obj-$(CONFIG_MPC8555_CDS) += mpc85xx_cds_common.o 6obj-$(CONFIG_MPC8555_CDS) += mpc85xx_cds_common.o
6obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads_common.o mpc8560_ads.o 7obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads_common.o mpc8560_ads.o
7obj-$(CONFIG_SBC8560) += sbc85xx.o sbc8560.o 8obj-$(CONFIG_SBC8560) += sbc85xx.o sbc8560.o
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index 4d857d6d63..ddd2e9a5bb 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/open_pic.h> 44#include <asm/open_pic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -88,33 +87,39 @@ mpc8540ads_setup_arch(void)
88#ifdef CONFIG_SERIAL_TEXT_DEBUG 87#ifdef CONFIG_SERIAL_TEXT_DEBUG
89 /* Invalidate the entry we stole earlier the serial ports 88 /* Invalidate the entry we stole earlier the serial ports
90 * should be properly mapped */ 89 * should be properly mapped */
91 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 90 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
92#endif 91#endif
93 92
94 /* setup the board related information for the enet controllers */ 93 /* setup the board related information for the enet controllers */
95 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 94 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
96 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 95 if (pdata) {
97 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 96 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
98 pdata->phyid = 0; 97 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
99 /* fixup phy address */ 98 pdata->phyid = 0;
100 pdata->phy_reg_addr += binfo->bi_immr_base; 99 /* fixup phy address */
101 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 100 pdata->phy_reg_addr += binfo->bi_immr_base;
101 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
102 }
102 103
103 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 104 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
104 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 105 if (pdata) {
105 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 106 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
106 pdata->phyid = 1; 107 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
107 /* fixup phy address */ 108 pdata->phyid = 1;
108 pdata->phy_reg_addr += binfo->bi_immr_base; 109 /* fixup phy address */
109 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 110 pdata->phy_reg_addr += binfo->bi_immr_base;
110 111 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
111 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); 112 }
112 pdata->board_flags = 0; 113
113 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 114 if (pdata) {
114 pdata->phyid = 3; 115 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
115 /* fixup phy address */ 116 pdata->board_flags = 0;
116 pdata->phy_reg_addr += binfo->bi_immr_base; 117 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
117 memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); 118 pdata->phyid = 3;
119 /* fixup phy address */
120 pdata->phy_reg_addr += binfo->bi_immr_base;
121 memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6);
122 }
118 123
119#ifdef CONFIG_BLK_DEV_INITRD 124#ifdef CONFIG_BLK_DEV_INITRD
120 if (initrd_start) 125 if (initrd_start)
@@ -150,7 +155,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
150 struct uart_port p; 155 struct uart_port p;
151 156
152 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 157 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
153 settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, 158 settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
154 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); 159 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
155 160
156 memset(&p, 0, sizeof (p)); 161 memset(&p, 0, sizeof (p));
@@ -210,6 +215,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
210#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) 215#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
211 ppc_md.progress = gen550_progress; 216 ppc_md.progress = gen550_progress;
212#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ 217#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
218#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
219 ppc_md.early_serial_map = mpc85xx_early_serial_map;
220#endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
213 221
214 if (ppc_md.progress) 222 if (ppc_md.progress)
215 ppc_md.progress("mpc8540ads_init(): exit", 0); 223 ppc_md.progress("mpc8540ads_init(): exit", 0);
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
index 761b8c7b25..e18380258b 100644
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/open_pic.h> 44#include <asm/open_pic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -91,20 +90,24 @@ mpc8560ads_setup_arch(void)
91 90
92 /* setup the board related information for the enet controllers */ 91 /* setup the board related information for the enet controllers */
93 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 92 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
94 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 93 if (pdata) {
95 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 94 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
96 pdata->phyid = 0; 95 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
97 /* fixup phy address */ 96 pdata->phyid = 0;
98 pdata->phy_reg_addr += binfo->bi_immr_base; 97 /* fixup phy address */
99 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 98 pdata->phy_reg_addr += binfo->bi_immr_base;
99 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
100 }
100 101
101 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 102 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
102 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 103 if (pdata) {
103 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 104 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
104 pdata->phyid = 1; 105 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
105 /* fixup phy address */ 106 pdata->phyid = 1;
106 pdata->phy_reg_addr += binfo->bi_immr_base; 107 /* fixup phy address */
107 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 108 pdata->phy_reg_addr += binfo->bi_immr_base;
109 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
110 }
108 111
109#ifdef CONFIG_BLK_DEV_INITRD 112#ifdef CONFIG_BLK_DEV_INITRD
110 if (initrd_start) 113 if (initrd_start)
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
index ba9f9f562c..18e952d176 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
@@ -36,7 +36,6 @@
36#include <asm/time.h> 36#include <asm/time.h>
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/machdep.h> 38#include <asm/machdep.h>
39#include <asm/prom.h>
40#include <asm/open_pic.h> 39#include <asm/open_pic.h>
41#include <asm/bootinfo.h> 40#include <asm/bootinfo.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
@@ -59,40 +58,8 @@ extern unsigned long total_memory; /* in mm/init */
59unsigned char __res[sizeof (bd_t)]; 58unsigned char __res[sizeof (bd_t)];
60 59
61/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 60/* Internal interrupts are all Level Sensitive, and Positive Polarity */
62
63static u_char mpc85xx_ads_openpic_initsenses[] __initdata = { 61static u_char mpc85xx_ads_openpic_initsenses[] __initdata = {
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 62 MPC85XX_INTERNAL_IRQ_SENSES,
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
96 0x0, /* External 0: */ 63 0x0, /* External 0: */
97#if defined(CONFIG_PCI) 64#if defined(CONFIG_PCI)
98 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */ 65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */
@@ -159,7 +126,7 @@ mpc85xx_ads_init_IRQ(void)
159 /* Skip reserved space and internal sources */ 126 /* Skip reserved space and internal sources */
160 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 127 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
161 /* Map PIC IRQs 0-11 */ 128 /* Map PIC IRQs 0-11 */
162 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 129 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
163 130
164 /* we let openpic interrupts starting from an offset, to 131 /* we let openpic interrupts starting from an offset, to
165 * leave space for cascading interrupts underneath. 132 * leave space for cascading interrupts underneath.
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index 6c020d67ad..b52c4317fe 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -42,8 +42,8 @@
42#include <asm/todc.h> 42#include <asm/todc.h>
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/machdep.h> 44#include <asm/machdep.h>
45#include <asm/prom.h>
46#include <asm/open_pic.h> 45#include <asm/open_pic.h>
46#include <asm/i8259.h>
47#include <asm/bootinfo.h> 47#include <asm/bootinfo.h>
48#include <asm/pci-bridge.h> 48#include <asm/pci-bridge.h>
49#include <asm/mpc85xx.h> 49#include <asm/mpc85xx.h>
@@ -72,40 +72,8 @@ static int cds_pci_slot = 2;
72static volatile u8 * cadmus; 72static volatile u8 * cadmus;
73 73
74/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 74/* Internal interrupts are all Level Sensitive, and Positive Polarity */
75
76static u_char mpc85xx_cds_openpic_initsenses[] __initdata = { 75static u_char mpc85xx_cds_openpic_initsenses[] __initdata = {
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 76 MPC85XX_INTERNAL_IRQ_SENSES,
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
96 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
97 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
98 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
99 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
100 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
101 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
102 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
103 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
104 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
105 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
106 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
107 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
108 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
109#if defined(CONFIG_PCI) 77#if defined(CONFIG_PCI)
110 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 0: PCI1 slot */ 78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 0: PCI1 slot */
111 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI1 slot */ 79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI1 slot */
@@ -181,6 +149,7 @@ void __init
181mpc85xx_cds_init_IRQ(void) 149mpc85xx_cds_init_IRQ(void)
182{ 150{
183 bd_t *binfo = (bd_t *) __res; 151 bd_t *binfo = (bd_t *) __res;
152 int i;
184 153
185 /* Determine the Physical Address of the OpenPIC regs */ 154 /* Determine the Physical Address of the OpenPIC regs */
186 phys_addr_t OpenPIC_PAddr = binfo->bi_immr_base + MPC85xx_OPENPIC_OFFSET; 155 phys_addr_t OpenPIC_PAddr = binfo->bi_immr_base + MPC85xx_OPENPIC_OFFSET;
@@ -189,15 +158,28 @@ mpc85xx_cds_init_IRQ(void)
189 OpenPIC_NumInitSenses = sizeof (mpc85xx_cds_openpic_initsenses); 158 OpenPIC_NumInitSenses = sizeof (mpc85xx_cds_openpic_initsenses);
190 159
191 /* Skip reserved space and internal sources */ 160 /* Skip reserved space and internal sources */
161#ifdef CONFIG_MPC8548
162 openpic_set_sources(0, 48, OpenPIC_Addr + 0x10200);
163#else
192 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 164 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
165#endif
193 /* Map PIC IRQs 0-11 */ 166 /* Map PIC IRQs 0-11 */
194 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 167 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
195 168
196 /* we let openpic interrupts starting from an offset, to 169 /* we let openpic interrupts starting from an offset, to
197 * leave space for cascading interrupts underneath. 170 * leave space for cascading interrupts underneath.
198 */ 171 */
199 openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET); 172 openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET);
200 173
174#ifdef CONFIG_PCI
175 openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq);
176
177 for (i = 0; i < NUM_8259_INTERRUPTS; i++)
178 irq_desc[i].handler = &i8259_pic;
179
180 i8259_init(0);
181#endif
182
201#ifdef CONFIG_CPM2 183#ifdef CONFIG_CPM2
202 /* Setup CPM2 PIC */ 184 /* Setup CPM2 PIC */
203 cpm2_init_IRQ(); 185 cpm2_init_IRQ();
@@ -231,7 +213,7 @@ mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
231 * interrupt on slot */ 213 * interrupt on slot */
232 { 214 {
233 { 0, 1, 2, 3 }, /* 16 - PMC */ 215 { 0, 1, 2, 3 }, /* 16 - PMC */
234 { 3, 0, 0, 0 }, /* 17 P2P (Tsi320) */ 216 { 0, 1, 2, 3 }, /* 17 P2P (Tsi320) */
235 { 0, 1, 2, 3 }, /* 18 - Slot 1 */ 217 { 0, 1, 2, 3 }, /* 18 - Slot 1 */
236 { 1, 2, 3, 0 }, /* 19 - Slot 2 */ 218 { 1, 2, 3, 0 }, /* 19 - Slot 2 */
237 { 2, 3, 0, 1 }, /* 20 - Slot 3 */ 219 { 2, 3, 0, 1 }, /* 20 - Slot 3 */
@@ -280,13 +262,135 @@ mpc85xx_exclude_device(u_char bus, u_char devfn)
280 return PCIBIOS_DEVICE_NOT_FOUND; 262 return PCIBIOS_DEVICE_NOT_FOUND;
281#endif 263#endif
282 /* We explicitly do not go past the Tundra 320 Bridge */ 264 /* We explicitly do not go past the Tundra 320 Bridge */
283 if (bus == 1) 265 if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
284 return PCIBIOS_DEVICE_NOT_FOUND; 266 return PCIBIOS_DEVICE_NOT_FOUND;
285 if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL)) 267 if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
286 return PCIBIOS_DEVICE_NOT_FOUND; 268 return PCIBIOS_DEVICE_NOT_FOUND;
287 else 269 else
288 return PCIBIOS_SUCCESSFUL; 270 return PCIBIOS_SUCCESSFUL;
289} 271}
272
273void __init
274mpc85xx_cds_enable_via(struct pci_controller *hose)
275{
276 u32 pci_class;
277 u16 vid, did;
278
279 early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
280 if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
281 return;
282
283 /* Configure P2P so that we can reach bus 1 */
284 early_write_config_byte(hose, 0, 0x88, PCI_PRIMARY_BUS, 0);
285 early_write_config_byte(hose, 0, 0x88, PCI_SECONDARY_BUS, 1);
286 early_write_config_byte(hose, 0, 0x88, PCI_SUBORDINATE_BUS, 0xff);
287
288 early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
289 early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
290
291 if ((vid != PCI_VENDOR_ID_VIA) ||
292 (did != PCI_DEVICE_ID_VIA_82C686))
293 return;
294
295 /* Enable USB and IDE functions */
296 early_write_config_byte(hose, 1, 0x10, 0x48, 0x08);
297}
298
299void __init
300mpc85xx_cds_fixup_via(struct pci_controller *hose)
301{
302 u32 pci_class;
303 u16 vid, did;
304
305 early_read_config_dword(hose, 0, 0x88, PCI_CLASS_REVISION, &pci_class);
306 if ((pci_class >> 16) != PCI_CLASS_BRIDGE_PCI)
307 return;
308
309 /*
310 * Force the backplane P2P bridge to have a window
311 * open from 0x00000000-0x00001fff in PCI I/O space.
312 * This allows legacy I/O (i8259, etc) on the VIA
313 * southbridge to be accessed.
314 */
315 early_write_config_byte(hose, 0, 0x88, PCI_IO_BASE, 0x00);
316 early_write_config_word(hose, 0, 0x88, PCI_IO_BASE_UPPER16, 0x0000);
317 early_write_config_byte(hose, 0, 0x88, PCI_IO_LIMIT, 0x10);
318 early_write_config_word(hose, 0, 0x88, PCI_IO_LIMIT_UPPER16, 0x0000);
319
320 early_read_config_word(hose, 1, 0x10, PCI_VENDOR_ID, &vid);
321 early_read_config_word(hose, 1, 0x10, PCI_DEVICE_ID, &did);
322 if ((vid != PCI_VENDOR_ID_VIA) ||
323 (did != PCI_DEVICE_ID_VIA_82C686))
324 return;
325
326 /*
327 * Since the P2P window was forced to cover the fixed
328 * legacy I/O addresses, it is necessary to manually
329 * place the base addresses for the IDE and USB functions
330 * within this window.
331 */
332 /* Function 1, IDE */
333 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_0, 0x1ff8);
334 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_1, 0x1ff4);
335 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_2, 0x1fe8);
336 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_3, 0x1fe4);
337 early_write_config_dword(hose, 1, 0x11, PCI_BASE_ADDRESS_4, 0x1fd0);
338
339 /* Function 2, USB ports 0-1 */
340 early_write_config_dword(hose, 1, 0x12, PCI_BASE_ADDRESS_4, 0x1fa0);
341
342 /* Function 3, USB ports 2-3 */
343 early_write_config_dword(hose, 1, 0x13, PCI_BASE_ADDRESS_4, 0x1f80);
344
345 /* Function 5, Power Management */
346 early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_0, 0x1e00);
347 early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_1, 0x1dfc);
348 early_write_config_dword(hose, 1, 0x15, PCI_BASE_ADDRESS_2, 0x1df8);
349
350 /* Function 6, AC97 Interface */
351 early_write_config_dword(hose, 1, 0x16, PCI_BASE_ADDRESS_0, 0x1c00);
352}
353
354void __init
355mpc85xx_cds_pcibios_fixup(void)
356{
357 struct pci_dev *dev = NULL;
358 u_char c;
359
360 if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
361 PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
362 /*
363 * U-Boot does not set the enable bits
364 * for the IDE device. Force them on here.
365 */
366 pci_read_config_byte(dev, 0x40, &c);
367 c |= 0x03; /* IDE: Chip Enable Bits */
368 pci_write_config_byte(dev, 0x40, c);
369
370 /*
371 * Since only primary interface works, force the
372 * IDE function to standard primary IDE interrupt
373 * w/ 8259 offset
374 */
375 dev->irq = 14;
376 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
377 }
378
379 /*
380 * Force legacy USB interrupt routing
381 */
382 if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
383 PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
384 dev->irq = 10;
385 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
386 }
387
388 if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
389 PCI_DEVICE_ID_VIA_82C586_2, dev))) {
390 dev->irq = 11;
391 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
392 }
393}
290#endif /* CONFIG_PCI */ 394#endif /* CONFIG_PCI */
291 395
292TODC_ALLOC(); 396TODC_ALLOC();
@@ -328,6 +432,9 @@ mpc85xx_cds_setup_arch(void)
328 loops_per_jiffy = freq / HZ; 432 loops_per_jiffy = freq / HZ;
329 433
330#ifdef CONFIG_PCI 434#ifdef CONFIG_PCI
435 /* VIA IDE configuration */
436 ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
437
331 /* setup PCI host bridges */ 438 /* setup PCI host bridges */
332 mpc85xx_setup_hose(); 439 mpc85xx_setup_hose();
333#endif 440#endif
@@ -339,26 +446,52 @@ mpc85xx_cds_setup_arch(void)
339#ifdef CONFIG_SERIAL_TEXT_DEBUG 446#ifdef CONFIG_SERIAL_TEXT_DEBUG
340 /* Invalidate the entry we stole earlier the serial ports 447 /* Invalidate the entry we stole earlier the serial ports
341 * should be properly mapped */ 448 * should be properly mapped */
342 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 449 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
343#endif 450#endif
344 451
345 /* setup the board related information for the enet controllers */ 452 /* setup the board related information for the enet controllers */
346 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 453 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
347 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 454 if (pdata) {
348 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 455 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
349 pdata->phyid = 0; 456 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
350 /* fixup phy address */ 457 pdata->phyid = 0;
351 pdata->phy_reg_addr += binfo->bi_immr_base; 458 /* fixup phy address */
352 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 459 pdata->phy_reg_addr += binfo->bi_immr_base;
460 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
461 }
353 462
354 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 463 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
355 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 464 if (pdata) {
356 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 465 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
357 pdata->phyid = 1; 466 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
358 /* fixup phy address */ 467 pdata->phyid = 1;
359 pdata->phy_reg_addr += binfo->bi_immr_base; 468 /* fixup phy address */
360 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 469 pdata->phy_reg_addr += binfo->bi_immr_base;
470 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
471 }
472
473 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
474 if (pdata) {
475 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
476 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
477 pdata->phyid = 0;
478 /* fixup phy address */
479 pdata->phy_reg_addr += binfo->bi_immr_base;
480 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
481 }
482
483 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
484 if (pdata) {
485 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
486 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
487 pdata->phyid = 1;
488 /* fixup phy address */
489 pdata->phy_reg_addr += binfo->bi_immr_base;
490 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
491 }
361 492
493 ppc_sys_device_remove(MPC85xx_eTSEC3);
494 ppc_sys_device_remove(MPC85xx_eTSEC4);
362 495
363#ifdef CONFIG_BLK_DEV_INITRD 496#ifdef CONFIG_BLK_DEV_INITRD
364 if (initrd_start) 497 if (initrd_start)
@@ -395,7 +528,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
395 struct uart_port p; 528 struct uart_port p;
396 529
397 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 530 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
398 settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, 531 settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
399 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); 532 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
400 533
401 memset(&p, 0, sizeof (p)); 534 memset(&p, 0, sizeof (p));
@@ -459,6 +592,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
459#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) 592#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
460 ppc_md.progress = gen550_progress; 593 ppc_md.progress = gen550_progress;
461#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ 594#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
595#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
596 ppc_md.early_serial_map = mpc85xx_early_serial_map;
597#endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
462 598
463 if (ppc_md.progress) 599 if (ppc_md.progress)
464 ppc_md.progress("mpc85xx_cds_init(): exit", 0); 600 ppc_md.progress("mpc85xx_cds_init(): exit", 0);
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
index 7627d77504..12b292c6ae 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h
@@ -77,4 +77,7 @@
77 77
78#define MPC85XX_PCI2_IO_SIZE 0x01000000 78#define MPC85XX_PCI2_IO_SIZE 0x01000000
79 79
80#define NR_8259_INTS 16
81#define CPM_IRQ_OFFSET NR_8259_INTS
82
80#endif /* __MACH_MPC85XX_CDS_H__ */ 83#endif /* __MACH_MPC85XX_CDS_H__ */
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index 9ab05e590c..165df94d4a 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/prom.h>
45#include <asm/open_pic.h> 44#include <asm/open_pic.h>
46#include <asm/bootinfo.h> 45#include <asm/bootinfo.h>
47#include <asm/pci-bridge.h> 46#include <asm/pci-bridge.h>
@@ -125,25 +124,29 @@ sbc8560_setup_arch(void)
125#ifdef CONFIG_SERIAL_TEXT_DEBUG 124#ifdef CONFIG_SERIAL_TEXT_DEBUG
126 /* Invalidate the entry we stole earlier the serial ports 125 /* Invalidate the entry we stole earlier the serial ports
127 * should be properly mapped */ 126 * should be properly mapped */
128 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 127 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
129#endif 128#endif
130 129
131 /* setup the board related information for the enet controllers */ 130 /* setup the board related information for the enet controllers */
132 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 131 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
133 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 132 if (pdata) {
134 pdata->interruptPHY = MPC85xx_IRQ_EXT6; 133 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
135 pdata->phyid = 25; 134 pdata->interruptPHY = MPC85xx_IRQ_EXT6;
136 /* fixup phy address */ 135 pdata->phyid = 25;
137 pdata->phy_reg_addr += binfo->bi_immr_base; 136 /* fixup phy address */
138 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 137 pdata->phy_reg_addr += binfo->bi_immr_base;
138 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
139 }
139 140
140 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 141 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
141 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; 142 if (pdata) {
142 pdata->interruptPHY = MPC85xx_IRQ_EXT7; 143 pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
143 pdata->phyid = 26; 144 pdata->interruptPHY = MPC85xx_IRQ_EXT7;
144 /* fixup phy address */ 145 pdata->phyid = 26;
145 pdata->phy_reg_addr += binfo->bi_immr_base; 146 /* fixup phy address */
146 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 147 pdata->phy_reg_addr += binfo->bi_immr_base;
148 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
149 }
147 150
148#ifdef CONFIG_BLK_DEV_INITRD 151#ifdef CONFIG_BLK_DEV_INITRD
149 if (initrd_start) 152 if (initrd_start)
@@ -176,7 +179,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
176 179
177#ifdef CONFIG_SERIAL_TEXT_DEBUG 180#ifdef CONFIG_SERIAL_TEXT_DEBUG
178 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 181 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
179 settlbcam(NUM_TLBCAMS - 1, UARTA_ADDR, 182 settlbcam(num_tlbcam_entries - 1, UARTA_ADDR,
180 UARTA_ADDR, 0x1000, _PAGE_IO, 0); 183 UARTA_ADDR, 0x1000, _PAGE_IO, 0);
181#endif 184#endif
182 185
@@ -221,6 +224,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
221#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) 224#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG)
222 ppc_md.progress = gen550_progress; 225 ppc_md.progress = gen550_progress;
223#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ 226#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */
227#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_KGDB)
228 ppc_md.early_serial_map = sbc8560_early_serial_map;
229#endif /* CONFIG_SERIAL_8250 && CONFIG_KGDB */
224 230
225 if (ppc_md.progress) 231 if (ppc_md.progress)
226 ppc_md.progress("sbc8560_init(): exit", 0); 232 ppc_md.progress("sbc8560_init(): exit", 0);
diff --git a/arch/ppc/platforms/85xx/sbc85xx.c b/arch/ppc/platforms/85xx/sbc85xx.c
index 2d638c1c1b..4f6d1ddd6f 100644
--- a/arch/ppc/platforms/85xx/sbc85xx.c
+++ b/arch/ppc/platforms/85xx/sbc85xx.c
@@ -35,7 +35,6 @@
35#include <asm/time.h> 35#include <asm/time.h>
36#include <asm/io.h> 36#include <asm/io.h>
37#include <asm/machdep.h> 37#include <asm/machdep.h>
38#include <asm/prom.h>
39#include <asm/open_pic.h> 38#include <asm/open_pic.h>
40#include <asm/bootinfo.h> 39#include <asm/bootinfo.h>
41#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
@@ -59,40 +58,8 @@ unsigned long pci_dram_offset = 0;
59extern unsigned long total_memory; /* in mm/init */ 58extern unsigned long total_memory; /* in mm/init */
60 59
61/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 60/* Internal interrupts are all Level Sensitive, and Positive Polarity */
62
63static u_char sbc8560_openpic_initsenses[] __initdata = { 61static u_char sbc8560_openpic_initsenses[] __initdata = {
64 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 62 MPC85XX_INTERNAL_IRQ_SENSES,
65 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
66 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
67 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
68 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
69 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
70 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
71 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
72 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
73 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
74 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
96 0x0, /* External 0: */ 63 0x0, /* External 0: */
97 0x0, /* External 1: */ 64 0x0, /* External 1: */
98#if defined(CONFIG_PCI) 65#if defined(CONFIG_PCI)
@@ -159,7 +126,7 @@ sbc8560_init_IRQ(void)
159 /* Skip reserved space and internal sources */ 126 /* Skip reserved space and internal sources */
160 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 127 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
161 /* Map PIC IRQs 0-11 */ 128 /* Map PIC IRQs 0-11 */
162 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 129 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
163 130
164 /* we let openpic interrupts starting from an offset, to 131 /* we let openpic interrupts starting from an offset, to
165 * leave space for cascading interrupts underneath. 132 * leave space for cascading interrupts underneath.
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
index bc95836e41..bb41265cfc 100644
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -46,7 +46,6 @@
46#include <asm/time.h> 46#include <asm/time.h>
47#include <asm/io.h> 47#include <asm/io.h>
48#include <asm/machdep.h> 48#include <asm/machdep.h>
49#include <asm/prom.h>
50#include <asm/open_pic.h> 49#include <asm/open_pic.h>
51#include <asm/bootinfo.h> 50#include <asm/bootinfo.h>
52#include <asm/pci-bridge.h> 51#include <asm/pci-bridge.h>
@@ -72,38 +71,7 @@ unsigned long pci_dram_offset = 0;
72 71
73/* Internal interrupts are all Level Sensitive, and Positive Polarity */ 72/* Internal interrupts are all Level Sensitive, and Positive Polarity */
74static u8 gp3_openpic_initsenses[] __initdata = { 73static u8 gp3_openpic_initsenses[] __initdata = {
75 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ 74 MPC85XX_INTERNAL_IRQ_SENSES,
76 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */
77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */
78 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */
79 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */
80 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */
81 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */
82 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */
83 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */
84 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */
85 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */
86 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */
87 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */
88 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */
89 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */
90 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */
91 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */
92 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */
93 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */
94 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */
95 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */
96 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */
97 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */
98 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */
99 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */
100 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */
101 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */
102 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */
103 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */
104 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */
105 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */
106 (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */
107 0x0, /* External 0: */ 75 0x0, /* External 0: */
108#if defined(CONFIG_PCI) 76#if defined(CONFIG_PCI)
109 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */ 77 (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */
@@ -154,19 +122,23 @@ gp3_setup_arch(void)
154 122
155 /* setup the board related information for the enet controllers */ 123 /* setup the board related information for the enet controllers */
156 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); 124 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
157/* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ 125 if (pdata) {
158 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 126 /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
159 pdata->phyid = 2; 127 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
160 pdata->phy_reg_addr += binfo->bi_immr_base; 128 pdata->phyid = 2;
161 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); 129 pdata->phy_reg_addr += binfo->bi_immr_base;
130 memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
131 }
162 132
163 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); 133 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
164/* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ 134 if (pdata) {
165 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 135 /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
166 pdata->phyid = 4; 136 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
167 /* fixup phy address */ 137 pdata->phyid = 4;
168 pdata->phy_reg_addr += binfo->bi_immr_base; 138 /* fixup phy address */
169 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 139 pdata->phy_reg_addr += binfo->bi_immr_base;
140 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
141 }
170 142
171#ifdef CONFIG_BLK_DEV_INITRD 143#ifdef CONFIG_BLK_DEV_INITRD
172 if (initrd_start) 144 if (initrd_start)
@@ -200,7 +172,6 @@ static struct irqaction cpm2_irqaction = {
200static void __init 172static void __init
201gp3_init_IRQ(void) 173gp3_init_IRQ(void)
202{ 174{
203 int i;
204 bd_t *binfo = (bd_t *) __res; 175 bd_t *binfo = (bd_t *) __res;
205 176
206 /* 177 /*
@@ -218,7 +189,7 @@ gp3_init_IRQ(void)
218 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); 189 openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200);
219 190
220 /* Map PIC IRQs 0-11 */ 191 /* Map PIC IRQs 0-11 */
221 openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); 192 openpic_set_sources(48, 12, OpenPIC_Addr + 0x10000);
222 193
223 /* 194 /*
224 * Let openpic interrupts starting from an offset, to 195 * Let openpic interrupts starting from an offset, to
diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c
index 7d0ee308f6..7d3fbb5c5d 100644
--- a/arch/ppc/platforms/chrp_pci.c
+++ b/arch/ppc/platforms/chrp_pci.c
@@ -9,7 +9,6 @@
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/ide.h> 11#include <linux/ide.h>
12#include <linux/bootmem.h>
13 12
14#include <asm/io.h> 13#include <asm/io.h>
15#include <asm/pgtable.h> 14#include <asm/pgtable.h>
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index eda922ac31..169dbf6534 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -27,12 +27,12 @@
27#include <linux/root_dev.h> 27#include <linux/root_dev.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/seq_file.h> 29#include <linux/seq_file.h>
30#include <linux/bootmem.h>
31#include <linux/mtd/physmap.h> 30#include <linux/mtd/physmap.h>
32#include <linux/mv643xx.h> 31#include <linux/mv643xx.h>
33#ifdef CONFIG_BOOTIMG 32#ifdef CONFIG_BOOTIMG
34#include <linux/bootimg.h> 33#include <linux/bootimg.h>
35#endif 34#endif
35#include <asm/io.h>
36#include <asm/page.h> 36#include <asm/page.h>
37#include <asm/time.h> 37#include <asm/time.h>
38#include <asm/smp.h> 38#include <asm/smp.h>
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
index f7fb2786cd..5fdd4f607a 100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -83,16 +83,13 @@ static u32 frequency_gpio;
83static u32 slew_done_gpio; 83static u32 slew_done_gpio;
84static int no_schedule; 84static int no_schedule;
85static int has_cpu_l2lve; 85static int has_cpu_l2lve;
86 86static int is_pmu_based;
87
88#define PMAC_CPU_LOW_SPEED 1
89#define PMAC_CPU_HIGH_SPEED 0
90 87
91/* There are only two frequency states for each processor. Values 88/* There are only two frequency states for each processor. Values
92 * are in kHz for the time being. 89 * are in kHz for the time being.
93 */ 90 */
94#define CPUFREQ_HIGH PMAC_CPU_HIGH_SPEED 91#define CPUFREQ_HIGH 0
95#define CPUFREQ_LOW PMAC_CPU_LOW_SPEED 92#define CPUFREQ_LOW 1
96 93
97static struct cpufreq_frequency_table pmac_cpu_freqs[] = { 94static struct cpufreq_frequency_table pmac_cpu_freqs[] = {
98 {CPUFREQ_HIGH, 0}, 95 {CPUFREQ_HIGH, 0},
@@ -100,6 +97,11 @@ static struct cpufreq_frequency_table pmac_cpu_freqs[] = {
100 {0, CPUFREQ_TABLE_END}, 97 {0, CPUFREQ_TABLE_END},
101}; 98};
102 99
100static struct freq_attr* pmac_cpu_freqs_attr[] = {
101 &cpufreq_freq_attr_scaling_available_freqs,
102 NULL,
103};
104
103static inline void local_delay(unsigned long ms) 105static inline void local_delay(unsigned long ms)
104{ 106{
105 if (no_schedule) 107 if (no_schedule)
@@ -269,6 +271,8 @@ static int __pmac pmu_set_cpu_speed(int low_speed)
269#ifdef DEBUG_FREQ 271#ifdef DEBUG_FREQ
270 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1)); 272 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
271#endif 273#endif
274 pmu_suspend();
275
272 /* Disable all interrupt sources on openpic */ 276 /* Disable all interrupt sources on openpic */
273 pic_prio = openpic_get_priority(); 277 pic_prio = openpic_get_priority();
274 openpic_set_priority(0xf); 278 openpic_set_priority(0xf);
@@ -343,6 +347,8 @@ static int __pmac pmu_set_cpu_speed(int low_speed)
343 debug_calc_bogomips(); 347 debug_calc_bogomips();
344#endif 348#endif
345 349
350 pmu_resume();
351
346 preempt_enable(); 352 preempt_enable();
347 353
348 return 0; 354 return 0;
@@ -355,7 +361,7 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
355 static unsigned long prev_l3cr; 361 static unsigned long prev_l3cr;
356 362
357 freqs.old = cur_freq; 363 freqs.old = cur_freq;
358 freqs.new = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq; 364 freqs.new = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
359 freqs.cpu = smp_processor_id(); 365 freqs.cpu = smp_processor_id();
360 366
361 if (freqs.old == freqs.new) 367 if (freqs.old == freqs.new)
@@ -363,7 +369,7 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
363 369
364 if (notify) 370 if (notify)
365 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 371 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
366 if (speed_mode == PMAC_CPU_LOW_SPEED && 372 if (speed_mode == CPUFREQ_LOW &&
367 cpu_has_feature(CPU_FTR_L3CR)) { 373 cpu_has_feature(CPU_FTR_L3CR)) {
368 l3cr = _get_L3CR(); 374 l3cr = _get_L3CR();
369 if (l3cr & L3CR_L3E) { 375 if (l3cr & L3CR_L3E) {
@@ -371,8 +377,8 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
371 _set_L3CR(0); 377 _set_L3CR(0);
372 } 378 }
373 } 379 }
374 set_speed_proc(speed_mode == PMAC_CPU_LOW_SPEED); 380 set_speed_proc(speed_mode == CPUFREQ_LOW);
375 if (speed_mode == PMAC_CPU_HIGH_SPEED && 381 if (speed_mode == CPUFREQ_HIGH &&
376 cpu_has_feature(CPU_FTR_L3CR)) { 382 cpu_has_feature(CPU_FTR_L3CR)) {
377 l3cr = _get_L3CR(); 383 l3cr = _get_L3CR();
378 if ((prev_l3cr & L3CR_L3E) && l3cr != prev_l3cr) 384 if ((prev_l3cr & L3CR_L3E) && l3cr != prev_l3cr)
@@ -380,7 +386,7 @@ static int __pmac do_set_cpu_speed(int speed_mode, int notify)
380 } 386 }
381 if (notify) 387 if (notify)
382 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 388 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
383 cur_freq = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq; 389 cur_freq = (speed_mode == CPUFREQ_HIGH) ? hi_freq : low_freq;
384 390
385 return 0; 391 return 0;
386} 392}
@@ -423,7 +429,8 @@ static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
423 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 429 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
424 policy->cur = cur_freq; 430 policy->cur = cur_freq;
425 431
426 return cpufreq_frequency_table_cpuinfo(policy, &pmac_cpu_freqs[0]); 432 cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu);
433 return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
427} 434}
428 435
429static u32 __pmac read_gpio(struct device_node *np) 436static u32 __pmac read_gpio(struct device_node *np)
@@ -456,8 +463,8 @@ static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, u32 state)
456 */ 463 */
457 no_schedule = 1; 464 no_schedule = 1;
458 sleep_freq = cur_freq; 465 sleep_freq = cur_freq;
459 if (cur_freq == low_freq) 466 if (cur_freq == low_freq && !is_pmu_based)
460 do_set_cpu_speed(PMAC_CPU_HIGH_SPEED, 0); 467 do_set_cpu_speed(CPUFREQ_HIGH, 0);
461 return 0; 468 return 0;
462} 469}
463 470
@@ -473,8 +480,8 @@ static int __pmac pmac_cpufreq_resume(struct cpufreq_policy *policy)
473 * is that we force a switch to whatever it was, which is 480 * is that we force a switch to whatever it was, which is
474 * probably high speed due to our suspend() routine 481 * probably high speed due to our suspend() routine
475 */ 482 */
476 do_set_cpu_speed(sleep_freq == low_freq ? PMAC_CPU_LOW_SPEED 483 do_set_cpu_speed(sleep_freq == low_freq ?
477 : PMAC_CPU_HIGH_SPEED, 0); 484 CPUFREQ_LOW : CPUFREQ_HIGH, 0);
478 485
479 no_schedule = 0; 486 no_schedule = 0;
480 return 0; 487 return 0;
@@ -488,6 +495,7 @@ static struct cpufreq_driver pmac_cpufreq_driver = {
488 .suspend = pmac_cpufreq_suspend, 495 .suspend = pmac_cpufreq_suspend,
489 .resume = pmac_cpufreq_resume, 496 .resume = pmac_cpufreq_resume,
490 .flags = CPUFREQ_PM_NO_WARN, 497 .flags = CPUFREQ_PM_NO_WARN,
498 .attr = pmac_cpu_freqs_attr,
491 .name = "powermac", 499 .name = "powermac",
492 .owner = THIS_MODULE, 500 .owner = THIS_MODULE,
493}; 501};
@@ -580,6 +588,7 @@ static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
580 return 1; 588 return 1;
581 hi_freq = (*value) / 1000; 589 hi_freq = (*value) / 1000;
582 set_speed_proc = pmu_set_cpu_speed; 590 set_speed_proc = pmu_set_cpu_speed;
591 is_pmu_based = 1;
583 592
584 return 0; 593 return 0;
585} 594}
@@ -684,6 +693,7 @@ static int __init pmac_cpufreq_setup(void)
684 hi_freq = cur_freq; 693 hi_freq = cur_freq;
685 low_freq = 400000; 694 low_freq = 400000;
686 set_speed_proc = pmu_set_cpu_speed; 695 set_speed_proc = pmu_set_cpu_speed;
696 is_pmu_based = 1;
687 } 697 }
688 /* Else check for TiPb 400 & 500 */ 698 /* Else check for TiPb 400 & 500 */
689 else if (machine_is_compatible("PowerBook3,2")) { 699 else if (machine_is_compatible("PowerBook3,2")) {
@@ -695,6 +705,7 @@ static int __init pmac_cpufreq_setup(void)
695 hi_freq = cur_freq; 705 hi_freq = cur_freq;
696 low_freq = 300000; 706 low_freq = 300000;
697 set_speed_proc = pmu_set_cpu_speed; 707 set_speed_proc = pmu_set_cpu_speed;
708 is_pmu_based = 1;
698 } 709 }
699 /* Else check for 750FX */ 710 /* Else check for 750FX */
700 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000) 711 else if (PVR_VER(mfspr(SPRN_PVR)) == 0x7000)
diff --git a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c
index f6ff519240..719fb49fe2 100644
--- a/arch/ppc/platforms/pmac_pci.c
+++ b/arch/ppc/platforms/pmac_pci.c
@@ -17,7 +17,6 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/bootmem.h>
21 20
22#include <asm/sections.h> 21#include <asm/sections.h>
23#include <asm/io.h> 22#include <asm/io.h>
diff --git a/arch/ppc/platforms/pq2ads.h b/arch/ppc/platforms/pq2ads.h
index cf5e5dd06d..067d9a5aeb 100644
--- a/arch/ppc/platforms/pq2ads.h
+++ b/arch/ppc/platforms/pq2ads.h
@@ -49,10 +49,10 @@
49/* PCI interrupt controller */ 49/* PCI interrupt controller */
50#define PCI_INT_STAT_REG 0xF8200000 50#define PCI_INT_STAT_REG 0xF8200000
51#define PCI_INT_MASK_REG 0xF8200004 51#define PCI_INT_MASK_REG 0xF8200004
52#define PIRQA (NR_SIU_INTS + 0) 52#define PIRQA (NR_CPM_INTS + 0)
53#define PIRQB (NR_SIU_INTS + 1) 53#define PIRQB (NR_CPM_INTS + 1)
54#define PIRQC (NR_SIU_INTS + 2) 54#define PIRQC (NR_CPM_INTS + 2)
55#define PIRQD (NR_SIU_INTS + 3) 55#define PIRQD (NR_CPM_INTS + 3)
56 56
57/* 57/*
58 * PCI memory map definitions for MPC8266ADS-PCI. 58 * PCI memory map definitions for MPC8266ADS-PCI.
@@ -68,28 +68,23 @@
68 * 0x00000000-0x1FFFFFFF 0x00000000-0x1FFFFFFF MPC8266 local memory 68 * 0x00000000-0x1FFFFFFF 0x00000000-0x1FFFFFFF MPC8266 local memory
69 */ 69 */
70 70
71/* window for a PCI master to access MPC8266 memory */ 71/* All the other PCI memory map definitions reside at syslib/m82xx_pci.h
72#define PCI_SLV_MEM_LOCAL 0x00000000 /* Local base */ 72 Here we should redefine what is unique for this board */
73#define PCI_SLV_MEM_BUS 0x00000000 /* PCI base */ 73#define M82xx_PCI_SLAVE_MEM_LOCAL 0x00000000 /* Local base */
74#define M82xx_PCI_SLAVE_MEM_BUS 0x00000000 /* PCI base */
75#define M82xx_PCI_SLAVE_MEM_SIZE 0x10000000 /* 256 Mb */
74 76
75/* window for the processor to access PCI memory with prefetching */ 77#define M82xx_PCI_SLAVE_SEC_WND_SIZE ~(0x40000000 - 1U) /* 2 x 512Mb */
76#define PCI_MSTR_MEM_LOCAL 0x80000000 /* Local base */ 78#define M82xx_PCI_SLAVE_SEC_WND_BASE 0x80000000 /* PCI Memory base */
77#define PCI_MSTR_MEM_BUS 0x80000000 /* PCI base */
78#define PCI_MSTR_MEM_SIZE 0x20000000 /* 512MB */
79 79
80/* window for the processor to access PCI memory without prefetching */ 80#if defined(CONFIG_ADS8272)
81#define PCI_MSTR_MEMIO_LOCAL 0xA0000000 /* Local base */ 81#define PCI_INT_TO_SIU SIU_INT_IRQ2
82#define PCI_MSTR_MEMIO_BUS 0xA0000000 /* PCI base */ 82#elif defined(CONFIG_PQ2FADS)
83#define PCI_MSTR_MEMIO_SIZE 0x20000000 /* 512MB */ 83#define PCI_INT_TO_SIU SIU_INT_IRQ6
84#else
85#warning PCI Bridge will be without interrupts support
86#endif
84 87
85/* window for the processor to access PCI I/O */
86#define PCI_MSTR_IO_LOCAL 0xF4000000 /* Local base */
87#define PCI_MSTR_IO_BUS 0x00000000 /* PCI base */
88#define PCI_MSTR_IO_SIZE 0x04000000 /* 64MB */
89
90#define _IO_BASE PCI_MSTR_IO_LOCAL
91#define _ISA_MEM_BASE PCI_MSTR_MEMIO_LOCAL
92#define PCI_DRAM_OFFSET PCI_SLV_MEM_BUS
93#endif /* CONFIG_PCI */ 88#endif /* CONFIG_PCI */
94 89
95#endif /* __MACH_ADS8260_DEFS */ 90#endif /* __MACH_ADS8260_DEFS */
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index 531bfa0e45..70e58f43f2 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -81,6 +81,7 @@
81#include <linux/serial.h> 81#include <linux/serial.h>
82#include <linux/tty.h> /* for linux/serial_core.h */ 82#include <linux/tty.h> /* for linux/serial_core.h */
83#include <linux/serial_core.h> 83#include <linux/serial_core.h>
84#include <linux/serial_8250.h>
84 85
85#include <asm/system.h> 86#include <asm/system.h>
86#include <asm/pgtable.h> 87#include <asm/pgtable.h>
@@ -99,6 +100,7 @@
99#include <asm/mpc10x.h> 100#include <asm/mpc10x.h>
100#include <asm/pci-bridge.h> 101#include <asm/pci-bridge.h>
101#include <asm/kgdb.h> 102#include <asm/kgdb.h>
103#include <asm/ppc_sys.h>
102 104
103#include "sandpoint.h" 105#include "sandpoint.h"
104 106
@@ -305,6 +307,24 @@ sandpoint_setup_arch(void)
305 /* Lookup PCI host bridges */ 307 /* Lookup PCI host bridges */
306 sandpoint_find_bridges(); 308 sandpoint_find_bridges();
307 309
310 if (strncmp (cur_ppc_sys_spec->ppc_sys_name, "8245", 4) == 0)
311 {
312 bd_t *bp = (bd_t *)__res;
313 struct plat_serial8250_port *pdata;
314 pdata = (struct plat_serial8250_port *) ppc_sys_get_pdata(MPC10X_DUART);
315
316 if (pdata)
317 {
318 pdata[0].uartclk = bp->bi_busfreq;
319 pdata[0].membase = ioremap(pdata[0].mapbase, 0x100);
320
321 /* this disables the 2nd serial port on the DUART
322 * since the sandpoint does not have it connected */
323 pdata[1].uartclk = 0;
324 pdata[1].irq = 0;
325 pdata[1].mapbase = 0;
326 }
327
308 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n"); 328 printk(KERN_INFO "Motorola SPS Sandpoint Test Platform\n");
309 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n"); 329 printk(KERN_INFO "Port by MontaVista Software, Inc. (source@mvista.com)\n");
310 330
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index dd418ea342..dec5bf4f68 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -81,7 +81,7 @@ obj-$(CONFIG_SBC82xx) += todc_time.o
81obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \ 81obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
82 todc_time.o 82 todc_time.o
83obj-$(CONFIG_8260) += m8260_setup.o 83obj-$(CONFIG_8260) += m8260_setup.o
84obj-$(CONFIG_PCI_8260) += m8260_pci.o indirect_pci.o 84obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o
85obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o 85obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
86obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o 86obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
87ifeq ($(CONFIG_PPC_GEN550),y) 87ifeq ($(CONFIG_PPC_GEN550),y)
@@ -92,12 +92,12 @@ ifeq ($(CONFIG_SERIAL_MPSC_CONSOLE),y)
92obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o 92obj-$(CONFIG_SERIAL_TEXT_DEBUG) += mv64x60_dbg.o
93endif 93endif
94obj-$(CONFIG_BOOTX_TEXT) += btext.o 94obj-$(CONFIG_BOOTX_TEXT) += btext.o
95obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o 95obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o ppc_sys.o
96obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o 96obj-$(CONFIG_MPC10X_OPENPIC) += open_pic.o
97obj-$(CONFIG_40x) += dcr.o 97obj-$(CONFIG_40x) += dcr.o
98obj-$(CONFIG_BOOKE) += dcr.o 98obj-$(CONFIG_BOOKE) += dcr.o
99obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \ 99obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o \
100 ppc_sys.o mpc85xx_sys.o \ 100 ppc_sys.o i8259.o mpc85xx_sys.o \
101 mpc85xx_devices.o 101 mpc85xx_devices.o
102ifeq ($(CONFIG_85xx),y) 102ifeq ($(CONFIG_85xx),y)
103obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o 103obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o
@@ -107,6 +107,7 @@ obj-$(CONFIG_83xx) += ipic.o ppc83xx_setup.o ppc_sys.o \
107ifeq ($(CONFIG_83xx),y) 107ifeq ($(CONFIG_83xx),y)
108obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o 108obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o
109endif 109endif
110obj-$(CONFIG_MPC8548_CDS) += todc_time.o
110obj-$(CONFIG_MPC8555_CDS) += todc_time.o 111obj-$(CONFIG_MPC8555_CDS) += todc_time.o
111obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o \ 112obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o \
112 mpc52xx_sys.o mpc52xx_devices.o ppc_sys.o 113 mpc52xx_sys.o mpc52xx_devices.o ppc_sys.o
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c
index ea5e77080e..4c19a4ac71 100644
--- a/arch/ppc/syslib/cpm2_common.c
+++ b/arch/ppc/syslib/cpm2_common.c
@@ -21,8 +21,8 @@
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/bootmem.h>
25#include <linux/module.h> 24#include <linux/module.h>
25#include <asm/io.h>
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/mpc8260.h> 27#include <asm/mpc8260.h>
28#include <asm/page.h> 28#include <asm/page.h>
diff --git a/arch/ppc/syslib/indirect_pci.c b/arch/ppc/syslib/indirect_pci.c
index a5a752609e..e714884697 100644
--- a/arch/ppc/syslib/indirect_pci.c
+++ b/arch/ppc/syslib/indirect_pci.c
@@ -14,7 +14,6 @@
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/bootmem.h>
18 17
19#include <asm/io.h> 18#include <asm/io.h>
20#include <asm/prom.h> 19#include <asm/prom.h>
diff --git a/arch/ppc/syslib/ipic.c b/arch/ppc/syslib/ipic.c
index 580ed658e8..8f01e0f1d8 100644
--- a/arch/ppc/syslib/ipic.c
+++ b/arch/ppc/syslib/ipic.c
@@ -79,7 +79,7 @@ static struct ipic_info ipic_info[] = {
79 .prio_mask = 7, 79 .prio_mask = 7,
80 }, 80 },
81 [17] = { 81 [17] = {
82 .pend = IPIC_SIPNR_H, 82 .pend = IPIC_SEPNR,
83 .mask = IPIC_SEMSR, 83 .mask = IPIC_SEMSR,
84 .prio = IPIC_SMPRR_A, 84 .prio = IPIC_SMPRR_A,
85 .force = IPIC_SEFCR, 85 .force = IPIC_SEFCR,
@@ -87,7 +87,7 @@ static struct ipic_info ipic_info[] = {
87 .prio_mask = 5, 87 .prio_mask = 5,
88 }, 88 },
89 [18] = { 89 [18] = {
90 .pend = IPIC_SIPNR_H, 90 .pend = IPIC_SEPNR,
91 .mask = IPIC_SEMSR, 91 .mask = IPIC_SEMSR,
92 .prio = IPIC_SMPRR_A, 92 .prio = IPIC_SMPRR_A,
93 .force = IPIC_SEFCR, 93 .force = IPIC_SEFCR,
@@ -95,7 +95,7 @@ static struct ipic_info ipic_info[] = {
95 .prio_mask = 6, 95 .prio_mask = 6,
96 }, 96 },
97 [19] = { 97 [19] = {
98 .pend = IPIC_SIPNR_H, 98 .pend = IPIC_SEPNR,
99 .mask = IPIC_SEMSR, 99 .mask = IPIC_SEMSR,
100 .prio = IPIC_SMPRR_A, 100 .prio = IPIC_SMPRR_A,
101 .force = IPIC_SEFCR, 101 .force = IPIC_SEFCR,
@@ -103,7 +103,7 @@ static struct ipic_info ipic_info[] = {
103 .prio_mask = 7, 103 .prio_mask = 7,
104 }, 104 },
105 [20] = { 105 [20] = {
106 .pend = IPIC_SIPNR_H, 106 .pend = IPIC_SEPNR,
107 .mask = IPIC_SEMSR, 107 .mask = IPIC_SEMSR,
108 .prio = IPIC_SMPRR_B, 108 .prio = IPIC_SMPRR_B,
109 .force = IPIC_SEFCR, 109 .force = IPIC_SEFCR,
@@ -111,7 +111,7 @@ static struct ipic_info ipic_info[] = {
111 .prio_mask = 4, 111 .prio_mask = 4,
112 }, 112 },
113 [21] = { 113 [21] = {
114 .pend = IPIC_SIPNR_H, 114 .pend = IPIC_SEPNR,
115 .mask = IPIC_SEMSR, 115 .mask = IPIC_SEMSR,
116 .prio = IPIC_SMPRR_B, 116 .prio = IPIC_SMPRR_B,
117 .force = IPIC_SEFCR, 117 .force = IPIC_SEFCR,
@@ -119,7 +119,7 @@ static struct ipic_info ipic_info[] = {
119 .prio_mask = 5, 119 .prio_mask = 5,
120 }, 120 },
121 [22] = { 121 [22] = {
122 .pend = IPIC_SIPNR_H, 122 .pend = IPIC_SEPNR,
123 .mask = IPIC_SEMSR, 123 .mask = IPIC_SEMSR,
124 .prio = IPIC_SMPRR_B, 124 .prio = IPIC_SMPRR_B,
125 .force = IPIC_SEFCR, 125 .force = IPIC_SEFCR,
@@ -127,7 +127,7 @@ static struct ipic_info ipic_info[] = {
127 .prio_mask = 6, 127 .prio_mask = 6,
128 }, 128 },
129 [23] = { 129 [23] = {
130 .pend = IPIC_SIPNR_H, 130 .pend = IPIC_SEPNR,
131 .mask = IPIC_SEMSR, 131 .mask = IPIC_SEMSR,
132 .prio = IPIC_SMPRR_B, 132 .prio = IPIC_SMPRR_B,
133 .force = IPIC_SEFCR, 133 .force = IPIC_SEFCR,
diff --git a/arch/ppc/syslib/m8260_pci.c b/arch/ppc/syslib/m8260_pci.c
deleted file mode 100644
index 057cc3f8ff..0000000000
--- a/arch/ppc/syslib/m8260_pci.c
+++ /dev/null
@@ -1,193 +0,0 @@
1/*
2 * (C) Copyright 2003
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
5 * (C) Copyright 2004 Red Hat, Inc.
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
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#include <linux/kernel.h>
27#include <linux/init.h>
28#include <linux/pci.h>
29#include <linux/slab.h>
30#include <linux/delay.h>
31
32#include <asm/byteorder.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/uaccess.h>
36#include <asm/machdep.h>
37#include <asm/pci-bridge.h>
38#include <asm/immap_cpm2.h>
39#include <asm/mpc8260.h>
40
41#include "m8260_pci.h"
42
43
44/* PCI bus configuration registers.
45 */
46
47static void __init m8260_setup_pci(struct pci_controller *hose)
48{
49 volatile cpm2_map_t *immap = cpm2_immr;
50 unsigned long pocmr;
51 u16 tempShort;
52
53#ifndef CONFIG_ATC /* already done in U-Boot */
54 /*
55 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
56 * and local bus for PCI (SIUMCR [LBPC]).
57 */
58 immap->im_siu_conf.siu_82xx.sc_siumcr = 0x00640000;
59#endif
60
61 /* Make PCI lowest priority */
62 /* Each 4 bits is a device bus request and the MS 4bits
63 is highest priority */
64 /* Bus 4bit value
65 --- ----------
66 CPM high 0b0000
67 CPM middle 0b0001
68 CPM low 0b0010
69 PCI reguest 0b0011
70 Reserved 0b0100
71 Reserved 0b0101
72 Internal Core 0b0110
73 External Master 1 0b0111
74 External Master 2 0b1000
75 External Master 3 0b1001
76 The rest are reserved */
77 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;
78
79 /* Park bus on core while modifying PCI Bus accesses */
80 immap->im_siu_conf.siu_82xx.sc_ppc_acr = 0x6;
81
82 /*
83 * Set up master window that allows the CPU to access PCI space. This
84 * window is set up using the first SIU PCIBR registers.
85 */
86 immap->im_memctl.memc_pcimsk0 = MPC826x_PCI_MASK;
87 immap->im_memctl.memc_pcibr0 = MPC826x_PCI_BASE | PCIBR_ENABLE;
88
89 /* Disable machine check on no response or target abort */
90 immap->im_pci.pci_emr = cpu_to_le32(0x1fe7);
91 /* Release PCI RST (by default the PCI RST signal is held low) */
92 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
93
94 /* give it some time */
95 mdelay(1);
96
97 /*
98 * Set up master window that allows the CPU to access PCI Memory (prefetch)
99 * space. This window is set up using the first set of Outbound ATU registers.
100 */
101 immap->im_pci.pci_potar0 = cpu_to_le32(MPC826x_PCI_LOWER_MEM >> 12);
102 immap->im_pci.pci_pobar0 = cpu_to_le32((MPC826x_PCI_LOWER_MEM - MPC826x_PCI_MEM_OFFSET) >> 12);
103 pocmr = ((MPC826x_PCI_UPPER_MEM - MPC826x_PCI_LOWER_MEM) >> 12) ^ 0xfffff;
104 immap->im_pci.pci_pocmr0 = cpu_to_le32(pocmr | POCMR_ENABLE | POCMR_PREFETCH_EN);
105
106 /*
107 * Set up master window that allows the CPU to access PCI Memory (non-prefetch)
108 * space. This window is set up using the second set of Outbound ATU registers.
109 */
110 immap->im_pci.pci_potar1 = cpu_to_le32(MPC826x_PCI_LOWER_MMIO >> 12);
111 immap->im_pci.pci_pobar1 = cpu_to_le32((MPC826x_PCI_LOWER_MMIO - MPC826x_PCI_MMIO_OFFSET) >> 12);
112 pocmr = ((MPC826x_PCI_UPPER_MMIO - MPC826x_PCI_LOWER_MMIO) >> 12) ^ 0xfffff;
113 immap->im_pci.pci_pocmr1 = cpu_to_le32(pocmr | POCMR_ENABLE);
114
115 /*
116 * Set up master window that allows the CPU to access PCI IO space. This window
117 * is set up using the third set of Outbound ATU registers.
118 */
119 immap->im_pci.pci_potar2 = cpu_to_le32(MPC826x_PCI_IO_BASE >> 12);
120 immap->im_pci.pci_pobar2 = cpu_to_le32(MPC826x_PCI_LOWER_IO >> 12);
121 pocmr = ((MPC826x_PCI_UPPER_IO - MPC826x_PCI_LOWER_IO) >> 12) ^ 0xfffff;
122 immap->im_pci.pci_pocmr2 = cpu_to_le32(pocmr | POCMR_ENABLE | POCMR_PCI_IO);
123
124 /*
125 * Set up slave window that allows PCI masters to access MPC826x local memory.
126 * This window is set up using the first set of Inbound ATU registers
127 */
128
129 immap->im_pci.pci_pitar0 = cpu_to_le32(MPC826x_PCI_SLAVE_MEM_LOCAL >> 12);
130 immap->im_pci.pci_pibar0 = cpu_to_le32(MPC826x_PCI_SLAVE_MEM_BUS >> 12);
131 pocmr = ((MPC826x_PCI_SLAVE_MEM_SIZE-1) >> 12) ^ 0xfffff;
132 immap->im_pci.pci_picmr0 = cpu_to_le32(pocmr | PICMR_ENABLE | PICMR_PREFETCH_EN);
133
134 /* See above for description - puts PCI request as highest priority */
135 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x03124567;
136
137 /* Park the bus on the PCI */
138 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
139
140 /* Host mode - specify the bridge as a host-PCI bridge */
141 early_write_config_word(hose, 0, 0, PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_HOST);
142
143 /* Enable the host bridge to be a master on the PCI bus, and to act as a PCI memory target */
144 early_read_config_word(hose, 0, 0, PCI_COMMAND, &tempShort);
145 early_write_config_word(hose, 0, 0, PCI_COMMAND,
146 tempShort | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
147}
148
149void __init m8260_find_bridges(void)
150{
151 extern int pci_assign_all_busses;
152 struct pci_controller * hose;
153
154 pci_assign_all_busses = 1;
155
156 hose = pcibios_alloc_controller();
157
158 if (!hose)
159 return;
160
161 ppc_md.pci_swizzle = common_swizzle;
162
163 hose->first_busno = 0;
164 hose->bus_offset = 0;
165 hose->last_busno = 0xff;
166
167 setup_m8260_indirect_pci(hose,
168 (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,
169 (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);
170
171 m8260_setup_pci(hose);
172 hose->pci_mem_offset = MPC826x_PCI_MEM_OFFSET;
173
174 hose->io_base_virt = ioremap(MPC826x_PCI_IO_BASE,
175 MPC826x_PCI_IO_SIZE);
176 isa_io_base = (unsigned long) hose->io_base_virt;
177
178 /* setup resources */
179 pci_init_resource(&hose->mem_resources[0],
180 MPC826x_PCI_LOWER_MEM,
181 MPC826x_PCI_UPPER_MEM,
182 IORESOURCE_MEM|IORESOURCE_PREFETCH, "PCI prefetchable memory");
183
184 pci_init_resource(&hose->mem_resources[1],
185 MPC826x_PCI_LOWER_MMIO,
186 MPC826x_PCI_UPPER_MMIO,
187 IORESOURCE_MEM, "PCI memory");
188
189 pci_init_resource(&hose->io_resource,
190 MPC826x_PCI_LOWER_IO,
191 MPC826x_PCI_UPPER_IO,
192 IORESOURCE_IO, "PCI I/O");
193}
diff --git a/arch/ppc/syslib/m8260_pci.h b/arch/ppc/syslib/m8260_pci.h
deleted file mode 100644
index d1352120ac..0000000000
--- a/arch/ppc/syslib/m8260_pci.h
+++ /dev/null
@@ -1,76 +0,0 @@
1
2#ifndef _PPC_KERNEL_M8260_PCI_H
3#define _PPC_KERNEL_M8260_PCI_H
4
5#include <asm/m8260_pci.h>
6
7/*
8 * Local->PCI map (from CPU) controlled by
9 * MPC826x master window
10 *
11 * 0x80000000 - 0xBFFFFFFF Total CPU2PCI space PCIBR0
12 *
13 * 0x80000000 - 0x9FFFFFFF PCI Mem with prefetch (Outbound ATU #1)
14 * 0xA0000000 - 0xAFFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)
15 * 0xB0000000 - 0xB0FFFFFF 32-bit PCI IO (Outbound ATU #3)
16 *
17 * PCI->Local map (from PCI)
18 * MPC826x slave window controlled by
19 *
20 * 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)
21 */
22
23/*
24 * Slave window that allows PCI masters to access MPC826x local memory.
25 * This window is set up using the first set of Inbound ATU registers
26 */
27
28#ifndef MPC826x_PCI_SLAVE_MEM_LOCAL
29#define MPC826x_PCI_SLAVE_MEM_LOCAL (((struct bd_info *)__res)->bi_memstart)
30#define MPC826x_PCI_SLAVE_MEM_BUS (((struct bd_info *)__res)->bi_memstart)
31#define MPC826x_PCI_SLAVE_MEM_SIZE (((struct bd_info *)__res)->bi_memsize)
32#endif
33
34/*
35 * This is the window that allows the CPU to access PCI address space.
36 * It will be setup with the SIU PCIBR0 register. All three PCI master
37 * windows, which allow the CPU to access PCI prefetch, non prefetch,
38 * and IO space (see below), must all fit within this window.
39 */
40#ifndef MPC826x_PCI_BASE
41#define MPC826x_PCI_BASE 0x80000000
42#define MPC826x_PCI_MASK 0xc0000000
43#endif
44
45#ifndef MPC826x_PCI_LOWER_MEM
46#define MPC826x_PCI_LOWER_MEM 0x80000000
47#define MPC826x_PCI_UPPER_MEM 0x9fffffff
48#define MPC826x_PCI_MEM_OFFSET 0x00000000
49#endif
50
51#ifndef MPC826x_PCI_LOWER_MMIO
52#define MPC826x_PCI_LOWER_MMIO 0xa0000000
53#define MPC826x_PCI_UPPER_MMIO 0xafffffff
54#define MPC826x_PCI_MMIO_OFFSET 0x00000000
55#endif
56
57#ifndef MPC826x_PCI_LOWER_IO
58#define MPC826x_PCI_LOWER_IO 0x00000000
59#define MPC826x_PCI_UPPER_IO 0x00ffffff
60#define MPC826x_PCI_IO_BASE 0xb0000000
61#define MPC826x_PCI_IO_SIZE 0x01000000
62#endif
63
64#ifndef _IO_BASE
65#define _IO_BASE isa_io_base
66#endif
67
68#ifdef CONFIG_8260_PCI9
69struct pci_controller;
70extern void setup_m8260_indirect_pci(struct pci_controller* hose,
71 u32 cfg_addr, u32 cfg_data);
72#else
73#define setup_m8260_indirect_pci setup_indirect_pci
74#endif
75
76#endif /* _PPC_KERNEL_M8260_PCI_H */
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index 9c0582d639..1dc7e4e1d4 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -31,7 +31,7 @@
31#include <asm/immap_cpm2.h> 31#include <asm/immap_cpm2.h>
32#include <asm/cpm2.h> 32#include <asm/cpm2.h>
33 33
34#include "m8260_pci.h" 34#include "m82xx_pci.h"
35 35
36#ifdef CONFIG_8260_PCI9 36#ifdef CONFIG_8260_PCI9
37/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */ 37/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */
@@ -248,11 +248,11 @@ EXPORT_SYMBOL(idma_pci9_read_le);
248 248
249static inline int is_pci_mem(unsigned long addr) 249static inline int is_pci_mem(unsigned long addr)
250{ 250{
251 if (addr >= MPC826x_PCI_LOWER_MMIO && 251 if (addr >= M82xx_PCI_LOWER_MMIO &&
252 addr <= MPC826x_PCI_UPPER_MMIO) 252 addr <= M82xx_PCI_UPPER_MMIO)
253 return 1; 253 return 1;
254 if (addr >= MPC826x_PCI_LOWER_MEM && 254 if (addr >= M82xx_PCI_LOWER_MEM &&
255 addr <= MPC826x_PCI_UPPER_MEM) 255 addr <= M82xx_PCI_UPPER_MEM)
256 return 1; 256 return 1;
257 return 0; 257 return 0;
258} 258}
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
index 23ea3f694d..fda75d7905 100644
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -34,7 +34,8 @@
34unsigned char __res[sizeof(bd_t)]; 34unsigned char __res[sizeof(bd_t)];
35 35
36extern void cpm2_reset(void); 36extern void cpm2_reset(void);
37extern void m8260_find_bridges(void); 37extern void pq2_find_bridges(void);
38extern void pq2pci_init_irq(void);
38extern void idma_pci9_init(void); 39extern void idma_pci9_init(void);
39 40
40/* Place-holder for board-specific init */ 41/* Place-holder for board-specific init */
@@ -56,7 +57,7 @@ m8260_setup_arch(void)
56 idma_pci9_init(); 57 idma_pci9_init();
57#endif 58#endif
58#ifdef CONFIG_PCI_8260 59#ifdef CONFIG_PCI_8260
59 m8260_find_bridges(); 60 pq2_find_bridges();
60#endif 61#endif
61#ifdef CONFIG_BLK_DEV_INITRD 62#ifdef CONFIG_BLK_DEV_INITRD
62 if (initrd_start) 63 if (initrd_start)
@@ -173,6 +174,12 @@ m8260_init_IRQ(void)
173 * in case the boot rom changed something on us. 174 * in case the boot rom changed something on us.
174 */ 175 */
175 cpm2_immr->im_intctl.ic_siprr = 0x05309770; 176 cpm2_immr->im_intctl.ic_siprr = 0x05309770;
177
178#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS))
179 /* Initialize stuff for the 82xx CPLD IC and install demux */
180 pq2pci_init_irq();
181#endif
182
176} 183}
177 184
178/* 185/*
diff --git a/arch/ppc/syslib/m82xx_pci.c b/arch/ppc/syslib/m82xx_pci.c
new file mode 100644
index 0000000000..5e7a7edcea
--- /dev/null
+++ b/arch/ppc/syslib/m82xx_pci.c
@@ -0,0 +1,383 @@
1/*
2 *
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
6 * (C) Copyright 2004 Red Hat, Inc.
7 *
8 * 2005 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * See file CREDITS for list of people who contributed to this
12 * project.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 */
29
30#include <linux/kernel.h>
31#include <linux/init.h>
32#include <linux/pci.h>
33#include <linux/slab.h>
34#include <linux/delay.h>
35#include <linux/irq.h>
36#include <linux/interrupt.h>
37
38#include <asm/byteorder.h>
39#include <asm/io.h>
40#include <asm/irq.h>
41#include <asm/uaccess.h>
42#include <asm/machdep.h>
43#include <asm/pci-bridge.h>
44#include <asm/immap_cpm2.h>
45#include <asm/mpc8260.h>
46#include <asm/cpm2.h>
47
48#include "m82xx_pci.h"
49
50/*
51 * Interrupt routing
52 */
53
54static inline int
55pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
56{
57 static char pci_irq_table[][4] =
58 /*
59 * PCI IDSEL/INTPIN->INTLINE
60 * A B C D
61 */
62 {
63 { PIRQA, PIRQB, PIRQC, PIRQD }, /* IDSEL 22 - PCI slot 0 */
64 { PIRQD, PIRQA, PIRQB, PIRQC }, /* IDSEL 23 - PCI slot 1 */
65 { PIRQC, PIRQD, PIRQA, PIRQB }, /* IDSEL 24 - PCI slot 2 */
66 };
67
68 const long min_idsel = 22, max_idsel = 24, irqs_per_slot = 4;
69 return PCI_IRQ_TABLE_LOOKUP;
70}
71
72static void
73pq2pci_mask_irq(unsigned int irq)
74{
75 int bit = irq - NR_CPM_INTS;
76
77 *(volatile unsigned long *) PCI_INT_MASK_REG |= (1 << (31 - bit));
78 return;
79}
80
81static void
82pq2pci_unmask_irq(unsigned int irq)
83{
84 int bit = irq - NR_CPM_INTS;
85
86 *(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
87 return;
88}
89
90static void
91pq2pci_mask_and_ack(unsigned int irq)
92{
93 int bit = irq - NR_CPM_INTS;
94
95 *(volatile unsigned long *) PCI_INT_MASK_REG |= (1 << (31 - bit));
96 return;
97}
98
99static void
100pq2pci_end_irq(unsigned int irq)
101{
102 int bit = irq - NR_CPM_INTS;
103
104 *(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
105 return;
106}
107
108struct hw_interrupt_type pq2pci_ic = {
109 "PQ2 PCI",
110 NULL,
111 NULL,
112 pq2pci_unmask_irq,
113 pq2pci_mask_irq,
114 pq2pci_mask_and_ack,
115 pq2pci_end_irq,
116 0
117};
118
119static irqreturn_t
120pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs)
121{
122 unsigned long stat, mask, pend;
123 int bit;
124
125 for(;;) {
126 stat = *(volatile unsigned long *) PCI_INT_STAT_REG;
127 mask = *(volatile unsigned long *) PCI_INT_MASK_REG;
128 pend = stat & ~mask & 0xf0000000;
129 if (!pend)
130 break;
131 for (bit = 0; pend != 0; ++bit, pend <<= 1) {
132 if (pend & 0x80000000)
133 __do_IRQ(NR_CPM_INTS + bit, regs);
134 }
135 }
136
137 return IRQ_HANDLED;
138}
139
140static struct irqaction pq2pci_irqaction = {
141 .handler = pq2pci_irq_demux,
142 .flags = SA_INTERRUPT,
143 .mask = CPU_MASK_NONE,
144 .name = "PQ2 PCI cascade",
145};
146
147
148void
149pq2pci_init_irq(void)
150{
151 int irq;
152 volatile cpm2_map_t *immap = cpm2_immr;
153#if defined CONFIG_ADS8272
154 /* configure chip select for PCI interrupt controller */
155 immap->im_memctl.memc_br3 = PCI_INT_STAT_REG | 0x00001801;
156 immap->im_memctl.memc_or3 = 0xffff8010;
157#elif defined CONFIG_PQ2FADS
158 immap->im_memctl.memc_br8 = PCI_INT_STAT_REG | 0x00001801;
159 immap->im_memctl.memc_or8 = 0xffff8010;
160#endif
161 for (irq = NR_CPM_INTS; irq < NR_CPM_INTS + 4; irq++)
162 irq_desc[irq].handler = &pq2pci_ic;
163
164 /* make PCI IRQ level sensitive */
165 immap->im_intctl.ic_siexr &=
166 ~(1 << (14 - (PCI_INT_TO_SIU - SIU_INT_IRQ1)));
167
168 /* mask all PCI interrupts */
169 *(volatile unsigned long *) PCI_INT_MASK_REG |= 0xfff00000;
170
171 /* install the demultiplexer for the PCI cascade interrupt */
172 setup_irq(PCI_INT_TO_SIU, &pq2pci_irqaction);
173 return;
174}
175
176static int
177pq2pci_exclude_device(u_char bus, u_char devfn)
178{
179 return PCIBIOS_SUCCESSFUL;
180}
181
182/* PCI bus configuration registers.
183 */
184static void
185pq2ads_setup_pci(struct pci_controller *hose)
186{
187 __u32 val;
188 volatile cpm2_map_t *immap = cpm2_immr;
189 bd_t* binfo = (bd_t*) __res;
190 u32 sccr = immap->im_clkrst.car_sccr;
191 uint pci_div,freq,time;
192 /* PCI int lowest prio */
193 /* Each 4 bits is a device bus request and the MS 4bits
194 is highest priority */
195 /* Bus 4bit value
196 --- ----------
197 CPM high 0b0000
198 CPM middle 0b0001
199 CPM low 0b0010
200 PCI reguest 0b0011
201 Reserved 0b0100
202 Reserved 0b0101
203 Internal Core 0b0110
204 External Master 1 0b0111
205 External Master 2 0b1000
206 External Master 3 0b1001
207 The rest are reserved
208 */
209 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;
210 /* park bus on core */
211 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_CORE;
212 /*
213 * Set up master windows that allow the CPU to access PCI space. These
214 * windows are set up using the two SIU PCIBR registers.
215 */
216
217 immap->im_memctl.memc_pcimsk0 = M82xx_PCI_PRIM_WND_SIZE;
218 immap->im_memctl.memc_pcibr0 = M82xx_PCI_PRIM_WND_BASE | PCIBR_ENABLE;
219
220#ifdef M82xx_PCI_SEC_WND_SIZE
221 immap->im_memctl.memc_pcimsk1 = M82xx_PCI_SEC_WND_SIZE;
222 immap->im_memctl.memc_pcibr1 = M82xx_PCI_SEC_WND_BASE | PCIBR_ENABLE;
223#endif
224
225#if defined CONFIG_ADS8272
226 immap->im_siu_conf.siu_82xx.sc_siumcr =
227 (immap->im_siu_conf.siu_82xx.sc_siumcr &
228 ~(SIUMCR_BBD | SIUMCR_ESE | SIUMCR_PBSE |
229 SIUMCR_CDIS | SIUMCR_DPPC11 | SIUMCR_L2CPC11 |
230 SIUMCR_LBPC11 | SIUMCR_APPC11 |
231 SIUMCR_CS10PC11 | SIUMCR_BCTLC11 | SIUMCR_MMR11)) |
232 SIUMCR_DPPC11 | SIUMCR_L2CPC01 | SIUMCR_LBPC00 |
233 SIUMCR_APPC10 | SIUMCR_CS10PC00 |
234 SIUMCR_BCTLC00 | SIUMCR_MMR11 ;
235
236#elif defined CONFIG_PQ2FADS
237 /*
238 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
239 * and local bus for PCI (SIUMCR [LBPC]).
240 */
241 immap->im_siu_conf.siu_82xx.sc_siumcr = (immap->im_siu_conf.sc_siumcr &
242 ~(SIUMCR_L2PC11 | SIUMCR_LBPC11 | SIUMCR_CS10PC11 | SIUMCR_APPC11) |
243 SIUMCR_BBD | SIUMCR_LBPC01 | SIUMCR_DPPC11 | SIUMCR_APPC10;
244#endif
245 /* Enable PCI */
246 immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
247
248 pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
249 ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
250 freq = (uint)((2*binfo->bi_cpmfreq)/(pci_div));
251 time = (int)666666/freq;
252 /* due to PCI Local Bus spec, some devices needs to wait such a long
253 time after RST deassertion. More specifically, 0.508s for 66MHz & twice more for 33 */
254 printk("%s: The PCI bus is %d Mhz.\nWaiting %s after deasserting RST...\n",__FILE__,freq,
255 (time==1) ? "0.5 seconds":"1 second" );
256
257 {
258 int i;
259 for(i=0;i<(500*time);i++)
260 udelay(1000);
261 }
262
263 /* setup ATU registers */
264 immap->im_pci.pci_pocmr0 = cpu_to_le32(POCMR_ENABLE | POCMR_PCI_IO |
265 ((~(M82xx_PCI_IO_SIZE - 1U)) >> POTA_ADDR_SHIFT));
266 immap->im_pci.pci_potar0 = cpu_to_le32(M82xx_PCI_LOWER_IO >> POTA_ADDR_SHIFT);
267 immap->im_pci.pci_pobar0 = cpu_to_le32(M82xx_PCI_IO_BASE >> POTA_ADDR_SHIFT);
268
269 /* Set-up non-prefetchable window */
270 immap->im_pci.pci_pocmr1 = cpu_to_le32(POCMR_ENABLE | ((~(M82xx_PCI_MMIO_SIZE-1U)) >> POTA_ADDR_SHIFT));
271 immap->im_pci.pci_potar1 = cpu_to_le32(M82xx_PCI_LOWER_MMIO >> POTA_ADDR_SHIFT);
272 immap->im_pci.pci_pobar1 = cpu_to_le32((M82xx_PCI_LOWER_MMIO - M82xx_PCI_MMIO_OFFSET) >> POTA_ADDR_SHIFT);
273
274 /* Set-up prefetchable window */
275 immap->im_pci.pci_pocmr2 = cpu_to_le32(POCMR_ENABLE |POCMR_PREFETCH_EN |
276 (~(M82xx_PCI_MEM_SIZE-1U) >> POTA_ADDR_SHIFT));
277 immap->im_pci.pci_potar2 = cpu_to_le32(M82xx_PCI_LOWER_MEM >> POTA_ADDR_SHIFT);
278 immap->im_pci.pci_pobar2 = cpu_to_le32((M82xx_PCI_LOWER_MEM - M82xx_PCI_MEM_OFFSET) >> POTA_ADDR_SHIFT);
279
280 /* Inbound transactions from PCI memory space */
281 immap->im_pci.pci_picmr0 = cpu_to_le32(PICMR_ENABLE | PICMR_PREFETCH_EN |
282 ((~(M82xx_PCI_SLAVE_MEM_SIZE-1U)) >> PITA_ADDR_SHIFT));
283 immap->im_pci.pci_pibar0 = cpu_to_le32(M82xx_PCI_SLAVE_MEM_BUS >> PITA_ADDR_SHIFT);
284 immap->im_pci.pci_pitar0 = cpu_to_le32(M82xx_PCI_SLAVE_MEM_LOCAL>> PITA_ADDR_SHIFT);
285
286#if defined CONFIG_ADS8272
287 /* PCI int highest prio */
288 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x01236745;
289#elif defined CONFIG_PQ2FADS
290 immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x03124567;
291#endif
292 /* park bus on PCI */
293 immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
294
295 /* Enable bus mastering and inbound memory transactions */
296 early_read_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, &val);
297 val &= 0xffff0000;
298 val |= PCI_COMMAND_MEMORY|PCI_COMMAND_MASTER;
299 early_write_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, val);
300
301}
302
303void __init pq2_find_bridges(void)
304{
305 extern int pci_assign_all_busses;
306 struct pci_controller * hose;
307 int host_bridge;
308
309 pci_assign_all_busses = 1;
310
311 hose = pcibios_alloc_controller();
312
313 if (!hose)
314 return;
315
316 ppc_md.pci_swizzle = common_swizzle;
317
318 hose->first_busno = 0;
319 hose->bus_offset = 0;
320 hose->last_busno = 0xff;
321
322#ifdef CONFIG_ADS8272
323 hose->set_cfg_type = 1;
324#endif
325
326 setup_m8260_indirect_pci(hose,
327 (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,
328 (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);
329
330 /* Make sure it is a supported bridge */
331 early_read_config_dword(hose,
332 0,
333 PCI_DEVFN(0,0),
334 PCI_VENDOR_ID,
335 &host_bridge);
336 switch (host_bridge) {
337 case PCI_DEVICE_ID_MPC8265:
338 break;
339 case PCI_DEVICE_ID_MPC8272:
340 break;
341 default:
342 printk("Attempting to use unrecognized host bridge ID"
343 " 0x%08x.\n", host_bridge);
344 break;
345 }
346
347 pq2ads_setup_pci(hose);
348
349 hose->io_space.start = M82xx_PCI_LOWER_IO;
350 hose->io_space.end = M82xx_PCI_UPPER_IO;
351 hose->mem_space.start = M82xx_PCI_LOWER_MEM;
352 hose->mem_space.end = M82xx_PCI_UPPER_MMIO;
353 hose->pci_mem_offset = M82xx_PCI_MEM_OFFSET;
354
355 isa_io_base =
356 (unsigned long) ioremap(M82xx_PCI_IO_BASE,
357 M82xx_PCI_IO_SIZE);
358 hose->io_base_virt = (void *) isa_io_base;
359
360 /* setup resources */
361 pci_init_resource(&hose->mem_resources[0],
362 M82xx_PCI_LOWER_MEM,
363 M82xx_PCI_UPPER_MEM,
364 IORESOURCE_MEM|IORESOURCE_PREFETCH, "PCI prefetchable memory");
365
366 pci_init_resource(&hose->mem_resources[1],
367 M82xx_PCI_LOWER_MMIO,
368 M82xx_PCI_UPPER_MMIO,
369 IORESOURCE_MEM, "PCI memory");
370
371 pci_init_resource(&hose->io_resource,
372 M82xx_PCI_LOWER_IO,
373 M82xx_PCI_UPPER_IO,
374 IORESOURCE_IO | 1, "PCI I/O");
375
376 ppc_md.pci_exclude_device = pq2pci_exclude_device;
377 hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
378
379 ppc_md.pci_map_irq = pq2pci_map_irq;
380 ppc_md.pcibios_fixup = NULL;
381 ppc_md.pcibios_fixup_bus = NULL;
382
383}
diff --git a/arch/ppc/syslib/m82xx_pci.h b/arch/ppc/syslib/m82xx_pci.h
new file mode 100644
index 0000000000..924f73f8e5
--- /dev/null
+++ b/arch/ppc/syslib/m82xx_pci.h
@@ -0,0 +1,92 @@
1
2#ifndef _PPC_KERNEL_M82XX_PCI_H
3#define _PPC_KERNEL_M82XX_PCI_H
4
5#include <asm/m8260_pci.h>
6/*
7 * Local->PCI map (from CPU) controlled by
8 * MPC826x master window
9 *
10 * 0xF6000000 - 0xF7FFFFFF IO space
11 * 0x80000000 - 0xBFFFFFFF CPU2PCI memory space PCIBR0
12 *
13 * 0x80000000 - 0x9FFFFFFF PCI Mem with prefetch (Outbound ATU #1)
14 * 0xA0000000 - 0xBFFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)
15 * 0xF6000000 - 0xF7FFFFFF 32-bit PCI IO (Outbound ATU #3)
16 *
17 * PCI->Local map (from PCI)
18 * MPC826x slave window controlled by
19 *
20 * 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)
21 */
22
23/*
24 * Slave window that allows PCI masters to access MPC826x local memory.
25 * This window is set up using the first set of Inbound ATU registers
26 */
27
28#ifndef M82xx_PCI_SLAVE_MEM_LOCAL
29#define M82xx_PCI_SLAVE_MEM_LOCAL (((struct bd_info *)__res)->bi_memstart)
30#define M82xx_PCI_SLAVE_MEM_BUS (((struct bd_info *)__res)->bi_memstart)
31#define M82xx_PCI_SLAVE_MEM_SIZE (((struct bd_info *)__res)->bi_memsize)
32#endif
33
34/*
35 * This is the window that allows the CPU to access PCI address space.
36 * It will be setup with the SIU PCIBR0 register. All three PCI master
37 * windows, which allow the CPU to access PCI prefetch, non prefetch,
38 * and IO space (see below), must all fit within this window.
39 */
40
41#ifndef M82xx_PCI_LOWER_MEM
42#define M82xx_PCI_LOWER_MEM 0x80000000
43#define M82xx_PCI_UPPER_MEM 0x9fffffff
44#define M82xx_PCI_MEM_OFFSET 0x00000000
45#define M82xx_PCI_MEM_SIZE 0x20000000
46#endif
47
48#ifndef M82xx_PCI_LOWER_MMIO
49#define M82xx_PCI_LOWER_MMIO 0xa0000000
50#define M82xx_PCI_UPPER_MMIO 0xafffffff
51#define M82xx_PCI_MMIO_OFFSET 0x00000000
52#define M82xx_PCI_MMIO_SIZE 0x20000000
53#endif
54
55#ifndef M82xx_PCI_LOWER_IO
56#define M82xx_PCI_LOWER_IO 0x00000000
57#define M82xx_PCI_UPPER_IO 0x01ffffff
58#define M82xx_PCI_IO_BASE 0xf6000000
59#define M82xx_PCI_IO_SIZE 0x02000000
60#endif
61
62#ifndef M82xx_PCI_PRIM_WND_SIZE
63#define M82xx_PCI_PRIM_WND_SIZE ~(M82xx_PCI_IO_SIZE - 1U)
64#define M82xx_PCI_PRIM_WND_BASE (M82xx_PCI_IO_BASE)
65#endif
66
67#ifndef M82xx_PCI_SEC_WND_SIZE
68#define M82xx_PCI_SEC_WND_SIZE ~(M82xx_PCI_MEM_SIZE + M82xx_PCI_MMIO_SIZE - 1U)
69#define M82xx_PCI_SEC_WND_BASE (M82xx_PCI_LOWER_MEM)
70#endif
71
72#ifndef POTA_ADDR_SHIFT
73#define POTA_ADDR_SHIFT 12
74#endif
75
76#ifndef PITA_ADDR_SHIFT
77#define PITA_ADDR_SHIFT 12
78#endif
79
80#ifndef _IO_BASE
81#define _IO_BASE isa_io_base
82#endif
83
84#ifdef CONFIG_8260_PCI9
85struct pci_controller;
86extern void setup_m8260_indirect_pci(struct pci_controller* hose,
87 u32 cfg_addr, u32 cfg_data);
88#else
89#define setup_m8260_indirect_pci setup_indirect_pci
90#endif
91
92#endif /* _PPC_KERNEL_M8260_PCI_H */
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index fd93adfd46..8fc5f41545 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -21,6 +21,9 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/serial_8250.h>
25#include <linux/fsl_devices.h>
26#include <linux/device.h>
24 27
25#include <asm/byteorder.h> 28#include <asm/byteorder.h>
26#include <asm/io.h> 29#include <asm/io.h>
@@ -30,16 +33,7 @@
30#include <asm/pci-bridge.h> 33#include <asm/pci-bridge.h>
31#include <asm/open_pic.h> 34#include <asm/open_pic.h>
32#include <asm/mpc10x.h> 35#include <asm/mpc10x.h>
33#include <asm/ocp.h> 36#include <asm/ppc_sys.h>
34
35/* The OCP structure is fixed by code below, before OCP initialises.
36 paddr depends on where the board places the EUMB.
37 - fixed in mpc10x_bridge_init().
38 irq depends on two things:
39 > does the board use the EPIC at all? (PCORE does not).
40 > is the EPIC in serial or parallel mode?
41 - fixed in mpc10x_set_openpic().
42*/
43 37
44#ifdef CONFIG_MPC10X_OPENPIC 38#ifdef CONFIG_MPC10X_OPENPIC
45#ifdef CONFIG_EPIC_SERIAL_MODE 39#ifdef CONFIG_EPIC_SERIAL_MODE
@@ -50,35 +44,140 @@
50#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS) 44#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS)
51#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS) 45#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS)
52#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS) 46#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS)
47#define MPC10X_UART0_IRQ (EPIC_IRQ_BASE + 4 + NUM_8259_INTERRUPTS)
53#else 48#else
54#define MPC10X_I2C_IRQ OCP_IRQ_NA 49#define MPC10X_I2C_IRQ -1
55#define MPC10X_DMA0_IRQ OCP_IRQ_NA 50#define MPC10X_DMA0_IRQ -1
56#define MPC10X_DMA1_IRQ OCP_IRQ_NA 51#define MPC10X_DMA1_IRQ -1
52#define MPC10X_UART0_IRQ -1
57#endif 53#endif
58 54
59 55static struct fsl_i2c_platform_data mpc10x_i2c_pdata = {
60struct ocp_def core_ocp[] = { 56 .device_flags = 0,
61 { .vendor = OCP_VENDOR_INVALID
62 }
63}; 57};
64 58
65static struct ocp_fs_i2c_data mpc10x_i2c_data = { 59static struct plat_serial8250_port serial_platform_data[] = {
66 .flags = 0 60 [0] = {
61 .mapbase = 0x4500,
62 .iotype = UPIO_MEM,
63 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
64 },
65 [1] = {
66 .mapbase = 0x4600,
67 .iotype = UPIO_MEM,
68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
69 },
70 { },
67}; 71};
68static struct ocp_def mpc10x_i2c_ocp = { 72
69 .vendor = OCP_VENDOR_MOTOROLA, 73struct platform_device ppc_sys_platform_devices[] = {
70 .function = OCP_FUNC_IIC, 74 [MPC10X_IIC1] = {
71 .index = 0, 75 .name = "fsl-i2c",
72 .additions = &mpc10x_i2c_data 76 .id = 1,
77 .dev.platform_data = &mpc10x_i2c_pdata,
78 .num_resources = 2,
79 .resource = (struct resource[]) {
80 {
81 .start = MPC10X_EUMB_I2C_OFFSET,
82 .end = MPC10X_EUMB_I2C_OFFSET +
83 MPC10X_EUMB_I2C_SIZE - 1,
84 .flags = IORESOURCE_MEM,
85 },
86 {
87 .flags = IORESOURCE_IRQ
88 },
89 },
90 },
91 [MPC10X_DMA0] = {
92 .name = "fsl-dma",
93 .id = 0,
94 .num_resources = 2,
95 .resource = (struct resource[]) {
96 {
97 .start = MPC10X_EUMB_DMA_OFFSET + 0x10,
98 .end = MPC10X_EUMB_DMA_OFFSET + 0x1f,
99 .flags = IORESOURCE_MEM,
100 },
101 {
102 .flags = IORESOURCE_IRQ,
103 },
104 },
105 },
106 [MPC10X_DMA1] = {
107 .name = "fsl-dma",
108 .id = 1,
109 .num_resources = 2,
110 .resource = (struct resource[]) {
111 {
112 .start = MPC10X_EUMB_DMA_OFFSET + 0x20,
113 .end = MPC10X_EUMB_DMA_OFFSET + 0x2f,
114 .flags = IORESOURCE_MEM,
115 },
116 {
117 .flags = IORESOURCE_IRQ,
118 },
119 },
120 },
121 [MPC10X_DMA1] = {
122 .name = "fsl-dma",
123 .id = 1,
124 .num_resources = 2,
125 .resource = (struct resource[]) {
126 {
127 .start = MPC10X_EUMB_DMA_OFFSET + 0x20,
128 .end = MPC10X_EUMB_DMA_OFFSET + 0x2f,
129 .flags = IORESOURCE_MEM,
130 },
131 {
132 .flags = IORESOURCE_IRQ,
133 },
134 },
135 },
136 [MPC10X_DUART] = {
137 .name = "serial8250",
138 .id = 0,
139 .dev.platform_data = serial_platform_data,
140 },
73}; 141};
74 142
75static struct ocp_def mpc10x_dma_ocp[2] = { 143/* We use the PCI ID to match on */
76{ .vendor = OCP_VENDOR_MOTOROLA, 144struct ppc_sys_spec *cur_ppc_sys_spec;
77 .function = OCP_FUNC_DMA, 145struct ppc_sys_spec ppc_sys_specs[] = {
78 .index = 0 }, 146 {
79{ .vendor = OCP_VENDOR_MOTOROLA, 147 .ppc_sys_name = "8245",
80 .function = OCP_FUNC_DMA, 148 .mask = 0xFFFFFFFF,
81 .index = 1 } 149 .value = MPC10X_BRIDGE_8245,
150 .num_devices = 4,
151 .device_list = (enum ppc_sys_devices[])
152 {
153 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1, MPC10X_DUART,
154 },
155 },
156 {
157 .ppc_sys_name = "8240",
158 .mask = 0xFFFFFFFF,
159 .value = MPC10X_BRIDGE_8240,
160 .num_devices = 3,
161 .device_list = (enum ppc_sys_devices[])
162 {
163 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1,
164 },
165 },
166 {
167 .ppc_sys_name = "107",
168 .mask = 0xFFFFFFFF,
169 .value = MPC10X_BRIDGE_107,
170 .num_devices = 3,
171 .device_list = (enum ppc_sys_devices[])
172 {
173 MPC10X_IIC1, MPC10X_DMA0, MPC10X_DMA1,
174 },
175 },
176 { /* default match */
177 .ppc_sys_name = "",
178 .mask = 0x00000000,
179 .value = 0x00000000,
180 },
82}; 181};
83 182
84/* Set resources to match bridge memory map */ 183/* Set resources to match bridge memory map */
@@ -132,7 +231,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
132 uint new_map, 231 uint new_map,
133 uint phys_eumb_base) 232 uint phys_eumb_base)
134{ 233{
135 int host_bridge, picr1, picr1_bit; 234 int host_bridge, picr1, picr1_bit, i;
136 ulong pci_config_addr, pci_config_data; 235 ulong pci_config_addr, pci_config_data;
137 u_char pir, byte; 236 u_char pir, byte;
138 237
@@ -273,7 +372,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
273 printk("Host bridge in Agent mode\n"); 372 printk("Host bridge in Agent mode\n");
274 /* Read or Set LMBAR & PCSRBAR? */ 373 /* Read or Set LMBAR & PCSRBAR? */
275 } 374 }
276 375
277 /* Set base addr of the 8240/107 EUMB. */ 376 /* Set base addr of the 8240/107 EUMB. */
278 early_write_config_dword(hose, 377 early_write_config_dword(hose,
279 0, 378 0,
@@ -287,17 +386,6 @@ mpc10x_bridge_init(struct pci_controller *hose,
287 ioremap(phys_eumb_base + MPC10X_EUMB_EPIC_OFFSET, 386 ioremap(phys_eumb_base + MPC10X_EUMB_EPIC_OFFSET,
288 MPC10X_EUMB_EPIC_SIZE); 387 MPC10X_EUMB_EPIC_SIZE);
289#endif 388#endif
290 mpc10x_i2c_ocp.paddr = phys_eumb_base + MPC10X_EUMB_I2C_OFFSET;
291 mpc10x_i2c_ocp.irq = MPC10X_I2C_IRQ;
292 ocp_add_one_device(&mpc10x_i2c_ocp);
293 mpc10x_dma_ocp[0].paddr = phys_eumb_base +
294 MPC10X_EUMB_DMA_OFFSET + 0x100;
295 mpc10x_dma_ocp[0].irq = MPC10X_DMA0_IRQ;
296 ocp_add_one_device(&mpc10x_dma_ocp[0]);
297 mpc10x_dma_ocp[1].paddr = phys_eumb_base +
298 MPC10X_EUMB_DMA_OFFSET + 0x200;
299 mpc10x_dma_ocp[1].irq = MPC10X_DMA1_IRQ;
300 ocp_add_one_device(&mpc10x_dma_ocp[1]);
301 } 389 }
302 390
303#ifdef CONFIG_MPC10X_STORE_GATHERING 391#ifdef CONFIG_MPC10X_STORE_GATHERING
@@ -306,6 +394,29 @@ mpc10x_bridge_init(struct pci_controller *hose,
306 mpc10x_disable_store_gathering(hose); 394 mpc10x_disable_store_gathering(hose);
307#endif 395#endif
308 396
397 /* setup platform devices for MPC10x bridges */
398 identify_ppc_sys_by_id (host_bridge);
399
400 for (i = 0; i < cur_ppc_sys_spec->num_devices; i++) {
401 unsigned int dev_id = cur_ppc_sys_spec->device_list[i];
402 ppc_sys_fixup_mem_resource(&ppc_sys_platform_devices[dev_id],
403 phys_eumb_base);
404 }
405
406 /* IRQ's are determined at runtime */
407 ppc_sys_platform_devices[MPC10X_IIC1].resource[1].start = MPC10X_I2C_IRQ;
408 ppc_sys_platform_devices[MPC10X_IIC1].resource[1].end = MPC10X_I2C_IRQ;
409 ppc_sys_platform_devices[MPC10X_DMA0].resource[1].start = MPC10X_DMA0_IRQ;
410 ppc_sys_platform_devices[MPC10X_DMA0].resource[1].end = MPC10X_DMA0_IRQ;
411 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].start = MPC10X_DMA1_IRQ;
412 ppc_sys_platform_devices[MPC10X_DMA1].resource[1].end = MPC10X_DMA1_IRQ;
413
414 serial_platform_data[0].mapbase += phys_eumb_base;
415 serial_platform_data[0].irq = MPC10X_UART0_IRQ;
416
417 serial_platform_data[1].mapbase += phys_eumb_base;
418 serial_platform_data[1].irq = MPC10X_UART0_IRQ + 1;
419
309 /* 420 /*
310 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative 421 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative
311 * PCI reads may return stale data so turn off. 422 * PCI reads may return stale data so turn off.
@@ -330,7 +441,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
330 * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd. 441 * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd.
331 */ 442 */
332 if (host_bridge == MPC10X_BRIDGE_8245) { 443 if (host_bridge == MPC10X_BRIDGE_8245) {
333 ulong picr2; 444 u32 picr2;
334 445
335 early_read_config_dword(hose, 0, PCI_DEVFN(0,0), 446 early_read_config_dword(hose, 0, PCI_DEVFN(0,0),
336 MPC10X_CFG_PICR2_REG, &picr2); 447 MPC10X_CFG_PICR2_REG, &picr2);
@@ -504,6 +615,8 @@ void __init mpc10x_set_openpic(void)
504 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020); 615 openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020);
505 /* Skip reserved space and map Message Unit Interrupt (I2O) */ 616 /* Skip reserved space and map Message Unit Interrupt (I2O) */
506 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0); 617 openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0);
618 /* Skip reserved space and map Serial Interupts */
619 openpic_set_sources(EPIC_IRQ_BASE + 4, 2, OpenPIC_Addr + 0x11120);
507 620
508 openpic_init(NUM_8259_INTERRUPTS); 621 openpic_init(NUM_8259_INTERRUPTS);
509} 622}
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
index 1e658ef57e..8af322dd47 100644
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -40,6 +40,42 @@ static struct gianfar_platform_data mpc85xx_tsec2_pdata = {
40 .phy_reg_addr = MPC85xx_ENET1_OFFSET, 40 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
41}; 41};
42 42
43static struct gianfar_platform_data mpc85xx_etsec1_pdata = {
44 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
45 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
46 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
47 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
48 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
49 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
50};
51
52static struct gianfar_platform_data mpc85xx_etsec2_pdata = {
53 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
54 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
55 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
56 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
57 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
58 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
59};
60
61static struct gianfar_platform_data mpc85xx_etsec3_pdata = {
62 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
63 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
64 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
65 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
66 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
67 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
68};
69
70static struct gianfar_platform_data mpc85xx_etsec4_pdata = {
71 .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
72 FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
73 FSL_GIANFAR_DEV_HAS_MULTI_INTR |
74 FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
75 FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
76 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
77};
78
43static struct gianfar_platform_data mpc85xx_fec_pdata = { 79static struct gianfar_platform_data mpc85xx_fec_pdata = {
44 .phy_reg_addr = MPC85xx_ENET1_OFFSET, 80 .phy_reg_addr = MPC85xx_ENET1_OFFSET,
45}; 81};
@@ -48,6 +84,10 @@ static struct fsl_i2c_platform_data mpc85xx_fsl_i2c_pdata = {
48 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR, 84 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
49}; 85};
50 86
87static struct fsl_i2c_platform_data mpc85xx_fsl_i2c2_pdata = {
88 .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
89};
90
51static struct plat_serial8250_port serial_platform_data[] = { 91static struct plat_serial8250_port serial_platform_data[] = {
52 [0] = { 92 [0] = {
53 .mapbase = 0x4500, 93 .mapbase = 0x4500,
@@ -281,7 +321,6 @@ struct platform_device ppc_sys_platform_devices[] = {
281 }, 321 },
282 }, 322 },
283 }, 323 },
284#ifdef CONFIG_CPM2
285 [MPC85xx_CPM_FCC1] = { 324 [MPC85xx_CPM_FCC1] = {
286 .name = "fsl-cpm-fcc", 325 .name = "fsl-cpm-fcc",
287 .id = 1, 326 .id = 1,
@@ -535,7 +574,151 @@ struct platform_device ppc_sys_platform_devices[] = {
535 }, 574 },
536 }, 575 },
537 }, 576 },
538#endif /* CONFIG_CPM2 */ 577 [MPC85xx_eTSEC1] = {
578 .name = "fsl-gianfar",
579 .id = 1,
580 .dev.platform_data = &mpc85xx_etsec1_pdata,
581 .num_resources = 4,
582 .resource = (struct resource[]) {
583 {
584 .start = MPC85xx_ENET1_OFFSET,
585 .end = MPC85xx_ENET1_OFFSET +
586 MPC85xx_ENET1_SIZE - 1,
587 .flags = IORESOURCE_MEM,
588 },
589 {
590 .name = "tx",
591 .start = MPC85xx_IRQ_TSEC1_TX,
592 .end = MPC85xx_IRQ_TSEC1_TX,
593 .flags = IORESOURCE_IRQ,
594 },
595 {
596 .name = "rx",
597 .start = MPC85xx_IRQ_TSEC1_RX,
598 .end = MPC85xx_IRQ_TSEC1_RX,
599 .flags = IORESOURCE_IRQ,
600 },
601 {
602 .name = "error",
603 .start = MPC85xx_IRQ_TSEC1_ERROR,
604 .end = MPC85xx_IRQ_TSEC1_ERROR,
605 .flags = IORESOURCE_IRQ,
606 },
607 },
608 },
609 [MPC85xx_eTSEC2] = {
610 .name = "fsl-gianfar",
611 .id = 2,
612 .dev.platform_data = &mpc85xx_etsec2_pdata,
613 .num_resources = 4,
614 .resource = (struct resource[]) {
615 {
616 .start = MPC85xx_ENET2_OFFSET,
617 .end = MPC85xx_ENET2_OFFSET +
618 MPC85xx_ENET2_SIZE - 1,
619 .flags = IORESOURCE_MEM,
620 },
621 {
622 .name = "tx",
623 .start = MPC85xx_IRQ_TSEC2_TX,
624 .end = MPC85xx_IRQ_TSEC2_TX,
625 .flags = IORESOURCE_IRQ,
626 },
627 {
628 .name = "rx",
629 .start = MPC85xx_IRQ_TSEC2_RX,
630 .end = MPC85xx_IRQ_TSEC2_RX,
631 .flags = IORESOURCE_IRQ,
632 },
633 {
634 .name = "error",
635 .start = MPC85xx_IRQ_TSEC2_ERROR,
636 .end = MPC85xx_IRQ_TSEC2_ERROR,
637 .flags = IORESOURCE_IRQ,
638 },
639 },
640 },
641 [MPC85xx_eTSEC3] = {
642 .name = "fsl-gianfar",
643 .id = 3,
644 .dev.platform_data = &mpc85xx_etsec3_pdata,
645 .num_resources = 4,
646 .resource = (struct resource[]) {
647 {
648 .start = MPC85xx_ENET3_OFFSET,
649 .end = MPC85xx_ENET3_OFFSET +
650 MPC85xx_ENET3_SIZE - 1,
651 .flags = IORESOURCE_MEM,
652 },
653 {
654 .name = "tx",
655 .start = MPC85xx_IRQ_TSEC3_TX,
656 .end = MPC85xx_IRQ_TSEC3_TX,
657 .flags = IORESOURCE_IRQ,
658 },
659 {
660 .name = "rx",
661 .start = MPC85xx_IRQ_TSEC3_RX,
662 .end = MPC85xx_IRQ_TSEC3_RX,
663 .flags = IORESOURCE_IRQ,
664 },
665 {
666 .name = "error",
667 .start = MPC85xx_IRQ_TSEC3_ERROR,
668 .end = MPC85xx_IRQ_TSEC3_ERROR,
669 .flags = IORESOURCE_IRQ,
670 },
671 },
672 },
673 [MPC85xx_eTSEC4] = {
674 .name = "fsl-gianfar",
675 .id = 4,
676 .dev.platform_data = &mpc85xx_etsec4_pdata,
677 .num_resources = 4,
678 .resource = (struct resource[]) {
679 {
680 .start = 0x27000,
681 .end = 0x27fff,
682 .flags = IORESOURCE_MEM,
683 },
684 {
685 .name = "tx",
686 .start = MPC85xx_IRQ_TSEC4_TX,
687 .end = MPC85xx_IRQ_TSEC4_TX,
688 .flags = IORESOURCE_IRQ,
689 },
690 {
691 .name = "rx",
692 .start = MPC85xx_IRQ_TSEC4_RX,
693 .end = MPC85xx_IRQ_TSEC4_RX,
694 .flags = IORESOURCE_IRQ,
695 },
696 {
697 .name = "error",
698 .start = MPC85xx_IRQ_TSEC4_ERROR,
699 .end = MPC85xx_IRQ_TSEC4_ERROR,
700 .flags = IORESOURCE_IRQ,
701 },
702 },
703 },
704 [MPC85xx_IIC2] = {
705 .name = "fsl-i2c",
706 .id = 2,
707 .dev.platform_data = &mpc85xx_fsl_i2c2_pdata,
708 .num_resources = 2,
709 .resource = (struct resource[]) {
710 {
711 .start = 0x03100,
712 .end = 0x031ff,
713 .flags = IORESOURCE_MEM,
714 },
715 {
716 .start = MPC85xx_IRQ_IIC1,
717 .end = MPC85xx_IRQ_IIC1,
718 .flags = IORESOURCE_IRQ,
719 },
720 },
721 },
539}; 722};
540 723
541static int __init mach_mpc85xx_fixup(struct platform_device *pdev) 724static int __init mach_mpc85xx_fixup(struct platform_device *pdev)
diff --git a/arch/ppc/syslib/mpc85xx_sys.c b/arch/ppc/syslib/mpc85xx_sys.c
index d806a92a94..6e3184ab35 100644
--- a/arch/ppc/syslib/mpc85xx_sys.c
+++ b/arch/ppc/syslib/mpc85xx_sys.c
@@ -110,6 +110,111 @@ struct ppc_sys_spec ppc_sys_specs[] = {
110 MPC85xx_CPM_USB, 110 MPC85xx_CPM_USB,
111 }, 111 },
112 }, 112 },
113 /* SVRs on 8548 rev1.0 matches for 8548/8547/8545 */
114 {
115 .ppc_sys_name = "8548E",
116 .mask = 0xFFFF00F0,
117 .value = 0x80390010,
118 .num_devices = 13,
119 .device_list = (enum ppc_sys_devices[])
120 {
121 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
122 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
123 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
124 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
125 },
126 },
127 {
128 .ppc_sys_name = "8548",
129 .mask = 0xFFFF00F0,
130 .value = 0x80310010,
131 .num_devices = 12,
132 .device_list = (enum ppc_sys_devices[])
133 {
134 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
135 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
136 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
137 MPC85xx_PERFMON, MPC85xx_DUART,
138 },
139 },
140 {
141 .ppc_sys_name = "8547E",
142 .mask = 0xFFFF00F0,
143 .value = 0x80390010,
144 .num_devices = 13,
145 .device_list = (enum ppc_sys_devices[])
146 {
147 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
148 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
149 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
150 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
151 },
152 },
153 {
154 .ppc_sys_name = "8547",
155 .mask = 0xFFFF00F0,
156 .value = 0x80310010,
157 .num_devices = 12,
158 .device_list = (enum ppc_sys_devices[])
159 {
160 MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
161 MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
162 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
163 MPC85xx_PERFMON, MPC85xx_DUART,
164 },
165 },
166 {
167 .ppc_sys_name = "8545E",
168 .mask = 0xFFFF00F0,
169 .value = 0x80390010,
170 .num_devices = 11,
171 .device_list = (enum ppc_sys_devices[])
172 {
173 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
174 MPC85xx_IIC1, MPC85xx_IIC2,
175 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
176 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
177 },
178 },
179 {
180 .ppc_sys_name = "8545",
181 .mask = 0xFFFF00F0,
182 .value = 0x80310010,
183 .num_devices = 10,
184 .device_list = (enum ppc_sys_devices[])
185 {
186 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
187 MPC85xx_IIC1, MPC85xx_IIC2,
188 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
189 MPC85xx_PERFMON, MPC85xx_DUART,
190 },
191 },
192 {
193 .ppc_sys_name = "8543E",
194 .mask = 0xFFFF00F0,
195 .value = 0x803A0010,
196 .num_devices = 11,
197 .device_list = (enum ppc_sys_devices[])
198 {
199 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
200 MPC85xx_IIC1, MPC85xx_IIC2,
201 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
202 MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
203 },
204 },
205 {
206 .ppc_sys_name = "8543",
207 .mask = 0xFFFF00F0,
208 .value = 0x80320010,
209 .num_devices = 10,
210 .device_list = (enum ppc_sys_devices[])
211 {
212 MPC85xx_eTSEC1, MPC85xx_eTSEC2,
213 MPC85xx_IIC1, MPC85xx_IIC2,
214 MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
215 MPC85xx_PERFMON, MPC85xx_DUART,
216 },
217 },
113 { /* default match */ 218 { /* default match */
114 .ppc_sys_name = "", 219 .ppc_sys_name = "",
115 .mask = 0x00000000, 220 .mask = 0x00000000,
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index 7b241e7876..cc77177fa1 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -17,7 +17,6 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/string.h> 19#include <linux/string.h>
20#include <linux/bootmem.h>
21#include <linux/spinlock.h> 20#include <linux/spinlock.h>
22#include <linux/mv643xx.h> 21#include <linux/mv643xx.h>
23 22
diff --git a/arch/ppc/syslib/mv64x60_win.c b/arch/ppc/syslib/mv64x60_win.c
index b6f0f5dcf6..5b827e2bbe 100644
--- a/arch/ppc/syslib/mv64x60_win.c
+++ b/arch/ppc/syslib/mv64x60_win.c
@@ -17,7 +17,6 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/string.h> 19#include <linux/string.h>
20#include <linux/bootmem.h>
21#include <linux/mv643xx.h> 20#include <linux/mv643xx.h>
22 21
23#include <asm/byteorder.h> 22#include <asm/byteorder.h>
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index a5156c5179..e5fd2ae503 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -68,7 +68,7 @@ static int ocp_inited;
68/* Sysfs support */ 68/* Sysfs support */
69#define OCP_DEF_ATTR(field, format_string) \ 69#define OCP_DEF_ATTR(field, format_string) \
70static ssize_t \ 70static ssize_t \
71show_##field(struct device *dev, char *buf) \ 71show_##field(struct device *dev, struct device_attribute *attr, char *buf) \
72{ \ 72{ \
73 struct ocp_device *odev = to_ocp_dev(dev); \ 73 struct ocp_device *odev = to_ocp_dev(dev); \
74 \ 74 \
diff --git a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c
index 46269ed21a..49c0e34e2d 100644
--- a/arch/ppc/syslib/of_device.c
+++ b/arch/ppc/syslib/of_device.c
@@ -161,7 +161,7 @@ void of_unregister_driver(struct of_platform_driver *drv)
161} 161}
162 162
163 163
164static ssize_t dev_show_devspec(struct device *dev, char *buf) 164static ssize_t dev_show_devspec(struct device *dev, struct device_attribute *attr, char *buf)
165{ 165{
166 struct of_device *ofdev; 166 struct of_device *ofdev;
167 167
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 9d4ed68b58..b45d8268bf 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -21,7 +21,6 @@
21#include <asm/signal.h> 21#include <asm/signal.h>
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/prom.h>
25#include <asm/sections.h> 24#include <asm/sections.h>
26#include <asm/open_pic.h> 25#include <asm/open_pic.h>
27#include <asm/i8259.h> 26#include <asm/i8259.h>
@@ -275,7 +274,7 @@ static void __init openpic_enable_sie(void)
275} 274}
276#endif 275#endif
277 276
278#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PM) 277#if defined(CONFIG_EPIC_SERIAL_MODE)
279static void openpic_reset(void) 278static void openpic_reset(void)
280{ 279{
281 openpic_setfield(&OpenPIC->Global.Global_Configuration0, 280 openpic_setfield(&OpenPIC->Global.Global_Configuration0,
@@ -993,8 +992,6 @@ int openpic_resume(struct sys_device *sysdev)
993 return 0; 992 return 0;
994 } 993 }
995 994
996 openpic_reset();
997
998 /* OpenPIC sometimes seem to need some time to be fully back up... */ 995 /* OpenPIC sometimes seem to need some time to be fully back up... */
999 do { 996 do {
1000 openpic_set_spurious(OPENPIC_VEC_SPURIOUS); 997 openpic_set_spurious(OPENPIC_VEC_SPURIOUS);
diff --git a/arch/ppc/syslib/open_pic2.c b/arch/ppc/syslib/open_pic2.c
index ea26da0d8b..7e272c51a4 100644
--- a/arch/ppc/syslib/open_pic2.c
+++ b/arch/ppc/syslib/open_pic2.c
@@ -25,7 +25,6 @@
25#include <asm/signal.h> 25#include <asm/signal.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/prom.h>
29#include <asm/sections.h> 28#include <asm/sections.h>
30#include <asm/open_pic.h> 29#include <asm/open_pic.h>
31#include <asm/i8259.h> 30#include <asm/i8259.h>
diff --git a/arch/ppc/syslib/ppc4xx_kgdb.c b/arch/ppc/syslib/ppc4xx_kgdb.c
deleted file mode 100644
index fe8668bf81..0000000000
--- a/arch/ppc/syslib/ppc4xx_kgdb.c
+++ /dev/null
@@ -1,124 +0,0 @@
1#include <linux/config.h>
2#include <linux/types.h>
3#include <asm/ibm4xx.h>
4#include <linux/kernel.h>
5
6
7
8#define LSR_DR 0x01 /* Data ready */
9#define LSR_OE 0x02 /* Overrun */
10#define LSR_PE 0x04 /* Parity error */
11#define LSR_FE 0x08 /* Framing error */
12#define LSR_BI 0x10 /* Break */
13#define LSR_THRE 0x20 /* Xmit holding register empty */
14#define LSR_TEMT 0x40 /* Xmitter empty */
15#define LSR_ERR 0x80 /* Error */
16
17#include <platforms/4xx/ibm_ocp.h>
18
19extern struct NS16550* COM_PORTS[];
20#ifndef NULL
21#define NULL 0x00
22#endif
23
24static volatile struct NS16550 *kgdb_debugport = NULL;
25
26volatile struct NS16550 *
27NS16550_init(int chan)
28{
29 volatile struct NS16550 *com_port;
30 int quot;
31#ifdef BASE_BAUD
32 quot = BASE_BAUD / 9600;
33#else
34 quot = 0x000c; /* 0xc = 9600 baud (on a pc) */
35#endif
36
37 com_port = (struct NS16550 *) COM_PORTS[chan];
38
39 com_port->lcr = 0x00;
40 com_port->ier = 0xFF;
41 com_port->ier = 0x00;
42 com_port->lcr = com_port->lcr | 0x80; /* Access baud rate */
43 com_port->dll = ( quot & 0x00ff ); /* 0xc = 9600 baud */
44 com_port->dlm = ( quot & 0xff00 ) >> 8;
45 com_port->lcr = 0x03; /* 8 data, 1 stop, no parity */
46 com_port->mcr = 0x00; /* RTS/DTR */
47 com_port->fcr = 0x07; /* Clear & enable FIFOs */
48
49 return( com_port );
50}
51
52
53void
54NS16550_putc(volatile struct NS16550 *com_port, unsigned char c)
55{
56 while ((com_port->lsr & LSR_THRE) == 0)
57 ;
58 com_port->thr = c;
59 return;
60}
61
62unsigned char
63NS16550_getc(volatile struct NS16550 *com_port)
64{
65 while ((com_port->lsr & LSR_DR) == 0)
66 ;
67 return (com_port->rbr);
68}
69
70unsigned char
71NS16550_tstc(volatile struct NS16550 *com_port)
72{
73 return ((com_port->lsr & LSR_DR) != 0);
74}
75
76
77#if defined(CONFIG_KGDB_TTYS0)
78#define KGDB_PORT 0
79#elif defined(CONFIG_KGDB_TTYS1)
80#define KGDB_PORT 1
81#elif defined(CONFIG_KGDB_TTYS2)
82#define KGDB_PORT 2
83#elif defined(CONFIG_KGDB_TTYS3)
84#define KGDB_PORT 3
85#else
86#error "invalid kgdb_tty port"
87#endif
88
89void putDebugChar( unsigned char c )
90{
91 if ( kgdb_debugport == NULL )
92 kgdb_debugport = NS16550_init(KGDB_PORT);
93 NS16550_putc( kgdb_debugport, c );
94}
95
96int getDebugChar( void )
97{
98 if (kgdb_debugport == NULL)
99 kgdb_debugport = NS16550_init(KGDB_PORT);
100
101 return(NS16550_getc(kgdb_debugport));
102}
103
104void kgdb_interruptible(int enable)
105{
106 return;
107}
108
109void putDebugString(char* str)
110{
111 while (*str != '\0') {
112 putDebugChar(*str);
113 str++;
114 }
115 putDebugChar('\r');
116 return;
117}
118
119void
120kgdb_map_scc(void)
121{
122 printk("kgdb init \n");
123 kgdb_debugport = NS16550_init(KGDB_PORT);
124}
diff --git a/arch/ppc/syslib/ppc83xx_setup.c b/arch/ppc/syslib/ppc83xx_setup.c
index c28f9d6794..602a86891f 100644
--- a/arch/ppc/syslib/ppc83xx_setup.c
+++ b/arch/ppc/syslib/ppc83xx_setup.c
@@ -23,12 +23,12 @@
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25 25
26#include <asm/prom.h>
27#include <asm/time.h> 26#include <asm/time.h>
28#include <asm/mpc83xx.h> 27#include <asm/mpc83xx.h>
29#include <asm/mmu.h> 28#include <asm/mmu.h>
30#include <asm/ppc_sys.h> 29#include <asm/ppc_sys.h>
31#include <asm/kgdb.h> 30#include <asm/kgdb.h>
31#include <asm/delay.h>
32 32
33#include <syslib/ppc83xx_setup.h> 33#include <syslib/ppc83xx_setup.h>
34 34
@@ -117,7 +117,34 @@ mpc83xx_early_serial_map(void)
117void 117void
118mpc83xx_restart(char *cmd) 118mpc83xx_restart(char *cmd)
119{ 119{
120 volatile unsigned char __iomem *reg;
121 unsigned char tmp;
122
123 reg = ioremap(BCSR_PHYS_ADDR, BCSR_SIZE);
124
120 local_irq_disable(); 125 local_irq_disable();
126
127 /*
128 * Unlock the BCSR bits so a PRST will update the contents.
129 * Otherwise the reset asserts but doesn't clear.
130 */
131 tmp = in_8(reg + BCSR_MISC_REG3_OFF);
132 tmp |= BCSR_MISC_REG3_CNFLOCK; /* low true, high false */
133 out_8(reg + BCSR_MISC_REG3_OFF, tmp);
134
135 /*
136 * Trigger a reset via a low->high transition of the
137 * PORESET bit.
138 */
139 tmp = in_8(reg + BCSR_MISC_REG2_OFF);
140 tmp &= ~BCSR_MISC_REG2_PORESET;
141 out_8(reg + BCSR_MISC_REG2_OFF, tmp);
142
143 udelay(1);
144
145 tmp |= BCSR_MISC_REG2_PORESET;
146 out_8(reg + BCSR_MISC_REG2_OFF, tmp);
147
121 for(;;); 148 for(;;);
122} 149}
123 150
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index 152c3ef131..ca95d79a70 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -23,7 +23,6 @@
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25 25
26#include <asm/prom.h>
27#include <asm/time.h> 26#include <asm/time.h>
28#include <asm/mpc85xx.h> 27#include <asm/mpc85xx.h>
29#include <asm/immap_85xx.h> 28#include <asm/immap_85xx.h>
@@ -33,6 +32,8 @@
33 32
34#include <syslib/ppc85xx_setup.h> 33#include <syslib/ppc85xx_setup.h>
35 34
35extern void abort(void);
36
36/* Return the amount of memory */ 37/* Return the amount of memory */
37unsigned long __init 38unsigned long __init
38mpc85xx_find_end_of_memory(void) 39mpc85xx_find_end_of_memory(void)
@@ -132,6 +133,12 @@ mpc85xx_halt(void)
132} 133}
133 134
134#ifdef CONFIG_PCI 135#ifdef CONFIG_PCI
136
137#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
138extern void mpc85xx_cds_enable_via(struct pci_controller *hose);
139extern void mpc85xx_cds_fixup_via(struct pci_controller *hose);
140#endif
141
135static void __init 142static void __init
136mpc85xx_setup_pci1(struct pci_controller *hose) 143mpc85xx_setup_pci1(struct pci_controller *hose)
137{ 144{
@@ -302,8 +309,18 @@ mpc85xx_setup_hose(void)
302 309
303 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 310 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
304 311
312#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
313 /* Pre pciauto_bus_scan VIA init */
314 mpc85xx_cds_enable_via(hose_a);
315#endif
316
305 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno); 317 hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno);
306 318
319#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
320 /* Post pciauto_bus_scan VIA fixup */
321 mpc85xx_cds_fixup_via(hose_a);
322#endif
323
307#ifdef CONFIG_85xx_PCI2 324#ifdef CONFIG_85xx_PCI2
308 hose_b = pcibios_alloc_controller(); 325 hose_b = pcibios_alloc_controller();
309 326
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
index 2cee87137f..7f15136830 100644
--- a/arch/ppc/syslib/prom_init.c
+++ b/arch/ppc/syslib/prom_init.c
@@ -626,8 +626,18 @@ inspect_node(phandle node, struct device_node *dad,
626 l = call_prom("package-to-path", 3, 1, node, 626 l = call_prom("package-to-path", 3, 1, node,
627 mem_start, mem_end - mem_start); 627 mem_start, mem_end - mem_start);
628 if (l >= 0) { 628 if (l >= 0) {
629 char *p, *ep;
630
629 np->full_name = PTRUNRELOC((char *) mem_start); 631 np->full_name = PTRUNRELOC((char *) mem_start);
630 *(char *)(mem_start + l) = 0; 632 *(char *)(mem_start + l) = 0;
633 /* Fixup an Apple bug where they have bogus \0 chars in the
634 * middle of the path in some properties
635 */
636 for (p = (char *)mem_start, ep = p + l; p < ep; p++)
637 if ((*p) == '\0') {
638 memmove(p, p+1, ep - p);
639 ep--;
640 }
631 mem_start = ALIGNUL(mem_start + l + 1); 641 mem_start = ALIGNUL(mem_start + l + 1);
632 } 642 }
633 643
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 8565f49b8b..be7869e394 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -9,6 +9,7 @@
9#include <linux/smp.h> 9#include <linux/smp.h>
10#include <linux/interrupt.h> 10#include <linux/interrupt.h>
11#include <linux/bitops.h> 11#include <linux/bitops.h>
12#include <linux/kallsyms.h>
12#include <asm/ptrace.h> 13#include <asm/ptrace.h>
13#include <asm/string.h> 14#include <asm/string.h>
14#include <asm/prom.h> 15#include <asm/prom.h>
@@ -93,8 +94,7 @@ static void take_input(char *);
93static unsigned read_spr(int); 94static unsigned read_spr(int);
94static void write_spr(int, unsigned); 95static void write_spr(int, unsigned);
95static void super_regs(void); 96static void super_regs(void);
96static void print_sysmap(void); 97static void symbol_lookup(void);
97static void sysmap_lookup(void);
98static void remove_bpts(void); 98static void remove_bpts(void);
99static void insert_bpts(void); 99static void insert_bpts(void);
100static struct bpt *at_breakpoint(unsigned pc); 100static struct bpt *at_breakpoint(unsigned pc);
@@ -103,7 +103,6 @@ static void cacheflush(void);
103#ifdef CONFIG_SMP 103#ifdef CONFIG_SMP
104static void cpu_cmd(void); 104static void cpu_cmd(void);
105#endif /* CONFIG_SMP */ 105#endif /* CONFIG_SMP */
106static int pretty_print_addr(unsigned long addr);
107static void csum(void); 106static void csum(void);
108#ifdef CONFIG_BOOTX_TEXT 107#ifdef CONFIG_BOOTX_TEXT
109static void vidcmds(void); 108static void vidcmds(void);
@@ -120,8 +119,6 @@ extern void longjmp(u_int *, int);
120 119
121extern void xmon_enter(void); 120extern void xmon_enter(void);
122extern void xmon_leave(void); 121extern void xmon_leave(void);
123extern char* xmon_find_symbol(unsigned long addr, unsigned long* saddr);
124extern unsigned long xmon_symbol_to_addr(char* symbol);
125 122
126static unsigned start_tb[NR_CPUS][2]; 123static unsigned start_tb[NR_CPUS][2];
127static unsigned stop_tb[NR_CPUS][2]; 124static unsigned stop_tb[NR_CPUS][2];
@@ -148,7 +145,6 @@ Commands:\n\
148 mm move a block of memory\n\ 145 mm move a block of memory\n\
149 ms set a block of memory\n\ 146 ms set a block of memory\n\
150 md compare two blocks of memory\n\ 147 md compare two blocks of memory\n\
151 M print System.map\n\
152 r print registers\n\ 148 r print registers\n\
153 S print special registers\n\ 149 S print special registers\n\
154 t print backtrace\n\ 150 t print backtrace\n\
@@ -175,6 +171,35 @@ extern inline void __delay(unsigned int loops)
175 "r" (loops) : "ctr"); 171 "r" (loops) : "ctr");
176} 172}
177 173
174/* Print an address in numeric and symbolic form (if possible) */
175static void xmon_print_symbol(unsigned long address, const char *mid,
176 const char *after)
177{
178 char *modname;
179 const char *name = NULL;
180 unsigned long offset, size;
181 static char tmpstr[128];
182
183 printf("%.8lx", address);
184 if (setjmp(bus_error_jmp) == 0) {
185 debugger_fault_handler = handle_fault;
186 sync();
187 name = kallsyms_lookup(address, &size, &offset, &modname,
188 tmpstr);
189 sync();
190 /* wait a little while to see if we get a machine check */
191 __delay(200);
192 }
193 debugger_fault_handler = NULL;
194
195 if (name) {
196 printf("%s%s+%#lx/%#lx", mid, name, offset, size);
197 if (modname)
198 printf(" [%s]", modname);
199 }
200 printf("%s", after);
201}
202
178static void get_tb(unsigned *p) 203static void get_tb(unsigned *p)
179{ 204{
180 unsigned hi, lo, hiagain; 205 unsigned hi, lo, hiagain;
@@ -454,7 +479,7 @@ cmds(struct pt_regs *excp)
454 dump(); 479 dump();
455 break; 480 break;
456 case 'l': 481 case 'l':
457 sysmap_lookup(); 482 symbol_lookup();
458 break; 483 break;
459 case 'r': 484 case 'r':
460 if (excp != NULL) 485 if (excp != NULL)
@@ -466,9 +491,6 @@ cmds(struct pt_regs *excp)
466 else 491 else
467 excprint(excp); 492 excprint(excp);
468 break; 493 break;
469 case 'M':
470 print_sysmap();
471 break;
472 case 'S': 494 case 'S':
473 super_regs(); 495 super_regs();
474 break; 496 break;
@@ -825,20 +847,19 @@ backtrace(struct pt_regs *excp)
825 for (; sp != 0; sp = stack[0]) { 847 for (; sp != 0; sp = stack[0]) {
826 if (mread(sp, stack, sizeof(stack)) != sizeof(stack)) 848 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
827 break; 849 break;
828 pretty_print_addr(stack[1]); 850 printf("[%.8lx] ", stack);
829 printf(" "); 851 xmon_print_symbol(stack[1], " ", "\n");
830 if (stack[1] == (unsigned) &ret_from_except 852 if (stack[1] == (unsigned) &ret_from_except
831 || stack[1] == (unsigned) &ret_from_except_full 853 || stack[1] == (unsigned) &ret_from_except_full
832 || stack[1] == (unsigned) &ret_from_syscall) { 854 || stack[1] == (unsigned) &ret_from_syscall) {
833 if (mread(sp+16, &regs, sizeof(regs)) != sizeof(regs)) 855 if (mread(sp+16, &regs, sizeof(regs)) != sizeof(regs))
834 break; 856 break;
835 printf("\nexception:%x [%x] %x ", regs.trap, sp+16, 857 printf("exception:%x [%x] %x\n", regs.trap, sp+16,
836 regs.nip); 858 regs.nip);
837 sp = regs.gpr[1]; 859 sp = regs.gpr[1];
838 if (mread(sp, stack, sizeof(stack)) != sizeof(stack)) 860 if (mread(sp, stack, sizeof(stack)) != sizeof(stack))
839 break; 861 break;
840 } 862 }
841 printf("\n");
842 } 863 }
843} 864}
844 865
@@ -859,11 +880,10 @@ excprint(struct pt_regs *fp)
859#ifdef CONFIG_SMP 880#ifdef CONFIG_SMP
860 printf("cpu %d: ", smp_processor_id()); 881 printf("cpu %d: ", smp_processor_id());
861#endif /* CONFIG_SMP */ 882#endif /* CONFIG_SMP */
862 printf("vector: %x at pc = ", fp->trap); 883 printf("vector: %x at pc=", fp->trap);
863 pretty_print_addr(fp->nip); 884 xmon_print_symbol(fp->nip, ": ", ", lr=");
864 printf(", lr = "); 885 xmon_print_symbol(fp->link, ": ", "\n");
865 pretty_print_addr(fp->link); 886 printf("msr = %x, sp = %x [%x]\n", fp->msr, fp->gpr[1], fp);
866 printf("\nmsr = %x, sp = %x [%x]\n", fp->msr, fp->gpr[1], fp);
867 trap = TRAP(fp); 887 trap = TRAP(fp);
868 if (trap == 0x300 || trap == 0x600) 888 if (trap == 0x300 || trap == 0x600)
869 printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr); 889 printf("dar = %x, dsisr = %x\n", fp->dar, fp->dsisr);
@@ -951,24 +971,6 @@ extern char exc_prolog;
951extern char dec_exc; 971extern char dec_exc;
952 972
953void 973void
954print_sysmap(void)
955{
956 extern char *sysmap;
957 if ( sysmap ) {
958 printf("System.map: \n");
959 if( setjmp(bus_error_jmp) == 0 ) {
960 debugger_fault_handler = handle_fault;
961 sync();
962 xmon_puts(sysmap);
963 sync();
964 }
965 debugger_fault_handler = NULL;
966 }
967 else
968 printf("No System.map\n");
969}
970
971void
972super_regs(void) 974super_regs(void)
973{ 975{
974 int i, cmd; 976 int i, cmd;
@@ -1738,7 +1740,7 @@ scanhex(unsigned *vp)
1738 printf("invalid register name '%%%s'\n", regname); 1740 printf("invalid register name '%%%s'\n", regname);
1739 return 0; 1741 return 0;
1740 } else if (c == '$') { 1742 } else if (c == '$') {
1741 static char symname[64]; 1743 static char symname[128];
1742 int i; 1744 int i;
1743 for (i=0; i<63; i++) { 1745 for (i=0; i<63; i++) {
1744 c = inchar(); 1746 c = inchar();
@@ -1749,7 +1751,14 @@ scanhex(unsigned *vp)
1749 symname[i] = c; 1751 symname[i] = c;
1750 } 1752 }
1751 symname[i++] = 0; 1753 symname[i++] = 0;
1752 *vp = xmon_symbol_to_addr(symname); 1754 *vp = 0;
1755 if (setjmp(bus_error_jmp) == 0) {
1756 debugger_fault_handler = handle_fault;
1757 sync();
1758 *vp = kallsyms_lookup_name(symname);
1759 sync();
1760 }
1761 debugger_fault_handler = NULL;
1753 if (!(*vp)) { 1762 if (!(*vp)) {
1754 printf("unknown symbol\n"); 1763 printf("unknown symbol\n");
1755 return 0; 1764 return 0;
@@ -1840,169 +1849,34 @@ take_input(char *str)
1840 lineptr = str; 1849 lineptr = str;
1841} 1850}
1842 1851
1843void 1852static void
1844sysmap_lookup(void) 1853symbol_lookup(void)
1845{ 1854{
1846 int type = inchar(); 1855 int type = inchar();
1847 unsigned addr; 1856 unsigned addr;
1848 static char tmp[64]; 1857 static char tmp[128];
1849 char* cur;
1850
1851 extern char *sysmap;
1852 extern unsigned long sysmap_size;
1853 if ( !sysmap || !sysmap_size )
1854 return;
1855
1856 switch(type) {
1857 case 'a':
1858 if (scanhex(&addr)) {
1859 pretty_print_addr(addr);
1860 printf("\n");
1861 }
1862 termch = 0;
1863 break;
1864 case 's':
1865 getstring(tmp, 64);
1866 if( setjmp(bus_error_jmp) == 0 ) {
1867 debugger_fault_handler = handle_fault;
1868 sync();
1869 cur = sysmap;
1870 do {
1871 cur = strstr(cur, tmp);
1872 if (cur) {
1873 static char res[64];
1874 char *p, *d;
1875 p = cur;
1876 while(p > sysmap && *p != 10)
1877 p--;
1878 if (*p == 10) p++;
1879 d = res;
1880 while(*p && p < (sysmap + sysmap_size) && *p != 10)
1881 *(d++) = *(p++);
1882 *(d++) = 0;
1883 printf("%s\n", res);
1884 cur++;
1885 }
1886 } while (cur);
1887 sync();
1888 }
1889 debugger_fault_handler = NULL;
1890 termch = 0;
1891 break;
1892 }
1893}
1894 1858
1895static int 1859 switch (type) {
1896pretty_print_addr(unsigned long addr) 1860 case 'a':
1897{ 1861 if (scanhex(&addr))
1898 char *sym; 1862 xmon_print_symbol(addr, ": ", "\n");
1899 unsigned long saddr; 1863 termch = 0;
1900 1864 break;
1901 printf("%08x", addr); 1865 case 's':
1902 sym = xmon_find_symbol(addr, &saddr); 1866 getstring(tmp, 64);
1903 if (sym) 1867 if (setjmp(bus_error_jmp) == 0) {
1904 printf(" (%s+0x%x)", sym, addr-saddr); 1868 debugger_fault_handler = handle_fault;
1905 return (sym != 0); 1869 sync();
1906} 1870 addr = kallsyms_lookup_name(tmp);
1907 1871 if (addr)
1908char* 1872 printf("%s: %lx\n", tmp, addr);
1909xmon_find_symbol(unsigned long addr, unsigned long* saddr) 1873 else
1910{ 1874 printf("Symbol '%s' not found.\n", tmp);
1911 static char rbuffer[64]; 1875 sync();
1912 char *p, *ep, *limit; 1876 }
1913 unsigned long prev, next; 1877 debugger_fault_handler = NULL;
1914 char* psym; 1878 termch = 0;
1915 1879 break;
1916 extern char *sysmap;
1917 extern unsigned long sysmap_size;
1918 if ( !sysmap || !sysmap_size )
1919 return NULL;
1920
1921 prev = 0;
1922 psym = NULL;
1923 p = sysmap;
1924 limit = p + sysmap_size;
1925 if( setjmp(bus_error_jmp) == 0 ) {
1926 debugger_fault_handler = handle_fault;
1927 sync();
1928 do {
1929 next = simple_strtoul(p, &p, 16);
1930 if (next > addr && prev <= addr) {
1931 if (!psym)
1932 goto bail;
1933 ep = rbuffer;
1934 p = psym;
1935 while(*p && p < limit && *p == 32)
1936 p++;
1937 while(*p && p < limit && *p != 10 && (ep - rbuffer) < 63)
1938 *(ep++) = *(p++);
1939 *(ep++) = 0;
1940 if (saddr)
1941 *saddr = prev;
1942 debugger_fault_handler = NULL;
1943 return rbuffer;
1944 }
1945 prev = next;
1946 psym = p;
1947 while(*p && p < limit && *p != 10)
1948 p++;
1949 if (*p) p++;
1950 } while(*p && p < limit && next);
1951bail:
1952 sync();
1953 } 1880 }
1954 debugger_fault_handler = NULL;
1955 return NULL;
1956} 1881}
1957 1882
1958unsigned long
1959xmon_symbol_to_addr(char* symbol)
1960{
1961 char *p, *cur;
1962 char *match = NULL;
1963 int goodness = 0;
1964 int result = 0;
1965
1966 extern char *sysmap;
1967 extern unsigned long sysmap_size;
1968 if ( !sysmap || !sysmap_size )
1969 return 0;
1970
1971 if( setjmp(bus_error_jmp) == 0 ) {
1972 debugger_fault_handler = handle_fault;
1973 sync();
1974 cur = sysmap;
1975 while(cur) {
1976 cur = strstr(cur, symbol);
1977 if (cur) {
1978 int gd = 1;
1979
1980 /* best match if equal, better match if
1981 * begins with
1982 */
1983 if (cur == sysmap || *(cur-1) == ' ') {
1984 gd++;
1985 if (cur[strlen(symbol)] == 10)
1986 gd++;
1987 }
1988 if (gd > goodness) {
1989 match = cur;
1990 goodness = gd;
1991 if (gd == 3)
1992 break;
1993 }
1994 cur++;
1995 }
1996 }
1997 if (goodness) {
1998 p = match;
1999 while(p > sysmap && *p != 10)
2000 p--;
2001 if (*p == 10) p++;
2002 result = simple_strtoul(p, &p, 16);
2003 }
2004 sync();
2005 }
2006 debugger_fault_handler = NULL;
2007 return result;
2008}