aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/Makefile19
-rw-r--r--arch/powerpc/boot/.gitignore8
-rw-r--r--arch/powerpc/boot/44x.c85
-rw-r--r--arch/powerpc/boot/44x.h5
-rw-r--r--arch/powerpc/boot/4xx.c300
-rw-r--r--arch/powerpc/boot/4xx.h22
-rw-r--r--arch/powerpc/boot/Makefile13
-rw-r--r--arch/powerpc/boot/bamboo.c45
-rw-r--r--arch/powerpc/boot/cpm-serial.c249
-rw-r--r--arch/powerpc/boot/cuboot-83xx.c1
-rw-r--r--arch/powerpc/boot/cuboot-85xx.c1
-rw-r--r--arch/powerpc/boot/cuboot-8xx.c45
-rw-r--r--arch/powerpc/boot/cuboot-pq2.c283
-rw-r--r--arch/powerpc/boot/cuboot-sequoia.c56
-rw-r--r--arch/powerpc/boot/cuboot.c3
-rw-r--r--arch/powerpc/boot/dcr.h18
-rw-r--r--arch/powerpc/boot/devtree.c70
-rw-r--r--arch/powerpc/boot/dts/bamboo.dts244
-rw-r--r--arch/powerpc/boot/dts/ebony.dts5
-rw-r--r--arch/powerpc/boot/dts/holly.dts4
-rw-r--r--arch/powerpc/boot/dts/kuroboxHD.dts3
-rw-r--r--arch/powerpc/boot/dts/kuroboxHG.dts3
-rw-r--r--arch/powerpc/boot/dts/mpc8272ads.dts376
-rw-r--r--arch/powerpc/boot/dts/prpmc2800.dts4
-rw-r--r--arch/powerpc/boot/dts/sequoia.dts286
-rw-r--r--arch/powerpc/boot/dts/walnut.dts183
-rw-r--r--arch/powerpc/boot/ebony.c45
-rw-r--r--arch/powerpc/boot/holly.c5
-rw-r--r--arch/powerpc/boot/io.h49
-rw-r--r--arch/powerpc/boot/main.c10
-rw-r--r--arch/powerpc/boot/mpsc.c1
-rw-r--r--arch/powerpc/boot/mv64x60_i2c.c2
-rw-r--r--arch/powerpc/boot/of.c2
-rw-r--r--arch/powerpc/boot/ops.h24
-rw-r--r--arch/powerpc/boot/ppcboot.h7
-rw-r--r--arch/powerpc/boot/prpmc2800.c6
-rw-r--r--arch/powerpc/boot/ps3.c4
-rw-r--r--arch/powerpc/boot/serial.c19
-rw-r--r--arch/powerpc/boot/treeboot-bamboo.c27
-rw-r--r--arch/powerpc/boot/treeboot-ebony.c2
-rw-r--r--arch/powerpc/boot/treeboot-walnut.c131
-rw-r--r--arch/powerpc/configs/bamboo_defconfig775
-rw-r--r--arch/powerpc/configs/ebony_defconfig85
-rw-r--r--arch/powerpc/configs/sequoia_defconfig776
-rw-r--r--arch/powerpc/configs/walnut_defconfig773
-rw-r--r--arch/powerpc/kernel/Makefile9
-rw-r--r--arch/powerpc/kernel/align.c57
-rw-r--r--arch/powerpc/kernel/asm-offsets.c8
-rw-r--r--arch/powerpc/kernel/btext.c1
-rw-r--r--arch/powerpc/kernel/cputable.c18
-rw-r--r--arch/powerpc/kernel/crash.c1
-rw-r--r--arch/powerpc/kernel/crash_dump.c2
-rw-r--r--arch/powerpc/kernel/head_40x.S (renamed from arch/powerpc/kernel/head_4xx.S)3
-rw-r--r--arch/powerpc/kernel/head_44x.S2
-rw-r--r--arch/powerpc/kernel/head_64.S585
-rw-r--r--arch/powerpc/kernel/iommu.c1
-rw-r--r--arch/powerpc/kernel/irq.c4
-rw-r--r--arch/powerpc/kernel/lparmap.c32
-rw-r--r--arch/powerpc/kernel/nvram_64.c23
-rw-r--r--arch/powerpc/kernel/pci_32.c4
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c2
-rw-r--r--arch/powerpc/kernel/prom.c1
-rw-r--r--arch/powerpc/kernel/prom_init.c11
-rw-r--r--arch/powerpc/kernel/rtas_pci.c4
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/time.c3
-rw-r--r--arch/powerpc/mm/40x_mmu.c (renamed from arch/powerpc/mm/4xx_mmu.c)4
-rw-r--r--arch/powerpc/mm/Makefile2
-rw-r--r--arch/powerpc/mm/hash_utils_64.c7
-rw-r--r--arch/powerpc/mm/hugetlbpage.c3
-rw-r--r--arch/powerpc/mm/init_32.c1
-rw-r--r--arch/powerpc/mm/mem.c1
-rw-r--r--arch/powerpc/mm/mmu_context_64.c11
-rw-r--r--arch/powerpc/mm/slice.c1
-rw-r--r--arch/powerpc/platforms/40x/Kconfig (renamed from arch/powerpc/platforms/4xx/Kconfig)91
-rw-r--r--arch/powerpc/platforms/40x/Makefile1
-rw-r--r--arch/powerpc/platforms/40x/walnut.c68
-rw-r--r--arch/powerpc/platforms/44x/Kconfig32
-rw-r--r--arch/powerpc/platforms/44x/Makefile2
-rw-r--r--arch/powerpc/platforms/44x/bamboo.c66
-rw-r--r--arch/powerpc/platforms/44x/sequoia.c66
-rw-r--r--arch/powerpc/platforms/4xx/Makefile1
-rw-r--r--arch/powerpc/platforms/52xx/efika.c4
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c14
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c1
-rw-r--r--arch/powerpc/platforms/82xx/m82xx_pci.h2
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx.c1
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx_ads.c1
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads.h1
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/8xx/m8xx_setup.c76
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads.h1
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads_setup.c15
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads.h1
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads_setup.c15
-rw-r--r--arch/powerpc/platforms/Kconfig3
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype2
-rw-r--r--arch/powerpc/platforms/Makefile2
-rw-r--r--arch/powerpc/platforms/celleb/pci.c16
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c8
-rw-r--r--arch/powerpc/platforms/celleb/scc_sio.c8
-rw-r--r--arch/powerpc/platforms/celleb/setup.c4
-rw-r--r--arch/powerpc/platforms/chrp/gg2.h61
-rw-r--r--arch/powerpc/platforms/chrp/pci.c39
-rw-r--r--arch/powerpc/platforms/chrp/setup.c3
-rw-r--r--arch/powerpc/platforms/chrp/smp.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c14
-rw-r--r--arch/powerpc/platforms/embedded6xx/linkstation.c5
-rw-r--r--arch/powerpc/platforms/embedded6xx/ls_uart.c4
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc10x.h180
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c3
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h21
-rw-r--r--arch/powerpc/platforms/embedded6xx/prpmc2800.c7
-rw-r--r--arch/powerpc/platforms/iseries/Makefile1
-rw-r--r--arch/powerpc/platforms/iseries/exception.S251
-rw-r--r--arch/powerpc/platforms/iseries/exception.h58
-rw-r--r--arch/powerpc/platforms/iseries/it_lp_naca.h2
-rw-r--r--arch/powerpc/platforms/iseries/setup.c1
-rw-r--r--arch/powerpc/platforms/maple/pci.c21
-rw-r--r--arch/powerpc/platforms/pasemi/iommu.c4
-rw-r--r--arch/powerpc/platforms/pasemi/pci.c7
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c24
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c1
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c1
-rw-r--r--arch/powerpc/platforms/powermac/pci.c25
-rw-r--r--arch/powerpc/platforms/powermac/pmac.h4
-rw-r--r--arch/powerpc/platforms/powermac/udbg_adb.c5
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c52
-rw-r--r--arch/powerpc/platforms/pseries/eeh_cache.c9
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c1
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c96
-rw-r--r--arch/powerpc/sysdev/commproc.c20
-rw-r--r--arch/powerpc/sysdev/cpm2_common.c2
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c4
-rw-r--r--arch/powerpc/sysdev/dcr.c4
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c13
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c4
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c4
-rw-r--r--arch/powerpc/sysdev/uic.c66
-rw-r--r--arch/ppc/.gitignore2
-rw-r--r--drivers/char/hvc_beat.c4
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
-rw-r--r--drivers/macintosh/adb-iop.c1
-rw-r--r--drivers/macintosh/ans-lcd.c3
-rw-r--r--drivers/macintosh/ans-lcd.h (renamed from include/asm-ppc/ans-lcd.h)0
-rw-r--r--drivers/macintosh/therm_adt746x.c5
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/macintosh/windfarm_smu_sat.c2
-rw-r--r--drivers/mtd/maps/Kconfig2
-rw-r--r--include/asm-powerpc/8xx_immap.h564
-rw-r--r--include/asm-powerpc/atomic.h34
-rw-r--r--include/asm-powerpc/commproc.h692
-rw-r--r--include/asm-powerpc/cpm2.h1248
-rw-r--r--include/asm-powerpc/dma-mapping.h24
-rw-r--r--include/asm-powerpc/exception.h309
-rw-r--r--include/asm-powerpc/highmem.h135
-rw-r--r--include/asm-powerpc/hydra.h102
-rw-r--r--include/asm-powerpc/immap_cpm2.h648
-rw-r--r--include/asm-powerpc/io.h3
-rw-r--r--include/asm-powerpc/iseries/lpar_map.h3
-rw-r--r--include/asm-powerpc/kgdb.h57
-rw-r--r--include/asm-powerpc/lmb.h6
-rw-r--r--include/asm-powerpc/mmu-40x.h65
-rw-r--r--include/asm-powerpc/mmu.h3
-rw-r--r--include/asm-powerpc/mpc52xx_psc.h191
-rw-r--r--include/asm-powerpc/nvram.h6
-rw-r--r--include/asm-powerpc/page_64.h9
-rw-r--r--include/asm-powerpc/ppc_asm.h14
-rw-r--r--include/asm-powerpc/prom.h3
-rw-r--r--include/asm-powerpc/time.h2
-rw-r--r--include/asm-ppc/prom.h1
-rw-r--r--include/linux/of.h1
177 files changed, 10011 insertions, 1540 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6c1e36c33faa..6015a92bc2a0 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -63,8 +63,7 @@ endif
63 63
64LDFLAGS_vmlinux := -Bstatic 64LDFLAGS_vmlinux := -Bstatic
65 65
66# The -Iarch/$(ARCH)/include is temporary while we are merging 66CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
67CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -Iarch/$(ARCH)/include
68AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) 67AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
69CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc 68CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
70CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple 69CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
@@ -72,9 +71,6 @@ CPPFLAGS += $(CPPFLAGS-y)
72AFLAGS += $(AFLAGS-y) 71AFLAGS += $(AFLAGS-y)
73CFLAGS += -msoft-float -pipe $(CFLAGS-y) 72CFLAGS += -msoft-float -pipe $(CFLAGS-y)
74CPP = $(CC) -E $(CFLAGS) 73CPP = $(CC) -E $(CFLAGS)
75# Temporary hack until we have migrated to asm-powerpc
76LINUXINCLUDE-$(CONFIG_PPC32) := -Iarch/$(ARCH)/include
77LINUXINCLUDE += $(LINUXINCLUDE-y)
78 74
79CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ 75CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
80 76
@@ -123,7 +119,7 @@ CFLAGS += $(cpu-as-y)
123head-y := arch/powerpc/kernel/head_32.o 119head-y := arch/powerpc/kernel/head_32.o
124head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o 120head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o
125head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o 121head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
126head-$(CONFIG_4xx) := arch/powerpc/kernel/head_4xx.o 122head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o
127head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o 123head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o
128head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o 124head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
129 125
@@ -172,19 +168,8 @@ install:
172archclean: 168archclean:
173 $(Q)$(MAKE) $(clean)=$(boot) 169 $(Q)$(MAKE) $(clean)=$(boot)
174 170
175archmrproper:
176 $(Q)rm -rf arch/$(ARCH)/include
177
178archprepare: checkbin 171archprepare: checkbin
179 172
180ifeq ($(CONFIG_PPC32),y)
181# Temporary hack until we have migrated to asm-powerpc
182include/asm: arch/$(ARCH)/include/asm
183arch/$(ARCH)/include/asm: FORCE
184 $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
185 $(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm
186endif
187
188# Use the file '.tmp_gas_check' for binutils tests, as gas won't output 173# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
189# to stdout and these checks are run even on install targets. 174# to stdout and these checks are run even on install targets.
190TOUT := .tmp_gas_check 175TOUT := .tmp_gas_check
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index eec7af7e5993..2c187ca05982 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -18,14 +18,14 @@ kernel-vmlinux.strip.c
18kernel-vmlinux.strip.gz 18kernel-vmlinux.strip.gz
19mktree 19mktree
20uImage 20uImage
21cuImage 21cuImage.*
22cuImage.bin.gz
23cuImage.elf
24zImage 22zImage
23zImage.bin.*
25zImage.chrp 24zImage.chrp
26zImage.coff 25zImage.coff
27zImage.coff.lds 26zImage.coff.lds
28zImage.lds 27zImage.ep*
28zImage.*lds
29zImage.miboot 29zImage.miboot
30zImage.pmac 30zImage.pmac
31zImage.pseries 31zImage.pseries
diff --git a/arch/powerpc/boot/44x.c b/arch/powerpc/boot/44x.c
deleted file mode 100644
index 9f64e840bef6..000000000000
--- a/arch/powerpc/boot/44x.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright 2007 David Gibson, IBM Corporation.
3 *
4 * Based on earlier code:
5 * Matt Porter <mporter@kernel.crashing.org>
6 * Copyright 2002-2005 MontaVista Software Inc.
7 *
8 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9 * Copyright (c) 2003, 2004 Zultys Technologies
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16#include <stddef.h>
17#include "types.h"
18#include "string.h"
19#include "stdio.h"
20#include "ops.h"
21#include "reg.h"
22#include "dcr.h"
23
24/* Read the 44x memory controller to get size of system memory. */
25void ibm44x_fixup_memsize(void)
26{
27 int i;
28 unsigned long memsize, bank_config;
29
30 memsize = 0;
31 for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
32 mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
33 bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
34
35 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
36 memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
37 }
38
39 dt_fixup_memory(0, memsize);
40}
41
42#define SPRN_DBCR0 0x134
43#define DBCR0_RST_SYSTEM 0x30000000
44
45void ibm44x_dbcr_reset(void)
46{
47 unsigned long tmp;
48
49 asm volatile (
50 "mfspr %0,%1\n"
51 "oris %0,%0,%2@h\n"
52 "mtspr %1,%0"
53 : "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM)
54 );
55
56}
57
58/* Read 4xx EBC bus bridge registers to get mappings of the peripheral
59 * banks into the OPB address space */
60void ibm4xx_fixup_ebc_ranges(const char *ebc)
61{
62 void *devp;
63 u32 bxcr;
64 u32 ranges[EBC_NUM_BANKS*4];
65 u32 *p = ranges;
66 int i;
67
68 for (i = 0; i < EBC_NUM_BANKS; i++) {
69 mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i));
70 bxcr = mfdcr(DCRN_EBC0_CFGDATA);
71
72 if ((bxcr & EBC_BXCR_BU) != EBC_BXCR_BU_OFF) {
73 *p++ = i;
74 *p++ = 0;
75 *p++ = bxcr & EBC_BXCR_BAS;
76 *p++ = EBC_BXCR_BANK_SIZE(bxcr);
77 }
78 }
79
80 devp = finddevice(ebc);
81 if (! devp)
82 fatal("Couldn't locate EBC node %s\n\r", ebc);
83
84 setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
85}
diff --git a/arch/powerpc/boot/44x.h b/arch/powerpc/boot/44x.h
index 577982c9a3cd..ad33dcc95ae5 100644
--- a/arch/powerpc/boot/44x.h
+++ b/arch/powerpc/boot/44x.h
@@ -10,10 +10,7 @@
10#ifndef _PPC_BOOT_44X_H_ 10#ifndef _PPC_BOOT_44X_H_
11#define _PPC_BOOT_44X_H_ 11#define _PPC_BOOT_44X_H_
12 12
13void ibm44x_fixup_memsize(void);
14void ibm4xx_fixup_ebc_ranges(const char *ebc);
15
16void ibm44x_dbcr_reset(void);
17void ebony_init(void *mac0, void *mac1); 13void ebony_init(void *mac0, void *mac1);
14void bamboo_init(void);
18 15
19#endif /* _PPC_BOOT_44X_H_ */ 16#endif /* _PPC_BOOT_44X_H_ */
diff --git a/arch/powerpc/boot/4xx.c b/arch/powerpc/boot/4xx.c
new file mode 100644
index 000000000000..ebf9e217612d
--- /dev/null
+++ b/arch/powerpc/boot/4xx.c
@@ -0,0 +1,300 @@
1/*
2 * Copyright 2007 David Gibson, IBM Corporation.
3 *
4 * Based on earlier code:
5 * Matt Porter <mporter@kernel.crashing.org>
6 * Copyright 2002-2005 MontaVista Software Inc.
7 *
8 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9 * Copyright (c) 2003, 2004 Zultys Technologies
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16#include <stddef.h>
17#include "types.h"
18#include "string.h"
19#include "stdio.h"
20#include "ops.h"
21#include "reg.h"
22#include "dcr.h"
23
24/* Read the 4xx SDRAM controller to get size of system memory. */
25void ibm4xx_fixup_memsize(void)
26{
27 int i;
28 unsigned long memsize, bank_config;
29
30 memsize = 0;
31 for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
32 mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
33 bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
34
35 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
36 memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
37 }
38
39 dt_fixup_memory(0, memsize);
40}
41
42/* 4xx DDR1/2 Denali memory controller support */
43/* DDR0 registers */
44#define DDR0_02 2
45#define DDR0_08 8
46#define DDR0_10 10
47#define DDR0_14 14
48#define DDR0_42 42
49#define DDR0_43 43
50
51/* DDR0_02 */
52#define DDR_START 0x1
53#define DDR_START_SHIFT 0
54#define DDR_MAX_CS_REG 0x3
55#define DDR_MAX_CS_REG_SHIFT 24
56#define DDR_MAX_COL_REG 0xf
57#define DDR_MAX_COL_REG_SHIFT 16
58#define DDR_MAX_ROW_REG 0xf
59#define DDR_MAX_ROW_REG_SHIFT 8
60/* DDR0_08 */
61#define DDR_DDR2_MODE 0x1
62#define DDR_DDR2_MODE_SHIFT 0
63/* DDR0_10 */
64#define DDR_CS_MAP 0x3
65#define DDR_CS_MAP_SHIFT 8
66/* DDR0_14 */
67#define DDR_REDUC 0x1
68#define DDR_REDUC_SHIFT 16
69/* DDR0_42 */
70#define DDR_APIN 0x7
71#define DDR_APIN_SHIFT 24
72/* DDR0_43 */
73#define DDR_COL_SZ 0x7
74#define DDR_COL_SZ_SHIFT 8
75#define DDR_BANK8 0x1
76#define DDR_BANK8_SHIFT 0
77
78#define DDR_GET_VAL(val, mask, shift) (((val) >> (shift)) & (mask))
79
80static inline u32 mfdcr_sdram0(u32 reg)
81{
82 mtdcr(DCRN_SDRAM0_CFGADDR, reg);
83 return mfdcr(DCRN_SDRAM0_CFGDATA);
84}
85
86void ibm4xx_denali_fixup_memsize(void)
87{
88 u32 val, max_cs, max_col, max_row;
89 u32 cs, col, row, bank, dpath;
90 unsigned long memsize;
91
92 val = mfdcr_sdram0(DDR0_02);
93 if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT))
94 fatal("DDR controller is not initialized\n");
95
96 /* get maximum cs col and row values */
97 max_cs = DDR_GET_VAL(val, DDR_MAX_CS_REG, DDR_MAX_CS_REG_SHIFT);
98 max_col = DDR_GET_VAL(val, DDR_MAX_COL_REG, DDR_MAX_COL_REG_SHIFT);
99 max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT);
100
101 /* get CS value */
102 val = mfdcr_sdram0(DDR0_10);
103
104 val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
105 cs = 0;
106 while (val) {
107 if (val && 0x1)
108 cs++;
109 val = val >> 1;
110 }
111
112 if (!cs)
113 fatal("No memory installed\n");
114 if (cs > max_cs)
115 fatal("DDR wrong CS configuration\n");
116
117 /* get data path bytes */
118 val = mfdcr_sdram0(DDR0_14);
119
120 if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
121 dpath = 8; /* 64 bits */
122 else
123 dpath = 4; /* 32 bits */
124
125 /* get adress pins (rows) */
126 val = mfdcr_sdram0(DDR0_42);
127
128 row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT);
129 if (row > max_row)
130 fatal("DDR wrong APIN configuration\n");
131 row = max_row - row;
132
133 /* get collomn size and banks */
134 val = mfdcr_sdram0(DDR0_43);
135
136 col = DDR_GET_VAL(val, DDR_COL_SZ, DDR_COL_SZ_SHIFT);
137 if (col > max_col)
138 fatal("DDR wrong COL configuration\n");
139 col = max_col - col;
140
141 if (DDR_GET_VAL(val, DDR_BANK8, DDR_BANK8_SHIFT))
142 bank = 8; /* 8 banks */
143 else
144 bank = 4; /* 4 banks */
145
146 memsize = cs * (1 << (col+row)) * bank * dpath;
147 dt_fixup_memory(0, memsize);
148}
149
150#define SPRN_DBCR0_40X 0x3F2
151#define SPRN_DBCR0_44X 0x134
152#define DBCR0_RST_SYSTEM 0x30000000
153
154void ibm44x_dbcr_reset(void)
155{
156 unsigned long tmp;
157
158 asm volatile (
159 "mfspr %0,%1\n"
160 "oris %0,%0,%2@h\n"
161 "mtspr %1,%0"
162 : "=&r"(tmp) : "i"(SPRN_DBCR0_44X), "i"(DBCR0_RST_SYSTEM)
163 );
164
165}
166
167void ibm40x_dbcr_reset(void)
168{
169 unsigned long tmp;
170
171 asm volatile (
172 "mfspr %0,%1\n"
173 "oris %0,%0,%2@h\n"
174 "mtspr %1,%0"
175 : "=&r"(tmp) : "i"(SPRN_DBCR0_40X), "i"(DBCR0_RST_SYSTEM)
176 );
177}
178
179#define EMAC_RESET 0x20000000
180void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
181{
182 /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
183 if (emac0)
184 *emac0 = EMAC_RESET;
185 if (emac1)
186 *emac1 = EMAC_RESET;
187
188 mtdcr(DCRN_MAL0_CFG, MAL_RESET);
189}
190
191/* Read 4xx EBC bus bridge registers to get mappings of the peripheral
192 * banks into the OPB address space */
193void ibm4xx_fixup_ebc_ranges(const char *ebc)
194{
195 void *devp;
196 u32 bxcr;
197 u32 ranges[EBC_NUM_BANKS*4];
198 u32 *p = ranges;
199 int i;
200
201 for (i = 0; i < EBC_NUM_BANKS; i++) {
202 mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i));
203 bxcr = mfdcr(DCRN_EBC0_CFGDATA);
204
205 if ((bxcr & EBC_BXCR_BU) != EBC_BXCR_BU_OFF) {
206 *p++ = i;
207 *p++ = 0;
208 *p++ = bxcr & EBC_BXCR_BAS;
209 *p++ = EBC_BXCR_BANK_SIZE(bxcr);
210 }
211 }
212
213 devp = finddevice(ebc);
214 if (! devp)
215 fatal("Couldn't locate EBC node %s\n\r", ebc);
216
217 setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
218}
219
220#define SPRN_CCR1 0x378
221void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
222{
223 u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
224 u32 reg;
225 u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
226
227 mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
228 reg = mfdcr(DCRN_CPR0_DATA);
229 tmp = (reg & 0x000F0000) >> 16;
230 fwdva = tmp ? tmp : 16;
231 tmp = (reg & 0x00000700) >> 8;
232 fwdvb = tmp ? tmp : 8;
233 tmp = (reg & 0x1F000000) >> 24;
234 fbdv = tmp ? tmp : 32;
235 lfbdv = (reg & 0x0000007F);
236
237 mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
238 reg = mfdcr(DCRN_CPR0_DATA);
239 tmp = (reg & 0x03000000) >> 24;
240 opbdv0 = tmp ? tmp : 4;
241
242 mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
243 reg = mfdcr(DCRN_CPR0_DATA);
244 tmp = (reg & 0x07000000) >> 24;
245 perdv0 = tmp ? tmp : 8;
246
247 mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
248 reg = mfdcr(DCRN_CPR0_DATA);
249 tmp = (reg & 0x07000000) >> 24;
250 prbdv0 = tmp ? tmp : 8;
251
252 mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
253 reg = mfdcr(DCRN_CPR0_DATA);
254 tmp = (reg & 0x03000000) >> 24;
255 spcid0 = tmp ? tmp : 4;
256
257 /* Calculate M */
258 mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
259 reg = mfdcr(DCRN_CPR0_DATA);
260 tmp = (reg & 0x03000000) >> 24;
261 if (tmp == 0) { /* PLL output */
262 tmp = (reg & 0x20000000) >> 29;
263 if (!tmp) /* PLLOUTA */
264 m = fbdv * lfbdv * fwdva;
265 else
266 m = fbdv * lfbdv * fwdvb;
267 }
268 else if (tmp == 1) /* CPU output */
269 m = fbdv * fwdva;
270 else
271 m = perdv0 * opbdv0 * fwdvb;
272
273 vco = (m * sysclk) + (m >> 1);
274 cpu = vco / fwdva;
275 plb = vco / fwdvb / prbdv0;
276 opb = plb / opbdv0;
277 ebc = plb / perdv0;
278
279 /* FIXME */
280 uart0 = ser_clk;
281
282 /* Figure out timebase. Either CPU or default TmrClk */
283 asm volatile (
284 "mfspr %0,%1\n"
285 :
286 "=&r"(reg) : "i"(SPRN_CCR1));
287 if (reg & 0x0080)
288 tb = 25000000; /* TmrClk is 25MHz */
289 else
290 tb = cpu;
291
292 dt_fixup_cpu_clocks(cpu, tb, 0);
293 dt_fixup_clock("/plb", plb);
294 dt_fixup_clock("/plb/opb", opb);
295 dt_fixup_clock("/plb/opb/ebc", ebc);
296 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
297 dt_fixup_clock("/plb/opb/serial@ef600400", uart0);
298 dt_fixup_clock("/plb/opb/serial@ef600500", uart0);
299 dt_fixup_clock("/plb/opb/serial@ef600600", uart0);
300}
diff --git a/arch/powerpc/boot/4xx.h b/arch/powerpc/boot/4xx.h
new file mode 100644
index 000000000000..adba6a599a93
--- /dev/null
+++ b/arch/powerpc/boot/4xx.h
@@ -0,0 +1,22 @@
1/*
2 * PowerPC 4xx related functions
3 *
4 * Copyright 2007 IBM Corporation.
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11#ifndef _POWERPC_BOOT_4XX_H_
12#define _POWERPC_BOOT_4XX_H_
13
14void ibm4xx_fixup_memsize(void);
15void ibm4xx_denali_fixup_memsize(void);
16void ibm44x_dbcr_reset(void);
17void ibm40x_dbcr_reset(void);
18void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
19void ibm4xx_fixup_ebc_ranges(const char *ebc);
20void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk);
21
22#endif /* _POWERPC_BOOT_4XX_H_ */
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 61a6f34ca5ed..fd16577a40d5 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -31,7 +31,7 @@ endif
31 31
32BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 32BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
33 33
34$(obj)/44x.o: BOOTCFLAGS += -mcpu=440 34$(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
35$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 35$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
36 36
37zlib := inffast.c inflate.c inftrees.c 37zlib := inffast.c inflate.c inftrees.c
@@ -44,10 +44,12 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
44src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 44src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
45 ns16550.c serial.c simple_alloc.c div64.S util.S \ 45 ns16550.c serial.c simple_alloc.c div64.S util.S \
46 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 46 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
47 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c 47 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
48 cpm-serial.c
48src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ 49src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \
49 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 50 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
50 ps3-head.S ps3-hvcall.S ps3.c 51 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
52 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c
51src-boot := $(src-wlib) $(src-plat) empty.c 53src-boot := $(src-wlib) $(src-plat) empty.c
52 54
53src-boot := $(addprefix $(obj)/, $(src-boot)) 55src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -139,9 +141,14 @@ image-$(CONFIG_PPC_ISERIES) += zImage.iseries
139image-$(CONFIG_DEFAULT_UIMAGE) += uImage 141image-$(CONFIG_DEFAULT_UIMAGE) += uImage
140 142
141ifneq ($(CONFIG_DEVICE_TREE),"") 143ifneq ($(CONFIG_DEVICE_TREE),"")
144image-$(CONFIG_PPC_8xx) += cuImage.8xx
145image-$(CONFIG_8260) += cuImage.pq2
142image-$(CONFIG_PPC_83xx) += cuImage.83xx 146image-$(CONFIG_PPC_83xx) += cuImage.83xx
143image-$(CONFIG_PPC_85xx) += cuImage.85xx 147image-$(CONFIG_PPC_85xx) += cuImage.85xx
144image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 148image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
149image-$(CONFIG_BAMBOO) += treeImage.bamboo
150image-$(CONFIG_SEQUOIA) += cuImage.sequoia
151image-$(CONFIG_WALNUT) += treeImage.walnut
145endif 152endif
146 153
147# For 32-bit powermacs, build the COFF and miboot images 154# For 32-bit powermacs, build the COFF and miboot images
diff --git a/arch/powerpc/boot/bamboo.c b/arch/powerpc/boot/bamboo.c
new file mode 100644
index 000000000000..bc097694b445
--- /dev/null
+++ b/arch/powerpc/boot/bamboo.c
@@ -0,0 +1,45 @@
1/*
2 * Copyright IBM Corporation, 2007
3 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
4 *
5 * Based on ebony wrapper:
6 * Copyright 2007 David Gibson, IBM Corporation.
7 *
8 * Clocking code based on code by:
9 * Stefan Roese <sr@denx.de>
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; version 2 of the License
14 */
15#include <stdarg.h>
16#include <stddef.h>
17#include "types.h"
18#include "elf.h"
19#include "string.h"
20#include "stdio.h"
21#include "page.h"
22#include "ops.h"
23#include "dcr.h"
24#include "4xx.h"
25#include "44x.h"
26
27extern char _dtb_start[];
28extern char _dtb_end[];
29
30static void bamboo_fixups(void)
31{
32 unsigned long sysclk = 33333333;
33
34 ibm440ep_fixup_clocks(sysclk, 11059200);
35 ibm4xx_fixup_memsize();
36 ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
37}
38
39void bamboo_init(void)
40{
41 platform_ops.fixups = bamboo_fixups;
42 platform_ops.exit = ibm44x_dbcr_reset;
43 ft_init(_dtb_start, 0, 32);
44 serial_console_init();
45}
diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c
new file mode 100644
index 000000000000..fcb8b5e956bd
--- /dev/null
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -0,0 +1,249 @@
1/*
2 * CPM serial console support.
3 *
4 * Copyright 2007 Freescale Semiconductor, Inc.
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * It is assumed that the firmware (or the platform file) has already set
8 * up the port.
9 */
10
11#include "types.h"
12#include "io.h"
13#include "ops.h"
14
15struct cpm_scc {
16 u32 gsmrl;
17 u32 gsmrh;
18 u16 psmr;
19 u8 res1[2];
20 u16 todr;
21 u16 dsr;
22 u16 scce;
23 u8 res2[2];
24 u16 sccm;
25 u8 res3;
26 u8 sccs;
27 u8 res4[8];
28};
29
30struct cpm_smc {
31 u8 res1[2];
32 u16 smcmr;
33 u8 res2[2];
34 u8 smce;
35 u8 res3[3];
36 u8 smcm;
37 u8 res4[5];
38};
39
40struct cpm_param {
41 u16 rbase;
42 u16 tbase;
43 u8 rfcr;
44 u8 tfcr;
45};
46
47struct cpm_bd {
48 u16 sc; /* Status and Control */
49 u16 len; /* Data length in buffer */
50 u8 *addr; /* Buffer address in host memory */
51};
52
53static void *cpcr;
54static struct cpm_param *param;
55static struct cpm_smc *smc;
56static struct cpm_scc *scc;
57struct cpm_bd *tbdf, *rbdf;
58static u32 cpm_cmd;
59static u8 *dpram_start;
60
61static void (*do_cmd)(int op);
62static void (*enable_port)(void);
63static void (*disable_port)(void);
64
65#define CPM_CMD_STOP_TX 4
66#define CPM_CMD_RESTART_TX 6
67#define CPM_CMD_INIT_RX_TX 0
68
69static void cpm1_cmd(int op)
70{
71 while (in_be16(cpcr) & 1)
72 ;
73
74 out_be16(cpcr, (op << 8) | cpm_cmd | 1);
75
76 while (in_be16(cpcr) & 1)
77 ;
78}
79
80static void cpm2_cmd(int op)
81{
82 while (in_be32(cpcr) & 0x10000)
83 ;
84
85 out_be32(cpcr, op | cpm_cmd | 0x10000);
86
87 while (in_be32(cpcr) & 0x10000)
88 ;
89}
90
91static void smc_disable_port(void)
92{
93 do_cmd(CPM_CMD_STOP_TX);
94 out_be16(&smc->smcmr, in_be16(&smc->smcmr) & ~3);
95}
96
97static void scc_disable_port(void)
98{
99 do_cmd(CPM_CMD_STOP_TX);
100 out_be32(&scc->gsmrl, in_be32(&scc->gsmrl) & ~0x30);
101}
102
103static void smc_enable_port(void)
104{
105 out_be16(&smc->smcmr, in_be16(&smc->smcmr) | 3);
106 do_cmd(CPM_CMD_RESTART_TX);
107}
108
109static void scc_enable_port(void)
110{
111 out_be32(&scc->gsmrl, in_be32(&scc->gsmrl) | 0x30);
112 do_cmd(CPM_CMD_RESTART_TX);
113}
114
115static int cpm_serial_open(void)
116{
117 int dpaddr = 0x800;
118 disable_port();
119
120 out_8(&param->rfcr, 0x10);
121 out_8(&param->tfcr, 0x10);
122
123 rbdf = (struct cpm_bd *)(dpram_start + dpaddr);
124 rbdf->addr = (u8 *)(rbdf + 2);
125 rbdf->sc = 0xa000;
126 rbdf->len = 1;
127
128 tbdf = rbdf + 1;
129 tbdf->addr = (u8 *)(rbdf + 2) + 1;
130 tbdf->sc = 0x2000;
131 tbdf->len = 1;
132
133 sync();
134 out_be16(&param->rbase, dpaddr);
135 out_be16(&param->tbase, dpaddr + sizeof(struct cpm_bd));
136
137 do_cmd(CPM_CMD_INIT_RX_TX);
138
139 enable_port();
140 return 0;
141}
142
143static void cpm_serial_putc(unsigned char c)
144{
145 while (tbdf->sc & 0x8000)
146 barrier();
147
148 sync();
149
150 tbdf->addr[0] = c;
151 eieio();
152 tbdf->sc |= 0x8000;
153}
154
155static unsigned char cpm_serial_tstc(void)
156{
157 barrier();
158 return !(rbdf->sc & 0x8000);
159}
160
161static unsigned char cpm_serial_getc(void)
162{
163 unsigned char c;
164
165 while (!cpm_serial_tstc())
166 ;
167
168 sync();
169 c = rbdf->addr[0];
170 eieio();
171 rbdf->sc |= 0x8000;
172
173 return c;
174}
175
176int cpm_console_init(void *devp, struct serial_console_data *scdp)
177{
178 void *reg_virt[2];
179 int is_smc = 0, is_cpm2 = 0, n;
180 unsigned long reg_phys;
181 void *parent;
182
183 if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) {
184 is_smc = 1;
185 } else if (dt_is_compatible(devp, "fsl,cpm2-scc-uart")) {
186 is_cpm2 = 1;
187 } else if (dt_is_compatible(devp, "fsl,cpm2-smc-uart")) {
188 is_cpm2 = 1;
189 is_smc = 1;
190 }
191
192 if (is_smc) {
193 enable_port = smc_enable_port;
194 disable_port = smc_disable_port;
195 } else {
196 enable_port = scc_enable_port;
197 disable_port = scc_disable_port;
198 }
199
200 if (is_cpm2)
201 do_cmd = cpm2_cmd;
202 else
203 do_cmd = cpm1_cmd;
204
205 n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4);
206 if (n < 4)
207 return -1;
208
209 n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt));
210 if (n < (int)sizeof(reg_virt)) {
211 for (n = 0; n < 2; n++) {
212 if (!dt_xlate_reg(devp, n, &reg_phys, NULL))
213 return -1;
214
215 reg_virt[n] = (void *)reg_phys;
216 }
217 }
218
219 if (is_smc)
220 smc = reg_virt[0];
221 else
222 scc = reg_virt[0];
223
224 param = reg_virt[1];
225
226 parent = get_parent(devp);
227 if (!parent)
228 return -1;
229
230 n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt));
231 if (n < (int)sizeof(reg_virt)) {
232 for (n = 0; n < 2; n++) {
233 if (!dt_xlate_reg(parent, n, &reg_phys, NULL))
234 return -1;
235
236 reg_virt[n] = (void *)reg_phys;
237 }
238 }
239
240 cpcr = reg_virt[0];
241 dpram_start = reg_virt[1];
242
243 scdp->open = cpm_serial_open;
244 scdp->putc = cpm_serial_putc;
245 scdp->getc = cpm_serial_getc;
246 scdp->tstc = cpm_serial_tstc;
247
248 return 0;
249}
diff --git a/arch/powerpc/boot/cuboot-83xx.c b/arch/powerpc/boot/cuboot-83xx.c
index 296025d8b295..a0505509abcc 100644
--- a/arch/powerpc/boot/cuboot-83xx.c
+++ b/arch/powerpc/boot/cuboot-83xx.c
@@ -18,7 +18,6 @@
18#include "ppcboot.h" 18#include "ppcboot.h"
19 19
20static bd_t bd; 20static bd_t bd;
21extern char _dtb_start[], _dtb_end[];
22 21
23static void platform_fixups(void) 22static void platform_fixups(void)
24{ 23{
diff --git a/arch/powerpc/boot/cuboot-85xx.c b/arch/powerpc/boot/cuboot-85xx.c
index 10f0f697c935..345dcbecef0f 100644
--- a/arch/powerpc/boot/cuboot-85xx.c
+++ b/arch/powerpc/boot/cuboot-85xx.c
@@ -18,7 +18,6 @@
18#include "ppcboot.h" 18#include "ppcboot.h"
19 19
20static bd_t bd; 20static bd_t bd;
21extern char _dtb_start[], _dtb_end[];
22 21
23static void platform_fixups(void) 22static void platform_fixups(void)
24{ 23{
diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c
new file mode 100644
index 000000000000..88ed84015a8b
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-8xx.c
@@ -0,0 +1,45 @@
1/*
2 * Old U-boot compatibility for 8xx
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 Freescale Semiconductor, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "ops.h"
14#include "stdio.h"
15#include "cuboot.h"
16
17#define TARGET_8xx
18#define TARGET_HAS_ETH1
19#include "ppcboot.h"
20
21static bd_t bd;
22
23static void platform_fixups(void)
24{
25 void *node;
26
27 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
28 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
29 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
30
31 node = finddevice("/soc/cpm");
32 if (node) {
33 setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
34 setprop(node, "fsl,brg-frequency", &bd.bi_busfreq, 4);
35 }
36}
37
38void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
39 unsigned long r6, unsigned long r7)
40{
41 CUBOOT_INIT();
42 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
43 serial_console_init();
44 platform_ops.fixups = platform_fixups;
45}
diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c
new file mode 100644
index 000000000000..8021fd4a43bc
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-pq2.c
@@ -0,0 +1,283 @@
1/*
2 * Old U-boot compatibility for PowerQUICC II
3 * (a.k.a. 82xx with CPM, not the 8240 family of chips)
4 *
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#include "ops.h"
15#include "stdio.h"
16#include "cuboot.h"
17#include "io.h"
18
19#define TARGET_CPM2
20#define TARGET_HAS_ETH1
21#include "ppcboot.h"
22
23static bd_t bd;
24
25struct cs_range {
26 u32 csnum;
27 u32 base; /* must be zero */
28 u32 addr;
29 u32 size;
30};
31
32struct pci_range {
33 u32 flags;
34 u32 pci_addr[2];
35 u32 phys_addr;
36 u32 size[2];
37};
38
39struct cs_range cs_ranges_buf[MAX_PROP_LEN / sizeof(struct cs_range)];
40struct pci_range pci_ranges_buf[MAX_PROP_LEN / sizeof(struct pci_range)];
41
42/* Different versions of u-boot put the BCSR in different places, and
43 * some don't set up the PCI PIC at all, so we assume the device tree is
44 * sane and update the BRx registers appropriately.
45 *
46 * For any node defined as compatible with fsl,pq2-chipselect,
47 * #address/#size must be 2/1 for chipselect bus, 1/1 for parent bus,
48 * and ranges must be for whole chip selects.
49 */
50static void update_cs_ranges(void)
51{
52 u32 ctrl_ph;
53 void *ctrl_node, *bus_node, *parent_node;
54 u32 *ctrl_addr;
55 unsigned long ctrl_size;
56 u32 naddr, nsize;
57 int len;
58 int i;
59
60 bus_node = finddevice("/chipselect");
61 if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-chipselect"))
62 return;
63
64 dt_get_reg_format(bus_node, &naddr, &nsize);
65 if (naddr != 2 || nsize != 1)
66 goto err;
67
68 parent_node = get_parent(bus_node);
69 if (!parent_node)
70 goto err;
71
72 dt_get_reg_format(parent_node, &naddr, &nsize);
73 if (naddr != 1 || nsize != 1)
74 goto err;
75
76 len = getprop(bus_node, "fsl,ctrl", &ctrl_ph, 4);
77 if (len != 4)
78 goto err;
79
80 ctrl_node = find_node_by_prop_value(NULL, "linux,phandle",
81 (char *)&ctrl_ph, 4);
82 if (!ctrl_node)
83 goto err;
84
85 if (!dt_is_compatible(ctrl_node, "fsl,pq2-chipselect-ctrl"))
86 goto err;
87
88 if (!dt_xlate_reg(ctrl_node, 0, (unsigned long *)&ctrl_addr,
89 &ctrl_size))
90 goto err;
91
92 len = getprop(bus_node, "ranges", cs_ranges_buf, sizeof(cs_ranges_buf));
93
94 for (i = 0; i < len / sizeof(struct cs_range); i++) {
95 u32 base, option;
96 int cs = cs_ranges_buf[i].csnum;
97 if (cs >= ctrl_size / 8)
98 goto err;
99
100 if (cs_ranges_buf[i].base != 0)
101 goto err;
102
103 base = in_be32(&ctrl_addr[cs * 2]);
104
105 /* If CS is already valid, use the existing flags.
106 * Otherwise, guess a sane default.
107 */
108 if (base & 1) {
109 base &= 0x7fff;
110 option = in_be32(&ctrl_addr[cs * 2 + 1]) & 0x7fff;
111 } else {
112 base = 0x1801;
113 option = 0x10;
114 }
115
116 out_be32(&ctrl_addr[cs * 2], 0);
117 out_be32(&ctrl_addr[cs * 2 + 1],
118 option | ~(cs_ranges_buf[i].size - 1));
119 out_be32(&ctrl_addr[cs * 2], base | cs_ranges_buf[i].addr);
120 }
121
122 return;
123
124err:
125 printf("Bad /chipselect or fsl,pq2-chipselect-ctrl node\r\n");
126}
127
128/* Older u-boots don't set PCI up properly. Update the hardware to match
129 * the device tree. The prefetch mem region and non-prefetch mem region
130 * must be contiguous in the host bus. As required by the PCI binding,
131 * PCI #addr/#size must be 3/2. The parent bus must be 1/1. Only
132 * 32-bit PCI is supported. All three region types (prefetchable mem,
133 * non-prefetchable mem, and I/O) must be present.
134 */
135static void fixup_pci(void)
136{
137 struct pci_range *mem = NULL, *mmio = NULL,
138 *io = NULL, *mem_base = NULL;
139 u32 *pci_regs[3];
140 u8 *soc_regs;
141 int i, len;
142 void *ctrl_node, *bus_node, *parent_node, *soc_node;
143 u32 naddr, nsize, bus_ph, mem_log2;
144
145 ctrl_node = finddevice("/soc/pci");
146 if (!ctrl_node || !dt_is_compatible(ctrl_node, "fsl,pq2-pci"))
147 return;
148
149 soc_node = finddevice("/soc");
150 if (!soc_node || !dt_is_compatible(soc_node, "fsl,pq2-soc"))
151 goto err;
152
153 for (i = 0; i < 3; i++)
154 if (!dt_xlate_reg(ctrl_node, i,
155 (unsigned long *)&pci_regs[i], NULL))
156 goto err;
157
158 if (!dt_xlate_reg(soc_node, 0, (unsigned long *)&soc_regs, NULL))
159 goto err;
160
161 len = getprop(ctrl_node, "fsl,bus", &bus_ph, 4);
162 if (len != 4)
163 goto err;
164
165 bus_node = find_node_by_prop_value(NULL, "linux,phandle",
166 (char *)&bus_ph, 4);
167 if (!bus_node)
168 goto err;
169
170 dt_get_reg_format(bus_node, &naddr, &nsize);
171 if (naddr != 3 || nsize != 2)
172 goto err;
173
174 parent_node = get_parent(bus_node);
175 if (!parent_node)
176 goto err;
177
178 dt_get_reg_format(parent_node, &naddr, &nsize);
179 if (naddr != 1 || nsize != 1)
180 goto err;
181
182 len = getprop(bus_node, "ranges", pci_ranges_buf,
183 sizeof(pci_ranges_buf));
184
185 for (i = 0; i < len / sizeof(struct pci_range); i++) {
186 u32 flags = pci_ranges_buf[i].flags & 0x43000000;
187
188 if (flags == 0x42000000)
189 mem = &pci_ranges_buf[i];
190 else if (flags == 0x02000000)
191 mmio = &pci_ranges_buf[i];
192 else if (flags == 0x01000000)
193 io = &pci_ranges_buf[i];
194 }
195
196 if (!mem || !mmio || !io)
197 goto err;
198
199 if (mem->phys_addr + mem->size[1] == mmio->phys_addr)
200 mem_base = mem;
201 else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr)
202 mem_base = mmio;
203 else
204 goto err;
205
206 out_be32(&pci_regs[1][0], mem_base->phys_addr | 1);
207 out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1));
208
209 out_be32(&pci_regs[1][1], io->phys_addr | 1);
210 out_be32(&pci_regs[2][1], ~(io->size[1] - 1));
211
212 out_le32(&pci_regs[0][0], mem->pci_addr[1] >> 12);
213 out_le32(&pci_regs[0][2], mem->phys_addr >> 12);
214 out_le32(&pci_regs[0][4], (~(mem->size[1] - 1) >> 12) | 0xa0000000);
215
216 out_le32(&pci_regs[0][6], mmio->pci_addr[1] >> 12);
217 out_le32(&pci_regs[0][8], mmio->phys_addr >> 12);
218 out_le32(&pci_regs[0][10], (~(mmio->size[1] - 1) >> 12) | 0x80000000);
219
220 out_le32(&pci_regs[0][12], io->pci_addr[1] >> 12);
221 out_le32(&pci_regs[0][14], io->phys_addr >> 12);
222 out_le32(&pci_regs[0][16], (~(io->size[1] - 1) >> 12) | 0xc0000000);
223
224 /* Inbound translation */
225 out_le32(&pci_regs[0][58], 0);
226 out_le32(&pci_regs[0][60], 0);
227
228 mem_log2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1);
229 out_le32(&pci_regs[0][62], 0xa0000000 | ~((1 << (mem_log2 - 12)) - 1));
230
231 /* If PCI is disabled, drive RST high to enable. */
232 if (!(in_le32(&pci_regs[0][32]) & 1)) {
233 /* Tpvrh (Power valid to RST# high) 100 ms */
234 udelay(100000);
235
236 out_le32(&pci_regs[0][32], 1);
237
238 /* Trhfa (RST# high to first cfg access) 2^25 clocks */
239 udelay(1020000);
240 }
241
242 /* Enable bus master and memory access */
243 out_le32(&pci_regs[0][64], 0x80000004);
244 out_le32(&pci_regs[0][65], in_le32(&pci_regs[0][65]) | 6);
245
246 /* Park the bus on PCI, and elevate PCI's arbitration priority,
247 * as required by section 9.6 of the user's manual.
248 */
249 out_8(&soc_regs[0x10028], 3);
250 out_be32((u32 *)&soc_regs[0x1002c], 0x01236745);
251
252 return;
253
254err:
255 printf("Bad PCI node\r\n");
256}
257
258static void pq2_platform_fixups(void)
259{
260 void *node;
261
262 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
263 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
264 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
265
266 node = finddevice("/soc/cpm");
267 if (node) {
268 setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4);
269 setprop(node, "fsl,brg-frequency", &bd.bi_brgfreq, 4);
270 }
271
272 update_cs_ranges();
273 fixup_pci();
274}
275
276void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
277 unsigned long r6, unsigned long r7)
278{
279 CUBOOT_INIT();
280 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
281 serial_console_init();
282 platform_ops.fixups = pq2_platform_fixups;
283}
diff --git a/arch/powerpc/boot/cuboot-sequoia.c b/arch/powerpc/boot/cuboot-sequoia.c
new file mode 100644
index 000000000000..ec635e0bd4ec
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-sequoia.c
@@ -0,0 +1,56 @@
1/*
2 * Old U-boot compatibility for Sequoia
3 *
4 * Valentine Barshak <vbarshak@ru.mvista.com>
5 * Copyright 2007 MontaVista Software, Inc
6 *
7 * Based on Ebony code by David Gibson <david@gibson.dropbear.id.au>
8 * Copyright IBM Corporation, 2007
9 *
10 * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
11 * Copyright IBM Corporation, 2007
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; version 2 of the License
16 */
17
18#include <stdarg.h>
19#include <stddef.h>
20#include "types.h"
21#include "elf.h"
22#include "string.h"
23#include "stdio.h"
24#include "page.h"
25#include "ops.h"
26#include "dcr.h"
27#include "4xx.h"
28#include "44x.h"
29#include "cuboot.h"
30
31#define TARGET_4xx
32#define TARGET_44x
33#include "ppcboot.h"
34
35static bd_t bd;
36
37
38static void sequoia_fixups(void)
39{
40 unsigned long sysclk = 33333333;
41
42 ibm440ep_fixup_clocks(sysclk, 11059200);
43 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
44 ibm4xx_denali_fixup_memsize();
45 dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
46}
47
48void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
49 unsigned long r6, unsigned long r7)
50{
51 CUBOOT_INIT();
52 platform_ops.fixups = sequoia_fixups;
53 platform_ops.exit = ibm44x_dbcr_reset;
54 ft_init(_dtb_start, 0, 32);
55 serial_console_init();
56}
diff --git a/arch/powerpc/boot/cuboot.c b/arch/powerpc/boot/cuboot.c
index 65795468ad6f..7768b2306b7a 100644
--- a/arch/powerpc/boot/cuboot.c
+++ b/arch/powerpc/boot/cuboot.c
@@ -17,9 +17,6 @@
17 17
18#include "ppcboot.h" 18#include "ppcboot.h"
19 19
20extern char _end[];
21extern char _dtb_start[], _dtb_end[];
22
23void cuboot_init(unsigned long r4, unsigned long r5, 20void cuboot_init(unsigned long r4, unsigned long r5,
24 unsigned long r6, unsigned long r7, 21 unsigned long r6, unsigned long r7,
25 unsigned long end_of_ram) 22 unsigned long end_of_ram)
diff --git a/arch/powerpc/boot/dcr.h b/arch/powerpc/boot/dcr.h
index 14b44aa96fea..83b88aa92888 100644
--- a/arch/powerpc/boot/dcr.h
+++ b/arch/powerpc/boot/dcr.h
@@ -121,4 +121,22 @@ static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2C
121#define DCRN_CPC0_MIRQ1 0x0ed 121#define DCRN_CPC0_MIRQ1 0x0ed
122#define DCRN_CPC0_JTAGID 0x0ef 122#define DCRN_CPC0_JTAGID 0x0ef
123 123
124#define DCRN_MAL0_CFG 0x180
125#define MAL_RESET 0x80000000
126
127/* 440EP Clock/Power-on Reset regs */
128#define DCRN_CPR0_ADDR 0xc
129#define DCRN_CPR0_DATA 0xd
130#define CPR0_PLLD0 0x60
131#define CPR0_OPBD0 0xc0
132#define CPR0_PERD0 0xe0
133#define CPR0_PRIMBD0 0xa0
134#define CPR0_SCPID 0x120
135#define CPR0_PLLC0 0x40
136
137/* 405GP Clocking/Power Management/Chip Control regs */
138#define DCRN_CPC0_PLLMR 0xb0
139#define DCRN_405_CPC0_CR0 0xb1
140#define DCRN_405_CPC0_CR1 0xb2
141
124#endif /* _PPC_BOOT_DCR_H_ */ 142#endif /* _PPC_BOOT_DCR_H_ */
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index c9951550ed2c..e1b8122b4393 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -74,6 +74,8 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
74 if (bus > 0) 74 if (bus > 0)
75 setprop_val(devp, "bus-frequency", bus); 75 setprop_val(devp, "bus-frequency", bus);
76 } 76 }
77
78 timebase_period_ns = 1000000000 / tb;
77} 79}
78 80
79void dt_fixup_clock(const char *path, u32 freq) 81void dt_fixup_clock(const char *path, u32 freq)
@@ -111,9 +113,8 @@ void __dt_fixup_mac_addresses(u32 startindex, ...)
111} 113}
112 114
113#define MAX_ADDR_CELLS 4 115#define MAX_ADDR_CELLS 4
114#define MAX_RANGES 8
115 116
116static void get_reg_format(void *node, u32 *naddr, u32 *nsize) 117void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize)
117{ 118{
118 if (getprop(node, "#address-cells", naddr, 4) != 4) 119 if (getprop(node, "#address-cells", naddr, 4) != 4)
119 *naddr = 2; 120 *naddr = 2;
@@ -207,7 +208,7 @@ static int find_range(u32 *reg, u32 *ranges, int nregaddr,
207 * In particular, PCI is not supported. Also, only the beginning of the 208 * In particular, PCI is not supported. Also, only the beginning of the
208 * reg block is tracked; size is ignored except in ranges. 209 * reg block is tracked; size is ignored except in ranges.
209 */ 210 */
210static u32 dt_xlate_buf[MAX_ADDR_CELLS * MAX_RANGES * 3]; 211static u32 prop_buf[MAX_PROP_LEN / 4];
211 212
212static int dt_xlate(void *node, int res, int reglen, unsigned long *addr, 213static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
213 unsigned long *size) 214 unsigned long *size)
@@ -216,14 +217,14 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
216 u32 this_addr[MAX_ADDR_CELLS]; 217 u32 this_addr[MAX_ADDR_CELLS];
217 void *parent; 218 void *parent;
218 u64 ret_addr, ret_size; 219 u64 ret_addr, ret_size;
219 u32 naddr, nsize, prev_naddr; 220 u32 naddr, nsize, prev_naddr, prev_nsize;
220 int buflen, offset; 221 int buflen, offset;
221 222
222 parent = get_parent(node); 223 parent = get_parent(node);
223 if (!parent) 224 if (!parent)
224 return 0; 225 return 0;
225 226
226 get_reg_format(parent, &naddr, &nsize); 227 dt_get_reg_format(parent, &naddr, &nsize);
227 228
228 if (nsize > 2) 229 if (nsize > 2)
229 return 0; 230 return 0;
@@ -231,41 +232,47 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
231 offset = (naddr + nsize) * res; 232 offset = (naddr + nsize) * res;
232 233
233 if (reglen < offset + naddr + nsize || 234 if (reglen < offset + naddr + nsize ||
234 sizeof(dt_xlate_buf) < offset + naddr + nsize) 235 MAX_PROP_LEN < (offset + naddr + nsize) * 4)
235 return 0; 236 return 0;
236 237
237 copy_val(last_addr, dt_xlate_buf + offset, naddr); 238 copy_val(last_addr, prop_buf + offset, naddr);
238 239
239 ret_size = dt_xlate_buf[offset + naddr]; 240 ret_size = prop_buf[offset + naddr];
240 if (nsize == 2) { 241 if (nsize == 2) {
241 ret_size <<= 32; 242 ret_size <<= 32;
242 ret_size |= dt_xlate_buf[offset + naddr + 1]; 243 ret_size |= prop_buf[offset + naddr + 1];
243 } 244 }
244 245
245 while ((node = get_parent(node))) { 246 for (;;) {
246 prev_naddr = naddr; 247 prev_naddr = naddr;
248 prev_nsize = nsize;
249 node = parent;
250
251 parent = get_parent(node);
252 if (!parent)
253 break;
247 254
248 get_reg_format(node, &naddr, &nsize); 255 dt_get_reg_format(parent, &naddr, &nsize);
249 256
250 buflen = getprop(node, "ranges", dt_xlate_buf, 257 buflen = getprop(node, "ranges", prop_buf,
251 sizeof(dt_xlate_buf)); 258 sizeof(prop_buf));
252 if (buflen < 0) 259 if (buflen == 0)
253 continue; 260 continue;
254 if (buflen > sizeof(dt_xlate_buf)) 261 if (buflen < 0 || buflen > sizeof(prop_buf))
255 return 0; 262 return 0;
256 263
257 offset = find_range(last_addr, dt_xlate_buf, prev_naddr, 264 offset = find_range(last_addr, prop_buf, prev_naddr,
258 naddr, nsize, buflen / 4); 265 naddr, prev_nsize, buflen / 4);
259 266
260 if (offset < 0) 267 if (offset < 0)
261 return 0; 268 return 0;
262 269
263 copy_val(this_addr, dt_xlate_buf + offset, prev_naddr); 270 copy_val(this_addr, prop_buf + offset, prev_naddr);
264 271
265 if (!sub_reg(last_addr, this_addr)) 272 if (!sub_reg(last_addr, this_addr))
266 return 0; 273 return 0;
267 274
268 copy_val(this_addr, dt_xlate_buf + offset + prev_naddr, naddr); 275 copy_val(this_addr, prop_buf + offset + prev_naddr, naddr);
269 276
270 if (!add_reg(last_addr, this_addr, naddr)) 277 if (!add_reg(last_addr, this_addr, naddr))
271 return 0; 278 return 0;
@@ -292,16 +299,35 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size)
292{ 299{
293 int reglen; 300 int reglen;
294 301
295 reglen = getprop(node, "reg", dt_xlate_buf, sizeof(dt_xlate_buf)) / 4; 302 reglen = getprop(node, "reg", prop_buf, sizeof(prop_buf)) / 4;
296 return dt_xlate(node, res, reglen, addr, size); 303 return dt_xlate(node, res, reglen, addr, size);
297} 304}
298 305
299int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr) 306int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr)
300{ 307{
301 308
302 if (buflen > sizeof(dt_xlate_buf)) 309 if (buflen > sizeof(prop_buf))
303 return 0; 310 return 0;
304 311
305 memcpy(dt_xlate_buf, buf, buflen); 312 memcpy(prop_buf, buf, buflen);
306 return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL); 313 return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL);
307} 314}
315
316int dt_is_compatible(void *node, const char *compat)
317{
318 char *buf = (char *)prop_buf;
319 int len, pos;
320
321 len = getprop(node, "compatible", buf, MAX_PROP_LEN);
322 if (len < 0)
323 return 0;
324
325 for (pos = 0; pos < len; pos++) {
326 if (!strcmp(buf + pos, compat))
327 return 1;
328
329 pos += strnlen(&buf[pos], len - pos);
330 }
331
332 return 0;
333}
diff --git a/arch/powerpc/boot/dts/bamboo.dts b/arch/powerpc/boot/dts/bamboo.dts
new file mode 100644
index 000000000000..bdd56b0e9460
--- /dev/null
+++ b/arch/powerpc/boot/dts/bamboo.dts
@@ -0,0 +1,244 @@
1/*
2 * Device Tree Source for AMCC Bamboo
3 *
4 * Copyright (c) 2006, 2007 IBM Corp.
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * FIXME: Draft only!
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without
11 * any warranty of any kind, whether express or implied.
12 */
13
14/ {
15 #address-cells = <2>;
16 #size-cells = <1>;
17 model = "amcc,bamboo";
18 compatible = "amcc,bamboo";
19 dcr-parent = <&/cpus/PowerPC,440EP@0>;
20
21 cpus {
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 PowerPC,440EP@0 {
26 device_type = "cpu";
27 reg = <0>;
28 clock-frequency = <0>; /* Filled in by zImage */
29 timebase-frequency = <0>; /* Filled in by zImage */
30 i-cache-line-size = <20>;
31 d-cache-line-size = <20>;
32 i-cache-size = <8000>;
33 d-cache-size = <8000>;
34 dcr-controller;
35 dcr-access-method = "native";
36 };
37 };
38
39 memory {
40 device_type = "memory";
41 reg = <0 0 0>; /* Filled in by zImage */
42 };
43
44 UIC0: interrupt-controller0 {
45 compatible = "ibm,uic-440ep","ibm,uic";
46 interrupt-controller;
47 cell-index = <0>;
48 dcr-reg = <0c0 009>;
49 #address-cells = <0>;
50 #size-cells = <0>;
51 #interrupt-cells = <2>;
52 };
53
54 UIC1: interrupt-controller1 {
55 compatible = "ibm,uic-440ep","ibm,uic";
56 interrupt-controller;
57 cell-index = <1>;
58 dcr-reg = <0d0 009>;
59 #address-cells = <0>;
60 #size-cells = <0>;
61 #interrupt-cells = <2>;
62 interrupts = <1e 4 1f 4>; /* cascade */
63 interrupt-parent = <&UIC0>;
64 };
65
66 SDR0: sdr {
67 compatible = "ibm,sdr-440ep";
68 dcr-reg = <00e 002>;
69 };
70
71 CPR0: cpr {
72 compatible = "ibm,cpr-440ep";
73 dcr-reg = <00c 002>;
74 };
75
76 plb {
77 compatible = "ibm,plb-440ep", "ibm,plb-440gp", "ibm,plb4";
78 #address-cells = <2>;
79 #size-cells = <1>;
80 ranges;
81 clock-frequency = <0>; /* Filled in by zImage */
82
83 SDRAM0: sdram {
84 compatible = "ibm,sdram-440ep", "ibm,sdram-405gp";
85 dcr-reg = <010 2>;
86 };
87
88 DMA0: dma {
89 compatible = "ibm,dma-440ep", "ibm,dma-440gp";
90 dcr-reg = <100 027>;
91 };
92
93 MAL0: mcmal {
94 compatible = "ibm,mcmal-440ep", "ibm,mcmal-440gp", "ibm,mcmal";
95 dcr-reg = <180 62>;
96 num-tx-chans = <4>;
97 num-rx-chans = <4>;
98 interrupt-parent = <&MAL0>;
99 interrupts = <0 1 2 3 4>;
100 #interrupt-cells = <1>;
101 interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
102 /*RXEOB*/ 1 &UIC0 b 4
103 /*SERR*/ 2 &UIC1 0 4
104 /*TXDE*/ 3 &UIC1 1 4
105 /*RXDE*/ 4 &UIC1 3 4>;
106 };
107
108 POB0: opb {
109 compatible = "ibm,opb-440ep", "ibm,opb-440gp", "ibm,opb";
110 #address-cells = <1>;
111 #size-cells = <1>;
112 /* Bamboo is oddball in the 44x world and doesn't use the ERPN
113 * bits.
114 */
115 ranges = <00000000 0 00000000 80000000
116 80000000 0 80000000 80000000>;
117 interrupt-parent = <&UIC1>;
118 interrupts = <7 4>;
119 clock-frequency = <0>; /* Filled in by zImage */
120
121 EBC0: ebc {
122 compatible = "ibm,ebc-440ep", "ibm,ebc-440gp", "ibm,ebc";
123 dcr-reg = <012 2>;
124 #address-cells = <2>;
125 #size-cells = <1>;
126 clock-frequency = <0>; /* Filled in by zImage */
127 ranges;
128 interrupts = <5 1>;
129 interrupt-parent = <&UIC1>;
130 };
131
132 UART0: serial@ef600300 {
133 device_type = "serial";
134 compatible = "ns16550";
135 reg = <ef600300 8>;
136 virtual-reg = <ef600300>;
137 clock-frequency = <0>; /* Filled in by zImage */
138 current-speed = <1c200>;
139 interrupt-parent = <&UIC0>;
140 interrupts = <0 4>;
141 };
142
143 UART1: serial@ef600400 {
144 device_type = "serial";
145 compatible = "ns16550";
146 reg = <ef600400 8>;
147 virtual-reg = <ef600400>;
148 clock-frequency = <0>;
149 current-speed = <0>;
150 interrupt-parent = <&UIC0>;
151 interrupts = <1 4>;
152 };
153
154 UART2: serial@ef600500 {
155 device_type = "serial";
156 compatible = "ns16550";
157 reg = <ef600500 8>;
158 virtual-reg = <ef600500>;
159 clock-frequency = <0>;
160 current-speed = <0>;
161 interrupt-parent = <&UIC0>;
162 interrupts = <3 4>;
163 };
164
165 UART3: serial@ef600600 {
166 device_type = "serial";
167 compatible = "ns16550";
168 reg = <ef600600 8>;
169 virtual-reg = <ef600600>;
170 clock-frequency = <0>;
171 current-speed = <0>;
172 interrupt-parent = <&UIC0>;
173 interrupts = <4 4>;
174 };
175
176 IIC0: i2c@ef600700 {
177 device_type = "i2c";
178 compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
179 reg = <ef600700 14>;
180 interrupt-parent = <&UIC0>;
181 interrupts = <2 4>;
182 };
183
184 IIC1: i2c@ef600800 {
185 device_type = "i2c";
186 compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
187 reg = <ef600800 14>;
188 interrupt-parent = <&UIC0>;
189 interrupts = <7 4>;
190 };
191
192 ZMII0: emac-zmii@ef600d00 {
193 device_type = "zmii-interface";
194 compatible = "ibm,zmii-440ep", "ibm,zmii-440gp", "ibm,zmii";
195 reg = <ef600d00 c>;
196 };
197
198 EMAC0: ethernet@ef600e00 {
199 device_type = "network";
200 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
201 interrupt-parent = <&UIC1>;
202 interrupts = <1c 4 1d 4>;
203 reg = <ef600e00 70>;
204 local-mac-address = [000000000000];
205 mal-device = <&MAL0>;
206 mal-tx-channel = <0 1>;
207 mal-rx-channel = <0>;
208 cell-index = <0>;
209 max-frame-size = <5dc>;
210 rx-fifo-size = <1000>;
211 tx-fifo-size = <800>;
212 phy-mode = "rmii";
213 phy-map = <00000001>;
214 zmii-device = <&ZMII0>;
215 zmii-channel = <0>;
216 };
217
218 EMAC1: ethernet@ef600f00 {
219 device_type = "network";
220 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
221 interrupt-parent = <&UIC1>;
222 interrupts = <1e 4 1f 4>;
223 reg = <ef600f00 70>;
224 local-mac-address = [000000000000];
225 mal-device = <&MAL0>;
226 mal-tx-channel = <2 3>;
227 mal-rx-channel = <1>;
228 cell-index = <1>;
229 max-frame-size = <5dc>;
230 rx-fifo-size = <1000>;
231 tx-fifo-size = <800>;
232 phy-mode = "rmii";
233 phy-map = <00000001>;
234 zmii-device = <&ZMII0>;
235 zmii-channel = <1>;
236 };
237 };
238 };
239
240 chosen {
241 linux,stdout-path = "/plb/opb/serial@ef600300";
242 bootargs = "console=ttyS0,115200";
243 };
244};
diff --git a/arch/powerpc/boot/dts/ebony.dts b/arch/powerpc/boot/dts/ebony.dts
index c5f99613fc7b..37599bda5500 100644
--- a/arch/powerpc/boot/dts/ebony.dts
+++ b/arch/powerpc/boot/dts/ebony.dts
@@ -9,10 +9,6 @@
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without 10 * License version 2. This program is licensed "as is" without
11 * any warranty of any kind, whether express or implied. 11 * any warranty of any kind, whether express or implied.
12 *
13 * To build:
14 * dtc -I dts -O asm -o ebony.S -b 0 ebony.dts
15 * dtc -I dts -O dtb -o ebony.dtb -b 0 ebony.dts
16 */ 12 */
17 13
18/ { 14/ {
@@ -175,6 +171,7 @@
175 fpga@7,0 { 171 fpga@7,0 {
176 compatible = "Ebony-FPGA"; 172 compatible = "Ebony-FPGA";
177 reg = <7 0 10>; 173 reg = <7 0 10>;
174 virtual-reg = <e8300000>;
178 }; 175 };
179 }; 176 };
180 177
diff --git a/arch/powerpc/boot/dts/holly.dts b/arch/powerpc/boot/dts/holly.dts
index 80a4fab8ee37..1a4d0beccc99 100644
--- a/arch/powerpc/boot/dts/holly.dts
+++ b/arch/powerpc/boot/dts/holly.dts
@@ -8,10 +8,6 @@
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without 9 * License version 2. This program is licensed "as is" without
10 * any warranty of any kind, whether express or implied. 10 * any warranty of any kind, whether express or implied.
11 *
12 * To build:
13 * dtc -I dts -O asm -o holly.S -b 0 holly.dts
14 * dtc -I dts -O dtb -o holly.dtb -b 0 holly.dts
15 */ 11 */
16 12
17/ { 13/ {
diff --git a/arch/powerpc/boot/dts/kuroboxHD.dts b/arch/powerpc/boot/dts/kuroboxHD.dts
index 122537419d9f..b0eeff036de3 100644
--- a/arch/powerpc/boot/dts/kuroboxHD.dts
+++ b/arch/powerpc/boot/dts/kuroboxHD.dts
@@ -15,9 +15,6 @@
15 15
16XXXX add flash parts, rtc, ?? 16XXXX add flash parts, rtc, ??
17 17
18build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
19
20
21 */ 18 */
22 19
23/ { 20/ {
diff --git a/arch/powerpc/boot/dts/kuroboxHG.dts b/arch/powerpc/boot/dts/kuroboxHG.dts
index 579aa8b967d9..ccd15a231a10 100644
--- a/arch/powerpc/boot/dts/kuroboxHG.dts
+++ b/arch/powerpc/boot/dts/kuroboxHG.dts
@@ -15,9 +15,6 @@
15 15
16XXXX add flash parts, rtc, ?? 16XXXX add flash parts, rtc, ??
17 17
18build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
19
20
21 */ 18 */
22 19
23/ { 20/ {
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 1934b800278e..4d09dcad2537 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -10,207 +10,209 @@
10 */ 10 */
11 11
12/ { 12/ {
13 model = "MPC8272ADS"; 13 model = "MPC8272ADS";
14 compatible = "MPC8260ADS"; 14 compatible = "MPC8260ADS";
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 17
18 cpus { 18 cpus {
19 #address-cells = <1>; 19 #address-cells = <1>;
20 #size-cells = <0>; 20 #size-cells = <0>;
21 21
22 PowerPC,8272@0 { 22 PowerPC,8272@0 {
23 device_type = "cpu"; 23 device_type = "cpu";
24 reg = <0>; 24 reg = <0>;
25 d-cache-line-size = <20>; // 32 bytes 25 d-cache-line-size = <20>; // 32 bytes
26 i-cache-line-size = <20>; // 32 bytes 26 i-cache-line-size = <20>; // 32 bytes
27 d-cache-size = <4000>; // L1, 16K 27 d-cache-size = <4000>; // L1, 16K
28 i-cache-size = <4000>; // L1, 16K 28 i-cache-size = <4000>; // L1, 16K
29 timebase-frequency = <0>; 29 timebase-frequency = <0>;
30 bus-frequency = <0>; 30 bus-frequency = <0>;
31 clock-frequency = <0>; 31 clock-frequency = <0>;
32 32-bit; 32 32-bit;
33 }; 33 };
34 }; 34 };
35 35
36 pci_pic: interrupt-controller@f8200000 { 36 pci_pic: interrupt-controller@f8200000 {
37 #address-cells = <0>; 37 #address-cells = <0>;
38 #interrupt-cells = <2>; 38 #interrupt-cells = <2>;
39 interrupt-controller; 39 interrupt-controller;
40 reg = <f8200000 f8200004>; 40 reg = <f8200000 f8200004>;
41 built-in; 41 built-in;
42 device_type = "pci-pic"; 42 device_type = "pci-pic";
43 }; 43 };
44 memory { 44
45 device_type = "memory"; 45 memory {
46 reg = <00000000 4000000 f4500000 00000020>; 46 device_type = "memory";
47 }; 47 reg = <00000000 4000000 f4500000 00000020>;
48 48 };
49 chosen { 49
50 name = "chosen"; 50 chosen {
51 linux,platform = <0>; 51 name = "chosen";
52 linux,platform = <0>;
52 interrupt-controller = <&Cpm_pic>; 53 interrupt-controller = <&Cpm_pic>;
53 }; 54 };
54 55
55 soc8272@f0000000 { 56 soc8272@f0000000 {
56 #address-cells = <1>; 57 #address-cells = <1>;
57 #size-cells = <1>; 58 #size-cells = <1>;
58 #interrupt-cells = <2>; 59 #interrupt-cells = <2>;
59 device_type = "soc"; 60 device_type = "soc";
60 ranges = <00000000 f0000000 00053000>; 61 ranges = <00000000 f0000000 00053000>;
61 reg = <f0000000 10000>; 62 reg = <f0000000 10000>;
62 63
63 mdio@0 { 64 mdio@0 {
64 device_type = "mdio"; 65 device_type = "mdio";
65 compatible = "fs_enet"; 66 compatible = "fs_enet";
66 reg = <0 0>; 67 reg = <0 0>;
67 #address-cells = <1>; 68 #address-cells = <1>;
68 #size-cells = <0>; 69 #size-cells = <0>;
70
69 phy0:ethernet-phy@0 { 71 phy0:ethernet-phy@0 {
70 interrupt-parent = <&Cpm_pic>; 72 interrupt-parent = <&Cpm_pic>;
71 interrupts = <17 4>; 73 interrupts = <17 4>;
72 reg = <0>; 74 reg = <0>;
73 bitbang = [ 12 12 13 02 02 01 ]; 75 bitbang = [ 12 12 13 02 02 01 ];
74 device_type = "ethernet-phy"; 76 device_type = "ethernet-phy";
75 }; 77 };
78
76 phy1:ethernet-phy@1 { 79 phy1:ethernet-phy@1 {
77 interrupt-parent = <&Cpm_pic>; 80 interrupt-parent = <&Cpm_pic>;
78 interrupts = <17 4>; 81 interrupts = <17 4>;
79 bitbang = [ 12 12 13 02 02 01 ]; 82 bitbang = [ 12 12 13 02 02 01 ];
80 reg = <3>; 83 reg = <3>;
81 device_type = "ethernet-phy"; 84 device_type = "ethernet-phy";
82 }; 85 };
83 }; 86 };
84 87
85 ethernet@24000 { 88 ethernet@24000 {
86 #address-cells = <1>; 89 #address-cells = <1>;
87 #size-cells = <0>; 90 #size-cells = <0>;
88 device_type = "network"; 91 device_type = "network";
89 device-id = <1>; 92 device-id = <1>;
90 compatible = "fs_enet"; 93 compatible = "fs_enet";
91 model = "FCC"; 94 model = "FCC";
92 reg = <11300 20 8400 100 11380 30>; 95 reg = <11300 20 8400 100 11380 30>;
93 mac-address = [ 00 11 2F 99 43 54 ]; 96 mac-address = [ 00 11 2F 99 43 54 ];
94 interrupts = <20 2>; 97 interrupts = <20 2>;
95 interrupt-parent = <&Cpm_pic>; 98 interrupt-parent = <&Cpm_pic>;
96 phy-handle = <&Phy0>; 99 phy-handle = <&Phy0>;
97 rx-clock = <13>; 100 rx-clock = <13>;
98 tx-clock = <12>; 101 tx-clock = <12>;
99 }; 102 };
100 103
101 ethernet@25000 { 104 ethernet@25000 {
102 device_type = "network"; 105 device_type = "network";
103 device-id = <2>; 106 device-id = <2>;
104 compatible = "fs_enet"; 107 compatible = "fs_enet";
105 model = "FCC"; 108 model = "FCC";
106 reg = <11320 20 8500 100 113b0 30>; 109 reg = <11320 20 8500 100 113b0 30>;
107 mac-address = [ 00 11 2F 99 44 54 ]; 110 mac-address = [ 00 11 2F 99 44 54 ];
108 interrupts = <21 2>; 111 interrupts = <21 2>;
109 interrupt-parent = <&Cpm_pic>; 112 interrupt-parent = <&Cpm_pic>;
110 phy-handle = <&Phy1>; 113 phy-handle = <&Phy1>;
111 rx-clock = <17>; 114 rx-clock = <17>;
112 tx-clock = <18>; 115 tx-clock = <18>;
113 }; 116 };
114 117
115 cpm@f0000000 { 118 cpm@f0000000 {
116 #address-cells = <1>; 119 #address-cells = <1>;
117 #size-cells = <1>; 120 #size-cells = <1>;
118 #interrupt-cells = <2>; 121 #interrupt-cells = <2>;
119 device_type = "cpm"; 122 device_type = "cpm";
120 model = "CPM2"; 123 model = "CPM2";
121 ranges = <00000000 00000000 20000>; 124 ranges = <00000000 00000000 20000>;
122 reg = <0 20000>; 125 reg = <0 20000>;
123 command-proc = <119c0>; 126 command-proc = <119c0>;
124 brg-frequency = <17D7840>; 127 brg-frequency = <17D7840>;
125 cpm_clk = <BEBC200>; 128 cpm_clk = <BEBC200>;
126 129
127 scc@11a00 { 130 scc@11a00 {
128 device_type = "serial"; 131 device_type = "serial";
129 compatible = "cpm_uart"; 132 compatible = "cpm_uart";
130 model = "SCC"; 133 model = "SCC";
131 device-id = <1>; 134 device-id = <1>;
132 reg = <11a00 20 8000 100>; 135 reg = <11a00 20 8000 100>;
133 current-speed = <1c200>; 136 current-speed = <1c200>;
134 interrupts = <28 2>; 137 interrupts = <28 2>;
135 interrupt-parent = <&Cpm_pic>; 138 interrupt-parent = <&Cpm_pic>;
136 clock-setup = <0 00ffffff>; 139 clock-setup = <0 00ffffff>;
137 rx-clock = <1>; 140 rx-clock = <1>;
138 tx-clock = <1>; 141 tx-clock = <1>;
139 }; 142 };
140 143
141 scc@11a60 { 144 scc@11a60 {
142 device_type = "serial"; 145 device_type = "serial";
143 compatible = "cpm_uart"; 146 compatible = "cpm_uart";
144 model = "SCC"; 147 model = "SCC";
145 device-id = <4>; 148 device-id = <4>;
146 reg = <11a60 20 8300 100>; 149 reg = <11a60 20 8300 100>;
147 current-speed = <1c200>; 150 current-speed = <1c200>;
148 interrupts = <2b 2>; 151 interrupts = <2b 2>;
149 interrupt-parent = <&Cpm_pic>; 152 interrupt-parent = <&Cpm_pic>;
150 clock-setup = <1b ffffff00>; 153 clock-setup = <1b ffffff00>;
151 rx-clock = <4>; 154 rx-clock = <4>;
152 tx-clock = <4>; 155 tx-clock = <4>;
153 }; 156 };
154 157 };
155 }; 158
156 cpm_pic:interrupt-controller@10c00 { 159 cpm_pic:interrupt-controller@10c00 {
157 #address-cells = <0>; 160 #address-cells = <0>;
158 #interrupt-cells = <2>; 161 #interrupt-cells = <2>;
159 interrupt-controller; 162 interrupt-controller;
160 reg = <10c00 80>; 163 reg = <10c00 80>;
161 built-in; 164 built-in;
162 device_type = "cpm-pic"; 165 device_type = "cpm-pic";
163 compatible = "CPM2"; 166 compatible = "CPM2";
164 }; 167 };
165 pci@0500 { 168
166 #interrupt-cells = <1>; 169 pci@0500 {
167 #size-cells = <2>; 170 #interrupt-cells = <1>;
168 #address-cells = <3>; 171 #size-cells = <2>;
169 compatible = "8272"; 172 #address-cells = <3>;
170 device_type = "pci"; 173 compatible = "8272";
171 reg = <10430 4dc>; 174 device_type = "pci";
172 clock-frequency = <3f940aa>; 175 reg = <10430 4dc>;
173 interrupt-map-mask = <f800 0 0 7>; 176 clock-frequency = <3f940aa>;
174 interrupt-map = < 177 interrupt-map-mask = <f800 0 0 7>;
175 178 interrupt-map = <
176 /* IDSEL 0x16 */ 179 /* IDSEL 0x16 */
177 b000 0 0 1 f8200000 40 8 180 b000 0 0 1 f8200000 40 8
178 b000 0 0 2 f8200000 41 8 181 b000 0 0 2 f8200000 41 8
179 b000 0 0 3 f8200000 42 8 182 b000 0 0 3 f8200000 42 8
180 b000 0 0 4 f8200000 43 8 183 b000 0 0 4 f8200000 43 8
181 184
182 /* IDSEL 0x17 */ 185 /* IDSEL 0x17 */
183 b800 0 0 1 f8200000 43 8 186 b800 0 0 1 f8200000 43 8
184 b800 0 0 2 f8200000 40 8 187 b800 0 0 2 f8200000 40 8
185 b800 0 0 3 f8200000 41 8 188 b800 0 0 3 f8200000 41 8
186 b800 0 0 4 f8200000 42 8 189 b800 0 0 4 f8200000 42 8
187 190
188 /* IDSEL 0x18 */ 191 /* IDSEL 0x18 */
189 c000 0 0 1 f8200000 42 8 192 c000 0 0 1 f8200000 42 8
190 c000 0 0 2 f8200000 43 8 193 c000 0 0 2 f8200000 43 8
191 c000 0 0 3 f8200000 40 8 194 c000 0 0 3 f8200000 40 8
192 c000 0 0 4 f8200000 41 8>; 195 c000 0 0 4 f8200000 41 8>;
193 interrupt-parent = <&Cpm_pic>; 196 interrupt-parent = <&Cpm_pic>;
194 interrupts = <14 8>; 197 interrupts = <14 8>;
195 bus-range = <0 0>; 198 bus-range = <0 0>;
196 ranges = <02000000 0 80000000 80000000 0 40000000 199 ranges = <02000000 0 80000000 80000000 0 40000000
197 01000000 0 00000000 f6000000 0 02000000>; 200 01000000 0 00000000 f6000000 0 02000000>;
198 }; 201 };
199 202
200/* May need to remove if on a part without crypto engine */ 203/* May need to remove if on a part without crypto engine */
201 crypto@30000 { 204 crypto@30000 {
202 device_type = "crypto"; 205 device_type = "crypto";
203 model = "SEC2"; 206 model = "SEC2";
204 compatible = "talitos"; 207 compatible = "talitos";
205 reg = <30000 10000>; 208 reg = <30000 10000>;
206 interrupts = <b 2>; 209 interrupts = <b 2>;
207 interrupt-parent = <&Cpm_pic>; 210 interrupt-parent = <&Cpm_pic>;
208 num-channels = <4>; 211 num-channels = <4>;
209 channel-fifo-len = <18>; 212 channel-fifo-len = <18>;
210 exec-units-mask = <0000007e>; 213 exec-units-mask = <0000007e>;
211/* desc mask is for rev1.x, we need runtime fixup for >=2.x */ 214/* desc mask is for rev1.x, we need runtime fixup for >=2.x */
212 descriptor-types-mask = <01010ebf>; 215 descriptor-types-mask = <01010ebf>;
213 }; 216 };
214 217 };
215 };
216}; 218};
diff --git a/arch/powerpc/boot/dts/prpmc2800.dts b/arch/powerpc/boot/dts/prpmc2800.dts
index 5300b50cdc2f..e416ea67be49 100644
--- a/arch/powerpc/boot/dts/prpmc2800.dts
+++ b/arch/powerpc/boot/dts/prpmc2800.dts
@@ -9,10 +9,6 @@
9 * 9 *
10 * Property values that are labeled as "Default" will be updated by bootwrapper 10 * Property values that are labeled as "Default" will be updated by bootwrapper
11 * if it can determine the exact PrPMC type. 11 * if it can determine the exact PrPMC type.
12 *
13 * To build:
14 * dtc -I dts -O asm -o prpmc2800.S -b 0 prpmc2800.dts
15 * dtc -I dts -O dtb -o prpmc2800.dtb -b 0 prpmc2800.dts
16 */ 12 */
17 13
18/ { 14/ {
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts
new file mode 100644
index 000000000000..af6a56b4e5b1
--- /dev/null
+++ b/arch/powerpc/boot/dts/sequoia.dts
@@ -0,0 +1,286 @@
1/*
2 * Device Tree Source for AMCC Sequoia
3 *
4 * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
5 * Copyright (c) 2006, 2007 IBM Corp.
6 *
7 * FIXME: Draft only!
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without
11 * any warranty of any kind, whether express or implied.
12 *
13 */
14
15/ {
16 #address-cells = <2>;
17 #size-cells = <1>;
18 model = "amcc,sequoia";
19 compatible = "amcc,sequoia";
20 dcr-parent = <&/cpus/PowerPC,440EPx@0>;
21
22 cpus {
23 #address-cells = <1>;
24 #size-cells = <0>;
25
26 PowerPC,440EPx@0 {
27 device_type = "cpu";
28 reg = <0>;
29 clock-frequency = <0>; /* Filled in by zImage */
30 timebase-frequency = <0>; /* Filled in by zImage */
31 i-cache-line-size = <20>;
32 d-cache-line-size = <20>;
33 i-cache-size = <8000>;
34 d-cache-size = <8000>;
35 dcr-controller;
36 dcr-access-method = "native";
37 };
38 };
39
40 memory {
41 device_type = "memory";
42 reg = <0 0 0>; /* Filled in by zImage */
43 };
44
45 UIC0: interrupt-controller0 {
46 compatible = "ibm,uic-440epx","ibm,uic";
47 interrupt-controller;
48 cell-index = <0>;
49 dcr-reg = <0c0 009>;
50 #address-cells = <0>;
51 #size-cells = <0>;
52 #interrupt-cells = <2>;
53 };
54
55 UIC1: interrupt-controller1 {
56 compatible = "ibm,uic-440epx","ibm,uic";
57 interrupt-controller;
58 cell-index = <1>;
59 dcr-reg = <0d0 009>;
60 #address-cells = <0>;
61 #size-cells = <0>;
62 #interrupt-cells = <2>;
63 interrupts = <1e 4 1f 4>; /* cascade */
64 interrupt-parent = <&UIC0>;
65 };
66
67 UIC2: interrupt-controller2 {
68 compatible = "ibm,uic-440epx","ibm,uic";
69 interrupt-controller;
70 cell-index = <2>;
71 dcr-reg = <0e0 009>;
72 #address-cells = <0>;
73 #size-cells = <0>;
74 #interrupt-cells = <2>;
75 interrupts = <1c 4 1d 4>; /* cascade */
76 interrupt-parent = <&UIC0>;
77 };
78
79 SDR0: sdr {
80 compatible = "ibm,sdr-440epx", "ibm,sdr-440ep";
81 dcr-reg = <00e 002>;
82 };
83
84 CPR0: cpr {
85 compatible = "ibm,cpr-440epx", "ibm,cpr-440ep";
86 dcr-reg = <00c 002>;
87 };
88
89 plb {
90 compatible = "ibm,plb-440epx", "ibm,plb4";
91 #address-cells = <2>;
92 #size-cells = <1>;
93 ranges;
94 clock-frequency = <0>; /* Filled in by zImage */
95
96 SDRAM0: sdram {
97 device_type = "memory-controller";
98 compatible = "ibm,sdram-440epx", "ibm,sdram-44x-ddr2denali";
99 dcr-reg = <010 2>;
100 };
101
102 DMA0: dma {
103 compatible = "ibm,dma-440epx", "ibm,dma-4xx";
104 dcr-reg = <100 027>;
105 };
106
107 MAL0: mcmal {
108 compatible = "ibm,mcmal-440epx", "ibm,mcmal2";
109 dcr-reg = <180 62>;
110 num-tx-chans = <4>;
111 num-rx-chans = <4>;
112 interrupt-parent = <&MAL0>;
113 interrupts = <0 1 2 3 4>;
114 #interrupt-cells = <1>;
115 #address-cells = <0>;
116 #size-cells = <0>;
117 interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
118 /*RXEOB*/ 1 &UIC0 b 4
119 /*SERR*/ 2 &UIC1 0 4
120 /*TXDE*/ 3 &UIC1 1 4
121 /*RXDE*/ 4 &UIC1 2 4>;
122 interrupt-map-mask = <ffffffff>;
123 };
124
125 POB0: opb {
126 compatible = "ibm,opb-440epx", "ibm,opb";
127 #address-cells = <1>;
128 #size-cells = <1>;
129 ranges = <00000000 1 00000000 80000000
130 80000000 1 80000000 80000000>;
131 interrupt-parent = <&UIC1>;
132 interrupts = <7 4>;
133 clock-frequency = <0>; /* Filled in by zImage */
134
135 EBC0: ebc {
136 compatible = "ibm,ebc-440epx", "ibm,ebc";
137 dcr-reg = <012 2>;
138 #address-cells = <2>;
139 #size-cells = <1>;
140 clock-frequency = <0>; /* Filled in by zImage */
141 interrupts = <5 1>;
142 interrupt-parent = <&UIC1>;
143
144 nor_flash@0,0 {
145 device_type = "rom";
146 compatible = "direct-mapped";
147 probe-type = "CFI";
148 bank-width = <2>;
149 partitions = < 0 180000
150 180000 200000
151 380000 3aa0000
152 3e20000 140000
153 3f60000 40000
154 3fa0000 60000>;
155 partition-names = "Kernel", "ramdisk", "file system",
156 "kozio", "env", "u-boot";
157 reg = <0 000000 4000000>;
158 };
159
160 };
161
162 UART0: serial@ef600300 {
163 device_type = "serial";
164 compatible = "ns16550";
165 reg = <ef600300 8>;
166 virtual-reg = <ef600300>;
167 clock-frequency = <0>; /* Filled in by zImage */
168 current-speed = <1c200>;
169 interrupt-parent = <&UIC0>;
170 interrupts = <0 4>;
171 };
172
173 UART1: serial@ef600400 {
174 device_type = "serial";
175 compatible = "ns16550";
176 reg = <ef600400 8>;
177 virtual-reg = <ef600400>;
178 clock-frequency = <0>;
179 current-speed = <0>;
180 interrupt-parent = <&UIC0>;
181 interrupts = <1 4>;
182 };
183
184 UART2: serial@ef600500 {
185 device_type = "serial";
186 compatible = "ns16550";
187 reg = <ef600500 8>;
188 virtual-reg = <ef600500>;
189 clock-frequency = <0>;
190 current-speed = <0>;
191 interrupt-parent = <&UIC1>;
192 interrupts = <3 4>;
193 };
194
195 UART3: serial@ef600600 {
196 device_type = "serial";
197 compatible = "ns16550";
198 reg = <ef600600 8>;
199 virtual-reg = <ef600600>;
200 clock-frequency = <0>;
201 current-speed = <0>;
202 interrupt-parent = <&UIC1>;
203 interrupts = <4 4>;
204 };
205
206 IIC0: i2c@ef600700 {
207 device_type = "i2c";
208 compatible = "ibm,iic-440epx", "ibm,iic";
209 reg = <ef600700 14>;
210 interrupt-parent = <&UIC0>;
211 interrupts = <2 4>;
212 };
213
214 IIC1: i2c@ef600800 {
215 device_type = "i2c";
216 compatible = "ibm,iic-440epx", "ibm,iic";
217 reg = <ef600800 14>;
218 interrupt-parent = <&UIC0>;
219 interrupts = <7 4>;
220 };
221
222 ZMII0: emac-zmii@ef600d00 {
223 device_type = "zmii-interface";
224 compatible = "ibm,zmii-440epx", "ibm,zmii";
225 reg = <ef600d00 c>;
226 };
227
228 EMAC0: ethernet@ef600e00 {
229 linux,network-index = <0>;
230 device_type = "network";
231 compatible = "ibm,emac-440epx", "ibm,emac4";
232 interrupt-parent = <&EMAC0>;
233 interrupts = <0 1>;
234 #interrupt-cells = <1>;
235 #address-cells = <0>;
236 #size-cells = <0>;
237 interrupt-map = </*Status*/ 0 &UIC0 18 4
238 /*Wake*/ 1 &UIC1 1d 4>;
239 reg = <ef600e00 70>;
240 local-mac-address = [000000000000];
241 mal-device = <&MAL0>;
242 mal-tx-channel = <0 1>;
243 mal-rx-channel = <0>;
244 cell-index = <0>;
245 max-frame-size = <5dc>;
246 rx-fifo-size = <1000>;
247 tx-fifo-size = <800>;
248 phy-mode = "rmii";
249 phy-map = <00000000>;
250 zmii-device = <&ZMII0>;
251 zmii-channel = <0>;
252 };
253
254 EMAC1: ethernet@ef600f00 {
255 linux,network-index = <1>;
256 device_type = "network";
257 compatible = "ibm,emac-440epx", "ibm,emac4";
258 interrupt-parent = <&EMAC1>;
259 interrupts = <0 1>;
260 #interrupt-cells = <1>;
261 #address-cells = <0>;
262 #size-cells = <0>;
263 interrupt-map = </*Status*/ 0 &UIC0 19 4
264 /*Wake*/ 1 &UIC1 1f 4>;
265 reg = <ef600f00 70>;
266 local-mac-address = [000000000000];
267 mal-device = <&MAL0>;
268 mal-tx-channel = <2 3>;
269 mal-rx-channel = <1>;
270 cell-index = <1>;
271 max-frame-size = <5dc>;
272 rx-fifo-size = <1000>;
273 tx-fifo-size = <800>;
274 phy-mode = "rmii";
275 phy-map = <00000000>;
276 zmii-device = <&ZMII0>;
277 zmii-channel = <1>;
278 };
279 };
280 };
281
282 chosen {
283 linux,stdout-path = "/plb/opb/serial@ef600300";
284 bootargs = "console=ttyS0,115200";
285 };
286};
diff --git a/arch/powerpc/boot/dts/walnut.dts b/arch/powerpc/boot/dts/walnut.dts
new file mode 100644
index 000000000000..27bef06db134
--- /dev/null
+++ b/arch/powerpc/boot/dts/walnut.dts
@@ -0,0 +1,183 @@
1/*
2 * Device Tree Source for IBM Walnut
3 *
4 * Copyright 2007 IBM Corp.
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without
9 * any warranty of any kind, whether express or implied.
10 */
11
12/ {
13 #address-cells = <1>;
14 #size-cells = <1>;
15 model = "ibm,walnut";
16 compatible = "ibm,walnut";
17 dcr-parent = <&/cpus/PowerPC,405GP@0>;
18
19 cpus {
20 #address-cells = <1>;
21 #size-cells = <0>;
22
23 PowerPC,405GP@0 {
24 device_type = "cpu";
25 reg = <0>;
26 clock-frequency = <bebc200>; /* Filled in by zImage */
27 timebase-frequency = <0>; /* Filled in by zImage */
28 i-cache-line-size = <20>;
29 d-cache-line-size = <20>;
30 i-cache-size = <4000>;
31 d-cache-size = <4000>;
32 dcr-controller;
33 dcr-access-method = "native";
34 };
35 };
36
37 memory {
38 device_type = "memory";
39 reg = <0 0>; /* Filled in by zImage */
40 };
41
42 UIC0: interrupt-controller {
43 compatible = "ibm,uic";
44 interrupt-controller;
45 cell-index = <0>;
46 dcr-reg = <0c0 9>;
47 #address-cells = <0>;
48 #size-cells = <0>;
49 #interrupt-cells = <2>;
50 };
51
52 plb {
53 compatible = "ibm,plb3";
54 #address-cells = <1>;
55 #size-cells = <1>;
56 ranges;
57 clock-frequency = <0>; /* Filled in by zImage */
58
59 SDRAM0: memory-controller {
60 compatible = "ibm,sdram-405gp";
61 dcr-reg = <010 2>;
62 };
63
64 MAL: mcmal {
65 compatible = "ibm,mcmal-405gp", "ibm,mcmal";
66 dcr-reg = <180 62>;
67 num-tx-chans = <2>;
68 num-rx-chans = <1>;
69 interrupt-parent = <&UIC0>;
70 interrupts = <a 4 b 4 c 4 d 4 e 4>;
71 };
72
73 POB0: opb {
74 compatible = "ibm,opb-405gp", "ibm,opb";
75 #address-cells = <1>;
76 #size-cells = <1>;
77 ranges = <ef600000 ef600000 a00000>;
78 dcr-reg = <0a0 5>;
79 clock-frequency = <0>; /* Filled in by zImage */
80
81 UART0: serial@ef600300 {
82 device_type = "serial";
83 compatible = "ns16550";
84 reg = <ef600300 8>;
85 virtual-reg = <ef600300>;
86 clock-frequency = <0>; /* Filled in by zImage */
87 current-speed = <2580>;
88 interrupt-parent = <&UIC0>;
89 interrupts = <0 4>;
90 };
91
92 UART1: serial@ef600400 {
93 device_type = "serial";
94 compatible = "ns16550";
95 reg = <ef600400 8>;
96 virtual-reg = <ef600400>;
97 clock-frequency = <0>; /* Filled in by zImage */
98 current-speed = <2580>;
99 interrupt-parent = <&UIC0>;
100 interrupts = <1 4>;
101 };
102
103 IIC: i2c@ef600500 {
104 compatible = "ibm,iic-405gp", "ibm,iic";
105 reg = <ef600500 11>;
106 interrupt-parent = <&UIC0>;
107 interrupts = <2 4>;
108 };
109
110 GPIO: gpio@ef600700 {
111 compatible = "ibm,gpio-405gp";
112 reg = <ef600700 20>;
113 };
114
115 EMAC: ethernet@ef600800 {
116 linux,network-index = <0>;
117 device_type = "network";
118 compatible = "ibm,emac-405gp", "ibm,emac";
119 interrupt-parent = <&UIC0>;
120 interrupts = <9 4 f 4>;
121 reg = <ef600800 70>;
122 mal-device = <&MAL>;
123 mal-tx-channel = <0 1>;
124 mal-rx-channel = <0>;
125 cell-index = <0>;
126 max-frame-size = <5dc>;
127 rx-fifo-size = <1000>;
128 tx-fifo-size = <800>;
129 phy-mode = "rmii";
130 phy-map = <00000001>;
131 };
132
133 };
134
135 EBC0: ebc {
136 compatible = "ibm,ebc-405gp", "ibm,ebc";
137 dcr-reg = <012 2>;
138 #address-cells = <2>;
139 #size-cells = <1>;
140 clock-frequency = <0>; /* Filled in by zImage */
141
142 sram@0,0 {
143 reg = <0 0 80000>;
144 };
145
146 flash@0,80000 {
147 device_type = "rom";
148 compatible = "direct-mapped";
149 probe-type = "JEDEC";
150 bank-width = <1>;
151 partitions = <0 80000>;
152 partition-names = "OpenBIOS";
153 reg = <0 80000 80000>;
154 };
155
156 ds1743@1,0 {
157 /* NVRAM and RTC */
158 compatible = "ds1743";
159 reg = <1 0 2000>;
160 };
161
162 keyboard@2,0 {
163 compatible = "intel,82C42PC";
164 reg = <2 0 2>;
165 };
166
167 ir@3,0 {
168 compatible = "ti,TIR2000PAG";
169 reg = <3 0 10>;
170 };
171
172 fpga@7,0 {
173 compatible = "Walnut-FPGA";
174 reg = <7 0 10>;
175 virtual-reg = <f0300005>;
176 };
177 };
178 };
179
180 chosen {
181 linux,stdout-path = "/plb/opb/serial@ef600300";
182 };
183};
diff --git a/arch/powerpc/boot/ebony.c b/arch/powerpc/boot/ebony.c
index 75daedafd0a4..86c0f5df0a86 100644
--- a/arch/powerpc/boot/ebony.c
+++ b/arch/powerpc/boot/ebony.c
@@ -24,12 +24,11 @@
24#include "page.h" 24#include "page.h"
25#include "ops.h" 25#include "ops.h"
26#include "reg.h" 26#include "reg.h"
27#include "io.h"
27#include "dcr.h" 28#include "dcr.h"
29#include "4xx.h"
28#include "44x.h" 30#include "44x.h"
29 31
30extern char _dtb_start[];
31extern char _dtb_end[];
32
33static u8 *ebony_mac0, *ebony_mac1; 32static u8 *ebony_mac0, *ebony_mac1;
34 33
35/* Calculate 440GP clocks */ 34/* Calculate 440GP clocks */
@@ -92,15 +91,53 @@ void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
92 dt_fixup_clock("/plb/opb/serial@40000300", uart1); 91 dt_fixup_clock("/plb/opb/serial@40000300", uart1);
93} 92}
94 93
94#define EBONY_FPGA_PATH "/plb/opb/ebc/fpga"
95#define EBONY_FPGA_FLASH_SEL 0x01
96#define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"
97
98static void ebony_flashsel_fixup(void)
99{
100 void *devp;
101 u32 reg[3] = {0x0, 0x0, 0x80000};
102 u8 *fpga;
103 u8 fpga_reg0 = 0x0;
104
105 devp = finddevice(EBONY_FPGA_PATH);
106 if (!devp)
107 fatal("Couldn't locate FPGA node %s\n\r", EBONY_FPGA_PATH);
108
109 if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
110 fatal("%s has missing or invalid virtual-reg property\n\r",
111 EBONY_FPGA_PATH);
112
113 fpga_reg0 = in_8(fpga);
114
115 devp = finddevice(EBONY_SMALL_FLASH_PATH);
116 if (!devp)
117 fatal("Couldn't locate small flash node %s\n\r",
118 EBONY_SMALL_FLASH_PATH);
119
120 if (getprop(devp, "reg", reg, sizeof(reg)) != sizeof(reg))
121 fatal("%s has reg property of unexpected size\n\r",
122 EBONY_SMALL_FLASH_PATH);
123
124 /* Invert address bit 14 (IBM-endian) if FLASH_SEL fpga bit is set */
125 if (fpga_reg0 & EBONY_FPGA_FLASH_SEL)
126 reg[1] ^= 0x80000;
127
128 setprop(devp, "reg", reg, sizeof(reg));
129}
130
95static void ebony_fixups(void) 131static void ebony_fixups(void)
96{ 132{
97 // FIXME: sysclk should be derived by reading the FPGA registers 133 // FIXME: sysclk should be derived by reading the FPGA registers
98 unsigned long sysclk = 33000000; 134 unsigned long sysclk = 33000000;
99 135
100 ibm440gp_fixup_clocks(sysclk, 6 * 1843200); 136 ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
101 ibm44x_fixup_memsize(); 137 ibm4xx_fixup_memsize();
102 dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); 138 dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
103 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 139 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
140 ebony_flashsel_fixup();
104} 141}
105 142
106void ebony_init(void *mac0, void *mac1) 143void ebony_init(void *mac0, void *mac1)
diff --git a/arch/powerpc/boot/holly.c b/arch/powerpc/boot/holly.c
index 7d6539f5e22c..199e783aea4d 100644
--- a/arch/powerpc/boot/holly.c
+++ b/arch/powerpc/boot/holly.c
@@ -21,11 +21,6 @@
21#include "ops.h" 21#include "ops.h"
22#include "io.h" 22#include "io.h"
23 23
24extern char _start[];
25extern char _end[];
26extern char _dtb_start[];
27extern char _dtb_end[];
28
29BSS_STACK(4096); 24BSS_STACK(4096);
30 25
31void platform_init(unsigned long r3, unsigned long r4, unsigned long r5) 26void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
diff --git a/arch/powerpc/boot/io.h b/arch/powerpc/boot/io.h
index 32974ed49e02..ccaedaec50d5 100644
--- a/arch/powerpc/boot/io.h
+++ b/arch/powerpc/boot/io.h
@@ -1,5 +1,8 @@
1#ifndef _IO_H 1#ifndef _IO_H
2#define __IO_H 2#define __IO_H
3
4#include "types.h"
5
3/* 6/*
4 * Low-level I/O routines. 7 * Low-level I/O routines.
5 * 8 *
@@ -20,6 +23,37 @@ static inline void out_8(volatile unsigned char *addr, int val)
20 : "=m" (*addr) : "r" (val)); 23 : "=m" (*addr) : "r" (val));
21} 24}
22 25
26static inline unsigned in_le16(const volatile u16 *addr)
27{
28 unsigned ret;
29
30 __asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync"
31 : "=r" (ret) : "r" (addr), "m" (*addr));
32
33 return ret;
34}
35
36static inline unsigned in_be16(const volatile u16 *addr)
37{
38 unsigned ret;
39
40 __asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
41 : "=r" (ret) : "m" (*addr));
42 return ret;
43}
44
45static inline void out_le16(volatile u16 *addr, int val)
46{
47 __asm__ __volatile__("sthbrx %1,0,%2; sync" : "=m" (*addr)
48 : "r" (val), "r" (addr));
49}
50
51static inline void out_be16(volatile u16 *addr, int val)
52{
53 __asm__ __volatile__("sth%U0%X0 %1,%0; sync"
54 : "=m" (*addr) : "r" (val));
55}
56
23static inline unsigned in_le32(const volatile unsigned *addr) 57static inline unsigned in_le32(const volatile unsigned *addr)
24{ 58{
25 unsigned ret; 59 unsigned ret;
@@ -50,4 +84,19 @@ static inline void out_be32(volatile unsigned *addr, int val)
50 : "=m" (*addr) : "r" (val)); 84 : "=m" (*addr) : "r" (val));
51} 85}
52 86
87static inline void sync(void)
88{
89 asm volatile("sync" : : : "memory");
90}
91
92static inline void eieio(void)
93{
94 asm volatile("eieio" : : : "memory");
95}
96
97static inline void barrier(void)
98{
99 asm volatile("" : : : "memory");
100}
101
53#endif /* _IO_H */ 102#endif /* _IO_H */
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 416dc3857bfe..1b496b37eca0 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -19,16 +19,6 @@
19#include "flatdevtree.h" 19#include "flatdevtree.h"
20#include "reg.h" 20#include "reg.h"
21 21
22extern char _start[];
23extern char __bss_start[];
24extern char _end[];
25extern char _vmlinux_start[];
26extern char _vmlinux_end[];
27extern char _initrd_start[];
28extern char _initrd_end[];
29extern char _dtb_start[];
30extern char _dtb_end[];
31
32static struct gunzip_state gzstate; 22static struct gunzip_state gzstate;
33 23
34struct addr_range { 24struct addr_range {
diff --git a/arch/powerpc/boot/mpsc.c b/arch/powerpc/boot/mpsc.c
index f1c0e965e5ce..802ea53790d8 100644
--- a/arch/powerpc/boot/mpsc.c
+++ b/arch/powerpc/boot/mpsc.c
@@ -17,7 +17,6 @@
17#include "io.h" 17#include "io.h"
18#include "ops.h" 18#include "ops.h"
19 19
20extern void udelay(long delay);
21 20
22#define MPSC_CHR_1 0x000c 21#define MPSC_CHR_1 0x000c
23 22
diff --git a/arch/powerpc/boot/mv64x60_i2c.c b/arch/powerpc/boot/mv64x60_i2c.c
index 435fe8528680..d085377be3bc 100644
--- a/arch/powerpc/boot/mv64x60_i2c.c
+++ b/arch/powerpc/boot/mv64x60_i2c.c
@@ -21,8 +21,6 @@
21#include "ops.h" 21#include "ops.h"
22#include "mv64x60.h" 22#include "mv64x60.h"
23 23
24extern void udelay(long);
25
26/* Register defines */ 24/* Register defines */
27#define MV64x60_I2C_REG_SLAVE_ADDR 0x00 25#define MV64x60_I2C_REG_SLAVE_ADDR 0x00
28#define MV64x60_I2C_REG_DATA 0x04 26#define MV64x60_I2C_REG_DATA 0x04
diff --git a/arch/powerpc/boot/of.c b/arch/powerpc/boot/of.c
index 385e08b83b7e..61d9899aa0d0 100644
--- a/arch/powerpc/boot/of.c
+++ b/arch/powerpc/boot/of.c
@@ -17,8 +17,6 @@
17 17
18#include "of.h" 18#include "of.h"
19 19
20extern char _end[];
21
22/* Value picked to match that used by yaboot */ 20/* Value picked to match that used by yaboot */
23#define PROG_START 0x01400000 /* only used on 64-bit systems */ 21#define PROG_START 0x01400000 /* only used on 64-bit systems */
24#define RAM_END (512<<20) /* Fixme: use OF */ 22#define RAM_END (512<<20) /* Fixme: use OF */
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 86077066cd7c..45c2268d5c56 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -82,11 +82,14 @@ int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
82int serial_console_init(void); 82int serial_console_init(void);
83int ns16550_console_init(void *devp, struct serial_console_data *scdp); 83int ns16550_console_init(void *devp, struct serial_console_data *scdp);
84int mpsc_console_init(void *devp, struct serial_console_data *scdp); 84int mpsc_console_init(void *devp, struct serial_console_data *scdp);
85int cpm_console_init(void *devp, struct serial_console_data *scdp);
85void *simple_alloc_init(char *base, unsigned long heap_size, 86void *simple_alloc_init(char *base, unsigned long heap_size,
86 unsigned long granularity, unsigned long max_allocs); 87 unsigned long granularity, unsigned long max_allocs);
87extern void flush_cache(void *, unsigned long); 88extern void flush_cache(void *, unsigned long);
88int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); 89int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
89int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); 90int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
91int dt_is_compatible(void *node, const char *compat);
92void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
90 93
91static inline void *finddevice(const char *name) 94static inline void *finddevice(const char *name)
92{ 95{
@@ -191,4 +194,25 @@ static inline void exit(void)
191 static char _bss_stack[size]; \ 194 static char _bss_stack[size]; \
192 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack); 195 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack);
193 196
197extern unsigned long timebase_period_ns;
198void udelay(long delay);
199
200extern char _start[];
201extern char __bss_start[];
202extern char _end[];
203extern char _vmlinux_start[];
204extern char _vmlinux_end[];
205extern char _initrd_start[];
206extern char _initrd_end[];
207extern char _dtb_start[];
208extern char _dtb_end[];
209
210static inline __attribute__((const))
211int __ilog2_u32(u32 n)
212{
213 int bit;
214 asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
215 return 31 - bit;
216}
217
194#endif /* _PPC_BOOT_OPS_H_ */ 218#endif /* _PPC_BOOT_OPS_H_ */
diff --git a/arch/powerpc/boot/ppcboot.h b/arch/powerpc/boot/ppcboot.h
index 5290ff2c2b2b..6ae6f9063952 100644
--- a/arch/powerpc/boot/ppcboot.h
+++ b/arch/powerpc/boot/ppcboot.h
@@ -78,17 +78,18 @@ typedef struct bd_info {
78 hymod_conf_t bi_hymod_conf; /* hymod configuration information */ 78 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
79#endif 79#endif
80#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \ 80#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \
81 defined(TARGET_85xx) || defined(TARGET_83xx) 81 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
82 /* second onboard ethernet port */ 82 /* second onboard ethernet port */
83 unsigned char bi_enet1addr[6]; 83 unsigned char bi_enet1addr[6];
84#define HAVE_ENET1ADDR 84#define HAVE_ENET1ADDR
85#endif 85#endif
86#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || defined(TARGET_85xx) 86#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || \
87 defined(TARGET_85xx) || defined(TARGET_HAS_ETH2)
87 /* third onboard ethernet ports */ 88 /* third onboard ethernet ports */
88 unsigned char bi_enet2addr[6]; 89 unsigned char bi_enet2addr[6];
89#define HAVE_ENET2ADDR 90#define HAVE_ENET2ADDR
90#endif 91#endif
91#if defined(TARGET_440GX) 92#if defined(TARGET_440GX) || defined(TARGET_HAS_ETH3)
92 /* fourth onboard ethernet ports */ 93 /* fourth onboard ethernet ports */
93 unsigned char bi_enet3addr[6]; 94 unsigned char bi_enet3addr[6];
94#define HAVE_ENET3ADDR 95#define HAVE_ENET3ADDR
diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index f428bac10d4a..9614e1db9dae 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -21,12 +21,6 @@
21#include "gunzip_util.h" 21#include "gunzip_util.h"
22#include "mv64x60.h" 22#include "mv64x60.h"
23 23
24extern char _end[];
25extern char _vmlinux_start[], _vmlinux_end[];
26extern char _dtb_start[], _dtb_end[];
27
28extern void udelay(long delay);
29
30#define KB 1024U 24#define KB 1024U
31#define MB (KB*KB) 25#define MB (KB*KB)
32#define GB (KB*MB) 26#define GB (KB*MB)
diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c
index 893d59339c26..d6661151b494 100644
--- a/arch/powerpc/boot/ps3.c
+++ b/arch/powerpc/boot/ps3.c
@@ -120,10 +120,6 @@ void ps3_copy_vectors(void)
120 120
121void platform_init(void) 121void platform_init(void)
122{ 122{
123 extern char _end[];
124 extern char _dtb_start[];
125 extern char _initrd_start[];
126 extern char _initrd_end[];
127 const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */ 123 const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
128 void *chosen; 124 void *chosen;
129 unsigned long ft_addr; 125 unsigned long ft_addr;
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index eaa0d3ae3518..d47f8e0b4b81 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -19,8 +19,6 @@
19#include "io.h" 19#include "io.h"
20#include "ops.h" 20#include "ops.h"
21 21
22extern void udelay(long delay);
23
24static int serial_open(void) 22static int serial_open(void)
25{ 23{
26 struct serial_console_data *scdp = console_ops.data; 24 struct serial_console_data *scdp = console_ops.data;
@@ -114,29 +112,32 @@ int serial_console_init(void)
114{ 112{
115 void *devp; 113 void *devp;
116 int rc = -1; 114 int rc = -1;
117 char compat[MAX_PROP_LEN];
118 115
119 devp = serial_get_stdout_devp(); 116 devp = serial_get_stdout_devp();
120 if (devp == NULL) 117 if (devp == NULL)
121 goto err_out; 118 goto err_out;
122 119
123 if (getprop(devp, "compatible", compat, sizeof(compat)) < 0) 120 if (dt_is_compatible(devp, "ns16550"))
124 goto err_out;
125
126 if (!strcmp(compat, "ns16550"))
127 rc = ns16550_console_init(devp, &serial_cd); 121 rc = ns16550_console_init(devp, &serial_cd);
128 else if (!strcmp(compat, "marvell,mpsc")) 122 else if (dt_is_compatible(devp, "marvell,mpsc"))
129 rc = mpsc_console_init(devp, &serial_cd); 123 rc = mpsc_console_init(devp, &serial_cd);
124 else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") ||
125 dt_is_compatible(devp, "fsl,cpm1-smc-uart") ||
126 dt_is_compatible(devp, "fsl,cpm2-scc-uart") ||
127 dt_is_compatible(devp, "fsl,cpm2-smc-uart"))
128 rc = cpm_console_init(devp, &serial_cd);
130 129
131 /* Add other serial console driver calls here */ 130 /* Add other serial console driver calls here */
132 131
133 if (!rc) { 132 if (!rc) {
134 console_ops.open = serial_open; 133 console_ops.open = serial_open;
135 console_ops.write = serial_write; 134 console_ops.write = serial_write;
136 console_ops.edit_cmdline = serial_edit_cmdline;
137 console_ops.close = serial_close; 135 console_ops.close = serial_close;
138 console_ops.data = &serial_cd; 136 console_ops.data = &serial_cd;
139 137
138 if (serial_cd.getc)
139 console_ops.edit_cmdline = serial_edit_cmdline;
140
140 return 0; 141 return 0;
141 } 142 }
142err_out: 143err_out:
diff --git a/arch/powerpc/boot/treeboot-bamboo.c b/arch/powerpc/boot/treeboot-bamboo.c
new file mode 100644
index 000000000000..1f1fe5aaac12
--- /dev/null
+++ b/arch/powerpc/boot/treeboot-bamboo.c
@@ -0,0 +1,27 @@
1/*
2 * Copyright IBM Corporation, 2007
3 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
4 *
5 * Based on ebony wrapper:
6 * Copyright 2007 David Gibson, IBM Corporation.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; version 2 of the License
11 */
12#include "ops.h"
13#include "stdio.h"
14#include "44x.h"
15
16extern char _end[];
17
18BSS_STACK(4096);
19
20void platform_init(void)
21{
22 unsigned long end_of_ram = 0x8000000;
23 unsigned long avail_ram = end_of_ram - (unsigned long)_end;
24
25 simple_alloc_init(_end, avail_ram, 32, 64);
26 bamboo_init();
27}
diff --git a/arch/powerpc/boot/treeboot-ebony.c b/arch/powerpc/boot/treeboot-ebony.c
index 8436a9c55192..21cc4834a384 100644
--- a/arch/powerpc/boot/treeboot-ebony.c
+++ b/arch/powerpc/boot/treeboot-ebony.c
@@ -16,8 +16,6 @@
16#include "stdio.h" 16#include "stdio.h"
17#include "44x.h" 17#include "44x.h"
18 18
19extern char _end[];
20
21BSS_STACK(4096); 19BSS_STACK(4096);
22 20
23#define OPENBIOS_MAC_BASE 0xfffffe0c 21#define OPENBIOS_MAC_BASE 0xfffffe0c
diff --git a/arch/powerpc/boot/treeboot-walnut.c b/arch/powerpc/boot/treeboot-walnut.c
new file mode 100644
index 000000000000..3adf2d08a230
--- /dev/null
+++ b/arch/powerpc/boot/treeboot-walnut.c
@@ -0,0 +1,131 @@
1/*
2 * Old U-boot compatibility for Walnut
3 *
4 * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
5 *
6 * Copyright 2007 IBM Corporation
7 * Based on cuboot-83xx.c, which is:
8 * Copyright (c) 2007 Freescale Semiconductor, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published
12 * by the Free Software Foundation.
13 */
14
15#include "ops.h"
16#include "stdio.h"
17#include "dcr.h"
18#include "4xx.h"
19#include "io.h"
20
21BSS_STACK(4096);
22
23void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
24{
25 u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
26 u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
27 u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
28 u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
29 u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
30
31 fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
32 fbdv = (pllmr & 0x1e000000) >> 25;
33 cbdv = ((pllmr & 0x00060000) >> 17) + 1;
34 opdv = ((pllmr & 0x00018000) >> 15) + 1;
35 epdv = ((pllmr & 0x00001800) >> 13) + 2;
36 udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
37
38 m = fwdv * fbdv * cbdv;
39
40 cpu = sysclk * m / fwdv;
41 plb = cpu / cbdv;
42 opb = plb / opdv;
43 ebc = plb / epdv;
44
45 if (cpc0_cr0 & 0x80) {
46 /* uart0 uses the external clock */
47 uart0 = ser_clk;
48 } else {
49 uart0 = cpu / udiv;
50 }
51
52 if (cpc0_cr0 & 0x40) {
53 /* uart1 uses the external clock */
54 uart1 = ser_clk;
55 } else {
56 uart1 = cpu / udiv;
57 }
58
59 /* setup the timebase clock to tick at the cpu frequency */
60 cpc0_cr1 = cpc0_cr1 & ~ 0x00800000;
61 mtdcr(DCRN_CPC0_CR1, cpc0_cr1);
62 tb = cpu;
63
64 dt_fixup_cpu_clocks(cpu, tb, 0);
65 dt_fixup_clock("/plb", plb);
66 dt_fixup_clock("/plb/opb", opb);
67 dt_fixup_clock("/plb/ebc", ebc);
68 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
69 dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
70}
71
72static void walnut_flashsel_fixup(void)
73{
74 void *devp, *sram;
75 u32 reg_flash[3] = {0x0, 0x0, 0x80000};
76 u32 reg_sram[3] = {0x0, 0x0, 0x80000};
77 u8 *fpga;
78 u8 fpga_brds1 = 0x0;
79
80 devp = finddevice("/plb/ebc/fpga");
81 if (!devp)
82 fatal("Couldn't locate FPGA node\n\r");
83
84 if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
85 fatal("no virtual-reg property\n\r");
86
87 fpga_brds1 = in_8(fpga);
88
89 devp = finddevice("/plb/ebc/flash");
90 if (!devp)
91 fatal("Couldn't locate flash node\n\r");
92
93 if (getprop(devp, "reg", reg_flash, sizeof(reg_flash)) != sizeof(reg_flash))
94 fatal("flash reg property has unexpected size\n\r");
95
96 sram = finddevice("/plb/ebc/sram");
97 if (!sram)
98 fatal("Couldn't locate sram node\n\r");
99
100 if (getprop(sram, "reg", reg_sram, sizeof(reg_sram)) != sizeof(reg_sram))
101 fatal("sram reg property has unexpected size\n\r");
102
103 if (fpga_brds1 & 0x1) {
104 reg_flash[1] ^= 0x80000;
105 reg_sram[1] ^= 0x80000;
106 }
107
108 setprop(devp, "reg", reg_flash, sizeof(reg_flash));
109 setprop(sram, "reg", reg_sram, sizeof(reg_sram));
110}
111
112static void walnut_fixups(void)
113{
114 ibm4xx_fixup_memsize();
115 ibm405gp_fixup_clocks(33330000, 0xa8c000);
116 ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
117 ibm4xx_fixup_ebc_ranges("/plb/ebc");
118 walnut_flashsel_fixup();
119}
120
121void platform_init(void)
122{
123 unsigned long end_of_ram = 0x2000000;
124 unsigned long avail_ram = end_of_ram - (unsigned long) _end;
125
126 simple_alloc_init(_end, avail_ram, 32, 32);
127 platform_ops.fixups = walnut_fixups;
128 platform_ops.exit = ibm40x_dbcr_reset;
129 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
130 serial_console_init();
131}
diff --git a/arch/powerpc/configs/bamboo_defconfig b/arch/powerpc/configs/bamboo_defconfig
new file mode 100644
index 000000000000..b592dec4640f
--- /dev/null
+++ b/arch/powerpc/configs/bamboo_defconfig
@@ -0,0 +1,775 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc1
4# Fri Aug 3 10:46:53 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15CONFIG_44x=y
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_4xx=y
19CONFIG_BOOKE=y
20CONFIG_PTE_64BIT=y
21CONFIG_PHYS_64BIT=y
22# CONFIG_PPC_MM_SLICES is not set
23CONFIG_NOT_COHERENT_CACHE=y
24CONFIG_PPC32=y
25CONFIG_PPC_MERGE=y
26CONFIG_MMU=y
27CONFIG_GENERIC_HARDIRQS=y
28CONFIG_IRQ_PER_CPU=y
29CONFIG_RWSEM_XCHGADD_ALGORITHM=y
30CONFIG_ARCH_HAS_ILOG2_U32=y
31CONFIG_GENERIC_HWEIGHT=y
32CONFIG_GENERIC_CALIBRATE_DELAY=y
33CONFIG_GENERIC_FIND_NEXT_BIT=y
34# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35CONFIG_PPC=y
36CONFIG_EARLY_PRINTK=y
37CONFIG_GENERIC_NVRAM=y
38CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
39CONFIG_ARCH_MAY_HAVE_PC_FDC=y
40CONFIG_PPC_OF=y
41CONFIG_OF=y
42CONFIG_PPC_UDBG_16550=y
43# CONFIG_GENERIC_TBSYNC is not set
44CONFIG_AUDIT_ARCH=y
45CONFIG_GENERIC_BUG=y
46# CONFIG_DEFAULT_UIMAGE is not set
47CONFIG_PPC_DCR_NATIVE=y
48# CONFIG_PPC_DCR_MMIO is not set
49CONFIG_PPC_DCR=y
50CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
51
52#
53# General setup
54#
55CONFIG_EXPERIMENTAL=y
56CONFIG_BROKEN_ON_SMP=y
57CONFIG_INIT_ENV_ARG_LIMIT=32
58CONFIG_LOCALVERSION=""
59CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y
61CONFIG_SYSVIPC=y
62CONFIG_SYSVIPC_SYSCTL=y
63CONFIG_POSIX_MQUEUE=y
64# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set
66# CONFIG_USER_NS is not set
67# CONFIG_AUDIT is not set
68# CONFIG_IKCONFIG is not set
69CONFIG_LOG_BUF_SHIFT=14
70CONFIG_SYSFS_DEPRECATED=y
71# CONFIG_RELAY is not set
72CONFIG_BLK_DEV_INITRD=y
73CONFIG_INITRAMFS_SOURCE=""
74# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
75CONFIG_SYSCTL=y
76CONFIG_EMBEDDED=y
77CONFIG_SYSCTL_SYSCALL=y
78CONFIG_KALLSYMS=y
79# CONFIG_KALLSYMS_ALL is not set
80# CONFIG_KALLSYMS_EXTRA_PASS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_ANON_INODES=y
88CONFIG_EPOLL=y
89CONFIG_SIGNALFD=y
90CONFIG_TIMERFD=y
91CONFIG_EVENTFD=y
92CONFIG_SHMEM=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97CONFIG_RT_MUTEXES=y
98# CONFIG_TINY_SHMEM is not set
99CONFIG_BASE_SMALL=0
100CONFIG_MODULES=y
101CONFIG_MODULE_UNLOAD=y
102# CONFIG_MODULE_FORCE_UNLOAD is not set
103# CONFIG_MODVERSIONS is not set
104# CONFIG_MODULE_SRCVERSION_ALL is not set
105CONFIG_KMOD=y
106CONFIG_BLOCK=y
107CONFIG_LBD=y
108# CONFIG_BLK_DEV_IO_TRACE is not set
109# CONFIG_LSF is not set
110# CONFIG_BLK_DEV_BSG is not set
111
112#
113# IO Schedulers
114#
115CONFIG_IOSCHED_NOOP=y
116CONFIG_IOSCHED_AS=y
117CONFIG_IOSCHED_DEADLINE=y
118CONFIG_IOSCHED_CFQ=y
119CONFIG_DEFAULT_AS=y
120# CONFIG_DEFAULT_DEADLINE is not set
121# CONFIG_DEFAULT_CFQ is not set
122# CONFIG_DEFAULT_NOOP is not set
123CONFIG_DEFAULT_IOSCHED="anticipatory"
124
125#
126# Platform support
127#
128# CONFIG_PPC_MPC52xx is not set
129# CONFIG_PPC_MPC5200 is not set
130# CONFIG_PPC_CELL is not set
131# CONFIG_PPC_CELL_NATIVE is not set
132# CONFIG_PQ2ADS is not set
133CONFIG_BAMBOO=y
134# CONFIG_EBONY is not set
135CONFIG_440EP=y
136CONFIG_IBM440EP_ERR42=y
137# CONFIG_MPIC is not set
138# CONFIG_MPIC_WEIRD is not set
139# CONFIG_PPC_I8259 is not set
140# CONFIG_PPC_RTAS is not set
141# CONFIG_MMIO_NVRAM is not set
142# CONFIG_PPC_MPC106 is not set
143# CONFIG_PPC_970_NAP is not set
144# CONFIG_PPC_INDIRECT_IO is not set
145# CONFIG_GENERIC_IOMAP is not set
146# CONFIG_CPU_FREQ is not set
147# CONFIG_CPM2 is not set
148
149#
150# Kernel options
151#
152# CONFIG_HIGHMEM is not set
153# CONFIG_HZ_100 is not set
154CONFIG_HZ_250=y
155# CONFIG_HZ_300 is not set
156# CONFIG_HZ_1000 is not set
157CONFIG_HZ=250
158CONFIG_PREEMPT_NONE=y
159# CONFIG_PREEMPT_VOLUNTARY is not set
160# CONFIG_PREEMPT is not set
161CONFIG_BINFMT_ELF=y
162# CONFIG_BINFMT_MISC is not set
163# CONFIG_MATH_EMULATION is not set
164CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
165CONFIG_ARCH_FLATMEM_ENABLE=y
166CONFIG_ARCH_POPULATES_NODE_MAP=y
167CONFIG_SELECT_MEMORY_MODEL=y
168CONFIG_FLATMEM_MANUAL=y
169# CONFIG_DISCONTIGMEM_MANUAL is not set
170# CONFIG_SPARSEMEM_MANUAL is not set
171CONFIG_FLATMEM=y
172CONFIG_FLAT_NODE_MEM_MAP=y
173# CONFIG_SPARSEMEM_STATIC is not set
174CONFIG_SPLIT_PTLOCK_CPUS=4
175CONFIG_RESOURCES_64BIT=y
176CONFIG_ZONE_DMA_FLAG=1
177CONFIG_BOUNCE=y
178CONFIG_VIRT_TO_BUS=y
179CONFIG_PROC_DEVICETREE=y
180CONFIG_CMDLINE_BOOL=y
181CONFIG_CMDLINE=""
182CONFIG_SECCOMP=y
183CONFIG_WANT_DEVICE_TREE=y
184CONFIG_DEVICE_TREE="bamboo.dts"
185CONFIG_ISA_DMA_API=y
186
187#
188# Bus options
189#
190CONFIG_ZONE_DMA=y
191CONFIG_PPC_INDIRECT_PCI=y
192CONFIG_PCI=y
193CONFIG_PCI_DOMAINS=y
194CONFIG_PCI_SYSCALL=y
195# CONFIG_PCIEPORTBUS is not set
196CONFIG_ARCH_SUPPORTS_MSI=y
197# CONFIG_PCI_MSI is not set
198# CONFIG_PCI_DEBUG is not set
199
200#
201# PCCARD (PCMCIA/CardBus) support
202#
203# CONFIG_PCCARD is not set
204# CONFIG_HOTPLUG_PCI is not set
205
206#
207# Advanced setup
208#
209# CONFIG_ADVANCED_OPTIONS is not set
210
211#
212# Default settings for advanced configuration options are used
213#
214CONFIG_HIGHMEM_START=0xfe000000
215CONFIG_LOWMEM_SIZE=0x30000000
216CONFIG_KERNEL_START=0xc0000000
217CONFIG_TASK_SIZE=0x80000000
218CONFIG_CONSISTENT_START=0xff100000
219CONFIG_CONSISTENT_SIZE=0x00200000
220CONFIG_BOOT_LOAD=0x01000000
221
222#
223# Networking
224#
225CONFIG_NET=y
226
227#
228# Networking options
229#
230CONFIG_PACKET=y
231# CONFIG_PACKET_MMAP is not set
232CONFIG_UNIX=y
233# CONFIG_NET_KEY is not set
234CONFIG_INET=y
235# CONFIG_IP_MULTICAST is not set
236# CONFIG_IP_ADVANCED_ROUTER is not set
237CONFIG_IP_FIB_HASH=y
238CONFIG_IP_PNP=y
239CONFIG_IP_PNP_DHCP=y
240CONFIG_IP_PNP_BOOTP=y
241# CONFIG_IP_PNP_RARP is not set
242# CONFIG_NET_IPIP is not set
243# CONFIG_NET_IPGRE is not set
244# CONFIG_ARPD is not set
245# CONFIG_SYN_COOKIES is not set
246# CONFIG_INET_AH is not set
247# CONFIG_INET_ESP is not set
248# CONFIG_INET_IPCOMP is not set
249# CONFIG_INET_XFRM_TUNNEL is not set
250# CONFIG_INET_TUNNEL is not set
251# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
252# CONFIG_INET_XFRM_MODE_TUNNEL is not set
253# CONFIG_INET_XFRM_MODE_BEET is not set
254CONFIG_INET_DIAG=y
255CONFIG_INET_TCP_DIAG=y
256# CONFIG_TCP_CONG_ADVANCED is not set
257CONFIG_TCP_CONG_CUBIC=y
258CONFIG_DEFAULT_TCP_CONG="cubic"
259# CONFIG_TCP_MD5SIG is not set
260# CONFIG_IPV6 is not set
261# CONFIG_INET6_XFRM_TUNNEL is not set
262# CONFIG_INET6_TUNNEL is not set
263# CONFIG_NETWORK_SECMARK is not set
264# CONFIG_NETFILTER is not set
265# CONFIG_IP_DCCP is not set
266# CONFIG_IP_SCTP is not set
267# CONFIG_TIPC is not set
268# CONFIG_ATM is not set
269# CONFIG_BRIDGE is not set
270# CONFIG_VLAN_8021Q is not set
271# CONFIG_DECNET is not set
272# CONFIG_LLC2 is not set
273# CONFIG_IPX is not set
274# CONFIG_ATALK is not set
275# CONFIG_X25 is not set
276# CONFIG_LAPB is not set
277# CONFIG_ECONET is not set
278# CONFIG_WAN_ROUTER is not set
279
280#
281# QoS and/or fair queueing
282#
283# CONFIG_NET_SCHED is not set
284
285#
286# Network testing
287#
288# CONFIG_NET_PKTGEN is not set
289# CONFIG_HAMRADIO is not set
290# CONFIG_IRDA is not set
291# CONFIG_BT is not set
292# CONFIG_AF_RXRPC is not set
293
294#
295# Wireless
296#
297# CONFIG_CFG80211 is not set
298# CONFIG_WIRELESS_EXT is not set
299# CONFIG_MAC80211 is not set
300# CONFIG_IEEE80211 is not set
301# CONFIG_RFKILL is not set
302# CONFIG_NET_9P is not set
303
304#
305# Device Drivers
306#
307
308#
309# Generic Driver Options
310#
311CONFIG_STANDALONE=y
312CONFIG_PREVENT_FIRMWARE_BUILD=y
313CONFIG_FW_LOADER=y
314# CONFIG_DEBUG_DRIVER is not set
315# CONFIG_DEBUG_DEVRES is not set
316# CONFIG_SYS_HYPERVISOR is not set
317CONFIG_CONNECTOR=y
318CONFIG_PROC_EVENTS=y
319# CONFIG_MTD is not set
320CONFIG_OF_DEVICE=y
321# CONFIG_PARPORT is not set
322CONFIG_BLK_DEV=y
323# CONFIG_BLK_DEV_FD is not set
324# CONFIG_BLK_CPQ_DA is not set
325# CONFIG_BLK_CPQ_CISS_DA is not set
326# CONFIG_BLK_DEV_DAC960 is not set
327# CONFIG_BLK_DEV_UMEM is not set
328# CONFIG_BLK_DEV_COW_COMMON is not set
329# CONFIG_BLK_DEV_LOOP is not set
330# CONFIG_BLK_DEV_NBD is not set
331# CONFIG_BLK_DEV_SX8 is not set
332CONFIG_BLK_DEV_RAM=y
333CONFIG_BLK_DEV_RAM_COUNT=16
334CONFIG_BLK_DEV_RAM_SIZE=35000
335CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
336# CONFIG_CDROM_PKTCDVD is not set
337# CONFIG_ATA_OVER_ETH is not set
338# CONFIG_XILINX_SYSACE is not set
339CONFIG_MISC_DEVICES=y
340# CONFIG_PHANTOM is not set
341# CONFIG_EEPROM_93CX6 is not set
342# CONFIG_SGI_IOC4 is not set
343# CONFIG_TIFM_CORE is not set
344# CONFIG_IDE is not set
345
346#
347# SCSI device support
348#
349# CONFIG_RAID_ATTRS is not set
350# CONFIG_SCSI is not set
351# CONFIG_SCSI_DMA is not set
352# CONFIG_SCSI_NETLINK is not set
353# CONFIG_ATA is not set
354# CONFIG_MD is not set
355
356#
357# Fusion MPT device support
358#
359# CONFIG_FUSION is not set
360
361#
362# IEEE 1394 (FireWire) support
363#
364# CONFIG_FIREWIRE is not set
365# CONFIG_IEEE1394 is not set
366# CONFIG_I2O is not set
367CONFIG_MACINTOSH_DRIVERS=y
368# CONFIG_MAC_EMUMOUSEBTN is not set
369# CONFIG_WINDFARM is not set
370CONFIG_NETDEVICES=y
371# CONFIG_NETDEVICES_MULTIQUEUE is not set
372# CONFIG_DUMMY is not set
373# CONFIG_BONDING is not set
374# CONFIG_MACVLAN is not set
375# CONFIG_EQUALIZER is not set
376# CONFIG_TUN is not set
377# CONFIG_ARCNET is not set
378# CONFIG_NET_ETHERNET is not set
379CONFIG_NETDEV_1000=y
380# CONFIG_ACENIC is not set
381# CONFIG_DL2K is not set
382# CONFIG_E1000 is not set
383# CONFIG_NS83820 is not set
384# CONFIG_HAMACHI is not set
385# CONFIG_YELLOWFIN is not set
386# CONFIG_R8169 is not set
387# CONFIG_SIS190 is not set
388# CONFIG_SKGE is not set
389# CONFIG_SKY2 is not set
390# CONFIG_VIA_VELOCITY is not set
391# CONFIG_TIGON3 is not set
392# CONFIG_BNX2 is not set
393# CONFIG_QLA3XXX is not set
394# CONFIG_ATL1 is not set
395CONFIG_NETDEV_10000=y
396# CONFIG_CHELSIO_T1 is not set
397# CONFIG_CHELSIO_T3 is not set
398# CONFIG_IXGB is not set
399# CONFIG_S2IO is not set
400# CONFIG_MYRI10GE is not set
401# CONFIG_NETXEN_NIC is not set
402# CONFIG_MLX4_CORE is not set
403# CONFIG_TR is not set
404
405#
406# Wireless LAN
407#
408# CONFIG_WLAN_PRE80211 is not set
409# CONFIG_WLAN_80211 is not set
410# CONFIG_WAN is not set
411# CONFIG_FDDI is not set
412# CONFIG_HIPPI is not set
413# CONFIG_PPP is not set
414# CONFIG_SLIP is not set
415# CONFIG_SHAPER is not set
416# CONFIG_NETCONSOLE is not set
417# CONFIG_NETPOLL is not set
418# CONFIG_NET_POLL_CONTROLLER is not set
419# CONFIG_ISDN is not set
420# CONFIG_PHONE is not set
421
422#
423# Input device support
424#
425# CONFIG_INPUT is not set
426
427#
428# Hardware I/O ports
429#
430# CONFIG_SERIO is not set
431# CONFIG_GAMEPORT is not set
432
433#
434# Character devices
435#
436# CONFIG_VT is not set
437# CONFIG_SERIAL_NONSTANDARD is not set
438
439#
440# Serial drivers
441#
442CONFIG_SERIAL_8250=y
443CONFIG_SERIAL_8250_CONSOLE=y
444# CONFIG_SERIAL_8250_PCI is not set
445CONFIG_SERIAL_8250_NR_UARTS=4
446CONFIG_SERIAL_8250_RUNTIME_UARTS=4
447CONFIG_SERIAL_8250_EXTENDED=y
448# CONFIG_SERIAL_8250_MANY_PORTS is not set
449CONFIG_SERIAL_8250_SHARE_IRQ=y
450# CONFIG_SERIAL_8250_DETECT_IRQ is not set
451# CONFIG_SERIAL_8250_RSA is not set
452
453#
454# Non-8250 serial port support
455#
456# CONFIG_SERIAL_UARTLITE is not set
457CONFIG_SERIAL_CORE=y
458CONFIG_SERIAL_CORE_CONSOLE=y
459# CONFIG_SERIAL_JSM is not set
460CONFIG_SERIAL_OF_PLATFORM=y
461CONFIG_UNIX98_PTYS=y
462CONFIG_LEGACY_PTYS=y
463CONFIG_LEGACY_PTY_COUNT=256
464# CONFIG_IPMI_HANDLER is not set
465# CONFIG_WATCHDOG is not set
466# CONFIG_HW_RANDOM is not set
467# CONFIG_NVRAM is not set
468# CONFIG_GEN_RTC is not set
469# CONFIG_R3964 is not set
470# CONFIG_APPLICOM is not set
471# CONFIG_AGP is not set
472# CONFIG_DRM is not set
473# CONFIG_RAW_DRIVER is not set
474# CONFIG_TCG_TPM is not set
475CONFIG_DEVPORT=y
476# CONFIG_I2C is not set
477
478#
479# SPI support
480#
481# CONFIG_SPI is not set
482# CONFIG_SPI_MASTER is not set
483# CONFIG_W1 is not set
484# CONFIG_POWER_SUPPLY is not set
485# CONFIG_HWMON is not set
486
487#
488# Multifunction device drivers
489#
490# CONFIG_MFD_SM501 is not set
491
492#
493# Multimedia devices
494#
495# CONFIG_VIDEO_DEV is not set
496# CONFIG_DVB_CORE is not set
497CONFIG_DAB=y
498
499#
500# Graphics support
501#
502# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
503
504#
505# Display device support
506#
507# CONFIG_DISPLAY_SUPPORT is not set
508# CONFIG_VGASTATE is not set
509CONFIG_VIDEO_OUTPUT_CONTROL=m
510# CONFIG_FB is not set
511# CONFIG_FB_IBM_GXT4500 is not set
512
513#
514# Sound
515#
516# CONFIG_SOUND is not set
517CONFIG_USB_SUPPORT=y
518CONFIG_USB_ARCH_HAS_HCD=y
519CONFIG_USB_ARCH_HAS_OHCI=y
520CONFIG_USB_ARCH_HAS_EHCI=y
521# CONFIG_USB is not set
522
523#
524# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
525#
526
527#
528# USB Gadget Support
529#
530# CONFIG_USB_GADGET is not set
531# CONFIG_MMC is not set
532# CONFIG_NEW_LEDS is not set
533# CONFIG_INFINIBAND is not set
534# CONFIG_EDAC is not set
535# CONFIG_RTC_CLASS is not set
536
537#
538# DMA Engine support
539#
540# CONFIG_DMA_ENGINE is not set
541
542#
543# DMA Clients
544#
545
546#
547# DMA Devices
548#
549
550#
551# Userspace I/O
552#
553# CONFIG_UIO is not set
554
555#
556# File systems
557#
558CONFIG_EXT2_FS=y
559# CONFIG_EXT2_FS_XATTR is not set
560# CONFIG_EXT2_FS_XIP is not set
561# CONFIG_EXT3_FS is not set
562# CONFIG_EXT4DEV_FS is not set
563# CONFIG_REISERFS_FS is not set
564# CONFIG_JFS_FS is not set
565# CONFIG_FS_POSIX_ACL is not set
566# CONFIG_XFS_FS is not set
567# CONFIG_GFS2_FS is not set
568# CONFIG_OCFS2_FS is not set
569# CONFIG_MINIX_FS is not set
570# CONFIG_ROMFS_FS is not set
571CONFIG_INOTIFY=y
572CONFIG_INOTIFY_USER=y
573# CONFIG_QUOTA is not set
574CONFIG_DNOTIFY=y
575# CONFIG_AUTOFS_FS is not set
576# CONFIG_AUTOFS4_FS is not set
577# CONFIG_FUSE_FS is not set
578
579#
580# CD-ROM/DVD Filesystems
581#
582# CONFIG_ISO9660_FS is not set
583# CONFIG_UDF_FS is not set
584
585#
586# DOS/FAT/NT Filesystems
587#
588# CONFIG_MSDOS_FS is not set
589# CONFIG_VFAT_FS is not set
590# CONFIG_NTFS_FS is not set
591
592#
593# Pseudo filesystems
594#
595CONFIG_PROC_FS=y
596CONFIG_PROC_KCORE=y
597CONFIG_PROC_SYSCTL=y
598CONFIG_SYSFS=y
599CONFIG_TMPFS=y
600# CONFIG_TMPFS_POSIX_ACL is not set
601# CONFIG_HUGETLB_PAGE is not set
602CONFIG_RAMFS=y
603# CONFIG_CONFIGFS_FS is not set
604
605#
606# Miscellaneous filesystems
607#
608# CONFIG_ADFS_FS is not set
609# CONFIG_AFFS_FS is not set
610# CONFIG_HFS_FS is not set
611# CONFIG_HFSPLUS_FS is not set
612# CONFIG_BEFS_FS is not set
613# CONFIG_BFS_FS is not set
614# CONFIG_EFS_FS is not set
615CONFIG_CRAMFS=y
616# CONFIG_VXFS_FS is not set
617# CONFIG_HPFS_FS is not set
618# CONFIG_QNX4FS_FS is not set
619# CONFIG_SYSV_FS is not set
620# CONFIG_UFS_FS is not set
621
622#
623# Network File Systems
624#
625CONFIG_NFS_FS=y
626CONFIG_NFS_V3=y
627# CONFIG_NFS_V3_ACL is not set
628# CONFIG_NFS_V4 is not set
629# CONFIG_NFS_DIRECTIO is not set
630# CONFIG_NFSD is not set
631CONFIG_ROOT_NFS=y
632CONFIG_LOCKD=y
633CONFIG_LOCKD_V4=y
634CONFIG_NFS_COMMON=y
635CONFIG_SUNRPC=y
636# CONFIG_SUNRPC_BIND34 is not set
637# CONFIG_RPCSEC_GSS_KRB5 is not set
638# CONFIG_RPCSEC_GSS_SPKM3 is not set
639# CONFIG_SMB_FS is not set
640# CONFIG_CIFS is not set
641# CONFIG_NCP_FS is not set
642# CONFIG_CODA_FS is not set
643# CONFIG_AFS_FS is not set
644
645#
646# Partition Types
647#
648# CONFIG_PARTITION_ADVANCED is not set
649CONFIG_MSDOS_PARTITION=y
650
651#
652# Native Language Support
653#
654# CONFIG_NLS is not set
655
656#
657# Distributed Lock Manager
658#
659# CONFIG_DLM is not set
660# CONFIG_UCC_SLOW is not set
661
662#
663# Library routines
664#
665CONFIG_BITREVERSE=y
666# CONFIG_CRC_CCITT is not set
667# CONFIG_CRC16 is not set
668# CONFIG_CRC_ITU_T is not set
669CONFIG_CRC32=y
670# CONFIG_CRC7 is not set
671# CONFIG_LIBCRC32C is not set
672CONFIG_ZLIB_INFLATE=y
673CONFIG_PLIST=y
674CONFIG_HAS_IOMEM=y
675CONFIG_HAS_IOPORT=y
676CONFIG_HAS_DMA=y
677
678#
679# Instrumentation Support
680#
681# CONFIG_PROFILING is not set
682
683#
684# Kernel hacking
685#
686# CONFIG_PRINTK_TIME is not set
687CONFIG_ENABLE_MUST_CHECK=y
688CONFIG_MAGIC_SYSRQ=y
689# CONFIG_UNUSED_SYMBOLS is not set
690# CONFIG_DEBUG_FS is not set
691# CONFIG_HEADERS_CHECK is not set
692CONFIG_DEBUG_KERNEL=y
693# CONFIG_DEBUG_SHIRQ is not set
694CONFIG_DETECT_SOFTLOCKUP=y
695CONFIG_SCHED_DEBUG=y
696# CONFIG_SCHEDSTATS is not set
697# CONFIG_TIMER_STATS is not set
698# CONFIG_DEBUG_SLAB is not set
699# CONFIG_DEBUG_RT_MUTEXES is not set
700# CONFIG_RT_MUTEX_TESTER is not set
701# CONFIG_DEBUG_SPINLOCK is not set
702# CONFIG_DEBUG_MUTEXES is not set
703# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
704# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
705# CONFIG_DEBUG_KOBJECT is not set
706# CONFIG_DEBUG_BUGVERBOSE is not set
707# CONFIG_DEBUG_INFO is not set
708# CONFIG_DEBUG_VM is not set
709# CONFIG_DEBUG_LIST is not set
710CONFIG_FORCED_INLINING=y
711# CONFIG_RCU_TORTURE_TEST is not set
712# CONFIG_FAULT_INJECTION is not set
713# CONFIG_DEBUG_STACKOVERFLOW is not set
714# CONFIG_DEBUG_STACK_USAGE is not set
715# CONFIG_DEBUG_PAGEALLOC is not set
716CONFIG_DEBUGGER=y
717# CONFIG_KGDB is not set
718# CONFIG_XMON is not set
719# CONFIG_BDI_SWITCH is not set
720CONFIG_PPC_EARLY_DEBUG=y
721# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
722# CONFIG_PPC_EARLY_DEBUG_G5 is not set
723# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
724# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
725# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
726# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
727# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
728# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
729CONFIG_PPC_EARLY_DEBUG_44x=y
730CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
731CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x0
732
733#
734# Security options
735#
736# CONFIG_KEYS is not set
737# CONFIG_SECURITY is not set
738CONFIG_CRYPTO=y
739CONFIG_CRYPTO_ALGAPI=y
740CONFIG_CRYPTO_BLKCIPHER=y
741CONFIG_CRYPTO_MANAGER=y
742# CONFIG_CRYPTO_HMAC is not set
743# CONFIG_CRYPTO_XCBC is not set
744# CONFIG_CRYPTO_NULL is not set
745# CONFIG_CRYPTO_MD4 is not set
746CONFIG_CRYPTO_MD5=y
747# CONFIG_CRYPTO_SHA1 is not set
748# CONFIG_CRYPTO_SHA256 is not set
749# CONFIG_CRYPTO_SHA512 is not set
750# CONFIG_CRYPTO_WP512 is not set
751# CONFIG_CRYPTO_TGR192 is not set
752# CONFIG_CRYPTO_GF128MUL is not set
753CONFIG_CRYPTO_ECB=y
754CONFIG_CRYPTO_CBC=y
755CONFIG_CRYPTO_PCBC=y
756# CONFIG_CRYPTO_LRW is not set
757# CONFIG_CRYPTO_CRYPTD is not set
758CONFIG_CRYPTO_DES=y
759# CONFIG_CRYPTO_FCRYPT is not set
760# CONFIG_CRYPTO_BLOWFISH is not set
761# CONFIG_CRYPTO_TWOFISH is not set
762# CONFIG_CRYPTO_SERPENT is not set
763# CONFIG_CRYPTO_AES is not set
764# CONFIG_CRYPTO_CAST5 is not set
765# CONFIG_CRYPTO_CAST6 is not set
766# CONFIG_CRYPTO_TEA is not set
767# CONFIG_CRYPTO_ARC4 is not set
768# CONFIG_CRYPTO_KHAZAD is not set
769# CONFIG_CRYPTO_ANUBIS is not set
770# CONFIG_CRYPTO_DEFLATE is not set
771# CONFIG_CRYPTO_MICHAEL_MIC is not set
772# CONFIG_CRYPTO_CRC32C is not set
773# CONFIG_CRYPTO_CAMELLIA is not set
774# CONFIG_CRYPTO_TEST is not set
775CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/configs/ebony_defconfig b/arch/powerpc/configs/ebony_defconfig
index ebb8167608b8..3a50467b1f75 100644
--- a/arch/powerpc/configs/ebony_defconfig
+++ b/arch/powerpc/configs/ebony_defconfig
@@ -313,7 +313,80 @@ CONFIG_FW_LOADER=y
313# CONFIG_SYS_HYPERVISOR is not set 313# CONFIG_SYS_HYPERVISOR is not set
314CONFIG_CONNECTOR=y 314CONFIG_CONNECTOR=y
315CONFIG_PROC_EVENTS=y 315CONFIG_PROC_EVENTS=y
316# CONFIG_MTD is not set 316CONFIG_MTD=y
317# CONFIG_MTD_DEBUG is not set
318# CONFIG_MTD_CONCAT is not set
319CONFIG_MTD_PARTITIONS=y
320# CONFIG_MTD_REDBOOT_PARTS is not set
321# CONFIG_MTD_CMDLINE_PARTS is not set
322
323#
324# User Modules And Translation Layers
325#
326CONFIG_MTD_CHAR=y
327CONFIG_MTD_BLKDEVS=y
328CONFIG_MTD_BLOCK=y
329# CONFIG_FTL is not set
330# CONFIG_NFTL is not set
331# CONFIG_INFTL is not set
332# CONFIG_RFD_FTL is not set
333# CONFIG_SSFDC is not set
334
335#
336# RAM/ROM/Flash chip drivers
337#
338CONFIG_MTD_CFI=y
339CONFIG_MTD_JEDECPROBE=y
340CONFIG_MTD_GEN_PROBE=y
341# CONFIG_MTD_CFI_ADV_OPTIONS is not set
342CONFIG_MTD_MAP_BANK_WIDTH_1=y
343CONFIG_MTD_MAP_BANK_WIDTH_2=y
344CONFIG_MTD_MAP_BANK_WIDTH_4=y
345# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
346# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
347# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
348CONFIG_MTD_CFI_I1=y
349CONFIG_MTD_CFI_I2=y
350# CONFIG_MTD_CFI_I4 is not set
351# CONFIG_MTD_CFI_I8 is not set
352# CONFIG_MTD_CFI_INTELEXT is not set
353CONFIG_MTD_CFI_AMDSTD=y
354# CONFIG_MTD_CFI_STAA is not set
355CONFIG_MTD_CFI_UTIL=y
356# CONFIG_MTD_RAM is not set
357# CONFIG_MTD_ROM is not set
358# CONFIG_MTD_ABSENT is not set
359
360#
361# Mapping drivers for chip access
362#
363# CONFIG_MTD_COMPLEX_MAPPINGS is not set
364# CONFIG_MTD_PHYSMAP is not set
365CONFIG_MTD_PHYSMAP_OF=y
366# CONFIG_MTD_PLATRAM is not set
367
368#
369# Self-contained MTD device drivers
370#
371# CONFIG_MTD_PMC551 is not set
372# CONFIG_MTD_SLRAM is not set
373# CONFIG_MTD_PHRAM is not set
374# CONFIG_MTD_MTDRAM is not set
375# CONFIG_MTD_BLOCK2MTD is not set
376
377#
378# Disk-On-Chip Device Drivers
379#
380# CONFIG_MTD_DOC2000 is not set
381# CONFIG_MTD_DOC2001 is not set
382# CONFIG_MTD_DOC2001PLUS is not set
383# CONFIG_MTD_NAND is not set
384# CONFIG_MTD_ONENAND is not set
385
386#
387# UBI - Unsorted block images
388#
389# CONFIG_MTD_UBI is not set
317CONFIG_OF_DEVICE=y 390CONFIG_OF_DEVICE=y
318# CONFIG_PARPORT is not set 391# CONFIG_PARPORT is not set
319CONFIG_BLK_DEV=y 392CONFIG_BLK_DEV=y
@@ -607,6 +680,15 @@ CONFIG_RAMFS=y
607# CONFIG_BEFS_FS is not set 680# CONFIG_BEFS_FS is not set
608# CONFIG_BFS_FS is not set 681# CONFIG_BFS_FS is not set
609# CONFIG_EFS_FS is not set 682# CONFIG_EFS_FS is not set
683CONFIG_JFFS2_FS=y
684CONFIG_JFFS2_FS_DEBUG=0
685CONFIG_JFFS2_FS_WRITEBUFFER=y
686# CONFIG_JFFS2_SUMMARY is not set
687# CONFIG_JFFS2_FS_XATTR is not set
688# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
689CONFIG_JFFS2_ZLIB=y
690CONFIG_JFFS2_RTIME=y
691# CONFIG_JFFS2_RUBIN is not set
610CONFIG_CRAMFS=y 692CONFIG_CRAMFS=y
611# CONFIG_VXFS_FS is not set 693# CONFIG_VXFS_FS is not set
612# CONFIG_HPFS_FS is not set 694# CONFIG_HPFS_FS is not set
@@ -665,6 +747,7 @@ CONFIG_CRC32=y
665# CONFIG_CRC7 is not set 747# CONFIG_CRC7 is not set
666# CONFIG_LIBCRC32C is not set 748# CONFIG_LIBCRC32C is not set
667CONFIG_ZLIB_INFLATE=y 749CONFIG_ZLIB_INFLATE=y
750CONFIG_ZLIB_DEFLATE=y
668CONFIG_PLIST=y 751CONFIG_PLIST=y
669CONFIG_HAS_IOMEM=y 752CONFIG_HAS_IOMEM=y
670CONFIG_HAS_IOPORT=y 753CONFIG_HAS_IOPORT=y
diff --git a/arch/powerpc/configs/sequoia_defconfig b/arch/powerpc/configs/sequoia_defconfig
new file mode 100644
index 000000000000..58256625b5b8
--- /dev/null
+++ b/arch/powerpc/configs/sequoia_defconfig
@@ -0,0 +1,776 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc3
4# Mon Aug 27 20:19:13 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15CONFIG_44x=y
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_4xx=y
19CONFIG_BOOKE=y
20CONFIG_PTE_64BIT=y
21CONFIG_PHYS_64BIT=y
22# CONFIG_PPC_MM_SLICES is not set
23CONFIG_NOT_COHERENT_CACHE=y
24CONFIG_PPC32=y
25CONFIG_PPC_MERGE=y
26CONFIG_MMU=y
27CONFIG_GENERIC_HARDIRQS=y
28CONFIG_IRQ_PER_CPU=y
29CONFIG_RWSEM_XCHGADD_ALGORITHM=y
30CONFIG_ARCH_HAS_ILOG2_U32=y
31CONFIG_GENERIC_HWEIGHT=y
32CONFIG_GENERIC_CALIBRATE_DELAY=y
33CONFIG_GENERIC_FIND_NEXT_BIT=y
34# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35CONFIG_PPC=y
36CONFIG_EARLY_PRINTK=y
37CONFIG_GENERIC_NVRAM=y
38CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
39CONFIG_ARCH_MAY_HAVE_PC_FDC=y
40CONFIG_PPC_OF=y
41CONFIG_OF=y
42CONFIG_PPC_UDBG_16550=y
43# CONFIG_GENERIC_TBSYNC is not set
44CONFIG_AUDIT_ARCH=y
45CONFIG_GENERIC_BUG=y
46# CONFIG_DEFAULT_UIMAGE is not set
47CONFIG_PPC_DCR_NATIVE=y
48# CONFIG_PPC_DCR_MMIO is not set
49CONFIG_PPC_DCR=y
50CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
51
52#
53# General setup
54#
55CONFIG_EXPERIMENTAL=y
56CONFIG_BROKEN_ON_SMP=y
57CONFIG_INIT_ENV_ARG_LIMIT=32
58CONFIG_LOCALVERSION=""
59CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y
61CONFIG_SYSVIPC=y
62CONFIG_SYSVIPC_SYSCTL=y
63CONFIG_POSIX_MQUEUE=y
64# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set
66# CONFIG_USER_NS is not set
67# CONFIG_AUDIT is not set
68# CONFIG_IKCONFIG is not set
69CONFIG_LOG_BUF_SHIFT=14
70CONFIG_SYSFS_DEPRECATED=y
71# CONFIG_RELAY is not set
72CONFIG_BLK_DEV_INITRD=y
73CONFIG_INITRAMFS_SOURCE=""
74# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
75CONFIG_SYSCTL=y
76CONFIG_EMBEDDED=y
77CONFIG_SYSCTL_SYSCALL=y
78CONFIG_KALLSYMS=y
79# CONFIG_KALLSYMS_ALL is not set
80# CONFIG_KALLSYMS_EXTRA_PASS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_ANON_INODES=y
88CONFIG_EPOLL=y
89CONFIG_SIGNALFD=y
90CONFIG_TIMERFD=y
91CONFIG_EVENTFD=y
92CONFIG_SHMEM=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97CONFIG_RT_MUTEXES=y
98# CONFIG_TINY_SHMEM is not set
99CONFIG_BASE_SMALL=0
100CONFIG_MODULES=y
101CONFIG_MODULE_UNLOAD=y
102# CONFIG_MODULE_FORCE_UNLOAD is not set
103# CONFIG_MODVERSIONS is not set
104# CONFIG_MODULE_SRCVERSION_ALL is not set
105CONFIG_KMOD=y
106CONFIG_BLOCK=y
107CONFIG_LBD=y
108# CONFIG_BLK_DEV_IO_TRACE is not set
109# CONFIG_LSF is not set
110# CONFIG_BLK_DEV_BSG is not set
111
112#
113# IO Schedulers
114#
115CONFIG_IOSCHED_NOOP=y
116CONFIG_IOSCHED_AS=y
117CONFIG_IOSCHED_DEADLINE=y
118CONFIG_IOSCHED_CFQ=y
119CONFIG_DEFAULT_AS=y
120# CONFIG_DEFAULT_DEADLINE is not set
121# CONFIG_DEFAULT_CFQ is not set
122# CONFIG_DEFAULT_NOOP is not set
123CONFIG_DEFAULT_IOSCHED="anticipatory"
124
125#
126# Platform support
127#
128# CONFIG_PPC_MPC52xx is not set
129# CONFIG_PPC_MPC5200 is not set
130# CONFIG_PPC_CELL is not set
131# CONFIG_PPC_CELL_NATIVE is not set
132# CONFIG_PQ2ADS is not set
133# CONFIG_BAMBOO is not set
134# CONFIG_EBONY is not set
135CONFIG_SEQUOIA=y
136CONFIG_440EPX=y
137CONFIG_440A=y
138# CONFIG_MPIC is not set
139# CONFIG_MPIC_WEIRD is not set
140# CONFIG_PPC_I8259 is not set
141# CONFIG_PPC_RTAS is not set
142# CONFIG_MMIO_NVRAM is not set
143# CONFIG_PPC_MPC106 is not set
144# CONFIG_PPC_970_NAP is not set
145# CONFIG_PPC_INDIRECT_IO is not set
146# CONFIG_GENERIC_IOMAP is not set
147# CONFIG_CPU_FREQ is not set
148# CONFIG_CPM2 is not set
149
150#
151# Kernel options
152#
153# CONFIG_HIGHMEM is not set
154# CONFIG_HZ_100 is not set
155CONFIG_HZ_250=y
156# CONFIG_HZ_300 is not set
157# CONFIG_HZ_1000 is not set
158CONFIG_HZ=250
159CONFIG_PREEMPT_NONE=y
160# CONFIG_PREEMPT_VOLUNTARY is not set
161# CONFIG_PREEMPT is not set
162CONFIG_BINFMT_ELF=y
163# CONFIG_BINFMT_MISC is not set
164# CONFIG_MATH_EMULATION is not set
165CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
166CONFIG_ARCH_FLATMEM_ENABLE=y
167CONFIG_ARCH_POPULATES_NODE_MAP=y
168CONFIG_SELECT_MEMORY_MODEL=y
169CONFIG_FLATMEM_MANUAL=y
170# CONFIG_DISCONTIGMEM_MANUAL is not set
171# CONFIG_SPARSEMEM_MANUAL is not set
172CONFIG_FLATMEM=y
173CONFIG_FLAT_NODE_MEM_MAP=y
174# CONFIG_SPARSEMEM_STATIC is not set
175CONFIG_SPLIT_PTLOCK_CPUS=4
176CONFIG_RESOURCES_64BIT=y
177CONFIG_ZONE_DMA_FLAG=1
178CONFIG_BOUNCE=y
179CONFIG_VIRT_TO_BUS=y
180CONFIG_PROC_DEVICETREE=y
181CONFIG_CMDLINE_BOOL=y
182CONFIG_CMDLINE=""
183CONFIG_SECCOMP=y
184CONFIG_WANT_DEVICE_TREE=y
185CONFIG_DEVICE_TREE="sequoia.dts"
186CONFIG_ISA_DMA_API=y
187
188#
189# Bus options
190#
191CONFIG_ZONE_DMA=y
192CONFIG_PPC_INDIRECT_PCI=y
193CONFIG_PCI=y
194CONFIG_PCI_DOMAINS=y
195CONFIG_PCI_SYSCALL=y
196# CONFIG_PCIEPORTBUS is not set
197CONFIG_ARCH_SUPPORTS_MSI=y
198# CONFIG_PCI_MSI is not set
199# CONFIG_PCI_DEBUG is not set
200
201#
202# PCCARD (PCMCIA/CardBus) support
203#
204# CONFIG_PCCARD is not set
205# CONFIG_HOTPLUG_PCI is not set
206
207#
208# Advanced setup
209#
210# CONFIG_ADVANCED_OPTIONS is not set
211
212#
213# Default settings for advanced configuration options are used
214#
215CONFIG_HIGHMEM_START=0xfe000000
216CONFIG_LOWMEM_SIZE=0x30000000
217CONFIG_KERNEL_START=0xc0000000
218CONFIG_TASK_SIZE=0x80000000
219CONFIG_CONSISTENT_START=0xff100000
220CONFIG_CONSISTENT_SIZE=0x00200000
221CONFIG_BOOT_LOAD=0x01000000
222
223#
224# Networking
225#
226CONFIG_NET=y
227
228#
229# Networking options
230#
231CONFIG_PACKET=y
232# CONFIG_PACKET_MMAP is not set
233CONFIG_UNIX=y
234# CONFIG_NET_KEY is not set
235CONFIG_INET=y
236# CONFIG_IP_MULTICAST is not set
237# CONFIG_IP_ADVANCED_ROUTER is not set
238CONFIG_IP_FIB_HASH=y
239CONFIG_IP_PNP=y
240CONFIG_IP_PNP_DHCP=y
241CONFIG_IP_PNP_BOOTP=y
242# CONFIG_IP_PNP_RARP is not set
243# CONFIG_NET_IPIP is not set
244# CONFIG_NET_IPGRE is not set
245# CONFIG_ARPD is not set
246# CONFIG_SYN_COOKIES is not set
247# CONFIG_INET_AH is not set
248# CONFIG_INET_ESP is not set
249# CONFIG_INET_IPCOMP is not set
250# CONFIG_INET_XFRM_TUNNEL is not set
251# CONFIG_INET_TUNNEL is not set
252# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
253# CONFIG_INET_XFRM_MODE_TUNNEL is not set
254# CONFIG_INET_XFRM_MODE_BEET is not set
255CONFIG_INET_DIAG=y
256CONFIG_INET_TCP_DIAG=y
257# CONFIG_TCP_CONG_ADVANCED is not set
258CONFIG_TCP_CONG_CUBIC=y
259CONFIG_DEFAULT_TCP_CONG="cubic"
260# CONFIG_TCP_MD5SIG is not set
261# CONFIG_IPV6 is not set
262# CONFIG_INET6_XFRM_TUNNEL is not set
263# CONFIG_INET6_TUNNEL is not set
264# CONFIG_NETWORK_SECMARK is not set
265# CONFIG_NETFILTER is not set
266# CONFIG_IP_DCCP is not set
267# CONFIG_IP_SCTP is not set
268# CONFIG_TIPC is not set
269# CONFIG_ATM is not set
270# CONFIG_BRIDGE is not set
271# CONFIG_VLAN_8021Q is not set
272# CONFIG_DECNET is not set
273# CONFIG_LLC2 is not set
274# CONFIG_IPX is not set
275# CONFIG_ATALK is not set
276# CONFIG_X25 is not set
277# CONFIG_LAPB is not set
278# CONFIG_ECONET is not set
279# CONFIG_WAN_ROUTER is not set
280
281#
282# QoS and/or fair queueing
283#
284# CONFIG_NET_SCHED is not set
285
286#
287# Network testing
288#
289# CONFIG_NET_PKTGEN is not set
290# CONFIG_HAMRADIO is not set
291# CONFIG_IRDA is not set
292# CONFIG_BT is not set
293# CONFIG_AF_RXRPC is not set
294
295#
296# Wireless
297#
298# CONFIG_CFG80211 is not set
299# CONFIG_WIRELESS_EXT is not set
300# CONFIG_MAC80211 is not set
301# CONFIG_IEEE80211 is not set
302# CONFIG_RFKILL is not set
303# CONFIG_NET_9P is not set
304
305#
306# Device Drivers
307#
308
309#
310# Generic Driver Options
311#
312CONFIG_STANDALONE=y
313CONFIG_PREVENT_FIRMWARE_BUILD=y
314CONFIG_FW_LOADER=y
315# CONFIG_DEBUG_DRIVER is not set
316# CONFIG_DEBUG_DEVRES is not set
317# CONFIG_SYS_HYPERVISOR is not set
318CONFIG_CONNECTOR=y
319CONFIG_PROC_EVENTS=y
320# CONFIG_MTD is not set
321CONFIG_OF_DEVICE=y
322# CONFIG_PARPORT is not set
323CONFIG_BLK_DEV=y
324# CONFIG_BLK_DEV_FD is not set
325# CONFIG_BLK_CPQ_DA is not set
326# CONFIG_BLK_CPQ_CISS_DA is not set
327# CONFIG_BLK_DEV_DAC960 is not set
328# CONFIG_BLK_DEV_UMEM is not set
329# CONFIG_BLK_DEV_COW_COMMON is not set
330# CONFIG_BLK_DEV_LOOP is not set
331# CONFIG_BLK_DEV_NBD is not set
332# CONFIG_BLK_DEV_SX8 is not set
333CONFIG_BLK_DEV_RAM=y
334CONFIG_BLK_DEV_RAM_COUNT=16
335CONFIG_BLK_DEV_RAM_SIZE=35000
336CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
337# CONFIG_CDROM_PKTCDVD is not set
338# CONFIG_ATA_OVER_ETH is not set
339# CONFIG_XILINX_SYSACE is not set
340CONFIG_MISC_DEVICES=y
341# CONFIG_PHANTOM is not set
342# CONFIG_EEPROM_93CX6 is not set
343# CONFIG_SGI_IOC4 is not set
344# CONFIG_TIFM_CORE is not set
345# CONFIG_IDE is not set
346
347#
348# SCSI device support
349#
350# CONFIG_RAID_ATTRS is not set
351# CONFIG_SCSI is not set
352# CONFIG_SCSI_DMA is not set
353# CONFIG_SCSI_NETLINK is not set
354# CONFIG_ATA is not set
355# CONFIG_MD is not set
356
357#
358# Fusion MPT device support
359#
360# CONFIG_FUSION is not set
361
362#
363# IEEE 1394 (FireWire) support
364#
365# CONFIG_FIREWIRE is not set
366# CONFIG_IEEE1394 is not set
367# CONFIG_I2O is not set
368CONFIG_MACINTOSH_DRIVERS=y
369# CONFIG_MAC_EMUMOUSEBTN is not set
370# CONFIG_WINDFARM is not set
371CONFIG_NETDEVICES=y
372# CONFIG_NETDEVICES_MULTIQUEUE is not set
373# CONFIG_DUMMY is not set
374# CONFIG_BONDING is not set
375# CONFIG_MACVLAN is not set
376# CONFIG_EQUALIZER is not set
377# CONFIG_TUN is not set
378# CONFIG_ARCNET is not set
379# CONFIG_NET_ETHERNET is not set
380CONFIG_NETDEV_1000=y
381# CONFIG_ACENIC is not set
382# CONFIG_DL2K is not set
383# CONFIG_E1000 is not set
384# CONFIG_NS83820 is not set
385# CONFIG_HAMACHI is not set
386# CONFIG_YELLOWFIN is not set
387# CONFIG_R8169 is not set
388# CONFIG_SIS190 is not set
389# CONFIG_SKGE is not set
390# CONFIG_SKY2 is not set
391# CONFIG_VIA_VELOCITY is not set
392# CONFIG_TIGON3 is not set
393# CONFIG_BNX2 is not set
394# CONFIG_QLA3XXX is not set
395# CONFIG_ATL1 is not set
396CONFIG_NETDEV_10000=y
397# CONFIG_CHELSIO_T1 is not set
398# CONFIG_CHELSIO_T3 is not set
399# CONFIG_IXGB is not set
400# CONFIG_S2IO is not set
401# CONFIG_MYRI10GE is not set
402# CONFIG_NETXEN_NIC is not set
403# CONFIG_MLX4_CORE is not set
404# CONFIG_TR is not set
405
406#
407# Wireless LAN
408#
409# CONFIG_WLAN_PRE80211 is not set
410# CONFIG_WLAN_80211 is not set
411# CONFIG_WAN is not set
412# CONFIG_FDDI is not set
413# CONFIG_HIPPI is not set
414# CONFIG_PPP is not set
415# CONFIG_SLIP is not set
416# CONFIG_SHAPER is not set
417# CONFIG_NETCONSOLE is not set
418# CONFIG_NETPOLL is not set
419# CONFIG_NET_POLL_CONTROLLER is not set
420# CONFIG_ISDN is not set
421# CONFIG_PHONE is not set
422
423#
424# Input device support
425#
426# CONFIG_INPUT is not set
427
428#
429# Hardware I/O ports
430#
431# CONFIG_SERIO is not set
432# CONFIG_GAMEPORT is not set
433
434#
435# Character devices
436#
437# CONFIG_VT is not set
438# CONFIG_SERIAL_NONSTANDARD is not set
439
440#
441# Serial drivers
442#
443CONFIG_SERIAL_8250=y
444CONFIG_SERIAL_8250_CONSOLE=y
445# CONFIG_SERIAL_8250_PCI is not set
446CONFIG_SERIAL_8250_NR_UARTS=4
447CONFIG_SERIAL_8250_RUNTIME_UARTS=4
448CONFIG_SERIAL_8250_EXTENDED=y
449# CONFIG_SERIAL_8250_MANY_PORTS is not set
450CONFIG_SERIAL_8250_SHARE_IRQ=y
451# CONFIG_SERIAL_8250_DETECT_IRQ is not set
452# CONFIG_SERIAL_8250_RSA is not set
453
454#
455# Non-8250 serial port support
456#
457# CONFIG_SERIAL_UARTLITE is not set
458CONFIG_SERIAL_CORE=y
459CONFIG_SERIAL_CORE_CONSOLE=y
460# CONFIG_SERIAL_JSM is not set
461CONFIG_SERIAL_OF_PLATFORM=y
462CONFIG_UNIX98_PTYS=y
463CONFIG_LEGACY_PTYS=y
464CONFIG_LEGACY_PTY_COUNT=256
465# CONFIG_IPMI_HANDLER is not set
466# CONFIG_WATCHDOG is not set
467# CONFIG_HW_RANDOM is not set
468# CONFIG_NVRAM is not set
469# CONFIG_GEN_RTC is not set
470# CONFIG_R3964 is not set
471# CONFIG_APPLICOM is not set
472# CONFIG_AGP is not set
473# CONFIG_DRM is not set
474# CONFIG_RAW_DRIVER is not set
475# CONFIG_TCG_TPM is not set
476CONFIG_DEVPORT=y
477# CONFIG_I2C is not set
478
479#
480# SPI support
481#
482# CONFIG_SPI is not set
483# CONFIG_SPI_MASTER is not set
484# CONFIG_W1 is not set
485# CONFIG_POWER_SUPPLY is not set
486# CONFIG_HWMON is not set
487
488#
489# Multifunction device drivers
490#
491# CONFIG_MFD_SM501 is not set
492
493#
494# Multimedia devices
495#
496# CONFIG_VIDEO_DEV is not set
497# CONFIG_DVB_CORE is not set
498CONFIG_DAB=y
499
500#
501# Graphics support
502#
503# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
504
505#
506# Display device support
507#
508# CONFIG_DISPLAY_SUPPORT is not set
509# CONFIG_VGASTATE is not set
510CONFIG_VIDEO_OUTPUT_CONTROL=m
511# CONFIG_FB is not set
512# CONFIG_FB_IBM_GXT4500 is not set
513
514#
515# Sound
516#
517# CONFIG_SOUND is not set
518CONFIG_USB_SUPPORT=y
519CONFIG_USB_ARCH_HAS_HCD=y
520CONFIG_USB_ARCH_HAS_OHCI=y
521CONFIG_USB_ARCH_HAS_EHCI=y
522# CONFIG_USB is not set
523
524#
525# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
526#
527
528#
529# USB Gadget Support
530#
531# CONFIG_USB_GADGET is not set
532# CONFIG_MMC is not set
533# CONFIG_NEW_LEDS is not set
534# CONFIG_INFINIBAND is not set
535# CONFIG_EDAC is not set
536# CONFIG_RTC_CLASS is not set
537
538#
539# DMA Engine support
540#
541# CONFIG_DMA_ENGINE is not set
542
543#
544# DMA Clients
545#
546
547#
548# DMA Devices
549#
550
551#
552# Userspace I/O
553#
554# CONFIG_UIO is not set
555
556#
557# File systems
558#
559CONFIG_EXT2_FS=y
560# CONFIG_EXT2_FS_XATTR is not set
561# CONFIG_EXT2_FS_XIP is not set
562# CONFIG_EXT3_FS is not set
563# CONFIG_EXT4DEV_FS is not set
564# CONFIG_REISERFS_FS is not set
565# CONFIG_JFS_FS is not set
566# CONFIG_FS_POSIX_ACL is not set
567# CONFIG_XFS_FS is not set
568# CONFIG_GFS2_FS is not set
569# CONFIG_OCFS2_FS is not set
570# CONFIG_MINIX_FS is not set
571# CONFIG_ROMFS_FS is not set
572CONFIG_INOTIFY=y
573CONFIG_INOTIFY_USER=y
574# CONFIG_QUOTA is not set
575CONFIG_DNOTIFY=y
576# CONFIG_AUTOFS_FS is not set
577# CONFIG_AUTOFS4_FS is not set
578# CONFIG_FUSE_FS is not set
579
580#
581# CD-ROM/DVD Filesystems
582#
583# CONFIG_ISO9660_FS is not set
584# CONFIG_UDF_FS is not set
585
586#
587# DOS/FAT/NT Filesystems
588#
589# CONFIG_MSDOS_FS is not set
590# CONFIG_VFAT_FS is not set
591# CONFIG_NTFS_FS is not set
592
593#
594# Pseudo filesystems
595#
596CONFIG_PROC_FS=y
597CONFIG_PROC_KCORE=y
598CONFIG_PROC_SYSCTL=y
599CONFIG_SYSFS=y
600CONFIG_TMPFS=y
601# CONFIG_TMPFS_POSIX_ACL is not set
602# CONFIG_HUGETLB_PAGE is not set
603CONFIG_RAMFS=y
604# CONFIG_CONFIGFS_FS is not set
605
606#
607# Miscellaneous filesystems
608#
609# CONFIG_ADFS_FS is not set
610# CONFIG_AFFS_FS is not set
611# CONFIG_HFS_FS is not set
612# CONFIG_HFSPLUS_FS is not set
613# CONFIG_BEFS_FS is not set
614# CONFIG_BFS_FS is not set
615# CONFIG_EFS_FS is not set
616CONFIG_CRAMFS=y
617# CONFIG_VXFS_FS is not set
618# CONFIG_HPFS_FS is not set
619# CONFIG_QNX4FS_FS is not set
620# CONFIG_SYSV_FS is not set
621# CONFIG_UFS_FS is not set
622
623#
624# Network File Systems
625#
626CONFIG_NFS_FS=y
627CONFIG_NFS_V3=y
628# CONFIG_NFS_V3_ACL is not set
629# CONFIG_NFS_V4 is not set
630# CONFIG_NFS_DIRECTIO is not set
631# CONFIG_NFSD is not set
632CONFIG_ROOT_NFS=y
633CONFIG_LOCKD=y
634CONFIG_LOCKD_V4=y
635CONFIG_NFS_COMMON=y
636CONFIG_SUNRPC=y
637# CONFIG_SUNRPC_BIND34 is not set
638# CONFIG_RPCSEC_GSS_KRB5 is not set
639# CONFIG_RPCSEC_GSS_SPKM3 is not set
640# CONFIG_SMB_FS is not set
641# CONFIG_CIFS is not set
642# CONFIG_NCP_FS is not set
643# CONFIG_CODA_FS is not set
644# CONFIG_AFS_FS is not set
645
646#
647# Partition Types
648#
649# CONFIG_PARTITION_ADVANCED is not set
650CONFIG_MSDOS_PARTITION=y
651
652#
653# Native Language Support
654#
655# CONFIG_NLS is not set
656
657#
658# Distributed Lock Manager
659#
660# CONFIG_DLM is not set
661# CONFIG_UCC_SLOW is not set
662
663#
664# Library routines
665#
666CONFIG_BITREVERSE=y
667# CONFIG_CRC_CCITT is not set
668# CONFIG_CRC16 is not set
669# CONFIG_CRC_ITU_T is not set
670CONFIG_CRC32=y
671# CONFIG_CRC7 is not set
672# CONFIG_LIBCRC32C is not set
673CONFIG_ZLIB_INFLATE=y
674CONFIG_PLIST=y
675CONFIG_HAS_IOMEM=y
676CONFIG_HAS_IOPORT=y
677CONFIG_HAS_DMA=y
678
679#
680# Instrumentation Support
681#
682# CONFIG_PROFILING is not set
683
684#
685# Kernel hacking
686#
687# CONFIG_PRINTK_TIME is not set
688CONFIG_ENABLE_MUST_CHECK=y
689CONFIG_MAGIC_SYSRQ=y
690# CONFIG_UNUSED_SYMBOLS is not set
691# CONFIG_DEBUG_FS is not set
692# CONFIG_HEADERS_CHECK is not set
693CONFIG_DEBUG_KERNEL=y
694# CONFIG_DEBUG_SHIRQ is not set
695CONFIG_DETECT_SOFTLOCKUP=y
696CONFIG_SCHED_DEBUG=y
697# CONFIG_SCHEDSTATS is not set
698# CONFIG_TIMER_STATS is not set
699# CONFIG_DEBUG_SLAB is not set
700# CONFIG_DEBUG_RT_MUTEXES is not set
701# CONFIG_RT_MUTEX_TESTER is not set
702# CONFIG_DEBUG_SPINLOCK is not set
703# CONFIG_DEBUG_MUTEXES is not set
704# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
705# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
706# CONFIG_DEBUG_KOBJECT is not set
707# CONFIG_DEBUG_BUGVERBOSE is not set
708# CONFIG_DEBUG_INFO is not set
709# CONFIG_DEBUG_VM is not set
710# CONFIG_DEBUG_LIST is not set
711CONFIG_FORCED_INLINING=y
712# CONFIG_RCU_TORTURE_TEST is not set
713# CONFIG_FAULT_INJECTION is not set
714# CONFIG_DEBUG_STACKOVERFLOW is not set
715# CONFIG_DEBUG_STACK_USAGE is not set
716# CONFIG_DEBUG_PAGEALLOC is not set
717CONFIG_DEBUGGER=y
718# CONFIG_KGDB is not set
719# CONFIG_XMON is not set
720# CONFIG_BDI_SWITCH is not set
721CONFIG_PPC_EARLY_DEBUG=y
722# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
723# CONFIG_PPC_EARLY_DEBUG_G5 is not set
724# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
725# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
726# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
727# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
728# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
729# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
730CONFIG_PPC_EARLY_DEBUG_44x=y
731CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
732CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
733
734#
735# Security options
736#
737# CONFIG_KEYS is not set
738# CONFIG_SECURITY is not set
739CONFIG_CRYPTO=y
740CONFIG_CRYPTO_ALGAPI=y
741CONFIG_CRYPTO_BLKCIPHER=y
742CONFIG_CRYPTO_MANAGER=y
743# CONFIG_CRYPTO_HMAC is not set
744# CONFIG_CRYPTO_XCBC is not set
745# CONFIG_CRYPTO_NULL is not set
746# CONFIG_CRYPTO_MD4 is not set
747CONFIG_CRYPTO_MD5=y
748# CONFIG_CRYPTO_SHA1 is not set
749# CONFIG_CRYPTO_SHA256 is not set
750# CONFIG_CRYPTO_SHA512 is not set
751# CONFIG_CRYPTO_WP512 is not set
752# CONFIG_CRYPTO_TGR192 is not set
753# CONFIG_CRYPTO_GF128MUL is not set
754CONFIG_CRYPTO_ECB=y
755CONFIG_CRYPTO_CBC=y
756CONFIG_CRYPTO_PCBC=y
757# CONFIG_CRYPTO_LRW is not set
758# CONFIG_CRYPTO_CRYPTD is not set
759CONFIG_CRYPTO_DES=y
760# CONFIG_CRYPTO_FCRYPT is not set
761# CONFIG_CRYPTO_BLOWFISH is not set
762# CONFIG_CRYPTO_TWOFISH is not set
763# CONFIG_CRYPTO_SERPENT is not set
764# CONFIG_CRYPTO_AES is not set
765# CONFIG_CRYPTO_CAST5 is not set
766# CONFIG_CRYPTO_CAST6 is not set
767# CONFIG_CRYPTO_TEA is not set
768# CONFIG_CRYPTO_ARC4 is not set
769# CONFIG_CRYPTO_KHAZAD is not set
770# CONFIG_CRYPTO_ANUBIS is not set
771# CONFIG_CRYPTO_DEFLATE is not set
772# CONFIG_CRYPTO_MICHAEL_MIC is not set
773# CONFIG_CRYPTO_CRC32C is not set
774# CONFIG_CRYPTO_CAMELLIA is not set
775# CONFIG_CRYPTO_TEST is not set
776CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/configs/walnut_defconfig b/arch/powerpc/configs/walnut_defconfig
new file mode 100644
index 000000000000..766bf840c18d
--- /dev/null
+++ b/arch/powerpc/configs/walnut_defconfig
@@ -0,0 +1,773 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4
4# Wed Sep 5 12:06:37 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14CONFIG_40x=y
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_4xx=y
18# CONFIG_PPC_MM_SLICES is not set
19CONFIG_NOT_COHERENT_CACHE=y
20CONFIG_PPC32=y
21CONFIG_PPC_MERGE=y
22CONFIG_MMU=y
23CONFIG_GENERIC_HARDIRQS=y
24CONFIG_IRQ_PER_CPU=y
25CONFIG_RWSEM_XCHGADD_ALGORITHM=y
26CONFIG_ARCH_HAS_ILOG2_U32=y
27CONFIG_GENERIC_HWEIGHT=y
28CONFIG_GENERIC_CALIBRATE_DELAY=y
29CONFIG_GENERIC_FIND_NEXT_BIT=y
30# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
31CONFIG_PPC=y
32CONFIG_EARLY_PRINTK=y
33CONFIG_GENERIC_NVRAM=y
34CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
35CONFIG_ARCH_MAY_HAVE_PC_FDC=y
36CONFIG_PPC_OF=y
37CONFIG_OF=y
38# CONFIG_PPC_UDBG_16550 is not set
39# CONFIG_GENERIC_TBSYNC is not set
40CONFIG_AUDIT_ARCH=y
41CONFIG_GENERIC_BUG=y
42# CONFIG_DEFAULT_UIMAGE is not set
43CONFIG_PPC_DCR_NATIVE=y
44# CONFIG_PPC_DCR_MMIO is not set
45CONFIG_PPC_DCR=y
46CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
47
48#
49# General setup
50#
51CONFIG_EXPERIMENTAL=y
52CONFIG_BROKEN_ON_SMP=y
53CONFIG_INIT_ENV_ARG_LIMIT=32
54CONFIG_LOCALVERSION=""
55CONFIG_LOCALVERSION_AUTO=y
56CONFIG_SWAP=y
57CONFIG_SYSVIPC=y
58CONFIG_SYSVIPC_SYSCTL=y
59CONFIG_POSIX_MQUEUE=y
60# CONFIG_BSD_PROCESS_ACCT is not set
61# CONFIG_TASKSTATS is not set
62# CONFIG_USER_NS is not set
63# CONFIG_AUDIT is not set
64# CONFIG_IKCONFIG is not set
65CONFIG_LOG_BUF_SHIFT=14
66CONFIG_SYSFS_DEPRECATED=y
67# CONFIG_RELAY is not set
68CONFIG_BLK_DEV_INITRD=y
69CONFIG_INITRAMFS_SOURCE=""
70# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
71CONFIG_SYSCTL=y
72CONFIG_EMBEDDED=y
73CONFIG_SYSCTL_SYSCALL=y
74CONFIG_KALLSYMS=y
75CONFIG_KALLSYMS_ALL=y
76CONFIG_KALLSYMS_EXTRA_PASS=y
77CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y
79CONFIG_BUG=y
80CONFIG_ELF_CORE=y
81CONFIG_BASE_FULL=y
82CONFIG_FUTEX=y
83CONFIG_ANON_INODES=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_VM_EVENT_COUNTERS=y
90CONFIG_SLAB=y
91# CONFIG_SLUB is not set
92# CONFIG_SLOB is not set
93CONFIG_RT_MUTEXES=y
94# CONFIG_TINY_SHMEM is not set
95CONFIG_BASE_SMALL=0
96CONFIG_MODULES=y
97CONFIG_MODULE_UNLOAD=y
98# CONFIG_MODULE_FORCE_UNLOAD is not set
99# CONFIG_MODVERSIONS is not set
100# CONFIG_MODULE_SRCVERSION_ALL is not set
101CONFIG_KMOD=y
102CONFIG_BLOCK=y
103CONFIG_LBD=y
104# CONFIG_BLK_DEV_IO_TRACE is not set
105# CONFIG_LSF is not set
106# CONFIG_BLK_DEV_BSG is not set
107
108#
109# IO Schedulers
110#
111CONFIG_IOSCHED_NOOP=y
112CONFIG_IOSCHED_AS=y
113CONFIG_IOSCHED_DEADLINE=y
114CONFIG_IOSCHED_CFQ=y
115CONFIG_DEFAULT_AS=y
116# CONFIG_DEFAULT_DEADLINE is not set
117# CONFIG_DEFAULT_CFQ is not set
118# CONFIG_DEFAULT_NOOP is not set
119CONFIG_DEFAULT_IOSCHED="anticipatory"
120
121#
122# Platform support
123#
124# CONFIG_PPC_MPC52xx is not set
125# CONFIG_PPC_MPC5200 is not set
126# CONFIG_PPC_CELL is not set
127# CONFIG_PPC_CELL_NATIVE is not set
128# CONFIG_PQ2ADS is not set
129CONFIG_WALNUT=y
130CONFIG_405GP=y
131CONFIG_IBM405_ERR77=y
132CONFIG_IBM405_ERR51=y
133# CONFIG_MPIC is not set
134# CONFIG_MPIC_WEIRD is not set
135# CONFIG_PPC_I8259 is not set
136# CONFIG_PPC_RTAS is not set
137# CONFIG_MMIO_NVRAM is not set
138# CONFIG_PPC_MPC106 is not set
139# CONFIG_PPC_970_NAP is not set
140# CONFIG_PPC_INDIRECT_IO is not set
141# CONFIG_GENERIC_IOMAP is not set
142# CONFIG_CPU_FREQ is not set
143# CONFIG_CPM2 is not set
144# CONFIG_FSL_ULI1575 is not set
145
146#
147# Kernel options
148#
149# CONFIG_HIGHMEM is not set
150# CONFIG_HZ_100 is not set
151CONFIG_HZ_250=y
152# CONFIG_HZ_300 is not set
153# CONFIG_HZ_1000 is not set
154CONFIG_HZ=250
155CONFIG_PREEMPT_NONE=y
156# CONFIG_PREEMPT_VOLUNTARY is not set
157# CONFIG_PREEMPT is not set
158CONFIG_BINFMT_ELF=y
159# CONFIG_BINFMT_MISC is not set
160# CONFIG_MATH_EMULATION is not set
161CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
162CONFIG_ARCH_FLATMEM_ENABLE=y
163CONFIG_ARCH_POPULATES_NODE_MAP=y
164CONFIG_SELECT_MEMORY_MODEL=y
165CONFIG_FLATMEM_MANUAL=y
166# CONFIG_DISCONTIGMEM_MANUAL is not set
167# CONFIG_SPARSEMEM_MANUAL is not set
168CONFIG_FLATMEM=y
169CONFIG_FLAT_NODE_MEM_MAP=y
170# CONFIG_SPARSEMEM_STATIC is not set
171CONFIG_SPLIT_PTLOCK_CPUS=4
172CONFIG_RESOURCES_64BIT=y
173CONFIG_ZONE_DMA_FLAG=1
174CONFIG_BOUNCE=y
175CONFIG_VIRT_TO_BUS=y
176CONFIG_PROC_DEVICETREE=y
177# CONFIG_CMDLINE_BOOL is not set
178# CONFIG_PM is not set
179CONFIG_SECCOMP=y
180CONFIG_WANT_DEVICE_TREE=y
181CONFIG_DEVICE_TREE="walnut.dts"
182CONFIG_ISA_DMA_API=y
183
184#
185# Bus options
186#
187CONFIG_ZONE_DMA=y
188# CONFIG_PCI is not set
189# CONFIG_PCI_DOMAINS is not set
190# CONFIG_PCI_SYSCALL is not set
191# CONFIG_ARCH_SUPPORTS_MSI is not set
192
193#
194# PCCARD (PCMCIA/CardBus) support
195#
196# CONFIG_PCCARD is not set
197
198#
199# Advanced setup
200#
201# CONFIG_ADVANCED_OPTIONS is not set
202
203#
204# Default settings for advanced configuration options are used
205#
206CONFIG_HIGHMEM_START=0xfe000000
207CONFIG_LOWMEM_SIZE=0x30000000
208CONFIG_KERNEL_START=0xc0000000
209CONFIG_TASK_SIZE=0x80000000
210CONFIG_CONSISTENT_START=0xff100000
211CONFIG_CONSISTENT_SIZE=0x00200000
212CONFIG_BOOT_LOAD=0x00400000
213
214#
215# Networking
216#
217CONFIG_NET=y
218
219#
220# Networking options
221#
222CONFIG_PACKET=y
223# CONFIG_PACKET_MMAP is not set
224CONFIG_UNIX=y
225# CONFIG_NET_KEY is not set
226CONFIG_INET=y
227# CONFIG_IP_MULTICAST is not set
228# CONFIG_IP_ADVANCED_ROUTER is not set
229CONFIG_IP_FIB_HASH=y
230CONFIG_IP_PNP=y
231CONFIG_IP_PNP_DHCP=y
232CONFIG_IP_PNP_BOOTP=y
233# CONFIG_IP_PNP_RARP is not set
234# CONFIG_NET_IPIP is not set
235# CONFIG_NET_IPGRE is not set
236# CONFIG_ARPD is not set
237# CONFIG_SYN_COOKIES is not set
238# CONFIG_INET_AH is not set
239# CONFIG_INET_ESP is not set
240# CONFIG_INET_IPCOMP is not set
241# CONFIG_INET_XFRM_TUNNEL is not set
242# CONFIG_INET_TUNNEL is not set
243# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
244# CONFIG_INET_XFRM_MODE_TUNNEL is not set
245# CONFIG_INET_XFRM_MODE_BEET is not set
246CONFIG_INET_DIAG=y
247CONFIG_INET_TCP_DIAG=y
248# CONFIG_TCP_CONG_ADVANCED is not set
249CONFIG_TCP_CONG_CUBIC=y
250CONFIG_DEFAULT_TCP_CONG="cubic"
251# CONFIG_TCP_MD5SIG is not set
252# CONFIG_IPV6 is not set
253# CONFIG_INET6_XFRM_TUNNEL is not set
254# CONFIG_INET6_TUNNEL is not set
255# CONFIG_NETWORK_SECMARK is not set
256# CONFIG_NETFILTER is not set
257# CONFIG_IP_DCCP is not set
258# CONFIG_IP_SCTP is not set
259# CONFIG_TIPC is not set
260# CONFIG_ATM is not set
261# CONFIG_BRIDGE is not set
262# CONFIG_VLAN_8021Q is not set
263# CONFIG_DECNET is not set
264# CONFIG_LLC2 is not set
265# CONFIG_IPX is not set
266# CONFIG_ATALK is not set
267# CONFIG_X25 is not set
268# CONFIG_LAPB is not set
269# CONFIG_ECONET is not set
270# CONFIG_WAN_ROUTER is not set
271
272#
273# QoS and/or fair queueing
274#
275# CONFIG_NET_SCHED is not set
276
277#
278# Network testing
279#
280# CONFIG_NET_PKTGEN is not set
281# CONFIG_HAMRADIO is not set
282# CONFIG_IRDA is not set
283# CONFIG_BT is not set
284# CONFIG_AF_RXRPC is not set
285
286#
287# Wireless
288#
289# CONFIG_CFG80211 is not set
290# CONFIG_WIRELESS_EXT is not set
291# CONFIG_MAC80211 is not set
292# CONFIG_IEEE80211 is not set
293# CONFIG_RFKILL is not set
294# CONFIG_NET_9P is not set
295
296#
297# Device Drivers
298#
299
300#
301# Generic Driver Options
302#
303CONFIG_STANDALONE=y
304CONFIG_PREVENT_FIRMWARE_BUILD=y
305CONFIG_FW_LOADER=y
306# CONFIG_DEBUG_DRIVER is not set
307# CONFIG_DEBUG_DEVRES is not set
308# CONFIG_SYS_HYPERVISOR is not set
309CONFIG_CONNECTOR=y
310CONFIG_PROC_EVENTS=y
311CONFIG_MTD=y
312# CONFIG_MTD_DEBUG is not set
313# CONFIG_MTD_CONCAT is not set
314CONFIG_MTD_PARTITIONS=y
315# CONFIG_MTD_REDBOOT_PARTS is not set
316CONFIG_MTD_CMDLINE_PARTS=y
317
318#
319# User Modules And Translation Layers
320#
321CONFIG_MTD_CHAR=y
322CONFIG_MTD_BLKDEVS=m
323CONFIG_MTD_BLOCK=m
324# CONFIG_MTD_BLOCK_RO is not set
325# CONFIG_FTL is not set
326# CONFIG_NFTL is not set
327# CONFIG_INFTL is not set
328# CONFIG_RFD_FTL is not set
329# CONFIG_SSFDC is not set
330
331#
332# RAM/ROM/Flash chip drivers
333#
334CONFIG_MTD_CFI=y
335CONFIG_MTD_JEDECPROBE=y
336CONFIG_MTD_GEN_PROBE=y
337# CONFIG_MTD_CFI_ADV_OPTIONS is not set
338CONFIG_MTD_MAP_BANK_WIDTH_1=y
339CONFIG_MTD_MAP_BANK_WIDTH_2=y
340CONFIG_MTD_MAP_BANK_WIDTH_4=y
341# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
342# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
343# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
344CONFIG_MTD_CFI_I1=y
345CONFIG_MTD_CFI_I2=y
346# CONFIG_MTD_CFI_I4 is not set
347# CONFIG_MTD_CFI_I8 is not set
348# CONFIG_MTD_CFI_INTELEXT is not set
349CONFIG_MTD_CFI_AMDSTD=y
350# CONFIG_MTD_CFI_STAA is not set
351CONFIG_MTD_CFI_UTIL=y
352# CONFIG_MTD_RAM is not set
353# CONFIG_MTD_ROM is not set
354# CONFIG_MTD_ABSENT is not set
355
356#
357# Mapping drivers for chip access
358#
359# CONFIG_MTD_COMPLEX_MAPPINGS is not set
360# CONFIG_MTD_PHYSMAP is not set
361CONFIG_MTD_PHYSMAP_OF=y
362# CONFIG_MTD_WALNUT is not set
363# CONFIG_MTD_PLATRAM is not set
364
365#
366# Self-contained MTD device drivers
367#
368# CONFIG_MTD_SLRAM is not set
369# CONFIG_MTD_PHRAM is not set
370# CONFIG_MTD_MTDRAM is not set
371# CONFIG_MTD_BLOCK2MTD is not set
372
373#
374# Disk-On-Chip Device Drivers
375#
376# CONFIG_MTD_DOC2000 is not set
377# CONFIG_MTD_DOC2001 is not set
378# CONFIG_MTD_DOC2001PLUS is not set
379# CONFIG_MTD_NAND is not set
380# CONFIG_MTD_ONENAND is not set
381
382#
383# UBI - Unsorted block images
384#
385# CONFIG_MTD_UBI is not set
386CONFIG_OF_DEVICE=y
387# CONFIG_PARPORT is not set
388CONFIG_BLK_DEV=y
389# CONFIG_BLK_DEV_FD is not set
390# CONFIG_BLK_DEV_COW_COMMON is not set
391# CONFIG_BLK_DEV_LOOP is not set
392# CONFIG_BLK_DEV_NBD is not set
393CONFIG_BLK_DEV_RAM=y
394CONFIG_BLK_DEV_RAM_COUNT=16
395CONFIG_BLK_DEV_RAM_SIZE=35000
396CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
397# CONFIG_CDROM_PKTCDVD is not set
398# CONFIG_ATA_OVER_ETH is not set
399# CONFIG_XILINX_SYSACE is not set
400CONFIG_MISC_DEVICES=y
401# CONFIG_EEPROM_93CX6 is not set
402# CONFIG_IDE is not set
403
404#
405# SCSI device support
406#
407# CONFIG_RAID_ATTRS is not set
408# CONFIG_SCSI is not set
409# CONFIG_SCSI_DMA is not set
410# CONFIG_SCSI_NETLINK is not set
411# CONFIG_ATA is not set
412# CONFIG_MD is not set
413# CONFIG_MACINTOSH_DRIVERS is not set
414CONFIG_NETDEVICES=y
415# CONFIG_NETDEVICES_MULTIQUEUE is not set
416# CONFIG_DUMMY is not set
417# CONFIG_BONDING is not set
418# CONFIG_MACVLAN is not set
419# CONFIG_EQUALIZER is not set
420# CONFIG_TUN is not set
421# CONFIG_NET_ETHERNET is not set
422CONFIG_NETDEV_1000=y
423CONFIG_NETDEV_10000=y
424
425#
426# Wireless LAN
427#
428# CONFIG_WLAN_PRE80211 is not set
429# CONFIG_WLAN_80211 is not set
430# CONFIG_WAN is not set
431# CONFIG_PPP is not set
432# CONFIG_SLIP is not set
433# CONFIG_SHAPER is not set
434# CONFIG_NETCONSOLE is not set
435# CONFIG_NETPOLL is not set
436# CONFIG_NET_POLL_CONTROLLER is not set
437# CONFIG_ISDN is not set
438# CONFIG_PHONE is not set
439
440#
441# Input device support
442#
443# CONFIG_INPUT is not set
444
445#
446# Hardware I/O ports
447#
448# CONFIG_SERIO is not set
449# CONFIG_GAMEPORT is not set
450
451#
452# Character devices
453#
454# CONFIG_VT is not set
455# CONFIG_SERIAL_NONSTANDARD is not set
456
457#
458# Serial drivers
459#
460CONFIG_SERIAL_8250=y
461CONFIG_SERIAL_8250_CONSOLE=y
462CONFIG_SERIAL_8250_NR_UARTS=4
463CONFIG_SERIAL_8250_RUNTIME_UARTS=4
464CONFIG_SERIAL_8250_EXTENDED=y
465# CONFIG_SERIAL_8250_MANY_PORTS is not set
466CONFIG_SERIAL_8250_SHARE_IRQ=y
467# CONFIG_SERIAL_8250_DETECT_IRQ is not set
468# CONFIG_SERIAL_8250_RSA is not set
469
470#
471# Non-8250 serial port support
472#
473# CONFIG_SERIAL_UARTLITE is not set
474CONFIG_SERIAL_CORE=y
475CONFIG_SERIAL_CORE_CONSOLE=y
476CONFIG_SERIAL_OF_PLATFORM=y
477CONFIG_UNIX98_PTYS=y
478CONFIG_LEGACY_PTYS=y
479CONFIG_LEGACY_PTY_COUNT=256
480# CONFIG_IPMI_HANDLER is not set
481# CONFIG_WATCHDOG is not set
482# CONFIG_HW_RANDOM is not set
483# CONFIG_NVRAM is not set
484# CONFIG_GEN_RTC is not set
485# CONFIG_R3964 is not set
486# CONFIG_RAW_DRIVER is not set
487# CONFIG_TCG_TPM is not set
488# CONFIG_I2C is not set
489
490#
491# SPI support
492#
493# CONFIG_SPI is not set
494# CONFIG_SPI_MASTER is not set
495# CONFIG_W1 is not set
496# CONFIG_POWER_SUPPLY is not set
497# CONFIG_HWMON is not set
498
499#
500# Multifunction device drivers
501#
502# CONFIG_MFD_SM501 is not set
503
504#
505# Multimedia devices
506#
507# CONFIG_VIDEO_DEV is not set
508# CONFIG_DVB_CORE is not set
509# CONFIG_DAB is not set
510
511#
512# Graphics support
513#
514# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
515
516#
517# Display device support
518#
519# CONFIG_DISPLAY_SUPPORT is not set
520# CONFIG_VGASTATE is not set
521CONFIG_VIDEO_OUTPUT_CONTROL=m
522# CONFIG_FB is not set
523# CONFIG_FB_IBM_GXT4500 is not set
524
525#
526# Sound
527#
528# CONFIG_SOUND is not set
529CONFIG_USB_SUPPORT=y
530# CONFIG_USB_ARCH_HAS_HCD is not set
531# CONFIG_USB_ARCH_HAS_OHCI is not set
532# CONFIG_USB_ARCH_HAS_EHCI is not set
533
534#
535# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
536#
537
538#
539# USB Gadget Support
540#
541# CONFIG_USB_GADGET is not set
542# CONFIG_MMC is not set
543# CONFIG_NEW_LEDS is not set
544# CONFIG_EDAC is not set
545# CONFIG_RTC_CLASS is not set
546
547#
548# DMA Engine support
549#
550# CONFIG_DMA_ENGINE is not set
551
552#
553# DMA Clients
554#
555
556#
557# DMA Devices
558#
559
560#
561# Userspace I/O
562#
563# CONFIG_UIO is not set
564
565#
566# File systems
567#
568CONFIG_EXT2_FS=y
569# CONFIG_EXT2_FS_XATTR is not set
570# CONFIG_EXT2_FS_XIP is not set
571# CONFIG_EXT3_FS is not set
572# CONFIG_EXT4DEV_FS is not set
573# CONFIG_REISERFS_FS is not set
574# CONFIG_JFS_FS is not set
575# CONFIG_FS_POSIX_ACL is not set
576# CONFIG_XFS_FS is not set
577# CONFIG_GFS2_FS is not set
578# CONFIG_OCFS2_FS is not set
579# CONFIG_MINIX_FS is not set
580# CONFIG_ROMFS_FS is not set
581CONFIG_INOTIFY=y
582CONFIG_INOTIFY_USER=y
583# CONFIG_QUOTA is not set
584CONFIG_DNOTIFY=y
585# CONFIG_AUTOFS_FS is not set
586# CONFIG_AUTOFS4_FS is not set
587# CONFIG_FUSE_FS is not set
588
589#
590# CD-ROM/DVD Filesystems
591#
592# CONFIG_ISO9660_FS is not set
593# CONFIG_UDF_FS is not set
594
595#
596# DOS/FAT/NT Filesystems
597#
598# CONFIG_MSDOS_FS is not set
599# CONFIG_VFAT_FS is not set
600# CONFIG_NTFS_FS is not set
601
602#
603# Pseudo filesystems
604#
605CONFIG_PROC_FS=y
606CONFIG_PROC_KCORE=y
607CONFIG_PROC_SYSCTL=y
608CONFIG_SYSFS=y
609CONFIG_TMPFS=y
610# CONFIG_TMPFS_POSIX_ACL is not set
611# CONFIG_HUGETLB_PAGE is not set
612CONFIG_RAMFS=y
613# CONFIG_CONFIGFS_FS is not set
614
615#
616# Miscellaneous filesystems
617#
618# CONFIG_ADFS_FS is not set
619# CONFIG_AFFS_FS is not set
620# CONFIG_HFS_FS is not set
621# CONFIG_HFSPLUS_FS is not set
622# CONFIG_BEFS_FS is not set
623# CONFIG_BFS_FS is not set
624# CONFIG_EFS_FS is not set
625# CONFIG_JFFS2_FS is not set
626CONFIG_CRAMFS=y
627# CONFIG_VXFS_FS is not set
628# CONFIG_HPFS_FS is not set
629# CONFIG_QNX4FS_FS is not set
630# CONFIG_SYSV_FS is not set
631# CONFIG_UFS_FS is not set
632
633#
634# Network File Systems
635#
636CONFIG_NFS_FS=y
637CONFIG_NFS_V3=y
638# CONFIG_NFS_V3_ACL is not set
639# CONFIG_NFS_V4 is not set
640# CONFIG_NFS_DIRECTIO is not set
641# CONFIG_NFSD is not set
642CONFIG_ROOT_NFS=y
643CONFIG_LOCKD=y
644CONFIG_LOCKD_V4=y
645CONFIG_NFS_COMMON=y
646CONFIG_SUNRPC=y
647# CONFIG_SUNRPC_BIND34 is not set
648# CONFIG_RPCSEC_GSS_KRB5 is not set
649# CONFIG_RPCSEC_GSS_SPKM3 is not set
650# CONFIG_SMB_FS is not set
651# CONFIG_CIFS is not set
652# CONFIG_NCP_FS is not set
653# CONFIG_CODA_FS is not set
654# CONFIG_AFS_FS is not set
655
656#
657# Partition Types
658#
659# CONFIG_PARTITION_ADVANCED is not set
660CONFIG_MSDOS_PARTITION=y
661
662#
663# Native Language Support
664#
665# CONFIG_NLS is not set
666
667#
668# Distributed Lock Manager
669#
670# CONFIG_DLM is not set
671# CONFIG_UCC_SLOW is not set
672
673#
674# Library routines
675#
676CONFIG_BITREVERSE=y
677# CONFIG_CRC_CCITT is not set
678# CONFIG_CRC16 is not set
679# CONFIG_CRC_ITU_T is not set
680CONFIG_CRC32=y
681# CONFIG_CRC7 is not set
682# CONFIG_LIBCRC32C is not set
683CONFIG_ZLIB_INFLATE=y
684CONFIG_PLIST=y
685CONFIG_HAS_IOMEM=y
686CONFIG_HAS_IOPORT=y
687CONFIG_HAS_DMA=y
688
689#
690# Instrumentation Support
691#
692# CONFIG_PROFILING is not set
693
694#
695# Kernel hacking
696#
697# CONFIG_PRINTK_TIME is not set
698CONFIG_ENABLE_MUST_CHECK=y
699CONFIG_MAGIC_SYSRQ=y
700# CONFIG_UNUSED_SYMBOLS is not set
701# CONFIG_DEBUG_FS is not set
702# CONFIG_HEADERS_CHECK is not set
703CONFIG_DEBUG_KERNEL=y
704# CONFIG_DEBUG_SHIRQ is not set
705CONFIG_DETECT_SOFTLOCKUP=y
706CONFIG_SCHED_DEBUG=y
707# CONFIG_SCHEDSTATS is not set
708# CONFIG_TIMER_STATS is not set
709# CONFIG_DEBUG_SLAB is not set
710# CONFIG_DEBUG_RT_MUTEXES is not set
711# CONFIG_RT_MUTEX_TESTER is not set
712# CONFIG_DEBUG_SPINLOCK is not set
713# CONFIG_DEBUG_MUTEXES is not set
714# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
715# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
716# CONFIG_DEBUG_KOBJECT is not set
717CONFIG_DEBUG_BUGVERBOSE=y
718# CONFIG_DEBUG_INFO is not set
719# CONFIG_DEBUG_VM is not set
720# CONFIG_DEBUG_LIST is not set
721CONFIG_FORCED_INLINING=y
722# CONFIG_RCU_TORTURE_TEST is not set
723# CONFIG_FAULT_INJECTION is not set
724# CONFIG_DEBUG_STACKOVERFLOW is not set
725# CONFIG_DEBUG_STACK_USAGE is not set
726# CONFIG_DEBUG_PAGEALLOC is not set
727# CONFIG_DEBUGGER is not set
728# CONFIG_BDI_SWITCH is not set
729# CONFIG_PPC_EARLY_DEBUG is not set
730
731#
732# Security options
733#
734# CONFIG_KEYS is not set
735# CONFIG_SECURITY is not set
736CONFIG_CRYPTO=y
737CONFIG_CRYPTO_ALGAPI=y
738CONFIG_CRYPTO_BLKCIPHER=y
739CONFIG_CRYPTO_MANAGER=y
740# CONFIG_CRYPTO_HMAC is not set
741# CONFIG_CRYPTO_XCBC is not set
742# CONFIG_CRYPTO_NULL is not set
743# CONFIG_CRYPTO_MD4 is not set
744CONFIG_CRYPTO_MD5=y
745# CONFIG_CRYPTO_SHA1 is not set
746# CONFIG_CRYPTO_SHA256 is not set
747# CONFIG_CRYPTO_SHA512 is not set
748# CONFIG_CRYPTO_WP512 is not set
749# CONFIG_CRYPTO_TGR192 is not set
750# CONFIG_CRYPTO_GF128MUL is not set
751CONFIG_CRYPTO_ECB=y
752CONFIG_CRYPTO_CBC=y
753CONFIG_CRYPTO_PCBC=y
754# CONFIG_CRYPTO_LRW is not set
755# CONFIG_CRYPTO_CRYPTD is not set
756CONFIG_CRYPTO_DES=y
757# CONFIG_CRYPTO_FCRYPT is not set
758# CONFIG_CRYPTO_BLOWFISH is not set
759# CONFIG_CRYPTO_TWOFISH is not set
760# CONFIG_CRYPTO_SERPENT is not set
761# CONFIG_CRYPTO_AES is not set
762# CONFIG_CRYPTO_CAST5 is not set
763# CONFIG_CRYPTO_CAST6 is not set
764# CONFIG_CRYPTO_TEA is not set
765# CONFIG_CRYPTO_ARC4 is not set
766# CONFIG_CRYPTO_KHAZAD is not set
767# CONFIG_CRYPTO_ANUBIS is not set
768# CONFIG_CRYPTO_DEFLATE is not set
769# CONFIG_CRYPTO_MICHAEL_MIC is not set
770# CONFIG_CRYPTO_CRC32C is not set
771# CONFIG_CRYPTO_CAMELLIA is not set
772# CONFIG_CRYPTO_TEST is not set
773CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index b0cb2e662c25..967afc517d8f 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -46,7 +46,7 @@ ifeq ($(CONFIG_PPC_MERGE),y)
46 46
47extra-$(CONFIG_PPC_STD_MMU) := head_32.o 47extra-$(CONFIG_PPC_STD_MMU) := head_32.o
48extra-$(CONFIG_PPC64) := head_64.o 48extra-$(CONFIG_PPC64) := head_64.o
49extra-$(CONFIG_40x) := head_4xx.o 49extra-$(CONFIG_40x) := head_40x.o
50extra-$(CONFIG_44x) := head_44x.o 50extra-$(CONFIG_44x) := head_44x.o
51extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o 51extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
52extra-$(CONFIG_8xx) := head_8xx.o 52extra-$(CONFIG_8xx) := head_8xx.o
@@ -80,13 +80,6 @@ ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
80obj-y += iomap.o 80obj-y += iomap.o
81endif 81endif
82 82
83ifeq ($(CONFIG_PPC_ISERIES),y)
84CFLAGS_lparmap.s += -g0
85extra-y += lparmap.s
86$(obj)/head_64.o: $(obj)/lparmap.s
87AFLAGS_head_64.o += -I$(obj)
88endif
89
90else 83else
91# stuff used from here for ARCH=ppc 84# stuff used from here for ARCH=ppc
92smpobj-$(CONFIG_SMP) += smp.o 85smpobj-$(CONFIG_SMP) += smp.o
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 5c9ff7f5c44e..4c47f9cc0d9a 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -38,7 +38,7 @@ struct aligninfo {
38/* Bits in the flags field */ 38/* Bits in the flags field */
39#define LD 0 /* load */ 39#define LD 0 /* load */
40#define ST 1 /* store */ 40#define ST 1 /* store */
41#define SE 2 /* sign-extend value */ 41#define SE 2 /* sign-extend value, or FP ld/st as word */
42#define F 4 /* to/from fp regs */ 42#define F 4 /* to/from fp regs */
43#define U 8 /* update index register */ 43#define U 8 /* update index register */
44#define M 0x10 /* multiple load/store */ 44#define M 0x10 /* multiple load/store */
@@ -87,9 +87,9 @@ static struct aligninfo aligninfo[128] = {
87 { 8, LD+F+U }, /* 00 1 1001: lfdu */ 87 { 8, LD+F+U }, /* 00 1 1001: lfdu */
88 { 4, ST+F+S+U }, /* 00 1 1010: stfsu */ 88 { 4, ST+F+S+U }, /* 00 1 1010: stfsu */
89 { 8, ST+F+U }, /* 00 1 1011: stfdu */ 89 { 8, ST+F+U }, /* 00 1 1011: stfdu */
90 INVALID, /* 00 1 1100 */ 90 { 16, LD+F }, /* 00 1 1100: lfdp */
91 INVALID, /* 00 1 1101 */ 91 INVALID, /* 00 1 1101 */
92 INVALID, /* 00 1 1110 */ 92 { 16, ST+F }, /* 00 1 1110: stfdp */
93 INVALID, /* 00 1 1111 */ 93 INVALID, /* 00 1 1111 */
94 { 8, LD }, /* 01 0 0000: ldx */ 94 { 8, LD }, /* 01 0 0000: ldx */
95 INVALID, /* 01 0 0001 */ 95 INVALID, /* 01 0 0001 */
@@ -167,10 +167,10 @@ static struct aligninfo aligninfo[128] = {
167 { 8, LD+F }, /* 11 0 1001: lfdx */ 167 { 8, LD+F }, /* 11 0 1001: lfdx */
168 { 4, ST+F+S }, /* 11 0 1010: stfsx */ 168 { 4, ST+F+S }, /* 11 0 1010: stfsx */
169 { 8, ST+F }, /* 11 0 1011: stfdx */ 169 { 8, ST+F }, /* 11 0 1011: stfdx */
170 INVALID, /* 11 0 1100 */ 170 { 16, LD+F }, /* 11 0 1100: lfdpx */
171 { 8, LD+M }, /* 11 0 1101: lmd */ 171 { 4, LD+F+SE }, /* 11 0 1101: lfiwax */
172 INVALID, /* 11 0 1110 */ 172 { 16, ST+F }, /* 11 0 1110: stfdpx */
173 { 8, ST+M }, /* 11 0 1111: stmd */ 173 { 4, ST+F }, /* 11 0 1111: stfiwx */
174 { 4, LD+U }, /* 11 1 0000: lwzux */ 174 { 4, LD+U }, /* 11 1 0000: lwzux */
175 INVALID, /* 11 1 0001 */ 175 INVALID, /* 11 1 0001 */
176 { 4, ST+U }, /* 11 1 0010: stwux */ 176 { 4, ST+U }, /* 11 1 0010: stwux */
@@ -356,6 +356,42 @@ static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr,
356 return 1; 356 return 1;
357} 357}
358 358
359/*
360 * Emulate floating-point pair loads and stores.
361 * Only POWER6 has these instructions, and it does true little-endian,
362 * so we don't need the address swizzling.
363 */
364static int emulate_fp_pair(struct pt_regs *regs, unsigned char __user *addr,
365 unsigned int reg, unsigned int flags)
366{
367 char *ptr = (char *) &current->thread.fpr[reg];
368 int i, ret;
369
370 if (!(flags & F))
371 return 0;
372 if (reg & 1)
373 return 0; /* invalid form: FRS/FRT must be even */
374 if (!(flags & SW)) {
375 /* not byte-swapped - easy */
376 if (!(flags & ST))
377 ret = __copy_from_user(ptr, addr, 16);
378 else
379 ret = __copy_to_user(addr, ptr, 16);
380 } else {
381 /* each FPR value is byte-swapped separately */
382 ret = 0;
383 for (i = 0; i < 16; ++i) {
384 if (!(flags & ST))
385 ret |= __get_user(ptr[i^7], addr + i);
386 else
387 ret |= __put_user(ptr[i^7], addr + i);
388 }
389 }
390 if (ret)
391 return -EFAULT;
392 return 1; /* exception handled and fixed up */
393}
394
359 395
360/* 396/*
361 * Called on alignment exception. Attempts to fixup 397 * Called on alignment exception. Attempts to fixup
@@ -471,6 +507,10 @@ int fix_alignment(struct pt_regs *regs)
471 flush_fp_to_thread(current); 507 flush_fp_to_thread(current);
472 } 508 }
473 509
510 /* Special case for 16-byte FP loads and stores */
511 if (nb == 16)
512 return emulate_fp_pair(regs, addr, reg, flags);
513
474 /* If we are loading, get the data from user space, else 514 /* If we are loading, get the data from user space, else
475 * get it from register values 515 * get it from register values
476 */ 516 */
@@ -531,7 +571,8 @@ int fix_alignment(struct pt_regs *regs)
531 * or floating point single precision conversion 571 * or floating point single precision conversion
532 */ 572 */
533 switch (flags & ~(U|SW)) { 573 switch (flags & ~(U|SW)) {
534 case LD+SE: /* sign extend */ 574 case LD+SE: /* sign extending integer loads */
575 case LD+F+SE: /* sign extend for lfiwax */
535 if ( nb == 2 ) 576 if ( nb == 2 )
536 data.ll = data.x16.low16; 577 data.ll = data.x16.low16;
537 else /* nb must be 4 */ 578 else /* nb must be 4 */
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 2cb1d9487796..a40805328f9b 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -312,5 +312,13 @@ int main(void)
312#ifdef CONFIG_BUG 312#ifdef CONFIG_BUG
313 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry)); 313 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
314#endif 314#endif
315
316#ifdef CONFIG_PPC_ISERIES
317 /* the assembler miscalculates the VSID values */
318 DEFINE(PAGE_OFFSET_ESID, GET_ESID(PAGE_OFFSET));
319 DEFINE(PAGE_OFFSET_VSID, KERNEL_VSID(PAGE_OFFSET));
320 DEFINE(VMALLOC_START_ESID, GET_ESID(VMALLOC_START));
321 DEFINE(VMALLOC_START_VSID, KERNEL_VSID(VMALLOC_START));
322#endif
315 return 0; 323 return 0;
316} 324}
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index e7b684689e04..3ef51fb6f107 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -11,7 +11,6 @@
11#include <asm/sections.h> 11#include <asm/sections.h>
12#include <asm/prom.h> 12#include <asm/prom.h>
13#include <asm/btext.h> 13#include <asm/btext.h>
14#include <asm/prom.h>
15#include <asm/page.h> 14#include <asm/page.h>
16#include <asm/mmu.h> 15#include <asm/mmu.h>
17#include <asm/pgtable.h> 16#include <asm/pgtable.h>
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b1f8000952f3..5873073c9045 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1132,6 +1132,24 @@ static struct cpu_spec cpu_specs[] = {
1132 .dcache_bsize = 32, 1132 .dcache_bsize = 32,
1133 .platform = "ppc440", 1133 .platform = "ppc440",
1134 }, 1134 },
1135 { /* 440EPX */
1136 .pvr_mask = 0xf0000ffb,
1137 .pvr_value = 0x200008D0,
1138 .cpu_name = "440EPX",
1139 .cpu_features = CPU_FTRS_44X,
1140 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1141 .icache_bsize = 32,
1142 .dcache_bsize = 32,
1143 },
1144 { /* 440GRX */
1145 .pvr_mask = 0xf0000ffb,
1146 .pvr_value = 0x200008D8,
1147 .cpu_name = "440GRX",
1148 .cpu_features = CPU_FTRS_44X,
1149 .cpu_user_features = COMMON_USER_BOOKE,
1150 .icache_bsize = 32,
1151 .dcache_bsize = 32,
1152 },
1135 { /* 440GP Rev. B */ 1153 { /* 440GP Rev. B */
1136 .pvr_mask = 0xf0000fff, 1154 .pvr_mask = 0xf0000fff,
1137 .pvr_value = 0x40000440, 1155 .pvr_value = 0x40000440,
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 37658ea417fa..77c749a13378 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/irq.h>
28 27
29#include <asm/processor.h> 28#include <asm/processor.h>
30#include <asm/machdep.h> 29#include <asm/machdep.h>
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 2f6f5a7bc69e..ffa91d673ec8 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -25,7 +25,7 @@
25#define DBG(fmt...) 25#define DBG(fmt...)
26#endif 26#endif
27 27
28void reserve_kdump_trampoline(void) 28void __init reserve_kdump_trampoline(void)
29{ 29{
30 lmb_reserve(0, KDUMP_RESERVE_LIMIT); 30 lmb_reserve(0, KDUMP_RESERVE_LIMIT);
31} 31}
diff --git a/arch/powerpc/kernel/head_4xx.S b/arch/powerpc/kernel/head_40x.S
index adc7f8097cd4..a8e045773a92 100644
--- a/arch/powerpc/kernel/head_4xx.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -35,7 +35,6 @@
35#include <asm/page.h> 35#include <asm/page.h>
36#include <asm/mmu.h> 36#include <asm/mmu.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/ibm4xx.h>
39#include <asm/cputable.h> 38#include <asm/cputable.h>
40#include <asm/thread_info.h> 39#include <asm/thread_info.h>
41#include <asm/ppc_asm.h> 40#include <asm/ppc_asm.h>
@@ -772,7 +771,7 @@ finish_tlb_load:
772 */ 771 */
773 lwz r9, tlb_4xx_index@l(0) 772 lwz r9, tlb_4xx_index@l(0)
774 addi r9, r9, 1 773 addi r9, r9, 1
775 andi. r9, r9, (PPC4XX_TLB_SIZE-1) 774 andi. r9, r9, (PPC40X_TLB_SIZE-1)
776 stw r9, tlb_4xx_index@l(0) 775 stw r9, tlb_4xx_index@l(0)
777 776
7786: 7776:
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 88695963f587..e26d26e31813 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -217,7 +217,7 @@ skpinv: addi r4,r4,1 /* Increment */
217 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 217 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
218 mtspr SPRN_IVPR,r4 218 mtspr SPRN_IVPR,r4
219 219
220#ifdef CONFIG_440EP 220#if defined(CONFIG_440EP) || defined(CONFIG_440EPX)
221 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */ 221 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
222 mfspr r2,SPRN_CCR0 222 mfspr r2,SPRN_CCR0
223 lis r3,0xffef 223 lis r3,0xffef
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 171800002ede..33c4e8cab0ba 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -34,6 +34,8 @@
34#include <asm/iseries/lpar_map.h> 34#include <asm/iseries/lpar_map.h>
35#include <asm/thread_info.h> 35#include <asm/thread_info.h>
36#include <asm/firmware.h> 36#include <asm/firmware.h>
37#include <asm/page_64.h>
38#include <asm/exception.h>
37 39
38#define DO_SOFT_DISABLE 40#define DO_SOFT_DISABLE
39 41
@@ -144,344 +146,9 @@ exception_marker:
144 .text 146 .text
145 147
146/* 148/*
147 * The following macros define the code that appears as
148 * the prologue to each of the exception handlers. They
149 * are split into two parts to allow a single kernel binary
150 * to be used for pSeries and iSeries.
151 * LOL. One day... - paulus
152 */
153
154/*
155 * We make as much of the exception code common between native
156 * exception handlers (including pSeries LPAR) and iSeries LPAR
157 * implementations as possible.
158 */
159
160/*
161 * This is the start of the interrupt handlers for pSeries 149 * This is the start of the interrupt handlers for pSeries
162 * This code runs with relocation off. 150 * This code runs with relocation off.
163 */ 151 */
164#define EX_R9 0
165#define EX_R10 8
166#define EX_R11 16
167#define EX_R12 24
168#define EX_R13 32
169#define EX_SRR0 40
170#define EX_DAR 48
171#define EX_DSISR 56
172#define EX_CCR 60
173#define EX_R3 64
174#define EX_LR 72
175
176/*
177 * We're short on space and time in the exception prolog, so we can't
178 * use the normal SET_REG_IMMEDIATE macro. Normally we just need the
179 * low halfword of the address, but for Kdump we need the whole low
180 * word.
181 */
182#ifdef CONFIG_CRASH_DUMP
183#define LOAD_HANDLER(reg, label) \
184 oris reg,reg,(label)@h; /* virt addr of handler ... */ \
185 ori reg,reg,(label)@l; /* .. and the rest */
186#else
187#define LOAD_HANDLER(reg, label) \
188 ori reg,reg,(label)@l; /* virt addr of handler ... */
189#endif
190
191/*
192 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
193 * The firmware calls the registered system_reset_fwnmi and
194 * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run
195 * a 32bit application at the time of the event.
196 * This firmware bug is present on POWER4 and JS20.
197 */
198#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \
199 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
200 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
201 std r10,area+EX_R10(r13); \
202 std r11,area+EX_R11(r13); \
203 std r12,area+EX_R12(r13); \
204 mfspr r9,SPRN_SPRG1; \
205 std r9,area+EX_R13(r13); \
206 mfcr r9; \
207 clrrdi r12,r13,32; /* get high part of &label */ \
208 mfmsr r10; \
209 /* force 64bit mode */ \
210 li r11,5; /* MSR_SF_LG|MSR_ISF_LG */ \
211 rldimi r10,r11,61,0; /* insert into top 3 bits */ \
212 /* done 64bit mode */ \
213 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
214 LOAD_HANDLER(r12,label) \
215 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
216 mtspr SPRN_SRR0,r12; \
217 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
218 mtspr SPRN_SRR1,r10; \
219 rfid; \
220 b . /* prevent speculative execution */
221
222#define EXCEPTION_PROLOG_PSERIES(area, label) \
223 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
224 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
225 std r10,area+EX_R10(r13); \
226 std r11,area+EX_R11(r13); \
227 std r12,area+EX_R12(r13); \
228 mfspr r9,SPRN_SPRG1; \
229 std r9,area+EX_R13(r13); \
230 mfcr r9; \
231 clrrdi r12,r13,32; /* get high part of &label */ \
232 mfmsr r10; \
233 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
234 LOAD_HANDLER(r12,label) \
235 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
236 mtspr SPRN_SRR0,r12; \
237 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
238 mtspr SPRN_SRR1,r10; \
239 rfid; \
240 b . /* prevent speculative execution */
241
242/*
243 * This is the start of the interrupt handlers for iSeries
244 * This code runs with relocation on.
245 */
246#define EXCEPTION_PROLOG_ISERIES_1(area) \
247 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
248 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
249 std r10,area+EX_R10(r13); \
250 std r11,area+EX_R11(r13); \
251 std r12,area+EX_R12(r13); \
252 mfspr r9,SPRN_SPRG1; \
253 std r9,area+EX_R13(r13); \
254 mfcr r9
255
256#define EXCEPTION_PROLOG_ISERIES_2 \
257 mfmsr r10; \
258 ld r12,PACALPPACAPTR(r13); \
259 ld r11,LPPACASRR0(r12); \
260 ld r12,LPPACASRR1(r12); \
261 ori r10,r10,MSR_RI; \
262 mtmsrd r10,1
263
264/*
265 * The common exception prolog is used for all except a few exceptions
266 * such as a segment miss on a kernel address. We have to be prepared
267 * to take another exception from the point where we first touch the
268 * kernel stack onwards.
269 *
270 * On entry r13 points to the paca, r9-r13 are saved in the paca,
271 * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
272 * SRR1, and relocation is on.
273 */
274#define EXCEPTION_PROLOG_COMMON(n, area) \
275 andi. r10,r12,MSR_PR; /* See if coming from user */ \
276 mr r10,r1; /* Save r1 */ \
277 subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
278 beq- 1f; \
279 ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
2801: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
281 bge- cr1,2f; /* abort if it is */ \
282 b 3f; \
2832: li r1,(n); /* will be reloaded later */ \
284 sth r1,PACA_TRAP_SAVE(r13); \
285 b bad_stack; \
2863: std r9,_CCR(r1); /* save CR in stackframe */ \
287 std r11,_NIP(r1); /* save SRR0 in stackframe */ \
288 std r12,_MSR(r1); /* save SRR1 in stackframe */ \
289 std r10,0(r1); /* make stack chain pointer */ \
290 std r0,GPR0(r1); /* save r0 in stackframe */ \
291 std r10,GPR1(r1); /* save r1 in stackframe */ \
292 ACCOUNT_CPU_USER_ENTRY(r9, r10); \
293 std r2,GPR2(r1); /* save r2 in stackframe */ \
294 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
295 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
296 ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \
297 ld r10,area+EX_R10(r13); \
298 std r9,GPR9(r1); \
299 std r10,GPR10(r1); \
300 ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \
301 ld r10,area+EX_R12(r13); \
302 ld r11,area+EX_R13(r13); \
303 std r9,GPR11(r1); \
304 std r10,GPR12(r1); \
305 std r11,GPR13(r1); \
306 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
307 mflr r9; /* save LR in stackframe */ \
308 std r9,_LINK(r1); \
309 mfctr r10; /* save CTR in stackframe */ \
310 std r10,_CTR(r1); \
311 lbz r10,PACASOFTIRQEN(r13); \
312 mfspr r11,SPRN_XER; /* save XER in stackframe */ \
313 std r10,SOFTE(r1); \
314 std r11,_XER(r1); \
315 li r9,(n)+1; \
316 std r9,_TRAP(r1); /* set trap number */ \
317 li r10,0; \
318 ld r11,exception_marker@toc(r2); \
319 std r10,RESULT(r1); /* clear regs->result */ \
320 std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */
321
322/*
323 * Exception vectors.
324 */
325#define STD_EXCEPTION_PSERIES(n, label) \
326 . = n; \
327 .globl label##_pSeries; \
328label##_pSeries: \
329 HMT_MEDIUM; \
330 mtspr SPRN_SPRG1,r13; /* save r13 */ \
331 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
332
333#define HSTD_EXCEPTION_PSERIES(n, label) \
334 . = n; \
335 .globl label##_pSeries; \
336label##_pSeries: \
337 HMT_MEDIUM; \
338 mtspr SPRN_SPRG1,r20; /* save r20 */ \
339 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \
340 mtspr SPRN_SRR0,r20; \
341 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \
342 mtspr SPRN_SRR1,r20; \
343 mfspr r20,SPRN_SPRG1; /* restore r20 */ \
344 mtspr SPRN_SPRG1,r13; /* save r13 */ \
345 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
346
347
348#define MASKABLE_EXCEPTION_PSERIES(n, label) \
349 . = n; \
350 .globl label##_pSeries; \
351label##_pSeries: \
352 HMT_MEDIUM; \
353 mtspr SPRN_SPRG1,r13; /* save r13 */ \
354 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
355 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
356 std r10,PACA_EXGEN+EX_R10(r13); \
357 lbz r10,PACASOFTIRQEN(r13); \
358 mfcr r9; \
359 cmpwi r10,0; \
360 beq masked_interrupt; \
361 mfspr r10,SPRN_SPRG1; \
362 std r10,PACA_EXGEN+EX_R13(r13); \
363 std r11,PACA_EXGEN+EX_R11(r13); \
364 std r12,PACA_EXGEN+EX_R12(r13); \
365 clrrdi r12,r13,32; /* get high part of &label */ \
366 mfmsr r10; \
367 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
368 LOAD_HANDLER(r12,label##_common) \
369 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
370 mtspr SPRN_SRR0,r12; \
371 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
372 mtspr SPRN_SRR1,r10; \
373 rfid; \
374 b . /* prevent speculative execution */
375
376#define STD_EXCEPTION_ISERIES(n, label, area) \
377 .globl label##_iSeries; \
378label##_iSeries: \
379 HMT_MEDIUM; \
380 mtspr SPRN_SPRG1,r13; /* save r13 */ \
381 EXCEPTION_PROLOG_ISERIES_1(area); \
382 EXCEPTION_PROLOG_ISERIES_2; \
383 b label##_common
384
385#define MASKABLE_EXCEPTION_ISERIES(n, label) \
386 .globl label##_iSeries; \
387label##_iSeries: \
388 HMT_MEDIUM; \
389 mtspr SPRN_SPRG1,r13; /* save r13 */ \
390 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
391 lbz r10,PACASOFTIRQEN(r13); \
392 cmpwi 0,r10,0; \
393 beq- label##_iSeries_masked; \
394 EXCEPTION_PROLOG_ISERIES_2; \
395 b label##_common; \
396
397#ifdef CONFIG_PPC_ISERIES
398#define DISABLE_INTS \
399 li r11,0; \
400 stb r11,PACASOFTIRQEN(r13); \
401BEGIN_FW_FTR_SECTION; \
402 stb r11,PACAHARDIRQEN(r13); \
403END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
404BEGIN_FW_FTR_SECTION; \
405 mfmsr r10; \
406 ori r10,r10,MSR_EE; \
407 mtmsrd r10,1; \
408END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
409
410#else
411#define DISABLE_INTS \
412 li r11,0; \
413 stb r11,PACASOFTIRQEN(r13); \
414 stb r11,PACAHARDIRQEN(r13)
415
416#endif /* CONFIG_PPC_ISERIES */
417
418#define ENABLE_INTS \
419 ld r12,_MSR(r1); \
420 mfmsr r11; \
421 rlwimi r11,r12,0,MSR_EE; \
422 mtmsrd r11,1
423
424#define STD_EXCEPTION_COMMON(trap, label, hdlr) \
425 .align 7; \
426 .globl label##_common; \
427label##_common: \
428 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
429 DISABLE_INTS; \
430 bl .save_nvgprs; \
431 addi r3,r1,STACK_FRAME_OVERHEAD; \
432 bl hdlr; \
433 b .ret_from_except
434
435/*
436 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur
437 * in the idle task and therefore need the special idle handling.
438 */
439#define STD_EXCEPTION_COMMON_IDLE(trap, label, hdlr) \
440 .align 7; \
441 .globl label##_common; \
442label##_common: \
443 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
444 FINISH_NAP; \
445 DISABLE_INTS; \
446 bl .save_nvgprs; \
447 addi r3,r1,STACK_FRAME_OVERHEAD; \
448 bl hdlr; \
449 b .ret_from_except
450
451#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \
452 .align 7; \
453 .globl label##_common; \
454label##_common: \
455 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
456 FINISH_NAP; \
457 DISABLE_INTS; \
458 bl .ppc64_runlatch_on; \
459 addi r3,r1,STACK_FRAME_OVERHEAD; \
460 bl hdlr; \
461 b .ret_from_except_lite
462
463/*
464 * When the idle code in power4_idle puts the CPU into NAP mode,
465 * it has to do so in a loop, and relies on the external interrupt
466 * and decrementer interrupt entry code to get it out of the loop.
467 * It sets the _TLF_NAPPING bit in current_thread_info()->local_flags
468 * to signal that it is in the loop and needs help to get out.
469 */
470#ifdef CONFIG_PPC_970_NAP
471#define FINISH_NAP \
472BEGIN_FTR_SECTION \
473 clrrdi r11,r1,THREAD_SHIFT; \
474 ld r9,TI_LOCAL_FLAGS(r11); \
475 andi. r10,r9,_TLF_NAPPING; \
476 bnel power4_fixup_nap; \
477END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
478#else
479#define FINISH_NAP
480#endif
481
482/*
483 * Start of pSeries system interrupt routines
484 */
485 . = 0x100 152 . = 0x100
486 .globl __start_interrupts 153 .globl __start_interrupts
487__start_interrupts: 154__start_interrupts:
@@ -691,192 +358,6 @@ machine_check_fwnmi:
691 mtspr SPRN_SPRG1,r13 /* save r13 */ 358 mtspr SPRN_SPRG1,r13 /* save r13 */
692 EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common) 359 EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common)
693 360
694#ifdef CONFIG_PPC_ISERIES
695/*** ISeries-LPAR interrupt handlers ***/
696
697 STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC)
698
699 .globl data_access_iSeries
700data_access_iSeries:
701 mtspr SPRN_SPRG1,r13
702BEGIN_FTR_SECTION
703 mtspr SPRN_SPRG2,r12
704 mfspr r13,SPRN_DAR
705 mfspr r12,SPRN_DSISR
706 srdi r13,r13,60
707 rlwimi r13,r12,16,0x20
708 mfcr r12
709 cmpwi r13,0x2c
710 beq .do_stab_bolted_iSeries
711 mtcrf 0x80,r12
712 mfspr r12,SPRN_SPRG2
713END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
714 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN)
715 EXCEPTION_PROLOG_ISERIES_2
716 b data_access_common
717
718.do_stab_bolted_iSeries:
719 mtcrf 0x80,r12
720 mfspr r12,SPRN_SPRG2
721 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
722 EXCEPTION_PROLOG_ISERIES_2
723 b .do_stab_bolted
724
725 .globl data_access_slb_iSeries
726data_access_slb_iSeries:
727 mtspr SPRN_SPRG1,r13 /* save r13 */
728 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
729 std r3,PACA_EXSLB+EX_R3(r13)
730 mfspr r3,SPRN_DAR
731 std r9,PACA_EXSLB+EX_R9(r13)
732 mfcr r9
733#ifdef __DISABLED__
734 cmpdi r3,0
735 bge slb_miss_user_iseries
736#endif
737 std r10,PACA_EXSLB+EX_R10(r13)
738 std r11,PACA_EXSLB+EX_R11(r13)
739 std r12,PACA_EXSLB+EX_R12(r13)
740 mfspr r10,SPRN_SPRG1
741 std r10,PACA_EXSLB+EX_R13(r13)
742 ld r12,PACALPPACAPTR(r13)
743 ld r12,LPPACASRR1(r12)
744 b .slb_miss_realmode
745
746 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)
747
748 .globl instruction_access_slb_iSeries
749instruction_access_slb_iSeries:
750 mtspr SPRN_SPRG1,r13 /* save r13 */
751 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
752 std r3,PACA_EXSLB+EX_R3(r13)
753 ld r3,PACALPPACAPTR(r13)
754 ld r3,LPPACASRR0(r3) /* get SRR0 value */
755 std r9,PACA_EXSLB+EX_R9(r13)
756 mfcr r9
757#ifdef __DISABLED__
758 cmpdi r3,0
759 bge .slb_miss_user_iseries
760#endif
761 std r10,PACA_EXSLB+EX_R10(r13)
762 std r11,PACA_EXSLB+EX_R11(r13)
763 std r12,PACA_EXSLB+EX_R12(r13)
764 mfspr r10,SPRN_SPRG1
765 std r10,PACA_EXSLB+EX_R13(r13)
766 ld r12,PACALPPACAPTR(r13)
767 ld r12,LPPACASRR1(r12)
768 b .slb_miss_realmode
769
770#ifdef __DISABLED__
771slb_miss_user_iseries:
772 std r10,PACA_EXGEN+EX_R10(r13)
773 std r11,PACA_EXGEN+EX_R11(r13)
774 std r12,PACA_EXGEN+EX_R12(r13)
775 mfspr r10,SPRG1
776 ld r11,PACA_EXSLB+EX_R9(r13)
777 ld r12,PACA_EXSLB+EX_R3(r13)
778 std r10,PACA_EXGEN+EX_R13(r13)
779 std r11,PACA_EXGEN+EX_R9(r13)
780 std r12,PACA_EXGEN+EX_R3(r13)
781 EXCEPTION_PROLOG_ISERIES_2
782 b slb_miss_user_common
783#endif
784
785 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt)
786 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN)
787 STD_EXCEPTION_ISERIES(0x700, program_check, PACA_EXGEN)
788 STD_EXCEPTION_ISERIES(0x800, fp_unavailable, PACA_EXGEN)
789 MASKABLE_EXCEPTION_ISERIES(0x900, decrementer)
790 STD_EXCEPTION_ISERIES(0xa00, trap_0a, PACA_EXGEN)
791 STD_EXCEPTION_ISERIES(0xb00, trap_0b, PACA_EXGEN)
792
793 .globl system_call_iSeries
794system_call_iSeries:
795 mr r9,r13
796 mfspr r13,SPRN_SPRG3
797 EXCEPTION_PROLOG_ISERIES_2
798 b system_call_common
799
800 STD_EXCEPTION_ISERIES( 0xd00, single_step, PACA_EXGEN)
801 STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN)
802 STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN)
803
804 .globl system_reset_iSeries
805system_reset_iSeries:
806 mfspr r13,SPRN_SPRG3 /* Get paca address */
807 mfmsr r24
808 ori r24,r24,MSR_RI
809 mtmsrd r24 /* RI on */
810 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
811 cmpwi 0,r24,0 /* Are we processor 0? */
812 bne 1f
813 b .__start_initialization_iSeries /* Start up the first processor */
8141: mfspr r4,SPRN_CTRLF
815 li r5,CTRL_RUNLATCH /* Turn off the run light */
816 andc r4,r4,r5
817 mtspr SPRN_CTRLT,r4
818
8191:
820 HMT_LOW
821#ifdef CONFIG_SMP
822 lbz r23,PACAPROCSTART(r13) /* Test if this processor
823 * should start */
824 sync
825 LOAD_REG_IMMEDIATE(r3,current_set)
826 sldi r28,r24,3 /* get current_set[cpu#] */
827 ldx r3,r3,r28
828 addi r1,r3,THREAD_SIZE
829 subi r1,r1,STACK_FRAME_OVERHEAD
830
831 cmpwi 0,r23,0
832 beq iSeries_secondary_smp_loop /* Loop until told to go */
833 bne __secondary_start /* Loop until told to go */
834iSeries_secondary_smp_loop:
835 /* Let the Hypervisor know we are alive */
836 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
837 lis r3,0x8002
838 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
839#else /* CONFIG_SMP */
840 /* Yield the processor. This is required for non-SMP kernels
841 which are running on multi-threaded machines. */
842 lis r3,0x8000
843 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
844 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
845 li r4,0 /* "yield timed" */
846 li r5,-1 /* "yield forever" */
847#endif /* CONFIG_SMP */
848 li r0,-1 /* r0=-1 indicates a Hypervisor call */
849 sc /* Invoke the hypervisor via a system call */
850 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
851 b 1b /* If SMP not configured, secondaries
852 * loop forever */
853
854decrementer_iSeries_masked:
855 /* We may not have a valid TOC pointer in here. */
856 li r11,1
857 ld r12,PACALPPACAPTR(r13)
858 stb r11,LPPACADECRINT(r12)
859 LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
860 lwz r12,0(r12)
861 mtspr SPRN_DEC,r12
862 /* fall through */
863
864hardware_interrupt_iSeries_masked:
865 mtcrf 0x80,r9 /* Restore regs */
866 ld r12,PACALPPACAPTR(r13)
867 ld r11,LPPACASRR0(r12)
868 ld r12,LPPACASRR1(r12)
869 mtspr SPRN_SRR0,r11
870 mtspr SPRN_SRR1,r12
871 ld r9,PACA_EXGEN+EX_R9(r13)
872 ld r10,PACA_EXGEN+EX_R10(r13)
873 ld r11,PACA_EXGEN+EX_R11(r13)
874 ld r12,PACA_EXGEN+EX_R12(r13)
875 ld r13,PACA_EXGEN+EX_R13(r13)
876 rfid
877 b . /* prevent speculative execution */
878#endif /* CONFIG_PPC_ISERIES */
879
880/*** Common interrupt handlers ***/ 361/*** Common interrupt handlers ***/
881 362
882 STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception) 363 STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
@@ -1519,8 +1000,8 @@ _GLOBAL(do_stab_bolted)
1519 * Space for CPU0's segment table. 1000 * Space for CPU0's segment table.
1520 * 1001 *
1521 * On iSeries, the hypervisor must fill in at least one entry before 1002 * On iSeries, the hypervisor must fill in at least one entry before
1522 * we get control (with relocate on). The address is give to the hv 1003 * we get control (with relocate on). The address is given to the hv
1523 * as a page number (see xLparMap in lpardata.c), so this must be at a 1004 * as a page number (see xLparMap below), so this must be at a
1524 * fixed address (the linker can't compute (u64)&initial_stab >> 1005 * fixed address (the linker can't compute (u64)&initial_stab >>
1525 * PAGE_SHIFT). 1006 * PAGE_SHIFT).
1526 */ 1007 */
@@ -1542,12 +1023,22 @@ fwnmi_data_area:
1542 * both pSeries and iSeries */ 1023 * both pSeries and iSeries */
1543#ifdef CONFIG_PPC_ISERIES 1024#ifdef CONFIG_PPC_ISERIES
1544 . = LPARMAP_PHYS 1025 . = LPARMAP_PHYS
1545#include "lparmap.s" 1026 .globl xLparMap
1546/* 1027xLparMap:
1547 * This ".text" is here for old compilers that generate a trailing 1028 .quad HvEsidsToMap /* xNumberEsids */
1548 * .note section when compiling .c files to .s 1029 .quad HvRangesToMap /* xNumberRanges */
1549 */ 1030 .quad STAB0_PAGE /* xSegmentTableOffs */
1550 .text 1031 .zero 40 /* xRsvd */
1032 /* xEsids (HvEsidsToMap entries of 2 quads) */
1033 .quad PAGE_OFFSET_ESID /* xKernelEsid */
1034 .quad PAGE_OFFSET_VSID /* xKernelVsid */
1035 .quad VMALLOC_START_ESID /* xKernelEsid */
1036 .quad VMALLOC_START_VSID /* xKernelVsid */
1037 /* xRanges (HvRangesToMap entries of 3 quads) */
1038 .quad HvPagesToMap /* xPages */
1039 .quad 0 /* xOffset */
1040 .quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
1041
1551#endif /* CONFIG_PPC_ISERIES */ 1042#endif /* CONFIG_PPC_ISERIES */
1552 1043
1553 . = 0x8000 1044 . = 0x8000
@@ -1611,39 +1102,6 @@ _GLOBAL(generic_secondary_smp_init)
1611 b __secondary_start 1102 b __secondary_start
1612#endif 1103#endif
1613 1104
1614#ifdef CONFIG_PPC_ISERIES
1615_INIT_STATIC(__start_initialization_iSeries)
1616 /* Clear out the BSS */
1617 LOAD_REG_IMMEDIATE(r11,__bss_stop)
1618 LOAD_REG_IMMEDIATE(r8,__bss_start)
1619 sub r11,r11,r8 /* bss size */
1620 addi r11,r11,7 /* round up to an even double word */
1621 rldicl. r11,r11,61,3 /* shift right by 3 */
1622 beq 4f
1623 addi r8,r8,-8
1624 li r0,0
1625 mtctr r11 /* zero this many doublewords */
16263: stdu r0,8(r8)
1627 bdnz 3b
16284:
1629 LOAD_REG_IMMEDIATE(r1,init_thread_union)
1630 addi r1,r1,THREAD_SIZE
1631 li r0,0
1632 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1633
1634 LOAD_REG_IMMEDIATE(r2,__toc_start)
1635 addi r2,r2,0x4000
1636 addi r2,r2,0x4000
1637
1638 bl .iSeries_early_setup
1639 bl .early_setup
1640
1641 /* relocation is on at this point */
1642
1643 b .start_here_common
1644#endif /* CONFIG_PPC_ISERIES */
1645
1646
1647_STATIC(__mmu_off) 1105_STATIC(__mmu_off)
1648 mfmsr r3 1106 mfmsr r3
1649 andi. r0,r3,MSR_IR|MSR_DR 1107 andi. r0,r3,MSR_IR|MSR_DR
@@ -1891,6 +1349,7 @@ _GLOBAL(pmac_secondary_start)
1891 * r13 = paca virtual address 1349 * r13 = paca virtual address
1892 * SPRG3 = paca virtual address 1350 * SPRG3 = paca virtual address
1893 */ 1351 */
1352 .globl __secondary_start
1894__secondary_start: 1353__secondary_start:
1895 /* Set thread priority to MEDIUM */ 1354 /* Set thread priority to MEDIUM */
1896 HMT_MEDIUM 1355 HMT_MEDIUM
@@ -2021,7 +1480,7 @@ _INIT_STATIC(start_here_multiplatform)
2021 b . /* prevent speculative execution */ 1480 b . /* prevent speculative execution */
2022 1481
2023 /* This is where all platforms converge execution */ 1482 /* This is where all platforms converge execution */
2024_INIT_STATIC(start_here_common) 1483_INIT_GLOBAL(start_here_common)
2025 /* relocation is on at this point */ 1484 /* relocation is on at this point */
2026 1485
2027 /* The following code sets up the SP and TOC now that we are */ 1486 /* The following code sets up the SP and TOC now that we are */
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index c08ceca6277d..e4ec6eee81a8 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -30,7 +30,6 @@
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/init.h>
34#include <linux/bitops.h> 33#include <linux/bitops.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/prom.h> 35#include <asm/prom.h>
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 24bea97c736c..dfad0e469eec 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -272,7 +272,7 @@ void do_IRQ(struct pt_regs *regs)
272 struct thread_info *curtp, *irqtp; 272 struct thread_info *curtp, *irqtp;
273#endif 273#endif
274 274
275 irq_enter(); 275 irq_enter();
276 276
277#ifdef CONFIG_DEBUG_STACKOVERFLOW 277#ifdef CONFIG_DEBUG_STACKOVERFLOW
278 /* Debugging check for stack overflow: is there less than 2KB free? */ 278 /* Debugging check for stack overflow: is there less than 2KB free? */
@@ -321,7 +321,7 @@ void do_IRQ(struct pt_regs *regs)
321 /* That's not SMP safe ... but who cares ? */ 321 /* That's not SMP safe ... but who cares ? */
322 ppc_spurious_interrupts++; 322 ppc_spurious_interrupts++;
323 323
324 irq_exit(); 324 irq_exit();
325 set_irq_regs(old_regs); 325 set_irq_regs(old_regs);
326 326
327#ifdef CONFIG_PPC_ISERIES 327#ifdef CONFIG_PPC_ISERIES
diff --git a/arch/powerpc/kernel/lparmap.c b/arch/powerpc/kernel/lparmap.c
deleted file mode 100644
index af11285ffbd1..000000000000
--- a/arch/powerpc/kernel/lparmap.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright (C) 2005 Stephen Rothwell IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <asm/mmu.h>
10#include <asm/pgtable.h>
11#include <asm/iseries/lpar_map.h>
12
13/* The # is to stop gcc trying to make .text nonexecutable */
14const struct LparMap __attribute__((__section__(".text #"))) xLparMap = {
15 .xNumberEsids = HvEsidsToMap,
16 .xNumberRanges = HvRangesToMap,
17 .xSegmentTableOffs = STAB0_PAGE,
18
19 .xEsids = {
20 { .xKernelEsid = GET_ESID(PAGE_OFFSET),
21 .xKernelVsid = KERNEL_VSID(PAGE_OFFSET), },
22 { .xKernelEsid = GET_ESID(VMALLOC_START),
23 .xKernelVsid = KERNEL_VSID(VMALLOC_START), },
24 },
25
26 .xRanges = {
27 { .xPages = HvPagesToMap,
28 .xOffset = 0,
29 .xVPN = KERNEL_VSID(PAGE_OFFSET) << (SID_SHIFT - HW_PAGE_SHIFT),
30 },
31 },
32};
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index f9676f52c6d8..0ed31f220482 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -34,21 +34,10 @@
34 34
35#undef DEBUG_NVRAM 35#undef DEBUG_NVRAM
36 36
37static int nvram_scan_partitions(void);
38static int nvram_setup_partition(void);
39static int nvram_create_os_partition(void);
40static int nvram_remove_os_partition(void);
41
42static struct nvram_partition * nvram_part; 37static struct nvram_partition * nvram_part;
43static long nvram_error_log_index = -1; 38static long nvram_error_log_index = -1;
44static long nvram_error_log_size = 0; 39static long nvram_error_log_size = 0;
45 40
46int no_logging = 1; /* Until we initialize everything,
47 * make sure we don't try logging
48 * anything */
49
50extern volatile int error_log_cnt;
51
52struct err_log_info { 41struct err_log_info {
53 int error_type; 42 int error_type;
54 unsigned int seq_num; 43 unsigned int seq_num;
@@ -636,16 +625,13 @@ void __exit nvram_cleanup(void)
636 * sequence #: The unique sequence # for each event. (until it wraps) 625 * sequence #: The unique sequence # for each event. (until it wraps)
637 * error log: The error log from event_scan 626 * error log: The error log from event_scan
638 */ 627 */
639int nvram_write_error_log(char * buff, int length, unsigned int err_type) 628int nvram_write_error_log(char * buff, int length,
629 unsigned int err_type, unsigned int error_log_cnt)
640{ 630{
641 int rc; 631 int rc;
642 loff_t tmp_index; 632 loff_t tmp_index;
643 struct err_log_info info; 633 struct err_log_info info;
644 634
645 if (no_logging) {
646 return -EPERM;
647 }
648
649 if (nvram_error_log_index == -1) { 635 if (nvram_error_log_index == -1) {
650 return -ESPIPE; 636 return -ESPIPE;
651 } 637 }
@@ -678,7 +664,8 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type)
678 * 664 *
679 * Reads nvram for error log for at most 'length' 665 * Reads nvram for error log for at most 'length'
680 */ 666 */
681int nvram_read_error_log(char * buff, int length, unsigned int * err_type) 667int nvram_read_error_log(char * buff, int length,
668 unsigned int * err_type, unsigned int * error_log_cnt)
682{ 669{
683 int rc; 670 int rc;
684 loff_t tmp_index; 671 loff_t tmp_index;
@@ -704,7 +691,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
704 return rc; 691 return rc;
705 } 692 }
706 693
707 error_log_cnt = info.seq_num; 694 *error_log_cnt = info.seq_num;
708 *err_type = info.error_type; 695 *err_type = info.error_type;
709 696
710 return 0; 697 return 0;
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 04a3109ae3c6..0e2bee46304c 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -1457,8 +1457,8 @@ null_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
1457 1457
1458static struct pci_ops null_pci_ops = 1458static struct pci_ops null_pci_ops =
1459{ 1459{
1460 null_read_config, 1460 .read = null_read_config,
1461 null_write_config 1461 .write = null_write_config,
1462}; 1462};
1463 1463
1464/* 1464/*
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index a20f1951a5ce..430c502179c3 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -180,7 +180,7 @@ EXPORT_SYMBOL(cacheable_memcpy);
180EXPORT_SYMBOL(cpm_install_handler); 180EXPORT_SYMBOL(cpm_install_handler);
181EXPORT_SYMBOL(cpm_free_handler); 181EXPORT_SYMBOL(cpm_free_handler);
182#endif /* CONFIG_8xx */ 182#endif /* CONFIG_8xx */
183#if defined(CONFIG_8xx) || defined(CONFIG_40x) 183#if defined(CONFIG_8xx)
184EXPORT_SYMBOL(__res); 184EXPORT_SYMBOL(__res);
185#endif 185#endif
186 186
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index a38197b12d3e..0028fe68e09e 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -52,7 +52,6 @@
52#include <asm/pSeries_reconfig.h> 52#include <asm/pSeries_reconfig.h>
53#include <asm/pci-bridge.h> 53#include <asm/pci-bridge.h>
54#include <asm/kexec.h> 54#include <asm/kexec.h>
55#include <asm/system.h>
56 55
57#ifdef DEBUG 56#ifdef DEBUG
58#define DBG(fmt...) printk(KERN_ERR fmt) 57#define DBG(fmt...) printk(KERN_ERR fmt)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index a1d582e38627..29c2160bcbb5 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2046,6 +2046,7 @@ static void __init fixup_device_tree_maple(void)
2046/* 2046/*
2047 * Pegasos and BriQ lacks the "ranges" property in the isa node 2047 * Pegasos and BriQ lacks the "ranges" property in the isa node
2048 * Pegasos needs decimal IRQ 14/15, not hexadecimal 2048 * Pegasos needs decimal IRQ 14/15, not hexadecimal
2049 * Pegasos has the IDE configured in legacy mode, but advertised as native
2049 */ 2050 */
2050static void __init fixup_device_tree_chrp(void) 2051static void __init fixup_device_tree_chrp(void)
2051{ 2052{
@@ -2083,9 +2084,13 @@ static void __init fixup_device_tree_chrp(void)
2083 prom_printf("Fixing up IDE interrupt on Pegasos...\n"); 2084 prom_printf("Fixing up IDE interrupt on Pegasos...\n");
2084 prop[0] = 14; 2085 prop[0] = 14;
2085 prop[1] = 0x0; 2086 prop[1] = 0x0;
2086 prop[2] = 15; 2087 prom_setprop(ph, name, "interrupts", prop, 2*sizeof(u32));
2087 prop[3] = 0x0; 2088 prom_printf("Fixing up IDE class-code on Pegasos...\n");
2088 prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32)); 2089 rc = prom_getprop(ph, "class-code", prop, sizeof(u32));
2090 if (rc == sizeof(u32)) {
2091 prop[0] &= ~0x5;
2092 prom_setprop(ph, name, "class-code", prop, sizeof(u32));
2093 }
2089 } 2094 }
2090} 2095}
2091#else 2096#else
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index a5de6211b97a..21f14e57d1f3 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -171,8 +171,8 @@ static int rtas_pci_write_config(struct pci_bus *bus,
171} 171}
172 172
173struct pci_ops rtas_pci_ops = { 173struct pci_ops rtas_pci_ops = {
174 rtas_pci_read_config, 174 .read = rtas_pci_read_config,
175 rtas_pci_write_config 175 .write = rtas_pci_write_config,
176}; 176};
177 177
178int is_python(struct device_node *dev) 178int is_python(struct device_node *dev)
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 7ec6ba56d83d..a288a5f2dbc6 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -18,13 +18,11 @@
18#include <linux/cpu.h> 18#include <linux/cpu.h>
19#include <linux/console.h> 19#include <linux/console.h>
20 20
21#include <asm/residual.h>
22#include <asm/io.h> 21#include <asm/io.h>
23#include <asm/prom.h> 22#include <asm/prom.h>
24#include <asm/processor.h> 23#include <asm/processor.h>
25#include <asm/pgtable.h> 24#include <asm/pgtable.h>
26#include <asm/setup.h> 25#include <asm/setup.h>
27#include <asm/amigappc.h>
28#include <asm/smp.h> 26#include <asm/smp.h>
29#include <asm/elf.h> 27#include <asm/elf.h>
30#include <asm/cputable.h> 28#include <asm/cputable.h>
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 727a6699f2f4..b5944d8e3802 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -72,7 +72,6 @@
72#include <asm/iseries/it_lp_queue.h> 72#include <asm/iseries/it_lp_queue.h>
73#include <asm/iseries/hv_call_xm.h> 73#include <asm/iseries/hv_call_xm.h>
74#endif 74#endif
75#include <asm/smp.h>
76 75
77/* keep track of when we need to update the rtc */ 76/* keep track of when we need to update the rtc */
78time_t last_rtc_update; 77time_t last_rtc_update;
@@ -867,7 +866,7 @@ void __init generic_calibrate_decr(void)
867 "(not found)\n"); 866 "(not found)\n");
868 } 867 }
869 868
870#ifdef CONFIG_BOOKE 869#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
871 /* Set the time base to zero */ 870 /* Set the time base to zero */
872 mtspr(SPRN_TBWL, 0); 871 mtspr(SPRN_TBWL, 0);
873 mtspr(SPRN_TBWU, 0); 872 mtspr(SPRN_TBWU, 0);
diff --git a/arch/powerpc/mm/4xx_mmu.c b/arch/powerpc/mm/40x_mmu.c
index 7ff2609b64d1..e067df836be2 100644
--- a/arch/powerpc/mm/4xx_mmu.c
+++ b/arch/powerpc/mm/40x_mmu.c
@@ -108,7 +108,7 @@ unsigned long __init mmu_mapin_ram(void)
108 pmd_t *pmdp; 108 pmd_t *pmdp;
109 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; 109 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
110 110
111 pmdp = pmd_offset(pgd_offset_k(v), v); 111 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
112 pmd_val(*pmdp++) = val; 112 pmd_val(*pmdp++) = val;
113 pmd_val(*pmdp++) = val; 113 pmd_val(*pmdp++) = val;
114 pmd_val(*pmdp++) = val; 114 pmd_val(*pmdp++) = val;
@@ -123,7 +123,7 @@ unsigned long __init mmu_mapin_ram(void)
123 pmd_t *pmdp; 123 pmd_t *pmdp;
124 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; 124 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
125 125
126 pmdp = pmd_offset(pgd_offset_k(v), v); 126 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
127 pmd_val(*pmdp) = val; 127 pmd_val(*pmdp) = val;
128 128
129 v += LARGE_PAGE_SIZE_4M; 129 v += LARGE_PAGE_SIZE_4M;
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 7e4d27ad3dee..bf20fa688809 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \
13 hash_utils_64.o hash_low_64.o tlb_64.o \ 13 hash_utils_64.o hash_low_64.o tlb_64.o \
14 slb_low.o slb.o stab.o mmap.o $(hash-y) 14 slb_low.o slb.o stab.o mmap.o $(hash-y)
15obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o tlb_32.o 15obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o tlb_32.o
16obj-$(CONFIG_40x) += 4xx_mmu.o 16obj-$(CONFIG_40x) += 40x_mmu.o
17obj-$(CONFIG_44x) += 44x_mmu.o 17obj-$(CONFIG_44x) += 44x_mmu.o
18obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o 18obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o
19obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o 19obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index a47151e806ca..d525f2eba313 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -49,7 +49,6 @@
49#include <asm/tlb.h> 49#include <asm/tlb.h>
50#include <asm/cacheflush.h> 50#include <asm/cacheflush.h>
51#include <asm/cputable.h> 51#include <asm/cputable.h>
52#include <asm/abs_addr.h>
53#include <asm/sections.h> 52#include <asm/sections.h>
54#include <asm/spu.h> 53#include <asm/spu.h>
55 54
@@ -602,13 +601,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
602{ 601{
603 if (mm->context.user_psize == MMU_PAGE_4K) 602 if (mm->context.user_psize == MMU_PAGE_4K)
604 return; 603 return;
605#ifdef CONFIG_PPC_MM_SLICES
606 slice_set_user_psize(mm, MMU_PAGE_4K); 604 slice_set_user_psize(mm, MMU_PAGE_4K);
607#else /* CONFIG_PPC_MM_SLICES */
608 mm->context.user_psize = MMU_PAGE_4K;
609 mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp;
610#endif /* CONFIG_PPC_MM_SLICES */
611
612#ifdef CONFIG_SPU_BASE 605#ifdef CONFIG_SPU_BASE
613 spu_flush_all_slbs(mm); 606 spu_flush_all_slbs(mm);
614#endif 607#endif
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 4835f73af304..ba5f12a60467 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -22,11 +22,8 @@
22#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
23#include <asm/machdep.h> 23#include <asm/machdep.h>
24#include <asm/cputable.h> 24#include <asm/cputable.h>
25#include <asm/tlb.h>
26#include <asm/spu.h> 25#include <asm/spu.h>
27 26
28#include <linux/sysctl.h>
29
30#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT) 27#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT)
31#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT) 28#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
32 29
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index e1f5ded851f6..d65995ae8273 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -41,7 +41,6 @@
41#include <asm/machdep.h> 41#include <asm/machdep.h>
42#include <asm/btext.h> 42#include <asm/btext.h>
43#include <asm/tlb.h> 43#include <asm/tlb.h>
44#include <asm/prom.h>
45#include <asm/lmb.h> 44#include <asm/lmb.h>
46#include <asm/sections.h> 45#include <asm/sections.h>
47 46
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index f0e7eedb1ba3..32dcfc9b0082 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -42,7 +42,6 @@
42#include <asm/machdep.h> 42#include <asm/machdep.h>
43#include <asm/btext.h> 43#include <asm/btext.h>
44#include <asm/tlb.h> 44#include <asm/tlb.h>
45#include <asm/prom.h>
46#include <asm/lmb.h> 45#include <asm/lmb.h>
47#include <asm/sections.h> 46#include <asm/sections.h>
48#include <asm/vdso.h> 47#include <asm/vdso.h>
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
index 7a78cdc0515a..1db38ba1f544 100644
--- a/arch/powerpc/mm/mmu_context_64.c
+++ b/arch/powerpc/mm/mmu_context_64.c
@@ -28,7 +28,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
28{ 28{
29 int index; 29 int index;
30 int err; 30 int err;
31 int new_context = (mm->context.id == 0);
32 31
33again: 32again:
34 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) 33 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
@@ -50,19 +49,13 @@ again:
50 return -ENOMEM; 49 return -ENOMEM;
51 } 50 }
52 51
53 mm->context.id = index;
54#ifdef CONFIG_PPC_MM_SLICES
55 /* The old code would re-promote on fork, we don't do that 52 /* The old code would re-promote on fork, we don't do that
56 * when using slices as it could cause problem promoting slices 53 * when using slices as it could cause problem promoting slices
57 * that have been forced down to 4K 54 * that have been forced down to 4K
58 */ 55 */
59 if (new_context) 56 if (slice_mm_new_context(mm))
60 slice_set_user_psize(mm, mmu_virtual_psize); 57 slice_set_user_psize(mm, mmu_virtual_psize);
61#else 58 mm->context.id = index;
62 mm->context.user_psize = mmu_virtual_psize;
63 mm->context.sllp = SLB_VSID_USER |
64 mmu_psize_defs[mmu_virtual_psize].sllp;
65#endif
66 59
67 return 0; 60 return 0;
68} 61}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index d5fd3909d13a..319826ef1645 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -551,6 +551,7 @@ EXPORT_SYMBOL_GPL(get_slice_psize);
551 * 551 *
552 * This is also called in init_new_context() to change back the user 552 * This is also called in init_new_context() to change back the user
553 * psize from whatever the parent context had it set to 553 * psize from whatever the parent context had it set to
554 * N.B. This may be called before mm->context.id has been set.
554 * 555 *
555 * This function will only change the content of the {low,high)_slice_psize 556 * This function will only change the content of the {low,high)_slice_psize
556 * masks, it will not flush SLBs as this shall be handled lazily by the 557 * masks, it will not flush SLBs as this shall be handled lazily by the
diff --git a/arch/powerpc/platforms/4xx/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index ded357c17414..c3dce3b3d524 100644
--- a/arch/powerpc/platforms/4xx/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -1,16 +1,3 @@
1config 4xx
2 bool
3 depends on 40x || 44x
4 default y
5
6config BOOKE
7 bool
8 depends on 44x
9 default y
10
11menu "AMCC 40x options"
12 depends on 40x
13
14#config BUBINGA 1#config BUBINGA
15# bool "Bubinga" 2# bool "Bubinga"
16# depends on 40x 3# depends on 40x
@@ -66,13 +53,13 @@ menu "AMCC 40x options"
66# help 53# help
67# This option enables support for the IBM PPC405GPr evaluation board. 54# This option enables support for the IBM PPC405GPr evaluation board.
68 55
69#config WALNUT 56config WALNUT
70# bool "Walnut" 57 bool "Walnut"
71# depends on 40x 58 depends on 40x
72# default y 59 default y
73# select 405GP 60 select 405GP
74# help 61 help
75# This option enables support for the IBM PPC405GP evaluation board. 62 This option enables support for the IBM PPC405GP evaluation board.
76 63
77#config XILINX_ML300 64#config XILINX_ML300
78# bool "Xilinx-ML300" 65# bool "Xilinx-ML300"
@@ -82,8 +69,6 @@ menu "AMCC 40x options"
82# help 69# help
83# This option enables support for the Xilinx ML300 evaluation board. 70# This option enables support for the Xilinx ML300 evaluation board.
84 71
85endmenu
86
87# 40x specific CPU modules, selected based on the board above. 72# 40x specific CPU modules, selected based on the board above.
88config NP405H 73config NP405H
89 bool 74 bool
@@ -126,68 +111,6 @@ config IBM405_ERR77
126config IBM405_ERR51 111config IBM405_ERR51
127 bool 112 bool
128 113
129menu "AMCC 44x options"
130 depends on 44x
131
132#config BAMBOO
133# bool "Bamboo"
134# depends on 44x
135# default n
136# select 440EP
137# help
138# This option enables support for the IBM PPC440EP evaluation board.
139
140config EBONY
141 bool "Ebony"
142 depends on 44x
143 default y
144 select 440GP
145 help
146 This option enables support for the IBM PPC440GP evaluation board.
147
148#config LUAN
149# bool "Luan"
150# depends on 44x
151# default n
152# select 440SP
153# help
154# This option enables support for the IBM PPC440SP evaluation board.
155
156#config OCOTEA
157# bool "Ocotea"
158# depends on 44x
159# default n
160# select 440GX
161# help
162# This option enables support for the IBM PPC440GX evaluation board.
163
164endmenu
165
166# 44x specific CPU modules, selected based on the board above.
167config 440EP
168 bool
169 select PPC_FPU
170 select IBM440EP_ERR42
171
172config 440GP
173 bool
174 select IBM_NEW_EMAC_ZMII
175
176config 440GX
177 bool
178
179config 440SP
180 bool
181
182config 440A
183 bool
184 depends on 440GX
185 default y
186
187# 44x errata/workaround config symbols, selected by the CPU models above
188config IBM440EP_ERR42
189 bool
190
191#config XILINX_OCP 114#config XILINX_OCP
192# bool 115# bool
193# depends on XILINX_ML300 116# depends on XILINX_ML300
diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
new file mode 100644
index 000000000000..e6c0bbd063a4
--- /dev/null
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_WALNUT) += walnut.o
diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c
new file mode 100644
index 000000000000..c17fdf23b492
--- /dev/null
+++ b/arch/powerpc/platforms/40x/walnut.c
@@ -0,0 +1,68 @@
1/*
2 * Architecture- / platform-specific boot-time initialization code for
3 * IBM PowerPC 4xx based boards. Adapted from original
4 * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
5 * <dan@net4x.com>.
6 *
7 * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
8 *
9 * Rewritten and ported to the merged powerpc tree:
10 * Copyright 2007 IBM Corporation
11 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
12 *
13 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
14 * the terms of the GNU General Public License version 2. This program
15 * is licensed "as is" without any warranty of any kind, whether express
16 * or implied.
17 */
18
19#include <linux/init.h>
20#include <asm/machdep.h>
21#include <asm/prom.h>
22#include <asm/udbg.h>
23#include <asm/time.h>
24#include <asm/uic.h>
25#include <asm/of_platform.h>
26
27static struct of_device_id walnut_of_bus[] = {
28 { .compatible = "ibm,plb3", },
29 { .compatible = "ibm,opb", },
30 { .compatible = "ibm,ebc", },
31 {},
32};
33
34static int __init walnut_device_probe(void)
35{
36 if (!machine_is(walnut))
37 return 0;
38
39 /* FIXME: do bus probe here */
40 of_platform_bus_probe(NULL, walnut_of_bus, NULL);
41
42 return 0;
43}
44device_initcall(walnut_device_probe);
45
46static int __init walnut_probe(void)
47{
48 unsigned long root = of_get_flat_dt_root();
49
50 if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
51 return 0;
52
53 return 1;
54}
55
56static void __init walnut_setup_arch(void)
57{
58}
59
60define_machine(walnut) {
61 .name = "Walnut",
62 .probe = walnut_probe,
63 .setup_arch = walnut_setup_arch,
64 .progress = udbg_progress,
65 .init_IRQ = uic_init_tree,
66 .get_irq = uic_get_irq,
67 .calibrate_decr = generic_calibrate_decr,
68};
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 1b3e008fd148..f28acdcbd6c9 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -1,10 +1,10 @@
1#config BAMBOO 1config BAMBOO
2# bool "Bamboo" 2 bool "Bamboo"
3# depends on 44x 3 depends on 44x
4# default n 4 default n
5# select 440EP 5 select 440EP
6# help 6 help
7# This option enables support for the IBM PPC440EP evaluation board. 7 This option enables support for the IBM PPC440EP evaluation board.
8 8
9config EBONY 9config EBONY
10 bool "Ebony" 10 bool "Ebony"
@@ -14,6 +14,14 @@ config EBONY
14 help 14 help
15 This option enables support for the IBM PPC440GP evaluation board. 15 This option enables support for the IBM PPC440GP evaluation board.
16 16
17config SEQUOIA
18 bool "Sequoia"
19 depends on 44x
20 default n
21 select 440EPX
22 help
23 This option enables support for the AMCC PPC440EPX evaluation board.
24
17#config LUAN 25#config LUAN
18# bool "Luan" 26# bool "Luan"
19# depends on 44x 27# depends on 44x
@@ -35,6 +43,14 @@ config 440EP
35 bool 43 bool
36 select PPC_FPU 44 select PPC_FPU
37 select IBM440EP_ERR42 45 select IBM440EP_ERR42
46# select IBM_NEW_EMAC_ZMII
47
48config 440EPX
49 bool
50 select PPC_FPU
51# Disabled until the new EMAC Driver is merged.
52# select IBM_NEW_EMAC_EMAC4
53# select IBM_NEW_EMAC_ZMII
38 54
39config 440GP 55config 440GP
40 bool 56 bool
@@ -49,7 +65,7 @@ config 440SP
49 65
50config 440A 66config 440A
51 bool 67 bool
52 depends on 440GX 68 depends on 440GX || 440EPX
53 default y 69 default y
54 70
55# 44x errata/workaround config symbols, selected by the CPU models above 71# 44x errata/workaround config symbols, selected by the CPU models above
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 41d0a18a0e44..10ce6740cc7d 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,2 +1,4 @@
1obj-$(CONFIG_44x) := misc_44x.o 1obj-$(CONFIG_44x) := misc_44x.o
2obj-$(CONFIG_EBONY) += ebony.o 2obj-$(CONFIG_EBONY) += ebony.o
3obj-$(CONFIG_BAMBOO) += bamboo.o
4obj-$(CONFIG_SEQUOIA) += sequoia.o
diff --git a/arch/powerpc/platforms/44x/bamboo.c b/arch/powerpc/platforms/44x/bamboo.c
new file mode 100644
index 000000000000..9bc45dea078f
--- /dev/null
+++ b/arch/powerpc/platforms/44x/bamboo.c
@@ -0,0 +1,66 @@
1/*
2 * Bamboo board specific routines
3 *
4 * Wade Farnsworth <wfarnsworth@mvista.com>
5 * Copyright 2004 MontaVista Software Inc.
6 *
7 * Rewritten and ported to the merged powerpc tree:
8 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
9 * Copyright 2007 IBM Corporation
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#include <linux/init.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22#include <asm/of_platform.h>
23#include "44x.h"
24
25static struct of_device_id bamboo_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init bamboo_device_probe(void)
33{
34 if (!machine_is(bamboo))
35 return 0;
36
37 of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
38
39 return 0;
40}
41device_initcall(bamboo_device_probe);
42
43static int __init bamboo_probe(void)
44{
45 unsigned long root = of_get_flat_dt_root();
46
47 if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
48 return 0;
49
50 return 1;
51}
52
53static void __init bamboo_setup_arch(void)
54{
55}
56
57define_machine(bamboo) {
58 .name = "Bamboo",
59 .probe = bamboo_probe,
60 .setup_arch = bamboo_setup_arch,
61 .progress = udbg_progress,
62 .init_IRQ = uic_init_tree,
63 .get_irq = uic_get_irq,
64 .restart = ppc44x_reset_system,
65 .calibrate_decr = generic_calibrate_decr,
66};
diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
new file mode 100644
index 000000000000..7d0d9d567d25
--- /dev/null
+++ b/arch/powerpc/platforms/44x/sequoia.c
@@ -0,0 +1,66 @@
1/*
2 * Sequoia board specific routines
3 *
4 * Valentine Barshak <vbarshak@ru.mvista.com>
5 * Copyright 2007 MontaVista Software Inc.
6 *
7 * Based on the Bamboo code by
8 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
9 * Copyright 2007 IBM Corporation
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#include <linux/init.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22#include <asm/of_platform.h>
23#include "44x.h"
24
25static struct of_device_id sequoia_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init sequoia_device_probe(void)
33{
34 if (!machine_is(sequoia))
35 return 0;
36
37 of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
38
39 return 0;
40}
41device_initcall(sequoia_device_probe);
42
43static int __init sequoia_probe(void)
44{
45 unsigned long root = of_get_flat_dt_root();
46
47 if (!of_flat_dt_is_compatible(root, "amcc,sequoia"))
48 return 0;
49
50 return 1;
51}
52
53static void __init sequoia_setup_arch(void)
54{
55}
56
57define_machine(sequoia) {
58 .name = "Sequoia",
59 .probe = sequoia_probe,
60 .setup_arch = sequoia_setup_arch,
61 .progress = udbg_progress,
62 .init_IRQ = uic_init_tree,
63 .get_irq = uic_get_irq,
64 .restart = ppc44x_reset_system,
65 .calibrate_decr = generic_calibrate_decr,
66};
diff --git a/arch/powerpc/platforms/4xx/Makefile b/arch/powerpc/platforms/4xx/Makefile
deleted file mode 100644
index 79ff6b1e887c..000000000000
--- a/arch/powerpc/platforms/4xx/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1# empty makefile so make clean works \ No newline at end of file
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 4be6e7a17b66..4263158b3274 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -78,8 +78,8 @@ static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
78} 78}
79 79
80static struct pci_ops rtas_pci_ops = { 80static struct pci_ops rtas_pci_ops = {
81 rtas_read_config, 81 .read = rtas_read_config,
82 rtas_write_config 82 .write = rtas_write_config,
83}; 83};
84 84
85 85
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 5c46e898fd45..ce3f6951828e 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -35,7 +35,6 @@
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/machdep.h> 36#include <asm/machdep.h>
37#include <asm/ipic.h> 37#include <asm/ipic.h>
38#include <asm/bootinfo.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
40#include <asm/prom.h> 39#include <asm/prom.h>
41#include <asm/udbg.h> 40#include <asm/udbg.h>
@@ -109,22 +108,13 @@ static void lite5200_resume_finish(void __iomem *mbar)
109 108
110static void __init lite5200_setup_arch(void) 109static void __init lite5200_setup_arch(void)
111{ 110{
111#ifdef CONFIG_PCI
112 struct device_node *np; 112 struct device_node *np;
113#endif
113 114
114 if (ppc_md.progress) 115 if (ppc_md.progress)
115 ppc_md.progress("lite5200_setup_arch()", 0); 116 ppc_md.progress("lite5200_setup_arch()", 0);
116 117
117 np = of_find_node_by_type(NULL, "cpu");
118 if (np) {
119 const unsigned int *fp =
120 of_get_property(np, "clock-frequency", NULL);
121 if (fp != 0)
122 loops_per_jiffy = *fp / HZ;
123 else
124 loops_per_jiffy = 50000000 / HZ;
125 of_node_put(np);
126 }
127
128 /* CPU & Port mux setup */ 118 /* CPU & Port mux setup */
129 mpc52xx_setup_cpu(); /* Generic */ 119 mpc52xx_setup_cpu(); /* Generic */
130 lite5200_setup_cpu(); /* Platorm specific */ 120 lite5200_setup_cpu(); /* Platorm specific */
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index fbfff95b4437..8c464c55b5d0 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -22,7 +22,6 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/signal.h> 24#include <linux/signal.h>
25#include <linux/stddef.h>
26#include <linux/delay.h> 25#include <linux/delay.h>
27#include <linux/irq.h> 26#include <linux/irq.h>
28#include <linux/hardirq.h> 27#include <linux/hardirq.h>
diff --git a/arch/powerpc/platforms/82xx/m82xx_pci.h b/arch/powerpc/platforms/82xx/m82xx_pci.h
index 9cd8893b5a32..65e38a7ff48f 100644
--- a/arch/powerpc/platforms/82xx/m82xx_pci.h
+++ b/arch/powerpc/platforms/82xx/m82xx_pci.h
@@ -8,8 +8,6 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10 10
11#include <asm/m8260_pci.h>
12
13#define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET) 11#define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET)
14 12
15#ifndef _IO_BASE 13#ifndef _IO_BASE
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c
index cc9900d2e5ee..c706871aec1a 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx.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/bootinfo.h>
40#include <asm/pci-bridge.h> 39#include <asm/pci-bridge.h>
41#include <asm/mpc8260.h> 40#include <asm/mpc8260.h>
42#include <asm/irq.h> 41#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
index 2d1b05b9f8ef..c0a0c56ac5b3 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -37,7 +37,6 @@
37#include <asm/time.h> 37#include <asm/time.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/machdep.h> 39#include <asm/machdep.h>
40#include <asm/bootinfo.h>
41#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
42#include <asm/mpc8260.h> 41#include <asm/mpc8260.h>
43#include <asm/irq.h> 42#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 5b5cca6c8c88..6f749b76dd8f 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -23,7 +23,6 @@
23#define __MACH_ADS8260_DEFS 23#define __MACH_ADS8260_DEFS
24 24
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26#include <asm/ppcboot.h>
27 26
28/* For our show_cpuinfo hooks. */ 27/* For our show_cpuinfo hooks. */
29#define CPUINFO_VENDOR "Freescale Semiconductor" 28#define CPUINFO_VENDOR "Freescale Semiconductor"
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 2c8e641a739b..61e3f1cb0a7e 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -32,7 +32,6 @@
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/machdep.h> 33#include <asm/machdep.h>
34#include <asm/ipic.h> 34#include <asm/ipic.h>
35#include <asm/bootinfo.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
37#include <asm/prom.h> 36#include <asm/prom.h>
38#include <asm/udbg.h> 37#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 47ba5446f63c..6d06645e5ba8 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -30,7 +30,6 @@
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/ipic.h> 32#include <asm/ipic.h>
33#include <asm/bootinfo.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35#include <asm/prom.h> 34#include <asm/prom.h>
36#include <asm/udbg.h> 35#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 4c9ff9cadfe4..f8aba9a488bc 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -30,7 +30,6 @@
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/ipic.h> 32#include <asm/ipic.h>
33#include <asm/bootinfo.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35#include <asm/prom.h> 34#include <asm/prom.h>
36#include <asm/udbg.h> 35#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 84b58934aafd..69970b910c12 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -38,7 +38,6 @@
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/machdep.h> 39#include <asm/machdep.h>
40#include <asm/ipic.h> 40#include <asm/ipic.h>
41#include <asm/bootinfo.h>
42#include <asm/irq.h> 41#include <asm/irq.h>
43#include <asm/prom.h> 42#include <asm/prom.h>
44#include <asm/udbg.h> 43#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 2d4cb7847604..b46c8d50f6d1 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -35,7 +35,6 @@
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/machdep.h> 36#include <asm/machdep.h>
37#include <asm/ipic.h> 37#include <asm/ipic.h>
38#include <asm/bootinfo.h>
39#include <asm/pci-bridge.h> 38#include <asm/pci-bridge.h>
40#include <asm/mpc85xx.h> 39#include <asm/mpc85xx.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 7ca7e676f1c4..66366a023820 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -38,7 +38,6 @@
38#include <asm/time.h> 38#include <asm/time.h>
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/machdep.h> 40#include <asm/machdep.h>
41#include <asm/bootinfo.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
43#include <asm/mpc85xx.h> 42#include <asm/mpc85xx.h>
44#include <asm/irq.h> 43#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index f1693550c70c..b2b98dd8be6a 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -36,13 +36,11 @@
36 36
37#include <asm/mmu.h> 37#include <asm/mmu.h>
38#include <asm/reg.h> 38#include <asm/reg.h>
39#include <asm/residual.h>
40#include <asm/io.h> 39#include <asm/io.h>
41#include <asm/pgtable.h> 40#include <asm/pgtable.h>
42#include <asm/mpc8xx.h> 41#include <asm/mpc8xx.h>
43#include <asm/8xx_immap.h> 42#include <asm/8xx_immap.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/bootinfo.h>
46#include <asm/time.h> 44#include <asm/time.h>
47#include <asm/prom.h> 45#include <asm/prom.h>
48#include <asm/fs_pd.h> 46#include <asm/fs_pd.h>
@@ -55,7 +53,9 @@ struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
55#endif 53#endif
56 54
57void m8xx_calibrate_decr(void); 55void m8xx_calibrate_decr(void);
56#ifdef CONFIG_8xx_WDT
58extern void m8xx_wdt_handler_install(bd_t *bp); 57extern void m8xx_wdt_handler_install(bd_t *bp);
58#endif
59extern int cpm_pic_init(void); 59extern int cpm_pic_init(void);
60extern int cpm_get_irq(void); 60extern int cpm_get_irq(void);
61 61
@@ -89,24 +89,24 @@ init_internal_rtc(void)
89 89
90static int __init get_freq(char *name, unsigned long *val) 90static int __init get_freq(char *name, unsigned long *val)
91{ 91{
92 struct device_node *cpu; 92 struct device_node *cpu;
93 const unsigned int *fp; 93 const unsigned int *fp;
94 int found = 0; 94 int found = 0;
95 95
96 /* The cpu node should have timebase and clock frequency properties */ 96 /* The cpu node should have timebase and clock frequency properties */
97 cpu = of_find_node_by_type(NULL, "cpu"); 97 cpu = of_find_node_by_type(NULL, "cpu");
98 98
99 if (cpu) { 99 if (cpu) {
100 fp = of_get_property(cpu, name, NULL); 100 fp = of_get_property(cpu, name, NULL);
101 if (fp) { 101 if (fp) {
102 found = 1; 102 found = 1;
103 *val = *fp; 103 *val = *fp;
104 } 104 }
105 105
106 of_node_put(cpu); 106 of_node_put(cpu);
107 } 107 }
108 108
109 return found; 109 return found;
110} 110}
111 111
112/* The decrementer counts at the system (internal) clock frequency divided by 112/* The decrementer counts at the system (internal) clock frequency divided by
@@ -122,7 +122,7 @@ void __init mpc8xx_calibrate_decr(void)
122 sit8xx_t *sys_tmr2; 122 sit8xx_t *sys_tmr2;
123 int irq, virq; 123 int irq, virq;
124 124
125 clk_r1 = (cark8xx_t *) immr_map(im_clkrstk); 125 clk_r1 = (cark8xx_t *) immr_map(im_clkrstk);
126 126
127 /* Unlock the SCCR. */ 127 /* Unlock the SCCR. */
128 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY); 128 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY);
@@ -130,24 +130,24 @@ void __init mpc8xx_calibrate_decr(void)
130 immr_unmap(clk_r1); 130 immr_unmap(clk_r1);
131 131
132 /* Force all 8xx processors to use divide by 16 processor clock. */ 132 /* Force all 8xx processors to use divide by 16 processor clock. */
133 clk_r2 = (car8xx_t *) immr_map(im_clkrst); 133 clk_r2 = (car8xx_t *) immr_map(im_clkrst);
134 setbits32(&clk_r2->car_sccr, 0x02000000); 134 setbits32(&clk_r2->car_sccr, 0x02000000);
135 immr_unmap(clk_r2); 135 immr_unmap(clk_r2);
136 136
137 /* Processor frequency is MHz. 137 /* Processor frequency is MHz.
138 */ 138 */
139 ppc_tb_freq = 50000000; 139 ppc_tb_freq = 50000000;
140 if (!get_freq("bus-frequency", &ppc_tb_freq)) { 140 if (!get_freq("bus-frequency", &ppc_tb_freq)) {
141 printk(KERN_ERR "WARNING: Estimating decrementer frequency " 141 printk(KERN_ERR "WARNING: Estimating decrementer frequency "
142 "(not found)\n"); 142 "(not found)\n");
143 } 143 }
144 ppc_tb_freq /= 16; 144 ppc_tb_freq /= 16;
145 ppc_proc_freq = 50000000; 145 ppc_proc_freq = 50000000;
146 if (!get_freq("clock-frequency", &ppc_proc_freq)) 146 if (!get_freq("clock-frequency", &ppc_proc_freq))
147 printk(KERN_ERR "WARNING: Estimating processor frequency" 147 printk(KERN_ERR "WARNING: Estimating processor frequency"
148 "(not found)\n"); 148 "(not found)\n");
149 149
150 printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); 150 printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
151 151
152 /* Perform some more timer/timebase initialization. This used 152 /* Perform some more timer/timebase initialization. This used
153 * to be done elsewhere, but other changes caused it to get 153 * to be done elsewhere, but other changes caused it to get
@@ -164,7 +164,7 @@ void __init mpc8xx_calibrate_decr(void)
164 * we guarantee the registers are locked, then we unlock them 164 * we guarantee the registers are locked, then we unlock them
165 * for our use. 165 * for our use.
166 */ 166 */
167 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); 167 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk);
168 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY); 168 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY);
169 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY); 169 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY);
170 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY); 170 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY);
@@ -180,8 +180,8 @@ void __init mpc8xx_calibrate_decr(void)
180 * we have to enable the timebase). The decrementer interrupt 180 * we have to enable the timebase). The decrementer interrupt
181 * is wired into the vector table, nothing to do here for that. 181 * is wired into the vector table, nothing to do here for that.
182 */ 182 */
183 cpu = of_find_node_by_type(NULL, "cpu"); 183 cpu = of_find_node_by_type(NULL, "cpu");
184 virq= irq_of_parse_and_map(cpu, 0); 184 virq= irq_of_parse_and_map(cpu, 0);
185 irq = irq_map[virq].hwirq; 185 irq = irq_map[virq].hwirq;
186 186
187 sys_tmr2 = (sit8xx_t *) immr_map(im_sit); 187 sys_tmr2 = (sit8xx_t *) immr_map(im_sit);
@@ -211,10 +211,10 @@ int mpc8xx_set_rtc_time(struct rtc_time *tm)
211 sit8xx_t *sys_tmr2; 211 sit8xx_t *sys_tmr2;
212 int time; 212 int time;
213 213
214 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); 214 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk);
215 sys_tmr2 = (sit8xx_t *) immr_map(im_sit); 215 sys_tmr2 = (sit8xx_t *) immr_map(im_sit);
216 time = mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, 216 time = mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
217 tm->tm_hour, tm->tm_min, tm->tm_sec); 217 tm->tm_hour, tm->tm_min, tm->tm_sec);
218 218
219 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY); 219 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY);
220 out_be32(&sys_tmr2->sit_rtc, time); 220 out_be32(&sys_tmr2->sit_rtc, time);
@@ -233,8 +233,8 @@ void mpc8xx_get_rtc_time(struct rtc_time *tm)
233 /* Get time from the RTC. */ 233 /* Get time from the RTC. */
234 data = in_be32(&sys_tmr->sit_rtc); 234 data = in_be32(&sys_tmr->sit_rtc);
235 to_tm(data, tm); 235 to_tm(data, tm);
236 tm->tm_year -= 1900; 236 tm->tm_year -= 1900;
237 tm->tm_mon -= 1; 237 tm->tm_mon -= 1;
238 immr_unmap(sys_tmr); 238 immr_unmap(sys_tmr);
239 return; 239 return;
240} 240}
@@ -298,7 +298,7 @@ void __init m8xx_pic_init(void)
298 int irq; 298 int irq;
299 299
300 if (mpc8xx_pic_init()) { 300 if (mpc8xx_pic_init()) {
301 printk(KERN_ERR "Failed interrupt 8xx controller initialization\n"); 301 printk(KERN_ERR "Failed interrupt 8xx controller initialization\n");
302 return; 302 return;
303 } 303 }
304 304
diff --git a/arch/powerpc/platforms/8xx/mpc86xads.h b/arch/powerpc/platforms/8xx/mpc86xads.h
index 59bad2f9ae51..dd10cd20b6a7 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads.h
+++ b/arch/powerpc/platforms/8xx/mpc86xads.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_MPC86XADS_H__ 15#ifndef __ASM_MPC86XADS_H__
16#define __ASM_MPC86XADS_H__ 16#define __ASM_MPC86XADS_H__
17 17
18#include <asm/ppcboot.h>
19#include <sysdev/fsl_soc.h> 18#include <sysdev/fsl_soc.h>
20 19
21/* U-Boot maps BCSR to 0xff080000 */ 20/* U-Boot maps BCSR to 0xff080000 */
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index cf0e7bc8c2e7..8f64f48698ab 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -31,7 +31,6 @@
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h> 32#include <asm/system.h>
33#include <asm/time.h> 33#include <asm/time.h>
34#include <asm/ppcboot.h>
35#include <asm/mpc8xx.h> 34#include <asm/mpc8xx.h>
36#include <asm/8xx_immap.h> 35#include <asm/8xx_immap.h>
37#include <asm/commproc.h> 36#include <asm/commproc.h>
@@ -254,20 +253,6 @@ int platform_device_skip(const char *model, int id)
254 253
255static void __init mpc86xads_setup_arch(void) 254static void __init mpc86xads_setup_arch(void)
256{ 255{
257 struct device_node *cpu;
258
259 cpu = of_find_node_by_type(NULL, "cpu");
260 if (cpu != 0) {
261 const unsigned int *fp;
262
263 fp = of_get_property(cpu, "clock-frequency", NULL);
264 if (fp != 0)
265 loops_per_jiffy = *fp / HZ;
266 else
267 loops_per_jiffy = 50000000 / HZ;
268 of_node_put(cpu);
269 }
270
271 cpm_reset(); 256 cpm_reset();
272 257
273 mpc86xads_board_setup(); 258 mpc86xads_board_setup();
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index 7c31aec284c2..14db12417064 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_MPC885ADS_H__ 15#ifndef __ASM_MPC885ADS_H__
16#define __ASM_MPC885ADS_H__ 16#define __ASM_MPC885ADS_H__
17 17
18#include <asm/ppcboot.h>
19#include <sysdev/fsl_soc.h> 18#include <sysdev/fsl_soc.h>
20 19
21/* U-Boot maps BCSR to 0xff080000 */ 20/* U-Boot maps BCSR to 0xff080000 */
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 5a808d611ae3..d3da38586b04 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -32,7 +32,6 @@
32#include <asm/processor.h> 32#include <asm/processor.h>
33#include <asm/system.h> 33#include <asm/system.h>
34#include <asm/time.h> 34#include <asm/time.h>
35#include <asm/ppcboot.h>
36#include <asm/mpc8xx.h> 35#include <asm/mpc8xx.h>
37#include <asm/8xx_immap.h> 36#include <asm/8xx_immap.h>
38#include <asm/commproc.h> 37#include <asm/commproc.h>
@@ -406,20 +405,6 @@ int platform_device_skip(const char *model, int id)
406 405
407static void __init mpc885ads_setup_arch(void) 406static void __init mpc885ads_setup_arch(void)
408{ 407{
409 struct device_node *cpu;
410
411 cpu = of_find_node_by_type(NULL, "cpu");
412 if (cpu != 0) {
413 const unsigned int *fp;
414
415 fp = of_get_property(cpu, "clock-frequency", NULL);
416 if (fp != 0)
417 loops_per_jiffy = *fp / HZ;
418 else
419 loops_per_jiffy = 50000000 / HZ;
420 of_node_put(cpu);
421 }
422
423 cpm_reset(); 408 cpm_reset();
424 409
425 mpc885ads_board_setup(); 410 mpc885ads_board_setup();
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 19d4628edf79..065f3b19d6c7 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -19,6 +19,7 @@ config EMBEDDED6xx
19config PPC_82xx 19config PPC_82xx
20 bool "Freescale 82xx" 20 bool "Freescale 82xx"
21 depends on 6xx 21 depends on 6xx
22 select WANT_DEVICE_TREE
22 23
23config PPC_83xx 24config PPC_83xx
24 bool "Freescale 83xx" 25 bool "Freescale 83xx"
@@ -58,7 +59,7 @@ source "arch/powerpc/platforms/85xx/Kconfig"
58source "arch/powerpc/platforms/86xx/Kconfig" 59source "arch/powerpc/platforms/86xx/Kconfig"
59source "arch/powerpc/platforms/embedded6xx/Kconfig" 60source "arch/powerpc/platforms/embedded6xx/Kconfig"
60source "arch/powerpc/platforms/44x/Kconfig" 61source "arch/powerpc/platforms/44x/Kconfig"
61#source "arch/powerpc/platforms/4xx/Kconfig 62source "arch/powerpc/platforms/40x/Kconfig"
62 63
63config PPC_NATIVE 64config PPC_NATIVE
64 bool 65 bool
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index e4b2aee53a73..86eb4cf31f0b 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -36,10 +36,12 @@ config PPC_8xx
36 bool "Freescale 8xx" 36 bool "Freescale 8xx"
37 select FSL_SOC 37 select FSL_SOC
38 select 8xx 38 select 8xx
39 select WANT_DEVICE_TREE
39 40
40config 40x 41config 40x
41 bool "AMCC 40x" 42 bool "AMCC 40x"
42 select PPC_DCR_NATIVE 43 select PPC_DCR_NATIVE
44 select WANT_DEVICE_TREE
43 45
44config 44x 46config 44x
45 bool "AMCC 44x" 47 bool "AMCC 44x"
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index d44e832b01f2..6d9079da5f5a 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_PPC_PMAC) += powermac/
9endif 9endif
10endif 10endif
11obj-$(CONFIG_PPC_CHRP) += chrp/ 11obj-$(CONFIG_PPC_CHRP) += chrp/
12#obj-$(CONFIG_4xx) += 4xx/ 12obj-$(CONFIG_40x) += 40x/
13obj-$(CONFIG_44x) += 44x/ 13obj-$(CONFIG_44x) += 44x/
14obj-$(CONFIG_PPC_MPC52xx) += 52xx/ 14obj-$(CONFIG_PPC_MPC52xx) += 52xx/
15obj-$(CONFIG_PPC_8xx) += 8xx/ 15obj-$(CONFIG_PPC_8xx) += 8xx/
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index e9ac19c4bba4..11336b40feca 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -242,8 +242,8 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
242} 242}
243 243
244static struct pci_ops celleb_fake_pci_ops = { 244static struct pci_ops celleb_fake_pci_ops = {
245 celleb_fake_pci_read_config, 245 .read = celleb_fake_pci_read_config,
246 celleb_fake_pci_write_config 246 .write = celleb_fake_pci_write_config,
247}; 247};
248 248
249static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose, 249static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose,
@@ -288,8 +288,8 @@ static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose,
288 celleb_config_write_fake(config, PCI_COMMAND, 2, val); 288 celleb_config_write_fake(config, PCI_COMMAND, 2, val);
289} 289}
290 290
291static int __devinit celleb_setup_fake_pci_device(struct device_node *node, 291static int __init celleb_setup_fake_pci_device(struct device_node *node,
292 struct pci_controller *hose) 292 struct pci_controller *hose)
293{ 293{
294 unsigned int rlen; 294 unsigned int rlen;
295 int num_base_addr = 0; 295 int num_base_addr = 0;
@@ -418,8 +418,8 @@ error:
418 return 1; 418 return 1;
419} 419}
420 420
421static int __devinit phb_set_bus_ranges(struct device_node *dev, 421static int __init phb_set_bus_ranges(struct device_node *dev,
422 struct pci_controller *phb) 422 struct pci_controller *phb)
423{ 423{
424 const int *bus_range; 424 const int *bus_range;
425 unsigned int len; 425 unsigned int len;
@@ -434,7 +434,7 @@ static int __devinit phb_set_bus_ranges(struct device_node *dev,
434 return 0; 434 return 0;
435} 435}
436 436
437static void __devinit celleb_alloc_private_mem(struct pci_controller *hose) 437static void __init celleb_alloc_private_mem(struct pci_controller *hose)
438{ 438{
439 if (mem_init_done) 439 if (mem_init_done)
440 hose->private_data = 440 hose->private_data =
@@ -444,7 +444,7 @@ static void __devinit celleb_alloc_private_mem(struct pci_controller *hose)
444 alloc_bootmem(sizeof(struct celleb_pci_private)); 444 alloc_bootmem(sizeof(struct celleb_pci_private));
445} 445}
446 446
447int __devinit celleb_setup_phb(struct pci_controller *phb) 447int __init celleb_setup_phb(struct pci_controller *phb)
448{ 448{
449 const char *name; 449 const char *name;
450 struct device_node *dev = phb->arch_data; 450 struct device_node *dev = phb->arch_data;
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index c4b011094bd6..506fc8447554 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -278,12 +278,12 @@ static int celleb_epci_write_config(struct pci_bus *bus,
278} 278}
279 279
280struct pci_ops celleb_epci_ops = { 280struct pci_ops celleb_epci_ops = {
281 celleb_epci_read_config, 281 .read = celleb_epci_read_config,
282 celleb_epci_write_config, 282 .write = celleb_epci_write_config,
283}; 283};
284 284
285/* to be moved in FW */ 285/* to be moved in FW */
286static int __devinit celleb_epci_init(struct pci_controller *hose) 286static int __init celleb_epci_init(struct pci_controller *hose)
287{ 287{
288 u32 val; 288 u32 val;
289 volatile void __iomem *reg, *epci_base; 289 volatile void __iomem *reg, *epci_base;
@@ -403,7 +403,7 @@ static int __devinit celleb_epci_init(struct pci_controller *hose)
403 return 0; 403 return 0;
404} 404}
405 405
406int __devinit celleb_setup_epci(struct device_node *node, 406int __init celleb_setup_epci(struct device_node *node,
407 struct pci_controller *hose) 407 struct pci_controller *hose)
408{ 408{
409 struct resource r; 409 struct resource r;
diff --git a/arch/powerpc/platforms/celleb/scc_sio.c b/arch/powerpc/platforms/celleb/scc_sio.c
index bcd25f54d986..bb98735ac46f 100644
--- a/arch/powerpc/platforms/celleb/scc_sio.c
+++ b/arch/powerpc/platforms/celleb/scc_sio.c
@@ -28,18 +28,18 @@
28 28
29/* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024 29/* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024
30 mmio=0xfff000-0x1000,0xff2000-0x1000 */ 30 mmio=0xfff000-0x1000,0xff2000-0x1000 */
31static int txx9_serial_bitmap = 0; 31static int txx9_serial_bitmap __initdata = 0;
32 32
33static struct { 33static struct {
34 uint32_t offset; 34 uint32_t offset;
35 uint32_t index; 35 uint32_t index;
36} txx9_scc_tab[3] = { 36} txx9_scc_tab[3] __initdata = {
37 { 0x300, 0 }, /* 0xFFF300 */ 37 { 0x300, 0 }, /* 0xFFF300 */
38 { 0x400, 0 }, /* 0xFFF400 */ 38 { 0x400, 0 }, /* 0xFFF400 */
39 { 0x800, 1 } /* 0xFF2800 */ 39 { 0x800, 1 } /* 0xFF2800 */
40}; 40};
41 41
42static int txx9_serial_init(void) 42static int __init txx9_serial_init(void)
43{ 43{
44 extern int early_serial_txx9_setup(struct uart_port *port); 44 extern int early_serial_txx9_setup(struct uart_port *port);
45 struct device_node *node; 45 struct device_node *node;
@@ -79,7 +79,7 @@ static int txx9_serial_init(void)
79 return 0; 79 return 0;
80} 80}
81 81
82static int txx9_serial_config(char *ptr) 82static int __init txx9_serial_config(char *ptr)
83{ 83{
84 int i; 84 int i;
85 85
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 5e9f7f163571..1fca3f23533b 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -73,7 +73,7 @@ static void celleb_show_cpuinfo(struct seq_file *m)
73 of_node_put(root); 73 of_node_put(root);
74} 74}
75 75
76static int celleb_machine_type_hack(char *ptr) 76static int __init celleb_machine_type_hack(char *ptr)
77{ 77{
78 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type)); 78 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
79 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0; 79 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0;
@@ -135,7 +135,7 @@ static void celleb_kexec_cpu_down(int crash, int secondary)
135} 135}
136#endif 136#endif
137 137
138static struct of_device_id celleb_bus_ids[] = { 138static struct of_device_id celleb_bus_ids[] __initdata = {
139 { .type = "scc", }, 139 { .type = "scc", },
140 { .type = "ioif", }, /* old style */ 140 { .type = "ioif", }, /* old style */
141 {}, 141 {},
diff --git a/arch/powerpc/platforms/chrp/gg2.h b/arch/powerpc/platforms/chrp/gg2.h
new file mode 100644
index 000000000000..341ae55b99fb
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/gg2.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-ppc/gg2.h -- VLSI VAS96011/12 `Golden Gate 2' register definitions
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven
5 *
6 * This file is based on the following documentation:
7 *
8 * The VAS96011/12 Chipset, Data Book, Edition 1.0
9 * VLSI Technology, Inc.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file COPYING in the main directory of this archive
13 * for more details.
14 */
15
16#ifndef _ASMPPC_GG2_H
17#define _ASMPPC_GG2_H
18
19 /*
20 * Memory Map (CHRP mode)
21 */
22
23#define GG2_PCI_MEM_BASE 0xc0000000 /* Peripheral memory space */
24#define GG2_ISA_MEM_BASE 0xf7000000 /* Peripheral memory alias */
25#define GG2_ISA_IO_BASE 0xf8000000 /* Peripheral I/O space */
26#define GG2_PCI_CONFIG_BASE 0xfec00000 /* PCI configuration space */
27#define GG2_INT_ACK_SPECIAL 0xfec80000 /* Interrupt acknowledge and */
28 /* special PCI cycles */
29#define GG2_ROM_BASE0 0xff000000 /* ROM bank 0 */
30#define GG2_ROM_BASE1 0xff800000 /* ROM bank 1 */
31
32
33 /*
34 * GG2 specific PCI Registers
35 */
36
37extern void __iomem *gg2_pci_config_base; /* kernel virtual address */
38
39#define GG2_PCI_BUSNO 0x40 /* Bus number */
40#define GG2_PCI_SUBBUSNO 0x41 /* Subordinate bus number */
41#define GG2_PCI_DISCCTR 0x42 /* Disconnect counter */
42#define GG2_PCI_PPC_CTRL 0x50 /* PowerPC interface control register */
43#define GG2_PCI_ADDR_MAP 0x5c /* Address map */
44#define GG2_PCI_PCI_CTRL 0x60 /* PCI interface control register */
45#define GG2_PCI_ROM_CTRL 0x70 /* ROM interface control register */
46#define GG2_PCI_ROM_TIME 0x74 /* ROM timing */
47#define GG2_PCI_CC_CTRL 0x80 /* Cache controller control register */
48#define GG2_PCI_DRAM_BANK0 0x90 /* Control register for DRAM bank #0 */
49#define GG2_PCI_DRAM_BANK1 0x94 /* Control register for DRAM bank #1 */
50#define GG2_PCI_DRAM_BANK2 0x98 /* Control register for DRAM bank #2 */
51#define GG2_PCI_DRAM_BANK3 0x9c /* Control register for DRAM bank #3 */
52#define GG2_PCI_DRAM_BANK4 0xa0 /* Control register for DRAM bank #4 */
53#define GG2_PCI_DRAM_BANK5 0xa4 /* Control register for DRAM bank #5 */
54#define GG2_PCI_DRAM_TIME0 0xb0 /* Timing parameters set #0 */
55#define GG2_PCI_DRAM_TIME1 0xb4 /* Timing parameters set #1 */
56#define GG2_PCI_DRAM_CTRL 0xc0 /* DRAM control */
57#define GG2_PCI_ERR_CTRL 0xd0 /* Error control register */
58#define GG2_PCI_ERR_STATUS 0xd4 /* Error status register */
59 /* Cleared when read */
60
61#endif /* _ASMPPC_GG2_H */
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 28d1647b204e..e43465d34d29 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -13,7 +13,6 @@
13#include <asm/irq.h> 13#include <asm/irq.h>
14#include <asm/hydra.h> 14#include <asm/hydra.h>
15#include <asm/prom.h> 15#include <asm/prom.h>
16#include <asm/gg2.h>
17#include <asm/machdep.h> 16#include <asm/machdep.h>
18#include <asm/sections.h> 17#include <asm/sections.h>
19#include <asm/pci-bridge.h> 18#include <asm/pci-bridge.h>
@@ -21,6 +20,7 @@
21#include <asm/rtas.h> 20#include <asm/rtas.h>
22 21
23#include "chrp.h" 22#include "chrp.h"
23#include "gg2.h"
24 24
25/* LongTrail */ 25/* LongTrail */
26void __iomem *gg2_pci_config_base; 26void __iomem *gg2_pci_config_base;
@@ -86,8 +86,8 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
86 86
87static struct pci_ops gg2_pci_ops = 87static struct pci_ops gg2_pci_ops =
88{ 88{
89 gg2_read_config, 89 .read = gg2_read_config,
90 gg2_write_config 90 .write = gg2_write_config,
91}; 91};
92 92
93/* 93/*
@@ -124,8 +124,8 @@ int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
124 124
125static struct pci_ops rtas_pci_ops = 125static struct pci_ops rtas_pci_ops =
126{ 126{
127 rtas_read_config, 127 .read = rtas_read_config,
128 rtas_write_config 128 .write = rtas_write_config,
129}; 129};
130 130
131volatile struct Hydra __iomem *Hydra = NULL; 131volatile struct Hydra __iomem *Hydra = NULL;
@@ -338,3 +338,32 @@ void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
338} 338}
339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, 339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
340 chrp_pci_fixup_winbond_ata); 340 chrp_pci_fixup_winbond_ata);
341
342/* Pegasos2 firmware version 20040810 configures the built-in IDE controller
343 * in legacy mode, but sets the PCI registers to PCI native mode.
344 * The chip can only operate in legacy mode, so force the PCI class into legacy
345 * mode as well. The same fixup must be done to the class-code property in
346 * the IDE node /pci@80000000/ide@C,1
347 */
348static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
349{
350 u8 progif;
351 struct pci_dev *viaisa;
352
353 if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos)
354 return;
355 if (viaide->irq != 14)
356 return;
357
358 viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
359 if (!viaisa)
360 return;
361 printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id);
362
363 pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
364 pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
365 viaide->class &= ~0x5;
366
367 pci_dev_put(viaisa);
368}
369DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 373de4c063db..96498ad7b943 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -32,13 +32,11 @@
32#include <linux/seq_file.h> 32#include <linux/seq_file.h>
33#include <linux/root_dev.h> 33#include <linux/root_dev.h>
34#include <linux/initrd.h> 34#include <linux/initrd.h>
35#include <linux/module.h>
36#include <linux/timer.h> 35#include <linux/timer.h>
37 36
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <asm/prom.h> 39#include <asm/prom.h>
41#include <asm/gg2.h>
42#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
43#include <asm/dma.h> 41#include <asm/dma.h>
44#include <asm/machdep.h> 42#include <asm/machdep.h>
@@ -52,6 +50,7 @@
52#include <asm/xmon.h> 50#include <asm/xmon.h>
53 51
54#include "chrp.h" 52#include "chrp.h"
53#include "gg2.h"
55 54
56void rtas_indicator_progress(char *, unsigned short); 55void rtas_indicator_progress(char *, unsigned short);
57 56
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index 3ea0eb78568e..10a4a4d063b6 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -26,10 +26,8 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/residual.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/machdep.h> 30#include <asm/machdep.h>
32#include <asm/smp.h>
33#include <asm/mpic.h> 31#include <asm/mpic.h>
34#include <asm/rtas.h> 32#include <asm/rtas.h>
35 33
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index 6292e36dc577..b6de2b5223dd 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -113,23 +113,11 @@ static void holly_remap_bridge(void)
113 113
114static void __init holly_setup_arch(void) 114static void __init holly_setup_arch(void)
115{ 115{
116 struct device_node *cpu;
117 struct device_node *np; 116 struct device_node *np;
118 117
119 if (ppc_md.progress) 118 if (ppc_md.progress)
120 ppc_md.progress("holly_setup_arch():set_bridge", 0); 119 ppc_md.progress("holly_setup_arch():set_bridge", 0);
121 120
122 cpu = of_find_node_by_type(NULL, "cpu");
123 if (cpu) {
124 const unsigned int *fp;
125
126 fp = of_get_property(cpu, "clock-frequency", NULL);
127 if (fp)
128 loops_per_jiffy = *fp / HZ;
129 else
130 loops_per_jiffy = 50000000 / HZ;
131 of_node_put(cpu);
132 }
133 tsi108_csr_vir_base = get_vir_csrbase(); 121 tsi108_csr_vir_base = get_vir_csrbase();
134 122
135 /* setup PCI host bridge */ 123 /* setup PCI host bridge */
@@ -147,7 +135,7 @@ static void __init holly_setup_arch(void)
147} 135}
148 136
149/* 137/*
150 * Interrupt setup and service. Interrrupts on the holly come 138 * Interrupt setup and service. Interrupts on the holly come
151 * from the four external INT pins, PCI interrupts are routed via 139 * from the four external INT pins, PCI interrupts are routed via
152 * PCI interrupt control registers, it generates internal IRQ23 140 * PCI interrupt control registers, it generates internal IRQ23
153 * 141 *
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index bd5ca58345a1..61ca02c2d644 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -18,9 +18,10 @@
18#include <asm/time.h> 18#include <asm/time.h>
19#include <asm/prom.h> 19#include <asm/prom.h>
20#include <asm/mpic.h> 20#include <asm/mpic.h>
21#include <asm/mpc10x.h>
22#include <asm/pci-bridge.h> 21#include <asm/pci-bridge.h>
23 22
23#include "mpc10x.h"
24
24static struct mtd_partition linkstation_physmap_partitions[] = { 25static struct mtd_partition linkstation_physmap_partitions[] = {
25 { 26 {
26 .name = "mtd_firmimg", 27 .name = "mtd_firmimg",
@@ -99,7 +100,7 @@ static void __init linkstation_setup_arch(void)
99} 100}
100 101
101/* 102/*
102 * Interrupt setup and service. Interrrupts on the linkstation come 103 * Interrupt setup and service. Interrupts on the linkstation come
103 * from the four PCI slots plus onboard 8241 devices: I2C, DUART. 104 * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
104 */ 105 */
105static void __init linkstation_init_IRQ(void) 106static void __init linkstation_init_IRQ(void)
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index d0bee9f19e4e..0d9f1500a671 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -4,11 +4,11 @@
4#include <linux/serial_reg.h> 4#include <linux/serial_reg.h>
5#include <linux/serial_8250.h> 5#include <linux/serial_8250.h>
6#include <asm/io.h> 6#include <asm/io.h>
7#include <asm/mpc10x.h>
8#include <asm/ppc_sys.h>
9#include <asm/prom.h> 7#include <asm/prom.h>
10#include <asm/termbits.h> 8#include <asm/termbits.h>
11 9
10#include "mpc10x.h"
11
12static void __iomem *avr_addr; 12static void __iomem *avr_addr;
13static unsigned long avr_clock; 13static unsigned long avr_clock;
14 14
diff --git a/arch/powerpc/platforms/embedded6xx/mpc10x.h b/arch/powerpc/platforms/embedded6xx/mpc10x.h
new file mode 100644
index 000000000000..b30a6a3b5bd2
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/mpc10x.h
@@ -0,0 +1,180 @@
1/*
2 * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem
3 * ctlr/EPIC/etc.
4 *
5 * Author: Mark A. Greer
6 * mgreer@mvista.com
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PPC_KERNEL_MPC10X_H
14#define __PPC_KERNEL_MPC10X_H
15
16#include <linux/pci_ids.h>
17#include <asm/pci-bridge.h>
18
19/*
20 * The values here don't completely map everything but should work in most
21 * cases.
22 *
23 * MAP A (PReP Map)
24 * Processor: 0x80000000 - 0x807fffff -> PCI I/O: 0x00000000 - 0x007fffff
25 * Processor: 0xc0000000 - 0xdfffffff -> PCI MEM: 0x00000000 - 0x1fffffff
26 * PCI MEM: 0x80000000 -> Processor System Memory: 0x00000000
27 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
28 *
29 * MAP B (CHRP Map)
30 * Processor: 0xfe000000 - 0xfebfffff -> PCI I/O: 0x00000000 - 0x00bfffff
31 * Processor: 0x80000000 - 0xbfffffff -> PCI MEM: 0x80000000 - 0xbfffffff
32 * PCI MEM: 0x00000000 -> Processor System Memory: 0x00000000
33 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
34 */
35
36/*
37 * Define the vendor/device IDs for the various bridges--should be added to
38 * <linux/pci_ids.h>
39 */
40#define MPC10X_BRIDGE_106 ((PCI_DEVICE_ID_MOTOROLA_MPC106 << 16) | \
41 PCI_VENDOR_ID_MOTOROLA)
42#define MPC10X_BRIDGE_8240 ((0x0003 << 16) | PCI_VENDOR_ID_MOTOROLA)
43#define MPC10X_BRIDGE_107 ((0x0004 << 16) | PCI_VENDOR_ID_MOTOROLA)
44#define MPC10X_BRIDGE_8245 ((0x0006 << 16) | PCI_VENDOR_ID_MOTOROLA)
45
46/* Define the type of map to use */
47#define MPC10X_MEM_MAP_A 1
48#define MPC10X_MEM_MAP_B 2
49
50/* Map A (PReP Map) Defines */
51#define MPC10X_MAPA_CNFG_ADDR 0x80000cf8
52#define MPC10X_MAPA_CNFG_DATA 0x80000cfc
53
54#define MPC10X_MAPA_ISA_IO_BASE 0x80000000
55#define MPC10X_MAPA_ISA_MEM_BASE 0xc0000000
56#define MPC10X_MAPA_DRAM_OFFSET 0x80000000
57
58#define MPC10X_MAPA_PCI_INTACK_ADDR 0xbffffff0
59#define MPC10X_MAPA_PCI_IO_START 0x00000000
60#define MPC10X_MAPA_PCI_IO_END (0x00800000 - 1)
61#define MPC10X_MAPA_PCI_MEM_START 0x00000000
62#define MPC10X_MAPA_PCI_MEM_END (0x20000000 - 1)
63
64#define MPC10X_MAPA_PCI_MEM_OFFSET (MPC10X_MAPA_ISA_MEM_BASE - \
65 MPC10X_MAPA_PCI_MEM_START)
66
67/* Map B (CHRP Map) Defines */
68#define MPC10X_MAPB_CNFG_ADDR 0xfec00000
69#define MPC10X_MAPB_CNFG_DATA 0xfee00000
70
71#define MPC10X_MAPB_ISA_IO_BASE 0xfe000000
72#define MPC10X_MAPB_ISA_MEM_BASE 0x80000000
73#define MPC10X_MAPB_DRAM_OFFSET 0x00000000
74
75#define MPC10X_MAPB_PCI_INTACK_ADDR 0xfef00000
76#define MPC10X_MAPB_PCI_IO_START 0x00000000
77#define MPC10X_MAPB_PCI_IO_END (0x00c00000 - 1)
78#define MPC10X_MAPB_PCI_MEM_START 0x80000000
79#define MPC10X_MAPB_PCI_MEM_END (0xc0000000 - 1)
80
81#define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \
82 MPC10X_MAPB_PCI_MEM_START)
83
84/* Set hose members to values appropriate for the mem map used */
85#define MPC10X_SETUP_HOSE(hose, map) { \
86 (hose)->pci_mem_offset = MPC10X_MAP##map##_PCI_MEM_OFFSET; \
87 (hose)->io_space.start = MPC10X_MAP##map##_PCI_IO_START; \
88 (hose)->io_space.end = MPC10X_MAP##map##_PCI_IO_END; \
89 (hose)->mem_space.start = MPC10X_MAP##map##_PCI_MEM_START; \
90 (hose)->mem_space.end = MPC10X_MAP##map##_PCI_MEM_END; \
91 (hose)->io_base_virt = (void *)MPC10X_MAP##map##_ISA_IO_BASE; \
92}
93
94
95/* Miscellaneous Configuration register offsets */
96#define MPC10X_CFG_PIR_REG 0x09
97#define MPC10X_CFG_PIR_HOST_BRIDGE 0x00
98#define MPC10X_CFG_PIR_AGENT 0x01
99
100#define MPC10X_CFG_EUMBBAR 0x78
101
102#define MPC10X_CFG_PICR1_REG 0xa8
103#define MPC10X_CFG_PICR1_ADDR_MAP_MASK 0x00010000
104#define MPC10X_CFG_PICR1_ADDR_MAP_A 0x00010000
105#define MPC10X_CFG_PICR1_ADDR_MAP_B 0x00000000
106#define MPC10X_CFG_PICR1_SPEC_PCI_RD 0x00000004
107#define MPC10X_CFG_PICR1_ST_GATH_EN 0x00000040
108
109#define MPC10X_CFG_PICR2_REG 0xac
110#define MPC10X_CFG_PICR2_COPYBACK_OPT 0x00000001
111
112#define MPC10X_CFG_MAPB_OPTIONS_REG 0xe0
113#define MPC10X_CFG_MAPB_OPTIONS_CFAE 0x80 /* CPU_FD_ALIAS_EN */
114#define MPC10X_CFG_MAPB_OPTIONS_PFAE 0x40 /* PCI_FD_ALIAS_EN */
115#define MPC10X_CFG_MAPB_OPTIONS_DR 0x20 /* DLL_RESET */
116#define MPC10X_CFG_MAPB_OPTIONS_PCICH 0x08 /* PCI_COMPATIBILITY_HOLE */
117#define MPC10X_CFG_MAPB_OPTIONS_PROCCH 0x04 /* PROC_COMPATIBILITY_HOLE */
118
119/* Define offsets for the memory controller registers in the config space */
120#define MPC10X_MCTLR_MEM_START_1 0x80 /* Banks 0-3 */
121#define MPC10X_MCTLR_MEM_START_2 0x84 /* Banks 4-7 */
122#define MPC10X_MCTLR_EXT_MEM_START_1 0x88 /* Banks 0-3 */
123#define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */
124
125#define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */
126#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */
127#define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */
128#define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */
129
130#define MPC10X_MCTLR_MEM_BANK_ENABLES 0xa0
131
132/* Define some offset in the EUMB */
133#define MPC10X_EUMB_SIZE 0x00100000 /* Total EUMB size (1MB) */
134
135#define MPC10X_EUMB_MU_OFFSET 0x00000000 /* Msg Unit reg offset */
136#define MPC10X_EUMB_MU_SIZE 0x00001000 /* Msg Unit reg size */
137#define MPC10X_EUMB_DMA_OFFSET 0x00001000 /* DMA Unit reg offset */
138#define MPC10X_EUMB_DMA_SIZE 0x00001000 /* DMA Unit reg size */
139#define MPC10X_EUMB_ATU_OFFSET 0x00002000 /* Addr xlate reg offset */
140#define MPC10X_EUMB_ATU_SIZE 0x00001000 /* Addr xlate reg size */
141#define MPC10X_EUMB_I2C_OFFSET 0x00003000 /* I2C Unit reg offset */
142#define MPC10X_EUMB_I2C_SIZE 0x00001000 /* I2C Unit reg size */
143#define MPC10X_EUMB_DUART_OFFSET 0x00004000 /* DUART Unit reg offset (8245) */
144#define MPC10X_EUMB_DUART_SIZE 0x00001000 /* DUART Unit reg size (8245) */
145#define MPC10X_EUMB_EPIC_OFFSET 0x00040000 /* EPIC offset in EUMB */
146#define MPC10X_EUMB_EPIC_SIZE 0x00030000 /* EPIC size */
147#define MPC10X_EUMB_PM_OFFSET 0x000fe000 /* Performance Monitor reg offset (8245) */
148#define MPC10X_EUMB_PM_SIZE 0x00001000 /* Performance Monitor reg size (8245) */
149#define MPC10X_EUMB_WP_OFFSET 0x000ff000 /* Data path diagnostic, watchpoint reg offset */
150#define MPC10X_EUMB_WP_SIZE 0x00001000 /* Data path diagnostic, watchpoint reg size */
151
152/*
153 * Define some recommended places to put the EUMB regs.
154 * For both maps, recommend putting the EUMB from 0xeff00000 to 0xefffffff.
155 */
156extern unsigned long ioremap_base;
157#define MPC10X_MAPA_EUMB_BASE (ioremap_base - MPC10X_EUMB_SIZE)
158#define MPC10X_MAPB_EUMB_BASE MPC10X_MAPA_EUMB_BASE
159
160enum ppc_sys_devices {
161 MPC10X_IIC1,
162 MPC10X_DMA0,
163 MPC10X_DMA1,
164 MPC10X_UART0,
165 MPC10X_UART1,
166 NUM_PPC_SYS_DEVS,
167};
168
169int mpc10x_bridge_init(struct pci_controller *hose,
170 uint current_map,
171 uint new_map,
172 uint phys_eumb_base);
173unsigned long mpc10x_get_mem_size(uint mem_map);
174int mpc10x_enable_store_gathering(struct pci_controller *hose);
175int mpc10x_disable_store_gathering(struct pci_controller *hose);
176
177/* For MPC107 boards that use the built-in openpic */
178void mpc10x_set_openpic(void);
179
180#endif /* __PPC_KERNEL_MPC10X_H */
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 1e3cc69487b5..96737e5608d3 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -40,7 +40,6 @@
40#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
41#include <asm/reg.h> 41#include <asm/reg.h>
42#include <mm/mmu_decl.h> 42#include <mm/mmu_decl.h>
43#include "mpc7448_hpc2.h"
44#include <asm/tsi108_pci.h> 43#include <asm/tsi108_pci.h>
45#include <asm/tsi108_irq.h> 44#include <asm/tsi108_irq.h>
46#include <asm/mpic.h> 45#include <asm/mpic.h>
@@ -91,7 +90,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
91} 90}
92 91
93/* 92/*
94 * Interrupt setup and service. Interrrupts on the mpc7448_hpc2 come 93 * Interrupt setup and service. Interrupts on the mpc7448_hpc2 come
95 * from the four external INT pins, PCI interrupts are routed via 94 * from the four external INT pins, PCI interrupts are routed via
96 * PCI interrupt control registers, it generates internal IRQ23 95 * PCI interrupt control registers, it generates internal IRQ23
97 * 96 *
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h
deleted file mode 100644
index f7e0e0c7f8d8..000000000000
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * mpc7448_hpc2.h
3 *
4 * Definitions for Freescale MPC7448_HPC2 platform
5 *
6 * Author: Jacob Pan
7 * jacob.pan@freescale.com
8 * Maintainer: Roy Zang <roy.zang@freescale.com>
9 *
10 * 2006 (c) Freescale Semiconductor, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#ifndef __PPC_PLATFORMS_MPC7448_HPC2_H
17#define __PPC_PLATFORMS_MPC7448_HPC2_H
18
19#include <asm/ppcboot.h>
20
21#endif /* __PPC_PLATFORMS_MPC7448_HPC2_H */
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index 53420951dc53..54675648d6de 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -44,7 +44,6 @@ static void __init prpmc2800_setup_arch(void)
44 struct device_node *np; 44 struct device_node *np;
45 phys_addr_t paddr; 45 phys_addr_t paddr;
46 const unsigned int *reg; 46 const unsigned int *reg;
47 const unsigned int *prop;
48 47
49 /* 48 /*
50 * ioremap mpp and gpp registers in case they are later 49 * ioremap mpp and gpp registers in case they are later
@@ -62,12 +61,6 @@ static void __init prpmc2800_setup_arch(void)
62 of_node_put(np); 61 of_node_put(np);
63 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]); 62 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
64 63
65 np = of_find_node_by_type(NULL, "cpu");
66 prop = of_get_property(np, "clock-frequency", NULL);
67 if (prop)
68 loops_per_jiffy = *prop / HZ;
69 of_node_put(np);
70
71#ifdef CONFIG_PCI 64#ifdef CONFIG_PCI
72 mv64x60_pci_init(); 65 mv64x60_pci_init();
73#endif 66#endif
diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile
index 13ac3015d91c..60db509638f1 100644
--- a/arch/powerpc/platforms/iseries/Makefile
+++ b/arch/powerpc/platforms/iseries/Makefile
@@ -2,6 +2,7 @@ EXTRA_CFLAGS += -mno-minimal-toc
2 2
3extra-y += dt.o 3extra-y += dt.o
4 4
5obj-y += exception.o
5obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \ 6obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
6 hvcall.o proc.o htab.o iommu.o misc.o irq.o 7 hvcall.o proc.o htab.o iommu.o misc.o irq.o
7obj-$(CONFIG_PCI) += pci.o vpdinfo.o 8obj-$(CONFIG_PCI) += pci.o vpdinfo.o
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
new file mode 100644
index 000000000000..5381038f0881
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -0,0 +1,251 @@
1/*
2 * Low level routines for legacy iSeries support.
3 *
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27
28#include <asm/reg.h>
29#include <asm/ppc_asm.h>
30#include <asm/asm-offsets.h>
31#include <asm/thread_info.h>
32#include <asm/ptrace.h>
33#include <asm/cputable.h>
34
35#include "exception.h"
36
37 .text
38
39 .globl system_reset_iSeries
40system_reset_iSeries:
41 mfspr r13,SPRN_SPRG3 /* Get paca address */
42 mfmsr r24
43 ori r24,r24,MSR_RI
44 mtmsrd r24 /* RI on */
45 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
46 cmpwi 0,r24,0 /* Are we processor 0? */
47 bne 1f
48 b .__start_initialization_iSeries /* Start up the first processor */
491: mfspr r4,SPRN_CTRLF
50 li r5,CTRL_RUNLATCH /* Turn off the run light */
51 andc r4,r4,r5
52 mtspr SPRN_CTRLT,r4
53
541:
55 HMT_LOW
56#ifdef CONFIG_SMP
57 lbz r23,PACAPROCSTART(r13) /* Test if this processor
58 * should start */
59 sync
60 LOAD_REG_IMMEDIATE(r3,current_set)
61 sldi r28,r24,3 /* get current_set[cpu#] */
62 ldx r3,r3,r28
63 addi r1,r3,THREAD_SIZE
64 subi r1,r1,STACK_FRAME_OVERHEAD
65
66 cmpwi 0,r23,0
67 beq iSeries_secondary_smp_loop /* Loop until told to go */
68 b __secondary_start /* Loop until told to go */
69iSeries_secondary_smp_loop:
70 /* Let the Hypervisor know we are alive */
71 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
72 lis r3,0x8002
73 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
74#else /* CONFIG_SMP */
75 /* Yield the processor. This is required for non-SMP kernels
76 which are running on multi-threaded machines. */
77 lis r3,0x8000
78 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
79 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
80 li r4,0 /* "yield timed" */
81 li r5,-1 /* "yield forever" */
82#endif /* CONFIG_SMP */
83 li r0,-1 /* r0=-1 indicates a Hypervisor call */
84 sc /* Invoke the hypervisor via a system call */
85 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
86 b 1b /* If SMP not configured, secondaries
87 * loop forever */
88
89/*** ISeries-LPAR interrupt handlers ***/
90
91 STD_EXCEPTION_ISERIES(machine_check, PACA_EXMC)
92
93 .globl data_access_iSeries
94data_access_iSeries:
95 mtspr SPRN_SPRG1,r13
96BEGIN_FTR_SECTION
97 mtspr SPRN_SPRG2,r12
98 mfspr r13,SPRN_DAR
99 mfspr r12,SPRN_DSISR
100 srdi r13,r13,60
101 rlwimi r13,r12,16,0x20
102 mfcr r12
103 cmpwi r13,0x2c
104 beq .do_stab_bolted_iSeries
105 mtcrf 0x80,r12
106 mfspr r12,SPRN_SPRG2
107END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
108 EXCEPTION_PROLOG_1(PACA_EXGEN)
109 EXCEPTION_PROLOG_ISERIES_1
110 b data_access_common
111
112.do_stab_bolted_iSeries:
113 mtcrf 0x80,r12
114 mfspr r12,SPRN_SPRG2
115 EXCEPTION_PROLOG_1(PACA_EXSLB)
116 EXCEPTION_PROLOG_ISERIES_1
117 b .do_stab_bolted
118
119 .globl data_access_slb_iSeries
120data_access_slb_iSeries:
121 mtspr SPRN_SPRG1,r13 /* save r13 */
122 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
123 std r3,PACA_EXSLB+EX_R3(r13)
124 mfspr r3,SPRN_DAR
125 std r9,PACA_EXSLB+EX_R9(r13)
126 mfcr r9
127#ifdef __DISABLED__
128 cmpdi r3,0
129 bge slb_miss_user_iseries
130#endif
131 std r10,PACA_EXSLB+EX_R10(r13)
132 std r11,PACA_EXSLB+EX_R11(r13)
133 std r12,PACA_EXSLB+EX_R12(r13)
134 mfspr r10,SPRN_SPRG1
135 std r10,PACA_EXSLB+EX_R13(r13)
136 ld r12,PACALPPACAPTR(r13)
137 ld r12,LPPACASRR1(r12)
138 b .slb_miss_realmode
139
140 STD_EXCEPTION_ISERIES(instruction_access, PACA_EXGEN)
141
142 .globl instruction_access_slb_iSeries
143instruction_access_slb_iSeries:
144 mtspr SPRN_SPRG1,r13 /* save r13 */
145 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
146 std r3,PACA_EXSLB+EX_R3(r13)
147 ld r3,PACALPPACAPTR(r13)
148 ld r3,LPPACASRR0(r3) /* get SRR0 value */
149 std r9,PACA_EXSLB+EX_R9(r13)
150 mfcr r9
151#ifdef __DISABLED__
152 cmpdi r3,0
153 bge slb_miss_user_iseries
154#endif
155 std r10,PACA_EXSLB+EX_R10(r13)
156 std r11,PACA_EXSLB+EX_R11(r13)
157 std r12,PACA_EXSLB+EX_R12(r13)
158 mfspr r10,SPRN_SPRG1
159 std r10,PACA_EXSLB+EX_R13(r13)
160 ld r12,PACALPPACAPTR(r13)
161 ld r12,LPPACASRR1(r12)
162 b .slb_miss_realmode
163
164#ifdef __DISABLED__
165slb_miss_user_iseries:
166 std r10,PACA_EXGEN+EX_R10(r13)
167 std r11,PACA_EXGEN+EX_R11(r13)
168 std r12,PACA_EXGEN+EX_R12(r13)
169 mfspr r10,SPRG1
170 ld r11,PACA_EXSLB+EX_R9(r13)
171 ld r12,PACA_EXSLB+EX_R3(r13)
172 std r10,PACA_EXGEN+EX_R13(r13)
173 std r11,PACA_EXGEN+EX_R9(r13)
174 std r12,PACA_EXGEN+EX_R3(r13)
175 EXCEPTION_PROLOG_ISERIES_1
176 b slb_miss_user_common
177#endif
178
179 MASKABLE_EXCEPTION_ISERIES(hardware_interrupt)
180 STD_EXCEPTION_ISERIES(alignment, PACA_EXGEN)
181 STD_EXCEPTION_ISERIES(program_check, PACA_EXGEN)
182 STD_EXCEPTION_ISERIES(fp_unavailable, PACA_EXGEN)
183 MASKABLE_EXCEPTION_ISERIES(decrementer)
184 STD_EXCEPTION_ISERIES(trap_0a, PACA_EXGEN)
185 STD_EXCEPTION_ISERIES(trap_0b, PACA_EXGEN)
186
187 .globl system_call_iSeries
188system_call_iSeries:
189 mr r9,r13
190 mfspr r13,SPRN_SPRG3
191 EXCEPTION_PROLOG_ISERIES_1
192 b system_call_common
193
194 STD_EXCEPTION_ISERIES(single_step, PACA_EXGEN)
195 STD_EXCEPTION_ISERIES(trap_0e, PACA_EXGEN)
196 STD_EXCEPTION_ISERIES(performance_monitor, PACA_EXGEN)
197
198decrementer_iSeries_masked:
199 /* We may not have a valid TOC pointer in here. */
200 li r11,1
201 ld r12,PACALPPACAPTR(r13)
202 stb r11,LPPACADECRINT(r12)
203 LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
204 lwz r12,0(r12)
205 mtspr SPRN_DEC,r12
206 /* fall through */
207
208hardware_interrupt_iSeries_masked:
209 mtcrf 0x80,r9 /* Restore regs */
210 ld r12,PACALPPACAPTR(r13)
211 ld r11,LPPACASRR0(r12)
212 ld r12,LPPACASRR1(r12)
213 mtspr SPRN_SRR0,r11
214 mtspr SPRN_SRR1,r12
215 ld r9,PACA_EXGEN+EX_R9(r13)
216 ld r10,PACA_EXGEN+EX_R10(r13)
217 ld r11,PACA_EXGEN+EX_R11(r13)
218 ld r12,PACA_EXGEN+EX_R12(r13)
219 ld r13,PACA_EXGEN+EX_R13(r13)
220 rfid
221 b . /* prevent speculative execution */
222
223_INIT_STATIC(__start_initialization_iSeries)
224 /* Clear out the BSS */
225 LOAD_REG_IMMEDIATE(r11,__bss_stop)
226 LOAD_REG_IMMEDIATE(r8,__bss_start)
227 sub r11,r11,r8 /* bss size */
228 addi r11,r11,7 /* round up to an even double word */
229 rldicl. r11,r11,61,3 /* shift right by 3 */
230 beq 4f
231 addi r8,r8,-8
232 li r0,0
233 mtctr r11 /* zero this many doublewords */
2343: stdu r0,8(r8)
235 bdnz 3b
2364:
237 LOAD_REG_IMMEDIATE(r1,init_thread_union)
238 addi r1,r1,THREAD_SIZE
239 li r0,0
240 stdu r0,-STACK_FRAME_OVERHEAD(r1)
241
242 LOAD_REG_IMMEDIATE(r2,__toc_start)
243 addi r2,r2,0x4000
244 addi r2,r2,0x4000
245
246 bl .iSeries_early_setup
247 bl .early_setup
248
249 /* relocation is on at this point */
250
251 b .start_here_common
diff --git a/arch/powerpc/platforms/iseries/exception.h b/arch/powerpc/platforms/iseries/exception.h
new file mode 100644
index 000000000000..ced45a8fa1aa
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/exception.h
@@ -0,0 +1,58 @@
1#ifndef _ASM_POWERPC_ISERIES_EXCEPTION_H
2#define _ASM_POWERPC_ISERIES_EXCEPTION_H
3/*
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27#include <asm/exception.h>
28
29#define EXCEPTION_PROLOG_ISERIES_1 \
30 mfmsr r10; \
31 ld r12,PACALPPACAPTR(r13); \
32 ld r11,LPPACASRR0(r12); \
33 ld r12,LPPACASRR1(r12); \
34 ori r10,r10,MSR_RI; \
35 mtmsrd r10,1
36
37#define STD_EXCEPTION_ISERIES(label, area) \
38 .globl label##_iSeries; \
39label##_iSeries: \
40 HMT_MEDIUM; \
41 mtspr SPRN_SPRG1,r13; /* save r13 */ \
42 EXCEPTION_PROLOG_1(area); \
43 EXCEPTION_PROLOG_ISERIES_1; \
44 b label##_common
45
46#define MASKABLE_EXCEPTION_ISERIES(label) \
47 .globl label##_iSeries; \
48label##_iSeries: \
49 HMT_MEDIUM; \
50 mtspr SPRN_SPRG1,r13; /* save r13 */ \
51 EXCEPTION_PROLOG_1(PACA_EXGEN); \
52 lbz r10,PACASOFTIRQEN(r13); \
53 cmpwi 0,r10,0; \
54 beq- label##_iSeries_masked; \
55 EXCEPTION_PROLOG_ISERIES_1; \
56 b label##_common; \
57
58#endif /* _ASM_POWERPC_ISERIES_EXCEPTION_H */
diff --git a/arch/powerpc/platforms/iseries/it_lp_naca.h b/arch/powerpc/platforms/iseries/it_lp_naca.h
index 9bbf58986819..cf6dcf6ef07b 100644
--- a/arch/powerpc/platforms/iseries/it_lp_naca.h
+++ b/arch/powerpc/platforms/iseries/it_lp_naca.h
@@ -60,7 +60,7 @@ struct ItLpNaca {
60 u8 xRsvd2_0[128]; // Reserved x00-x7F 60 u8 xRsvd2_0[128]; // Reserved x00-x7F
61 61
62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators 62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators
63// NB: Padding required to keep xInterrruptHdlr at x300 which is required 63// NB: Padding required to keep xInterruptHdlr at x300 which is required
64// for v4r4 PLIC. 64// for v4r4 PLIC.
65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F 65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F
66 u8 xRsvd3_0[384]; // Reserved 180-2FF 66 u8 xRsvd3_0[384]; // Reserved 180-2FF
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 13a8b1908ded..fad493e29d37 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/paca.h> 42#include <asm/paca.h>
43#include <asm/cache.h> 43#include <asm/cache.h>
44#include <asm/sections.h>
45#include <asm/abs_addr.h> 44#include <asm/abs_addr.h>
46#include <asm/iseries/hv_lp_config.h> 45#include <asm/iseries/hv_lp_config.h>
47#include <asm/iseries/hv_call_event.h> 46#include <asm/iseries/hv_call_event.h>
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 2542403288f9..771ed0cf29a5 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -169,15 +169,12 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
169 switch (len) { 169 switch (len) {
170 case 1: 170 case 1:
171 out_8(addr, val); 171 out_8(addr, val);
172 (void) in_8(addr);
173 break; 172 break;
174 case 2: 173 case 2:
175 out_le16(addr, val); 174 out_le16(addr, val);
176 (void) in_le16(addr);
177 break; 175 break;
178 default: 176 default:
179 out_le32(addr, val); 177 out_le32(addr, val);
180 (void) in_le32(addr);
181 break; 178 break;
182 } 179 }
183 return PCIBIOS_SUCCESSFUL; 180 return PCIBIOS_SUCCESSFUL;
@@ -185,8 +182,8 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
185 182
186static struct pci_ops u3_agp_pci_ops = 183static struct pci_ops u3_agp_pci_ops =
187{ 184{
188 u3_agp_read_config, 185 .read = u3_agp_read_config,
189 u3_agp_write_config 186 .write = u3_agp_write_config,
190}; 187};
191 188
192static unsigned long u3_ht_cfa0(u8 devfn, u8 off) 189static unsigned long u3_ht_cfa0(u8 devfn, u8 off)
@@ -268,15 +265,12 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
268 switch (len) { 265 switch (len) {
269 case 1: 266 case 1:
270 out_8(addr, val); 267 out_8(addr, val);
271 (void) in_8(addr);
272 break; 268 break;
273 case 2: 269 case 2:
274 out_le16(addr, val); 270 out_le16(addr, val);
275 (void) in_le16(addr);
276 break; 271 break;
277 default: 272 default:
278 out_le32(addr, val); 273 out_le32(addr, val);
279 (void) in_le32(addr);
280 break; 274 break;
281 } 275 }
282 return PCIBIOS_SUCCESSFUL; 276 return PCIBIOS_SUCCESSFUL;
@@ -284,8 +278,8 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
284 278
285static struct pci_ops u3_ht_pci_ops = 279static struct pci_ops u3_ht_pci_ops =
286{ 280{
287 u3_ht_read_config, 281 .read = u3_ht_read_config,
288 u3_ht_write_config 282 .write = u3_ht_write_config,
289}; 283};
290 284
291static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off) 285static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off)
@@ -376,15 +370,12 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
376 switch (len) { 370 switch (len) {
377 case 1: 371 case 1:
378 out_8(addr, val); 372 out_8(addr, val);
379 (void) in_8(addr);
380 break; 373 break;
381 case 2: 374 case 2:
382 out_le16(addr, val); 375 out_le16(addr, val);
383 (void) in_le16(addr);
384 break; 376 break;
385 default: 377 default:
386 out_le32(addr, val); 378 out_le32(addr, val);
387 (void) in_le32(addr);
388 break; 379 break;
389 } 380 }
390 return PCIBIOS_SUCCESSFUL; 381 return PCIBIOS_SUCCESSFUL;
@@ -392,8 +383,8 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
392 383
393static struct pci_ops u4_pcie_pci_ops = 384static struct pci_ops u4_pcie_pci_ops =
394{ 385{
395 u4_pcie_read_config, 386 .read = u4_pcie_read_config,
396 u4_pcie_write_config 387 .write = u4_pcie_write_config,
397}; 388};
398 389
399static void __init setup_u3_agp(struct pci_controller* hose) 390static void __init setup_u3_agp(struct pci_controller* hose)
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
index 9014d55c717b..6c42787fb382 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -187,7 +187,7 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)
187static void pci_dma_bus_setup_null(struct pci_bus *b) { } 187static void pci_dma_bus_setup_null(struct pci_bus *b) { }
188static void pci_dma_dev_setup_null(struct pci_dev *d) { } 188static void pci_dma_dev_setup_null(struct pci_dev *d) { }
189 189
190int iob_init(struct device_node *dn) 190int __init iob_init(struct device_node *dn)
191{ 191{
192 unsigned long tmp; 192 unsigned long tmp;
193 u32 regword; 193 u32 regword;
@@ -233,7 +233,7 @@ int iob_init(struct device_node *dn)
233 233
234 234
235/* These are called very early. */ 235/* These are called very early. */
236void iommu_init_early_pasemi(void) 236void __init iommu_init_early_pasemi(void)
237{ 237{
238 int iommu_off; 238 int iommu_off;
239 239
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index ab1f5f62bcd8..03d1d07aa2ac 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -107,23 +107,20 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn,
107 switch (len) { 107 switch (len) {
108 case 1: 108 case 1:
109 out_8(addr, val); 109 out_8(addr, val);
110 (void) in_8(addr);
111 break; 110 break;
112 case 2: 111 case 2:
113 out_le16(addr, val); 112 out_le16(addr, val);
114 (void) in_le16(addr);
115 break; 113 break;
116 default: 114 default:
117 out_le32(addr, val); 115 out_le32(addr, val);
118 (void) in_le32(addr);
119 break; 116 break;
120 } 117 }
121 return PCIBIOS_SUCCESSFUL; 118 return PCIBIOS_SUCCESSFUL;
122} 119}
123 120
124static struct pci_ops pa_pxp_ops = { 121static struct pci_ops pa_pxp_ops = {
125 pa_pxp_read_config, 122 .read = pa_pxp_read_config,
126 pa_pxp_write_config, 123 .write = pa_pxp_write_config,
127}; 124};
128 125
129static void __init setup_pa_pxp(struct pci_controller *hose) 126static void __init setup_pa_pxp(struct pci_controller *hose)
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index ffe6528048b5..05def6282f83 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -50,26 +50,30 @@ static void pas_restart(char *cmd)
50 50
51#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
52static DEFINE_SPINLOCK(timebase_lock); 52static DEFINE_SPINLOCK(timebase_lock);
53static unsigned long timebase;
53 54
54static void __devinit pas_give_timebase(void) 55static void __devinit pas_give_timebase(void)
55{ 56{
56 unsigned long tb;
57
58 spin_lock(&timebase_lock); 57 spin_lock(&timebase_lock);
59 mtspr(SPRN_TBCTL, TBCTL_FREEZE); 58 mtspr(SPRN_TBCTL, TBCTL_FREEZE);
60 tb = mftb(); 59 isync();
61 mtspr(SPRN_TBCTL, TBCTL_UPDATE_LOWER | (tb & 0xffffffff)); 60 timebase = get_tb();
62 mtspr(SPRN_TBCTL, TBCTL_UPDATE_UPPER | (tb >> 32));
63 mtspr(SPRN_TBCTL, TBCTL_RESTART);
64 spin_unlock(&timebase_lock); 61 spin_unlock(&timebase_lock);
65 pr_debug("pas_give_timebase: cpu %d gave tb %lx\n", 62
66 smp_processor_id(), tb); 63 while (timebase)
64 barrier();
65 mtspr(SPRN_TBCTL, TBCTL_RESTART);
67} 66}
68 67
69static void __devinit pas_take_timebase(void) 68static void __devinit pas_take_timebase(void)
70{ 69{
71 pr_debug("pas_take_timebase: cpu %d has tb %lx\n", 70 while (!timebase)
72 smp_processor_id(), mftb()); 71 smp_rmb();
72
73 spin_lock(&timebase_lock);
74 set_tb(timebase >> 32, timebase & 0xffffffff);
75 timebase = 0;
76 spin_unlock(&timebase_lock);
73} 77}
74 78
75struct smp_ops_t pas_smp_ops = { 79struct smp_ops_t pas_smp_ops = {
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 9d73d0234c5d..cf660916ae0b 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -17,7 +17,6 @@
17#include <asm/prom.h> 17#include <asm/prom.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/bootx.h> 19#include <asm/bootx.h>
20#include <asm/bootinfo.h>
21#include <asm/btext.h> 20#include <asm/btext.h>
22#include <asm/io.h> 21#include <asm/io.h>
23 22
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index efdf5eb81ecc..da2007e3db0e 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -40,7 +40,6 @@
40#include <linux/completion.h> 40#include <linux/completion.h>
41#include <linux/platform_device.h> 41#include <linux/platform_device.h>
42#include <linux/interrupt.h> 42#include <linux/interrupt.h>
43#include <linux/completion.h>
44#include <linux/timer.h> 43#include <linux/timer.h>
45#include <linux/mutex.h> 44#include <linux/mutex.h>
46#include <asm/keylargo.h> 45#include <asm/keylargo.h>
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 92586db19754..ec49099830d5 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -209,15 +209,12 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
209 switch (len) { 209 switch (len) {
210 case 1: 210 case 1:
211 out_8(addr, val); 211 out_8(addr, val);
212 (void) in_8(addr);
213 break; 212 break;
214 case 2: 213 case 2:
215 out_le16(addr, val); 214 out_le16(addr, val);
216 (void) in_le16(addr);
217 break; 215 break;
218 default: 216 default:
219 out_le32(addr, val); 217 out_le32(addr, val);
220 (void) in_le32(addr);
221 break; 218 break;
222 } 219 }
223 return PCIBIOS_SUCCESSFUL; 220 return PCIBIOS_SUCCESSFUL;
@@ -225,8 +222,8 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
225 222
226static struct pci_ops macrisc_pci_ops = 223static struct pci_ops macrisc_pci_ops =
227{ 224{
228 macrisc_read_config, 225 .read = macrisc_read_config,
229 macrisc_write_config 226 .write = macrisc_write_config,
230}; 227};
231 228
232#ifdef CONFIG_PPC32 229#ifdef CONFIG_PPC32
@@ -280,8 +277,8 @@ chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
280 277
281static struct pci_ops chaos_pci_ops = 278static struct pci_ops chaos_pci_ops =
282{ 279{
283 chaos_read_config, 280 .read = chaos_read_config,
284 chaos_write_config 281 .write = chaos_write_config,
285}; 282};
286 283
287static void __init setup_chaos(struct pci_controller *hose, 284static void __init setup_chaos(struct pci_controller *hose,
@@ -440,15 +437,12 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
440 switch (len) { 437 switch (len) {
441 case 1: 438 case 1:
442 out_8(addr, val); 439 out_8(addr, val);
443 (void) in_8(addr);
444 break; 440 break;
445 case 2: 441 case 2:
446 out_le16(addr, val); 442 out_le16(addr, val);
447 (void) in_le16(addr);
448 break; 443 break;
449 default: 444 default:
450 out_le32((u32 __iomem *)addr, val); 445 out_le32((u32 __iomem *)addr, val);
451 (void) in_le32(addr);
452 break; 446 break;
453 } 447 }
454 return PCIBIOS_SUCCESSFUL; 448 return PCIBIOS_SUCCESSFUL;
@@ -456,8 +450,8 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
456 450
457static struct pci_ops u3_ht_pci_ops = 451static struct pci_ops u3_ht_pci_ops =
458{ 452{
459 u3_ht_read_config, 453 .read = u3_ht_read_config,
460 u3_ht_write_config 454 .write = u3_ht_write_config,
461}; 455};
462 456
463#define U4_PCIE_CFA0(devfn, off) \ 457#define U4_PCIE_CFA0(devfn, off) \
@@ -545,15 +539,12 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
545 switch (len) { 539 switch (len) {
546 case 1: 540 case 1:
547 out_8(addr, val); 541 out_8(addr, val);
548 (void) in_8(addr);
549 break; 542 break;
550 case 2: 543 case 2:
551 out_le16(addr, val); 544 out_le16(addr, val);
552 (void) in_le16(addr);
553 break; 545 break;
554 default: 546 default:
555 out_le32(addr, val); 547 out_le32(addr, val);
556 (void) in_le32(addr);
557 break; 548 break;
558 } 549 }
559 return PCIBIOS_SUCCESSFUL; 550 return PCIBIOS_SUCCESSFUL;
@@ -561,8 +552,8 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
561 552
562static struct pci_ops u4_pcie_pci_ops = 553static struct pci_ops u4_pcie_pci_ops =
563{ 554{
564 u4_pcie_read_config, 555 .read = u4_pcie_read_config,
565 u4_pcie_write_config 556 .write = u4_pcie_write_config,
566}; 557};
567 558
568#endif /* CONFIG_PPC64 */ 559#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index 6e090a7dea83..fcde070f7054 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -22,9 +22,6 @@ extern void pmac_read_rtc_time(void);
22extern void pmac_calibrate_decr(void); 22extern void pmac_calibrate_decr(void);
23extern void pmac_pci_irq_fixup(struct pci_dev *); 23extern void pmac_pci_irq_fixup(struct pci_dev *);
24extern void pmac_pci_init(void); 24extern void pmac_pci_init(void);
25extern unsigned long pmac_ide_get_base(int index);
26extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
27 unsigned long data_port, unsigned long ctrl_port, int *irq);
28 25
29extern void pmac_nvram_update(void); 26extern void pmac_nvram_update(void);
30extern unsigned char pmac_nvram_read_byte(int addr); 27extern unsigned char pmac_nvram_read_byte(int addr);
@@ -33,7 +30,6 @@ extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
33extern void pmac_pcibios_after_init(void); 30extern void pmac_pcibios_after_init(void);
34extern int of_show_percpuinfo(struct seq_file *m, int i); 31extern int of_show_percpuinfo(struct seq_file *m, int i);
35 32
36extern void pmac_pci_init(void);
37extern void pmac_setup_pci_dma(void); 33extern void pmac_setup_pci_dma(void);
38extern void pmac_check_ht_link(void); 34extern void pmac_check_ht_link(void);
39 35
diff --git a/arch/powerpc/platforms/powermac/udbg_adb.c b/arch/powerpc/platforms/powermac/udbg_adb.c
index 6124e59e1038..44e0b55a2a02 100644
--- a/arch/powerpc/platforms/powermac/udbg_adb.c
+++ b/arch/powerpc/platforms/powermac/udbg_adb.c
@@ -12,7 +12,6 @@
12#include <asm/xmon.h> 12#include <asm/xmon.h>
13#include <asm/prom.h> 13#include <asm/prom.h>
14#include <asm/bootx.h> 14#include <asm/bootx.h>
15#include <asm/machdep.h>
16#include <asm/errno.h> 15#include <asm/errno.h>
17#include <asm/pmac_feature.h> 16#include <asm/pmac_feature.h>
18#include <asm/processor.h> 17#include <asm/processor.h>
@@ -150,7 +149,7 @@ static void udbg_adb_putc(char c)
150 return udbg_adb_old_putc(c); 149 return udbg_adb_old_putc(c);
151} 150}
152 151
153void udbg_adb_init_early(void) 152void __init udbg_adb_init_early(void)
154{ 153{
155#ifdef CONFIG_BOOTX_TEXT 154#ifdef CONFIG_BOOTX_TEXT
156 if (btext_find_display(1) == 0) { 155 if (btext_find_display(1) == 0) {
@@ -160,7 +159,7 @@ void udbg_adb_init_early(void)
160#endif 159#endif
161} 160}
162 161
163int udbg_adb_init(int force_btext) 162int __init udbg_adb_init(int force_btext)
164{ 163{
165 struct device_node *np; 164 struct device_node *np;
166 165
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index b8770395013d..b242c6c34f81 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -169,6 +169,8 @@ static void rtas_slot_error_detail(struct pci_dn *pdn, int severity,
169 */ 169 */
170static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) 170static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
171{ 171{
172 struct device_node *dn;
173 struct pci_dev *dev = pdn->pcidev;
172 u32 cfg; 174 u32 cfg;
173 int cap, i; 175 int cap, i;
174 int n = 0; 176 int n = 0;
@@ -184,6 +186,17 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
184 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); 186 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg);
185 printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); 187 printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg);
186 188
189 /* Gather bridge-specific registers */
190 if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
191 rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg);
192 n += scnprintf(buf+n, len-n, "sec stat:%x\n", cfg);
193 printk(KERN_WARNING "EEH: Bridge secondary status: %04x\n", cfg);
194
195 rtas_read_config(pdn, PCI_BRIDGE_CONTROL, 2, &cfg);
196 n += scnprintf(buf+n, len-n, "brdg ctl:%x\n", cfg);
197 printk(KERN_WARNING "EEH: Bridge control: %04x\n", cfg);
198 }
199
187 /* Dump out the PCI-X command and status regs */ 200 /* Dump out the PCI-X command and status regs */
188 cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX); 201 cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX);
189 if (cap) { 202 if (cap) {
@@ -209,7 +222,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
209 printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); 222 printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg);
210 } 223 }
211 224
212 cap = pci_find_ext_capability(pdn->pcidev,PCI_EXT_CAP_ID_ERR); 225 cap = pci_find_ext_capability(pdn->pcidev, PCI_EXT_CAP_ID_ERR);
213 if (cap) { 226 if (cap) {
214 n += scnprintf(buf+n, len-n, "pci-e AER:\n"); 227 n += scnprintf(buf+n, len-n, "pci-e AER:\n");
215 printk(KERN_WARNING 228 printk(KERN_WARNING
@@ -222,6 +235,18 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
222 } 235 }
223 } 236 }
224 } 237 }
238
239 /* Gather status on devices under the bridge */
240 if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
241 dn = pdn->node->child;
242 while (dn) {
243 pdn = PCI_DN(dn);
244 if (pdn)
245 n += gather_pci_data(pdn, buf+n, len-n);
246 dn = dn->sibling;
247 }
248 }
249
225 return n; 250 return n;
226} 251}
227 252
@@ -750,12 +775,12 @@ int rtas_set_slot_reset(struct pci_dn *pdn)
750 return 0; 775 return 0;
751 776
752 if (rc < 0) { 777 if (rc < 0) {
753 printk (KERN_ERR "EEH: unrecoverable slot failure %s\n", 778 printk(KERN_ERR "EEH: unrecoverable slot failure %s\n",
754 pdn->node->full_name); 779 pdn->node->full_name);
755 return -1; 780 return -1;
756 } 781 }
757 printk (KERN_ERR "EEH: bus reset %d failed on slot %s\n", 782 printk(KERN_ERR "EEH: bus reset %d failed on slot %s, rc=%d\n",
758 i+1, pdn->node->full_name); 783 i+1, pdn->node->full_name, rc);
759 } 784 }
760 785
761 return -1; 786 return -1;
@@ -944,23 +969,6 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
944 } 969 }
945 pdn->class_code = *class_code; 970 pdn->class_code = *class_code;
946 971
947 /*
948 * Now decide if we are going to "Disable" EEH checking
949 * for this device. We still run with the EEH hardware active,
950 * but we won't be checking for ff's. This means a driver
951 * could return bad data (very bad!), an interrupt handler could
952 * hang waiting on status bits that won't change, etc.
953 * But there are a few cases like display devices that make sense.
954 */
955 enable = 1; /* i.e. we will do checking */
956#if 0
957 if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY)
958 enable = 0;
959#endif
960
961 if (!enable)
962 pdn->eeh_mode |= EEH_MODE_NOCHECK;
963
964 /* Ok... see if this device supports EEH. Some do, some don't, 972 /* Ok... see if this device supports EEH. Some do, some don't,
965 * and the only way to find out is to check each and every one. */ 973 * and the only way to find out is to check each and every one. */
966 regs = of_get_property(dn, "reg", NULL); 974 regs = of_get_property(dn, "reg", NULL);
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c
index e49c815eae23..1e83fcd0df31 100644
--- a/arch/powerpc/platforms/pseries/eeh_cache.c
+++ b/arch/powerpc/platforms/pseries/eeh_cache.c
@@ -225,6 +225,10 @@ void pci_addr_cache_insert_device(struct pci_dev *dev)
225{ 225{
226 unsigned long flags; 226 unsigned long flags;
227 227
228 /* Ignore PCI bridges */
229 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
230 return;
231
228 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags); 232 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
229 __pci_addr_cache_insert_device(dev); 233 __pci_addr_cache_insert_device(dev);
230 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags); 234 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
@@ -285,16 +289,13 @@ void __init pci_addr_cache_build(void)
285 spin_lock_init(&pci_io_addr_cache_root.piar_lock); 289 spin_lock_init(&pci_io_addr_cache_root.piar_lock);
286 290
287 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 291 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
288 /* Ignore PCI bridges */
289 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
290 continue;
291 292
292 pci_addr_cache_insert_device(dev); 293 pci_addr_cache_insert_device(dev);
293 294
294 dn = pci_device_to_OF_node(dev); 295 dn = pci_device_to_OF_node(dev);
295 if (!dn) 296 if (!dn)
296 continue; 297 continue;
297 pci_dev_get (dev); /* matching put is in eeh_remove_device() */ 298 pci_dev_get(dev); /* matching put is in eeh_remove_device() */
298 PCI_DN(dn)->pcidev = dev; 299 PCI_DN(dn)->pcidev = dev;
299 300
300 eeh_sysfs_add_device(dev); 301 eeh_sysfs_add_device(dev);
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8cc6eeeaae2f..ea327ca345c6 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -35,7 +35,6 @@
35#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
36#include <asm/tlb.h> 36#include <asm/tlb.h>
37#include <asm/prom.h> 37#include <asm/prom.h>
38#include <asm/abs_addr.h>
39#include <asm/cputable.h> 38#include <asm/cputable.h>
40#include <asm/udbg.h> 39#include <asm/udbg.h>
41#include <asm/smp.h> 40#include <asm/smp.h>
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index 9797b10b2935..30925d29bcea 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -44,15 +44,19 @@ static unsigned long rtas_log_start;
44static unsigned long rtas_log_size; 44static unsigned long rtas_log_size;
45 45
46static int surveillance_timeout = -1; 46static int surveillance_timeout = -1;
47static unsigned int rtas_event_scan_rate;
48static unsigned int rtas_error_log_max; 47static unsigned int rtas_error_log_max;
49static unsigned int rtas_error_log_buffer_max; 48static unsigned int rtas_error_log_buffer_max;
50 49
50/* RTAS service tokens */
51static unsigned int event_scan;
52static unsigned int rtas_event_scan_rate;
53
51static int full_rtas_msgs = 0; 54static int full_rtas_msgs = 0;
52 55
53extern int no_logging; 56/* Stop logging to nvram after first fatal error */
57static int no_more_logging;
54 58
55volatile int error_log_cnt = 0; 59static int error_log_cnt;
56 60
57/* 61/*
58 * Since we use 32 bit RTAS, the physical address of this must be below 62 * Since we use 32 bit RTAS, the physical address of this must be below
@@ -61,8 +65,6 @@ volatile int error_log_cnt = 0;
61 */ 65 */
62static unsigned char logdata[RTAS_ERROR_LOG_MAX]; 66static unsigned char logdata[RTAS_ERROR_LOG_MAX];
63 67
64static int get_eventscan_parms(void);
65
66static char *rtas_type[] = { 68static char *rtas_type[] = {
67 "Unknown", "Retry", "TCE Error", "Internal Device Failure", 69 "Unknown", "Retry", "TCE Error", "Internal Device Failure",
68 "Timeout", "Data Parity", "Address Parity", "Cache Parity", 70 "Timeout", "Data Parity", "Address Parity", "Cache Parity",
@@ -166,9 +168,9 @@ static int log_rtas_len(char * buf)
166 len += err->extended_log_length; 168 len += err->extended_log_length;
167 } 169 }
168 170
169 if (rtas_error_log_max == 0) { 171 if (rtas_error_log_max == 0)
170 get_eventscan_parms(); 172 rtas_error_log_max = rtas_get_error_log_max();
171 } 173
172 if (len > rtas_error_log_max) 174 if (len > rtas_error_log_max)
173 len = rtas_error_log_max; 175 len = rtas_error_log_max;
174 176
@@ -215,8 +217,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
215 } 217 }
216 218
217 /* Write error to NVRAM */ 219 /* Write error to NVRAM */
218 if (!no_logging && !(err_type & ERR_FLAG_BOOT)) 220 if (!no_more_logging && !(err_type & ERR_FLAG_BOOT))
219 nvram_write_error_log(buf, len, err_type); 221 nvram_write_error_log(buf, len, err_type, error_log_cnt);
220 222
221 /* 223 /*
222 * rtas errors can occur during boot, and we do want to capture 224 * rtas errors can occur during boot, and we do want to capture
@@ -227,8 +229,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
227 printk_log_rtas(buf, len); 229 printk_log_rtas(buf, len);
228 230
229 /* Check to see if we need to or have stopped logging */ 231 /* Check to see if we need to or have stopped logging */
230 if (fatal || no_logging) { 232 if (fatal || no_more_logging) {
231 no_logging = 1; 233 no_more_logging = 1;
232 spin_unlock_irqrestore(&rtasd_log_lock, s); 234 spin_unlock_irqrestore(&rtasd_log_lock, s);
233 return; 235 return;
234 } 236 }
@@ -300,7 +302,7 @@ static ssize_t rtas_log_read(struct file * file, char __user * buf,
300 302
301 spin_lock_irqsave(&rtasd_log_lock, s); 303 spin_lock_irqsave(&rtasd_log_lock, s);
302 /* if it's 0, then we know we got the last one (the one in NVRAM) */ 304 /* if it's 0, then we know we got the last one (the one in NVRAM) */
303 if (rtas_log_size == 0 && !no_logging) 305 if (rtas_log_size == 0 && !no_more_logging)
304 nvram_clear_error_log(); 306 nvram_clear_error_log();
305 spin_unlock_irqrestore(&rtasd_log_lock, s); 307 spin_unlock_irqrestore(&rtasd_log_lock, s);
306 308
@@ -356,32 +358,7 @@ static int enable_surveillance(int timeout)
356 return -1; 358 return -1;
357} 359}
358 360
359static int get_eventscan_parms(void) 361static void do_event_scan(void)
360{
361 struct device_node *node;
362 const int *ip;
363
364 node = of_find_node_by_path("/rtas");
365
366 ip = of_get_property(node, "rtas-event-scan-rate", NULL);
367 if (ip == NULL) {
368 printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
369 of_node_put(node);
370 return -1;
371 }
372 rtas_event_scan_rate = *ip;
373 DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
374
375 /* Make room for the sequence number */
376 rtas_error_log_max = rtas_get_error_log_max();
377 rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
378
379 of_node_put(node);
380
381 return 0;
382}
383
384static void do_event_scan(int event_scan)
385{ 362{
386 int error; 363 int error;
387 do { 364 do {
@@ -408,7 +385,7 @@ static void do_event_scan_all_cpus(long delay)
408 cpu = first_cpu(cpu_online_map); 385 cpu = first_cpu(cpu_online_map);
409 for (;;) { 386 for (;;) {
410 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 387 set_cpus_allowed(current, cpumask_of_cpu(cpu));
411 do_event_scan(rtas_token("event-scan")); 388 do_event_scan();
412 set_cpus_allowed(current, CPU_MASK_ALL); 389 set_cpus_allowed(current, CPU_MASK_ALL);
413 390
414 /* Drop hotplug lock, and sleep for the specified delay */ 391 /* Drop hotplug lock, and sleep for the specified delay */
@@ -426,31 +403,17 @@ static void do_event_scan_all_cpus(long delay)
426static int rtasd(void *unused) 403static int rtasd(void *unused)
427{ 404{
428 unsigned int err_type; 405 unsigned int err_type;
429 int event_scan = rtas_token("event-scan");
430 int rc; 406 int rc;
431 407
432 daemonize("rtasd"); 408 daemonize("rtasd");
433 409
434 if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1)
435 goto error;
436
437 rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
438 if (!rtas_log_buf) {
439 printk(KERN_ERR "rtasd: no memory\n");
440 goto error;
441 }
442
443 printk(KERN_DEBUG "RTAS daemon started\n"); 410 printk(KERN_DEBUG "RTAS daemon started\n");
444
445 DEBUG("will sleep for %d milliseconds\n", (30000/rtas_event_scan_rate)); 411 DEBUG("will sleep for %d milliseconds\n", (30000/rtas_event_scan_rate));
446 412
447 /* See if we have any error stored in NVRAM */ 413 /* See if we have any error stored in NVRAM */
448 memset(logdata, 0, rtas_error_log_max); 414 memset(logdata, 0, rtas_error_log_max);
449 415 rc = nvram_read_error_log(logdata, rtas_error_log_max,
450 rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type); 416 &err_type, &error_log_cnt);
451
452 /* We can use rtas_log_buf now */
453 no_logging = 0;
454 417
455 if (!rc) { 418 if (!rc) {
456 if (err_type != ERR_FLAG_ALREADY_LOGGED) { 419 if (err_type != ERR_FLAG_ALREADY_LOGGED) {
@@ -473,8 +436,6 @@ static int rtasd(void *unused)
473 for (;;) 436 for (;;)
474 do_event_scan_all_cpus(30000/rtas_event_scan_rate); 437 do_event_scan_all_cpus(30000/rtas_event_scan_rate);
475 438
476error:
477 /* Should delete proc entries */
478 return -EINVAL; 439 return -EINVAL;
479} 440}
480 441
@@ -486,11 +447,28 @@ static int __init rtas_init(void)
486 return 0; 447 return 0;
487 448
488 /* No RTAS */ 449 /* No RTAS */
489 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { 450 event_scan = rtas_token("event-scan");
451 if (event_scan == RTAS_UNKNOWN_SERVICE) {
490 printk(KERN_DEBUG "rtasd: no event-scan on system\n"); 452 printk(KERN_DEBUG "rtasd: no event-scan on system\n");
491 return -ENODEV; 453 return -ENODEV;
492 } 454 }
493 455
456 rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
457 if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
458 printk(KERN_ERR "rtasd: no rtas-event-scan-rate on system\n");
459 return -ENODEV;
460 }
461
462 /* Make room for the sequence number */
463 rtas_error_log_max = rtas_get_error_log_max();
464 rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
465
466 rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
467 if (!rtas_log_buf) {
468 printk(KERN_ERR "rtasd: no memory\n");
469 return -ENOMEM;
470 }
471
494 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL); 472 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL);
495 if (entry) 473 if (entry)
496 entry->proc_fops = &proc_rtas_log_operations; 474 entry->proc_fops = &proc_rtas_log_operations;
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 4f67b89ba1d0..e8e79f83d198 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -45,10 +45,10 @@
45#define CPM_MAP_SIZE (0x4000) 45#define CPM_MAP_SIZE (0x4000)
46 46
47static void m8xx_cpm_dpinit(void); 47static void m8xx_cpm_dpinit(void);
48static uint host_buffer; /* One page of host buffer */ 48static uint host_buffer; /* One page of host buffer */
49static uint host_end; /* end + 1 */ 49static uint host_end; /* end + 1 */
50cpm8xx_t *cpmp; /* Pointer to comm processor space */ 50cpm8xx_t *cpmp; /* Pointer to comm processor space */
51cpic8xx_t *cpic_reg; 51cpic8xx_t *cpic_reg;
52 52
53static struct device_node *cpm_pic_node; 53static struct device_node *cpm_pic_node;
54static struct irq_host *cpm_pic_host; 54static struct irq_host *cpm_pic_host;
@@ -115,7 +115,7 @@ static int cpm_pic_host_map(struct irq_host *h, unsigned int virq,
115 * and return. This is a no-op function so we don't need any special 115 * and return. This is a no-op function so we don't need any special
116 * tests in the interrupt handler. 116 * tests in the interrupt handler.
117 */ 117 */
118static irqreturn_t cpm_error_interrupt(int irq, void *dev) 118static irqreturn_t cpm_error_interrupt(int irq, void *dev)
119{ 119{
120 return IRQ_HANDLED; 120 return IRQ_HANDLED;
121} 121}
@@ -181,7 +181,7 @@ unsigned int cpm_pic_init(void)
181 printk(KERN_ERR "CPM PIC init: can not find cpm node\n"); 181 printk(KERN_ERR "CPM PIC init: can not find cpm node\n");
182 goto end; 182 goto end;
183 } 183 }
184 eirq= irq_of_parse_and_map(np, 0); 184 eirq = irq_of_parse_and_map(np, 0);
185 if (eirq == NO_IRQ) 185 if (eirq == NO_IRQ)
186 goto end; 186 goto end;
187 187
@@ -197,15 +197,15 @@ end:
197 197
198void cpm_reset(void) 198void cpm_reset(void)
199{ 199{
200 cpm8xx_t *commproc; 200 cpm8xx_t *commproc;
201 sysconf8xx_t *siu_conf; 201 sysconf8xx_t *siu_conf;
202 202
203 commproc = (cpm8xx_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); 203 commproc = (cpm8xx_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
204 204
205#ifdef CONFIG_UCODE_PATCH 205#ifdef CONFIG_UCODE_PATCH
206 /* Perform a reset. 206 /* Perform a reset.
207 */ 207 */
208 out_be16(&commproc->cp_cpcr, CPM_CR_RST | CPM_CR_FLG); 208 out_be16(&commproc->cp_cpcr, CPM_CR_RST | CPM_CR_FLG);
209 209
210 /* Wait for it. 210 /* Wait for it.
211 */ 211 */
@@ -307,7 +307,7 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
307static rh_info_t cpm_dpmem_info; 307static rh_info_t cpm_dpmem_info;
308 308
309#define CPM_DPMEM_ALIGNMENT 8 309#define CPM_DPMEM_ALIGNMENT 8
310static u8* dpram_vbase; 310static u8 *dpram_vbase;
311static uint dpram_pbase; 311static uint dpram_pbase;
312 312
313void m8xx_cpm_dpinit(void) 313void m8xx_cpm_dpinit(void)
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index c827715a5090..3bf89b324760 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -201,7 +201,7 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode)
201 } 201 }
202 202
203 if (mode == CPM_CLK_RX) 203 if (mode == CPM_CLK_RX)
204 shift +=3; 204 shift += 3;
205 205
206 for (i=0; i<24; i++) { 206 for (i=0; i<24; i++) {
207 if (clk_map[i][0] == target && clk_map[i][1] == clock) { 207 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index a1d2042bb304..e0e24b01e3a6 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -204,7 +204,7 @@ static void dart_free(struct iommu_table *tbl, long index, long npages)
204} 204}
205 205
206 206
207static int dart_init(struct device_node *dart_node) 207static int __init dart_init(struct device_node *dart_node)
208{ 208{
209 unsigned int i; 209 unsigned int i;
210 unsigned long tmp, base, size; 210 unsigned long tmp, base, size;
@@ -313,7 +313,7 @@ static void pci_dma_bus_setup_dart(struct pci_bus *bus)
313 PCI_DN(dn)->iommu_table = &iommu_table_dart; 313 PCI_DN(dn)->iommu_table = &iommu_table_dart;
314} 314}
315 315
316void iommu_init_early_dart(void) 316void __init iommu_init_early_dart(void)
317{ 317{
318 struct device_node *dn; 318 struct device_node *dn;
319 319
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index 574b6ef44e0b..e82d54de8a8d 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -33,6 +33,7 @@ unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
33 33
34 return dr[index * 2]; 34 return dr[index * 2];
35} 35}
36EXPORT_SYMBOL_GPL(dcr_resource_start);
36 37
37unsigned int dcr_resource_len(struct device_node *np, unsigned int index) 38unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
38{ 39{
@@ -44,6 +45,7 @@ unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
44 45
45 return dr[index * 2 + 1]; 46 return dr[index * 2 + 1];
46} 47}
48EXPORT_SYMBOL_GPL(dcr_resource_len);
47 49
48#ifndef CONFIG_PPC_DCR_NATIVE 50#ifndef CONFIG_PPC_DCR_NATIVE
49 51
@@ -122,6 +124,7 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
122 ret.token -= dcr_n * ret.stride; 124 ret.token -= dcr_n * ret.stride;
123 return ret; 125 return ret;
124} 126}
127EXPORT_SYMBOL_GPL(dcr_map);
125 128
126void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c) 129void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c)
127{ 130{
@@ -133,5 +136,6 @@ void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c)
133 iounmap(h.token); 136 iounmap(h.token);
134 h.token = NULL; 137 h.token = NULL;
135} 138}
139EXPORT_SYMBOL_GPL(dcr_unmap);
136 140
137#endif /* !defined(CONFIG_PPC_DCR_NATIVE) */ 141#endif /* !defined(CONFIG_PPC_DCR_NATIVE) */
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 1cf29c9d4408..f3abce11bead 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -321,21 +321,26 @@ static struct i2c_driver_device i2c_devices[] __initdata = {
321 {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",}, 321 {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
322}; 322};
323 323
324static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info) 324static int __init of_find_i2c_driver(struct device_node *node,
325 struct i2c_board_info *info)
325{ 326{
326 int i; 327 int i;
327 328
328 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { 329 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
329 if (!of_device_is_compatible(node, i2c_devices[i].of_device)) 330 if (!of_device_is_compatible(node, i2c_devices[i].of_device))
330 continue; 331 continue;
331 strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN); 332 if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
332 strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE); 333 KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
334 strlcpy(info->type, i2c_devices[i].i2c_type,
335 I2C_NAME_SIZE) >= I2C_NAME_SIZE)
336 return -ENOMEM;
333 return 0; 337 return 0;
334 } 338 }
335 return -ENODEV; 339 return -ENODEV;
336} 340}
337 341
338static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num) 342static void __init of_register_i2c_devices(struct device_node *adap_node,
343 int bus_num)
339{ 344{
340 struct device_node *node = NULL; 345 struct device_node *node = NULL;
341 346
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index 5294560c7b00..b5d068204aa3 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -144,8 +144,8 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
144 144
145static struct pci_ops indirect_pci_ops = 145static struct pci_ops indirect_pci_ops =
146{ 146{
147 indirect_read_config, 147 .read = indirect_read_config,
148 indirect_write_config 148 .write = indirect_write_config,
149}; 149};
150 150
151void __init 151void __init
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 90db8a720fed..cf0bfbd73401 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -193,8 +193,8 @@ void tsi108_clear_pci_cfg_error(void)
193} 193}
194 194
195static struct pci_ops tsi108_direct_pci_ops = { 195static struct pci_ops tsi108_direct_pci_ops = {
196 tsi108_direct_read_config, 196 .read = tsi108_direct_read_config,
197 tsi108_direct_write_config 197 .write = tsi108_direct_write_config,
198}; 198};
199 199
200int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary) 200int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary)
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 89059895a20d..47180b3fca56 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -24,6 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/kernel_stat.h>
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/io.h> 29#include <asm/io.h>
29#include <asm/prom.h> 30#include <asm/prom.h>
@@ -142,7 +143,7 @@ static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
142 143
143 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); 144 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
144 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; 145 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
145 if (trigger) 146 if (!trigger)
146 desc->status |= IRQ_LEVEL; 147 desc->status |= IRQ_LEVEL;
147 148
148 spin_unlock_irqrestore(&uic->lock, flags); 149 spin_unlock_irqrestore(&uic->lock, flags);
@@ -159,6 +160,64 @@ static struct irq_chip uic_irq_chip = {
159 .set_type = uic_set_irq_type, 160 .set_type = uic_set_irq_type,
160}; 161};
161 162
163/**
164 * handle_uic_irq - irq flow handler for UIC
165 * @irq: the interrupt number
166 * @desc: the interrupt description structure for this irq
167 *
168 * This is modified version of the generic handle_level_irq() suitable
169 * for the UIC. On the UIC, acking (i.e. clearing the SR bit) a level
170 * irq will have no effect if the interrupt is still asserted by the
171 * device, even if the interrupt is already masked. Therefore, unlike
172 * the standard handle_level_irq(), we must ack the interrupt *after*
173 * invoking the ISR (which should have de-asserted the interrupt in
174 * the external source). For edge interrupts we ack at the beginning
175 * instead of the end, to keep the window in which we can miss an
176 * interrupt as small as possible.
177 */
178void fastcall handle_uic_irq(unsigned int irq, struct irq_desc *desc)
179{
180 unsigned int cpu = smp_processor_id();
181 struct irqaction *action;
182 irqreturn_t action_ret;
183
184 spin_lock(&desc->lock);
185 if (desc->status & IRQ_LEVEL)
186 desc->chip->mask(irq);
187 else
188 desc->chip->mask_ack(irq);
189
190 if (unlikely(desc->status & IRQ_INPROGRESS))
191 goto out_unlock;
192 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
193 kstat_cpu(cpu).irqs[irq]++;
194
195 /*
196 * If its disabled or no action available
197 * keep it masked and get out of here
198 */
199 action = desc->action;
200 if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
201 desc->status |= IRQ_PENDING;
202 goto out_unlock;
203 }
204
205 desc->status |= IRQ_INPROGRESS;
206 desc->status &= ~IRQ_PENDING;
207 spin_unlock(&desc->lock);
208
209 action_ret = handle_IRQ_event(irq, action);
210
211 spin_lock(&desc->lock);
212 desc->status &= ~IRQ_INPROGRESS;
213 if (desc->status & IRQ_LEVEL)
214 desc->chip->ack(irq);
215 if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
216 desc->chip->unmask(irq);
217out_unlock:
218 spin_unlock(&desc->lock);
219}
220
162static int uic_host_match(struct irq_host *h, struct device_node *node) 221static int uic_host_match(struct irq_host *h, struct device_node *node)
163{ 222{
164 struct uic *uic = h->host_data; 223 struct uic *uic = h->host_data;
@@ -173,7 +232,7 @@ static int uic_host_map(struct irq_host *h, unsigned int virq,
173 set_irq_chip_data(virq, uic); 232 set_irq_chip_data(virq, uic);
174 /* Despite the name, handle_level_irq() works for both level 233 /* Despite the name, handle_level_irq() works for both level
175 * and edge irqs on UIC. FIXME: check this is correct */ 234 * and edge irqs on UIC. FIXME: check this is correct */
176 set_irq_chip_and_handler(virq, &uic_irq_chip, handle_level_irq); 235 set_irq_chip_and_handler(virq, &uic_irq_chip, handle_uic_irq);
177 236
178 /* Set default irq type */ 237 /* Set default irq type */
179 set_irq_type(virq, IRQ_TYPE_NONE); 238 set_irq_type(virq, IRQ_TYPE_NONE);
@@ -207,6 +266,9 @@ irqreturn_t uic_cascade(int virq, void *data)
207 int subvirq; 266 int subvirq;
208 267
209 msr = mfdcr(uic->dcrbase + UIC_MSR); 268 msr = mfdcr(uic->dcrbase + UIC_MSR);
269 if (!msr) /* spurious interrupt */
270 return IRQ_HANDLED;
271
210 src = 32 - ffs(msr); 272 src = 32 - ffs(msr);
211 273
212 subvirq = irq_linear_revmap(uic->irqhost, src); 274 subvirq = irq_linear_revmap(uic->irqhost, src);
diff --git a/arch/ppc/.gitignore b/arch/ppc/.gitignore
index a1a869c8c840..1e79a0ae4473 100644
--- a/arch/ppc/.gitignore
+++ b/arch/ppc/.gitignore
@@ -1 +1 @@
include /include
diff --git a/drivers/char/hvc_beat.c b/drivers/char/hvc_beat.c
index 6f019f19be71..e74bb949c289 100644
--- a/drivers/char/hvc_beat.c
+++ b/drivers/char/hvc_beat.c
@@ -97,7 +97,7 @@ static int hvc_beat_config(char *p)
97 return 0; 97 return 0;
98} 98}
99 99
100static int hvc_beat_console_init(void) 100static int __init hvc_beat_console_init(void)
101{ 101{
102 if (hvc_beat_useit && machine_is_compatible("Beat")) { 102 if (hvc_beat_useit && machine_is_compatible("Beat")) {
103 hvc_instantiate(0, 0, &hvc_beat_get_put_ops); 103 hvc_instantiate(0, 0, &hvc_beat_get_put_ops);
@@ -106,7 +106,7 @@ static int hvc_beat_console_init(void)
106} 106}
107 107
108/* temp */ 108/* temp */
109static int hvc_beat_init(void) 109static int __init hvc_beat_init(void)
110{ 110{
111 struct hvc_struct *hp; 111 struct hvc_struct *hp;
112 112
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 9b07f7851061..f2e5cb1bedf3 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2251,19 +2251,19 @@ static int __devinit ipmi_of_probe(struct of_device *dev,
2251 return ret; 2251 return ret;
2252 } 2252 }
2253 2253
2254 regsize = get_property(np, "reg-size", &proplen); 2254 regsize = of_get_property(np, "reg-size", &proplen);
2255 if (regsize && proplen != 4) { 2255 if (regsize && proplen != 4) {
2256 dev_warn(&dev->dev, PFX "invalid regsize from OF\n"); 2256 dev_warn(&dev->dev, PFX "invalid regsize from OF\n");
2257 return -EINVAL; 2257 return -EINVAL;
2258 } 2258 }
2259 2259
2260 regspacing = get_property(np, "reg-spacing", &proplen); 2260 regspacing = of_get_property(np, "reg-spacing", &proplen);
2261 if (regspacing && proplen != 4) { 2261 if (regspacing && proplen != 4) {
2262 dev_warn(&dev->dev, PFX "invalid regspacing from OF\n"); 2262 dev_warn(&dev->dev, PFX "invalid regspacing from OF\n");
2263 return -EINVAL; 2263 return -EINVAL;
2264 } 2264 }
2265 2265
2266 regshift = get_property(np, "reg-shift", &proplen); 2266 regshift = of_get_property(np, "reg-shift", &proplen);
2267 if (regshift && proplen != 4) { 2267 if (regshift && proplen != 4) {
2268 dev_warn(&dev->dev, PFX "invalid regshift from OF\n"); 2268 dev_warn(&dev->dev, PFX "invalid regshift from OF\n");
2269 return -EINVAL; 2269 return -EINVAL;
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index 17ef5d3c01b4..444696625171 100644
--- a/drivers/macintosh/adb-iop.c
+++ b/drivers/macintosh/adb-iop.c
@@ -19,7 +19,6 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
21 21
22#include <asm/bootinfo.h>
23#include <asm/macintosh.h> 22#include <asm/macintosh.h>
24#include <asm/macints.h> 23#include <asm/macints.h>
25#include <asm/mac_iop.h> 24#include <asm/mac_iop.h>
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
index e54c4d9f6365..73c50bc02095 100644
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -14,9 +14,10 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/sections.h> 15#include <asm/sections.h>
16#include <asm/prom.h> 16#include <asm/prom.h>
17#include <asm/ans-lcd.h>
18#include <asm/io.h> 17#include <asm/io.h>
19 18
19#include "ans-lcd.h"
20
20#define ANSLCD_ADDR 0xf301c000 21#define ANSLCD_ADDR 0xf301c000
21#define ANSLCD_CTRL_IX 0x00 22#define ANSLCD_CTRL_IX 0x00
22#define ANSLCD_DATA_IX 0x10 23#define ANSLCD_DATA_IX 0x10
diff --git a/include/asm-ppc/ans-lcd.h b/drivers/macintosh/ans-lcd.h
index d795b9fd2db6..d795b9fd2db6 100644
--- a/include/asm-ppc/ans-lcd.h
+++ b/drivers/macintosh/ans-lcd.h
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index f25685b9b7cf..276945d51513 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -379,13 +379,10 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr,
379 if (thermostat) 379 if (thermostat)
380 return 0; 380 return 0;
381 381
382 th = (struct thermostat *) 382 th = kzalloc(sizeof(struct thermostat), GFP_KERNEL);
383 kmalloc(sizeof(struct thermostat), GFP_KERNEL);
384
385 if (!th) 383 if (!th)
386 return -ENOMEM; 384 return -ENOMEM;
387 385
388 memset(th, 0, sizeof(*th));
389 th->clt.addr = addr; 386 th->clt.addr = addr;
390 th->clt.adapter = adapter; 387 th->clt.adapter = adapter;
391 th->clt.driver = &thermostat_driver; 388 th->clt.driver = &thermostat_driver;
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 04f3973e3874..f7c509b7a8ea 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -410,7 +410,7 @@ static int __init via_pmu_start(void)
410 410
411 irq = irq_of_parse_and_map(vias, 0); 411 irq = irq_of_parse_and_map(vias, 0);
412 if (irq == NO_IRQ) { 412 if (irq == NO_IRQ) {
413 printk(KERN_ERR "via-pmu: can't map interruptn"); 413 printk(KERN_ERR "via-pmu: can't map interrupt\n");
414 return -ENODEV; 414 return -ENODEV;
415 } 415 }
416 if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) { 416 if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) {
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index 351982bcec1b..f449d775cdf4 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -380,10 +380,12 @@ static int __init sat_sensors_init(void)
380 return i2c_add_driver(&wf_sat_driver); 380 return i2c_add_driver(&wf_sat_driver);
381} 381}
382 382
383#if 0 /* uncomment when module_exit() below is uncommented */
383static void __exit sat_sensors_exit(void) 384static void __exit sat_sensors_exit(void)
384{ 385{
385 i2c_del_driver(&wf_sat_driver); 386 i2c_del_driver(&wf_sat_driver);
386} 387}
388#endif
387 389
388module_init(sat_sensors_init); 390module_init(sat_sensors_init);
389/*module_exit(sat_sensors_exit); Uncomment when cleanup is implemented */ 391/*module_exit(sat_sensors_exit); Uncomment when cleanup is implemented */
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index cc6c73442435..6cd132c75187 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -362,7 +362,7 @@ config MTD_WALNUT
362 362
363config MTD_EBONY 363config MTD_EBONY
364 tristate "Flash devices mapped on IBM 440GP Ebony" 364 tristate "Flash devices mapped on IBM 440GP Ebony"
365 depends on MTD_JEDECPROBE && EBONY 365 depends on MTD_JEDECPROBE && EBONY && !PPC_MERGE
366 help 366 help
367 This enables access routines for the flash chips on the IBM 440GP 367 This enables access routines for the flash chips on the IBM 440GP
368 Ebony board. If you have one of these boards and would like to 368 Ebony board. If you have one of these boards and would like to
diff --git a/include/asm-powerpc/8xx_immap.h b/include/asm-powerpc/8xx_immap.h
new file mode 100644
index 000000000000..1311cefdfd30
--- /dev/null
+++ b/include/asm-powerpc/8xx_immap.h
@@ -0,0 +1,564 @@
1/*
2 * MPC8xx Internal Memory Map
3 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4 *
5 * The I/O on the MPC860 is comprised of blocks of special registers
6 * and the dual port ram for the Communication Processor Module.
7 * Within this space are functional units such as the SIU, memory
8 * controller, system timers, and other control functions. It is
9 * a combination that I found difficult to separate into logical
10 * functional files.....but anyone else is welcome to try. -- Dan
11 */
12#ifdef __KERNEL__
13#ifndef __IMMAP_8XX__
14#define __IMMAP_8XX__
15
16/* System configuration registers.
17*/
18typedef struct sys_conf {
19 uint sc_siumcr;
20 uint sc_sypcr;
21 uint sc_swt;
22 char res1[2];
23 ushort sc_swsr;
24 uint sc_sipend;
25 uint sc_simask;
26 uint sc_siel;
27 uint sc_sivec;
28 uint sc_tesr;
29 char res2[0xc];
30 uint sc_sdcr;
31 char res3[0x4c];
32} sysconf8xx_t;
33
34/* PCMCIA configuration registers.
35*/
36typedef struct pcmcia_conf {
37 uint pcmc_pbr0;
38 uint pcmc_por0;
39 uint pcmc_pbr1;
40 uint pcmc_por1;
41 uint pcmc_pbr2;
42 uint pcmc_por2;
43 uint pcmc_pbr3;
44 uint pcmc_por3;
45 uint pcmc_pbr4;
46 uint pcmc_por4;
47 uint pcmc_pbr5;
48 uint pcmc_por5;
49 uint pcmc_pbr6;
50 uint pcmc_por6;
51 uint pcmc_pbr7;
52 uint pcmc_por7;
53 char res1[0x20];
54 uint pcmc_pgcra;
55 uint pcmc_pgcrb;
56 uint pcmc_pscr;
57 char res2[4];
58 uint pcmc_pipr;
59 char res3[4];
60 uint pcmc_per;
61 char res4[4];
62} pcmconf8xx_t;
63
64/* Memory controller registers.
65*/
66typedef struct mem_ctlr {
67 uint memc_br0;
68 uint memc_or0;
69 uint memc_br1;
70 uint memc_or1;
71 uint memc_br2;
72 uint memc_or2;
73 uint memc_br3;
74 uint memc_or3;
75 uint memc_br4;
76 uint memc_or4;
77 uint memc_br5;
78 uint memc_or5;
79 uint memc_br6;
80 uint memc_or6;
81 uint memc_br7;
82 uint memc_or7;
83 char res1[0x24];
84 uint memc_mar;
85 uint memc_mcr;
86 char res2[4];
87 uint memc_mamr;
88 uint memc_mbmr;
89 ushort memc_mstat;
90 ushort memc_mptpr;
91 uint memc_mdr;
92 char res3[0x80];
93} memctl8xx_t;
94
95/*-----------------------------------------------------------------------
96 * BR - Memory Controler: Base Register 16-9
97 */
98#define BR_BA_MSK 0xffff8000 /* Base Address Mask */
99#define BR_AT_MSK 0x00007000 /* Address Type Mask */
100#define BR_PS_MSK 0x00000c00 /* Port Size Mask */
101#define BR_PS_32 0x00000000 /* 32 bit port size */
102#define BR_PS_16 0x00000800 /* 16 bit port size */
103#define BR_PS_8 0x00000400 /* 8 bit port size */
104#define BR_PARE 0x00000200 /* Parity Enable */
105#define BR_WP 0x00000100 /* Write Protect */
106#define BR_MS_MSK 0x000000c0 /* Machine Select Mask */
107#define BR_MS_GPCM 0x00000000 /* G.P.C.M. Machine Select */
108#define BR_MS_UPMA 0x00000080 /* U.P.M.A Machine Select */
109#define BR_MS_UPMB 0x000000c0 /* U.P.M.B Machine Select */
110#define BR_V 0x00000001 /* Bank Valid */
111
112/*-----------------------------------------------------------------------
113 * OR - Memory Controler: Option Register 16-11
114 */
115#define OR_AM_MSK 0xffff8000 /* Address Mask Mask */
116#define OR_ATM_MSK 0x00007000 /* Address Type Mask Mask */
117#define OR_CSNT_SAM 0x00000800 /* Chip Select Negation Time/ Start */
118 /* Address Multiplex */
119#define OR_ACS_MSK 0x00000600 /* Address to Chip Select Setup mask */
120#define OR_ACS_DIV1 0x00000000 /* CS is output at the same time */
121#define OR_ACS_DIV4 0x00000400 /* CS is output 1/4 a clock later */
122#define OR_ACS_DIV2 0x00000600 /* CS is output 1/2 a clock later */
123#define OR_G5LA 0x00000400 /* Output #GPL5 on #GPL_A5 */
124#define OR_G5LS 0x00000200 /* Drive #GPL high on falling edge of...*/
125#define OR_BI 0x00000100 /* Burst inhibit */
126#define OR_SCY_MSK 0x000000f0 /* Cycle Lenght in Clocks */
127#define OR_SCY_0_CLK 0x00000000 /* 0 clock cycles wait states */
128#define OR_SCY_1_CLK 0x00000010 /* 1 clock cycles wait states */
129#define OR_SCY_2_CLK 0x00000020 /* 2 clock cycles wait states */
130#define OR_SCY_3_CLK 0x00000030 /* 3 clock cycles wait states */
131#define OR_SCY_4_CLK 0x00000040 /* 4 clock cycles wait states */
132#define OR_SCY_5_CLK 0x00000050 /* 5 clock cycles wait states */
133#define OR_SCY_6_CLK 0x00000060 /* 6 clock cycles wait states */
134#define OR_SCY_7_CLK 0x00000070 /* 7 clock cycles wait states */
135#define OR_SCY_8_CLK 0x00000080 /* 8 clock cycles wait states */
136#define OR_SCY_9_CLK 0x00000090 /* 9 clock cycles wait states */
137#define OR_SCY_10_CLK 0x000000a0 /* 10 clock cycles wait states */
138#define OR_SCY_11_CLK 0x000000b0 /* 11 clock cycles wait states */
139#define OR_SCY_12_CLK 0x000000c0 /* 12 clock cycles wait states */
140#define OR_SCY_13_CLK 0x000000d0 /* 13 clock cycles wait states */
141#define OR_SCY_14_CLK 0x000000e0 /* 14 clock cycles wait states */
142#define OR_SCY_15_CLK 0x000000f0 /* 15 clock cycles wait states */
143#define OR_SETA 0x00000008 /* External Transfer Acknowledge */
144#define OR_TRLX 0x00000004 /* Timing Relaxed */
145#define OR_EHTR 0x00000002 /* Extended Hold Time on Read */
146
147/* System Integration Timers.
148*/
149typedef struct sys_int_timers {
150 ushort sit_tbscr;
151 char res0[0x02];
152 uint sit_tbreff0;
153 uint sit_tbreff1;
154 char res1[0x14];
155 ushort sit_rtcsc;
156 char res2[0x02];
157 uint sit_rtc;
158 uint sit_rtsec;
159 uint sit_rtcal;
160 char res3[0x10];
161 ushort sit_piscr;
162 char res4[2];
163 uint sit_pitc;
164 uint sit_pitr;
165 char res5[0x34];
166} sit8xx_t;
167
168#define TBSCR_TBIRQ_MASK ((ushort)0xff00)
169#define TBSCR_REFA ((ushort)0x0080)
170#define TBSCR_REFB ((ushort)0x0040)
171#define TBSCR_REFAE ((ushort)0x0008)
172#define TBSCR_REFBE ((ushort)0x0004)
173#define TBSCR_TBF ((ushort)0x0002)
174#define TBSCR_TBE ((ushort)0x0001)
175
176#define RTCSC_RTCIRQ_MASK ((ushort)0xff00)
177#define RTCSC_SEC ((ushort)0x0080)
178#define RTCSC_ALR ((ushort)0x0040)
179#define RTCSC_38K ((ushort)0x0010)
180#define RTCSC_SIE ((ushort)0x0008)
181#define RTCSC_ALE ((ushort)0x0004)
182#define RTCSC_RTF ((ushort)0x0002)
183#define RTCSC_RTE ((ushort)0x0001)
184
185#define PISCR_PIRQ_MASK ((ushort)0xff00)
186#define PISCR_PS ((ushort)0x0080)
187#define PISCR_PIE ((ushort)0x0004)
188#define PISCR_PTF ((ushort)0x0002)
189#define PISCR_PTE ((ushort)0x0001)
190
191/* Clocks and Reset.
192*/
193typedef struct clk_and_reset {
194 uint car_sccr;
195 uint car_plprcr;
196 uint car_rsr;
197 char res[0x74]; /* Reserved area */
198} car8xx_t;
199
200/* System Integration Timers keys.
201*/
202typedef struct sitk {
203 uint sitk_tbscrk;
204 uint sitk_tbreff0k;
205 uint sitk_tbreff1k;
206 uint sitk_tbk;
207 char res1[0x10];
208 uint sitk_rtcsck;
209 uint sitk_rtck;
210 uint sitk_rtseck;
211 uint sitk_rtcalk;
212 char res2[0x10];
213 uint sitk_piscrk;
214 uint sitk_pitck;
215 char res3[0x38];
216} sitk8xx_t;
217
218/* Clocks and reset keys.
219*/
220typedef struct cark {
221 uint cark_sccrk;
222 uint cark_plprcrk;
223 uint cark_rsrk;
224 char res[0x474];
225} cark8xx_t;
226
227/* The key to unlock registers maintained by keep-alive power.
228*/
229#define KAPWR_KEY ((unsigned int)0x55ccaa33)
230
231/* Video interface. MPC823 Only.
232*/
233typedef struct vid823 {
234 ushort vid_vccr;
235 ushort res1;
236 u_char vid_vsr;
237 u_char res2;
238 u_char vid_vcmr;
239 u_char res3;
240 uint vid_vbcb;
241 uint res4;
242 uint vid_vfcr0;
243 uint vid_vfaa0;
244 uint vid_vfba0;
245 uint vid_vfcr1;
246 uint vid_vfaa1;
247 uint vid_vfba1;
248 u_char res5[0x18];
249} vid823_t;
250
251/* LCD interface. 823 Only.
252*/
253typedef struct lcd {
254 uint lcd_lccr;
255 uint lcd_lchcr;
256 uint lcd_lcvcr;
257 char res1[4];
258 uint lcd_lcfaa;
259 uint lcd_lcfba;
260 char lcd_lcsr;
261 char res2[0x7];
262} lcd823_t;
263
264/* I2C
265*/
266typedef struct i2c {
267 u_char i2c_i2mod;
268 char res1[3];
269 u_char i2c_i2add;
270 char res2[3];
271 u_char i2c_i2brg;
272 char res3[3];
273 u_char i2c_i2com;
274 char res4[3];
275 u_char i2c_i2cer;
276 char res5[3];
277 u_char i2c_i2cmr;
278 char res6[0x8b];
279} i2c8xx_t;
280
281/* DMA control/status registers.
282*/
283typedef struct sdma_csr {
284 char res1[4];
285 uint sdma_sdar;
286 u_char sdma_sdsr;
287 char res3[3];
288 u_char sdma_sdmr;
289 char res4[3];
290 u_char sdma_idsr1;
291 char res5[3];
292 u_char sdma_idmr1;
293 char res6[3];
294 u_char sdma_idsr2;
295 char res7[3];
296 u_char sdma_idmr2;
297 char res8[0x13];
298} sdma8xx_t;
299
300/* Communication Processor Module Interrupt Controller.
301*/
302typedef struct cpm_ic {
303 ushort cpic_civr;
304 char res[0xe];
305 uint cpic_cicr;
306 uint cpic_cipr;
307 uint cpic_cimr;
308 uint cpic_cisr;
309} cpic8xx_t;
310
311/* Input/Output Port control/status registers.
312*/
313typedef struct io_port {
314 ushort iop_padir;
315 ushort iop_papar;
316 ushort iop_paodr;
317 ushort iop_padat;
318 char res1[8];
319 ushort iop_pcdir;
320 ushort iop_pcpar;
321 ushort iop_pcso;
322 ushort iop_pcdat;
323 ushort iop_pcint;
324 char res2[6];
325 ushort iop_pddir;
326 ushort iop_pdpar;
327 char res3[2];
328 ushort iop_pddat;
329 uint utmode;
330 char res4[4];
331} iop8xx_t;
332
333/* Communication Processor Module Timers
334*/
335typedef struct cpm_timers {
336 ushort cpmt_tgcr;
337 char res1[0xe];
338 ushort cpmt_tmr1;
339 ushort cpmt_tmr2;
340 ushort cpmt_trr1;
341 ushort cpmt_trr2;
342 ushort cpmt_tcr1;
343 ushort cpmt_tcr2;
344 ushort cpmt_tcn1;
345 ushort cpmt_tcn2;
346 ushort cpmt_tmr3;
347 ushort cpmt_tmr4;
348 ushort cpmt_trr3;
349 ushort cpmt_trr4;
350 ushort cpmt_tcr3;
351 ushort cpmt_tcr4;
352 ushort cpmt_tcn3;
353 ushort cpmt_tcn4;
354 ushort cpmt_ter1;
355 ushort cpmt_ter2;
356 ushort cpmt_ter3;
357 ushort cpmt_ter4;
358 char res2[8];
359} cpmtimer8xx_t;
360
361/* Finally, the Communication Processor stuff.....
362*/
363typedef struct scc { /* Serial communication channels */
364 uint scc_gsmrl;
365 uint scc_gsmrh;
366 ushort scc_psmr;
367 char res1[2];
368 ushort scc_todr;
369 ushort scc_dsr;
370 ushort scc_scce;
371 char res2[2];
372 ushort scc_sccm;
373 char res3;
374 u_char scc_sccs;
375 char res4[8];
376} scc_t;
377
378typedef struct smc { /* Serial management channels */
379 char res1[2];
380 ushort smc_smcmr;
381 char res2[2];
382 u_char smc_smce;
383 char res3[3];
384 u_char smc_smcm;
385 char res4[5];
386} smc_t;
387
388/* MPC860T Fast Ethernet Controller. It isn't part of the CPM, but
389 * it fits within the address space.
390 */
391
392typedef struct fec {
393 uint fec_addr_low; /* lower 32 bits of station address */
394 ushort fec_addr_high; /* upper 16 bits of station address */
395 ushort res1; /* reserved */
396 uint fec_hash_table_high; /* upper 32-bits of hash table */
397 uint fec_hash_table_low; /* lower 32-bits of hash table */
398 uint fec_r_des_start; /* beginning of Rx descriptor ring */
399 uint fec_x_des_start; /* beginning of Tx descriptor ring */
400 uint fec_r_buff_size; /* Rx buffer size */
401 uint res2[9]; /* reserved */
402 uint fec_ecntrl; /* ethernet control register */
403 uint fec_ievent; /* interrupt event register */
404 uint fec_imask; /* interrupt mask register */
405 uint fec_ivec; /* interrupt level and vector status */
406 uint fec_r_des_active; /* Rx ring updated flag */
407 uint fec_x_des_active; /* Tx ring updated flag */
408 uint res3[10]; /* reserved */
409 uint fec_mii_data; /* MII data register */
410 uint fec_mii_speed; /* MII speed control register */
411 uint res4[17]; /* reserved */
412 uint fec_r_bound; /* end of RAM (read-only) */
413 uint fec_r_fstart; /* Rx FIFO start address */
414 uint res5[6]; /* reserved */
415 uint fec_x_fstart; /* Tx FIFO start address */
416 uint res6[17]; /* reserved */
417 uint fec_fun_code; /* fec SDMA function code */
418 uint res7[3]; /* reserved */
419 uint fec_r_cntrl; /* Rx control register */
420 uint fec_r_hash; /* Rx hash register */
421 uint res8[14]; /* reserved */
422 uint fec_x_cntrl; /* Tx control register */
423 uint res9[0x1e]; /* reserved */
424} fec_t;
425
426/* The FEC and LCD color map share the same address space....
427 * I guess we will never see an 823T :-).
428 */
429union fec_lcd {
430 fec_t fl_un_fec;
431 u_char fl_un_cmap[0x200];
432};
433
434typedef struct comm_proc {
435 /* General control and status registers.
436 */
437 ushort cp_cpcr;
438 u_char res1[2];
439 ushort cp_rccr;
440 u_char res2;
441 u_char cp_rmds;
442 u_char res3[4];
443 ushort cp_cpmcr1;
444 ushort cp_cpmcr2;
445 ushort cp_cpmcr3;
446 ushort cp_cpmcr4;
447 u_char res4[2];
448 ushort cp_rter;
449 u_char res5[2];
450 ushort cp_rtmr;
451 u_char res6[0x14];
452
453 /* Baud rate generators.
454 */
455 uint cp_brgc1;
456 uint cp_brgc2;
457 uint cp_brgc3;
458 uint cp_brgc4;
459
460 /* Serial Communication Channels.
461 */
462 scc_t cp_scc[4];
463
464 /* Serial Management Channels.
465 */
466 smc_t cp_smc[2];
467
468 /* Serial Peripheral Interface.
469 */
470 ushort cp_spmode;
471 u_char res7[4];
472 u_char cp_spie;
473 u_char res8[3];
474 u_char cp_spim;
475 u_char res9[2];
476 u_char cp_spcom;
477 u_char res10[2];
478
479 /* Parallel Interface Port.
480 */
481 u_char res11[2];
482 ushort cp_pipc;
483 u_char res12[2];
484 ushort cp_ptpr;
485 uint cp_pbdir;
486 uint cp_pbpar;
487 u_char res13[2];
488 ushort cp_pbodr;
489 uint cp_pbdat;
490
491 /* Port E - MPC87x/88x only.
492 */
493 uint cp_pedir;
494 uint cp_pepar;
495 uint cp_peso;
496 uint cp_peodr;
497 uint cp_pedat;
498
499 /* Communications Processor Timing Register -
500 Contains RMII Timing for the FECs on MPC87x/88x only.
501 */
502 uint cp_cptr;
503
504 /* Serial Interface and Time Slot Assignment.
505 */
506 uint cp_simode;
507 u_char cp_sigmr;
508 u_char res15;
509 u_char cp_sistr;
510 u_char cp_sicmr;
511 u_char res16[4];
512 uint cp_sicr;
513 uint cp_sirp;
514 u_char res17[0xc];
515
516 /* 256 bytes of MPC823 video controller RAM array.
517 */
518 u_char cp_vcram[0x100];
519 u_char cp_siram[0x200];
520
521 /* The fast ethernet controller is not really part of the CPM,
522 * but it resides in the address space.
523 * The LCD color map is also here.
524 */
525 union fec_lcd fl_un;
526#define cp_fec fl_un.fl_un_fec
527#define lcd_cmap fl_un.fl_un_cmap
528 char res18[0xE00];
529
530 /* The DUET family has a second FEC here */
531 fec_t cp_fec2;
532#define cp_fec1 cp_fec /* consistency macro */
533
534 /* Dual Ported RAM follows.
535 * There are many different formats for this memory area
536 * depending upon the devices used and options chosen.
537 * Some processors don't have all of it populated.
538 */
539 u_char cp_dpmem[0x1C00]; /* BD / Data / ucode */
540 u_char cp_dparam[0x400]; /* Parameter RAM */
541} cpm8xx_t;
542
543/* Internal memory map.
544*/
545typedef struct immap {
546 sysconf8xx_t im_siu_conf; /* SIU Configuration */
547 pcmconf8xx_t im_pcmcia; /* PCMCIA Configuration */
548 memctl8xx_t im_memctl; /* Memory Controller */
549 sit8xx_t im_sit; /* System integration timers */
550 car8xx_t im_clkrst; /* Clocks and reset */
551 sitk8xx_t im_sitk; /* Sys int timer keys */
552 cark8xx_t im_clkrstk; /* Clocks and reset keys */
553 vid823_t im_vid; /* Video (823 only) */
554 lcd823_t im_lcd; /* LCD (823 only) */
555 i2c8xx_t im_i2c; /* I2C control/status */
556 sdma8xx_t im_sdma; /* SDMA control/status */
557 cpic8xx_t im_cpic; /* CPM Interrupt Controller */
558 iop8xx_t im_ioport; /* IO Port control/status */
559 cpmtimer8xx_t im_cpmtimer; /* CPM timers */
560 cpm8xx_t im_cpm; /* Communication processor */
561} immap_t;
562
563#endif /* __IMMAP_8XX__ */
564#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index c44810b9d322..f3fc733758f5 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -5,7 +5,7 @@
5 * PowerPC atomic operations 5 * PowerPC atomic operations
6 */ 6 */
7 7
8typedef struct { volatile int counter; } atomic_t; 8typedef struct { int counter; } atomic_t;
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/compiler.h> 11#include <linux/compiler.h>
@@ -15,8 +15,19 @@ typedef struct { volatile int counter; } atomic_t;
15 15
16#define ATOMIC_INIT(i) { (i) } 16#define ATOMIC_INIT(i) { (i) }
17 17
18#define atomic_read(v) ((v)->counter) 18static __inline__ int atomic_read(const atomic_t *v)
19#define atomic_set(v,i) (((v)->counter) = (i)) 19{
20 int t;
21
22 __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter));
23
24 return t;
25}
26
27static __inline__ void atomic_set(atomic_t *v, int i)
28{
29 __asm__ __volatile__("stw%U0%X0 %1,%0" : "=m"(v->counter) : "r"(i));
30}
20 31
21static __inline__ void atomic_add(int a, atomic_t *v) 32static __inline__ void atomic_add(int a, atomic_t *v)
22{ 33{
@@ -240,12 +251,23 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
240 251
241#ifdef __powerpc64__ 252#ifdef __powerpc64__
242 253
243typedef struct { volatile long counter; } atomic64_t; 254typedef struct { long counter; } atomic64_t;
244 255
245#define ATOMIC64_INIT(i) { (i) } 256#define ATOMIC64_INIT(i) { (i) }
246 257
247#define atomic64_read(v) ((v)->counter) 258static __inline__ long atomic64_read(const atomic64_t *v)
248#define atomic64_set(v,i) (((v)->counter) = (i)) 259{
260 long t;
261
262 __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter));
263
264 return t;
265}
266
267static __inline__ void atomic64_set(atomic64_t *v, long i)
268{
269 __asm__ __volatile__("std%U0%X0 %1,%0" : "=m"(v->counter) : "r"(i));
270}
249 271
250static __inline__ void atomic64_add(long a, atomic64_t *v) 272static __inline__ void atomic64_add(long a, atomic64_t *v)
251{ 273{
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
new file mode 100644
index 000000000000..397248705e0e
--- /dev/null
+++ b/include/asm-powerpc/commproc.h
@@ -0,0 +1,692 @@
1/*
2 * MPC8xx Communication Processor Module.
3 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4 *
5 * This file contains structures and information for the communication
6 * processor channels. Some CPM control and status is available
7 * throught the MPC8xx internal memory map. See immap.h for details.
8 * This file only contains what I need for the moment, not the total
9 * CPM capabilities. I (or someone else) will add definitions as they
10 * are needed. -- Dan
11 *
12 * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
13 * bytes of the DP RAM and relocates the I2C parameter area to the
14 * IDMA1 space. The remaining DP RAM is available for buffer descriptors
15 * or other use.
16 */
17#ifndef __CPM_8XX__
18#define __CPM_8XX__
19
20#include <asm/8xx_immap.h>
21#include <asm/ptrace.h>
22
23/* CPM Command register.
24*/
25#define CPM_CR_RST ((ushort)0x8000)
26#define CPM_CR_OPCODE ((ushort)0x0f00)
27#define CPM_CR_CHAN ((ushort)0x00f0)
28#define CPM_CR_FLG ((ushort)0x0001)
29
30/* Some commands (there are more...later)
31*/
32#define CPM_CR_INIT_TRX ((ushort)0x0000)
33#define CPM_CR_INIT_RX ((ushort)0x0001)
34#define CPM_CR_INIT_TX ((ushort)0x0002)
35#define CPM_CR_HUNT_MODE ((ushort)0x0003)
36#define CPM_CR_STOP_TX ((ushort)0x0004)
37#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
38#define CPM_CR_RESTART_TX ((ushort)0x0006)
39#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
40#define CPM_CR_SET_GADDR ((ushort)0x0008)
41#define CPM_CR_SET_TIMER CPM_CR_SET_GADDR
42
43/* Channel numbers.
44*/
45#define CPM_CR_CH_SCC1 ((ushort)0x0000)
46#define CPM_CR_CH_I2C ((ushort)0x0001) /* I2C and IDMA1 */
47#define CPM_CR_CH_SCC2 ((ushort)0x0004)
48#define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI / IDMA2 / Timers */
49#define CPM_CR_CH_TIMER CPM_CR_CH_SPI
50#define CPM_CR_CH_SCC3 ((ushort)0x0008)
51#define CPM_CR_CH_SMC1 ((ushort)0x0009) /* SMC1 / DSP1 */
52#define CPM_CR_CH_SCC4 ((ushort)0x000c)
53#define CPM_CR_CH_SMC2 ((ushort)0x000d) /* SMC2 / DSP2 */
54
55#define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
56
57/* The dual ported RAM is multi-functional. Some areas can be (and are
58 * being) used for microcode. There is an area that can only be used
59 * as data ram for buffer descriptors, which is all we use right now.
60 * Currently the first 512 and last 256 bytes are used for microcode.
61 */
62#define CPM_DATAONLY_BASE ((uint)0x0800)
63#define CPM_DATAONLY_SIZE ((uint)0x0700)
64#define CPM_DP_NOSPACE ((uint)0x7fffffff)
65
66/* Export the base address of the communication processor registers
67 * and dual port ram.
68 */
69extern cpm8xx_t *cpmp; /* Pointer to comm processor */
70extern unsigned long cpm_dpalloc(uint size, uint align);
71extern int cpm_dpfree(unsigned long offset);
72extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
73extern void cpm_dpdump(void);
74extern void *cpm_dpram_addr(unsigned long offset);
75extern uint cpm_dpram_phys(u8* addr);
76extern void cpm_setbrg(uint brg, uint rate);
77
78extern uint m8xx_cpm_hostalloc(uint size);
79extern int m8xx_cpm_hostfree(uint start);
80extern void m8xx_cpm_hostdump(void);
81
82extern void cpm_load_patch(volatile immap_t *immr);
83
84/* Buffer descriptors used by many of the CPM protocols.
85*/
86typedef struct cpm_buf_desc {
87 ushort cbd_sc; /* Status and Control */
88 ushort cbd_datlen; /* Data length in buffer */
89 uint cbd_bufaddr; /* Buffer address in host memory */
90} cbd_t;
91
92#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
93#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
94#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
95#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
96#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
97#define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
98#define BD_SC_CM ((ushort)0x0200) /* Continous mode */
99#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
100#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
101#define BD_SC_BR ((ushort)0x0020) /* Break received */
102#define BD_SC_FR ((ushort)0x0010) /* Framing error */
103#define BD_SC_PR ((ushort)0x0008) /* Parity error */
104#define BD_SC_NAK ((ushort)0x0004) /* NAK - did not respond */
105#define BD_SC_OV ((ushort)0x0002) /* Overrun */
106#define BD_SC_UN ((ushort)0x0002) /* Underrun */
107#define BD_SC_CD ((ushort)0x0001) /* ?? */
108#define BD_SC_CL ((ushort)0x0001) /* Collision */
109
110/* Parameter RAM offsets.
111*/
112#define PROFF_SCC1 ((uint)0x0000)
113#define PROFF_IIC ((uint)0x0080)
114#define PROFF_SCC2 ((uint)0x0100)
115#define PROFF_SPI ((uint)0x0180)
116#define PROFF_SCC3 ((uint)0x0200)
117#define PROFF_SMC1 ((uint)0x0280)
118#define PROFF_SCC4 ((uint)0x0300)
119#define PROFF_SMC2 ((uint)0x0380)
120
121/* Define enough so I can at least use the serial port as a UART.
122 * The MBX uses SMC1 as the host serial port.
123 */
124typedef struct smc_uart {
125 ushort smc_rbase; /* Rx Buffer descriptor base address */
126 ushort smc_tbase; /* Tx Buffer descriptor base address */
127 u_char smc_rfcr; /* Rx function code */
128 u_char smc_tfcr; /* Tx function code */
129 ushort smc_mrblr; /* Max receive buffer length */
130 uint smc_rstate; /* Internal */
131 uint smc_idp; /* Internal */
132 ushort smc_rbptr; /* Internal */
133 ushort smc_ibc; /* Internal */
134 uint smc_rxtmp; /* Internal */
135 uint smc_tstate; /* Internal */
136 uint smc_tdp; /* Internal */
137 ushort smc_tbptr; /* Internal */
138 ushort smc_tbc; /* Internal */
139 uint smc_txtmp; /* Internal */
140 ushort smc_maxidl; /* Maximum idle characters */
141 ushort smc_tmpidl; /* Temporary idle counter */
142 ushort smc_brklen; /* Last received break length */
143 ushort smc_brkec; /* rcv'd break condition counter */
144 ushort smc_brkcr; /* xmt break count register */
145 ushort smc_rmask; /* Temporary bit mask */
146 char res1[8]; /* Reserved */
147 ushort smc_rpbase; /* Relocation pointer */
148} smc_uart_t;
149
150/* Function code bits.
151*/
152#define SMC_EB ((u_char)0x10) /* Set big endian byte order */
153
154/* SMC uart mode register.
155*/
156#define SMCMR_REN ((ushort)0x0001)
157#define SMCMR_TEN ((ushort)0x0002)
158#define SMCMR_DM ((ushort)0x000c)
159#define SMCMR_SM_GCI ((ushort)0x0000)
160#define SMCMR_SM_UART ((ushort)0x0020)
161#define SMCMR_SM_TRANS ((ushort)0x0030)
162#define SMCMR_SM_MASK ((ushort)0x0030)
163#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
164#define SMCMR_REVD SMCMR_PM_EVEN
165#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
166#define SMCMR_BS SMCMR_PEN
167#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
168#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
169#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
170
171/* SMC2 as Centronics parallel printer. It is half duplex, in that
172 * it can only receive or transmit. The parameter ram values for
173 * each direction are either unique or properly overlap, so we can
174 * include them in one structure.
175 */
176typedef struct smc_centronics {
177 ushort scent_rbase;
178 ushort scent_tbase;
179 u_char scent_cfcr;
180 u_char scent_smask;
181 ushort scent_mrblr;
182 uint scent_rstate;
183 uint scent_r_ptr;
184 ushort scent_rbptr;
185 ushort scent_r_cnt;
186 uint scent_rtemp;
187 uint scent_tstate;
188 uint scent_t_ptr;
189 ushort scent_tbptr;
190 ushort scent_t_cnt;
191 uint scent_ttemp;
192 ushort scent_max_sl;
193 ushort scent_sl_cnt;
194 ushort scent_character1;
195 ushort scent_character2;
196 ushort scent_character3;
197 ushort scent_character4;
198 ushort scent_character5;
199 ushort scent_character6;
200 ushort scent_character7;
201 ushort scent_character8;
202 ushort scent_rccm;
203 ushort scent_rccr;
204} smc_cent_t;
205
206/* Centronics Status Mask Register.
207*/
208#define SMC_CENT_F ((u_char)0x08)
209#define SMC_CENT_PE ((u_char)0x04)
210#define SMC_CENT_S ((u_char)0x02)
211
212/* SMC Event and Mask register.
213*/
214#define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
215#define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
216#define SMCM_TXE ((unsigned char)0x10) /* When in Transparent Mode */
217#define SMCM_BSY ((unsigned char)0x04)
218#define SMCM_TX ((unsigned char)0x02)
219#define SMCM_RX ((unsigned char)0x01)
220
221/* Baud rate generators.
222*/
223#define CPM_BRG_RST ((uint)0x00020000)
224#define CPM_BRG_EN ((uint)0x00010000)
225#define CPM_BRG_EXTC_INT ((uint)0x00000000)
226#define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
227#define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
228#define CPM_BRG_ATB ((uint)0x00002000)
229#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
230#define CPM_BRG_DIV16 ((uint)0x00000001)
231
232/* SI Clock Route Register
233*/
234#define SICR_RCLK_SCC1_BRG1 ((uint)0x00000000)
235#define SICR_TCLK_SCC1_BRG1 ((uint)0x00000000)
236#define SICR_RCLK_SCC2_BRG2 ((uint)0x00000800)
237#define SICR_TCLK_SCC2_BRG2 ((uint)0x00000100)
238#define SICR_RCLK_SCC3_BRG3 ((uint)0x00100000)
239#define SICR_TCLK_SCC3_BRG3 ((uint)0x00020000)
240#define SICR_RCLK_SCC4_BRG4 ((uint)0x18000000)
241#define SICR_TCLK_SCC4_BRG4 ((uint)0x03000000)
242
243/* SCCs.
244*/
245#define SCC_GSMRH_IRP ((uint)0x00040000)
246#define SCC_GSMRH_GDE ((uint)0x00010000)
247#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
248#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
249#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
250#define SCC_GSMRH_REVD ((uint)0x00002000)
251#define SCC_GSMRH_TRX ((uint)0x00001000)
252#define SCC_GSMRH_TTX ((uint)0x00000800)
253#define SCC_GSMRH_CDP ((uint)0x00000400)
254#define SCC_GSMRH_CTSP ((uint)0x00000200)
255#define SCC_GSMRH_CDS ((uint)0x00000100)
256#define SCC_GSMRH_CTSS ((uint)0x00000080)
257#define SCC_GSMRH_TFL ((uint)0x00000040)
258#define SCC_GSMRH_RFW ((uint)0x00000020)
259#define SCC_GSMRH_TXSY ((uint)0x00000010)
260#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
261#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
262#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
263#define SCC_GSMRH_RTSM ((uint)0x00000002)
264#define SCC_GSMRH_RSYN ((uint)0x00000001)
265
266#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
267#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
268#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
269#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
270#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
271#define SCC_GSMRL_TCI ((uint)0x10000000)
272#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
273#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
274#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
275#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
276#define SCC_GSMRL_RINV ((uint)0x02000000)
277#define SCC_GSMRL_TINV ((uint)0x01000000)
278#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
279#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
280#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
281#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
282#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
283#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
284#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
285#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
286#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
287#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
288#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
289#define SCC_GSMRL_TEND ((uint)0x00040000)
290#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
291#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
292#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
293#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
294#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
295#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
296#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
297#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
298#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
299#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
300#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
301#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
302#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
303#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
304#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
305#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
306#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
307#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
308#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
309#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
310#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
311#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
312#define SCC_GSMRL_ENR ((uint)0x00000020)
313#define SCC_GSMRL_ENT ((uint)0x00000010)
314#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
315#define SCC_GSMRL_MODE_QMC ((uint)0x0000000a)
316#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
317#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
318#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
319#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
320#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
321#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
322#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
323#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
324#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
325
326#define SCC_TODR_TOD ((ushort)0x8000)
327
328/* SCC Event and Mask register.
329*/
330#define SCCM_TXE ((unsigned char)0x10)
331#define SCCM_BSY ((unsigned char)0x04)
332#define SCCM_TX ((unsigned char)0x02)
333#define SCCM_RX ((unsigned char)0x01)
334
335typedef struct scc_param {
336 ushort scc_rbase; /* Rx Buffer descriptor base address */
337 ushort scc_tbase; /* Tx Buffer descriptor base address */
338 u_char scc_rfcr; /* Rx function code */
339 u_char scc_tfcr; /* Tx function code */
340 ushort scc_mrblr; /* Max receive buffer length */
341 uint scc_rstate; /* Internal */
342 uint scc_idp; /* Internal */
343 ushort scc_rbptr; /* Internal */
344 ushort scc_ibc; /* Internal */
345 uint scc_rxtmp; /* Internal */
346 uint scc_tstate; /* Internal */
347 uint scc_tdp; /* Internal */
348 ushort scc_tbptr; /* Internal */
349 ushort scc_tbc; /* Internal */
350 uint scc_txtmp; /* Internal */
351 uint scc_rcrc; /* Internal */
352 uint scc_tcrc; /* Internal */
353} sccp_t;
354
355/* Function code bits.
356*/
357#define SCC_EB ((u_char)0x10) /* Set big endian byte order */
358
359/* CPM Ethernet through SCCx.
360 */
361typedef struct scc_enet {
362 sccp_t sen_genscc;
363 uint sen_cpres; /* Preset CRC */
364 uint sen_cmask; /* Constant mask for CRC */
365 uint sen_crcec; /* CRC Error counter */
366 uint sen_alec; /* alignment error counter */
367 uint sen_disfc; /* discard frame counter */
368 ushort sen_pads; /* Tx short frame pad character */
369 ushort sen_retlim; /* Retry limit threshold */
370 ushort sen_retcnt; /* Retry limit counter */
371 ushort sen_maxflr; /* maximum frame length register */
372 ushort sen_minflr; /* minimum frame length register */
373 ushort sen_maxd1; /* maximum DMA1 length */
374 ushort sen_maxd2; /* maximum DMA2 length */
375 ushort sen_maxd; /* Rx max DMA */
376 ushort sen_dmacnt; /* Rx DMA counter */
377 ushort sen_maxb; /* Max BD byte count */
378 ushort sen_gaddr1; /* Group address filter */
379 ushort sen_gaddr2;
380 ushort sen_gaddr3;
381 ushort sen_gaddr4;
382 uint sen_tbuf0data0; /* Save area 0 - current frame */
383 uint sen_tbuf0data1; /* Save area 1 - current frame */
384 uint sen_tbuf0rba; /* Internal */
385 uint sen_tbuf0crc; /* Internal */
386 ushort sen_tbuf0bcnt; /* Internal */
387 ushort sen_paddrh; /* physical address (MSB) */
388 ushort sen_paddrm;
389 ushort sen_paddrl; /* physical address (LSB) */
390 ushort sen_pper; /* persistence */
391 ushort sen_rfbdptr; /* Rx first BD pointer */
392 ushort sen_tfbdptr; /* Tx first BD pointer */
393 ushort sen_tlbdptr; /* Tx last BD pointer */
394 uint sen_tbuf1data0; /* Save area 0 - current frame */
395 uint sen_tbuf1data1; /* Save area 1 - current frame */
396 uint sen_tbuf1rba; /* Internal */
397 uint sen_tbuf1crc; /* Internal */
398 ushort sen_tbuf1bcnt; /* Internal */
399 ushort sen_txlen; /* Tx Frame length counter */
400 ushort sen_iaddr1; /* Individual address filter */
401 ushort sen_iaddr2;
402 ushort sen_iaddr3;
403 ushort sen_iaddr4;
404 ushort sen_boffcnt; /* Backoff counter */
405
406 /* NOTE: Some versions of the manual have the following items
407 * incorrectly documented. Below is the proper order.
408 */
409 ushort sen_taddrh; /* temp address (MSB) */
410 ushort sen_taddrm;
411 ushort sen_taddrl; /* temp address (LSB) */
412} scc_enet_t;
413
414/* SCC Event register as used by Ethernet.
415*/
416#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
417#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
418#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
419#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
420#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
421#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
422
423/* SCC Mode Register (PMSR) as used by Ethernet.
424*/
425#define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
426#define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
427#define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
428#define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
429#define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
430#define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
431#define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
432#define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
433#define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
434#define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
435#define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
436#define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
437#define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
438
439/* Buffer descriptor control/status used by Ethernet receive.
440*/
441#define BD_ENET_RX_EMPTY ((ushort)0x8000)
442#define BD_ENET_RX_WRAP ((ushort)0x2000)
443#define BD_ENET_RX_INTR ((ushort)0x1000)
444#define BD_ENET_RX_LAST ((ushort)0x0800)
445#define BD_ENET_RX_FIRST ((ushort)0x0400)
446#define BD_ENET_RX_MISS ((ushort)0x0100)
447#define BD_ENET_RX_LG ((ushort)0x0020)
448#define BD_ENET_RX_NO ((ushort)0x0010)
449#define BD_ENET_RX_SH ((ushort)0x0008)
450#define BD_ENET_RX_CR ((ushort)0x0004)
451#define BD_ENET_RX_OV ((ushort)0x0002)
452#define BD_ENET_RX_CL ((ushort)0x0001)
453#define BD_ENET_RX_BC ((ushort)0x0080) /* DA is Broadcast */
454#define BD_ENET_RX_MC ((ushort)0x0040) /* DA is Multicast */
455#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
456
457/* Buffer descriptor control/status used by Ethernet transmit.
458*/
459#define BD_ENET_TX_READY ((ushort)0x8000)
460#define BD_ENET_TX_PAD ((ushort)0x4000)
461#define BD_ENET_TX_WRAP ((ushort)0x2000)
462#define BD_ENET_TX_INTR ((ushort)0x1000)
463#define BD_ENET_TX_LAST ((ushort)0x0800)
464#define BD_ENET_TX_TC ((ushort)0x0400)
465#define BD_ENET_TX_DEF ((ushort)0x0200)
466#define BD_ENET_TX_HB ((ushort)0x0100)
467#define BD_ENET_TX_LC ((ushort)0x0080)
468#define BD_ENET_TX_RL ((ushort)0x0040)
469#define BD_ENET_TX_RCMASK ((ushort)0x003c)
470#define BD_ENET_TX_UN ((ushort)0x0002)
471#define BD_ENET_TX_CSL ((ushort)0x0001)
472#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
473
474/* SCC as UART
475*/
476typedef struct scc_uart {
477 sccp_t scc_genscc;
478 char res1[8]; /* Reserved */
479 ushort scc_maxidl; /* Maximum idle chars */
480 ushort scc_idlc; /* temp idle counter */
481 ushort scc_brkcr; /* Break count register */
482 ushort scc_parec; /* receive parity error counter */
483 ushort scc_frmec; /* receive framing error counter */
484 ushort scc_nosec; /* receive noise counter */
485 ushort scc_brkec; /* receive break condition counter */
486 ushort scc_brkln; /* last received break length */
487 ushort scc_uaddr1; /* UART address character 1 */
488 ushort scc_uaddr2; /* UART address character 2 */
489 ushort scc_rtemp; /* Temp storage */
490 ushort scc_toseq; /* Transmit out of sequence char */
491 ushort scc_char1; /* control character 1 */
492 ushort scc_char2; /* control character 2 */
493 ushort scc_char3; /* control character 3 */
494 ushort scc_char4; /* control character 4 */
495 ushort scc_char5; /* control character 5 */
496 ushort scc_char6; /* control character 6 */
497 ushort scc_char7; /* control character 7 */
498 ushort scc_char8; /* control character 8 */
499 ushort scc_rccm; /* receive control character mask */
500 ushort scc_rccr; /* receive control character register */
501 ushort scc_rlbc; /* receive last break character */
502} scc_uart_t;
503
504/* SCC Event and Mask registers when it is used as a UART.
505*/
506#define UART_SCCM_GLR ((ushort)0x1000)
507#define UART_SCCM_GLT ((ushort)0x0800)
508#define UART_SCCM_AB ((ushort)0x0200)
509#define UART_SCCM_IDL ((ushort)0x0100)
510#define UART_SCCM_GRA ((ushort)0x0080)
511#define UART_SCCM_BRKE ((ushort)0x0040)
512#define UART_SCCM_BRKS ((ushort)0x0020)
513#define UART_SCCM_CCR ((ushort)0x0008)
514#define UART_SCCM_BSY ((ushort)0x0004)
515#define UART_SCCM_TX ((ushort)0x0002)
516#define UART_SCCM_RX ((ushort)0x0001)
517
518/* The SCC PMSR when used as a UART.
519*/
520#define SCU_PSMR_FLC ((ushort)0x8000)
521#define SCU_PSMR_SL ((ushort)0x4000)
522#define SCU_PSMR_CL ((ushort)0x3000)
523#define SCU_PSMR_UM ((ushort)0x0c00)
524#define SCU_PSMR_FRZ ((ushort)0x0200)
525#define SCU_PSMR_RZS ((ushort)0x0100)
526#define SCU_PSMR_SYN ((ushort)0x0080)
527#define SCU_PSMR_DRT ((ushort)0x0040)
528#define SCU_PSMR_PEN ((ushort)0x0010)
529#define SCU_PSMR_RPM ((ushort)0x000c)
530#define SCU_PSMR_REVP ((ushort)0x0008)
531#define SCU_PSMR_TPM ((ushort)0x0003)
532#define SCU_PSMR_TEVP ((ushort)0x0002)
533
534/* CPM Transparent mode SCC.
535 */
536typedef struct scc_trans {
537 sccp_t st_genscc;
538 uint st_cpres; /* Preset CRC */
539 uint st_cmask; /* Constant mask for CRC */
540} scc_trans_t;
541
542#define BD_SCC_TX_LAST ((ushort)0x0800)
543
544/* IIC parameter RAM.
545*/
546typedef struct iic {
547 ushort iic_rbase; /* Rx Buffer descriptor base address */
548 ushort iic_tbase; /* Tx Buffer descriptor base address */
549 u_char iic_rfcr; /* Rx function code */
550 u_char iic_tfcr; /* Tx function code */
551 ushort iic_mrblr; /* Max receive buffer length */
552 uint iic_rstate; /* Internal */
553 uint iic_rdp; /* Internal */
554 ushort iic_rbptr; /* Internal */
555 ushort iic_rbc; /* Internal */
556 uint iic_rxtmp; /* Internal */
557 uint iic_tstate; /* Internal */
558 uint iic_tdp; /* Internal */
559 ushort iic_tbptr; /* Internal */
560 ushort iic_tbc; /* Internal */
561 uint iic_txtmp; /* Internal */
562 char res1[4]; /* Reserved */
563 ushort iic_rpbase; /* Relocation pointer */
564 char res2[2]; /* Reserved */
565} iic_t;
566
567#define BD_IIC_START ((ushort)0x0400)
568
569/* SPI parameter RAM.
570*/
571typedef struct spi {
572 ushort spi_rbase; /* Rx Buffer descriptor base address */
573 ushort spi_tbase; /* Tx Buffer descriptor base address */
574 u_char spi_rfcr; /* Rx function code */
575 u_char spi_tfcr; /* Tx function code */
576 ushort spi_mrblr; /* Max receive buffer length */
577 uint spi_rstate; /* Internal */
578 uint spi_rdp; /* Internal */
579 ushort spi_rbptr; /* Internal */
580 ushort spi_rbc; /* Internal */
581 uint spi_rxtmp; /* Internal */
582 uint spi_tstate; /* Internal */
583 uint spi_tdp; /* Internal */
584 ushort spi_tbptr; /* Internal */
585 ushort spi_tbc; /* Internal */
586 uint spi_txtmp; /* Internal */
587 uint spi_res;
588 ushort spi_rpbase; /* Relocation pointer */
589 ushort spi_res2;
590} spi_t;
591
592/* SPI Mode register.
593*/
594#define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
595#define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
596#define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
597#define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
598#define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
599#define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
600#define SPMODE_EN ((ushort)0x0100) /* Enable */
601#define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
602#define SPMODE_LEN4 ((ushort)0x0030) /* 4 bits per char */
603#define SPMODE_LEN8 ((ushort)0x0070) /* 8 bits per char */
604#define SPMODE_LEN16 ((ushort)0x00f0) /* 16 bits per char */
605#define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
606
607/* SPIE fields */
608#define SPIE_MME 0x20
609#define SPIE_TXE 0x10
610#define SPIE_BSY 0x04
611#define SPIE_TXB 0x02
612#define SPIE_RXB 0x01
613
614/*
615 * RISC Controller Configuration Register definitons
616 */
617#define RCCR_TIME 0x8000 /* RISC Timer Enable */
618#define RCCR_TIMEP(t) (((t) & 0x3F)<<8) /* RISC Timer Period */
619#define RCCR_TIME_MASK 0x00FF /* not RISC Timer related bits */
620
621/* RISC Timer Parameter RAM offset */
622#define PROFF_RTMR ((uint)0x01B0)
623
624typedef struct risc_timer_pram {
625 unsigned short tm_base; /* RISC Timer Table Base Address */
626 unsigned short tm_ptr; /* RISC Timer Table Pointer (internal) */
627 unsigned short r_tmr; /* RISC Timer Mode Register */
628 unsigned short r_tmv; /* RISC Timer Valid Register */
629 unsigned long tm_cmd; /* RISC Timer Command Register */
630 unsigned long tm_cnt; /* RISC Timer Internal Count */
631} rt_pram_t;
632
633/* Bits in RISC Timer Command Register */
634#define TM_CMD_VALID 0x80000000 /* Valid - Enables the timer */
635#define TM_CMD_RESTART 0x40000000 /* Restart - for automatic restart */
636#define TM_CMD_PWM 0x20000000 /* Run in Pulse Width Modulation Mode */
637#define TM_CMD_NUM(n) (((n)&0xF)<<16) /* Timer Number */
638#define TM_CMD_PERIOD(p) ((p)&0xFFFF) /* Timer Period */
639
640/* CPM interrupts. There are nearly 32 interrupts generated by CPM
641 * channels or devices. All of these are presented to the PPC core
642 * as a single interrupt. The CPM interrupt handler dispatches its
643 * own handlers, in a similar fashion to the PPC core handler. We
644 * use the table as defined in the manuals (i.e. no special high
645 * priority and SCC1 == SCCa, etc...).
646 */
647#define CPMVEC_NR 32
648#define CPMVEC_PIO_PC15 ((ushort)0x1f)
649#define CPMVEC_SCC1 ((ushort)0x1e)
650#define CPMVEC_SCC2 ((ushort)0x1d)
651#define CPMVEC_SCC3 ((ushort)0x1c)
652#define CPMVEC_SCC4 ((ushort)0x1b)
653#define CPMVEC_PIO_PC14 ((ushort)0x1a)
654#define CPMVEC_TIMER1 ((ushort)0x19)
655#define CPMVEC_PIO_PC13 ((ushort)0x18)
656#define CPMVEC_PIO_PC12 ((ushort)0x17)
657#define CPMVEC_SDMA_CB_ERR ((ushort)0x16)
658#define CPMVEC_IDMA1 ((ushort)0x15)
659#define CPMVEC_IDMA2 ((ushort)0x14)
660#define CPMVEC_TIMER2 ((ushort)0x12)
661#define CPMVEC_RISCTIMER ((ushort)0x11)
662#define CPMVEC_I2C ((ushort)0x10)
663#define CPMVEC_PIO_PC11 ((ushort)0x0f)
664#define CPMVEC_PIO_PC10 ((ushort)0x0e)
665#define CPMVEC_TIMER3 ((ushort)0x0c)
666#define CPMVEC_PIO_PC9 ((ushort)0x0b)
667#define CPMVEC_PIO_PC8 ((ushort)0x0a)
668#define CPMVEC_PIO_PC7 ((ushort)0x09)
669#define CPMVEC_TIMER4 ((ushort)0x07)
670#define CPMVEC_PIO_PC6 ((ushort)0x06)
671#define CPMVEC_SPI ((ushort)0x05)
672#define CPMVEC_SMC1 ((ushort)0x04)
673#define CPMVEC_SMC2 ((ushort)0x03)
674#define CPMVEC_PIO_PC5 ((ushort)0x02)
675#define CPMVEC_PIO_PC4 ((ushort)0x01)
676#define CPMVEC_ERROR ((ushort)0x00)
677
678/* CPM interrupt configuration vector.
679*/
680#define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
681#define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
682#define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
683#define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
684#define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
685#define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
686#define CICR_IEN ((uint)0x00000080) /* Int. enable */
687#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
688
689extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
690extern void cpm_free_handler(int vec);
691
692#endif /* __CPM_8XX__ */
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
new file mode 100644
index 000000000000..12a2860f9a9c
--- /dev/null
+++ b/include/asm-powerpc/cpm2.h
@@ -0,0 +1,1248 @@
1/*
2 * Communication Processor Module v2.
3 *
4 * This file contains structures and information for the communication
5 * processor channels found in the dual port RAM or parameter RAM.
6 * All CPM control and status is available through the CPM2 internal
7 * memory map. See immap_cpm2.h for details.
8 */
9#ifdef __KERNEL__
10#ifndef __CPM2__
11#define __CPM2__
12
13#include <asm/immap_cpm2.h>
14
15/* CPM Command register.
16*/
17#define CPM_CR_RST ((uint)0x80000000)
18#define CPM_CR_PAGE ((uint)0x7c000000)
19#define CPM_CR_SBLOCK ((uint)0x03e00000)
20#define CPM_CR_FLG ((uint)0x00010000)
21#define CPM_CR_MCN ((uint)0x00003fc0)
22#define CPM_CR_OPCODE ((uint)0x0000000f)
23
24/* Device sub-block and page codes.
25*/
26#define CPM_CR_SCC1_SBLOCK (0x04)
27#define CPM_CR_SCC2_SBLOCK (0x05)
28#define CPM_CR_SCC3_SBLOCK (0x06)
29#define CPM_CR_SCC4_SBLOCK (0x07)
30#define CPM_CR_SMC1_SBLOCK (0x08)
31#define CPM_CR_SMC2_SBLOCK (0x09)
32#define CPM_CR_SPI_SBLOCK (0x0a)
33#define CPM_CR_I2C_SBLOCK (0x0b)
34#define CPM_CR_TIMER_SBLOCK (0x0f)
35#define CPM_CR_RAND_SBLOCK (0x0e)
36#define CPM_CR_FCC1_SBLOCK (0x10)
37#define CPM_CR_FCC2_SBLOCK (0x11)
38#define CPM_CR_FCC3_SBLOCK (0x12)
39#define CPM_CR_IDMA1_SBLOCK (0x14)
40#define CPM_CR_IDMA2_SBLOCK (0x15)
41#define CPM_CR_IDMA3_SBLOCK (0x16)
42#define CPM_CR_IDMA4_SBLOCK (0x17)
43#define CPM_CR_MCC1_SBLOCK (0x1c)
44
45#define CPM_CR_FCC_SBLOCK(x) (x + 0x10)
46
47#define CPM_CR_SCC1_PAGE (0x00)
48#define CPM_CR_SCC2_PAGE (0x01)
49#define CPM_CR_SCC3_PAGE (0x02)
50#define CPM_CR_SCC4_PAGE (0x03)
51#define CPM_CR_SMC1_PAGE (0x07)
52#define CPM_CR_SMC2_PAGE (0x08)
53#define CPM_CR_SPI_PAGE (0x09)
54#define CPM_CR_I2C_PAGE (0x0a)
55#define CPM_CR_TIMER_PAGE (0x0a)
56#define CPM_CR_RAND_PAGE (0x0a)
57#define CPM_CR_FCC1_PAGE (0x04)
58#define CPM_CR_FCC2_PAGE (0x05)
59#define CPM_CR_FCC3_PAGE (0x06)
60#define CPM_CR_IDMA1_PAGE (0x07)
61#define CPM_CR_IDMA2_PAGE (0x08)
62#define CPM_CR_IDMA3_PAGE (0x09)
63#define CPM_CR_IDMA4_PAGE (0x0a)
64#define CPM_CR_MCC1_PAGE (0x07)
65#define CPM_CR_MCC2_PAGE (0x08)
66
67#define CPM_CR_FCC_PAGE(x) (x + 0x04)
68
69/* Some opcodes (there are more...later)
70*/
71#define CPM_CR_INIT_TRX ((ushort)0x0000)
72#define CPM_CR_INIT_RX ((ushort)0x0001)
73#define CPM_CR_INIT_TX ((ushort)0x0002)
74#define CPM_CR_HUNT_MODE ((ushort)0x0003)
75#define CPM_CR_STOP_TX ((ushort)0x0004)
76#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
77#define CPM_CR_RESTART_TX ((ushort)0x0006)
78#define CPM_CR_SET_GADDR ((ushort)0x0008)
79#define CPM_CR_START_IDMA ((ushort)0x0009)
80#define CPM_CR_STOP_IDMA ((ushort)0x000b)
81
82#define mk_cr_cmd(PG, SBC, MCN, OP) \
83 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
84
85/* Dual Port RAM addresses. The first 16K is available for almost
86 * any CPM use, so we put the BDs there. The first 128 bytes are
87 * used for SMC1 and SMC2 parameter RAM, so we start allocating
88 * BDs above that. All of this must change when we start
89 * downloading RAM microcode.
90 */
91#define CPM_DATAONLY_BASE ((uint)128)
92#define CPM_DP_NOSPACE ((uint)0x7fffffff)
93#if defined(CONFIG_8272) || defined(CONFIG_MPC8555)
94#define CPM_DATAONLY_SIZE ((uint)(8 * 1024) - CPM_DATAONLY_BASE)
95#define CPM_FCC_SPECIAL_BASE ((uint)0x00009000)
96#else
97#define CPM_DATAONLY_SIZE ((uint)(16 * 1024) - CPM_DATAONLY_BASE)
98#define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
99#endif
100
101/* The number of pages of host memory we allocate for CPM. This is
102 * done early in kernel initialization to get physically contiguous
103 * pages.
104 */
105#define NUM_CPM_HOST_PAGES 2
106
107/* Export the base address of the communication processor registers
108 * and dual port ram.
109 */
110extern cpm_cpm2_t *cpmp; /* Pointer to comm processor */
111
112extern unsigned long cpm_dpalloc(uint size, uint align);
113extern int cpm_dpfree(unsigned long offset);
114extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
115extern void cpm_dpdump(void);
116extern void *cpm_dpram_addr(unsigned long offset);
117extern void cpm_setbrg(uint brg, uint rate);
118extern void cpm2_fastbrg(uint brg, uint rate, int div16);
119extern void cpm2_reset(void);
120
121
122/* Buffer descriptors used by many of the CPM protocols.
123*/
124typedef struct cpm_buf_desc {
125 ushort cbd_sc; /* Status and Control */
126 ushort cbd_datlen; /* Data length in buffer */
127 uint cbd_bufaddr; /* Buffer address in host memory */
128} cbd_t;
129
130#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
131#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
132#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
133#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
134#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
135#define BD_SC_CM ((ushort)0x0200) /* Continous mode */
136#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
137#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
138#define BD_SC_BR ((ushort)0x0020) /* Break received */
139#define BD_SC_FR ((ushort)0x0010) /* Framing error */
140#define BD_SC_PR ((ushort)0x0008) /* Parity error */
141#define BD_SC_OV ((ushort)0x0002) /* Overrun */
142#define BD_SC_CD ((ushort)0x0001) /* ?? */
143
144/* Function code bits, usually generic to devices.
145*/
146#define CPMFCR_GBL ((u_char)0x20) /* Set memory snooping */
147#define CPMFCR_EB ((u_char)0x10) /* Set big endian byte order */
148#define CPMFCR_TC2 ((u_char)0x04) /* Transfer code 2 value */
149#define CPMFCR_DTB ((u_char)0x02) /* Use local bus for data when set */
150#define CPMFCR_BDB ((u_char)0x01) /* Use local bus for BD when set */
151
152/* Parameter RAM offsets from the base.
153*/
154#define PROFF_SCC1 ((uint)0x8000)
155#define PROFF_SCC2 ((uint)0x8100)
156#define PROFF_SCC3 ((uint)0x8200)
157#define PROFF_SCC4 ((uint)0x8300)
158#define PROFF_FCC1 ((uint)0x8400)
159#define PROFF_FCC2 ((uint)0x8500)
160#define PROFF_FCC3 ((uint)0x8600)
161#define PROFF_MCC1 ((uint)0x8700)
162#define PROFF_SMC1_BASE ((uint)0x87fc)
163#define PROFF_IDMA1_BASE ((uint)0x87fe)
164#define PROFF_MCC2 ((uint)0x8800)
165#define PROFF_SMC2_BASE ((uint)0x88fc)
166#define PROFF_IDMA2_BASE ((uint)0x88fe)
167#define PROFF_SPI_BASE ((uint)0x89fc)
168#define PROFF_IDMA3_BASE ((uint)0x89fe)
169#define PROFF_TIMERS ((uint)0x8ae0)
170#define PROFF_REVNUM ((uint)0x8af0)
171#define PROFF_RAND ((uint)0x8af8)
172#define PROFF_I2C_BASE ((uint)0x8afc)
173#define PROFF_IDMA4_BASE ((uint)0x8afe)
174
175#define PROFF_SCC_SIZE ((uint)0x100)
176#define PROFF_FCC_SIZE ((uint)0x100)
177#define PROFF_SMC_SIZE ((uint)64)
178
179/* The SMCs are relocated to any of the first eight DPRAM pages.
180 * We will fix these at the first locations of DPRAM, until we
181 * get some microcode patches :-).
182 * The parameter ram space for the SMCs is fifty-some bytes, and
183 * they are required to start on a 64 byte boundary.
184 */
185#define PROFF_SMC1 (0)
186#define PROFF_SMC2 (64)
187
188
189/* Define enough so I can at least use the serial port as a UART.
190 */
191typedef struct smc_uart {
192 ushort smc_rbase; /* Rx Buffer descriptor base address */
193 ushort smc_tbase; /* Tx Buffer descriptor base address */
194 u_char smc_rfcr; /* Rx function code */
195 u_char smc_tfcr; /* Tx function code */
196 ushort smc_mrblr; /* Max receive buffer length */
197 uint smc_rstate; /* Internal */
198 uint smc_idp; /* Internal */
199 ushort smc_rbptr; /* Internal */
200 ushort smc_ibc; /* Internal */
201 uint smc_rxtmp; /* Internal */
202 uint smc_tstate; /* Internal */
203 uint smc_tdp; /* Internal */
204 ushort smc_tbptr; /* Internal */
205 ushort smc_tbc; /* Internal */
206 uint smc_txtmp; /* Internal */
207 ushort smc_maxidl; /* Maximum idle characters */
208 ushort smc_tmpidl; /* Temporary idle counter */
209 ushort smc_brklen; /* Last received break length */
210 ushort smc_brkec; /* rcv'd break condition counter */
211 ushort smc_brkcr; /* xmt break count register */
212 ushort smc_rmask; /* Temporary bit mask */
213 uint smc_stmp; /* SDMA Temp */
214} smc_uart_t;
215
216/* SMC uart mode register (Internal memory map).
217*/
218#define SMCMR_REN ((ushort)0x0001)
219#define SMCMR_TEN ((ushort)0x0002)
220#define SMCMR_DM ((ushort)0x000c)
221#define SMCMR_SM_GCI ((ushort)0x0000)
222#define SMCMR_SM_UART ((ushort)0x0020)
223#define SMCMR_SM_TRANS ((ushort)0x0030)
224#define SMCMR_SM_MASK ((ushort)0x0030)
225#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
226#define SMCMR_REVD SMCMR_PM_EVEN
227#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
228#define SMCMR_BS SMCMR_PEN
229#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
230#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
231#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
232
233/* SMC Event and Mask register.
234*/
235#define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
236#define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
237#define SMCM_TXE ((unsigned char)0x10)
238#define SMCM_BSY ((unsigned char)0x04)
239#define SMCM_TX ((unsigned char)0x02)
240#define SMCM_RX ((unsigned char)0x01)
241
242/* Baud rate generators.
243*/
244#define CPM_BRG_RST ((uint)0x00020000)
245#define CPM_BRG_EN ((uint)0x00010000)
246#define CPM_BRG_EXTC_INT ((uint)0x00000000)
247#define CPM_BRG_EXTC_CLK3_9 ((uint)0x00004000)
248#define CPM_BRG_EXTC_CLK5_15 ((uint)0x00008000)
249#define CPM_BRG_ATB ((uint)0x00002000)
250#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
251#define CPM_BRG_DIV16 ((uint)0x00000001)
252
253/* SCCs.
254*/
255#define SCC_GSMRH_IRP ((uint)0x00040000)
256#define SCC_GSMRH_GDE ((uint)0x00010000)
257#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
258#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
259#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
260#define SCC_GSMRH_REVD ((uint)0x00002000)
261#define SCC_GSMRH_TRX ((uint)0x00001000)
262#define SCC_GSMRH_TTX ((uint)0x00000800)
263#define SCC_GSMRH_CDP ((uint)0x00000400)
264#define SCC_GSMRH_CTSP ((uint)0x00000200)
265#define SCC_GSMRH_CDS ((uint)0x00000100)
266#define SCC_GSMRH_CTSS ((uint)0x00000080)
267#define SCC_GSMRH_TFL ((uint)0x00000040)
268#define SCC_GSMRH_RFW ((uint)0x00000020)
269#define SCC_GSMRH_TXSY ((uint)0x00000010)
270#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
271#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
272#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
273#define SCC_GSMRH_RTSM ((uint)0x00000002)
274#define SCC_GSMRH_RSYN ((uint)0x00000001)
275
276#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
277#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
278#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
279#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
280#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
281#define SCC_GSMRL_TCI ((uint)0x10000000)
282#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
283#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
284#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
285#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
286#define SCC_GSMRL_RINV ((uint)0x02000000)
287#define SCC_GSMRL_TINV ((uint)0x01000000)
288#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
289#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
290#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
291#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
292#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
293#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
294#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
295#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
296#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
297#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
298#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
299#define SCC_GSMRL_TEND ((uint)0x00040000)
300#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
301#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
302#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
303#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
304#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
305#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
306#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
307#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
308#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
309#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
310#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
311#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
312#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
313#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
314#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
315#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
316#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
317#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
318#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
319#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
320#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
321#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
322#define SCC_GSMRL_ENR ((uint)0x00000020)
323#define SCC_GSMRL_ENT ((uint)0x00000010)
324#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
325#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
326#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
327#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
328#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
329#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
330#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
331#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
332#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
333#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
334
335#define SCC_TODR_TOD ((ushort)0x8000)
336
337/* SCC Event and Mask register.
338*/
339#define SCCM_TXE ((unsigned char)0x10)
340#define SCCM_BSY ((unsigned char)0x04)
341#define SCCM_TX ((unsigned char)0x02)
342#define SCCM_RX ((unsigned char)0x01)
343
344typedef struct scc_param {
345 ushort scc_rbase; /* Rx Buffer descriptor base address */
346 ushort scc_tbase; /* Tx Buffer descriptor base address */
347 u_char scc_rfcr; /* Rx function code */
348 u_char scc_tfcr; /* Tx function code */
349 ushort scc_mrblr; /* Max receive buffer length */
350 uint scc_rstate; /* Internal */
351 uint scc_idp; /* Internal */
352 ushort scc_rbptr; /* Internal */
353 ushort scc_ibc; /* Internal */
354 uint scc_rxtmp; /* Internal */
355 uint scc_tstate; /* Internal */
356 uint scc_tdp; /* Internal */
357 ushort scc_tbptr; /* Internal */
358 ushort scc_tbc; /* Internal */
359 uint scc_txtmp; /* Internal */
360 uint scc_rcrc; /* Internal */
361 uint scc_tcrc; /* Internal */
362} sccp_t;
363
364/* CPM Ethernet through SCC1.
365 */
366typedef struct scc_enet {
367 sccp_t sen_genscc;
368 uint sen_cpres; /* Preset CRC */
369 uint sen_cmask; /* Constant mask for CRC */
370 uint sen_crcec; /* CRC Error counter */
371 uint sen_alec; /* alignment error counter */
372 uint sen_disfc; /* discard frame counter */
373 ushort sen_pads; /* Tx short frame pad character */
374 ushort sen_retlim; /* Retry limit threshold */
375 ushort sen_retcnt; /* Retry limit counter */
376 ushort sen_maxflr; /* maximum frame length register */
377 ushort sen_minflr; /* minimum frame length register */
378 ushort sen_maxd1; /* maximum DMA1 length */
379 ushort sen_maxd2; /* maximum DMA2 length */
380 ushort sen_maxd; /* Rx max DMA */
381 ushort sen_dmacnt; /* Rx DMA counter */
382 ushort sen_maxb; /* Max BD byte count */
383 ushort sen_gaddr1; /* Group address filter */
384 ushort sen_gaddr2;
385 ushort sen_gaddr3;
386 ushort sen_gaddr4;
387 uint sen_tbuf0data0; /* Save area 0 - current frame */
388 uint sen_tbuf0data1; /* Save area 1 - current frame */
389 uint sen_tbuf0rba; /* Internal */
390 uint sen_tbuf0crc; /* Internal */
391 ushort sen_tbuf0bcnt; /* Internal */
392 ushort sen_paddrh; /* physical address (MSB) */
393 ushort sen_paddrm;
394 ushort sen_paddrl; /* physical address (LSB) */
395 ushort sen_pper; /* persistence */
396 ushort sen_rfbdptr; /* Rx first BD pointer */
397 ushort sen_tfbdptr; /* Tx first BD pointer */
398 ushort sen_tlbdptr; /* Tx last BD pointer */
399 uint sen_tbuf1data0; /* Save area 0 - current frame */
400 uint sen_tbuf1data1; /* Save area 1 - current frame */
401 uint sen_tbuf1rba; /* Internal */
402 uint sen_tbuf1crc; /* Internal */
403 ushort sen_tbuf1bcnt; /* Internal */
404 ushort sen_txlen; /* Tx Frame length counter */
405 ushort sen_iaddr1; /* Individual address filter */
406 ushort sen_iaddr2;
407 ushort sen_iaddr3;
408 ushort sen_iaddr4;
409 ushort sen_boffcnt; /* Backoff counter */
410
411 /* NOTE: Some versions of the manual have the following items
412 * incorrectly documented. Below is the proper order.
413 */
414 ushort sen_taddrh; /* temp address (MSB) */
415 ushort sen_taddrm;
416 ushort sen_taddrl; /* temp address (LSB) */
417} scc_enet_t;
418
419
420/* SCC Event register as used by Ethernet.
421*/
422#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
423#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
424#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
425#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
426#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
427#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
428
429/* SCC Mode Register (PSMR) as used by Ethernet.
430*/
431#define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
432#define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
433#define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
434#define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
435#define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
436#define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
437#define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
438#define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
439#define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
440#define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
441#define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
442#define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
443#define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
444
445/* Buffer descriptor control/status used by Ethernet receive.
446 * Common to SCC and FCC.
447 */
448#define BD_ENET_RX_EMPTY ((ushort)0x8000)
449#define BD_ENET_RX_WRAP ((ushort)0x2000)
450#define BD_ENET_RX_INTR ((ushort)0x1000)
451#define BD_ENET_RX_LAST ((ushort)0x0800)
452#define BD_ENET_RX_FIRST ((ushort)0x0400)
453#define BD_ENET_RX_MISS ((ushort)0x0100)
454#define BD_ENET_RX_BC ((ushort)0x0080) /* FCC Only */
455#define BD_ENET_RX_MC ((ushort)0x0040) /* FCC Only */
456#define BD_ENET_RX_LG ((ushort)0x0020)
457#define BD_ENET_RX_NO ((ushort)0x0010)
458#define BD_ENET_RX_SH ((ushort)0x0008)
459#define BD_ENET_RX_CR ((ushort)0x0004)
460#define BD_ENET_RX_OV ((ushort)0x0002)
461#define BD_ENET_RX_CL ((ushort)0x0001)
462#define BD_ENET_RX_STATS ((ushort)0x01ff) /* All status bits */
463
464/* Buffer descriptor control/status used by Ethernet transmit.
465 * Common to SCC and FCC.
466 */
467#define BD_ENET_TX_READY ((ushort)0x8000)
468#define BD_ENET_TX_PAD ((ushort)0x4000)
469#define BD_ENET_TX_WRAP ((ushort)0x2000)
470#define BD_ENET_TX_INTR ((ushort)0x1000)
471#define BD_ENET_TX_LAST ((ushort)0x0800)
472#define BD_ENET_TX_TC ((ushort)0x0400)
473#define BD_ENET_TX_DEF ((ushort)0x0200)
474#define BD_ENET_TX_HB ((ushort)0x0100)
475#define BD_ENET_TX_LC ((ushort)0x0080)
476#define BD_ENET_TX_RL ((ushort)0x0040)
477#define BD_ENET_TX_RCMASK ((ushort)0x003c)
478#define BD_ENET_TX_UN ((ushort)0x0002)
479#define BD_ENET_TX_CSL ((ushort)0x0001)
480#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
481
482/* SCC as UART
483*/
484typedef struct scc_uart {
485 sccp_t scc_genscc;
486 uint scc_res1; /* Reserved */
487 uint scc_res2; /* Reserved */
488 ushort scc_maxidl; /* Maximum idle chars */
489 ushort scc_idlc; /* temp idle counter */
490 ushort scc_brkcr; /* Break count register */
491 ushort scc_parec; /* receive parity error counter */
492 ushort scc_frmec; /* receive framing error counter */
493 ushort scc_nosec; /* receive noise counter */
494 ushort scc_brkec; /* receive break condition counter */
495 ushort scc_brkln; /* last received break length */
496 ushort scc_uaddr1; /* UART address character 1 */
497 ushort scc_uaddr2; /* UART address character 2 */
498 ushort scc_rtemp; /* Temp storage */
499 ushort scc_toseq; /* Transmit out of sequence char */
500 ushort scc_char1; /* control character 1 */
501 ushort scc_char2; /* control character 2 */
502 ushort scc_char3; /* control character 3 */
503 ushort scc_char4; /* control character 4 */
504 ushort scc_char5; /* control character 5 */
505 ushort scc_char6; /* control character 6 */
506 ushort scc_char7; /* control character 7 */
507 ushort scc_char8; /* control character 8 */
508 ushort scc_rccm; /* receive control character mask */
509 ushort scc_rccr; /* receive control character register */
510 ushort scc_rlbc; /* receive last break character */
511} scc_uart_t;
512
513/* SCC Event and Mask registers when it is used as a UART.
514*/
515#define UART_SCCM_GLR ((ushort)0x1000)
516#define UART_SCCM_GLT ((ushort)0x0800)
517#define UART_SCCM_AB ((ushort)0x0200)
518#define UART_SCCM_IDL ((ushort)0x0100)
519#define UART_SCCM_GRA ((ushort)0x0080)
520#define UART_SCCM_BRKE ((ushort)0x0040)
521#define UART_SCCM_BRKS ((ushort)0x0020)
522#define UART_SCCM_CCR ((ushort)0x0008)
523#define UART_SCCM_BSY ((ushort)0x0004)
524#define UART_SCCM_TX ((ushort)0x0002)
525#define UART_SCCM_RX ((ushort)0x0001)
526
527/* The SCC PSMR when used as a UART.
528*/
529#define SCU_PSMR_FLC ((ushort)0x8000)
530#define SCU_PSMR_SL ((ushort)0x4000)
531#define SCU_PSMR_CL ((ushort)0x3000)
532#define SCU_PSMR_UM ((ushort)0x0c00)
533#define SCU_PSMR_FRZ ((ushort)0x0200)
534#define SCU_PSMR_RZS ((ushort)0x0100)
535#define SCU_PSMR_SYN ((ushort)0x0080)
536#define SCU_PSMR_DRT ((ushort)0x0040)
537#define SCU_PSMR_PEN ((ushort)0x0010)
538#define SCU_PSMR_RPM ((ushort)0x000c)
539#define SCU_PSMR_REVP ((ushort)0x0008)
540#define SCU_PSMR_TPM ((ushort)0x0003)
541#define SCU_PSMR_TEVP ((ushort)0x0002)
542
543/* CPM Transparent mode SCC.
544 */
545typedef struct scc_trans {
546 sccp_t st_genscc;
547 uint st_cpres; /* Preset CRC */
548 uint st_cmask; /* Constant mask for CRC */
549} scc_trans_t;
550
551#define BD_SCC_TX_LAST ((ushort)0x0800)
552
553/* How about some FCCs.....
554*/
555#define FCC_GFMR_DIAG_NORM ((uint)0x00000000)
556#define FCC_GFMR_DIAG_LE ((uint)0x40000000)
557#define FCC_GFMR_DIAG_AE ((uint)0x80000000)
558#define FCC_GFMR_DIAG_ALE ((uint)0xc0000000)
559#define FCC_GFMR_TCI ((uint)0x20000000)
560#define FCC_GFMR_TRX ((uint)0x10000000)
561#define FCC_GFMR_TTX ((uint)0x08000000)
562#define FCC_GFMR_TTX ((uint)0x08000000)
563#define FCC_GFMR_CDP ((uint)0x04000000)
564#define FCC_GFMR_CTSP ((uint)0x02000000)
565#define FCC_GFMR_CDS ((uint)0x01000000)
566#define FCC_GFMR_CTSS ((uint)0x00800000)
567#define FCC_GFMR_SYNL_NONE ((uint)0x00000000)
568#define FCC_GFMR_SYNL_AUTO ((uint)0x00004000)
569#define FCC_GFMR_SYNL_8 ((uint)0x00008000)
570#define FCC_GFMR_SYNL_16 ((uint)0x0000c000)
571#define FCC_GFMR_RTSM ((uint)0x00002000)
572#define FCC_GFMR_RENC_NRZ ((uint)0x00000000)
573#define FCC_GFMR_RENC_NRZI ((uint)0x00000800)
574#define FCC_GFMR_REVD ((uint)0x00000400)
575#define FCC_GFMR_TENC_NRZ ((uint)0x00000000)
576#define FCC_GFMR_TENC_NRZI ((uint)0x00000100)
577#define FCC_GFMR_TCRC_16 ((uint)0x00000000)
578#define FCC_GFMR_TCRC_32 ((uint)0x00000080)
579#define FCC_GFMR_ENR ((uint)0x00000020)
580#define FCC_GFMR_ENT ((uint)0x00000010)
581#define FCC_GFMR_MODE_ENET ((uint)0x0000000c)
582#define FCC_GFMR_MODE_ATM ((uint)0x0000000a)
583#define FCC_GFMR_MODE_HDLC ((uint)0x00000000)
584
585/* Generic FCC parameter ram.
586*/
587typedef struct fcc_param {
588 ushort fcc_riptr; /* Rx Internal temp pointer */
589 ushort fcc_tiptr; /* Tx Internal temp pointer */
590 ushort fcc_res1;
591 ushort fcc_mrblr; /* Max receive buffer length, mod 32 bytes */
592 uint fcc_rstate; /* Upper byte is Func code, must be set */
593 uint fcc_rbase; /* Receive BD base */
594 ushort fcc_rbdstat; /* RxBD status */
595 ushort fcc_rbdlen; /* RxBD down counter */
596 uint fcc_rdptr; /* RxBD internal data pointer */
597 uint fcc_tstate; /* Upper byte is Func code, must be set */
598 uint fcc_tbase; /* Transmit BD base */
599 ushort fcc_tbdstat; /* TxBD status */
600 ushort fcc_tbdlen; /* TxBD down counter */
601 uint fcc_tdptr; /* TxBD internal data pointer */
602 uint fcc_rbptr; /* Rx BD Internal buf pointer */
603 uint fcc_tbptr; /* Tx BD Internal buf pointer */
604 uint fcc_rcrc; /* Rx temp CRC */
605 uint fcc_res2;
606 uint fcc_tcrc; /* Tx temp CRC */
607} fccp_t;
608
609
610/* Ethernet controller through FCC.
611*/
612typedef struct fcc_enet {
613 fccp_t fen_genfcc;
614 uint fen_statbuf; /* Internal status buffer */
615 uint fen_camptr; /* CAM address */
616 uint fen_cmask; /* Constant mask for CRC */
617 uint fen_cpres; /* Preset CRC */
618 uint fen_crcec; /* CRC Error counter */
619 uint fen_alec; /* alignment error counter */
620 uint fen_disfc; /* discard frame counter */
621 ushort fen_retlim; /* Retry limit */
622 ushort fen_retcnt; /* Retry counter */
623 ushort fen_pper; /* Persistence */
624 ushort fen_boffcnt; /* backoff counter */
625 uint fen_gaddrh; /* Group address filter, high 32-bits */
626 uint fen_gaddrl; /* Group address filter, low 32-bits */
627 ushort fen_tfcstat; /* out of sequence TxBD */
628 ushort fen_tfclen;
629 uint fen_tfcptr;
630 ushort fen_mflr; /* Maximum frame length (1518) */
631 ushort fen_paddrh; /* MAC address */
632 ushort fen_paddrm;
633 ushort fen_paddrl;
634 ushort fen_ibdcount; /* Internal BD counter */
635 ushort fen_ibdstart; /* Internal BD start pointer */
636 ushort fen_ibdend; /* Internal BD end pointer */
637 ushort fen_txlen; /* Internal Tx frame length counter */
638 uint fen_ibdbase[8]; /* Internal use */
639 uint fen_iaddrh; /* Individual address filter */
640 uint fen_iaddrl;
641 ushort fen_minflr; /* Minimum frame length (64) */
642 ushort fen_taddrh; /* Filter transfer MAC address */
643 ushort fen_taddrm;
644 ushort fen_taddrl;
645 ushort fen_padptr; /* Pointer to pad byte buffer */
646 ushort fen_cftype; /* control frame type */
647 ushort fen_cfrange; /* control frame range */
648 ushort fen_maxb; /* maximum BD count */
649 ushort fen_maxd1; /* Max DMA1 length (1520) */
650 ushort fen_maxd2; /* Max DMA2 length (1520) */
651 ushort fen_maxd; /* internal max DMA count */
652 ushort fen_dmacnt; /* internal DMA counter */
653 uint fen_octc; /* Total octect counter */
654 uint fen_colc; /* Total collision counter */
655 uint fen_broc; /* Total broadcast packet counter */
656 uint fen_mulc; /* Total multicast packet count */
657 uint fen_uspc; /* Total packets < 64 bytes */
658 uint fen_frgc; /* Total packets < 64 bytes with errors */
659 uint fen_ospc; /* Total packets > 1518 */
660 uint fen_jbrc; /* Total packets > 1518 with errors */
661 uint fen_p64c; /* Total packets == 64 bytes */
662 uint fen_p65c; /* Total packets 64 < bytes <= 127 */
663 uint fen_p128c; /* Total packets 127 < bytes <= 255 */
664 uint fen_p256c; /* Total packets 256 < bytes <= 511 */
665 uint fen_p512c; /* Total packets 512 < bytes <= 1023 */
666 uint fen_p1024c; /* Total packets 1024 < bytes <= 1518 */
667 uint fen_cambuf; /* Internal CAM buffer poiner */
668 ushort fen_rfthr; /* Received frames threshold */
669 ushort fen_rfcnt; /* Received frames count */
670} fcc_enet_t;
671
672/* FCC Event/Mask register as used by Ethernet.
673*/
674#define FCC_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
675#define FCC_ENET_RXC ((ushort)0x0040) /* Control Frame Received */
676#define FCC_ENET_TXC ((ushort)0x0020) /* Out of seq. Tx sent */
677#define FCC_ENET_TXE ((ushort)0x0010) /* Transmit Error */
678#define FCC_ENET_RXF ((ushort)0x0008) /* Full frame received */
679#define FCC_ENET_BSY ((ushort)0x0004) /* Busy. Rx Frame dropped */
680#define FCC_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
681#define FCC_ENET_RXB ((ushort)0x0001) /* A buffer was received */
682
683/* FCC Mode Register (FPSMR) as used by Ethernet.
684*/
685#define FCC_PSMR_HBC ((uint)0x80000000) /* Enable heartbeat */
686#define FCC_PSMR_FC ((uint)0x40000000) /* Force Collision */
687#define FCC_PSMR_SBT ((uint)0x20000000) /* Stop backoff timer */
688#define FCC_PSMR_LPB ((uint)0x10000000) /* Local protect. 1 = FDX */
689#define FCC_PSMR_LCW ((uint)0x08000000) /* Late collision select */
690#define FCC_PSMR_FDE ((uint)0x04000000) /* Full Duplex Enable */
691#define FCC_PSMR_MON ((uint)0x02000000) /* RMON Enable */
692#define FCC_PSMR_PRO ((uint)0x00400000) /* Promiscuous Enable */
693#define FCC_PSMR_FCE ((uint)0x00200000) /* Flow Control Enable */
694#define FCC_PSMR_RSH ((uint)0x00100000) /* Receive Short Frames */
695#define FCC_PSMR_CAM ((uint)0x00000400) /* CAM enable */
696#define FCC_PSMR_BRO ((uint)0x00000200) /* Broadcast pkt discard */
697#define FCC_PSMR_ENCRC ((uint)0x00000080) /* Use 32-bit CRC */
698
699/* IIC parameter RAM.
700*/
701typedef struct iic {
702 ushort iic_rbase; /* Rx Buffer descriptor base address */
703 ushort iic_tbase; /* Tx Buffer descriptor base address */
704 u_char iic_rfcr; /* Rx function code */
705 u_char iic_tfcr; /* Tx function code */
706 ushort iic_mrblr; /* Max receive buffer length */
707 uint iic_rstate; /* Internal */
708 uint iic_rdp; /* Internal */
709 ushort iic_rbptr; /* Internal */
710 ushort iic_rbc; /* Internal */
711 uint iic_rxtmp; /* Internal */
712 uint iic_tstate; /* Internal */
713 uint iic_tdp; /* Internal */
714 ushort iic_tbptr; /* Internal */
715 ushort iic_tbc; /* Internal */
716 uint iic_txtmp; /* Internal */
717} iic_t;
718
719/* SPI parameter RAM.
720*/
721typedef struct spi {
722 ushort spi_rbase; /* Rx Buffer descriptor base address */
723 ushort spi_tbase; /* Tx Buffer descriptor base address */
724 u_char spi_rfcr; /* Rx function code */
725 u_char spi_tfcr; /* Tx function code */
726 ushort spi_mrblr; /* Max receive buffer length */
727 uint spi_rstate; /* Internal */
728 uint spi_rdp; /* Internal */
729 ushort spi_rbptr; /* Internal */
730 ushort spi_rbc; /* Internal */
731 uint spi_rxtmp; /* Internal */
732 uint spi_tstate; /* Internal */
733 uint spi_tdp; /* Internal */
734 ushort spi_tbptr; /* Internal */
735 ushort spi_tbc; /* Internal */
736 uint spi_txtmp; /* Internal */
737 uint spi_res; /* Tx temp. */
738 uint spi_res1[4]; /* SDMA temp. */
739} spi_t;
740
741/* SPI Mode register.
742*/
743#define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
744#define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
745#define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
746#define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
747#define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
748#define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
749#define SPMODE_EN ((ushort)0x0100) /* Enable */
750#define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
751#define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
752
753#define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
754#define SPMODE_PM(x) ((x) &0xF)
755
756#define SPI_EB ((u_char)0x10) /* big endian byte order */
757
758#define BD_IIC_START ((ushort)0x0400)
759
760/* IDMA parameter RAM
761*/
762typedef struct idma {
763 ushort ibase; /* IDMA buffer descriptor table base address */
764 ushort dcm; /* DMA channel mode */
765 ushort ibdptr; /* IDMA current buffer descriptor pointer */
766 ushort dpr_buf; /* IDMA transfer buffer base address */
767 ushort buf_inv; /* internal buffer inventory */
768 ushort ss_max; /* steady-state maximum transfer size */
769 ushort dpr_in_ptr; /* write pointer inside the internal buffer */
770 ushort sts; /* source transfer size */
771 ushort dpr_out_ptr; /* read pointer inside the internal buffer */
772 ushort seob; /* source end of burst */
773 ushort deob; /* destination end of burst */
774 ushort dts; /* destination transfer size */
775 ushort ret_add; /* return address when working in ERM=1 mode */
776 ushort res0; /* reserved */
777 uint bd_cnt; /* internal byte count */
778 uint s_ptr; /* source internal data pointer */
779 uint d_ptr; /* destination internal data pointer */
780 uint istate; /* internal state */
781 u_char res1[20]; /* pad to 64-byte length */
782} idma_t;
783
784/* DMA channel mode bit fields
785*/
786#define IDMA_DCM_FB ((ushort)0x8000) /* fly-by mode */
787#define IDMA_DCM_LP ((ushort)0x4000) /* low priority */
788#define IDMA_DCM_TC2 ((ushort)0x0400) /* value driven on TC[2] */
789#define IDMA_DCM_DMA_WRAP_MASK ((ushort)0x01c0) /* mask for DMA wrap */
790#define IDMA_DCM_DMA_WRAP_64 ((ushort)0x0000) /* 64-byte DMA xfer buffer */
791#define IDMA_DCM_DMA_WRAP_128 ((ushort)0x0040) /* 128-byte DMA xfer buffer */
792#define IDMA_DCM_DMA_WRAP_256 ((ushort)0x0080) /* 256-byte DMA xfer buffer */
793#define IDMA_DCM_DMA_WRAP_512 ((ushort)0x00c0) /* 512-byte DMA xfer buffer */
794#define IDMA_DCM_DMA_WRAP_1024 ((ushort)0x0100) /* 1024-byte DMA xfer buffer */
795#define IDMA_DCM_DMA_WRAP_2048 ((ushort)0x0140) /* 2048-byte DMA xfer buffer */
796#define IDMA_DCM_SINC ((ushort)0x0020) /* source inc addr */
797#define IDMA_DCM_DINC ((ushort)0x0010) /* destination inc addr */
798#define IDMA_DCM_ERM ((ushort)0x0008) /* external request mode */
799#define IDMA_DCM_DT ((ushort)0x0004) /* DONE treatment */
800#define IDMA_DCM_SD_MASK ((ushort)0x0003) /* mask for SD bit field */
801#define IDMA_DCM_SD_MEM2MEM ((ushort)0x0000) /* memory-to-memory xfer */
802#define IDMA_DCM_SD_PER2MEM ((ushort)0x0002) /* peripheral-to-memory xfer */
803#define IDMA_DCM_SD_MEM2PER ((ushort)0x0001) /* memory-to-peripheral xfer */
804
805/* IDMA Buffer Descriptors
806*/
807typedef struct idma_bd {
808 uint flags;
809 uint len; /* data length */
810 uint src; /* source data buffer pointer */
811 uint dst; /* destination data buffer pointer */
812} idma_bd_t;
813
814/* IDMA buffer descriptor flag bit fields
815*/
816#define IDMA_BD_V ((uint)0x80000000) /* valid */
817#define IDMA_BD_W ((uint)0x20000000) /* wrap */
818#define IDMA_BD_I ((uint)0x10000000) /* interrupt */
819#define IDMA_BD_L ((uint)0x08000000) /* last */
820#define IDMA_BD_CM ((uint)0x02000000) /* continuous mode */
821#define IDMA_BD_SDN ((uint)0x00400000) /* source done */
822#define IDMA_BD_DDN ((uint)0x00200000) /* destination done */
823#define IDMA_BD_DGBL ((uint)0x00100000) /* destination global */
824#define IDMA_BD_DBO_LE ((uint)0x00040000) /* little-end dest byte order */
825#define IDMA_BD_DBO_BE ((uint)0x00080000) /* big-end dest byte order */
826#define IDMA_BD_DDTB ((uint)0x00010000) /* destination data bus */
827#define IDMA_BD_SGBL ((uint)0x00002000) /* source global */
828#define IDMA_BD_SBO_LE ((uint)0x00000800) /* little-end src byte order */
829#define IDMA_BD_SBO_BE ((uint)0x00001000) /* big-end src byte order */
830#define IDMA_BD_SDTB ((uint)0x00000200) /* source data bus */
831
832/* per-channel IDMA registers
833*/
834typedef struct im_idma {
835 u_char idsr; /* IDMAn event status register */
836 u_char res0[3];
837 u_char idmr; /* IDMAn event mask register */
838 u_char res1[3];
839} im_idma_t;
840
841/* IDMA event register bit fields
842*/
843#define IDMA_EVENT_SC ((unsigned char)0x08) /* stop completed */
844#define IDMA_EVENT_OB ((unsigned char)0x04) /* out of buffers */
845#define IDMA_EVENT_EDN ((unsigned char)0x02) /* external DONE asserted */
846#define IDMA_EVENT_BC ((unsigned char)0x01) /* buffer descriptor complete */
847
848/* RISC Controller Configuration Register (RCCR) bit fields
849*/
850#define RCCR_TIME ((uint)0x80000000) /* timer enable */
851#define RCCR_TIMEP_MASK ((uint)0x3f000000) /* mask for timer period bit field */
852#define RCCR_DR0M ((uint)0x00800000) /* IDMA0 request mode */
853#define RCCR_DR1M ((uint)0x00400000) /* IDMA1 request mode */
854#define RCCR_DR2M ((uint)0x00000080) /* IDMA2 request mode */
855#define RCCR_DR3M ((uint)0x00000040) /* IDMA3 request mode */
856#define RCCR_DR0QP_MASK ((uint)0x00300000) /* mask for IDMA0 req priority */
857#define RCCR_DR0QP_HIGH ((uint)0x00000000) /* IDMA0 has high req priority */
858#define RCCR_DR0QP_MED ((uint)0x00100000) /* IDMA0 has medium req priority */
859#define RCCR_DR0QP_LOW ((uint)0x00200000) /* IDMA0 has low req priority */
860#define RCCR_DR1QP_MASK ((uint)0x00030000) /* mask for IDMA1 req priority */
861#define RCCR_DR1QP_HIGH ((uint)0x00000000) /* IDMA1 has high req priority */
862#define RCCR_DR1QP_MED ((uint)0x00010000) /* IDMA1 has medium req priority */
863#define RCCR_DR1QP_LOW ((uint)0x00020000) /* IDMA1 has low req priority */
864#define RCCR_DR2QP_MASK ((uint)0x00000030) /* mask for IDMA2 req priority */
865#define RCCR_DR2QP_HIGH ((uint)0x00000000) /* IDMA2 has high req priority */
866#define RCCR_DR2QP_MED ((uint)0x00000010) /* IDMA2 has medium req priority */
867#define RCCR_DR2QP_LOW ((uint)0x00000020) /* IDMA2 has low req priority */
868#define RCCR_DR3QP_MASK ((uint)0x00000003) /* mask for IDMA3 req priority */
869#define RCCR_DR3QP_HIGH ((uint)0x00000000) /* IDMA3 has high req priority */
870#define RCCR_DR3QP_MED ((uint)0x00000001) /* IDMA3 has medium req priority */
871#define RCCR_DR3QP_LOW ((uint)0x00000002) /* IDMA3 has low req priority */
872#define RCCR_EIE ((uint)0x00080000) /* external interrupt enable */
873#define RCCR_SCD ((uint)0x00040000) /* scheduler configuration */
874#define RCCR_ERAM_MASK ((uint)0x0000e000) /* mask for enable RAM microcode */
875#define RCCR_ERAM_0KB ((uint)0x00000000) /* use 0KB of dpram for microcode */
876#define RCCR_ERAM_2KB ((uint)0x00002000) /* use 2KB of dpram for microcode */
877#define RCCR_ERAM_4KB ((uint)0x00004000) /* use 4KB of dpram for microcode */
878#define RCCR_ERAM_6KB ((uint)0x00006000) /* use 6KB of dpram for microcode */
879#define RCCR_ERAM_8KB ((uint)0x00008000) /* use 8KB of dpram for microcode */
880#define RCCR_ERAM_10KB ((uint)0x0000a000) /* use 10KB of dpram for microcode */
881#define RCCR_ERAM_12KB ((uint)0x0000c000) /* use 12KB of dpram for microcode */
882#define RCCR_EDM0 ((uint)0x00000800) /* DREQ0 edge detect mode */
883#define RCCR_EDM1 ((uint)0x00000400) /* DREQ1 edge detect mode */
884#define RCCR_EDM2 ((uint)0x00000200) /* DREQ2 edge detect mode */
885#define RCCR_EDM3 ((uint)0x00000100) /* DREQ3 edge detect mode */
886#define RCCR_DEM01 ((uint)0x00000008) /* DONE0/DONE1 edge detect mode */
887#define RCCR_DEM23 ((uint)0x00000004) /* DONE2/DONE3 edge detect mode */
888
889/*-----------------------------------------------------------------------
890 * CMXFCR - CMX FCC Clock Route Register
891 */
892#define CMXFCR_FC1 0x40000000 /* FCC1 connection */
893#define CMXFCR_RF1CS_MSK 0x38000000 /* Receive FCC1 Clock Source Mask */
894#define CMXFCR_TF1CS_MSK 0x07000000 /* Transmit FCC1 Clock Source Mask */
895#define CMXFCR_FC2 0x00400000 /* FCC2 connection */
896#define CMXFCR_RF2CS_MSK 0x00380000 /* Receive FCC2 Clock Source Mask */
897#define CMXFCR_TF2CS_MSK 0x00070000 /* Transmit FCC2 Clock Source Mask */
898#define CMXFCR_FC3 0x00004000 /* FCC3 connection */
899#define CMXFCR_RF3CS_MSK 0x00003800 /* Receive FCC3 Clock Source Mask */
900#define CMXFCR_TF3CS_MSK 0x00000700 /* Transmit FCC3 Clock Source Mask */
901
902#define CMXFCR_RF1CS_BRG5 0x00000000 /* Receive FCC1 Clock Source is BRG5 */
903#define CMXFCR_RF1CS_BRG6 0x08000000 /* Receive FCC1 Clock Source is BRG6 */
904#define CMXFCR_RF1CS_BRG7 0x10000000 /* Receive FCC1 Clock Source is BRG7 */
905#define CMXFCR_RF1CS_BRG8 0x18000000 /* Receive FCC1 Clock Source is BRG8 */
906#define CMXFCR_RF1CS_CLK9 0x20000000 /* Receive FCC1 Clock Source is CLK9 */
907#define CMXFCR_RF1CS_CLK10 0x28000000 /* Receive FCC1 Clock Source is CLK10 */
908#define CMXFCR_RF1CS_CLK11 0x30000000 /* Receive FCC1 Clock Source is CLK11 */
909#define CMXFCR_RF1CS_CLK12 0x38000000 /* Receive FCC1 Clock Source is CLK12 */
910
911#define CMXFCR_TF1CS_BRG5 0x00000000 /* Transmit FCC1 Clock Source is BRG5 */
912#define CMXFCR_TF1CS_BRG6 0x01000000 /* Transmit FCC1 Clock Source is BRG6 */
913#define CMXFCR_TF1CS_BRG7 0x02000000 /* Transmit FCC1 Clock Source is BRG7 */
914#define CMXFCR_TF1CS_BRG8 0x03000000 /* Transmit FCC1 Clock Source is BRG8 */
915#define CMXFCR_TF1CS_CLK9 0x04000000 /* Transmit FCC1 Clock Source is CLK9 */
916#define CMXFCR_TF1CS_CLK10 0x05000000 /* Transmit FCC1 Clock Source is CLK10 */
917#define CMXFCR_TF1CS_CLK11 0x06000000 /* Transmit FCC1 Clock Source is CLK11 */
918#define CMXFCR_TF1CS_CLK12 0x07000000 /* Transmit FCC1 Clock Source is CLK12 */
919
920#define CMXFCR_RF2CS_BRG5 0x00000000 /* Receive FCC2 Clock Source is BRG5 */
921#define CMXFCR_RF2CS_BRG6 0x00080000 /* Receive FCC2 Clock Source is BRG6 */
922#define CMXFCR_RF2CS_BRG7 0x00100000 /* Receive FCC2 Clock Source is BRG7 */
923#define CMXFCR_RF2CS_BRG8 0x00180000 /* Receive FCC2 Clock Source is BRG8 */
924#define CMXFCR_RF2CS_CLK13 0x00200000 /* Receive FCC2 Clock Source is CLK13 */
925#define CMXFCR_RF2CS_CLK14 0x00280000 /* Receive FCC2 Clock Source is CLK14 */
926#define CMXFCR_RF2CS_CLK15 0x00300000 /* Receive FCC2 Clock Source is CLK15 */
927#define CMXFCR_RF2CS_CLK16 0x00380000 /* Receive FCC2 Clock Source is CLK16 */
928
929#define CMXFCR_TF2CS_BRG5 0x00000000 /* Transmit FCC2 Clock Source is BRG5 */
930#define CMXFCR_TF2CS_BRG6 0x00010000 /* Transmit FCC2 Clock Source is BRG6 */
931#define CMXFCR_TF2CS_BRG7 0x00020000 /* Transmit FCC2 Clock Source is BRG7 */
932#define CMXFCR_TF2CS_BRG8 0x00030000 /* Transmit FCC2 Clock Source is BRG8 */
933#define CMXFCR_TF2CS_CLK13 0x00040000 /* Transmit FCC2 Clock Source is CLK13 */
934#define CMXFCR_TF2CS_CLK14 0x00050000 /* Transmit FCC2 Clock Source is CLK14 */
935#define CMXFCR_TF2CS_CLK15 0x00060000 /* Transmit FCC2 Clock Source is CLK15 */
936#define CMXFCR_TF2CS_CLK16 0x00070000 /* Transmit FCC2 Clock Source is CLK16 */
937
938#define CMXFCR_RF3CS_BRG5 0x00000000 /* Receive FCC3 Clock Source is BRG5 */
939#define CMXFCR_RF3CS_BRG6 0x00000800 /* Receive FCC3 Clock Source is BRG6 */
940#define CMXFCR_RF3CS_BRG7 0x00001000 /* Receive FCC3 Clock Source is BRG7 */
941#define CMXFCR_RF3CS_BRG8 0x00001800 /* Receive FCC3 Clock Source is BRG8 */
942#define CMXFCR_RF3CS_CLK13 0x00002000 /* Receive FCC3 Clock Source is CLK13 */
943#define CMXFCR_RF3CS_CLK14 0x00002800 /* Receive FCC3 Clock Source is CLK14 */
944#define CMXFCR_RF3CS_CLK15 0x00003000 /* Receive FCC3 Clock Source is CLK15 */
945#define CMXFCR_RF3CS_CLK16 0x00003800 /* Receive FCC3 Clock Source is CLK16 */
946
947#define CMXFCR_TF3CS_BRG5 0x00000000 /* Transmit FCC3 Clock Source is BRG5 */
948#define CMXFCR_TF3CS_BRG6 0x00000100 /* Transmit FCC3 Clock Source is BRG6 */
949#define CMXFCR_TF3CS_BRG7 0x00000200 /* Transmit FCC3 Clock Source is BRG7 */
950#define CMXFCR_TF3CS_BRG8 0x00000300 /* Transmit FCC3 Clock Source is BRG8 */
951#define CMXFCR_TF3CS_CLK13 0x00000400 /* Transmit FCC3 Clock Source is CLK13 */
952#define CMXFCR_TF3CS_CLK14 0x00000500 /* Transmit FCC3 Clock Source is CLK14 */
953#define CMXFCR_TF3CS_CLK15 0x00000600 /* Transmit FCC3 Clock Source is CLK15 */
954#define CMXFCR_TF3CS_CLK16 0x00000700 /* Transmit FCC3 Clock Source is CLK16 */
955
956/*-----------------------------------------------------------------------
957 * CMXSCR - CMX SCC Clock Route Register
958 */
959#define CMXSCR_GR1 0x80000000 /* Grant Support of SCC1 */
960#define CMXSCR_SC1 0x40000000 /* SCC1 connection */
961#define CMXSCR_RS1CS_MSK 0x38000000 /* Receive SCC1 Clock Source Mask */
962#define CMXSCR_TS1CS_MSK 0x07000000 /* Transmit SCC1 Clock Source Mask */
963#define CMXSCR_GR2 0x00800000 /* Grant Support of SCC2 */
964#define CMXSCR_SC2 0x00400000 /* SCC2 connection */
965#define CMXSCR_RS2CS_MSK 0x00380000 /* Receive SCC2 Clock Source Mask */
966#define CMXSCR_TS2CS_MSK 0x00070000 /* Transmit SCC2 Clock Source Mask */
967#define CMXSCR_GR3 0x00008000 /* Grant Support of SCC3 */
968#define CMXSCR_SC3 0x00004000 /* SCC3 connection */
969#define CMXSCR_RS3CS_MSK 0x00003800 /* Receive SCC3 Clock Source Mask */
970#define CMXSCR_TS3CS_MSK 0x00000700 /* Transmit SCC3 Clock Source Mask */
971#define CMXSCR_GR4 0x00000080 /* Grant Support of SCC4 */
972#define CMXSCR_SC4 0x00000040 /* SCC4 connection */
973#define CMXSCR_RS4CS_MSK 0x00000038 /* Receive SCC4 Clock Source Mask */
974#define CMXSCR_TS4CS_MSK 0x00000007 /* Transmit SCC4 Clock Source Mask */
975
976#define CMXSCR_RS1CS_BRG1 0x00000000 /* SCC1 Rx Clock Source is BRG1 */
977#define CMXSCR_RS1CS_BRG2 0x08000000 /* SCC1 Rx Clock Source is BRG2 */
978#define CMXSCR_RS1CS_BRG3 0x10000000 /* SCC1 Rx Clock Source is BRG3 */
979#define CMXSCR_RS1CS_BRG4 0x18000000 /* SCC1 Rx Clock Source is BRG4 */
980#define CMXSCR_RS1CS_CLK11 0x20000000 /* SCC1 Rx Clock Source is CLK11 */
981#define CMXSCR_RS1CS_CLK12 0x28000000 /* SCC1 Rx Clock Source is CLK12 */
982#define CMXSCR_RS1CS_CLK3 0x30000000 /* SCC1 Rx Clock Source is CLK3 */
983#define CMXSCR_RS1CS_CLK4 0x38000000 /* SCC1 Rx Clock Source is CLK4 */
984
985#define CMXSCR_TS1CS_BRG1 0x00000000 /* SCC1 Tx Clock Source is BRG1 */
986#define CMXSCR_TS1CS_BRG2 0x01000000 /* SCC1 Tx Clock Source is BRG2 */
987#define CMXSCR_TS1CS_BRG3 0x02000000 /* SCC1 Tx Clock Source is BRG3 */
988#define CMXSCR_TS1CS_BRG4 0x03000000 /* SCC1 Tx Clock Source is BRG4 */
989#define CMXSCR_TS1CS_CLK11 0x04000000 /* SCC1 Tx Clock Source is CLK11 */
990#define CMXSCR_TS1CS_CLK12 0x05000000 /* SCC1 Tx Clock Source is CLK12 */
991#define CMXSCR_TS1CS_CLK3 0x06000000 /* SCC1 Tx Clock Source is CLK3 */
992#define CMXSCR_TS1CS_CLK4 0x07000000 /* SCC1 Tx Clock Source is CLK4 */
993
994#define CMXSCR_RS2CS_BRG1 0x00000000 /* SCC2 Rx Clock Source is BRG1 */
995#define CMXSCR_RS2CS_BRG2 0x00080000 /* SCC2 Rx Clock Source is BRG2 */
996#define CMXSCR_RS2CS_BRG3 0x00100000 /* SCC2 Rx Clock Source is BRG3 */
997#define CMXSCR_RS2CS_BRG4 0x00180000 /* SCC2 Rx Clock Source is BRG4 */
998#define CMXSCR_RS2CS_CLK11 0x00200000 /* SCC2 Rx Clock Source is CLK11 */
999#define CMXSCR_RS2CS_CLK12 0x00280000 /* SCC2 Rx Clock Source is CLK12 */
1000#define CMXSCR_RS2CS_CLK3 0x00300000 /* SCC2 Rx Clock Source is CLK3 */
1001#define CMXSCR_RS2CS_CLK4 0x00380000 /* SCC2 Rx Clock Source is CLK4 */
1002
1003#define CMXSCR_TS2CS_BRG1 0x00000000 /* SCC2 Tx Clock Source is BRG1 */
1004#define CMXSCR_TS2CS_BRG2 0x00010000 /* SCC2 Tx Clock Source is BRG2 */
1005#define CMXSCR_TS2CS_BRG3 0x00020000 /* SCC2 Tx Clock Source is BRG3 */
1006#define CMXSCR_TS2CS_BRG4 0x00030000 /* SCC2 Tx Clock Source is BRG4 */
1007#define CMXSCR_TS2CS_CLK11 0x00040000 /* SCC2 Tx Clock Source is CLK11 */
1008#define CMXSCR_TS2CS_CLK12 0x00050000 /* SCC2 Tx Clock Source is CLK12 */
1009#define CMXSCR_TS2CS_CLK3 0x00060000 /* SCC2 Tx Clock Source is CLK3 */
1010#define CMXSCR_TS2CS_CLK4 0x00070000 /* SCC2 Tx Clock Source is CLK4 */
1011
1012#define CMXSCR_RS3CS_BRG1 0x00000000 /* SCC3 Rx Clock Source is BRG1 */
1013#define CMXSCR_RS3CS_BRG2 0x00000800 /* SCC3 Rx Clock Source is BRG2 */
1014#define CMXSCR_RS3CS_BRG3 0x00001000 /* SCC3 Rx Clock Source is BRG3 */
1015#define CMXSCR_RS3CS_BRG4 0x00001800 /* SCC3 Rx Clock Source is BRG4 */
1016#define CMXSCR_RS3CS_CLK5 0x00002000 /* SCC3 Rx Clock Source is CLK5 */
1017#define CMXSCR_RS3CS_CLK6 0x00002800 /* SCC3 Rx Clock Source is CLK6 */
1018#define CMXSCR_RS3CS_CLK7 0x00003000 /* SCC3 Rx Clock Source is CLK7 */
1019#define CMXSCR_RS3CS_CLK8 0x00003800 /* SCC3 Rx Clock Source is CLK8 */
1020
1021#define CMXSCR_TS3CS_BRG1 0x00000000 /* SCC3 Tx Clock Source is BRG1 */
1022#define CMXSCR_TS3CS_BRG2 0x00000100 /* SCC3 Tx Clock Source is BRG2 */
1023#define CMXSCR_TS3CS_BRG3 0x00000200 /* SCC3 Tx Clock Source is BRG3 */
1024#define CMXSCR_TS3CS_BRG4 0x00000300 /* SCC3 Tx Clock Source is BRG4 */
1025#define CMXSCR_TS3CS_CLK5 0x00000400 /* SCC3 Tx Clock Source is CLK5 */
1026#define CMXSCR_TS3CS_CLK6 0x00000500 /* SCC3 Tx Clock Source is CLK6 */
1027#define CMXSCR_TS3CS_CLK7 0x00000600 /* SCC3 Tx Clock Source is CLK7 */
1028#define CMXSCR_TS3CS_CLK8 0x00000700 /* SCC3 Tx Clock Source is CLK8 */
1029
1030#define CMXSCR_RS4CS_BRG1 0x00000000 /* SCC4 Rx Clock Source is BRG1 */
1031#define CMXSCR_RS4CS_BRG2 0x00000008 /* SCC4 Rx Clock Source is BRG2 */
1032#define CMXSCR_RS4CS_BRG3 0x00000010 /* SCC4 Rx Clock Source is BRG3 */
1033#define CMXSCR_RS4CS_BRG4 0x00000018 /* SCC4 Rx Clock Source is BRG4 */
1034#define CMXSCR_RS4CS_CLK5 0x00000020 /* SCC4 Rx Clock Source is CLK5 */
1035#define CMXSCR_RS4CS_CLK6 0x00000028 /* SCC4 Rx Clock Source is CLK6 */
1036#define CMXSCR_RS4CS_CLK7 0x00000030 /* SCC4 Rx Clock Source is CLK7 */
1037#define CMXSCR_RS4CS_CLK8 0x00000038 /* SCC4 Rx Clock Source is CLK8 */
1038
1039#define CMXSCR_TS4CS_BRG1 0x00000000 /* SCC4 Tx Clock Source is BRG1 */
1040#define CMXSCR_TS4CS_BRG2 0x00000001 /* SCC4 Tx Clock Source is BRG2 */
1041#define CMXSCR_TS4CS_BRG3 0x00000002 /* SCC4 Tx Clock Source is BRG3 */
1042#define CMXSCR_TS4CS_BRG4 0x00000003 /* SCC4 Tx Clock Source is BRG4 */
1043#define CMXSCR_TS4CS_CLK5 0x00000004 /* SCC4 Tx Clock Source is CLK5 */
1044#define CMXSCR_TS4CS_CLK6 0x00000005 /* SCC4 Tx Clock Source is CLK6 */
1045#define CMXSCR_TS4CS_CLK7 0x00000006 /* SCC4 Tx Clock Source is CLK7 */
1046#define CMXSCR_TS4CS_CLK8 0x00000007 /* SCC4 Tx Clock Source is CLK8 */
1047
1048/*-----------------------------------------------------------------------
1049 * SIUMCR - SIU Module Configuration Register 4-31
1050 */
1051#define SIUMCR_BBD 0x80000000 /* Bus Busy Disable */
1052#define SIUMCR_ESE 0x40000000 /* External Snoop Enable */
1053#define SIUMCR_PBSE 0x20000000 /* Parity Byte Select Enable */
1054#define SIUMCR_CDIS 0x10000000 /* Core Disable */
1055#define SIUMCR_DPPC00 0x00000000 /* Data Parity Pins Configuration*/
1056#define SIUMCR_DPPC01 0x04000000 /* - " - */
1057#define SIUMCR_DPPC10 0x08000000 /* - " - */
1058#define SIUMCR_DPPC11 0x0c000000 /* - " - */
1059#define SIUMCR_L2CPC00 0x00000000 /* L2 Cache Pins Configuration */
1060#define SIUMCR_L2CPC01 0x01000000 /* - " - */
1061#define SIUMCR_L2CPC10 0x02000000 /* - " - */
1062#define SIUMCR_L2CPC11 0x03000000 /* - " - */
1063#define SIUMCR_LBPC00 0x00000000 /* Local Bus Pins Configuration */
1064#define SIUMCR_LBPC01 0x00400000 /* - " - */
1065#define SIUMCR_LBPC10 0x00800000 /* - " - */
1066#define SIUMCR_LBPC11 0x00c00000 /* - " - */
1067#define SIUMCR_APPC00 0x00000000 /* Address Parity Pins Configuration*/
1068#define SIUMCR_APPC01 0x00100000 /* - " - */
1069#define SIUMCR_APPC10 0x00200000 /* - " - */
1070#define SIUMCR_APPC11 0x00300000 /* - " - */
1071#define SIUMCR_CS10PC00 0x00000000 /* CS10 Pin Configuration */
1072#define SIUMCR_CS10PC01 0x00040000 /* - " - */
1073#define SIUMCR_CS10PC10 0x00080000 /* - " - */
1074#define SIUMCR_CS10PC11 0x000c0000 /* - " - */
1075#define SIUMCR_BCTLC00 0x00000000 /* Buffer Control Configuration */
1076#define SIUMCR_BCTLC01 0x00010000 /* - " - */
1077#define SIUMCR_BCTLC10 0x00020000 /* - " - */
1078#define SIUMCR_BCTLC11 0x00030000 /* - " - */
1079#define SIUMCR_MMR00 0x00000000 /* Mask Masters Requests */
1080#define SIUMCR_MMR01 0x00004000 /* - " - */
1081#define SIUMCR_MMR10 0x00008000 /* - " - */
1082#define SIUMCR_MMR11 0x0000c000 /* - " - */
1083#define SIUMCR_LPBSE 0x00002000 /* LocalBus Parity Byte Select Enable*/
1084
1085/*-----------------------------------------------------------------------
1086 * SCCR - System Clock Control Register 9-8
1087*/
1088#define SCCR_PCI_MODE 0x00000100 /* PCI Mode */
1089#define SCCR_PCI_MODCK 0x00000080 /* Value of PCI_MODCK pin */
1090#define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */
1091#define SCCR_PCIDF_SHIFT 3
1092
1093#ifndef CPM_IMMR_OFFSET
1094#define CPM_IMMR_OFFSET 0x101a8
1095#endif
1096
1097#define FCC_PSMR_RMII ((uint)0x00020000) /* Use RMII interface */
1098
1099/* FCC iop & clock configuration. BSP code is responsible to define Fx_RXCLK & Fx_TXCLK
1100 * in order to use clock-computing stuff below for the FCC x
1101 */
1102
1103/* Automatically generates register configurations */
1104#define PC_CLK(x) ((uint)(1<<(x-1))) /* FCC CLK I/O ports */
1105
1106#define CMXFCR_RF1CS(x) ((uint)((x-5)<<27)) /* FCC1 Receive Clock Source */
1107#define CMXFCR_TF1CS(x) ((uint)((x-5)<<24)) /* FCC1 Transmit Clock Source */
1108#define CMXFCR_RF2CS(x) ((uint)((x-9)<<19)) /* FCC2 Receive Clock Source */
1109#define CMXFCR_TF2CS(x) ((uint)((x-9)<<16)) /* FCC2 Transmit Clock Source */
1110#define CMXFCR_RF3CS(x) ((uint)((x-9)<<11)) /* FCC3 Receive Clock Source */
1111#define CMXFCR_TF3CS(x) ((uint)((x-9)<<8)) /* FCC3 Transmit Clock Source */
1112
1113#define PC_F1RXCLK PC_CLK(F1_RXCLK)
1114#define PC_F1TXCLK PC_CLK(F1_TXCLK)
1115#define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
1116#define CMX1_CLK_MASK ((uint)0xff000000)
1117
1118#define PC_F2RXCLK PC_CLK(F2_RXCLK)
1119#define PC_F2TXCLK PC_CLK(F2_TXCLK)
1120#define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
1121#define CMX2_CLK_MASK ((uint)0x00ff0000)
1122
1123#define PC_F3RXCLK PC_CLK(F3_RXCLK)
1124#define PC_F3TXCLK PC_CLK(F3_TXCLK)
1125#define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
1126#define CMX3_CLK_MASK ((uint)0x0000ff00)
1127
1128#define CPMUX_CLK_MASK (CMX3_CLK_MASK | CMX2_CLK_MASK)
1129#define CPMUX_CLK_ROUTE (CMX3_CLK_ROUTE | CMX2_CLK_ROUTE)
1130
1131#define CLK_TRX (PC_F3TXCLK | PC_F3RXCLK | PC_F2TXCLK | PC_F2RXCLK)
1132
1133/* I/O Pin assignment for FCC1. I don't yet know the best way to do this,
1134 * but there is little variation among the choices.
1135 */
1136#define PA1_COL 0x00000001U
1137#define PA1_CRS 0x00000002U
1138#define PA1_TXER 0x00000004U
1139#define PA1_TXEN 0x00000008U
1140#define PA1_RXDV 0x00000010U
1141#define PA1_RXER 0x00000020U
1142#define PA1_TXDAT 0x00003c00U
1143#define PA1_RXDAT 0x0003c000U
1144#define PA1_PSORA0 (PA1_RXDAT | PA1_TXDAT)
1145#define PA1_PSORA1 (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
1146 PA1_RXDV | PA1_RXER)
1147#define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
1148#define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
1149
1150
1151/* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
1152 * but there is little variation among the choices.
1153 */
1154#define PB2_TXER 0x00000001U
1155#define PB2_RXDV 0x00000002U
1156#define PB2_TXEN 0x00000004U
1157#define PB2_RXER 0x00000008U
1158#define PB2_COL 0x00000010U
1159#define PB2_CRS 0x00000020U
1160#define PB2_TXDAT 0x000003c0U
1161#define PB2_RXDAT 0x00003c00U
1162#define PB2_PSORB0 (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
1163 PB2_RXER | PB2_RXDV | PB2_TXER)
1164#define PB2_PSORB1 (PB2_TXEN)
1165#define PB2_DIRB0 (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
1166#define PB2_DIRB1 (PB2_TXDAT | PB2_TXEN | PB2_TXER)
1167
1168
1169/* I/O Pin assignment for FCC3. I don't yet know the best way to do this,
1170 * but there is little variation among the choices.
1171 */
1172#define PB3_RXDV 0x00004000U
1173#define PB3_RXER 0x00008000U
1174#define PB3_TXER 0x00010000U
1175#define PB3_TXEN 0x00020000U
1176#define PB3_COL 0x00040000U
1177#define PB3_CRS 0x00080000U
1178#define PB3_TXDAT 0x0f000000U
1179#define PC3_TXDAT 0x00000010U
1180#define PB3_RXDAT 0x00f00000U
1181#define PB3_PSORB0 (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
1182 PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
1183#define PB3_PSORB1 0
1184#define PB3_DIRB0 (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
1185#define PB3_DIRB1 (PB3_TXDAT | PB3_TXEN | PB3_TXER)
1186#define PC3_DIRC1 (PC3_TXDAT)
1187
1188/* Handy macro to specify mem for FCCs*/
1189#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
1190#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
1191#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
1192#define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2)
1193
1194/* Clocks and GRG's */
1195
1196enum cpm_clk_dir {
1197 CPM_CLK_RX,
1198 CPM_CLK_TX,
1199 CPM_CLK_RTX
1200};
1201
1202enum cpm_clk_target {
1203 CPM_CLK_SCC1,
1204 CPM_CLK_SCC2,
1205 CPM_CLK_SCC3,
1206 CPM_CLK_SCC4,
1207 CPM_CLK_FCC1,
1208 CPM_CLK_FCC2,
1209 CPM_CLK_FCC3
1210};
1211
1212enum cpm_clk {
1213 CPM_CLK_NONE = 0,
1214 CPM_BRG1, /* Baud Rate Generator 1 */
1215 CPM_BRG2, /* Baud Rate Generator 2 */
1216 CPM_BRG3, /* Baud Rate Generator 3 */
1217 CPM_BRG4, /* Baud Rate Generator 4 */
1218 CPM_BRG5, /* Baud Rate Generator 5 */
1219 CPM_BRG6, /* Baud Rate Generator 6 */
1220 CPM_BRG7, /* Baud Rate Generator 7 */
1221 CPM_BRG8, /* Baud Rate Generator 8 */
1222 CPM_CLK1, /* Clock 1 */
1223 CPM_CLK2, /* Clock 2 */
1224 CPM_CLK3, /* Clock 3 */
1225 CPM_CLK4, /* Clock 4 */
1226 CPM_CLK5, /* Clock 5 */
1227 CPM_CLK6, /* Clock 6 */
1228 CPM_CLK7, /* Clock 7 */
1229 CPM_CLK8, /* Clock 8 */
1230 CPM_CLK9, /* Clock 9 */
1231 CPM_CLK10, /* Clock 10 */
1232 CPM_CLK11, /* Clock 11 */
1233 CPM_CLK12, /* Clock 12 */
1234 CPM_CLK13, /* Clock 13 */
1235 CPM_CLK14, /* Clock 14 */
1236 CPM_CLK15, /* Clock 15 */
1237 CPM_CLK16, /* Clock 16 */
1238 CPM_CLK17, /* Clock 17 */
1239 CPM_CLK18, /* Clock 18 */
1240 CPM_CLK19, /* Clock 19 */
1241 CPM_CLK20, /* Clock 20 */
1242 CPM_CLK_DUMMY
1243};
1244
1245extern int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode);
1246
1247#endif /* __CPM2__ */
1248#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index 744d6bb24116..d05891608f74 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -249,8 +249,12 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
249 return virt_to_bus(ptr); 249 return virt_to_bus(ptr);
250} 250}
251 251
252/* We do nothing. */ 252static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
253#define dma_unmap_single(dev, addr, size, dir) ((void)0) 253 size_t size,
254 enum dma_data_direction direction)
255{
256 /* We do nothing. */
257}
254 258
255static inline dma_addr_t 259static inline dma_addr_t
256dma_map_page(struct device *dev, struct page *page, 260dma_map_page(struct device *dev, struct page *page,
@@ -264,8 +268,12 @@ dma_map_page(struct device *dev, struct page *page,
264 return page_to_bus(page) + offset; 268 return page_to_bus(page) + offset;
265} 269}
266 270
267/* We do nothing. */ 271static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
268#define dma_unmap_page(dev, handle, size, dir) ((void)0) 272 size_t size,
273 enum dma_data_direction direction)
274{
275 /* We do nothing. */
276}
269 277
270static inline int 278static inline int
271dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 279dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
@@ -284,8 +292,12 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
284 return nents; 292 return nents;
285} 293}
286 294
287/* We don't do anything here. */ 295static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
288#define dma_unmap_sg(dev, sg, nents, dir) ((void)0) 296 int nhwentries,
297 enum dma_data_direction direction)
298{
299 /* We don't do anything here. */
300}
289 301
290#endif /* CONFIG_PPC64 */ 302#endif /* CONFIG_PPC64 */
291 303
diff --git a/include/asm-powerpc/exception.h b/include/asm-powerpc/exception.h
new file mode 100644
index 000000000000..d850c8ea5903
--- /dev/null
+++ b/include/asm-powerpc/exception.h
@@ -0,0 +1,309 @@
1#ifndef _ASM_POWERPC_EXCEPTION_H
2#define _ASM_POWERPC_EXCEPTION_H
3/*
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27/*
28 * The following macros define the code that appears as
29 * the prologue to each of the exception handlers. They
30 * are split into two parts to allow a single kernel binary
31 * to be used for pSeries and iSeries.
32 *
33 * We make as much of the exception code common between native
34 * exception handlers (including pSeries LPAR) and iSeries LPAR
35 * implementations as possible.
36 */
37
38#define EX_R9 0
39#define EX_R10 8
40#define EX_R11 16
41#define EX_R12 24
42#define EX_R13 32
43#define EX_SRR0 40
44#define EX_DAR 48
45#define EX_DSISR 56
46#define EX_CCR 60
47#define EX_R3 64
48#define EX_LR 72
49
50/*
51 * We're short on space and time in the exception prolog, so we can't
52 * use the normal SET_REG_IMMEDIATE macro. Normally we just need the
53 * low halfword of the address, but for Kdump we need the whole low
54 * word.
55 */
56#ifdef CONFIG_CRASH_DUMP
57#define LOAD_HANDLER(reg, label) \
58 oris reg,reg,(label)@h; /* virt addr of handler ... */ \
59 ori reg,reg,(label)@l; /* .. and the rest */
60#else
61#define LOAD_HANDLER(reg, label) \
62 ori reg,reg,(label)@l; /* virt addr of handler ... */
63#endif
64
65#define EXCEPTION_PROLOG_1(area) \
66 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
67 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
68 std r10,area+EX_R10(r13); \
69 std r11,area+EX_R11(r13); \
70 std r12,area+EX_R12(r13); \
71 mfspr r9,SPRN_SPRG1; \
72 std r9,area+EX_R13(r13); \
73 mfcr r9
74
75/*
76 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
77 * The firmware calls the registered system_reset_fwnmi and
78 * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run
79 * a 32bit application at the time of the event.
80 * This firmware bug is present on POWER4 and JS20.
81 */
82#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \
83 EXCEPTION_PROLOG_1(area); \
84 clrrdi r12,r13,32; /* get high part of &label */ \
85 mfmsr r10; \
86 /* force 64bit mode */ \
87 li r11,5; /* MSR_SF_LG|MSR_ISF_LG */ \
88 rldimi r10,r11,61,0; /* insert into top 3 bits */ \
89 /* done 64bit mode */ \
90 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
91 LOAD_HANDLER(r12,label) \
92 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
93 mtspr SPRN_SRR0,r12; \
94 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
95 mtspr SPRN_SRR1,r10; \
96 rfid; \
97 b . /* prevent speculative execution */
98
99#define EXCEPTION_PROLOG_PSERIES(area, label) \
100 EXCEPTION_PROLOG_1(area); \
101 clrrdi r12,r13,32; /* get high part of &label */ \
102 mfmsr r10; \
103 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
104 LOAD_HANDLER(r12,label) \
105 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
106 mtspr SPRN_SRR0,r12; \
107 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
108 mtspr SPRN_SRR1,r10; \
109 rfid; \
110 b . /* prevent speculative execution */
111
112/*
113 * The common exception prolog is used for all except a few exceptions
114 * such as a segment miss on a kernel address. We have to be prepared
115 * to take another exception from the point where we first touch the
116 * kernel stack onwards.
117 *
118 * On entry r13 points to the paca, r9-r13 are saved in the paca,
119 * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
120 * SRR1, and relocation is on.
121 */
122#define EXCEPTION_PROLOG_COMMON(n, area) \
123 andi. r10,r12,MSR_PR; /* See if coming from user */ \
124 mr r10,r1; /* Save r1 */ \
125 subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
126 beq- 1f; \
127 ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
1281: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
129 bge- cr1,2f; /* abort if it is */ \
130 b 3f; \
1312: li r1,(n); /* will be reloaded later */ \
132 sth r1,PACA_TRAP_SAVE(r13); \
133 b bad_stack; \
1343: std r9,_CCR(r1); /* save CR in stackframe */ \
135 std r11,_NIP(r1); /* save SRR0 in stackframe */ \
136 std r12,_MSR(r1); /* save SRR1 in stackframe */ \
137 std r10,0(r1); /* make stack chain pointer */ \
138 std r0,GPR0(r1); /* save r0 in stackframe */ \
139 std r10,GPR1(r1); /* save r1 in stackframe */ \
140 ACCOUNT_CPU_USER_ENTRY(r9, r10); \
141 std r2,GPR2(r1); /* save r2 in stackframe */ \
142 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
143 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
144 ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \
145 ld r10,area+EX_R10(r13); \
146 std r9,GPR9(r1); \
147 std r10,GPR10(r1); \
148 ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \
149 ld r10,area+EX_R12(r13); \
150 ld r11,area+EX_R13(r13); \
151 std r9,GPR11(r1); \
152 std r10,GPR12(r1); \
153 std r11,GPR13(r1); \
154 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
155 mflr r9; /* save LR in stackframe */ \
156 std r9,_LINK(r1); \
157 mfctr r10; /* save CTR in stackframe */ \
158 std r10,_CTR(r1); \
159 lbz r10,PACASOFTIRQEN(r13); \
160 mfspr r11,SPRN_XER; /* save XER in stackframe */ \
161 std r10,SOFTE(r1); \
162 std r11,_XER(r1); \
163 li r9,(n)+1; \
164 std r9,_TRAP(r1); /* set trap number */ \
165 li r10,0; \
166 ld r11,exception_marker@toc(r2); \
167 std r10,RESULT(r1); /* clear regs->result */ \
168 std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */
169
170/*
171 * Exception vectors.
172 */
173#define STD_EXCEPTION_PSERIES(n, label) \
174 . = n; \
175 .globl label##_pSeries; \
176label##_pSeries: \
177 HMT_MEDIUM; \
178 mtspr SPRN_SPRG1,r13; /* save r13 */ \
179 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
180
181#define HSTD_EXCEPTION_PSERIES(n, label) \
182 . = n; \
183 .globl label##_pSeries; \
184label##_pSeries: \
185 HMT_MEDIUM; \
186 mtspr SPRN_SPRG1,r20; /* save r20 */ \
187 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \
188 mtspr SPRN_SRR0,r20; \
189 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \
190 mtspr SPRN_SRR1,r20; \
191 mfspr r20,SPRN_SPRG1; /* restore r20 */ \
192 mtspr SPRN_SPRG1,r13; /* save r13 */ \
193 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
194
195
196#define MASKABLE_EXCEPTION_PSERIES(n, label) \
197 . = n; \
198 .globl label##_pSeries; \
199label##_pSeries: \
200 HMT_MEDIUM; \
201 mtspr SPRN_SPRG1,r13; /* save r13 */ \
202 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
203 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
204 std r10,PACA_EXGEN+EX_R10(r13); \
205 lbz r10,PACASOFTIRQEN(r13); \
206 mfcr r9; \
207 cmpwi r10,0; \
208 beq masked_interrupt; \
209 mfspr r10,SPRN_SPRG1; \
210 std r10,PACA_EXGEN+EX_R13(r13); \
211 std r11,PACA_EXGEN+EX_R11(r13); \
212 std r12,PACA_EXGEN+EX_R12(r13); \
213 clrrdi r12,r13,32; /* get high part of &label */ \
214 mfmsr r10; \
215 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
216 LOAD_HANDLER(r12,label##_common) \
217 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
218 mtspr SPRN_SRR0,r12; \
219 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
220 mtspr SPRN_SRR1,r10; \
221 rfid; \
222 b . /* prevent speculative execution */
223
224#ifdef CONFIG_PPC_ISERIES
225#define DISABLE_INTS \
226 li r11,0; \
227 stb r11,PACASOFTIRQEN(r13); \
228BEGIN_FW_FTR_SECTION; \
229 stb r11,PACAHARDIRQEN(r13); \
230END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
231BEGIN_FW_FTR_SECTION; \
232 mfmsr r10; \
233 ori r10,r10,MSR_EE; \
234 mtmsrd r10,1; \
235END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
236
237#else
238#define DISABLE_INTS \
239 li r11,0; \
240 stb r11,PACASOFTIRQEN(r13); \
241 stb r11,PACAHARDIRQEN(r13)
242
243#endif /* CONFIG_PPC_ISERIES */
244
245#define ENABLE_INTS \
246 ld r12,_MSR(r1); \
247 mfmsr r11; \
248 rlwimi r11,r12,0,MSR_EE; \
249 mtmsrd r11,1
250
251#define STD_EXCEPTION_COMMON(trap, label, hdlr) \
252 .align 7; \
253 .globl label##_common; \
254label##_common: \
255 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
256 DISABLE_INTS; \
257 bl .save_nvgprs; \
258 addi r3,r1,STACK_FRAME_OVERHEAD; \
259 bl hdlr; \
260 b .ret_from_except
261
262/*
263 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur
264 * in the idle task and therefore need the special idle handling.
265 */
266#define STD_EXCEPTION_COMMON_IDLE(trap, label, hdlr) \
267 .align 7; \
268 .globl label##_common; \
269label##_common: \
270 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
271 FINISH_NAP; \
272 DISABLE_INTS; \
273 bl .save_nvgprs; \
274 addi r3,r1,STACK_FRAME_OVERHEAD; \
275 bl hdlr; \
276 b .ret_from_except
277
278#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \
279 .align 7; \
280 .globl label##_common; \
281label##_common: \
282 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
283 FINISH_NAP; \
284 DISABLE_INTS; \
285 bl .ppc64_runlatch_on; \
286 addi r3,r1,STACK_FRAME_OVERHEAD; \
287 bl hdlr; \
288 b .ret_from_except_lite
289
290/*
291 * When the idle code in power4_idle puts the CPU into NAP mode,
292 * it has to do so in a loop, and relies on the external interrupt
293 * and decrementer interrupt entry code to get it out of the loop.
294 * It sets the _TLF_NAPPING bit in current_thread_info()->local_flags
295 * to signal that it is in the loop and needs help to get out.
296 */
297#ifdef CONFIG_PPC_970_NAP
298#define FINISH_NAP \
299BEGIN_FTR_SECTION \
300 clrrdi r11,r1,THREAD_SHIFT; \
301 ld r9,TI_LOCAL_FLAGS(r11); \
302 andi. r10,r9,_TLF_NAPPING; \
303 bnel power4_fixup_nap; \
304END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
305#else
306#define FINISH_NAP
307#endif
308
309#endif /* _ASM_POWERPC_EXCEPTION_H */
diff --git a/include/asm-powerpc/highmem.h b/include/asm-powerpc/highmem.h
new file mode 100644
index 000000000000..f7b21ee302b4
--- /dev/null
+++ b/include/asm-powerpc/highmem.h
@@ -0,0 +1,135 @@
1/*
2 * highmem.h: virtual kernel memory mappings for high memory
3 *
4 * PowerPC version, stolen from the i386 version.
5 *
6 * Used in CONFIG_HIGHMEM systems for memory pages which
7 * are not addressable by direct kernel virtual addresses.
8 *
9 * Copyright (C) 1999 Gerhard Wichert, Siemens AG
10 * Gerhard.Wichert@pdb.siemens.de
11 *
12 *
13 * Redesigned the x86 32-bit VM architecture to deal with
14 * up to 16 Terrabyte physical memory. With current x86 CPUs
15 * we now support up to 64 Gigabytes physical RAM.
16 *
17 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
18 */
19
20#ifndef _ASM_HIGHMEM_H
21#define _ASM_HIGHMEM_H
22
23#ifdef __KERNEL__
24
25#include <linux/init.h>
26#include <linux/interrupt.h>
27#include <asm/kmap_types.h>
28#include <asm/tlbflush.h>
29#include <asm/page.h>
30
31/* undef for production */
32#define HIGHMEM_DEBUG 1
33
34extern pte_t *kmap_pte;
35extern pgprot_t kmap_prot;
36extern pte_t *pkmap_page_table;
37
38/*
39 * Right now we initialize only a single pte table. It can be extended
40 * easily, subsequent pte tables have to be allocated in one physical
41 * chunk of RAM.
42 */
43#define PKMAP_BASE CONFIG_HIGHMEM_START
44#define LAST_PKMAP (1 << PTE_SHIFT)
45#define LAST_PKMAP_MASK (LAST_PKMAP-1)
46#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
47#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
48
49#define KMAP_FIX_BEGIN (PKMAP_BASE + 0x00400000UL)
50
51extern void *kmap_high(struct page *page);
52extern void kunmap_high(struct page *page);
53
54static inline void *kmap(struct page *page)
55{
56 might_sleep();
57 if (!PageHighMem(page))
58 return page_address(page);
59 return kmap_high(page);
60}
61
62static inline void kunmap(struct page *page)
63{
64 BUG_ON(in_interrupt());
65 if (!PageHighMem(page))
66 return;
67 kunmap_high(page);
68}
69
70/*
71 * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
72 * gives a more generic (and caching) interface. But kmap_atomic can
73 * be used in IRQ contexts, so in some (very limited) cases we need
74 * it.
75 */
76static inline void *kmap_atomic(struct page *page, enum km_type type)
77{
78 unsigned int idx;
79 unsigned long vaddr;
80
81 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
82 pagefault_disable();
83 if (!PageHighMem(page))
84 return page_address(page);
85
86 idx = type + KM_TYPE_NR*smp_processor_id();
87 vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
88#ifdef HIGHMEM_DEBUG
89 BUG_ON(!pte_none(*(kmap_pte+idx)));
90#endif
91 set_pte_at(&init_mm, vaddr, kmap_pte+idx, mk_pte(page, kmap_prot));
92 flush_tlb_page(NULL, vaddr);
93
94 return (void*) vaddr;
95}
96
97static inline void kunmap_atomic(void *kvaddr, enum km_type type)
98{
99#ifdef HIGHMEM_DEBUG
100 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
101 unsigned int idx = type + KM_TYPE_NR*smp_processor_id();
102
103 if (vaddr < KMAP_FIX_BEGIN) { // FIXME
104 pagefault_enable();
105 return;
106 }
107
108 BUG_ON(vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE);
109
110 /*
111 * force other mappings to Oops if they'll try to access
112 * this pte without first remap it
113 */
114 pte_clear(&init_mm, vaddr, kmap_pte+idx);
115 flush_tlb_page(NULL, vaddr);
116#endif
117 pagefault_enable();
118}
119
120static inline struct page *kmap_atomic_to_page(void *ptr)
121{
122 unsigned long idx, vaddr = (unsigned long) ptr;
123
124 if (vaddr < KMAP_FIX_BEGIN)
125 return virt_to_page(ptr);
126
127 idx = (vaddr - KMAP_FIX_BEGIN) >> PAGE_SHIFT;
128 return pte_page(kmap_pte[idx]);
129}
130
131#define flush_cache_kmaps() flush_cache_all()
132
133#endif /* __KERNEL__ */
134
135#endif /* _ASM_HIGHMEM_H */
diff --git a/include/asm-powerpc/hydra.h b/include/asm-powerpc/hydra.h
new file mode 100644
index 000000000000..1ad4eed07fbe
--- /dev/null
+++ b/include/asm-powerpc/hydra.h
@@ -0,0 +1,102 @@
1/*
2 * include/asm-ppc/hydra.h -- Mac I/O `Hydra' definitions
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven
5 *
6 * This file is based on the following documentation:
7 *
8 * Macintosh Technology in the Common Hardware Reference Platform
9 * Apple Computer, Inc.
10 *
11 * © Copyright 1995 Apple Computer, Inc. All rights reserved.
12 *
13 * It's available online from http://chrp.apple.com/MacTech.pdf.
14 * You can obtain paper copies of this book from computer bookstores or by
15 * writing Morgan Kaufmann Publishers, Inc., 340 Pine Street, Sixth Floor, San
16 * Francisco, CA 94104. Reference ISBN 1-55860-393-X.
17 *
18 * This file is subject to the terms and conditions of the GNU General Public
19 * License. See the file COPYING in the main directory of this archive
20 * for more details.
21 */
22
23#ifndef _ASMPPC_HYDRA_H
24#define _ASMPPC_HYDRA_H
25
26#ifdef __KERNEL__
27
28struct Hydra {
29 /* DBDMA Controller Register Space */
30 char Pad1[0x30];
31 u_int CachePD;
32 u_int IDs;
33 u_int Feature_Control;
34 char Pad2[0x7fc4];
35 /* DBDMA Channel Register Space */
36 char SCSI_DMA[0x100];
37 char Pad3[0x300];
38 char SCCA_Tx_DMA[0x100];
39 char SCCA_Rx_DMA[0x100];
40 char SCCB_Tx_DMA[0x100];
41 char SCCB_Rx_DMA[0x100];
42 char Pad4[0x7800];
43 /* Device Register Space */
44 char SCSI[0x1000];
45 char ADB[0x1000];
46 char SCC_Legacy[0x1000];
47 char SCC[0x1000];
48 char Pad9[0x2000];
49 char VIA[0x2000];
50 char Pad10[0x28000];
51 char OpenPIC[0x40000];
52};
53
54extern volatile struct Hydra __iomem *Hydra;
55
56
57 /*
58 * Feature Control Register
59 */
60
61#define HYDRA_FC_SCC_CELL_EN 0x00000001 /* Enable SCC Clock */
62#define HYDRA_FC_SCSI_CELL_EN 0x00000002 /* Enable SCSI Clock */
63#define HYDRA_FC_SCCA_ENABLE 0x00000004 /* Enable SCC A Lines */
64#define HYDRA_FC_SCCB_ENABLE 0x00000008 /* Enable SCC B Lines */
65#define HYDRA_FC_ARB_BYPASS 0x00000010 /* Bypass Internal Arbiter */
66#define HYDRA_FC_RESET_SCC 0x00000020 /* Reset SCC */
67#define HYDRA_FC_MPIC_ENABLE 0x00000040 /* Enable OpenPIC */
68#define HYDRA_FC_SLOW_SCC_PCLK 0x00000080 /* 1=15.6672, 0=25 MHz */
69#define HYDRA_FC_MPIC_IS_MASTER 0x00000100 /* OpenPIC Master Mode */
70
71
72 /*
73 * OpenPIC Interrupt Sources
74 */
75
76#define HYDRA_INT_SIO 0
77#define HYDRA_INT_SCSI_DMA 1
78#define HYDRA_INT_SCCA_TX_DMA 2
79#define HYDRA_INT_SCCA_RX_DMA 3
80#define HYDRA_INT_SCCB_TX_DMA 4
81#define HYDRA_INT_SCCB_RX_DMA 5
82#define HYDRA_INT_SCSI 6
83#define HYDRA_INT_SCCA 7
84#define HYDRA_INT_SCCB 8
85#define HYDRA_INT_VIA 9
86#define HYDRA_INT_ADB 10
87#define HYDRA_INT_ADB_NMI 11
88#define HYDRA_INT_EXT1 12 /* PCI IRQW */
89#define HYDRA_INT_EXT2 13 /* PCI IRQX */
90#define HYDRA_INT_EXT3 14 /* PCI IRQY */
91#define HYDRA_INT_EXT4 15 /* PCI IRQZ */
92#define HYDRA_INT_EXT5 16 /* IDE Primay/Secondary */
93#define HYDRA_INT_EXT6 17 /* IDE Secondary */
94#define HYDRA_INT_EXT7 18 /* Power Off Request */
95#define HYDRA_INT_SPARE 19
96
97extern int hydra_init(void);
98extern void macio_adb_init(void);
99
100#endif /* __KERNEL__ */
101
102#endif /* _ASMPPC_HYDRA_H */
diff --git a/include/asm-powerpc/immap_cpm2.h b/include/asm-powerpc/immap_cpm2.h
new file mode 100644
index 000000000000..f316a91c628a
--- /dev/null
+++ b/include/asm-powerpc/immap_cpm2.h
@@ -0,0 +1,648 @@
1/*
2 * CPM2 Internal Memory Map
3 * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
4 *
5 * The Internal Memory Map for devices with CPM2 on them. This
6 * is the superset of all CPM2 devices (8260, 8266, 8280, 8272,
7 * 8560).
8 */
9#ifdef __KERNEL__
10#ifndef __IMMAP_CPM2__
11#define __IMMAP_CPM2__
12
13/* System configuration registers.
14*/
15typedef struct sys_82xx_conf {
16 u32 sc_siumcr;
17 u32 sc_sypcr;
18 u8 res1[6];
19 u16 sc_swsr;
20 u8 res2[20];
21 u32 sc_bcr;
22 u8 sc_ppc_acr;
23 u8 res3[3];
24 u32 sc_ppc_alrh;
25 u32 sc_ppc_alrl;
26 u8 sc_lcl_acr;
27 u8 res4[3];
28 u32 sc_lcl_alrh;
29 u32 sc_lcl_alrl;
30 u32 sc_tescr1;
31 u32 sc_tescr2;
32 u32 sc_ltescr1;
33 u32 sc_ltescr2;
34 u32 sc_pdtea;
35 u8 sc_pdtem;
36 u8 res5[3];
37 u32 sc_ldtea;
38 u8 sc_ldtem;
39 u8 res6[163];
40} sysconf_82xx_cpm2_t;
41
42typedef struct sys_85xx_conf {
43 u32 sc_cear;
44 u16 sc_ceer;
45 u16 sc_cemr;
46 u8 res1[70];
47 u32 sc_smaer;
48 u8 res2[4];
49 u32 sc_smevr;
50 u32 sc_smctr;
51 u32 sc_lmaer;
52 u8 res3[4];
53 u32 sc_lmevr;
54 u32 sc_lmctr;
55 u8 res4[144];
56} sysconf_85xx_cpm2_t;
57
58typedef union sys_conf {
59 sysconf_82xx_cpm2_t siu_82xx;
60 sysconf_85xx_cpm2_t siu_85xx;
61} sysconf_cpm2_t;
62
63
64
65/* Memory controller registers.
66*/
67typedef struct mem_ctlr {
68 u32 memc_br0;
69 u32 memc_or0;
70 u32 memc_br1;
71 u32 memc_or1;
72 u32 memc_br2;
73 u32 memc_or2;
74 u32 memc_br3;
75 u32 memc_or3;
76 u32 memc_br4;
77 u32 memc_or4;
78 u32 memc_br5;
79 u32 memc_or5;
80 u32 memc_br6;
81 u32 memc_or6;
82 u32 memc_br7;
83 u32 memc_or7;
84 u32 memc_br8;
85 u32 memc_or8;
86 u32 memc_br9;
87 u32 memc_or9;
88 u32 memc_br10;
89 u32 memc_or10;
90 u32 memc_br11;
91 u32 memc_or11;
92 u8 res1[8];
93 u32 memc_mar;
94 u8 res2[4];
95 u32 memc_mamr;
96 u32 memc_mbmr;
97 u32 memc_mcmr;
98 u8 res3[8];
99 u16 memc_mptpr;
100 u8 res4[2];
101 u32 memc_mdr;
102 u8 res5[4];
103 u32 memc_psdmr;
104 u32 memc_lsdmr;
105 u8 memc_purt;
106 u8 res6[3];
107 u8 memc_psrt;
108 u8 res7[3];
109 u8 memc_lurt;
110 u8 res8[3];
111 u8 memc_lsrt;
112 u8 res9[3];
113 u32 memc_immr;
114 u32 memc_pcibr0;
115 u32 memc_pcibr1;
116 u8 res10[16];
117 u32 memc_pcimsk0;
118 u32 memc_pcimsk1;
119 u8 res11[52];
120} memctl_cpm2_t;
121
122/* System Integration Timers.
123*/
124typedef struct sys_int_timers {
125 u8 res1[32];
126 u16 sit_tmcntsc;
127 u8 res2[2];
128 u32 sit_tmcnt;
129 u8 res3[4];
130 u32 sit_tmcntal;
131 u8 res4[16];
132 u16 sit_piscr;
133 u8 res5[2];
134 u32 sit_pitc;
135 u32 sit_pitr;
136 u8 res6[94];
137 u8 res7[390];
138} sit_cpm2_t;
139
140#define PISCR_PIRQ_MASK ((u16)0xff00)
141#define PISCR_PS ((u16)0x0080)
142#define PISCR_PIE ((u16)0x0004)
143#define PISCR_PTF ((u16)0x0002)
144#define PISCR_PTE ((u16)0x0001)
145
146/* PCI Controller.
147*/
148typedef struct pci_ctlr {
149 u32 pci_omisr;
150 u32 pci_omimr;
151 u8 res1[8];
152 u32 pci_ifqpr;
153 u32 pci_ofqpr;
154 u8 res2[8];
155 u32 pci_imr0;
156 u32 pci_imr1;
157 u32 pci_omr0;
158 u32 pci_omr1;
159 u32 pci_odr;
160 u8 res3[4];
161 u32 pci_idr;
162 u8 res4[20];
163 u32 pci_imisr;
164 u32 pci_imimr;
165 u8 res5[24];
166 u32 pci_ifhpr;
167 u8 res6[4];
168 u32 pci_iftpr;
169 u8 res7[4];
170 u32 pci_iphpr;
171 u8 res8[4];
172 u32 pci_iptpr;
173 u8 res9[4];
174 u32 pci_ofhpr;
175 u8 res10[4];
176 u32 pci_oftpr;
177 u8 res11[4];
178 u32 pci_ophpr;
179 u8 res12[4];
180 u32 pci_optpr;
181 u8 res13[8];
182 u32 pci_mucr;
183 u8 res14[8];
184 u32 pci_qbar;
185 u8 res15[12];
186 u32 pci_dmamr0;
187 u32 pci_dmasr0;
188 u32 pci_dmacdar0;
189 u8 res16[4];
190 u32 pci_dmasar0;
191 u8 res17[4];
192 u32 pci_dmadar0;
193 u8 res18[4];
194 u32 pci_dmabcr0;
195 u32 pci_dmandar0;
196 u8 res19[86];
197 u32 pci_dmamr1;
198 u32 pci_dmasr1;
199 u32 pci_dmacdar1;
200 u8 res20[4];
201 u32 pci_dmasar1;
202 u8 res21[4];
203 u32 pci_dmadar1;
204 u8 res22[4];
205 u32 pci_dmabcr1;
206 u32 pci_dmandar1;
207 u8 res23[88];
208 u32 pci_dmamr2;
209 u32 pci_dmasr2;
210 u32 pci_dmacdar2;
211 u8 res24[4];
212 u32 pci_dmasar2;
213 u8 res25[4];
214 u32 pci_dmadar2;
215 u8 res26[4];
216 u32 pci_dmabcr2;
217 u32 pci_dmandar2;
218 u8 res27[88];
219 u32 pci_dmamr3;
220 u32 pci_dmasr3;
221 u32 pci_dmacdar3;
222 u8 res28[4];
223 u32 pci_dmasar3;
224 u8 res29[4];
225 u32 pci_dmadar3;
226 u8 res30[4];
227 u32 pci_dmabcr3;
228 u32 pci_dmandar3;
229 u8 res31[344];
230 u32 pci_potar0;
231 u8 res32[4];
232 u32 pci_pobar0;
233 u8 res33[4];
234 u32 pci_pocmr0;
235 u8 res34[4];
236 u32 pci_potar1;
237 u8 res35[4];
238 u32 pci_pobar1;
239 u8 res36[4];
240 u32 pci_pocmr1;
241 u8 res37[4];
242 u32 pci_potar2;
243 u8 res38[4];
244 u32 pci_pobar2;
245 u8 res39[4];
246 u32 pci_pocmr2;
247 u8 res40[50];
248 u32 pci_ptcr;
249 u32 pci_gpcr;
250 u32 pci_gcr;
251 u32 pci_esr;
252 u32 pci_emr;
253 u32 pci_ecr;
254 u32 pci_eacr;
255 u8 res41[4];
256 u32 pci_edcr;
257 u8 res42[4];
258 u32 pci_eccr;
259 u8 res43[44];
260 u32 pci_pitar1;
261 u8 res44[4];
262 u32 pci_pibar1;
263 u8 res45[4];
264 u32 pci_picmr1;
265 u8 res46[4];
266 u32 pci_pitar0;
267 u8 res47[4];
268 u32 pci_pibar0;
269 u8 res48[4];
270 u32 pci_picmr0;
271 u8 res49[4];
272 u32 pci_cfg_addr;
273 u32 pci_cfg_data;
274 u32 pci_int_ack;
275 u8 res50[756];
276} pci_cpm2_t;
277
278/* Interrupt Controller.
279*/
280typedef struct interrupt_controller {
281 u16 ic_sicr;
282 u8 res1[2];
283 u32 ic_sivec;
284 u32 ic_sipnrh;
285 u32 ic_sipnrl;
286 u32 ic_siprr;
287 u32 ic_scprrh;
288 u32 ic_scprrl;
289 u32 ic_simrh;
290 u32 ic_simrl;
291 u32 ic_siexr;
292 u8 res2[88];
293} intctl_cpm2_t;
294
295/* Clocks and Reset.
296*/
297typedef struct clk_and_reset {
298 u32 car_sccr;
299 u8 res1[4];
300 u32 car_scmr;
301 u8 res2[4];
302 u32 car_rsr;
303 u32 car_rmr;
304 u8 res[104];
305} car_cpm2_t;
306
307/* Input/Output Port control/status registers.
308 * Names consistent with processor manual, although they are different
309 * from the original 8xx names.......
310 */
311typedef struct io_port {
312 u32 iop_pdira;
313 u32 iop_ppara;
314 u32 iop_psora;
315 u32 iop_podra;
316 u32 iop_pdata;
317 u8 res1[12];
318 u32 iop_pdirb;
319 u32 iop_pparb;
320 u32 iop_psorb;
321 u32 iop_podrb;
322 u32 iop_pdatb;
323 u8 res2[12];
324 u32 iop_pdirc;
325 u32 iop_pparc;
326 u32 iop_psorc;
327 u32 iop_podrc;
328 u32 iop_pdatc;
329 u8 res3[12];
330 u32 iop_pdird;
331 u32 iop_ppard;
332 u32 iop_psord;
333 u32 iop_podrd;
334 u32 iop_pdatd;
335 u8 res4[12];
336} iop_cpm2_t;
337
338/* Communication Processor Module Timers
339*/
340typedef struct cpm_timers {
341 u8 cpmt_tgcr1;
342 u8 res1[3];
343 u8 cpmt_tgcr2;
344 u8 res2[11];
345 u16 cpmt_tmr1;
346 u16 cpmt_tmr2;
347 u16 cpmt_trr1;
348 u16 cpmt_trr2;
349 u16 cpmt_tcr1;
350 u16 cpmt_tcr2;
351 u16 cpmt_tcn1;
352 u16 cpmt_tcn2;
353 u16 cpmt_tmr3;
354 u16 cpmt_tmr4;
355 u16 cpmt_trr3;
356 u16 cpmt_trr4;
357 u16 cpmt_tcr3;
358 u16 cpmt_tcr4;
359 u16 cpmt_tcn3;
360 u16 cpmt_tcn4;
361 u16 cpmt_ter1;
362 u16 cpmt_ter2;
363 u16 cpmt_ter3;
364 u16 cpmt_ter4;
365 u8 res3[584];
366} cpmtimer_cpm2_t;
367
368/* DMA control/status registers.
369*/
370typedef struct sdma_csr {
371 u8 res0[24];
372 u8 sdma_sdsr;
373 u8 res1[3];
374 u8 sdma_sdmr;
375 u8 res2[3];
376 u8 sdma_idsr1;
377 u8 res3[3];
378 u8 sdma_idmr1;
379 u8 res4[3];
380 u8 sdma_idsr2;
381 u8 res5[3];
382 u8 sdma_idmr2;
383 u8 res6[3];
384 u8 sdma_idsr3;
385 u8 res7[3];
386 u8 sdma_idmr3;
387 u8 res8[3];
388 u8 sdma_idsr4;
389 u8 res9[3];
390 u8 sdma_idmr4;
391 u8 res10[707];
392} sdma_cpm2_t;
393
394/* Fast controllers
395*/
396typedef struct fcc {
397 u32 fcc_gfmr;
398 u32 fcc_fpsmr;
399 u16 fcc_ftodr;
400 u8 res1[2];
401 u16 fcc_fdsr;
402 u8 res2[2];
403 u16 fcc_fcce;
404 u8 res3[2];
405 u16 fcc_fccm;
406 u8 res4[2];
407 u8 fcc_fccs;
408 u8 res5[3];
409 u8 fcc_ftirr_phy[4];
410} fcc_t;
411
412/* Fast controllers continued
413 */
414typedef struct fcc_c {
415 u32 fcc_firper;
416 u32 fcc_firer;
417 u32 fcc_firsr_hi;
418 u32 fcc_firsr_lo;
419 u8 fcc_gfemr;
420 u8 res1[15];
421} fcc_c_t;
422
423/* TC Layer
424 */
425typedef struct tclayer {
426 u16 tc_tcmode;
427 u16 tc_cdsmr;
428 u16 tc_tcer;
429 u16 tc_rcc;
430 u16 tc_tcmr;
431 u16 tc_fcc;
432 u16 tc_ccc;
433 u16 tc_icc;
434 u16 tc_tcc;
435 u16 tc_ecc;
436 u8 res1[12];
437} tclayer_t;
438
439
440/* I2C
441*/
442typedef struct i2c {
443 u8 i2c_i2mod;
444 u8 res1[3];
445 u8 i2c_i2add;
446 u8 res2[3];
447 u8 i2c_i2brg;
448 u8 res3[3];
449 u8 i2c_i2com;
450 u8 res4[3];
451 u8 i2c_i2cer;
452 u8 res5[3];
453 u8 i2c_i2cmr;
454 u8 res6[331];
455} i2c_cpm2_t;
456
457typedef struct scc { /* Serial communication channels */
458 u32 scc_gsmrl;
459 u32 scc_gsmrh;
460 u16 scc_psmr;
461 u8 res1[2];
462 u16 scc_todr;
463 u16 scc_dsr;
464 u16 scc_scce;
465 u8 res2[2];
466 u16 scc_sccm;
467 u8 res3;
468 u8 scc_sccs;
469 u8 res4[8];
470} scc_t;
471
472typedef struct smc { /* Serial management channels */
473 u8 res1[2];
474 u16 smc_smcmr;
475 u8 res2[2];
476 u8 smc_smce;
477 u8 res3[3];
478 u8 smc_smcm;
479 u8 res4[5];
480} smc_t;
481
482/* Serial Peripheral Interface.
483*/
484typedef struct spi_ctrl {
485 u16 spi_spmode;
486 u8 res1[4];
487 u8 spi_spie;
488 u8 res2[3];
489 u8 spi_spim;
490 u8 res3[2];
491 u8 spi_spcom;
492 u8 res4[82];
493} spictl_cpm2_t;
494
495/* CPM Mux.
496*/
497typedef struct cpmux {
498 u8 cmx_si1cr;
499 u8 res1;
500 u8 cmx_si2cr;
501 u8 res2;
502 u32 cmx_fcr;
503 u32 cmx_scr;
504 u8 cmx_smr;
505 u8 res3;
506 u16 cmx_uar;
507 u8 res4[16];
508} cpmux_t;
509
510/* SIRAM control
511*/
512typedef struct siram {
513 u16 si_amr;
514 u16 si_bmr;
515 u16 si_cmr;
516 u16 si_dmr;
517 u8 si_gmr;
518 u8 res1;
519 u8 si_cmdr;
520 u8 res2;
521 u8 si_str;
522 u8 res3;
523 u16 si_rsr;
524} siramctl_t;
525
526typedef struct mcc {
527 u16 mcc_mcce;
528 u8 res1[2];
529 u16 mcc_mccm;
530 u8 res2[2];
531 u8 mcc_mccf;
532 u8 res3[7];
533} mcc_t;
534
535typedef struct comm_proc {
536 u32 cp_cpcr;
537 u32 cp_rccr;
538 u8 res1[14];
539 u16 cp_rter;
540 u8 res2[2];
541 u16 cp_rtmr;
542 u16 cp_rtscr;
543 u8 res3[2];
544 u32 cp_rtsr;
545 u8 res4[12];
546} cpm_cpm2_t;
547
548/* USB Controller.
549*/
550typedef struct usb_ctlr {
551 u8 usb_usmod;
552 u8 usb_usadr;
553 u8 usb_uscom;
554 u8 res1[1];
555 u16 usb_usep1;
556 u16 usb_usep2;
557 u16 usb_usep3;
558 u16 usb_usep4;
559 u8 res2[4];
560 u16 usb_usber;
561 u8 res3[2];
562 u16 usb_usbmr;
563 u8 usb_usbs;
564 u8 res4[7];
565} usb_cpm2_t;
566
567/* ...and the whole thing wrapped up....
568*/
569
570typedef struct immap {
571 /* Some references are into the unique and known dpram spaces,
572 * others are from the generic base.
573 */
574#define im_dprambase im_dpram1
575 u8 im_dpram1[16*1024];
576 u8 res1[16*1024];
577 u8 im_dpram2[4*1024];
578 u8 res2[8*1024];
579 u8 im_dpram3[4*1024];
580 u8 res3[16*1024];
581
582 sysconf_cpm2_t im_siu_conf; /* SIU Configuration */
583 memctl_cpm2_t im_memctl; /* Memory Controller */
584 sit_cpm2_t im_sit; /* System Integration Timers */
585 pci_cpm2_t im_pci; /* PCI Controller */
586 intctl_cpm2_t im_intctl; /* Interrupt Controller */
587 car_cpm2_t im_clkrst; /* Clocks and reset */
588 iop_cpm2_t im_ioport; /* IO Port control/status */
589 cpmtimer_cpm2_t im_cpmtimer; /* CPM timers */
590 sdma_cpm2_t im_sdma; /* SDMA control/status */
591
592 fcc_t im_fcc[3]; /* Three FCCs */
593 u8 res4z[32];
594 fcc_c_t im_fcc_c[3]; /* Continued FCCs */
595
596 u8 res4[32];
597
598 tclayer_t im_tclayer[8]; /* Eight TCLayers */
599 u16 tc_tcgsr;
600 u16 tc_tcger;
601
602 /* First set of baud rate generators.
603 */
604 u8 res[236];
605 u32 im_brgc5;
606 u32 im_brgc6;
607 u32 im_brgc7;
608 u32 im_brgc8;
609
610 u8 res5[608];
611
612 i2c_cpm2_t im_i2c; /* I2C control/status */
613 cpm_cpm2_t im_cpm; /* Communication processor */
614
615 /* Second set of baud rate generators.
616 */
617 u32 im_brgc1;
618 u32 im_brgc2;
619 u32 im_brgc3;
620 u32 im_brgc4;
621
622 scc_t im_scc[4]; /* Four SCCs */
623 smc_t im_smc[2]; /* Couple of SMCs */
624 spictl_cpm2_t im_spi; /* A SPI */
625 cpmux_t im_cpmux; /* CPM clock route mux */
626 siramctl_t im_siramctl1; /* First SI RAM Control */
627 mcc_t im_mcc1; /* First MCC */
628 siramctl_t im_siramctl2; /* Second SI RAM Control */
629 mcc_t im_mcc2; /* Second MCC */
630 usb_cpm2_t im_usb; /* USB Controller */
631
632 u8 res6[1153];
633
634 u16 im_si1txram[256];
635 u8 res7[512];
636 u16 im_si1rxram[256];
637 u8 res8[512];
638 u16 im_si2txram[256];
639 u8 res9[512];
640 u16 im_si2rxram[256];
641 u8 res10[512];
642 u8 res11[4096];
643} cpm2_map_t;
644
645extern cpm2_map_t *cpm2_immr;
646
647#endif /* __IMMAP_CPM2__ */
648#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index bb8d965f96c6..4c0b55087dc7 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -734,6 +734,9 @@ static inline void * bus_to_virt(unsigned long address)
734#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v)) 734#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v))
735#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v)) 735#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
736 736
737#define setbits8(_addr, _v) out_8((_addr), in_8(_addr) | (_v))
738#define clrbits8(_addr, _v) out_8((_addr), in_8(_addr) & ~(_v))
739
737#endif /* __KERNEL__ */ 740#endif /* __KERNEL__ */
738 741
739#endif /* _ASM_POWERPC_IO_H */ 742#endif /* _ASM_POWERPC_IO_H */
diff --git a/include/asm-powerpc/iseries/lpar_map.h b/include/asm-powerpc/iseries/lpar_map.h
index 2ec384d66abb..5e9f3e128ee2 100644
--- a/include/asm-powerpc/iseries/lpar_map.h
+++ b/include/asm-powerpc/iseries/lpar_map.h
@@ -22,6 +22,8 @@
22 22
23#include <asm/types.h> 23#include <asm/types.h>
24 24
25#endif
26
25/* 27/*
26 * The iSeries hypervisor will set up mapping for one or more 28 * The iSeries hypervisor will set up mapping for one or more
27 * ESID/VSID pairs (in SLB/segment registers) and will set up 29 * ESID/VSID pairs (in SLB/segment registers) and will set up
@@ -56,6 +58,7 @@
56/* Hypervisor initially maps 32MB of the load area */ 58/* Hypervisor initially maps 32MB of the load area */
57#define HvPagesToMap 8192 59#define HvPagesToMap 8192
58 60
61#ifndef __ASSEMBLY__
59struct LparMap { 62struct LparMap {
60 u64 xNumberEsids; // Number of ESID/VSID pairs 63 u64 xNumberEsids; // Number of ESID/VSID pairs
61 u64 xNumberRanges; // Number of VA ranges to map 64 u64 xNumberRanges; // Number of VA ranges to map
diff --git a/include/asm-powerpc/kgdb.h b/include/asm-powerpc/kgdb.h
new file mode 100644
index 000000000000..b617dac82969
--- /dev/null
+++ b/include/asm-powerpc/kgdb.h
@@ -0,0 +1,57 @@
1/*
2 * kgdb.h: Defines and declarations for serial line source level
3 * remote debugging of the Linux kernel using gdb.
4 *
5 * PPC Mods (C) 1998 Michael Tesch (tesch@cs.wisc.edu)
6 *
7 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
8 */
9#ifdef __KERNEL__
10#ifndef _PPC_KGDB_H
11#define _PPC_KGDB_H
12
13#ifndef __ASSEMBLY__
14
15/* Things specific to the gen550 backend. */
16struct uart_port;
17
18extern void gen550_progress(char *, unsigned short);
19extern void gen550_kgdb_map_scc(void);
20extern void gen550_init(int, struct uart_port *);
21
22/* Things specific to the pmac backend. */
23extern void zs_kgdb_hook(int tty_num);
24
25/* To init the kgdb engine. (called by serial hook)*/
26extern void set_debug_traps(void);
27
28/* To enter the debugger explicitly. */
29extern void breakpoint(void);
30
31/* For taking exceptions
32 * these are defined in traps.c
33 */
34extern int (*debugger)(struct pt_regs *regs);
35extern int (*debugger_bpt)(struct pt_regs *regs);
36extern int (*debugger_sstep)(struct pt_regs *regs);
37extern int (*debugger_iabr_match)(struct pt_regs *regs);
38extern int (*debugger_dabr_match)(struct pt_regs *regs);
39extern void (*debugger_fault_handler)(struct pt_regs *regs);
40
41/* What we bring to the party */
42int kgdb_bpt(struct pt_regs *regs);
43int kgdb_sstep(struct pt_regs *regs);
44void kgdb(struct pt_regs *regs);
45int kgdb_iabr_match(struct pt_regs *regs);
46int kgdb_dabr_match(struct pt_regs *regs);
47
48/*
49 * external low-level support routines (ie macserial.c)
50 */
51extern void kgdb_interruptible(int); /* control interrupts from serial */
52extern void putDebugChar(char); /* write a single character */
53extern char getDebugChar(void); /* read and return a single char */
54
55#endif /* !(__ASSEMBLY__) */
56#endif /* !(_PPC_KGDB_H) */
57#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h
index 0c5880f70225..b5f9f4c9c294 100644
--- a/include/asm-powerpc/lmb.h
+++ b/include/asm-powerpc/lmb.h
@@ -1,5 +1,5 @@
1#ifndef _PPC64_LMB_H 1#ifndef _ASM_POWERPC_LMB_H
2#define _PPC64_LMB_H 2#define _ASM_POWERPC_LMB_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5/* 5/*
@@ -77,4 +77,4 @@ lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
77} 77}
78 78
79#endif /* __KERNEL__ */ 79#endif /* __KERNEL__ */
80#endif /* _PPC64_LMB_H */ 80#endif /* _ASM_POWERPC_LMB_H */
diff --git a/include/asm-powerpc/mmu-40x.h b/include/asm-powerpc/mmu-40x.h
new file mode 100644
index 000000000000..7d37f77043ac
--- /dev/null
+++ b/include/asm-powerpc/mmu-40x.h
@@ -0,0 +1,65 @@
1#ifndef _ASM_POWERPC_MMU_40X_H_
2#define _ASM_POWERPC_MMU_40X_H_
3
4/*
5 * PPC40x support
6 */
7
8#define PPC40X_TLB_SIZE 64
9
10/*
11 * TLB entries are defined by a "high" tag portion and a "low" data
12 * portion. On all architectures, the data portion is 32-bits.
13 *
14 * TLB entries are managed entirely under software control by reading,
15 * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx
16 * instructions.
17 */
18
19#define TLB_LO 1
20#define TLB_HI 0
21
22#define TLB_DATA TLB_LO
23#define TLB_TAG TLB_HI
24
25/* Tag portion */
26
27#define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */
28#define TLB_PAGESZ_MASK 0x00000380
29#define TLB_PAGESZ(x) (((x) & 0x7) << 7)
30#define PAGESZ_1K 0
31#define PAGESZ_4K 1
32#define PAGESZ_16K 2
33#define PAGESZ_64K 3
34#define PAGESZ_256K 4
35#define PAGESZ_1M 5
36#define PAGESZ_4M 6
37#define PAGESZ_16M 7
38#define TLB_VALID 0x00000040 /* Entry is valid */
39
40/* Data portion */
41
42#define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */
43#define TLB_PERM_MASK 0x00000300
44#define TLB_EX 0x00000200 /* Instruction execution allowed */
45#define TLB_WR 0x00000100 /* Writes permitted */
46#define TLB_ZSEL_MASK 0x000000F0
47#define TLB_ZSEL(x) (((x) & 0xF) << 4)
48#define TLB_ATTR_MASK 0x0000000F
49#define TLB_W 0x00000008 /* Caching is write-through */
50#define TLB_I 0x00000004 /* Caching is inhibited */
51#define TLB_M 0x00000002 /* Memory is coherent */
52#define TLB_G 0x00000001 /* Memory is guarded from prefetch */
53
54#ifndef __ASSEMBLY__
55
56typedef unsigned long phys_addr_t;
57
58typedef struct {
59 unsigned long id;
60 unsigned long vdso_base;
61} mm_context_t;
62
63#endif /* !__ASSEMBLY__ */
64
65#endif /* _ASM_POWERPC_MMU_40X_H_ */
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index d44d211e7588..4c0e1b4f975c 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -8,6 +8,9 @@
8#elif defined(CONFIG_PPC_STD_MMU) 8#elif defined(CONFIG_PPC_STD_MMU)
9/* 32-bit classic hash table MMU */ 9/* 32-bit classic hash table MMU */
10# include <asm/mmu-hash32.h> 10# include <asm/mmu-hash32.h>
11#elif defined(CONFIG_40x)
12/* 40x-style software loaded TLB */
13# include <asm/mmu-40x.h>
11#elif defined(CONFIG_44x) 14#elif defined(CONFIG_44x)
12/* 44x-style software loaded TLB */ 15/* 44x-style software loaded TLB */
13# include <asm/mmu-44x.h> 16# include <asm/mmu-44x.h>
diff --git a/include/asm-powerpc/mpc52xx_psc.h b/include/asm-powerpc/mpc52xx_psc.h
new file mode 100644
index 000000000000..26690d2b32f5
--- /dev/null
+++ b/include/asm-powerpc/mpc52xx_psc.h
@@ -0,0 +1,191 @@
1/*
2 * include/asm-ppc/mpc52xx_psc.h
3 *
4 * Definitions of consts/structs to drive the Freescale MPC52xx OnChip
5 * PSCs. Theses are shared between multiple drivers since a PSC can be
6 * UART, AC97, IR, I2S, ... So this header is in asm-ppc.
7 *
8 *
9 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
10 *
11 * Based/Extracted from some header of the 2.4 originally written by
12 * Dale Farnsworth <dfarnsworth@mvista.com>
13 *
14 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
15 * Copyright (C) 2003 MontaVista, Software, Inc.
16 *
17 * This file is licensed under the terms of the GNU General Public License
18 * version 2. This program is licensed "as is" without any warranty of any
19 * kind, whether express or implied.
20 */
21
22#ifndef __ASM_MPC52xx_PSC_H__
23#define __ASM_MPC52xx_PSC_H__
24
25#include <asm/types.h>
26
27/* Max number of PSCs */
28#define MPC52xx_PSC_MAXNUM 6
29
30/* Programmable Serial Controller (PSC) status register bits */
31#define MPC52xx_PSC_SR_CDE 0x0080
32#define MPC52xx_PSC_SR_RXRDY 0x0100
33#define MPC52xx_PSC_SR_RXFULL 0x0200
34#define MPC52xx_PSC_SR_TXRDY 0x0400
35#define MPC52xx_PSC_SR_TXEMP 0x0800
36#define MPC52xx_PSC_SR_OE 0x1000
37#define MPC52xx_PSC_SR_PE 0x2000
38#define MPC52xx_PSC_SR_FE 0x4000
39#define MPC52xx_PSC_SR_RB 0x8000
40
41/* PSC Command values */
42#define MPC52xx_PSC_RX_ENABLE 0x0001
43#define MPC52xx_PSC_RX_DISABLE 0x0002
44#define MPC52xx_PSC_TX_ENABLE 0x0004
45#define MPC52xx_PSC_TX_DISABLE 0x0008
46#define MPC52xx_PSC_SEL_MODE_REG_1 0x0010
47#define MPC52xx_PSC_RST_RX 0x0020
48#define MPC52xx_PSC_RST_TX 0x0030
49#define MPC52xx_PSC_RST_ERR_STAT 0x0040
50#define MPC52xx_PSC_RST_BRK_CHG_INT 0x0050
51#define MPC52xx_PSC_START_BRK 0x0060
52#define MPC52xx_PSC_STOP_BRK 0x0070
53
54/* PSC TxRx FIFO status bits */
55#define MPC52xx_PSC_RXTX_FIFO_ERR 0x0040
56#define MPC52xx_PSC_RXTX_FIFO_UF 0x0020
57#define MPC52xx_PSC_RXTX_FIFO_OF 0x0010
58#define MPC52xx_PSC_RXTX_FIFO_FR 0x0008
59#define MPC52xx_PSC_RXTX_FIFO_FULL 0x0004
60#define MPC52xx_PSC_RXTX_FIFO_ALARM 0x0002
61#define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001
62
63/* PSC interrupt mask bits */
64#define MPC52xx_PSC_IMR_TXRDY 0x0100
65#define MPC52xx_PSC_IMR_RXRDY 0x0200
66#define MPC52xx_PSC_IMR_DB 0x0400
67#define MPC52xx_PSC_IMR_IPC 0x8000
68
69/* PSC input port change bit */
70#define MPC52xx_PSC_CTS 0x01
71#define MPC52xx_PSC_DCD 0x02
72#define MPC52xx_PSC_D_CTS 0x10
73#define MPC52xx_PSC_D_DCD 0x20
74
75/* PSC mode fields */
76#define MPC52xx_PSC_MODE_5_BITS 0x00
77#define MPC52xx_PSC_MODE_6_BITS 0x01
78#define MPC52xx_PSC_MODE_7_BITS 0x02
79#define MPC52xx_PSC_MODE_8_BITS 0x03
80#define MPC52xx_PSC_MODE_BITS_MASK 0x03
81#define MPC52xx_PSC_MODE_PAREVEN 0x00
82#define MPC52xx_PSC_MODE_PARODD 0x04
83#define MPC52xx_PSC_MODE_PARFORCE 0x08
84#define MPC52xx_PSC_MODE_PARNONE 0x10
85#define MPC52xx_PSC_MODE_ERR 0x20
86#define MPC52xx_PSC_MODE_FFULL 0x40
87#define MPC52xx_PSC_MODE_RXRTS 0x80
88
89#define MPC52xx_PSC_MODE_ONE_STOP_5_BITS 0x00
90#define MPC52xx_PSC_MODE_ONE_STOP 0x07
91#define MPC52xx_PSC_MODE_TWO_STOP 0x0f
92
93#define MPC52xx_PSC_RFNUM_MASK 0x01ff
94
95
96/* Structure of the hardware registers */
97struct mpc52xx_psc {
98 u8 mode; /* PSC + 0x00 */
99 u8 reserved0[3];
100 union { /* PSC + 0x04 */
101 u16 status;
102 u16 clock_select;
103 } sr_csr;
104#define mpc52xx_psc_status sr_csr.status
105#define mpc52xx_psc_clock_select sr_csr.clock_select
106 u16 reserved1;
107 u8 command; /* PSC + 0x08 */
108 u8 reserved2[3];
109 union { /* PSC + 0x0c */
110 u8 buffer_8;
111 u16 buffer_16;
112 u32 buffer_32;
113 } buffer;
114#define mpc52xx_psc_buffer_8 buffer.buffer_8
115#define mpc52xx_psc_buffer_16 buffer.buffer_16
116#define mpc52xx_psc_buffer_32 buffer.buffer_32
117 union { /* PSC + 0x10 */
118 u8 ipcr;
119 u8 acr;
120 } ipcr_acr;
121#define mpc52xx_psc_ipcr ipcr_acr.ipcr
122#define mpc52xx_psc_acr ipcr_acr.acr
123 u8 reserved3[3];
124 union { /* PSC + 0x14 */
125 u16 isr;
126 u16 imr;
127 } isr_imr;
128#define mpc52xx_psc_isr isr_imr.isr
129#define mpc52xx_psc_imr isr_imr.imr
130 u16 reserved4;
131 u8 ctur; /* PSC + 0x18 */
132 u8 reserved5[3];
133 u8 ctlr; /* PSC + 0x1c */
134 u8 reserved6[3];
135 u16 ccr; /* PSC + 0x20 */
136 u8 reserved7[14];
137 u8 ivr; /* PSC + 0x30 */
138 u8 reserved8[3];
139 u8 ip; /* PSC + 0x34 */
140 u8 reserved9[3];
141 u8 op1; /* PSC + 0x38 */
142 u8 reserved10[3];
143 u8 op0; /* PSC + 0x3c */
144 u8 reserved11[3];
145 u32 sicr; /* PSC + 0x40 */
146 u8 ircr1; /* PSC + 0x44 */
147 u8 reserved13[3];
148 u8 ircr2; /* PSC + 0x44 */
149 u8 reserved14[3];
150 u8 irsdr; /* PSC + 0x4c */
151 u8 reserved15[3];
152 u8 irmdr; /* PSC + 0x50 */
153 u8 reserved16[3];
154 u8 irfdr; /* PSC + 0x54 */
155 u8 reserved17[3];
156 u16 rfnum; /* PSC + 0x58 */
157 u16 reserved18;
158 u16 tfnum; /* PSC + 0x5c */
159 u16 reserved19;
160 u32 rfdata; /* PSC + 0x60 */
161 u16 rfstat; /* PSC + 0x64 */
162 u16 reserved20;
163 u8 rfcntl; /* PSC + 0x68 */
164 u8 reserved21[5];
165 u16 rfalarm; /* PSC + 0x6e */
166 u16 reserved22;
167 u16 rfrptr; /* PSC + 0x72 */
168 u16 reserved23;
169 u16 rfwptr; /* PSC + 0x76 */
170 u16 reserved24;
171 u16 rflrfptr; /* PSC + 0x7a */
172 u16 reserved25;
173 u16 rflwfptr; /* PSC + 0x7e */
174 u32 tfdata; /* PSC + 0x80 */
175 u16 tfstat; /* PSC + 0x84 */
176 u16 reserved26;
177 u8 tfcntl; /* PSC + 0x88 */
178 u8 reserved27[5];
179 u16 tfalarm; /* PSC + 0x8e */
180 u16 reserved28;
181 u16 tfrptr; /* PSC + 0x92 */
182 u16 reserved29;
183 u16 tfwptr; /* PSC + 0x96 */
184 u16 reserved30;
185 u16 tflrfptr; /* PSC + 0x9a */
186 u16 reserved31;
187 u16 tflwfptr; /* PSC + 0x9e */
188};
189
190
191#endif /* __ASM_MPC52xx_PSC_H__ */
diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h
index f3563e11e260..9877982508bf 100644
--- a/include/asm-powerpc/nvram.h
+++ b/include/asm-powerpc/nvram.h
@@ -63,8 +63,10 @@ struct nvram_partition {
63}; 63};
64 64
65 65
66extern int nvram_write_error_log(char * buff, int length, unsigned int err_type); 66extern int nvram_write_error_log(char * buff, int length,
67extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type); 67 unsigned int err_type, unsigned int err_seq);
68extern int nvram_read_error_log(char * buff, int length,
69 unsigned int * err_type, unsigned int *err_seq);
68extern int nvram_clear_error_log(void); 70extern int nvram_clear_error_log(void);
69extern struct nvram_partition *nvram_find_partition(int sig, const char *name); 71extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
70 72
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 3448a3d4bc64..56a2df0f6836 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -28,7 +28,7 @@
28 28
29/* Segment size */ 29/* Segment size */
30#define SID_SHIFT 28 30#define SID_SHIFT 28
31#define SID_MASK 0xfffffffffUL 31#define SID_MASK ASM_CONST(0xfffffffff)
32#define ESID_MASK 0xfffffffff0000000UL 32#define ESID_MASK 0xfffffffff0000000UL
33#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK) 33#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK)
34 34
@@ -121,6 +121,7 @@ extern unsigned int get_slice_psize(struct mm_struct *mm,
121 121
122extern void slice_init_context(struct mm_struct *mm, unsigned int psize); 122extern void slice_init_context(struct mm_struct *mm, unsigned int psize);
123extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); 123extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
124#define slice_mm_new_context(mm) ((mm)->context.id == 0)
124 125
125#define ARCH_HAS_HUGEPAGE_ONLY_RANGE 126#define ARCH_HAS_HUGEPAGE_ONLY_RANGE
126extern int is_hugepage_only_range(struct mm_struct *m, 127extern int is_hugepage_only_range(struct mm_struct *m,
@@ -130,6 +131,12 @@ extern int is_hugepage_only_range(struct mm_struct *m,
130#endif /* __ASSEMBLY__ */ 131#endif /* __ASSEMBLY__ */
131#else 132#else
132#define slice_init() 133#define slice_init()
134#define slice_set_user_psize(mm, psize) \
135do { \
136 (mm)->context.user_psize = (psize); \
137 (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
138} while (0)
139#define slice_mm_new_context(mm) 1
133#endif /* CONFIG_PPC_MM_SLICES */ 140#endif /* CONFIG_PPC_MM_SLICES */
134 141
135#ifdef CONFIG_HUGETLB_PAGE 142#ifdef CONFIG_HUGETLB_PAGE
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index 65325721446d..211fdaeeef84 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -155,6 +155,20 @@ name: \
155 .type GLUE(.,name),@function; \ 155 .type GLUE(.,name),@function; \
156GLUE(.,name): 156GLUE(.,name):
157 157
158#define _INIT_GLOBAL(name) \
159 .section ".text.init.refok"; \
160 .align 2 ; \
161 .globl name; \
162 .globl GLUE(.,name); \
163 .section ".opd","aw"; \
164name: \
165 .quad GLUE(.,name); \
166 .quad .TOC.@tocbase; \
167 .quad 0; \
168 .previous; \
169 .type GLUE(.,name),@function; \
170GLUE(.,name):
171
158#define _KPROBE(name) \ 172#define _KPROBE(name) \
159 .section ".kprobes.text","a"; \ 173 .section ".kprobes.text","a"; \
160 .align 2 ; \ 174 .align 2 ; \
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 672083787a1d..925e2d384bb3 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -24,7 +24,7 @@
24#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 24#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
25#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 25#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
26 26
27#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l)) 27#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2))
28#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 28#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
30 30
@@ -145,7 +145,6 @@ extern void of_detach_node(struct device_node *);
145extern void finish_device_tree(void); 145extern void finish_device_tree(void);
146extern void unflatten_device_tree(void); 146extern void unflatten_device_tree(void);
147extern void early_init_devtree(void *); 147extern void early_init_devtree(void *);
148#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
149extern int machine_is_compatible(const char *compat); 148extern int machine_is_compatible(const char *compat);
150extern void print_properties(struct device_node *node); 149extern void print_properties(struct device_node *node);
151extern int prom_n_intr_cells(struct device_node* np); 150extern int prom_n_intr_cells(struct device_node* np);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index d7f5ddfbaac7..fdc271ebe41c 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -174,7 +174,7 @@ static inline unsigned int get_dec(void)
174static inline void set_dec(int val) 174static inline void set_dec(int val)
175{ 175{
176#if defined(CONFIG_40x) 176#if defined(CONFIG_40x)
177 return; /* Have to let it auto-reload */ 177 mtspr(SPRN_PIT, val);
178#elif defined(CONFIG_8xx_CPU6) 178#elif defined(CONFIG_8xx_CPU6)
179 set_dec_cpu6(val); 179 set_dec_cpu6(val);
180#else 180#else
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index 901f7fa8b2d7..71f4c996fe75 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -35,7 +35,6 @@ extern unsigned long sub_reloc_offset(unsigned long);
35#define machine_is_compatible(x) 0 35#define machine_is_compatible(x) 0
36#define of_find_compatible_node(f, t, c) NULL 36#define of_find_compatible_node(f, t, c) NULL
37#define of_get_property(p, n, l) NULL 37#define of_get_property(p, n, l) NULL
38#define get_property(a, b, c) of_get_property((a), (b), (c))
39 38
40#endif /* _PPC_PROM_H */ 39#endif /* _PPC_PROM_H */
41#endif /* __KERNEL__ */ 40#endif /* __KERNEL__ */
diff --git a/include/linux/of.h b/include/linux/of.h
index 47734ffd9745..6df80e985914 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -54,7 +54,6 @@ extern int of_device_is_compatible(const struct device_node *device,
54extern const void *of_get_property(const struct device_node *node, 54extern const void *of_get_property(const struct device_node *node,
55 const char *name, 55 const char *name,
56 int *lenp); 56 int *lenp);
57#define get_property(a, b, c) of_get_property((a), (b), (c))
58extern int of_n_addr_cells(struct device_node *np); 57extern int of_n_addr_cells(struct device_node *np);
59extern int of_n_size_cells(struct device_node *np); 58extern int of_n_size_cells(struct device_node *np);
60 59