aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/powerpc/booting-without-of.txt4
-rw-r--r--arch/powerpc/Kconfig10
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/powerpc/boot/Makefile34
-rw-r--r--arch/powerpc/boot/dts/holly.dts198
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts11
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts11
-rw-r--r--arch/powerpc/boot/dts/mpc832x_mds.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc836x_mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts6
-rw-r--r--arch/powerpc/boot/holly.c38
-rwxr-xr-xarch/powerpc/boot/wrapper28
-rw-r--r--arch/powerpc/configs/holly_defconfig1070
-rw-r--r--arch/powerpc/configs/mpc832x_mds_defconfig67
-rw-r--r--arch/powerpc/configs/mpc832x_rdb_defconfig28
-rw-r--r--arch/powerpc/configs/mpc836x_mds_defconfig42
-rw-r--r--arch/powerpc/configs/ps3_defconfig329
-rw-r--r--arch/powerpc/kernel/Makefile3
-rw-r--r--arch/powerpc/kernel/asm-offsets.c4
-rw-r--r--arch/powerpc/kernel/head_44x.S4
-rw-r--r--arch/powerpc/kernel/idle.c5
-rw-r--r--arch/powerpc/kernel/idle_power4.S21
-rw-r--r--arch/powerpc/kernel/irq.c11
-rw-r--r--arch/powerpc/kernel/kprobes.c10
-rw-r--r--arch/powerpc/kernel/legacy_serial.c14
-rw-r--r--arch/powerpc/kernel/of_device.c7
-rw-r--r--arch/powerpc/kernel/pci_32.c2
-rw-r--r--arch/powerpc/kernel/pci_64.c9
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c1
-rw-r--r--arch/powerpc/kernel/prom_init.c4
-rw-r--r--arch/powerpc/kernel/prom_parse.c25
-rw-r--r--arch/powerpc/kernel/smp.c73
-rw-r--r--arch/powerpc/kernel/swsusp.c43
-rw-r--r--arch/powerpc/kernel/swsusp_64.c24
-rw-r--r--arch/powerpc/kernel/swsusp_asm64.S228
-rw-r--r--arch/powerpc/kernel/sysfs.c2
-rw-r--r--arch/powerpc/kernel/vio.c2
-rw-r--r--arch/powerpc/mm/44x_mmu.c82
-rw-r--r--arch/powerpc/mm/fault.c42
-rw-r--r--arch/powerpc/mm/hash_native_64.c84
-rw-r--r--arch/powerpc/mm/hash_utils_64.c2
-rw-r--r--arch/powerpc/mm/mem.c1
-rw-r--r--arch/powerpc/mm/mmu_decl.h3
-rw-r--r--arch/powerpc/mm/stab.c2
-rw-r--r--arch/powerpc/platforms/52xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/52xx/Makefile2
-rw-r--r--arch/powerpc/platforms/52xx/efika.c15
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c28
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pm.c191
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_sleep.S154
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc8544_ds.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c2
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c6
-rw-r--r--arch/powerpc/platforms/cell/setup.c2
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c4
-rw-r--r--arch/powerpc/platforms/chrp/pci.c2
-rw-r--r--arch/powerpc/platforms/chrp/setup.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig14
-rw-r--r--arch/powerpc/platforms/embedded6xx/Makefile1
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c317
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c21
-rw-r--r--arch/powerpc/platforms/maple/pci.c12
-rw-r--r--arch/powerpc/platforms/maple/setup.c2
-rw-r--r--arch/powerpc/platforms/pasemi/cpufreq.c4
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c7
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c8
-rw-r--r--arch/powerpc/platforms/powermac/feature.c26
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c2
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c4
-rw-r--r--arch/powerpc/platforms/powermac/pci.c30
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c121
-rw-r--r--arch/powerpc/platforms/powermac/smp.c18
-rw-r--r--arch/powerpc/platforms/ps3/htab.c3
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c234
-rw-r--r--arch/powerpc/platforms/ps3/mm.c1
-rw-r--r--arch/powerpc/platforms/ps3/setup.c7
-rw-r--r--arch/powerpc/platforms/ps3/smp.c6
-rw-r--r--arch/powerpc/platforms/ps3/spu.c18
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c6
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c4
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c1
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
-rw-r--r--arch/powerpc/platforms/pseries/xics.c4
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c46
-rw-r--r--arch/powerpc/sysdev/mpic.c101
-rw-r--r--arch/powerpc/sysdev/tsi108_dev.c7
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c12
-rw-r--r--arch/powerpc/sysdev/uic.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_sgdma.c2
-rw-r--r--drivers/ata/sata_svw.c2
-rw-r--r--drivers/char/agp/uninorth-agp.c2
-rw-r--r--drivers/char/briq_panel.c2
-rw-r--r--drivers/char/hvc_iseries.c2
-rw-r--r--drivers/char/hvc_vio.c2
-rw-r--r--drivers/char/tpm/tpm_atmel.h4
-rw-r--r--drivers/hwmon/ams/ams-core.c6
-rw-r--r--drivers/hwmon/ams/ams-i2c.c2
-rw-r--r--drivers/hwmon/ams/ams-pmu.c2
-rw-r--r--drivers/ide/pci/pdc202xx_new.c2
-rw-r--r--drivers/ide/ppc/pmac.c18
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c2
-rw-r--r--drivers/macintosh/Kconfig12
-rw-r--r--drivers/macintosh/apm_emu.c521
-rw-r--r--drivers/macintosh/mac_hid.c8
-rw-r--r--drivers/macintosh/macio_sysfs.c27
-rw-r--r--drivers/macintosh/smu.c2
-rw-r--r--drivers/macintosh/therm_adt746x.c4
-rw-r--r--drivers/macintosh/via-pmu-led.c35
-rw-r--r--drivers/macintosh/via-pmu.c12
-rw-r--r--drivers/macintosh/windfarm_lm75_sensor.c4
-rw-r--r--drivers/macintosh/windfarm_max6690_sensor.c2
-rw-r--r--drivers/macintosh/windfarm_smu_controls.c2
-rw-r--r--drivers/macintosh/windfarm_smu_sat.c2
-rw-r--r--drivers/mtd/maps/physmap_of.c8
-rw-r--r--drivers/net/bmac.c5
-rw-r--r--drivers/net/ehea/ehea_main.c13
-rw-r--r--drivers/net/mace.c4
-rw-r--r--drivers/net/pasemi_mac.c2
-rw-r--r--drivers/net/spider_net.c4
-rw-r--r--drivers/net/sungem.c2
-rw-r--r--drivers/net/sungem_phy.c2
-rw-r--r--drivers/net/tsi108_eth.c12
-rw-r--r--drivers/net/tsi108_eth.h9
-rw-r--r--drivers/net/ucc_geth.c18
-rw-r--r--drivers/net/ucc_geth_mii.c4
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c10
-rw-r--r--drivers/ps3/vuart.c8
-rw-r--r--drivers/scsi/ibmvscsi/ibmvstgt.c8
-rw-r--r--drivers/scsi/ibmvscsi/rpa_vscsi.c4
-rw-r--r--drivers/scsi/mac53c94.c2
-rw-r--r--drivers/scsi/mesh.c2
-rw-r--r--drivers/serial/mpc52xx_uart.c7
-rw-r--r--drivers/serial/of_serial.c4
-rw-r--r--drivers/serial/pmac_zilog.c8
-rw-r--r--drivers/usb/host/ehci-ps3.c4
-rw-r--r--drivers/usb/host/ohci-ppc-of.c4
-rw-r--r--drivers/usb/host/ohci-ps3.c4
-rw-r--r--drivers/video/aty/radeon_base.c6
-rw-r--r--drivers/video/aty/radeon_monitor.c11
-rw-r--r--drivers/video/aty/radeon_pm.c2
-rw-r--r--drivers/video/nvidia/nv_of.c8
-rw-r--r--drivers/video/offb.c32
-rw-r--r--drivers/video/ps3fb.c12
-rw-r--r--drivers/video/riva/fbdev.c4
-rw-r--r--include/asm-powerpc/iommu.h14
-rw-r--r--include/asm-powerpc/kdebug.h17
-rw-r--r--include/asm-powerpc/kprobes.h7
-rw-r--r--include/asm-powerpc/machdep.h6
-rw-r--r--include/asm-powerpc/mmu-44x.h72
-rw-r--r--include/asm-powerpc/mmu.h7
-rw-r--r--include/asm-powerpc/mpc52xx.h11
-rw-r--r--include/asm-powerpc/mpic.h15
-rw-r--r--include/asm-powerpc/of_device.h2
-rw-r--r--include/asm-powerpc/page.h2
-rw-r--r--include/asm-powerpc/page_32.h2
-rw-r--r--include/asm-powerpc/pgalloc-32.h41
-rw-r--r--include/asm-powerpc/pgalloc-64.h152
-rw-r--r--include/asm-powerpc/pgalloc.h154
-rw-r--r--include/asm-powerpc/pgtable-4k.h3
-rw-r--r--include/asm-powerpc/pgtable-64k.h5
-rw-r--r--include/asm-powerpc/pgtable-ppc32.h839
-rw-r--r--include/asm-powerpc/pgtable-ppc64.h492
-rw-r--r--include/asm-powerpc/pgtable.h493
-rw-r--r--include/asm-powerpc/pmac_feature.h2
-rw-r--r--include/asm-powerpc/prom.h34
-rw-r--r--include/asm-powerpc/ps3.h33
-rw-r--r--include/asm-powerpc/suspend.h9
-rw-r--r--include/asm-powerpc/tsi108.h12
-rw-r--r--include/asm-powerpc/tsi108_pci.h45
-rw-r--r--include/linux/pmu.h8
-rw-r--r--include/linux/suspend.h2
-rw-r--r--kernel/power/Kconfig4
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-onyx.c4
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-tas.c2
-rw-r--r--sound/aoa/soundbus/i2sbus/i2sbus-core.c4
-rw-r--r--sound/oss/dmasound/dmasound_awacs.c16
-rw-r--r--sound/ppc/pmac.c14
-rw-r--r--sound/ppc/tumbler.c2
185 files changed, 5495 insertions, 1986 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 033a3f3b3ab7..d4bfae75c946 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1560,6 +1560,9 @@ platforms are moved over to use the flattened-device-tree model.
1560 network device. This is used by the bootwrapper to interpret 1560 network device. This is used by the bootwrapper to interpret
1561 MAC addresses passed by the firmware when no information other 1561 MAC addresses passed by the firmware when no information other
1562 than indices is available to associate an address with a device. 1562 than indices is available to associate an address with a device.
1563 - phy-connection-type : a string naming the controller/PHY interface type,
1564 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "tbi",
1565 or "rtbi".
1563 1566
1564 Example: 1567 Example:
1565 ucc@2000 { 1568 ucc@2000 {
@@ -1574,6 +1577,7 @@ platforms are moved over to use the flattened-device-tree model.
1574 rx-clock = "none"; 1577 rx-clock = "none";
1575 tx-clock = "clk9"; 1578 tx-clock = "clk9";
1576 phy-handle = <212000>; 1579 phy-handle = <212000>;
1580 phy-connection-type = "gmii";
1577 pio-handle = <140001>; 1581 pio-handle = <140001>;
1578 }; 1582 };
1579 1583
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8de5f9ff4ade..67668fdb0292 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -117,6 +117,9 @@ config GENERIC_BUG
117 default y 117 default y
118 depends on BUG 118 depends on BUG
119 119
120config SYS_SUPPORTS_APM_EMULATION
121 bool
122
120# 123#
121# Powerpc uses the slab allocator to manage its ptes and the 124# Powerpc uses the slab allocator to manage its ptes and the
122# page structs of ptes are used for splitting the page table 125# page structs of ptes are used for splitting the page table
@@ -136,6 +139,11 @@ config DEFAULT_UIMAGE
136 Used to allow a board to specify it wants a uImage built by default 139 Used to allow a board to specify it wants a uImage built by default
137 default n 140 default n
138 141
142config PPC64_SWSUSP
143 bool
144 depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
145 default y
146
139menu "Processor support" 147menu "Processor support"
140choice 148choice
141 prompt "Processor Type" 149 prompt "Processor Type"
@@ -669,7 +677,7 @@ config MCA
669config PCI 677config PCI
670 bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \ 678 bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
671 || PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \ 679 || PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
672 || MPC7448HPC2 || PPC_PS3 680 || MPC7448HPC2 || PPC_PS3 || PPC_HOLLY
673 default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \ 681 default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
674 && !PPC_85xx && !PPC_86xx 682 && !PPC_85xx && !PPC_86xx
675 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS 683 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 794992025d8d..81a531d84ff9 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -148,7 +148,7 @@ all: $(KBUILD_IMAGE)
148 148
149CPPFLAGS_vmlinux.lds := -Upowerpc 149CPPFLAGS_vmlinux.lds := -Upowerpc
150 150
151BOOT_TARGETS = zImage zImage.initrd uImage cuImage 151BOOT_TARGETS = zImage zImage.initrd uImage
152 152
153PHONY += $(BOOT_TARGETS) 153PHONY += $(BOOT_TARGETS)
154 154
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 3716594ea33e..ccd757c193e7 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -37,13 +37,13 @@ zlib := inffast.c inflate.c inftrees.c
37zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 37zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
38zliblinuxheader := zlib.h zconf.h zutil.h 38zliblinuxheader := zlib.h zconf.h zutil.h
39 39
40$(addprefix $(obj)/,$(zlib) main.o): $(addprefix $(obj)/,$(zliblinuxheader)) \ 40$(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
41 $(addprefix $(obj)/,$(zlibheader)) 41 $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
42 42
43src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 43src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
44 ns16550.c serial.c simple_alloc.c div64.S util.S \ 44 ns16550.c serial.c simple_alloc.c div64.S util.S \
45 gunzip_util.c elf_util.c $(zlib) devtree.c 45 gunzip_util.c elf_util.c $(zlib) devtree.c
46src-plat := of.c cuboot-83xx.c cuboot-85xx.c 46src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c
47src-boot := $(src-wlib) $(src-plat) empty.c 47src-boot := $(src-wlib) $(src-plat) empty.c
48 48
49src-boot := $(addprefix $(obj)/, $(src-boot)) 49src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -129,7 +129,13 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries
129image-$(CONFIG_PPC_CHRP) += zImage.chrp 129image-$(CONFIG_PPC_CHRP) += zImage.chrp
130image-$(CONFIG_PPC_EFIKA) += zImage.chrp 130image-$(CONFIG_PPC_EFIKA) += zImage.chrp
131image-$(CONFIG_PPC_PMAC) += zImage.pmac 131image-$(CONFIG_PPC_PMAC) += zImage.pmac
132image-$(CONFIG_DEFAULT_UIMAGE) += uImage cuImage 132image-$(CONFIG_PPC_HOLLY) += zImage.holly-elf
133image-$(CONFIG_DEFAULT_UIMAGE) += uImage
134
135ifneq ($(CONFIG_DEVICE_TREE),"")
136image-$(CONFIG_PPC_83xx) += cuImage.83xx
137image-$(CONFIG_PPC_85xx) += cuImage.85xx
138endif
133 139
134# For 32-bit powermacs, build the COFF and miboot images 140# For 32-bit powermacs, build the COFF and miboot images
135# as well as the ELF images. 141# as well as the ELF images.
@@ -159,18 +165,21 @@ $(obj)/zImage.ps3: vmlinux
159$(obj)/zImage.initrd.ps3: vmlinux 165$(obj)/zImage.initrd.ps3: vmlinux
160 @echo " WARNING zImage.initrd.ps3 not supported (yet)" 166 @echo " WARNING zImage.initrd.ps3 not supported (yet)"
161 167
168$(obj)/zImage.holly-elf: vmlinux $(wrapperbits)
169 $(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,)
170
171$(obj)/zImage.initrd.holly-elf: vmlinux $(wrapperbits) $(obj)/ramdisk.image.gz
172 $(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,$(obj)/ramdisk.image.gz)
173
162$(obj)/uImage: vmlinux $(wrapperbits) 174$(obj)/uImage: vmlinux $(wrapperbits)
163 $(call if_changed,wrap,uboot) 175 $(call if_changed,wrap,uboot)
164 176
165cuboot-plat-$(CONFIG_83xx) += 83xx 177# CONFIG_DEVICE_TREE will have "" around it, make sure to strip them
166cuboot-plat-$(CONFIG_85xx) += 85xx
167cuboot-plat-y += unknown-platform
168
169dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\ 178dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\
170 ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE) 179 ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE:"%"=%)
171 180
172$(obj)/cuImage: vmlinux $(wrapperbits) 181$(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits)
173 $(call if_changed,wrap,cuboot-$(word 1,$(cuboot-plat-y)),$(dts)) 182 $(call if_changed,wrap,cuboot-$*,$(dts))
174 183
175$(obj)/zImage: $(addprefix $(obj)/, $(image-y)) 184$(obj)/zImage: $(addprefix $(obj)/, $(image-y))
176 @rm -f $@; ln $< $@ 185 @rm -f $@; ln $< $@
@@ -181,8 +190,7 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
181 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< 190 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $<
182 191
183# anything not in $(targets) 192# anything not in $(targets)
184clean-files += $(image-) $(initrd-) zImage zImage.initrd \ 193clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.*
185 cuImage.elf cuImage.bin.gz
186 194
187# clean up files cached by wrapper 195# clean up files cached by wrapper
188clean-kernel := vmlinux.strip vmlinux.bin 196clean-kernel := vmlinux.strip vmlinux.bin
diff --git a/arch/powerpc/boot/dts/holly.dts b/arch/powerpc/boot/dts/holly.dts
new file mode 100644
index 000000000000..254499b107f4
--- /dev/null
+++ b/arch/powerpc/boot/dts/holly.dts
@@ -0,0 +1,198 @@
1/*
2 * Device Tree Source for IBM Holly (PPC 750CL with TSI controller)
3 * Copyright 2007, IBM Corporation
4 *
5 * Stephen Winiecki <stevewin@us.ibm.com>
6 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without
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 */
16
17/ {
18 model = "41K7339";
19 compatible = "ibm,holly";
20 #address-cells = <1>;
21 #size-cells = <1>;
22
23 cpus {
24 #address-cells = <1>;
25 #size-cells =<0>;
26 PowerPC,750CL@0 {
27 device_type = "cpu";
28 reg = <0>;
29 d-cache-line-size = <20>;
30 i-cache-line-size = <20>;
31 d-cache-size = <8000>;
32 i-cache-size = <8000>;
33 d-cache-sets = <80>;
34 i-cache-sets = <80>;
35 timebase-frequency = <2faf080>;
36 clock-frequency = <23c34600>;
37 bus-frequency = <bebc200>;
38 32-bit;
39 };
40 };
41
42 memory@0 {
43 device_type = "memory";
44 reg = <00000000 20000000>;
45 };
46
47 tsi109@c0000000 {
48 device_type = "tsi-bridge";
49 compatible = "tsi-bridge";
50 #address-cells = <1>;
51 #size-cells = <1>;
52 ranges = <00000000 c0000000 00010000>;
53 reg = <c0000000 00010000>;
54
55 i2c@7000 {
56 device_type = "i2c";
57 compatible = "tsi-i2c";
58 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
59 interrupts = <e 2>;
60 reg = <7000 400>;
61 };
62
63 mdio@6000 {
64 device_type = "mdio";
65 compatible = "tsi-ethernet";
66
67 PHY1: ethernet-phy@6000 {
68 device_type = "ethernet-phy";
69 compatible = "bcm54xx";
70 reg = <6000 50>;
71 phy-id = <1>;
72 };
73
74 PHY2: ethernet-phy@6400 {
75 device_type = "ethernet-phy";
76 compatible = "bcm54xx";
77 reg = <6000 50>;
78 phy-id = <2>;
79 };
80 };
81
82 ethernet@6200 {
83 device_type = "network";
84 compatible = "tsi-ethernet";
85 #address-cells = <1>;
86 #size-cells = <0>;
87 reg = <6000 200>;
88 local-mac-address = [ 00 00 00 00 00 00 ];
89 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
90 interrupts = <10 2>;
91 phy-handle = <&PHY1>;
92 };
93
94 ethernet@6600 {
95 device_type = "network";
96 compatible = "tsi-ethernet";
97 #address-cells = <1>;
98 #size-cells = <0>;
99 reg = <6400 200>;
100 local-mac-address = [ 00 00 00 00 00 00 ];
101 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
102 interrupts = <11 2>;
103 phy-handle = <&PHY2>;
104 };
105
106 serial@7808 {
107 device_type = "serial";
108 compatible = "ns16550";
109 reg = <7808 200>;
110 virtual-reg = <c0007808>;
111 clock-frequency = <3F9C6000>;
112 current-speed = <1c200>;
113 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
114 interrupts = <c 2>;
115 };
116
117 serial@7c08 {
118 device_type = "serial";
119 compatible = "ns16550";
120 reg = <7c08 200>;
121 virtual-reg = <c0007c08>;
122 clock-frequency = <3F9C6000>;
123 current-speed = <1c200>;
124 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
125 interrupts = <d 2>;
126 };
127
128 MPIC: pic@7400 {
129 device_type = "open-pic";
130 compatible = "chrp,open-pic";
131 interrupt-controller;
132 #interrupt-cells = <2>;
133 reg = <7400 400>;
134 big-endian;
135 };
136
137 pci@1000 {
138 device_type = "pci";
139 compatible = "tsi109";
140 #interrupt-cells = <1>;
141 #size-cells = <2>;
142 #address-cells = <3>;
143 reg = <1000 1000>;
144 bus-range = <0 0>;
145 /*----------------------------------------------------+
146 | PCI memory range.
147 | 01 denotes I/O space
148 | 02 denotes 32-bit memory space
149 +----------------------------------------------------*/
150 ranges = <02000000 0 40000000 40000000 0 10000000
151 01000000 0 00000000 7e000000 0 00010000>;
152 clock-frequency = <7f28154>;
153 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
154 interrupts = <17 2>;
155 interrupt-map-mask = <f800 0 0 7>;
156 /*----------------------------------------------------+
157 | The INTA, INTB, INTC, INTD are shared.
158 +----------------------------------------------------*/
159 interrupt-map = <
160 0800 0 0 1 &RT0 24 0
161 0800 0 0 2 &RT0 25 0
162 0800 0 0 3 &RT0 26 0
163 0800 0 0 4 &RT0 27 0
164
165 1000 0 0 1 &RT0 25 0
166 1000 0 0 2 &RT0 26 0
167 1000 0 0 3 &RT0 27 0
168 1000 0 0 4 &RT0 24 0
169
170 1800 0 0 1 &RT0 26 0
171 1800 0 0 2 &RT0 27 0
172 1800 0 0 3 &RT0 24 0
173 1800 0 0 4 &RT0 25 0
174
175 2000 0 0 1 &RT0 27 0
176 2000 0 0 2 &RT0 24 0
177 2000 0 0 3 &RT0 25 0
178 2000 0 0 4 &RT0 26 0
179 >;
180
181 RT0: router@1180 {
182 device_type = "pic-router";
183 interrupt-controller;
184 big-endian;
185 clock-frequency = <0>;
186 #address-cells = <0>;
187 #interrupt-cells = <2>;
188 interrupts = <17 2>;
189 interrupt-parent = < &/tsi109@c0000000/pic@7400 >;
190 };
191 };
192 };
193
194 chosen {
195 linux,stdout-path = "/tsi109@c0000000/serial@7808";
196 bootargs = "console=ttyS0,115200";
197 };
198};
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index ba54c6b40a09..e13ac6ef05a9 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -48,6 +48,7 @@
48 48
49 soc5200@f0000000 { 49 soc5200@f0000000 {
50 model = "fsl,mpc5200"; 50 model = "fsl,mpc5200";
51 compatible = "mpc5200";
51 revision = "" // from bootloader 52 revision = "" // from bootloader
52 #interrupt-cells = <3>; 53 #interrupt-cells = <3>;
53 device_type = "soc"; 54 device_type = "soc";
@@ -166,7 +167,7 @@
166 device_type = "mscan"; 167 device_type = "mscan";
167 compatible = "mpc5200-mscan"; 168 compatible = "mpc5200-mscan";
168 cell-index = <1>; 169 cell-index = <1>;
169 interrupts = <1 12 0>; 170 interrupts = <2 12 0>;
170 interrupt-parent = <500>; 171 interrupt-parent = <500>;
171 reg = <980 80>; 172 reg = <980 80>;
172 }; 173 };
@@ -178,7 +179,7 @@
178 interrupt-parent = <500>; 179 interrupt-parent = <500>;
179 }; 180 };
180 181
181 gpio-wkup@b00 { 182 gpio-wkup@c00 {
182 compatible = "mpc5200-gpio-wkup"; 183 compatible = "mpc5200-gpio-wkup";
183 reg = <c00 40>; 184 reg = <c00 40>;
184 interrupts = <1 8 0 0 3 0>; 185 interrupts = <1 8 0 0 3 0>;
@@ -317,20 +318,22 @@
317 318
318 i2c@3d00 { 319 i2c@3d00 {
319 device_type = "i2c"; 320 device_type = "i2c";
320 compatible = "mpc5200-i2c"; 321 compatible = "mpc5200-i2c\0fsl-i2c";
321 cell-index = <0>; 322 cell-index = <0>;
322 reg = <3d00 40>; 323 reg = <3d00 40>;
323 interrupts = <2 f 0>; 324 interrupts = <2 f 0>;
324 interrupt-parent = <500>; 325 interrupt-parent = <500>;
326 fsl5200-clocking;
325 }; 327 };
326 328
327 i2c@3d40 { 329 i2c@3d40 {
328 device_type = "i2c"; 330 device_type = "i2c";
329 compatible = "mpc5200-i2c"; 331 compatible = "mpc5200-i2c\0fsl-i2c";
330 cell-index = <1>; 332 cell-index = <1>;
331 reg = <3d40 40>; 333 reg = <3d40 40>;
332 interrupts = <2 10 0>; 334 interrupts = <2 10 0>;
333 interrupt-parent = <500>; 335 interrupt-parent = <500>;
336 fsl5200-clocking;
334 }; 337 };
335 sram@8000 { 338 sram@8000 {
336 device_type = "sram"; 339 device_type = "sram";
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index 2e003081b0d3..00211b39a342 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -48,6 +48,7 @@
48 48
49 soc5200@f0000000 { 49 soc5200@f0000000 {
50 model = "fsl,mpc5200b"; 50 model = "fsl,mpc5200b";
51 compatible = "mpc5200";
51 revision = ""; // from bootloader 52 revision = ""; // from bootloader
52 #interrupt-cells = <3>; 53 #interrupt-cells = <3>;
53 device_type = "soc"; 54 device_type = "soc";
@@ -166,7 +167,7 @@
166 device_type = "mscan"; 167 device_type = "mscan";
167 compatible = "mpc5200b-mscan\0mpc5200-mscan"; 168 compatible = "mpc5200b-mscan\0mpc5200-mscan";
168 cell-index = <1>; 169 cell-index = <1>;
169 interrupts = <1 12 0>; 170 interrupts = <2 12 0>;
170 interrupt-parent = <500>; 171 interrupt-parent = <500>;
171 reg = <980 80>; 172 reg = <980 80>;
172 }; 173 };
@@ -178,7 +179,7 @@
178 interrupt-parent = <500>; 179 interrupt-parent = <500>;
179 }; 180 };
180 181
181 gpio-wkup@b00 { 182 gpio-wkup@c00 {
182 compatible = "mpc5200b-gpio-wkup\0mpc5200-gpio-wkup"; 183 compatible = "mpc5200b-gpio-wkup\0mpc5200-gpio-wkup";
183 reg = <c00 40>; 184 reg = <c00 40>;
184 interrupts = <1 8 0 0 3 0>; 185 interrupts = <1 8 0 0 3 0>;
@@ -322,20 +323,22 @@
322 323
323 i2c@3d00 { 324 i2c@3d00 {
324 device_type = "i2c"; 325 device_type = "i2c";
325 compatible = "mpc5200b-i2c\0mpc5200-i2c"; 326 compatible = "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c";
326 cell-index = <0>; 327 cell-index = <0>;
327 reg = <3d00 40>; 328 reg = <3d00 40>;
328 interrupts = <2 f 0>; 329 interrupts = <2 f 0>;
329 interrupt-parent = <500>; 330 interrupt-parent = <500>;
331 fsl5200-clocking;
330 }; 332 };
331 333
332 i2c@3d40 { 334 i2c@3d40 {
333 device_type = "i2c"; 335 device_type = "i2c";
334 compatible = "mpc5200b-i2c\0mpc5200-i2c"; 336 compatible = "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c";
335 cell-index = <1>; 337 cell-index = <1>;
336 reg = <3d40 40>; 338 reg = <3d40 40>;
337 interrupts = <2 10 0>; 339 interrupts = <2 10 0>;
338 interrupt-parent = <500>; 340 interrupt-parent = <500>;
341 fsl5200-clocking;
339 }; 342 };
340 sram@8000 { 343 sram@8000 {
341 device_type = "sram"; 344 device_type = "sram";
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index c798491f4cd0..93b760696010 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -306,14 +306,12 @@
306 interrupts = <11 8>; 306 interrupts = <11 8>;
307 reg = <3>; 307 reg = <3>;
308 device_type = "ethernet-phy"; 308 device_type = "ethernet-phy";
309 interface = <3>; //ENET_100_MII
310 }; 309 };
311 phy4: ethernet-phy@04 { 310 phy4: ethernet-phy@04 {
312 interrupt-parent = < &ipic >; 311 interrupt-parent = < &ipic >;
313 interrupts = <12 8>; 312 interrupts = <12 8>;
314 reg = <4>; 313 reg = <4>;
315 device_type = "ethernet-phy"; 314 device_type = "ethernet-phy";
316 interface = <3>;
317 }; 315 };
318 }; 316 };
319 317
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index b55bced1593d..be4c35784e49 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -265,14 +265,12 @@
265 interrupts = <0>; 265 interrupts = <0>;
266 reg = <0>; 266 reg = <0>;
267 device_type = "ethernet-phy"; 267 device_type = "ethernet-phy";
268 interface = <3>; //ENET_100_MII
269 }; 268 };
270 phy04:ethernet-phy@04 { 269 phy04:ethernet-phy@04 {
271 interrupt-parent = <&pic>; 270 interrupt-parent = <&pic>;
272 interrupts = <0>; 271 interrupts = <0>;
273 reg = <4>; 272 reg = <4>;
274 device_type = "ethernet-phy"; 273 device_type = "ethernet-phy";
275 interface = <3>;
276 }; 274 };
277 }; 275 };
278 276
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 7f578eb57082..38c8594df3a4 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -305,6 +305,7 @@
305 rx-clock = <0>; 305 rx-clock = <0>;
306 tx-clock = <19>; 306 tx-clock = <19>;
307 phy-handle = < &phy0 >; 307 phy-handle = < &phy0 >;
308 phy-connection-type = "rgmii-id";
308 pio-handle = < &pio1 >; 309 pio-handle = < &pio1 >;
309 }; 310 };
310 311
@@ -320,6 +321,7 @@
320 rx-clock = <0>; 321 rx-clock = <0>;
321 tx-clock = <14>; 322 tx-clock = <14>;
322 phy-handle = < &phy1 >; 323 phy-handle = < &phy1 >;
324 phy-connection-type = "rgmii-id";
323 pio-handle = < &pio2 >; 325 pio-handle = < &pio2 >;
324 }; 326 };
325 327
@@ -335,14 +337,12 @@
335 interrupts = <11 8>; 337 interrupts = <11 8>;
336 reg = <0>; 338 reg = <0>;
337 device_type = "ethernet-phy"; 339 device_type = "ethernet-phy";
338 interface = <6>; //ENET_1000_GMII
339 }; 340 };
340 phy1: ethernet-phy@01 { 341 phy1: ethernet-phy@01 {
341 interrupt-parent = < &ipic >; 342 interrupt-parent = < &ipic >;
342 interrupts = <12 8>; 343 interrupts = <12 8>;
343 reg = <1>; 344 reg = <1>;
344 device_type = "ethernet-phy"; 345 device_type = "ethernet-phy";
345 interface = <6>;
346 }; 346 };
347 }; 347 };
348 348
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 7361b36749cb..948a3b61bd4a 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -288,6 +288,7 @@
288 rx-clock = <0>; 288 rx-clock = <0>;
289 tx-clock = <19>; 289 tx-clock = <19>;
290 phy-handle = <&qe_phy0>; 290 phy-handle = <&qe_phy0>;
291 phy-connection-type = "gmii";
291 pio-handle = <&pio1>; 292 pio-handle = <&pio1>;
292 }; 293 };
293 294
@@ -303,6 +304,7 @@
303 rx-clock = <0>; 304 rx-clock = <0>;
304 tx-clock = <14>; 305 tx-clock = <14>;
305 phy-handle = <&qe_phy1>; 306 phy-handle = <&qe_phy1>;
307 phy-connection-type = "gmii";
306 pio-handle = <&pio2>; 308 pio-handle = <&pio2>;
307 }; 309 };
308 310
@@ -320,28 +322,24 @@
320 interrupts = <31 1>; 322 interrupts = <31 1>;
321 reg = <0>; 323 reg = <0>;
322 device_type = "ethernet-phy"; 324 device_type = "ethernet-phy";
323 interface = <6>; //ENET_1000_GMII
324 }; 325 };
325 qe_phy1: ethernet-phy@01 { 326 qe_phy1: ethernet-phy@01 {
326 interrupt-parent = <&mpic>; 327 interrupt-parent = <&mpic>;
327 interrupts = <32 1>; 328 interrupts = <32 1>;
328 reg = <1>; 329 reg = <1>;
329 device_type = "ethernet-phy"; 330 device_type = "ethernet-phy";
330 interface = <6>;
331 }; 331 };
332 qe_phy2: ethernet-phy@02 { 332 qe_phy2: ethernet-phy@02 {
333 interrupt-parent = <&mpic>; 333 interrupt-parent = <&mpic>;
334 interrupts = <31 1>; 334 interrupts = <31 1>;
335 reg = <2>; 335 reg = <2>;
336 device_type = "ethernet-phy"; 336 device_type = "ethernet-phy";
337 interface = <6>; //ENET_1000_GMII
338 }; 337 };
339 qe_phy3: ethernet-phy@03 { 338 qe_phy3: ethernet-phy@03 {
340 interrupt-parent = <&mpic>; 339 interrupt-parent = <&mpic>;
341 interrupts = <32 1>; 340 interrupts = <32 1>;
342 reg = <3>; 341 reg = <3>;
343 device_type = "ethernet-phy"; 342 device_type = "ethernet-phy";
344 interface = <6>; //ENET_1000_GMII
345 }; 343 };
346 }; 344 };
347 345
diff --git a/arch/powerpc/boot/holly.c b/arch/powerpc/boot/holly.c
new file mode 100644
index 000000000000..7d6539f5e22c
--- /dev/null
+++ b/arch/powerpc/boot/holly.c
@@ -0,0 +1,38 @@
1/*
2 * Copyright 2007 IBM Corporation
3 *
4 * Stephen Winiecki <stevewin@us.ibm.com>
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * Based on earlier code:
8 * Copyright (C) Paul Mackerras 1997.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 */
14#include <stdarg.h>
15#include <stddef.h>
16#include "types.h"
17#include "elf.h"
18#include "string.h"
19#include "stdio.h"
20#include "page.h"
21#include "ops.h"
22#include "io.h"
23
24extern char _start[];
25extern char _end[];
26extern char _dtb_start[];
27extern char _dtb_end[];
28
29BSS_STACK(4096);
30
31void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
32{
33 u32 heapsize = 0x8000000 - (u32)_end; /* 128M */
34
35 simple_alloc_init(_end, heapsize, 32, 64);
36 ft_init(_dtb_start, 0, 4);
37 serial_console_init();
38}
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 5cedd901201f..1ea208096b15 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -163,20 +163,19 @@ fi
163 163
164vmz="$vmz$gzip" 164vmz="$vmz$gzip"
165 165
166case "$platform" in 166# Extract kernel version information, some platforms want to include
167uboot|cuboot*) 167# it in the image header
168 version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ 168version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \
169 cut -d' ' -f3` 169 cut -d' ' -f3`
170 if [ -n "$version" ]; then 170if [ -n "$version" ]; then
171 version="-n Linux-$version" 171 uboot_version="-n Linux-$version"
172 fi 172fi
173esac
174 173
175case "$platform" in 174case "$platform" in
176uboot) 175uboot)
177 rm -f "$ofile" 176 rm -f "$ofile"
178 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ 177 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
179 $version -d "$vmz" "$ofile" 178 $uboot_version -d "$vmz" "$ofile"
180 if [ -z "$cacheit" ]; then 179 if [ -z "$cacheit" ]; then
181 rm -f "$vmz" 180 rm -f "$vmz"
182 fi 181 fi
@@ -212,25 +211,24 @@ if [ "$platform" != "miboot" ]; then
212 rm $tmp 211 rm $tmp
213fi 212fi
214 213
214# Some platforms need the zImage's entry point and base address
215base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
216entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`
217
215# post-processing needed for some platforms 218# post-processing needed for some platforms
216case "$platform" in 219case "$platform" in
217pseries|chrp) 220pseries|chrp)
218 $object/addnote "$ofile" 221 $object/addnote "$ofile"
219 ;; 222 ;;
220pmaccoff) 223pmaccoff)
221 entry=`objdump -f "$ofile" | grep '^start address ' | \
222 cut -d' ' -f3`
223 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" 224 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
224 $object/hack-coff "$ofile" 225 $object/hack-coff "$ofile"
225 ;; 226 ;;
226cuboot*) 227cuboot*)
227 base=`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
228 entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | \
229 cut -d' ' -f3`
230 mv "$ofile" "$ofile".elf 228 mv "$ofile" "$ofile".elf
231 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin 229 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
232 gzip -f -9 "$ofile".bin 230 gzip -f -9 "$ofile".bin
233 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ 231 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
234 $version -d "$ofile".bin.gz "$ofile" 232 $uboot_version -d "$ofile".bin.gz "$ofile"
235 ;; 233 ;;
236esac 234esac
diff --git a/arch/powerpc/configs/holly_defconfig b/arch/powerpc/configs/holly_defconfig
new file mode 100644
index 000000000000..be633b9b57c3
--- /dev/null
+++ b/arch/powerpc/configs/holly_defconfig
@@ -0,0 +1,1070 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21
4# Sat May 5 11:02:35 2007
5#
6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y
8CONFIG_PPC_MERGE=y
9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_IRQ_PER_CPU=y
12CONFIG_RWSEM_XCHGADD_ALGORITHM=y
13CONFIG_ARCH_HAS_ILOG2_U32=y
14CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_CALIBRATE_DELAY=y
16CONFIG_GENERIC_FIND_NEXT_BIT=y
17CONFIG_PPC=y
18CONFIG_EARLY_PRINTK=y
19CONFIG_GENERIC_NVRAM=y
20CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
21CONFIG_ARCH_MAY_HAVE_PC_FDC=y
22CONFIG_PPC_OF=y
23CONFIG_PPC_UDBG_16550=y
24# CONFIG_GENERIC_TBSYNC is not set
25CONFIG_AUDIT_ARCH=y
26CONFIG_GENERIC_BUG=y
27# CONFIG_DEFAULT_UIMAGE is not set
28
29#
30# Processor support
31#
32CONFIG_CLASSIC32=y
33# CONFIG_PPC_82xx is not set
34# CONFIG_PPC_83xx is not set
35# CONFIG_PPC_85xx is not set
36# CONFIG_PPC_86xx is not set
37# CONFIG_PPC_8xx is not set
38# CONFIG_40x is not set
39# CONFIG_44x is not set
40# CONFIG_E200 is not set
41CONFIG_6xx=y
42CONFIG_PPC_FPU=y
43# CONFIG_PPC_DCR_NATIVE is not set
44# CONFIG_PPC_DCR_MMIO is not set
45# CONFIG_ALTIVEC is not set
46CONFIG_PPC_STD_MMU=y
47CONFIG_PPC_STD_MMU_32=y
48# CONFIG_SMP is not set
49CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
50
51#
52# Code maturity level options
53#
54CONFIG_EXPERIMENTAL=y
55CONFIG_BROKEN_ON_SMP=y
56CONFIG_INIT_ENV_ARG_LIMIT=32
57
58#
59# General setup
60#
61CONFIG_LOCALVERSION=""
62CONFIG_LOCALVERSION_AUTO=y
63CONFIG_SWAP=y
64CONFIG_SYSVIPC=y
65# CONFIG_IPC_NS is not set
66CONFIG_SYSVIPC_SYSCTL=y
67# CONFIG_POSIX_MQUEUE is not set
68# CONFIG_BSD_PROCESS_ACCT is not set
69# CONFIG_TASKSTATS is not set
70# CONFIG_UTS_NS is not set
71# CONFIG_AUDIT is not set
72# CONFIG_IKCONFIG is not set
73CONFIG_SYSFS_DEPRECATED=y
74# CONFIG_RELAY is not set
75CONFIG_BLK_DEV_INITRD=y
76CONFIG_INITRAMFS_SOURCE=""
77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
78CONFIG_SYSCTL=y
79CONFIG_EMBEDDED=y
80CONFIG_SYSCTL_SYSCALL=y
81CONFIG_KALLSYMS=y
82# CONFIG_KALLSYMS_ALL is not set
83# CONFIG_KALLSYMS_EXTRA_PASS is not set
84CONFIG_HOTPLUG=y
85CONFIG_PRINTK=y
86CONFIG_BUG=y
87CONFIG_ELF_CORE=y
88CONFIG_BASE_FULL=y
89CONFIG_FUTEX=y
90CONFIG_EPOLL=y
91CONFIG_SHMEM=y
92CONFIG_SLAB=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_RT_MUTEXES=y
95# CONFIG_TINY_SHMEM is not set
96CONFIG_BASE_SMALL=0
97# CONFIG_SLOB is not set
98
99#
100# Loadable module support
101#
102CONFIG_MODULES=y
103# CONFIG_MODULE_UNLOAD is not set
104# CONFIG_MODVERSIONS is not set
105# CONFIG_MODULE_SRCVERSION_ALL is not set
106# CONFIG_KMOD is not set
107
108#
109# Block layer
110#
111CONFIG_BLOCK=y
112CONFIG_LBD=y
113# CONFIG_BLK_DEV_IO_TRACE is not set
114# CONFIG_LSF is not set
115
116#
117# IO Schedulers
118#
119CONFIG_IOSCHED_NOOP=y
120CONFIG_IOSCHED_AS=y
121CONFIG_IOSCHED_DEADLINE=y
122CONFIG_IOSCHED_CFQ=y
123CONFIG_DEFAULT_AS=y
124# CONFIG_DEFAULT_DEADLINE is not set
125# CONFIG_DEFAULT_CFQ is not set
126# CONFIG_DEFAULT_NOOP is not set
127CONFIG_DEFAULT_IOSCHED="anticipatory"
128
129#
130# Platform support
131#
132# CONFIG_PPC_MULTIPLATFORM is not set
133CONFIG_EMBEDDED6xx=y
134# CONFIG_APUS is not set
135# CONFIG_PPC_MPC52xx is not set
136# CONFIG_PPC_MPC5200 is not set
137# CONFIG_PPC_CELL is not set
138# CONFIG_PPC_CELL_NATIVE is not set
139# CONFIG_PQ2ADS is not set
140# CONFIG_LINKSTATION is not set
141# CONFIG_MPC7448HPC2 is not set
142CONFIG_PPC_HOLLY=y
143CONFIG_TSI108_BRIDGE=y
144CONFIG_MPIC=y
145CONFIG_MPIC_WEIRD=y
146# CONFIG_PPC_I8259 is not set
147# CONFIG_PPC_RTAS is not set
148# CONFIG_MMIO_NVRAM is not set
149# CONFIG_PPC_MPC106 is not set
150# CONFIG_PPC_970_NAP is not set
151# CONFIG_PPC_INDIRECT_IO is not set
152# CONFIG_GENERIC_IOMAP is not set
153# CONFIG_CPU_FREQ is not set
154# CONFIG_TAU is not set
155# CONFIG_CPM2 is not set
156
157#
158# Kernel options
159#
160# CONFIG_HIGHMEM is not set
161# CONFIG_HZ_100 is not set
162CONFIG_HZ_250=y
163# CONFIG_HZ_300 is not set
164# CONFIG_HZ_1000 is not set
165CONFIG_HZ=250
166CONFIG_PREEMPT_NONE=y
167# CONFIG_PREEMPT_VOLUNTARY is not set
168# CONFIG_PREEMPT is not set
169CONFIG_BINFMT_ELF=y
170CONFIG_BINFMT_MISC=y
171CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
172CONFIG_ARCH_FLATMEM_ENABLE=y
173CONFIG_ARCH_POPULATES_NODE_MAP=y
174CONFIG_SELECT_MEMORY_MODEL=y
175CONFIG_FLATMEM_MANUAL=y
176# CONFIG_DISCONTIGMEM_MANUAL is not set
177# CONFIG_SPARSEMEM_MANUAL is not set
178CONFIG_FLATMEM=y
179CONFIG_FLAT_NODE_MEM_MAP=y
180# CONFIG_SPARSEMEM_STATIC is not set
181CONFIG_SPLIT_PTLOCK_CPUS=4
182# CONFIG_RESOURCES_64BIT is not set
183CONFIG_ZONE_DMA_FLAG=1
184CONFIG_PROC_DEVICETREE=y
185# CONFIG_CMDLINE_BOOL is not set
186# CONFIG_PM is not set
187# CONFIG_SECCOMP is not set
188# CONFIG_WANT_DEVICE_TREE is not set
189CONFIG_ISA_DMA_API=y
190
191#
192# Bus options
193#
194CONFIG_ZONE_DMA=y
195CONFIG_GENERIC_ISA_DMA=y
196# CONFIG_PPC_INDIRECT_PCI is not set
197CONFIG_PCI=y
198CONFIG_PCI_DOMAINS=y
199# CONFIG_PCIEPORTBUS is not set
200# CONFIG_PCI_DEBUG is not set
201
202#
203# PCCARD (PCMCIA/CardBus) support
204#
205# CONFIG_PCCARD is not set
206
207#
208# PCI Hotplug Support
209#
210# CONFIG_HOTPLUG_PCI is not set
211
212#
213# Advanced setup
214#
215# CONFIG_ADVANCED_OPTIONS is not set
216
217#
218# Default settings for advanced configuration options are used
219#
220CONFIG_HIGHMEM_START=0xfe000000
221CONFIG_LOWMEM_SIZE=0x30000000
222CONFIG_KERNEL_START=0xc0000000
223CONFIG_TASK_SIZE=0x80000000
224CONFIG_BOOT_LOAD=0x00800000
225
226#
227# Networking
228#
229CONFIG_NET=y
230
231#
232# Networking options
233#
234CONFIG_PACKET=y
235# CONFIG_PACKET_MMAP is not set
236CONFIG_UNIX=y
237CONFIG_XFRM=y
238CONFIG_XFRM_USER=y
239# CONFIG_XFRM_SUB_POLICY is not set
240# CONFIG_XFRM_MIGRATE is not set
241# CONFIG_NET_KEY is not set
242CONFIG_INET=y
243CONFIG_IP_MULTICAST=y
244# CONFIG_IP_ADVANCED_ROUTER is not set
245CONFIG_IP_FIB_HASH=y
246CONFIG_IP_PNP=y
247CONFIG_IP_PNP_DHCP=y
248CONFIG_IP_PNP_BOOTP=y
249# CONFIG_IP_PNP_RARP is not set
250# CONFIG_NET_IPIP is not set
251# CONFIG_NET_IPGRE is not set
252# CONFIG_IP_MROUTE is not set
253# CONFIG_ARPD is not set
254CONFIG_SYN_COOKIES=y
255# CONFIG_INET_AH is not set
256# CONFIG_INET_ESP is not set
257# CONFIG_INET_IPCOMP is not set
258# CONFIG_INET_XFRM_TUNNEL is not set
259# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_XFRM_MODE_TRANSPORT=y
261CONFIG_INET_XFRM_MODE_TUNNEL=y
262CONFIG_INET_XFRM_MODE_BEET=y
263CONFIG_INET_DIAG=y
264CONFIG_INET_TCP_DIAG=y
265# CONFIG_TCP_CONG_ADVANCED is not set
266CONFIG_TCP_CONG_CUBIC=y
267CONFIG_DEFAULT_TCP_CONG="cubic"
268# CONFIG_TCP_MD5SIG is not set
269# CONFIG_IPV6 is not set
270# CONFIG_INET6_XFRM_TUNNEL is not set
271# CONFIG_INET6_TUNNEL is not set
272# CONFIG_NETWORK_SECMARK is not set
273# CONFIG_NETFILTER is not set
274
275#
276# DCCP Configuration (EXPERIMENTAL)
277#
278# CONFIG_IP_DCCP is not set
279
280#
281# SCTP Configuration (EXPERIMENTAL)
282#
283# CONFIG_IP_SCTP is not set
284
285#
286# TIPC Configuration (EXPERIMENTAL)
287#
288# CONFIG_TIPC is not set
289# CONFIG_ATM is not set
290# CONFIG_BRIDGE is not set
291# CONFIG_VLAN_8021Q is not set
292# CONFIG_DECNET is not set
293# CONFIG_LLC2 is not set
294# CONFIG_IPX is not set
295# CONFIG_ATALK is not set
296# CONFIG_X25 is not set
297# CONFIG_LAPB is not set
298# CONFIG_ECONET is not set
299# CONFIG_WAN_ROUTER is not set
300
301#
302# QoS and/or fair queueing
303#
304# CONFIG_NET_SCHED is not set
305
306#
307# Network testing
308#
309# CONFIG_NET_PKTGEN is not set
310# CONFIG_HAMRADIO is not set
311# CONFIG_IRDA is not set
312# CONFIG_BT is not set
313# CONFIG_AF_RXRPC is not set
314
315#
316# Wireless
317#
318# CONFIG_CFG80211 is not set
319# CONFIG_WIRELESS_EXT is not set
320# CONFIG_IEEE80211 is not set
321
322#
323# Device Drivers
324#
325
326#
327# Generic Driver Options
328#
329CONFIG_STANDALONE=y
330CONFIG_PREVENT_FIRMWARE_BUILD=y
331# CONFIG_FW_LOADER is not set
332# CONFIG_DEBUG_DRIVER is not set
333# CONFIG_DEBUG_DEVRES is not set
334# CONFIG_SYS_HYPERVISOR is not set
335
336#
337# Connector - unified userspace <-> kernelspace linker
338#
339# CONFIG_CONNECTOR is not set
340# CONFIG_MTD is not set
341
342#
343# Parallel port support
344#
345# CONFIG_PARPORT is not set
346
347#
348# Plug and Play support
349#
350# CONFIG_PNPACPI is not set
351
352#
353# Block devices
354#
355# CONFIG_BLK_DEV_FD is not set
356# CONFIG_BLK_CPQ_DA is not set
357# CONFIG_BLK_CPQ_CISS_DA is not set
358# CONFIG_BLK_DEV_DAC960 is not set
359# CONFIG_BLK_DEV_UMEM is not set
360# CONFIG_BLK_DEV_COW_COMMON is not set
361CONFIG_BLK_DEV_LOOP=y
362# CONFIG_BLK_DEV_CRYPTOLOOP is not set
363# CONFIG_BLK_DEV_NBD is not set
364# CONFIG_BLK_DEV_SX8 is not set
365CONFIG_BLK_DEV_RAM=y
366CONFIG_BLK_DEV_RAM_COUNT=16
367CONFIG_BLK_DEV_RAM_SIZE=131072
368CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
369# CONFIG_CDROM_PKTCDVD is not set
370# CONFIG_ATA_OVER_ETH is not set
371
372#
373# Misc devices
374#
375# CONFIG_SGI_IOC4 is not set
376# CONFIG_TIFM_CORE is not set
377
378#
379# ATA/ATAPI/MFM/RLL support
380#
381# CONFIG_IDE is not set
382
383#
384# SCSI device support
385#
386# CONFIG_RAID_ATTRS is not set
387CONFIG_SCSI=y
388# CONFIG_SCSI_TGT is not set
389# CONFIG_SCSI_NETLINK is not set
390CONFIG_SCSI_PROC_FS=y
391
392#
393# SCSI support type (disk, tape, CD-ROM)
394#
395CONFIG_BLK_DEV_SD=y
396# CONFIG_CHR_DEV_ST is not set
397# CONFIG_CHR_DEV_OSST is not set
398# CONFIG_BLK_DEV_SR is not set
399# CONFIG_CHR_DEV_SG is not set
400# CONFIG_CHR_DEV_SCH is not set
401
402#
403# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
404#
405# CONFIG_SCSI_MULTI_LUN is not set
406# CONFIG_SCSI_CONSTANTS is not set
407# CONFIG_SCSI_LOGGING is not set
408# CONFIG_SCSI_SCAN_ASYNC is not set
409
410#
411# SCSI Transports
412#
413# CONFIG_SCSI_SPI_ATTRS is not set
414# CONFIG_SCSI_FC_ATTRS is not set
415# CONFIG_SCSI_ISCSI_ATTRS is not set
416# CONFIG_SCSI_SAS_ATTRS is not set
417# CONFIG_SCSI_SAS_LIBSAS is not set
418
419#
420# SCSI low-level drivers
421#
422# CONFIG_ISCSI_TCP is not set
423# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
424# CONFIG_SCSI_3W_9XXX is not set
425# CONFIG_SCSI_ACARD is not set
426# CONFIG_SCSI_AACRAID is not set
427# CONFIG_SCSI_AIC7XXX is not set
428# CONFIG_SCSI_AIC7XXX_OLD is not set
429# CONFIG_SCSI_AIC79XX is not set
430# CONFIG_SCSI_AIC94XX is not set
431# CONFIG_SCSI_DPT_I2O is not set
432# CONFIG_SCSI_ARCMSR is not set
433# CONFIG_MEGARAID_NEWGEN is not set
434# CONFIG_MEGARAID_LEGACY is not set
435# CONFIG_MEGARAID_SAS is not set
436# CONFIG_SCSI_HPTIOP is not set
437# CONFIG_SCSI_BUSLOGIC is not set
438# CONFIG_SCSI_DMX3191D is not set
439# CONFIG_SCSI_EATA is not set
440# CONFIG_SCSI_FUTURE_DOMAIN is not set
441# CONFIG_SCSI_GDTH is not set
442# CONFIG_SCSI_IPS is not set
443# CONFIG_SCSI_INITIO is not set
444# CONFIG_SCSI_INIA100 is not set
445# CONFIG_SCSI_STEX is not set
446# CONFIG_SCSI_SYM53C8XX_2 is not set
447# CONFIG_SCSI_IPR is not set
448# CONFIG_SCSI_QLOGIC_1280 is not set
449# CONFIG_SCSI_QLA_FC is not set
450# CONFIG_SCSI_QLA_ISCSI is not set
451# CONFIG_SCSI_LPFC is not set
452# CONFIG_SCSI_DC395x is not set
453# CONFIG_SCSI_DC390T is not set
454# CONFIG_SCSI_NSP32 is not set
455# CONFIG_SCSI_DEBUG is not set
456# CONFIG_SCSI_ESP_CORE is not set
457# CONFIG_SCSI_SRP is not set
458
459#
460# Serial ATA (prod) and Parallel ATA (experimental) drivers
461#
462CONFIG_ATA=y
463# CONFIG_ATA_NONSTANDARD is not set
464# CONFIG_SATA_AHCI is not set
465# CONFIG_SATA_SVW is not set
466# CONFIG_ATA_PIIX is not set
467# CONFIG_SATA_MV is not set
468# CONFIG_SATA_NV is not set
469# CONFIG_PDC_ADMA is not set
470# CONFIG_SATA_QSTOR is not set
471# CONFIG_SATA_PROMISE is not set
472# CONFIG_SATA_SX4 is not set
473# CONFIG_SATA_SIL is not set
474# CONFIG_SATA_SIL24 is not set
475# CONFIG_SATA_SIS is not set
476# CONFIG_SATA_ULI is not set
477# CONFIG_SATA_VIA is not set
478# CONFIG_SATA_VITESSE is not set
479# CONFIG_SATA_INIC162X is not set
480# CONFIG_PATA_ALI is not set
481# CONFIG_PATA_AMD is not set
482# CONFIG_PATA_ARTOP is not set
483# CONFIG_PATA_ATIIXP is not set
484# CONFIG_PATA_CMD640_PCI is not set
485# CONFIG_PATA_CMD64X is not set
486# CONFIG_PATA_CS5520 is not set
487# CONFIG_PATA_CS5530 is not set
488# CONFIG_PATA_CYPRESS is not set
489# CONFIG_PATA_EFAR is not set
490# CONFIG_ATA_GENERIC is not set
491# CONFIG_PATA_HPT366 is not set
492# CONFIG_PATA_HPT37X is not set
493# CONFIG_PATA_HPT3X2N is not set
494# CONFIG_PATA_HPT3X3 is not set
495# CONFIG_PATA_IT821X is not set
496# CONFIG_PATA_IT8213 is not set
497# CONFIG_PATA_JMICRON is not set
498# CONFIG_PATA_TRIFLEX is not set
499# CONFIG_PATA_MARVELL is not set
500# CONFIG_PATA_MPIIX is not set
501# CONFIG_PATA_OLDPIIX is not set
502# CONFIG_PATA_NETCELL is not set
503# CONFIG_PATA_NS87410 is not set
504# CONFIG_PATA_OPTI is not set
505# CONFIG_PATA_OPTIDMA is not set
506# CONFIG_PATA_PDC_OLD is not set
507# CONFIG_PATA_RADISYS is not set
508# CONFIG_PATA_RZ1000 is not set
509# CONFIG_PATA_SC1200 is not set
510# CONFIG_PATA_SERVERWORKS is not set
511# CONFIG_PATA_PDC2027X is not set
512# CONFIG_PATA_SIL680 is not set
513# CONFIG_PATA_SIS is not set
514# CONFIG_PATA_VIA is not set
515# CONFIG_PATA_WINBOND is not set
516# CONFIG_PATA_PLATFORM is not set
517
518#
519# Multi-device support (RAID and LVM)
520#
521# CONFIG_MD is not set
522
523#
524# Fusion MPT device support
525#
526# CONFIG_FUSION is not set
527# CONFIG_FUSION_SPI is not set
528# CONFIG_FUSION_FC is not set
529# CONFIG_FUSION_SAS is not set
530
531#
532# IEEE 1394 (FireWire) support
533#
534# CONFIG_IEEE1394 is not set
535
536#
537# I2O device support
538#
539# CONFIG_I2O is not set
540# CONFIG_MACINTOSH_DRIVERS is not set
541
542#
543# Network device support
544#
545CONFIG_NETDEVICES=y
546# CONFIG_DUMMY is not set
547# CONFIG_BONDING is not set
548# CONFIG_EQUALIZER is not set
549# CONFIG_TUN is not set
550
551#
552# ARCnet devices
553#
554# CONFIG_ARCNET is not set
555
556#
557# PHY device support
558#
559CONFIG_PHYLIB=y
560
561#
562# MII PHY device drivers
563#
564# CONFIG_MARVELL_PHY is not set
565# CONFIG_DAVICOM_PHY is not set
566# CONFIG_QSEMI_PHY is not set
567# CONFIG_LXT_PHY is not set
568# CONFIG_CICADA_PHY is not set
569# CONFIG_VITESSE_PHY is not set
570# CONFIG_SMSC_PHY is not set
571# CONFIG_BROADCOM_PHY is not set
572# CONFIG_FIXED_PHY is not set
573
574#
575# Ethernet (10 or 100Mbit)
576#
577CONFIG_NET_ETHERNET=y
578CONFIG_MII=y
579# CONFIG_HAPPYMEAL is not set
580# CONFIG_SUNGEM is not set
581# CONFIG_CASSINI is not set
582CONFIG_NET_VENDOR_3COM=y
583CONFIG_VORTEX=y
584# CONFIG_TYPHOON is not set
585
586#
587# Tulip family network device support
588#
589# CONFIG_NET_TULIP is not set
590# CONFIG_HP100 is not set
591# CONFIG_NET_PCI is not set
592
593#
594# Ethernet (1000 Mbit)
595#
596# CONFIG_ACENIC is not set
597# CONFIG_DL2K is not set
598# CONFIG_E1000 is not set
599# CONFIG_NS83820 is not set
600# CONFIG_HAMACHI is not set
601# CONFIG_YELLOWFIN is not set
602# CONFIG_R8169 is not set
603# CONFIG_SIS190 is not set
604# CONFIG_SKGE is not set
605# CONFIG_SKY2 is not set
606# CONFIG_SK98LIN is not set
607# CONFIG_TIGON3 is not set
608# CONFIG_BNX2 is not set
609CONFIG_TSI108_ETH=y
610# CONFIG_QLA3XXX is not set
611# CONFIG_ATL1 is not set
612
613#
614# Ethernet (10000 Mbit)
615#
616# CONFIG_CHELSIO_T1 is not set
617# CONFIG_CHELSIO_T3 is not set
618# CONFIG_IXGB is not set
619# CONFIG_S2IO is not set
620# CONFIG_MYRI10GE is not set
621# CONFIG_NETXEN_NIC is not set
622
623#
624# Token Ring devices
625#
626# CONFIG_TR is not set
627
628#
629# Wireless LAN
630#
631# CONFIG_WLAN_PRE80211 is not set
632# CONFIG_WLAN_80211 is not set
633
634#
635# Wan interfaces
636#
637# CONFIG_WAN is not set
638# CONFIG_FDDI is not set
639# CONFIG_HIPPI is not set
640# CONFIG_PPP is not set
641# CONFIG_SLIP is not set
642# CONFIG_NET_FC is not set
643# CONFIG_SHAPER is not set
644# CONFIG_NETCONSOLE is not set
645# CONFIG_NETPOLL is not set
646# CONFIG_NET_POLL_CONTROLLER is not set
647
648#
649# ISDN subsystem
650#
651# CONFIG_ISDN is not set
652
653#
654# Telephony Support
655#
656# CONFIG_PHONE is not set
657
658#
659# Input device support
660#
661CONFIG_INPUT=y
662# CONFIG_INPUT_FF_MEMLESS is not set
663
664#
665# Userland interfaces
666#
667# CONFIG_INPUT_MOUSEDEV is not set
668# CONFIG_INPUT_JOYDEV is not set
669# CONFIG_INPUT_TSDEV is not set
670# CONFIG_INPUT_EVDEV is not set
671# CONFIG_INPUT_EVBUG is not set
672
673#
674# Input Device Drivers
675#
676# CONFIG_INPUT_KEYBOARD is not set
677# CONFIG_INPUT_MOUSE is not set
678# CONFIG_INPUT_JOYSTICK is not set
679# CONFIG_INPUT_TOUCHSCREEN is not set
680# CONFIG_INPUT_MISC is not set
681
682#
683# Hardware I/O ports
684#
685# CONFIG_SERIO is not set
686# CONFIG_GAMEPORT is not set
687
688#
689# Character devices
690#
691# CONFIG_VT is not set
692# CONFIG_SERIAL_NONSTANDARD is not set
693
694#
695# Serial drivers
696#
697CONFIG_SERIAL_8250=y
698CONFIG_SERIAL_8250_CONSOLE=y
699# CONFIG_SERIAL_8250_PCI is not set
700CONFIG_SERIAL_8250_NR_UARTS=4
701CONFIG_SERIAL_8250_RUNTIME_UARTS=4
702CONFIG_SERIAL_8250_EXTENDED=y
703# CONFIG_SERIAL_8250_MANY_PORTS is not set
704CONFIG_SERIAL_8250_SHARE_IRQ=y
705# CONFIG_SERIAL_8250_DETECT_IRQ is not set
706# CONFIG_SERIAL_8250_RSA is not set
707
708#
709# Non-8250 serial port support
710#
711# CONFIG_SERIAL_UARTLITE is not set
712CONFIG_SERIAL_CORE=y
713CONFIG_SERIAL_CORE_CONSOLE=y
714# CONFIG_SERIAL_JSM is not set
715CONFIG_SERIAL_OF_PLATFORM=y
716CONFIG_UNIX98_PTYS=y
717CONFIG_LEGACY_PTYS=y
718CONFIG_LEGACY_PTY_COUNT=256
719
720#
721# IPMI
722#
723# CONFIG_IPMI_HANDLER is not set
724
725#
726# Watchdog Cards
727#
728# CONFIG_WATCHDOG is not set
729# CONFIG_HW_RANDOM is not set
730# CONFIG_NVRAM is not set
731CONFIG_GEN_RTC=y
732# CONFIG_GEN_RTC_X is not set
733# CONFIG_DTLK is not set
734# CONFIG_R3964 is not set
735# CONFIG_APPLICOM is not set
736# CONFIG_AGP is not set
737# CONFIG_DRM is not set
738# CONFIG_RAW_DRIVER is not set
739
740#
741# TPM devices
742#
743# CONFIG_TCG_TPM is not set
744
745#
746# I2C support
747#
748# CONFIG_I2C is not set
749
750#
751# SPI support
752#
753# CONFIG_SPI is not set
754# CONFIG_SPI_MASTER is not set
755
756#
757# Dallas's 1-wire bus
758#
759# CONFIG_W1 is not set
760
761#
762# Hardware Monitoring support
763#
764CONFIG_HWMON=y
765# CONFIG_HWMON_VID is not set
766# CONFIG_SENSORS_ABITUGURU is not set
767# CONFIG_SENSORS_F71805F is not set
768# CONFIG_SENSORS_PC87427 is not set
769# CONFIG_SENSORS_VT1211 is not set
770# CONFIG_HWMON_DEBUG_CHIP is not set
771
772#
773# Multifunction device drivers
774#
775# CONFIG_MFD_SM501 is not set
776
777#
778# Multimedia devices
779#
780# CONFIG_VIDEO_DEV is not set
781
782#
783# Digital Video Broadcasting Devices
784#
785# CONFIG_DVB is not set
786
787#
788# Graphics support
789#
790# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
791# CONFIG_FB is not set
792# CONFIG_FB_IBM_GXT4500 is not set
793
794#
795# Sound
796#
797# CONFIG_SOUND is not set
798
799#
800# HID Devices
801#
802CONFIG_HID=y
803# CONFIG_HID_DEBUG is not set
804
805#
806# USB support
807#
808CONFIG_USB_ARCH_HAS_HCD=y
809CONFIG_USB_ARCH_HAS_OHCI=y
810CONFIG_USB_ARCH_HAS_EHCI=y
811# CONFIG_USB is not set
812
813#
814# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
815#
816
817#
818# USB Gadget Support
819#
820# CONFIG_USB_GADGET is not set
821
822#
823# MMC/SD Card support
824#
825# CONFIG_MMC is not set
826
827#
828# LED devices
829#
830# CONFIG_NEW_LEDS is not set
831
832#
833# LED drivers
834#
835
836#
837# LED Triggers
838#
839
840#
841# InfiniBand support
842#
843# CONFIG_INFINIBAND is not set
844
845#
846# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
847#
848
849#
850# Real Time Clock
851#
852# CONFIG_RTC_CLASS is not set
853
854#
855# DMA Engine support
856#
857# CONFIG_DMA_ENGINE is not set
858
859#
860# DMA Clients
861#
862
863#
864# DMA Devices
865#
866
867#
868# Auxiliary Display support
869#
870
871#
872# Virtualization
873#
874
875#
876# File systems
877#
878CONFIG_EXT2_FS=y
879# CONFIG_EXT2_FS_XATTR is not set
880# CONFIG_EXT2_FS_XIP is not set
881CONFIG_EXT3_FS=y
882CONFIG_EXT3_FS_XATTR=y
883# CONFIG_EXT3_FS_POSIX_ACL is not set
884# CONFIG_EXT3_FS_SECURITY is not set
885# CONFIG_EXT4DEV_FS is not set
886CONFIG_JBD=y
887# CONFIG_JBD_DEBUG is not set
888CONFIG_FS_MBCACHE=y
889# CONFIG_REISERFS_FS is not set
890# CONFIG_JFS_FS is not set
891# CONFIG_FS_POSIX_ACL is not set
892# CONFIG_XFS_FS is not set
893# CONFIG_GFS2_FS is not set
894# CONFIG_OCFS2_FS is not set
895# CONFIG_MINIX_FS is not set
896# CONFIG_ROMFS_FS is not set
897CONFIG_INOTIFY=y
898CONFIG_INOTIFY_USER=y
899# CONFIG_QUOTA is not set
900CONFIG_DNOTIFY=y
901# CONFIG_AUTOFS_FS is not set
902# CONFIG_AUTOFS4_FS is not set
903# CONFIG_FUSE_FS is not set
904
905#
906# CD-ROM/DVD Filesystems
907#
908# CONFIG_ISO9660_FS is not set
909# CONFIG_UDF_FS is not set
910
911#
912# DOS/FAT/NT Filesystems
913#
914# CONFIG_MSDOS_FS is not set
915# CONFIG_VFAT_FS is not set
916# CONFIG_NTFS_FS is not set
917
918#
919# Pseudo filesystems
920#
921CONFIG_PROC_FS=y
922CONFIG_PROC_KCORE=y
923CONFIG_PROC_SYSCTL=y
924CONFIG_SYSFS=y
925CONFIG_TMPFS=y
926# CONFIG_TMPFS_POSIX_ACL is not set
927# CONFIG_HUGETLB_PAGE is not set
928CONFIG_RAMFS=y
929# CONFIG_CONFIGFS_FS is not set
930
931#
932# Miscellaneous filesystems
933#
934# CONFIG_ADFS_FS is not set
935# CONFIG_AFFS_FS is not set
936# CONFIG_HFS_FS is not set
937# CONFIG_HFSPLUS_FS is not set
938# CONFIG_BEFS_FS is not set
939# CONFIG_BFS_FS is not set
940# CONFIG_EFS_FS is not set
941# CONFIG_CRAMFS is not set
942# CONFIG_VXFS_FS is not set
943# CONFIG_HPFS_FS is not set
944# CONFIG_QNX4FS_FS is not set
945# CONFIG_SYSV_FS is not set
946# CONFIG_UFS_FS is not set
947
948#
949# Network File Systems
950#
951CONFIG_NFS_FS=y
952# CONFIG_NFS_V3 is not set
953# CONFIG_NFS_V4 is not set
954# CONFIG_NFS_DIRECTIO is not set
955# CONFIG_NFSD is not set
956CONFIG_ROOT_NFS=y
957CONFIG_LOCKD=y
958CONFIG_NFS_COMMON=y
959CONFIG_SUNRPC=y
960# CONFIG_RPCSEC_GSS_KRB5 is not set
961# CONFIG_RPCSEC_GSS_SPKM3 is not set
962# CONFIG_SMB_FS is not set
963# CONFIG_CIFS is not set
964# CONFIG_NCP_FS is not set
965# CONFIG_CODA_FS is not set
966# CONFIG_AFS_FS is not set
967# CONFIG_9P_FS is not set
968
969#
970# Partition Types
971#
972CONFIG_PARTITION_ADVANCED=y
973# CONFIG_ACORN_PARTITION is not set
974# CONFIG_OSF_PARTITION is not set
975# CONFIG_AMIGA_PARTITION is not set
976# CONFIG_ATARI_PARTITION is not set
977# CONFIG_MAC_PARTITION is not set
978CONFIG_MSDOS_PARTITION=y
979# CONFIG_BSD_DISKLABEL is not set
980# CONFIG_MINIX_SUBPARTITION is not set
981# CONFIG_SOLARIS_X86_PARTITION is not set
982# CONFIG_UNIXWARE_DISKLABEL is not set
983# CONFIG_LDM_PARTITION is not set
984# CONFIG_SGI_PARTITION is not set
985# CONFIG_ULTRIX_PARTITION is not set
986# CONFIG_SUN_PARTITION is not set
987# CONFIG_KARMA_PARTITION is not set
988# CONFIG_EFI_PARTITION is not set
989
990#
991# Native Language Support
992#
993# CONFIG_NLS is not set
994
995#
996# Distributed Lock Manager
997#
998# CONFIG_DLM is not set
999# CONFIG_UCC_SLOW is not set
1000# CONFIG_UCC_FAST is not set
1001
1002#
1003# Library routines
1004#
1005CONFIG_BITREVERSE=y
1006# CONFIG_CRC_CCITT is not set
1007# CONFIG_CRC16 is not set
1008CONFIG_CRC32=y
1009# CONFIG_LIBCRC32C is not set
1010CONFIG_PLIST=y
1011CONFIG_HAS_IOMEM=y
1012CONFIG_HAS_IOPORT=y
1013
1014#
1015# Instrumentation Support
1016#
1017# CONFIG_PROFILING is not set
1018# CONFIG_KPROBES is not set
1019
1020#
1021# Kernel hacking
1022#
1023# CONFIG_PRINTK_TIME is not set
1024CONFIG_ENABLE_MUST_CHECK=y
1025CONFIG_MAGIC_SYSRQ=y
1026# CONFIG_UNUSED_SYMBOLS is not set
1027# CONFIG_DEBUG_FS is not set
1028# CONFIG_HEADERS_CHECK is not set
1029CONFIG_DEBUG_KERNEL=y
1030# CONFIG_DEBUG_SHIRQ is not set
1031CONFIG_LOG_BUF_SHIFT=14
1032CONFIG_DETECT_SOFTLOCKUP=y
1033# CONFIG_SCHEDSTATS is not set
1034# CONFIG_TIMER_STATS is not set
1035# CONFIG_DEBUG_SLAB is not set
1036# CONFIG_DEBUG_RT_MUTEXES is not set
1037# CONFIG_RT_MUTEX_TESTER is not set
1038# CONFIG_DEBUG_SPINLOCK is not set
1039# CONFIG_DEBUG_MUTEXES is not set
1040# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1041# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1042# CONFIG_DEBUG_KOBJECT is not set
1043# CONFIG_DEBUG_BUGVERBOSE is not set
1044# CONFIG_DEBUG_INFO is not set
1045# CONFIG_DEBUG_VM is not set
1046# CONFIG_DEBUG_LIST is not set
1047CONFIG_FORCED_INLINING=y
1048# CONFIG_RCU_TORTURE_TEST is not set
1049# CONFIG_FAULT_INJECTION is not set
1050# CONFIG_DEBUG_STACKOVERFLOW is not set
1051# CONFIG_DEBUG_STACK_USAGE is not set
1052# CONFIG_DEBUG_PAGEALLOC is not set
1053CONFIG_DEBUGGER=y
1054CONFIG_XMON=y
1055CONFIG_XMON_DEFAULT=y
1056CONFIG_XMON_DISASSEMBLY=y
1057# CONFIG_BDI_SWITCH is not set
1058# CONFIG_BOOTX_TEXT is not set
1059# CONFIG_PPC_EARLY_DEBUG is not set
1060
1061#
1062# Security options
1063#
1064# CONFIG_KEYS is not set
1065# CONFIG_SECURITY is not set
1066
1067#
1068# Cryptographic options
1069#
1070# CONFIG_CRYPTO is not set
diff --git a/arch/powerpc/configs/mpc832x_mds_defconfig b/arch/powerpc/configs/mpc832x_mds_defconfig
index e1b36de6b38c..83192c0dc5bb 100644
--- a/arch/powerpc/configs/mpc832x_mds_defconfig
+++ b/arch/powerpc/configs/mpc832x_mds_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20-rc5 3# Linux kernel version: 2.6.21-rc5
4# Tue Jan 30 14:27:25 2007 4# Mon Apr 9 16:09:16 2007
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y 7CONFIG_PPC32=y
@@ -34,9 +34,9 @@ CONFIG_DEFAULT_UIMAGE=y
34CONFIG_PPC_83xx=y 34CONFIG_PPC_83xx=y
35# CONFIG_PPC_85xx is not set 35# CONFIG_PPC_85xx is not set
36# CONFIG_PPC_86xx is not set 36# CONFIG_PPC_86xx is not set
37# CONFIG_PPC_8xx is not set
37# CONFIG_40x is not set 38# CONFIG_40x is not set
38# CONFIG_44x is not set 39# CONFIG_44x is not set
39# CONFIG_8xx is not set
40# CONFIG_E200 is not set 40# CONFIG_E200 is not set
41CONFIG_6xx=y 41CONFIG_6xx=y
42CONFIG_83xx=y 42CONFIG_83xx=y
@@ -63,6 +63,7 @@ CONFIG_LOCALVERSION_AUTO=y
63CONFIG_SWAP=y 63CONFIG_SWAP=y
64CONFIG_SYSVIPC=y 64CONFIG_SYSVIPC=y
65# CONFIG_IPC_NS is not set 65# CONFIG_IPC_NS is not set
66CONFIG_SYSVIPC_SYSCTL=y
66# CONFIG_POSIX_MQUEUE is not set 67# CONFIG_POSIX_MQUEUE is not set
67# CONFIG_BSD_PROCESS_ACCT is not set 68# CONFIG_BSD_PROCESS_ACCT is not set
68# CONFIG_TASKSTATS is not set 69# CONFIG_TASKSTATS is not set
@@ -71,6 +72,7 @@ CONFIG_SYSVIPC=y
71# CONFIG_IKCONFIG is not set 72# CONFIG_IKCONFIG is not set
72CONFIG_SYSFS_DEPRECATED=y 73CONFIG_SYSFS_DEPRECATED=y
73# CONFIG_RELAY is not set 74# CONFIG_RELAY is not set
75CONFIG_BLK_DEV_INITRD=y
74CONFIG_INITRAMFS_SOURCE="" 76CONFIG_INITRAMFS_SOURCE=""
75# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
76CONFIG_SYSCTL=y 78CONFIG_SYSCTL=y
@@ -123,16 +125,17 @@ CONFIG_DEFAULT_AS=y
123# CONFIG_DEFAULT_NOOP is not set 125# CONFIG_DEFAULT_NOOP is not set
124CONFIG_DEFAULT_IOSCHED="anticipatory" 126CONFIG_DEFAULT_IOSCHED="anticipatory"
125CONFIG_QUICC_ENGINE=y 127CONFIG_QUICC_ENGINE=y
126CONFIG_PPC_GEN550=y
127# CONFIG_WANT_EARLY_SERIAL is not set 128# CONFIG_WANT_EARLY_SERIAL is not set
128 129
129# 130#
130# Platform support 131# Platform support
131# 132#
133# CONFIG_MPC8313_RDB is not set
132CONFIG_MPC832x_MDS=y 134CONFIG_MPC832x_MDS=y
133# CONFIG_MPC834x_SYS is not set 135# CONFIG_MPC832x_RDB is not set
136# CONFIG_MPC834x_MDS is not set
134# CONFIG_MPC834x_ITX is not set 137# CONFIG_MPC834x_ITX is not set
135# CONFIG_MPC8360E_PB is not set 138# CONFIG_MPC836x_MDS is not set
136CONFIG_PPC_MPC832x=y 139CONFIG_PPC_MPC832x=y
137# CONFIG_MPIC is not set 140# CONFIG_MPIC is not set
138 141
@@ -163,6 +166,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
163# CONFIG_SPARSEMEM_STATIC is not set 166# CONFIG_SPARSEMEM_STATIC is not set
164CONFIG_SPLIT_PTLOCK_CPUS=4 167CONFIG_SPLIT_PTLOCK_CPUS=4
165# CONFIG_RESOURCES_64BIT is not set 168# CONFIG_RESOURCES_64BIT is not set
169CONFIG_ZONE_DMA_FLAG=1
166CONFIG_PROC_DEVICETREE=y 170CONFIG_PROC_DEVICETREE=y
167# CONFIG_CMDLINE_BOOL is not set 171# CONFIG_CMDLINE_BOOL is not set
168# CONFIG_PM is not set 172# CONFIG_PM is not set
@@ -172,6 +176,7 @@ CONFIG_ISA_DMA_API=y
172# 176#
173# Bus options 177# Bus options
174# 178#
179CONFIG_ZONE_DMA=y
175CONFIG_GENERIC_ISA_DMA=y 180CONFIG_GENERIC_ISA_DMA=y
176# CONFIG_MPIC_WEIRD is not set 181# CONFIG_MPIC_WEIRD is not set
177# CONFIG_PPC_I8259 is not set 182# CONFIG_PPC_I8259 is not set
@@ -220,6 +225,7 @@ CONFIG_UNIX=y
220CONFIG_XFRM=y 225CONFIG_XFRM=y
221# CONFIG_XFRM_USER is not set 226# CONFIG_XFRM_USER is not set
222# CONFIG_XFRM_SUB_POLICY is not set 227# CONFIG_XFRM_SUB_POLICY is not set
228# CONFIG_XFRM_MIGRATE is not set
223# CONFIG_NET_KEY is not set 229# CONFIG_NET_KEY is not set
224CONFIG_INET=y 230CONFIG_INET=y
225CONFIG_IP_MULTICAST=y 231CONFIG_IP_MULTICAST=y
@@ -324,6 +330,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
324# 330#
325# Plug and Play support 331# Plug and Play support
326# 332#
333# CONFIG_PNPACPI is not set
327 334
328# 335#
329# Block devices 336# Block devices
@@ -342,7 +349,6 @@ CONFIG_BLK_DEV_RAM=y
342CONFIG_BLK_DEV_RAM_COUNT=16 349CONFIG_BLK_DEV_RAM_COUNT=16
343CONFIG_BLK_DEV_RAM_SIZE=32768 350CONFIG_BLK_DEV_RAM_SIZE=32768
344CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 351CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
345CONFIG_BLK_DEV_INITRD=y
346# CONFIG_CDROM_PKTCDVD is not set 352# CONFIG_CDROM_PKTCDVD is not set
347# CONFIG_ATA_OVER_ETH is not set 353# CONFIG_ATA_OVER_ETH is not set
348 354
@@ -482,7 +488,21 @@ CONFIG_NETDEVICES=y
482# 488#
483# PHY device support 489# PHY device support
484# 490#
485# CONFIG_PHYLIB is not set 491CONFIG_PHYLIB=y
492
493#
494# MII PHY device drivers
495#
496# CONFIG_MARVELL_PHY is not set
497CONFIG_DAVICOM_PHY=y
498# CONFIG_QSEMI_PHY is not set
499# CONFIG_LXT_PHY is not set
500# CONFIG_CICADA_PHY is not set
501# CONFIG_VITESSE_PHY is not set
502# CONFIG_SMSC_PHY is not set
503# CONFIG_BROADCOM_PHY is not set
504# CONFIG_ICPLUS_PHY is not set
505# CONFIG_FIXED_PHY is not set
486 506
487# 507#
488# Ethernet (10 or 100Mbit) 508# Ethernet (10 or 100Mbit)
@@ -524,11 +544,13 @@ CONFIG_UCC_GETH=y
524# CONFIG_UGETH_FILTERING is not set 544# CONFIG_UGETH_FILTERING is not set
525# CONFIG_UGETH_TX_ON_DEMOND is not set 545# CONFIG_UGETH_TX_ON_DEMOND is not set
526# CONFIG_QLA3XXX is not set 546# CONFIG_QLA3XXX is not set
547# CONFIG_ATL1 is not set
527 548
528# 549#
529# Ethernet (10000 Mbit) 550# Ethernet (10000 Mbit)
530# 551#
531# CONFIG_CHELSIO_T1 is not set 552# CONFIG_CHELSIO_T1 is not set
553# CONFIG_CHELSIO_T3 is not set
532# CONFIG_IXGB is not set 554# CONFIG_IXGB is not set
533# CONFIG_S2IO is not set 555# CONFIG_S2IO is not set
534# CONFIG_MYRI10GE is not set 556# CONFIG_MYRI10GE is not set
@@ -621,6 +643,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
621CONFIG_SERIAL_CORE=y 643CONFIG_SERIAL_CORE=y
622CONFIG_SERIAL_CORE_CONSOLE=y 644CONFIG_SERIAL_CORE_CONSOLE=y
623# CONFIG_SERIAL_JSM is not set 645# CONFIG_SERIAL_JSM is not set
646# CONFIG_SERIAL_OF_PLATFORM is not set
624CONFIG_UNIX98_PTYS=y 647CONFIG_UNIX98_PTYS=y
625CONFIG_LEGACY_PTYS=y 648CONFIG_LEGACY_PTYS=y
626CONFIG_LEGACY_PTY_COUNT=256 649CONFIG_LEGACY_PTY_COUNT=256
@@ -691,6 +714,7 @@ CONFIG_I2C_MPC=y
691# CONFIG_I2C_NFORCE2 is not set 714# CONFIG_I2C_NFORCE2 is not set
692# CONFIG_I2C_OCORES is not set 715# CONFIG_I2C_OCORES is not set
693# CONFIG_I2C_PARPORT_LIGHT is not set 716# CONFIG_I2C_PARPORT_LIGHT is not set
717# CONFIG_I2C_PASEMI is not set
694# CONFIG_I2C_PROSAVAGE is not set 718# CONFIG_I2C_PROSAVAGE is not set
695# CONFIG_I2C_SAVAGE4 is not set 719# CONFIG_I2C_SAVAGE4 is not set
696# CONFIG_I2C_SIS5595 is not set 720# CONFIG_I2C_SIS5595 is not set
@@ -738,6 +762,7 @@ CONFIG_HWMON=y
738# CONFIG_SENSORS_ADM1021 is not set 762# CONFIG_SENSORS_ADM1021 is not set
739# CONFIG_SENSORS_ADM1025 is not set 763# CONFIG_SENSORS_ADM1025 is not set
740# CONFIG_SENSORS_ADM1026 is not set 764# CONFIG_SENSORS_ADM1026 is not set
765# CONFIG_SENSORS_ADM1029 is not set
741# CONFIG_SENSORS_ADM1031 is not set 766# CONFIG_SENSORS_ADM1031 is not set
742# CONFIG_SENSORS_ADM9240 is not set 767# CONFIG_SENSORS_ADM9240 is not set
743# CONFIG_SENSORS_ASB100 is not set 768# CONFIG_SENSORS_ASB100 is not set
@@ -779,6 +804,11 @@ CONFIG_HWMON=y
779# CONFIG_HWMON_DEBUG_CHIP is not set 804# CONFIG_HWMON_DEBUG_CHIP is not set
780 805
781# 806#
807# Multifunction device drivers
808#
809# CONFIG_MFD_SM501 is not set
810
811#
782# Multimedia devices 812# Multimedia devices
783# 813#
784# CONFIG_VIDEO_DEV is not set 814# CONFIG_VIDEO_DEV is not set
@@ -791,10 +821,9 @@ CONFIG_HWMON=y
791# 821#
792# Graphics support 822# Graphics support
793# 823#
794CONFIG_FIRMWARE_EDID=y 824# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
795# CONFIG_FB is not set 825# CONFIG_FB is not set
796# CONFIG_FB_IBM_GXT4500 is not set 826# CONFIG_FB_IBM_GXT4500 is not set
797# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
798 827
799# 828#
800# Sound 829# Sound
@@ -805,6 +834,7 @@ CONFIG_FIRMWARE_EDID=y
805# HID Devices 834# HID Devices
806# 835#
807CONFIG_HID=y 836CONFIG_HID=y
837# CONFIG_HID_DEBUG is not set
808 838
809# 839#
810# USB support 840# USB support
@@ -869,6 +899,10 @@ CONFIG_USB_ARCH_HAS_EHCI=y
869# 899#
870 900
871# 901#
902# Auxiliary Display support
903#
904
905#
872# Virtualization 906# Virtualization
873# 907#
874 908
@@ -995,11 +1029,7 @@ CONFIG_PARTITION_ADVANCED=y
995# Distributed Lock Manager 1029# Distributed Lock Manager
996# 1030#
997# CONFIG_DLM is not set 1031# CONFIG_DLM is not set
998 1032# CONFIG_UCC_SLOW is not set
999#
1000# QE Options
1001#
1002CONFIG_UCC_SLOW=y
1003CONFIG_UCC_FAST=y 1033CONFIG_UCC_FAST=y
1004CONFIG_UCC=y 1034CONFIG_UCC=y
1005 1035
@@ -1012,7 +1042,8 @@ CONFIG_BITREVERSE=y
1012CONFIG_CRC32=y 1042CONFIG_CRC32=y
1013# CONFIG_LIBCRC32C is not set 1043# CONFIG_LIBCRC32C is not set
1014CONFIG_PLIST=y 1044CONFIG_PLIST=y
1015CONFIG_IOMAP_COPY=y 1045CONFIG_HAS_IOMEM=y
1046CONFIG_HAS_IOPORT=y
1016 1047
1017# 1048#
1018# Instrumentation Support 1049# Instrumentation Support
@@ -1032,7 +1063,6 @@ CONFIG_ENABLE_MUST_CHECK=y
1032CONFIG_LOG_BUF_SHIFT=14 1063CONFIG_LOG_BUF_SHIFT=14
1033# CONFIG_DEBUG_BUGVERBOSE is not set 1064# CONFIG_DEBUG_BUGVERBOSE is not set
1034# CONFIG_BOOTX_TEXT is not set 1065# CONFIG_BOOTX_TEXT is not set
1035# CONFIG_SERIAL_TEXT_DEBUG is not set
1036# CONFIG_PPC_EARLY_DEBUG is not set 1066# CONFIG_PPC_EARLY_DEBUG is not set
1037 1067
1038# 1068#
@@ -1061,8 +1091,10 @@ CONFIG_CRYPTO_MD5=y
1061# CONFIG_CRYPTO_GF128MUL is not set 1091# CONFIG_CRYPTO_GF128MUL is not set
1062CONFIG_CRYPTO_ECB=m 1092CONFIG_CRYPTO_ECB=m
1063CONFIG_CRYPTO_CBC=y 1093CONFIG_CRYPTO_CBC=y
1094CONFIG_CRYPTO_PCBC=m
1064# CONFIG_CRYPTO_LRW is not set 1095# CONFIG_CRYPTO_LRW is not set
1065CONFIG_CRYPTO_DES=y 1096CONFIG_CRYPTO_DES=y
1097# CONFIG_CRYPTO_FCRYPT is not set
1066# CONFIG_CRYPTO_BLOWFISH is not set 1098# CONFIG_CRYPTO_BLOWFISH is not set
1067# CONFIG_CRYPTO_TWOFISH is not set 1099# CONFIG_CRYPTO_TWOFISH is not set
1068# CONFIG_CRYPTO_SERPENT is not set 1100# CONFIG_CRYPTO_SERPENT is not set
@@ -1076,6 +1108,7 @@ CONFIG_CRYPTO_DES=y
1076# CONFIG_CRYPTO_DEFLATE is not set 1108# CONFIG_CRYPTO_DEFLATE is not set
1077# CONFIG_CRYPTO_MICHAEL_MIC is not set 1109# CONFIG_CRYPTO_MICHAEL_MIC is not set
1078# CONFIG_CRYPTO_CRC32C is not set 1110# CONFIG_CRYPTO_CRC32C is not set
1111# CONFIG_CRYPTO_CAMELLIA is not set
1079# CONFIG_CRYPTO_TEST is not set 1112# CONFIG_CRYPTO_TEST is not set
1080 1113
1081# 1114#
diff --git a/arch/powerpc/configs/mpc832x_rdb_defconfig b/arch/powerpc/configs/mpc832x_rdb_defconfig
index 56fc0a824458..4a4da875fa4e 100644
--- a/arch/powerpc/configs/mpc832x_rdb_defconfig
+++ b/arch/powerpc/configs/mpc832x_rdb_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21-rc3 3# Linux kernel version: 2.6.21-rc5
4# Mon Mar 12 17:32:19 2007 4# Mon Apr 9 16:12:43 2007
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y 7CONFIG_PPC32=y
@@ -125,7 +125,6 @@ CONFIG_DEFAULT_AS=y
125# CONFIG_DEFAULT_NOOP is not set 125# CONFIG_DEFAULT_NOOP is not set
126CONFIG_DEFAULT_IOSCHED="anticipatory" 126CONFIG_DEFAULT_IOSCHED="anticipatory"
127CONFIG_QUICC_ENGINE=y 127CONFIG_QUICC_ENGINE=y
128CONFIG_PPC_GEN550=y
129# CONFIG_WANT_EARLY_SERIAL is not set 128# CONFIG_WANT_EARLY_SERIAL is not set
130 129
131# 130#
@@ -490,7 +489,21 @@ CONFIG_NETDEVICES=y
490# 489#
491# PHY device support 490# PHY device support
492# 491#
493# CONFIG_PHYLIB is not set 492CONFIG_PHYLIB=y
493
494#
495# MII PHY device drivers
496#
497# CONFIG_MARVELL_PHY is not set
498# CONFIG_DAVICOM_PHY is not set
499# CONFIG_QSEMI_PHY is not set
500# CONFIG_LXT_PHY is not set
501# CONFIG_CICADA_PHY is not set
502# CONFIG_VITESSE_PHY is not set
503# CONFIG_SMSC_PHY is not set
504# CONFIG_BROADCOM_PHY is not set
505CONFIG_ICPLUS_PHY=y
506# CONFIG_FIXED_PHY is not set
494 507
495# 508#
496# Ethernet (10 or 100Mbit) 509# Ethernet (10 or 100Mbit)
@@ -1200,11 +1213,7 @@ CONFIG_NLS_ISO8859_1=y
1200# Distributed Lock Manager 1213# Distributed Lock Manager
1201# 1214#
1202# CONFIG_DLM is not set 1215# CONFIG_DLM is not set
1203 1216# CONFIG_UCC_SLOW is not set
1204#
1205# QE Options
1206#
1207CONFIG_UCC_SLOW=y
1208CONFIG_UCC_FAST=y 1217CONFIG_UCC_FAST=y
1209CONFIG_UCC=y 1218CONFIG_UCC=y
1210 1219
@@ -1238,7 +1247,6 @@ CONFIG_ENABLE_MUST_CHECK=y
1238CONFIG_LOG_BUF_SHIFT=14 1247CONFIG_LOG_BUF_SHIFT=14
1239# CONFIG_DEBUG_BUGVERBOSE is not set 1248# CONFIG_DEBUG_BUGVERBOSE is not set
1240# CONFIG_BOOTX_TEXT is not set 1249# CONFIG_BOOTX_TEXT is not set
1241# CONFIG_SERIAL_TEXT_DEBUG is not set
1242# CONFIG_PPC_EARLY_DEBUG is not set 1250# CONFIG_PPC_EARLY_DEBUG is not set
1243 1251
1244# 1252#
diff --git a/arch/powerpc/configs/mpc836x_mds_defconfig b/arch/powerpc/configs/mpc836x_mds_defconfig
index 8eb475cd0df0..921a151dc778 100644
--- a/arch/powerpc/configs/mpc836x_mds_defconfig
+++ b/arch/powerpc/configs/mpc836x_mds_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20 3# Linux kernel version: 2.6.21-rc5
4# Sat Feb 17 10:09:26 2007 4# Mon Apr 9 16:14:05 2007
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7CONFIG_PPC32=y 7CONFIG_PPC32=y
@@ -72,6 +72,7 @@ CONFIG_SYSVIPC_SYSCTL=y
72# CONFIG_IKCONFIG is not set 72# CONFIG_IKCONFIG is not set
73CONFIG_SYSFS_DEPRECATED=y 73CONFIG_SYSFS_DEPRECATED=y
74# CONFIG_RELAY is not set 74# CONFIG_RELAY is not set
75CONFIG_BLK_DEV_INITRD=y
75CONFIG_INITRAMFS_SOURCE="" 76CONFIG_INITRAMFS_SOURCE=""
76# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 77# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
77CONFIG_SYSCTL=y 78CONFIG_SYSCTL=y
@@ -124,7 +125,6 @@ CONFIG_DEFAULT_AS=y
124# CONFIG_DEFAULT_NOOP is not set 125# CONFIG_DEFAULT_NOOP is not set
125CONFIG_DEFAULT_IOSCHED="anticipatory" 126CONFIG_DEFAULT_IOSCHED="anticipatory"
126CONFIG_QUICC_ENGINE=y 127CONFIG_QUICC_ENGINE=y
127CONFIG_PPC_GEN550=y
128# CONFIG_WANT_EARLY_SERIAL is not set 128# CONFIG_WANT_EARLY_SERIAL is not set
129 129
130# 130#
@@ -132,6 +132,7 @@ CONFIG_PPC_GEN550=y
132# 132#
133# CONFIG_MPC8313_RDB is not set 133# CONFIG_MPC8313_RDB is not set
134# CONFIG_MPC832x_MDS is not set 134# CONFIG_MPC832x_MDS is not set
135# CONFIG_MPC832x_RDB is not set
135# CONFIG_MPC834x_MDS is not set 136# CONFIG_MPC834x_MDS is not set
136# CONFIG_MPC834x_ITX is not set 137# CONFIG_MPC834x_ITX is not set
137CONFIG_MPC836x_MDS=y 138CONFIG_MPC836x_MDS=y
@@ -328,6 +329,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
328# 329#
329# Plug and Play support 330# Plug and Play support
330# 331#
332# CONFIG_PNPACPI is not set
331 333
332# 334#
333# Block devices 335# Block devices
@@ -346,7 +348,6 @@ CONFIG_BLK_DEV_RAM=y
346CONFIG_BLK_DEV_RAM_COUNT=16 348CONFIG_BLK_DEV_RAM_COUNT=16
347CONFIG_BLK_DEV_RAM_SIZE=32768 349CONFIG_BLK_DEV_RAM_SIZE=32768
348CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 350CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
349CONFIG_BLK_DEV_INITRD=y
350# CONFIG_CDROM_PKTCDVD is not set 351# CONFIG_CDROM_PKTCDVD is not set
351# CONFIG_ATA_OVER_ETH is not set 352# CONFIG_ATA_OVER_ETH is not set
352 353
@@ -486,7 +487,21 @@ CONFIG_NETDEVICES=y
486# 487#
487# PHY device support 488# PHY device support
488# 489#
489# CONFIG_PHYLIB is not set 490CONFIG_PHYLIB=y
491
492#
493# MII PHY device drivers
494#
495CONFIG_MARVELL_PHY=y
496# CONFIG_DAVICOM_PHY is not set
497# CONFIG_QSEMI_PHY is not set
498# CONFIG_LXT_PHY is not set
499# CONFIG_CICADA_PHY is not set
500# CONFIG_VITESSE_PHY is not set
501# CONFIG_SMSC_PHY is not set
502# CONFIG_BROADCOM_PHY is not set
503# CONFIG_ICPLUS_PHY is not set
504# CONFIG_FIXED_PHY is not set
490 505
491# 506#
492# Ethernet (10 or 100Mbit) 507# Ethernet (10 or 100Mbit)
@@ -528,6 +543,7 @@ CONFIG_UCC_GETH=y
528# CONFIG_UGETH_FILTERING is not set 543# CONFIG_UGETH_FILTERING is not set
529# CONFIG_UGETH_TX_ON_DEMOND is not set 544# CONFIG_UGETH_TX_ON_DEMOND is not set
530# CONFIG_QLA3XXX is not set 545# CONFIG_QLA3XXX is not set
546# CONFIG_ATL1 is not set
531 547
532# 548#
533# Ethernet (10000 Mbit) 549# Ethernet (10000 Mbit)
@@ -745,6 +761,7 @@ CONFIG_HWMON=y
745# CONFIG_SENSORS_ADM1021 is not set 761# CONFIG_SENSORS_ADM1021 is not set
746# CONFIG_SENSORS_ADM1025 is not set 762# CONFIG_SENSORS_ADM1025 is not set
747# CONFIG_SENSORS_ADM1026 is not set 763# CONFIG_SENSORS_ADM1026 is not set
764# CONFIG_SENSORS_ADM1029 is not set
748# CONFIG_SENSORS_ADM1031 is not set 765# CONFIG_SENSORS_ADM1031 is not set
749# CONFIG_SENSORS_ADM9240 is not set 766# CONFIG_SENSORS_ADM9240 is not set
750# CONFIG_SENSORS_ASB100 is not set 767# CONFIG_SENSORS_ASB100 is not set
@@ -786,6 +803,11 @@ CONFIG_HWMON=y
786# CONFIG_HWMON_DEBUG_CHIP is not set 803# CONFIG_HWMON_DEBUG_CHIP is not set
787 804
788# 805#
806# Multifunction device drivers
807#
808# CONFIG_MFD_SM501 is not set
809
810#
789# Multimedia devices 811# Multimedia devices
790# 812#
791# CONFIG_VIDEO_DEV is not set 813# CONFIG_VIDEO_DEV is not set
@@ -798,10 +820,9 @@ CONFIG_HWMON=y
798# 820#
799# Graphics support 821# Graphics support
800# 822#
801CONFIG_FIRMWARE_EDID=y 823# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
802# CONFIG_FB is not set 824# CONFIG_FB is not set
803# CONFIG_FB_IBM_GXT4500 is not set 825# CONFIG_FB_IBM_GXT4500 is not set
804# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
805 826
806# 827#
807# Sound 828# Sound
@@ -1007,11 +1028,7 @@ CONFIG_PARTITION_ADVANCED=y
1007# Distributed Lock Manager 1028# Distributed Lock Manager
1008# 1029#
1009# CONFIG_DLM is not set 1030# CONFIG_DLM is not set
1010 1031# CONFIG_UCC_SLOW is not set
1011#
1012# QE Options
1013#
1014CONFIG_UCC_SLOW=y
1015CONFIG_UCC_FAST=y 1032CONFIG_UCC_FAST=y
1016CONFIG_UCC=y 1033CONFIG_UCC=y
1017 1034
@@ -1045,7 +1062,6 @@ CONFIG_ENABLE_MUST_CHECK=y
1045CONFIG_LOG_BUF_SHIFT=14 1062CONFIG_LOG_BUF_SHIFT=14
1046# CONFIG_DEBUG_BUGVERBOSE is not set 1063# CONFIG_DEBUG_BUGVERBOSE is not set
1047# CONFIG_BOOTX_TEXT is not set 1064# CONFIG_BOOTX_TEXT is not set
1048# CONFIG_SERIAL_TEXT_DEBUG is not set
1049# CONFIG_PPC_EARLY_DEBUG is not set 1065# CONFIG_PPC_EARLY_DEBUG is not set
1050 1066
1051# 1067#
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index 0345a2ceec59..fd604968f9a2 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20-rc6 3# Linux kernel version: 2.6.21
4# Thu Jan 25 13:35:34 2007 4# Mon Apr 30 12:03:35 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -60,6 +60,7 @@ CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y 60CONFIG_SWAP=y
61CONFIG_SYSVIPC=y 61CONFIG_SYSVIPC=y
62# CONFIG_IPC_NS is not set 62# CONFIG_IPC_NS is not set
63CONFIG_SYSVIPC_SYSCTL=y
63# CONFIG_POSIX_MQUEUE is not set 64# CONFIG_POSIX_MQUEUE is not set
64# CONFIG_BSD_PROCESS_ACCT is not set 65# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set 66# CONFIG_TASKSTATS is not set
@@ -69,6 +70,7 @@ CONFIG_SYSVIPC=y
69# CONFIG_CPUSETS is not set 70# CONFIG_CPUSETS is not set
70CONFIG_SYSFS_DEPRECATED=y 71CONFIG_SYSFS_DEPRECATED=y
71# CONFIG_RELAY is not set 72# CONFIG_RELAY is not set
73CONFIG_BLK_DEV_INITRD=y
72CONFIG_INITRAMFS_SOURCE="" 74CONFIG_INITRAMFS_SOURCE=""
73CONFIG_CC_OPTIMIZE_FOR_SIZE=y 75CONFIG_CC_OPTIMIZE_FOR_SIZE=y
74CONFIG_SYSCTL=y 76CONFIG_SYSCTL=y
@@ -131,13 +133,36 @@ CONFIG_PPC_MULTIPLATFORM=y
131# CONFIG_PPC_PSERIES is not set 133# CONFIG_PPC_PSERIES is not set
132# CONFIG_PPC_ISERIES is not set 134# CONFIG_PPC_ISERIES is not set
133# CONFIG_PPC_MPC52xx is not set 135# CONFIG_PPC_MPC52xx is not set
136# CONFIG_PPC_MPC5200 is not set
134# CONFIG_PPC_PMAC is not set 137# CONFIG_PPC_PMAC is not set
135# CONFIG_PPC_MAPLE is not set 138# CONFIG_PPC_MAPLE is not set
136# CONFIG_PPC_PASEMI is not set 139# CONFIG_PPC_PASEMI is not set
140# CONFIG_PPC_CELLEB is not set
141CONFIG_PPC_PS3=y
142
143#
144# PS3 Platform Options
145#
146# CONFIG_PS3_ADVANCED is not set
147CONFIG_PS3_HTAB_SIZE=20
148# CONFIG_PS3_DYNAMIC_DMA is not set
149CONFIG_PS3_USE_LPAR_ADDR=y
150CONFIG_PS3_VUART=y
151CONFIG_PS3_PS3AV=y
152CONFIG_PS3_SYS_MANAGER=y
137CONFIG_PPC_CELL=y 153CONFIG_PPC_CELL=y
138# CONFIG_PPC_CELL_NATIVE is not set 154# CONFIG_PPC_CELL_NATIVE is not set
139# CONFIG_PPC_IBM_CELL_BLADE is not set 155# CONFIG_PPC_IBM_CELL_BLADE is not set
140CONFIG_PPC_PS3=y 156
157#
158# Cell Broadband Engine options
159#
160CONFIG_SPU_FS=y
161CONFIG_SPU_BASE=y
162# CONFIG_PQ2ADS is not set
163# CONFIG_MPIC is not set
164# CONFIG_MPIC_WEIRD is not set
165# CONFIG_PPC_I8259 is not set
141# CONFIG_U3_DART is not set 166# CONFIG_U3_DART is not set
142# CONFIG_PPC_RTAS is not set 167# CONFIG_PPC_RTAS is not set
143# CONFIG_MMIO_NVRAM is not set 168# CONFIG_MMIO_NVRAM is not set
@@ -146,24 +171,7 @@ CONFIG_PPC_PS3=y
146# CONFIG_PPC_INDIRECT_IO is not set 171# CONFIG_PPC_INDIRECT_IO is not set
147# CONFIG_GENERIC_IOMAP is not set 172# CONFIG_GENERIC_IOMAP is not set
148# CONFIG_CPU_FREQ is not set 173# CONFIG_CPU_FREQ is not set
149# CONFIG_WANT_EARLY_SERIAL is not set 174# CONFIG_CPM2 is not set
150# CONFIG_MPIC is not set
151
152#
153# Cell Broadband Engine options
154#
155CONFIG_SPU_FS=y
156CONFIG_SPU_BASE=y
157# CONFIG_CBE_RAS is not set
158
159#
160# PS3 Platform Options
161#
162CONFIG_PS3_HTAB_SIZE=20
163# CONFIG_PS3_DYNAMIC_DMA is not set
164CONFIG_PS3_USE_LPAR_ADDR=y
165CONFIG_PS3_VUART=y
166CONFIG_PS3_PS3AV=y
167 175
168# 176#
169# Kernel options 177# Kernel options
@@ -179,10 +187,10 @@ CONFIG_PREEMPT_NONE=y
179# CONFIG_PREEMPT_BKL is not set 187# CONFIG_PREEMPT_BKL is not set
180CONFIG_BINFMT_ELF=y 188CONFIG_BINFMT_ELF=y
181CONFIG_BINFMT_MISC=y 189CONFIG_BINFMT_MISC=y
182CONFIG_FORCE_MAX_ZONEORDER=9 190CONFIG_FORCE_MAX_ZONEORDER=13
183# CONFIG_IOMMU_VMERGE is not set 191# CONFIG_IOMMU_VMERGE is not set
184CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 192CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
185# CONFIG_KEXEC is not set 193CONFIG_KEXEC=y
186# CONFIG_CRASH_DUMP is not set 194# CONFIG_CRASH_DUMP is not set
187# CONFIG_IRQ_ALL_CPUS is not set 195# CONFIG_IRQ_ALL_CPUS is not set
188# CONFIG_NUMA is not set 196# CONFIG_NUMA is not set
@@ -203,22 +211,22 @@ CONFIG_MEMORY_HOTPLUG=y
203CONFIG_MEMORY_HOTPLUG_SPARSE=y 211CONFIG_MEMORY_HOTPLUG_SPARSE=y
204CONFIG_SPLIT_PTLOCK_CPUS=4 212CONFIG_SPLIT_PTLOCK_CPUS=4
205CONFIG_RESOURCES_64BIT=y 213CONFIG_RESOURCES_64BIT=y
214CONFIG_ZONE_DMA_FLAG=1
206CONFIG_ARCH_MEMORY_PROBE=y 215CONFIG_ARCH_MEMORY_PROBE=y
207CONFIG_PPC_64K_PAGES=y 216# CONFIG_PPC_64K_PAGES is not set
208# CONFIG_SCHED_SMT is not set 217# CONFIG_SCHED_SMT is not set
209CONFIG_PROC_DEVICETREE=y 218CONFIG_PROC_DEVICETREE=y
210CONFIG_CMDLINE_BOOL=y 219# CONFIG_CMDLINE_BOOL is not set
211CONFIG_CMDLINE="root=/dev/sda1 ip=dhcp"
212# CONFIG_PM is not set 220# CONFIG_PM is not set
213# CONFIG_SECCOMP is not set 221# CONFIG_SECCOMP is not set
222# CONFIG_WANT_DEVICE_TREE is not set
214CONFIG_ISA_DMA_API=y 223CONFIG_ISA_DMA_API=y
215 224
216# 225#
217# Bus options 226# Bus options
218# 227#
228CONFIG_ZONE_DMA=y
219CONFIG_GENERIC_ISA_DMA=y 229CONFIG_GENERIC_ISA_DMA=y
220# CONFIG_MPIC_WEIRD is not set
221# CONFIG_PPC_I8259 is not set
222# CONFIG_PCI is not set 230# CONFIG_PCI is not set
223# CONFIG_PCI_DOMAINS is not set 231# CONFIG_PCI_DOMAINS is not set
224 232
@@ -240,10 +248,13 @@ CONFIG_NET=y
240# 248#
241# Networking options 249# Networking options
242# 250#
243# CONFIG_NETDEBUG is not set
244CONFIG_PACKET=y 251CONFIG_PACKET=y
245CONFIG_PACKET_MMAP=y 252CONFIG_PACKET_MMAP=y
246CONFIG_UNIX=y 253CONFIG_UNIX=y
254CONFIG_XFRM=y
255# CONFIG_XFRM_USER is not set
256# CONFIG_XFRM_SUB_POLICY is not set
257# CONFIG_XFRM_MIGRATE is not set
247# CONFIG_NET_KEY is not set 258# CONFIG_NET_KEY is not set
248CONFIG_INET=y 259CONFIG_INET=y
249# CONFIG_IP_MULTICAST is not set 260# CONFIG_IP_MULTICAST is not set
@@ -261,7 +272,7 @@ CONFIG_IP_PNP_DHCP=y
261# CONFIG_INET_ESP is not set 272# CONFIG_INET_ESP is not set
262# CONFIG_INET_IPCOMP is not set 273# CONFIG_INET_IPCOMP is not set
263# CONFIG_INET_XFRM_TUNNEL is not set 274# CONFIG_INET_XFRM_TUNNEL is not set
264# CONFIG_INET_TUNNEL is not set 275CONFIG_INET_TUNNEL=y
265# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 276# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
266# CONFIG_INET_XFRM_MODE_TUNNEL is not set 277# CONFIG_INET_XFRM_MODE_TUNNEL is not set
267# CONFIG_INET_XFRM_MODE_BEET is not set 278# CONFIG_INET_XFRM_MODE_BEET is not set
@@ -270,9 +281,23 @@ CONFIG_IP_PNP_DHCP=y
270CONFIG_TCP_CONG_CUBIC=y 281CONFIG_TCP_CONG_CUBIC=y
271CONFIG_DEFAULT_TCP_CONG="cubic" 282CONFIG_DEFAULT_TCP_CONG="cubic"
272# CONFIG_TCP_MD5SIG is not set 283# CONFIG_TCP_MD5SIG is not set
273# CONFIG_IPV6 is not set 284CONFIG_IPV6=y
285# CONFIG_IPV6_PRIVACY is not set
286# CONFIG_IPV6_ROUTER_PREF is not set
287# CONFIG_IPV6_OPTIMISTIC_DAD is not set
288# CONFIG_INET6_AH is not set
289# CONFIG_INET6_ESP is not set
290# CONFIG_INET6_IPCOMP is not set
291# CONFIG_IPV6_MIP6 is not set
274# CONFIG_INET6_XFRM_TUNNEL is not set 292# CONFIG_INET6_XFRM_TUNNEL is not set
275# CONFIG_INET6_TUNNEL is not set 293# CONFIG_INET6_TUNNEL is not set
294CONFIG_INET6_XFRM_MODE_TRANSPORT=y
295CONFIG_INET6_XFRM_MODE_TUNNEL=y
296CONFIG_INET6_XFRM_MODE_BEET=y
297# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
298CONFIG_IPV6_SIT=y
299# CONFIG_IPV6_TUNNEL is not set
300# CONFIG_IPV6_MULTIPLE_TABLES is not set
276# CONFIG_NETWORK_SECMARK is not set 301# CONFIG_NETWORK_SECMARK is not set
277# CONFIG_NETFILTER is not set 302# CONFIG_NETFILTER is not set
278 303
@@ -313,7 +338,31 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
313# CONFIG_NET_PKTGEN is not set 338# CONFIG_NET_PKTGEN is not set
314# CONFIG_HAMRADIO is not set 339# CONFIG_HAMRADIO is not set
315# CONFIG_IRDA is not set 340# CONFIG_IRDA is not set
316# CONFIG_BT is not set 341CONFIG_BT=m
342CONFIG_BT_L2CAP=m
343CONFIG_BT_SCO=m
344CONFIG_BT_RFCOMM=m
345# CONFIG_BT_RFCOMM_TTY is not set
346# CONFIG_BT_BNEP is not set
347CONFIG_BT_HIDP=m
348
349#
350# Bluetooth device drivers
351#
352CONFIG_BT_HCIUSB=m
353CONFIG_BT_HCIUSB_SCO=y
354# CONFIG_BT_HCIUART is not set
355# CONFIG_BT_HCIBCM203X is not set
356# CONFIG_BT_HCIBPA10X is not set
357# CONFIG_BT_HCIBFUSB is not set
358# CONFIG_BT_HCIVHCI is not set
359# CONFIG_AF_RXRPC is not set
360
361#
362# Wireless
363#
364# CONFIG_CFG80211 is not set
365CONFIG_WIRELESS_EXT=y
317# CONFIG_IEEE80211 is not set 366# CONFIG_IEEE80211 is not set
318 367
319# 368#
@@ -327,16 +376,13 @@ CONFIG_STANDALONE=y
327CONFIG_PREVENT_FIRMWARE_BUILD=y 376CONFIG_PREVENT_FIRMWARE_BUILD=y
328# CONFIG_FW_LOADER is not set 377# CONFIG_FW_LOADER is not set
329# CONFIG_DEBUG_DRIVER is not set 378# CONFIG_DEBUG_DRIVER is not set
379# CONFIG_DEBUG_DEVRES is not set
330# CONFIG_SYS_HYPERVISOR is not set 380# CONFIG_SYS_HYPERVISOR is not set
331 381
332# 382#
333# Connector - unified userspace <-> kernelspace linker 383# Connector - unified userspace <-> kernelspace linker
334# 384#
335# CONFIG_CONNECTOR is not set 385# CONFIG_CONNECTOR is not set
336
337#
338# Memory Technology Devices (MTD)
339#
340# CONFIG_MTD is not set 386# CONFIG_MTD is not set
341 387
342# 388#
@@ -347,24 +393,27 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
347# 393#
348# Plug and Play support 394# Plug and Play support
349# 395#
396# CONFIG_PNPACPI is not set
350 397
351# 398#
352# Block devices 399# Block devices
353# 400#
354# CONFIG_BLK_DEV_FD is not set 401# CONFIG_BLK_DEV_FD is not set
355# CONFIG_BLK_DEV_COW_COMMON is not set 402# CONFIG_BLK_DEV_COW_COMMON is not set
356# CONFIG_BLK_DEV_LOOP is not set 403CONFIG_BLK_DEV_LOOP=y
404# CONFIG_BLK_DEV_CRYPTOLOOP is not set
357# CONFIG_BLK_DEV_NBD is not set 405# CONFIG_BLK_DEV_NBD is not set
358# CONFIG_BLK_DEV_UB is not set 406# CONFIG_BLK_DEV_UB is not set
359# CONFIG_BLK_DEV_RAM is not set 407CONFIG_BLK_DEV_RAM=y
360# CONFIG_BLK_DEV_INITRD is not set 408CONFIG_BLK_DEV_RAM_COUNT=16
409CONFIG_BLK_DEV_RAM_SIZE=65535
410CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
361# CONFIG_CDROM_PKTCDVD is not set 411# CONFIG_CDROM_PKTCDVD is not set
362# CONFIG_ATA_OVER_ETH is not set 412# CONFIG_ATA_OVER_ETH is not set
363 413
364# 414#
365# Misc devices 415# Misc devices
366# 416#
367# CONFIG_TIFM_CORE is not set
368 417
369# 418#
370# ATA/ATAPI/MFM/RLL support 419# ATA/ATAPI/MFM/RLL support
@@ -388,7 +437,7 @@ CONFIG_BLK_DEV_SD=y
388# CONFIG_CHR_DEV_OSST is not set 437# CONFIG_CHR_DEV_OSST is not set
389CONFIG_BLK_DEV_SR=y 438CONFIG_BLK_DEV_SR=y
390# CONFIG_BLK_DEV_SR_VENDOR is not set 439# CONFIG_BLK_DEV_SR_VENDOR is not set
391# CONFIG_CHR_DEV_SG is not set 440CONFIG_CHR_DEV_SG=m
392# CONFIG_CHR_DEV_SCH is not set 441# CONFIG_CHR_DEV_SCH is not set
393 442
394# 443#
@@ -413,6 +462,7 @@ CONFIG_BLK_DEV_SR=y
413# 462#
414# CONFIG_ISCSI_TCP is not set 463# CONFIG_ISCSI_TCP is not set
415# CONFIG_SCSI_DEBUG is not set 464# CONFIG_SCSI_DEBUG is not set
465# CONFIG_SCSI_ESP_CORE is not set
416 466
417# 467#
418# Serial ATA (prod) and Parallel ATA (experimental) drivers 468# Serial ATA (prod) and Parallel ATA (experimental) drivers
@@ -460,7 +510,7 @@ CONFIG_NETDEVICES=y
460# Ethernet (10 or 100Mbit) 510# Ethernet (10 or 100Mbit)
461# 511#
462# CONFIG_NET_ETHERNET is not set 512# CONFIG_NET_ETHERNET is not set
463CONFIG_MII=y 513CONFIG_MII=m
464 514
465# 515#
466# Ethernet (1000 Mbit) 516# Ethernet (1000 Mbit)
@@ -475,9 +525,10 @@ CONFIG_MII=y
475# 525#
476 526
477# 527#
478# Wireless LAN (non-hamradio) 528# Wireless LAN
479# 529#
480# CONFIG_NET_RADIO is not set 530# CONFIG_WLAN_PRE80211 is not set
531# CONFIG_WLAN_80211 is not set
481 532
482# 533#
483# Wan interfaces 534# Wan interfaces
@@ -551,7 +602,8 @@ CONFIG_HW_CONSOLE=y
551# Non-8250 serial port support 602# Non-8250 serial port support
552# 603#
553CONFIG_UNIX98_PTYS=y 604CONFIG_UNIX98_PTYS=y
554# CONFIG_LEGACY_PTYS is not set 605CONFIG_LEGACY_PTYS=y
606CONFIG_LEGACY_PTY_COUNT=16
555 607
556# 608#
557# IPMI 609# IPMI
@@ -598,6 +650,11 @@ CONFIG_GEN_RTC=y
598# CONFIG_HWMON_VID is not set 650# CONFIG_HWMON_VID is not set
599 651
600# 652#
653# Multifunction device drivers
654#
655# CONFIG_MFD_SM501 is not set
656
657#
601# Multimedia devices 658# Multimedia devices
602# 659#
603# CONFIG_VIDEO_DEV is not set 660# CONFIG_VIDEO_DEV is not set
@@ -611,15 +668,22 @@ CONFIG_GEN_RTC=y
611# 668#
612# Graphics support 669# Graphics support
613# 670#
614# CONFIG_FIRMWARE_EDID is not set 671# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
615CONFIG_FB=y 672CONFIG_FB=y
673# CONFIG_FIRMWARE_EDID is not set
674# CONFIG_FB_DDC is not set
616CONFIG_FB_CFB_FILLRECT=y 675CONFIG_FB_CFB_FILLRECT=y
617CONFIG_FB_CFB_COPYAREA=y 676CONFIG_FB_CFB_COPYAREA=y
618CONFIG_FB_CFB_IMAGEBLIT=y 677CONFIG_FB_CFB_IMAGEBLIT=y
678# CONFIG_FB_SVGALIB is not set
619# CONFIG_FB_MACMODES is not set 679# CONFIG_FB_MACMODES is not set
620# CONFIG_FB_BACKLIGHT is not set 680# CONFIG_FB_BACKLIGHT is not set
621# CONFIG_FB_MODE_HELPERS is not set 681# CONFIG_FB_MODE_HELPERS is not set
622# CONFIG_FB_TILEBLITTING is not set 682# CONFIG_FB_TILEBLITTING is not set
683
684#
685# Frame buffer hardware drivers
686#
623# CONFIG_FB_OF is not set 687# CONFIG_FB_OF is not set
624# CONFIG_FB_VGA16 is not set 688# CONFIG_FB_VGA16 is not set
625# CONFIG_FB_S1D13XXX is not set 689# CONFIG_FB_S1D13XXX is not set
@@ -634,7 +698,7 @@ CONFIG_FB_PS3_DEFAULT_SIZE_M=18
634# CONFIG_VGA_CONSOLE is not set 698# CONFIG_VGA_CONSOLE is not set
635CONFIG_DUMMY_CONSOLE=y 699CONFIG_DUMMY_CONSOLE=y
636CONFIG_FRAMEBUFFER_CONSOLE=y 700CONFIG_FRAMEBUFFER_CONSOLE=y
637# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 701CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
638# CONFIG_FONTS is not set 702# CONFIG_FONTS is not set
639CONFIG_FONT_8x8=y 703CONFIG_FONT_8x8=y
640CONFIG_FONT_8x16=y 704CONFIG_FONT_8x16=y
@@ -646,17 +710,62 @@ CONFIG_LOGO=y
646# CONFIG_LOGO_LINUX_MONO is not set 710# CONFIG_LOGO_LINUX_MONO is not set
647# CONFIG_LOGO_LINUX_VGA16 is not set 711# CONFIG_LOGO_LINUX_VGA16 is not set
648CONFIG_LOGO_LINUX_CLUT224=y 712CONFIG_LOGO_LINUX_CLUT224=y
649# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
650 713
651# 714#
652# Sound 715# Sound
653# 716#
654# CONFIG_SOUND is not set 717CONFIG_SOUND=y
718
719#
720# Advanced Linux Sound Architecture
721#
722CONFIG_SND=y
723# CONFIG_SND_SEQUENCER is not set
724# CONFIG_SND_MIXER_OSS is not set
725# CONFIG_SND_PCM_OSS is not set
726# CONFIG_SND_DYNAMIC_MINORS is not set
727CONFIG_SND_SUPPORT_OLD_API=y
728CONFIG_SND_VERBOSE_PROCFS=y
729# CONFIG_SND_VERBOSE_PRINTK is not set
730# CONFIG_SND_DEBUG is not set
731
732#
733# Generic devices
734#
735# CONFIG_SND_DUMMY is not set
736# CONFIG_SND_MTPAV is not set
737# CONFIG_SND_SERIAL_U16550 is not set
738# CONFIG_SND_MPU401 is not set
739
740#
741# ALSA PowerMac devices
742#
743
744#
745# ALSA PowerMac requires I2C
746#
747
748#
749# USB devices
750#
751# CONFIG_SND_USB_AUDIO is not set
752# CONFIG_SND_USB_USX2Y is not set
753
754#
755# SoC audio support
756#
757# CONFIG_SND_SOC is not set
758
759#
760# Open Sound System
761#
762# CONFIG_SOUND_PRIME is not set
655 763
656# 764#
657# HID Devices 765# HID Devices
658# 766#
659CONFIG_HID=y 767CONFIG_HID=y
768# CONFIG_HID_DEBUG is not set
660 769
661# 770#
662# USB support 771# USB support
@@ -665,13 +774,13 @@ CONFIG_USB_ARCH_HAS_HCD=y
665CONFIG_USB_ARCH_HAS_OHCI=y 774CONFIG_USB_ARCH_HAS_OHCI=y
666CONFIG_USB_ARCH_HAS_EHCI=y 775CONFIG_USB_ARCH_HAS_EHCI=y
667CONFIG_USB=y 776CONFIG_USB=y
668CONFIG_USB_DEBUG=y 777# CONFIG_USB_DEBUG is not set
669 778
670# 779#
671# Miscellaneous USB options 780# Miscellaneous USB options
672# 781#
673# CONFIG_USB_DEVICEFS is not set 782CONFIG_USB_DEVICEFS=y
674# CONFIG_USB_BANDWIDTH is not set 783# CONFIG_USB_DEVICE_CLASS is not set
675# CONFIG_USB_DYNAMIC_MINORS is not set 784# CONFIG_USB_DYNAMIC_MINORS is not set
676# CONFIG_USB_OTG is not set 785# CONFIG_USB_OTG is not set
677 786
@@ -704,7 +813,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
704# 813#
705# may also be needed; see USB_STORAGE Help for more information 814# may also be needed; see USB_STORAGE Help for more information
706# 815#
707CONFIG_USB_STORAGE=y 816CONFIG_USB_STORAGE=m
708# CONFIG_USB_STORAGE_DEBUG is not set 817# CONFIG_USB_STORAGE_DEBUG is not set
709# CONFIG_USB_STORAGE_DATAFAB is not set 818# CONFIG_USB_STORAGE_DATAFAB is not set
710# CONFIG_USB_STORAGE_FREECOM is not set 819# CONFIG_USB_STORAGE_FREECOM is not set
@@ -720,10 +829,16 @@ CONFIG_USB_STORAGE=y
720# 829#
721# USB Input Devices 830# USB Input Devices
722# 831#
723CONFIG_USB_HID=y 832CONFIG_USB_HID=m
724# CONFIG_USB_HIDINPUT_POWERBOOK is not set 833# CONFIG_USB_HIDINPUT_POWERBOOK is not set
725# CONFIG_HID_FF is not set 834# CONFIG_HID_FF is not set
726# CONFIG_USB_HIDDEV is not set 835# CONFIG_USB_HIDDEV is not set
836
837#
838# USB HID Boot Protocol drivers
839#
840# CONFIG_USB_KBD is not set
841# CONFIG_USB_MOUSE is not set
727# CONFIG_USB_AIPTEK is not set 842# CONFIG_USB_AIPTEK is not set
728# CONFIG_USB_WACOM is not set 843# CONFIG_USB_WACOM is not set
729# CONFIG_USB_ACECAD is not set 844# CONFIG_USB_ACECAD is not set
@@ -736,6 +851,7 @@ CONFIG_USB_HID=y
736# CONFIG_USB_ATI_REMOTE2 is not set 851# CONFIG_USB_ATI_REMOTE2 is not set
737# CONFIG_USB_KEYSPAN_REMOTE is not set 852# CONFIG_USB_KEYSPAN_REMOTE is not set
738# CONFIG_USB_APPLETOUCH is not set 853# CONFIG_USB_APPLETOUCH is not set
854# CONFIG_USB_GTCO is not set
739 855
740# 856#
741# USB Imaging devices 857# USB Imaging devices
@@ -748,15 +864,16 @@ CONFIG_USB_HID=y
748# 864#
749# CONFIG_USB_CATC is not set 865# CONFIG_USB_CATC is not set
750# CONFIG_USB_KAWETH is not set 866# CONFIG_USB_KAWETH is not set
751# CONFIG_USB_PEGASUS is not set 867CONFIG_USB_PEGASUS=m
752# CONFIG_USB_RTL8150 is not set 868# CONFIG_USB_RTL8150 is not set
753CONFIG_USB_USBNET_MII=y 869CONFIG_USB_USBNET_MII=m
754CONFIG_USB_USBNET=y 870CONFIG_USB_USBNET=m
755CONFIG_USB_NET_CDCETHER=y 871# CONFIG_USB_NET_CDCETHER is not set
872# CONFIG_USB_NET_DM9601 is not set
756# CONFIG_USB_NET_GL620A is not set 873# CONFIG_USB_NET_GL620A is not set
757# CONFIG_USB_NET_NET1080 is not set 874# CONFIG_USB_NET_NET1080 is not set
758# CONFIG_USB_NET_PLUSB is not set 875# CONFIG_USB_NET_PLUSB is not set
759CONFIG_USB_NET_MCS7830=y 876CONFIG_USB_NET_MCS7830=m
760# CONFIG_USB_NET_RNDIS_HOST is not set 877# CONFIG_USB_NET_RNDIS_HOST is not set
761# CONFIG_USB_NET_CDC_SUBSET is not set 878# CONFIG_USB_NET_CDC_SUBSET is not set
762# CONFIG_USB_NET_ZAURUS is not set 879# CONFIG_USB_NET_ZAURUS is not set
@@ -781,6 +898,7 @@ CONFIG_USB_MON=y
781# CONFIG_USB_RIO500 is not set 898# CONFIG_USB_RIO500 is not set
782# CONFIG_USB_LEGOTOWER is not set 899# CONFIG_USB_LEGOTOWER is not set
783# CONFIG_USB_LCD is not set 900# CONFIG_USB_LCD is not set
901# CONFIG_USB_BERRY_CHARGE is not set
784# CONFIG_USB_LED is not set 902# CONFIG_USB_LED is not set
785# CONFIG_USB_CYPRESS_CY7C63 is not set 903# CONFIG_USB_CYPRESS_CY7C63 is not set
786# CONFIG_USB_CYTHERM is not set 904# CONFIG_USB_CYTHERM is not set
@@ -791,6 +909,8 @@ CONFIG_USB_MON=y
791# CONFIG_USB_SISUSBVGA is not set 909# CONFIG_USB_SISUSBVGA is not set
792# CONFIG_USB_LD is not set 910# CONFIG_USB_LD is not set
793# CONFIG_USB_TRANCEVIBRATOR is not set 911# CONFIG_USB_TRANCEVIBRATOR is not set
912# CONFIG_USB_IOWARRIOR is not set
913# CONFIG_USB_TEST is not set
794 914
795# 915#
796# USB DSL modem support 916# USB DSL modem support
@@ -846,13 +966,19 @@ CONFIG_USB_MON=y
846# 966#
847 967
848# 968#
969# Auxiliary Display support
970#
971
972#
849# Virtualization 973# Virtualization
850# 974#
851 975
852# 976#
853# File systems 977# File systems
854# 978#
855# CONFIG_EXT2_FS is not set 979CONFIG_EXT2_FS=m
980# CONFIG_EXT2_FS_XATTR is not set
981# CONFIG_EXT2_FS_XIP is not set
856CONFIG_EXT3_FS=y 982CONFIG_EXT3_FS=y
857CONFIG_EXT3_FS_XATTR=y 983CONFIG_EXT3_FS_XATTR=y
858# CONFIG_EXT3_FS_POSIX_ACL is not set 984# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -871,27 +997,30 @@ CONFIG_FS_MBCACHE=y
871# CONFIG_ROMFS_FS is not set 997# CONFIG_ROMFS_FS is not set
872CONFIG_INOTIFY=y 998CONFIG_INOTIFY=y
873CONFIG_INOTIFY_USER=y 999CONFIG_INOTIFY_USER=y
874# CONFIG_QUOTA is not set 1000CONFIG_QUOTA=y
1001# CONFIG_QFMT_V1 is not set
1002CONFIG_QFMT_V2=y
1003CONFIG_QUOTACTL=y
875CONFIG_DNOTIFY=y 1004CONFIG_DNOTIFY=y
876# CONFIG_AUTOFS_FS is not set 1005# CONFIG_AUTOFS_FS is not set
877# CONFIG_AUTOFS4_FS is not set 1006CONFIG_AUTOFS4_FS=y
878# CONFIG_FUSE_FS is not set 1007# CONFIG_FUSE_FS is not set
879 1008
880# 1009#
881# CD-ROM/DVD Filesystems 1010# CD-ROM/DVD Filesystems
882# 1011#
883CONFIG_ISO9660_FS=y 1012CONFIG_ISO9660_FS=m
884CONFIG_JOLIET=y 1013CONFIG_JOLIET=y
885# CONFIG_ZISOFS is not set 1014# CONFIG_ZISOFS is not set
886CONFIG_UDF_FS=y 1015CONFIG_UDF_FS=m
887CONFIG_UDF_NLS=y 1016CONFIG_UDF_NLS=y
888 1017
889# 1018#
890# DOS/FAT/NT Filesystems 1019# DOS/FAT/NT Filesystems
891# 1020#
892CONFIG_FAT_FS=y 1021CONFIG_FAT_FS=m
893# CONFIG_MSDOS_FS is not set 1022# CONFIG_MSDOS_FS is not set
894CONFIG_VFAT_FS=y 1023CONFIG_VFAT_FS=m
895CONFIG_FAT_DEFAULT_CODEPAGE=437 1024CONFIG_FAT_DEFAULT_CODEPAGE=437
896CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1025CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
897# CONFIG_NTFS_FS is not set 1026# CONFIG_NTFS_FS is not set
@@ -933,7 +1062,7 @@ CONFIG_RAMFS=y
933CONFIG_NFS_FS=y 1062CONFIG_NFS_FS=y
934CONFIG_NFS_V3=y 1063CONFIG_NFS_V3=y
935# CONFIG_NFS_V3_ACL is not set 1064# CONFIG_NFS_V3_ACL is not set
936# CONFIG_NFS_V4 is not set 1065CONFIG_NFS_V4=y
937# CONFIG_NFS_DIRECTIO is not set 1066# CONFIG_NFS_DIRECTIO is not set
938# CONFIG_NFSD is not set 1067# CONFIG_NFSD is not set
939CONFIG_ROOT_NFS=y 1068CONFIG_ROOT_NFS=y
@@ -941,10 +1070,16 @@ CONFIG_LOCKD=y
941CONFIG_LOCKD_V4=y 1070CONFIG_LOCKD_V4=y
942CONFIG_NFS_COMMON=y 1071CONFIG_NFS_COMMON=y
943CONFIG_SUNRPC=y 1072CONFIG_SUNRPC=y
944# CONFIG_RPCSEC_GSS_KRB5 is not set 1073CONFIG_SUNRPC_GSS=y
1074CONFIG_RPCSEC_GSS_KRB5=y
945# CONFIG_RPCSEC_GSS_SPKM3 is not set 1075# CONFIG_RPCSEC_GSS_SPKM3 is not set
946# CONFIG_SMB_FS is not set 1076# CONFIG_SMB_FS is not set
947# CONFIG_CIFS is not set 1077CONFIG_CIFS=m
1078# CONFIG_CIFS_STATS is not set
1079# CONFIG_CIFS_WEAK_PW_HASH is not set
1080# CONFIG_CIFS_XATTR is not set
1081# CONFIG_CIFS_DEBUG2 is not set
1082# CONFIG_CIFS_EXPERIMENTAL is not set
948# CONFIG_NCP_FS is not set 1083# CONFIG_NCP_FS is not set
949# CONFIG_CODA_FS is not set 1084# CONFIG_CODA_FS is not set
950# CONFIG_AFS_FS is not set 1085# CONFIG_AFS_FS is not set
@@ -1004,6 +1139,8 @@ CONFIG_NLS_ISO8859_1=y
1004# Distributed Lock Manager 1139# Distributed Lock Manager
1005# 1140#
1006# CONFIG_DLM is not set 1141# CONFIG_DLM is not set
1142# CONFIG_UCC_SLOW is not set
1143# CONFIG_UCC_FAST is not set
1007 1144
1008# 1145#
1009# Library routines 1146# Library routines
@@ -1014,7 +1151,8 @@ CONFIG_BITREVERSE=y
1014CONFIG_CRC32=y 1151CONFIG_CRC32=y
1015# CONFIG_LIBCRC32C is not set 1152# CONFIG_LIBCRC32C is not set
1016CONFIG_PLIST=y 1153CONFIG_PLIST=y
1017CONFIG_IOMAP_COPY=y 1154CONFIG_HAS_IOMEM=y
1155CONFIG_HAS_IOPORT=y
1018 1156
1019# 1157#
1020# Instrumentation Support 1158# Instrumentation Support
@@ -1032,16 +1170,16 @@ CONFIG_ENABLE_MUST_CHECK=y
1032# CONFIG_DEBUG_FS is not set 1170# CONFIG_DEBUG_FS is not set
1033# CONFIG_HEADERS_CHECK is not set 1171# CONFIG_HEADERS_CHECK is not set
1034CONFIG_DEBUG_KERNEL=y 1172CONFIG_DEBUG_KERNEL=y
1173# CONFIG_DEBUG_SHIRQ is not set
1035CONFIG_LOG_BUF_SHIFT=17 1174CONFIG_LOG_BUF_SHIFT=17
1036CONFIG_DETECT_SOFTLOCKUP=y 1175CONFIG_DETECT_SOFTLOCKUP=y
1037# CONFIG_SCHEDSTATS is not set 1176# CONFIG_SCHEDSTATS is not set
1038CONFIG_DEBUG_SLAB=y 1177# CONFIG_TIMER_STATS is not set
1039# CONFIG_DEBUG_SLAB_LEAK is not set 1178# CONFIG_DEBUG_SLAB is not set
1040# CONFIG_DEBUG_RT_MUTEXES is not set 1179# CONFIG_DEBUG_RT_MUTEXES is not set
1041# CONFIG_RT_MUTEX_TESTER is not set 1180# CONFIG_RT_MUTEX_TESTER is not set
1042CONFIG_DEBUG_SPINLOCK=y 1181CONFIG_DEBUG_SPINLOCK=y
1043CONFIG_DEBUG_MUTEXES=y 1182CONFIG_DEBUG_MUTEXES=y
1044CONFIG_DEBUG_RWSEMS=y
1045CONFIG_DEBUG_SPINLOCK_SLEEP=y 1183CONFIG_DEBUG_SPINLOCK_SLEEP=y
1046# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1184# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1047# CONFIG_DEBUG_KOBJECT is not set 1185# CONFIG_DEBUG_KOBJECT is not set
@@ -1051,8 +1189,10 @@ CONFIG_DEBUG_INFO=y
1051CONFIG_DEBUG_LIST=y 1189CONFIG_DEBUG_LIST=y
1052CONFIG_FORCED_INLINING=y 1190CONFIG_FORCED_INLINING=y
1053# CONFIG_RCU_TORTURE_TEST is not set 1191# CONFIG_RCU_TORTURE_TEST is not set
1192# CONFIG_FAULT_INJECTION is not set
1054CONFIG_DEBUG_STACKOVERFLOW=y 1193CONFIG_DEBUG_STACKOVERFLOW=y
1055# CONFIG_DEBUG_STACK_USAGE is not set 1194# CONFIG_DEBUG_STACK_USAGE is not set
1195# CONFIG_DEBUG_PAGEALLOC is not set
1056# CONFIG_DEBUGGER is not set 1196# CONFIG_DEBUGGER is not set
1057CONFIG_IRQSTACKS=y 1197CONFIG_IRQSTACKS=y
1058# CONFIG_BOOTX_TEXT is not set 1198# CONFIG_BOOTX_TEXT is not set
@@ -1063,6 +1203,8 @@ CONFIG_PPC_EARLY_DEBUG=y
1063# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set 1203# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
1064# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set 1204# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
1065# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set 1205# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
1206# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
1207# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
1066 1208
1067# 1209#
1068# Security options 1210# Security options
@@ -1073,4 +1215,43 @@ CONFIG_PPC_EARLY_DEBUG=y
1073# 1215#
1074# Cryptographic options 1216# Cryptographic options
1075# 1217#
1076# CONFIG_CRYPTO is not set 1218CONFIG_CRYPTO=y
1219CONFIG_CRYPTO_ALGAPI=y
1220CONFIG_CRYPTO_BLKCIPHER=y
1221CONFIG_CRYPTO_MANAGER=y
1222# CONFIG_CRYPTO_HMAC is not set
1223# CONFIG_CRYPTO_XCBC is not set
1224# CONFIG_CRYPTO_NULL is not set
1225# CONFIG_CRYPTO_MD4 is not set
1226CONFIG_CRYPTO_MD5=y
1227# CONFIG_CRYPTO_SHA1 is not set
1228# CONFIG_CRYPTO_SHA256 is not set
1229# CONFIG_CRYPTO_SHA512 is not set
1230# CONFIG_CRYPTO_WP512 is not set
1231# CONFIG_CRYPTO_TGR192 is not set
1232# CONFIG_CRYPTO_GF128MUL is not set
1233CONFIG_CRYPTO_ECB=m
1234CONFIG_CRYPTO_CBC=y
1235CONFIG_CRYPTO_PCBC=m
1236# CONFIG_CRYPTO_LRW is not set
1237CONFIG_CRYPTO_DES=y
1238# CONFIG_CRYPTO_FCRYPT is not set
1239# CONFIG_CRYPTO_BLOWFISH is not set
1240# CONFIG_CRYPTO_TWOFISH is not set
1241# CONFIG_CRYPTO_SERPENT is not set
1242# CONFIG_CRYPTO_AES is not set
1243# CONFIG_CRYPTO_CAST5 is not set
1244# CONFIG_CRYPTO_CAST6 is not set
1245# CONFIG_CRYPTO_TEA is not set
1246# CONFIG_CRYPTO_ARC4 is not set
1247# CONFIG_CRYPTO_KHAZAD is not set
1248# CONFIG_CRYPTO_ANUBIS is not set
1249# CONFIG_CRYPTO_DEFLATE is not set
1250# CONFIG_CRYPTO_MICHAEL_MIC is not set
1251# CONFIG_CRYPTO_CRC32C is not set
1252# CONFIG_CRYPTO_CAMELLIA is not set
1253# CONFIG_CRYPTO_TEST is not set
1254
1255#
1256# Hardware crypto devices
1257#
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index aa693d0f151a..94c703a95013 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -36,8 +36,9 @@ obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
36obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 36obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
37obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o 37obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
38obj-$(CONFIG_TAU) += tau_6xx.o 38obj-$(CONFIG_TAU) += tau_6xx.o
39obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o suspend.o
39obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o 40obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
40obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o 41obj64-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_64.o swsusp_asm64.o
41obj32-$(CONFIG_MODULES) += module_32.o 42obj32-$(CONFIG_MODULES) += module_32.o
42 43
43ifeq ($(CONFIG_PPC_MERGE),y) 44ifeq ($(CONFIG_PPC_MERGE),y)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 0c5150c69175..8f48560b7ee2 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -21,12 +21,12 @@
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/mman.h> 22#include <linux/mman.h>
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/suspend.h>
24#ifdef CONFIG_PPC64 25#ifdef CONFIG_PPC64
25#include <linux/time.h> 26#include <linux/time.h>
26#include <linux/hardirq.h> 27#include <linux/hardirq.h>
27#else 28#else
28#include <linux/ptrace.h> 29#include <linux/ptrace.h>
29#include <linux/suspend.h>
30#endif 30#endif
31 31
32#include <asm/io.h> 32#include <asm/io.h>
@@ -257,11 +257,11 @@ int main(void)
257 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); 257 DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
258 DEFINE(CPU_SPEC_RESTORE, offsetof(struct cpu_spec, cpu_restore)); 258 DEFINE(CPU_SPEC_RESTORE, offsetof(struct cpu_spec, cpu_restore));
259 259
260#ifndef CONFIG_PPC64
261 DEFINE(pbe_address, offsetof(struct pbe, address)); 260 DEFINE(pbe_address, offsetof(struct pbe, address));
262 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address)); 261 DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
263 DEFINE(pbe_next, offsetof(struct pbe, next)); 262 DEFINE(pbe_next, offsetof(struct pbe, next));
264 263
264#ifndef CONFIG_PPC64
265 DEFINE(TASK_SIZE, TASK_SIZE); 265 DEFINE(TASK_SIZE, TASK_SIZE);
266 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); 266 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
267#endif /* ! CONFIG_PPC64 */ 267#endif /* ! CONFIG_PPC64 */
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index a15d4b8cce48..9ee6773cf026 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -120,8 +120,8 @@ skpinv: addi r4,r4,1 /* Increment */
120 * Configure and load pinned entry into TLB slot 63. 120 * Configure and load pinned entry into TLB slot 63.
121 */ 121 */
122 122
123 lis r3,KERNELBASE@h /* Load the kernel virtual address */ 123 lis r3,PAGE_OFFSET@h
124 ori r3,r3,KERNELBASE@l 124 ori r3,r3,PAGE_OFFSET@l
125 125
126 /* Kernel is at the base of RAM */ 126 /* Kernel is at the base of RAM */
127 li r4, 0 /* Load the kernel physical address */ 127 li r4, 0 /* Load the kernel physical address */
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 6e7f50967bab..a9e9cbd32975 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -33,8 +33,11 @@
33#include <asm/smp.h> 33#include <asm/smp.h>
34 34
35#ifdef CONFIG_HOTPLUG_CPU 35#ifdef CONFIG_HOTPLUG_CPU
36/* this is used for software suspend, and that shuts down
37 * CPUs even while the system is still booting... */
36#define cpu_should_die() (cpu_is_offline(smp_processor_id()) && \ 38#define cpu_should_die() (cpu_is_offline(smp_processor_id()) && \
37 system_state == SYSTEM_RUNNING) 39 (system_state == SYSTEM_RUNNING \
40 || system_state == SYSTEM_BOOTING))
38#else 41#else
39#define cpu_should_die() 0 42#define cpu_should_die() 0
40#endif 43#endif
diff --git a/arch/powerpc/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index ba3195478600..5328709eeedc 100644
--- a/arch/powerpc/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -53,3 +53,24 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
53 isync 53 isync
54 b 1b 54 b 1b
55 55
56_GLOBAL(power4_cpu_offline_powersave)
57 /* Go to NAP now */
58 mfmsr r7
59 rldicl r0,r7,48,1
60 rotldi r0,r0,16
61 mtmsrd r0,1 /* hard-disable interrupts */
62 li r0,1
63 li r6,0
64 stb r0,PACAHARDIRQEN(r13) /* we'll hard-enable shortly */
65 stb r6,PACASOFTIRQEN(r13) /* soft-disable irqs */
66BEGIN_FTR_SECTION
67 DSSALL
68 sync
69END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
70 ori r7,r7,MSR_EE
71 oris r7,r7,MSR_POW@h
72 sync
73 isync
74 mtmsrd r7
75 isync
76 blr
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 6c83fe229e60..5719a530f2d1 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -67,6 +67,7 @@
67#ifdef CONFIG_PPC64 67#ifdef CONFIG_PPC64
68#include <asm/paca.h> 68#include <asm/paca.h>
69#include <asm/firmware.h> 69#include <asm/firmware.h>
70#include <asm/lv1call.h>
70#endif 71#endif
71 72
72int __irq_offset_value; 73int __irq_offset_value;
@@ -162,6 +163,16 @@ void local_irq_restore(unsigned long en)
162 local_paca->hard_enabled = en; 163 local_paca->hard_enabled = en;
163 if ((int)mfspr(SPRN_DEC) < 0) 164 if ((int)mfspr(SPRN_DEC) < 0)
164 mtspr(SPRN_DEC, 1); 165 mtspr(SPRN_DEC, 1);
166
167 /*
168 * Force the delivery of pending soft-disabled interrupts on PS3.
169 * Any HV call will have this side effect.
170 */
171 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
172 u64 tmp;
173 lv1_get_version_info(&tmp);
174 }
175
165 hard_irq_enable(); 176 hard_irq_enable();
166} 177}
167#endif /* CONFIG_PPC64 */ 178#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index ef647e7a9dc3..c27f41870c8f 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -410,7 +410,7 @@ out:
410 return 1; 410 return 1;
411} 411}
412 412
413static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) 413int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
414{ 414{
415 struct kprobe *cur = kprobe_running(); 415 struct kprobe *cur = kprobe_running();
416 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 416 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
@@ -495,14 +495,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
495 if (post_kprobe_handler(args->regs)) 495 if (post_kprobe_handler(args->regs))
496 ret = NOTIFY_STOP; 496 ret = NOTIFY_STOP;
497 break; 497 break;
498 case DIE_PAGE_FAULT:
499 /* kprobe_running() needs smp_processor_id() */
500 preempt_disable();
501 if (kprobe_running() &&
502 kprobe_fault_handler(args->regs, args->trapnr))
503 ret = NOTIFY_STOP;
504 preempt_enable();
505 break;
506 default: 498 default:
507 break; 499 break;
508 } 500 }
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index ae4836ea7442..cea8045ba40b 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -244,9 +244,9 @@ static int __init add_legacy_pci_port(struct device_node *np,
244 * doesn't work for these settings, you'll have to add your own special 244 * doesn't work for these settings, you'll have to add your own special
245 * cases here 245 * cases here
246 */ 246 */
247 if (device_is_compatible(pci_dev, "pci13a8,152") || 247 if (of_device_is_compatible(pci_dev, "pci13a8,152") ||
248 device_is_compatible(pci_dev, "pci13a8,154") || 248 of_device_is_compatible(pci_dev, "pci13a8,154") ||
249 device_is_compatible(pci_dev, "pci13a8,158")) { 249 of_device_is_compatible(pci_dev, "pci13a8,158")) {
250 addr += 0x200 * lindex; 250 addr += 0x200 * lindex;
251 base += 0x200 * lindex; 251 base += 0x200 * lindex;
252 } else { 252 } else {
@@ -365,11 +365,11 @@ void __init find_legacy_serial_ports(void)
365 /* Check for known pciclass, and also check wether we have 365 /* Check for known pciclass, and also check wether we have
366 * a device with child nodes for ports or not 366 * a device with child nodes for ports or not
367 */ 367 */
368 if (device_is_compatible(np, "pciclass,0700") || 368 if (of_device_is_compatible(np, "pciclass,0700") ||
369 device_is_compatible(np, "pciclass,070002")) 369 of_device_is_compatible(np, "pciclass,070002"))
370 pci = np; 370 pci = np;
371 else if (device_is_compatible(parent, "pciclass,0700") || 371 else if (of_device_is_compatible(parent, "pciclass,0700") ||
372 device_is_compatible(parent, "pciclass,070002")) 372 of_device_is_compatible(parent, "pciclass,070002"))
373 pci = parent; 373 pci = parent;
374 else { 374 else {
375 of_node_put(parent); 375 of_node_put(parent);
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 0c8ea7659d92..a464d67248df 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -27,7 +27,7 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches,
27 match &= node->type 27 match &= node->type
28 && !strcmp(matches->type, node->type); 28 && !strcmp(matches->type, node->type);
29 if (matches->compatible[0]) 29 if (matches->compatible[0])
30 match &= device_is_compatible(node, 30 match &= of_device_is_compatible(node,
31 matches->compatible); 31 matches->compatible);
32 if (match) 32 if (match)
33 return matches; 33 return matches;
@@ -120,8 +120,8 @@ void of_device_unregister(struct of_device *ofdev)
120} 120}
121 121
122 122
123static ssize_t of_device_get_modalias(struct of_device *ofdev, 123ssize_t of_device_get_modalias(struct of_device *ofdev,
124 char *str, ssize_t len) 124 char *str, ssize_t len)
125{ 125{
126 const char *compat; 126 const char *compat;
127 int cplen, i; 127 int cplen, i;
@@ -239,3 +239,4 @@ EXPORT_SYMBOL(of_dev_get);
239EXPORT_SYMBOL(of_dev_put); 239EXPORT_SYMBOL(of_dev_put);
240EXPORT_SYMBOL(of_release_dev); 240EXPORT_SYMBOL(of_release_dev);
241EXPORT_SYMBOL(of_device_uevent); 241EXPORT_SYMBOL(of_device_uevent);
242EXPORT_SYMBOL(of_device_get_modalias);
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index f022862de344..e66064b5093a 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -1658,7 +1658,7 @@ pgprot_t pci_phys_mem_access_prot(struct file *file,
1658 int i; 1658 int i;
1659 1659
1660 if (page_is_ram(pfn)) 1660 if (page_is_ram(pfn))
1661 return prot; 1661 return __pgprot(prot);
1662 1662
1663 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED; 1663 prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
1664 1664
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 7138092826aa..6d05a1f377b5 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -1006,8 +1006,9 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
1006 1006
1007 switch ((pci_space >> 24) & 0x3) { 1007 switch ((pci_space >> 24) & 0x3) {
1008 case 1: /* I/O space */ 1008 case 1: /* I/O space */
1009 hose->io_base_phys = cpu_phys_addr; 1009 hose->io_base_phys = cpu_phys_addr - pci_addr;
1010 hose->pci_io_size = size; 1010 /* handle from 0 to top of I/O window */
1011 hose->pci_io_size = pci_addr + size;
1011 1012
1012 res = &hose->io_resource; 1013 res = &hose->io_resource;
1013 res->flags = IORESOURCE_IO; 1014 res->flags = IORESOURCE_IO;
@@ -1117,8 +1118,8 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys,
1117 } else { 1118 } else {
1118 /* Root Bus */ 1119 /* Root Bus */
1119 res = &hose->io_resource; 1120 res = &hose->io_resource;
1120 *start_phys = hose->io_base_phys; 1121 *start_phys = hose->io_base_phys + res->start;
1121 *start_virt = (unsigned long) hose->io_base_virt; 1122 *start_virt = (unsigned long) hose->io_base_virt + res->start;
1122 if (res->end > res->start) 1123 if (res->end > res->start)
1123 *size = res->end - res->start + 1; 1124 *size = res->end - res->start + 1;
1124 else { 1125 else {
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index ff252aaead12..c96fa9bd35a4 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -66,7 +66,6 @@ EXPORT_SYMBOL(clear_pages);
66EXPORT_SYMBOL(ISA_DMA_THRESHOLD); 66EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
67EXPORT_SYMBOL(DMA_MODE_READ); 67EXPORT_SYMBOL(DMA_MODE_READ);
68EXPORT_SYMBOL(DMA_MODE_WRITE); 68EXPORT_SYMBOL(DMA_MODE_WRITE);
69EXPORT_SYMBOL(__div64_32);
70 69
71EXPORT_SYMBOL(do_signal); 70EXPORT_SYMBOL(do_signal);
72EXPORT_SYMBOL(transfer_to_handler); 71EXPORT_SYMBOL(transfer_to_handler);
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index e27d9d1b6e67..eee3555ced7c 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -967,7 +967,7 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp)
967 * If problems seem to show up, it would be a good start to track 967 * If problems seem to show up, it would be a good start to track
968 * them down. 968 * them down.
969 */ 969 */
970static void reserve_mem(u64 base, u64 size) 970static void __init reserve_mem(u64 base, u64 size)
971{ 971{
972 u64 top = base + size; 972 u64 top = base + size;
973 unsigned long cnt = RELOC(mem_reserve_cnt); 973 unsigned long cnt = RELOC(mem_reserve_cnt);
@@ -2153,7 +2153,7 @@ static void __init fixup_device_tree_efika(void)
2153 3,12,0, 3,13,0, 3,14,0, 3,15,0 }; 2153 3,12,0, 3,13,0, 3,14,0, 3,15,0 };
2154 struct subst_entry efika_subst_table[] = { 2154 struct subst_entry efika_subst_table[] = {
2155 { "/", "device_type", prop_cstr("efika") }, 2155 { "/", "device_type", prop_cstr("efika") },
2156 { "/builtin", "compatible", prop_cstr("soc") }, 2156 { "/builtin", "device_type", prop_cstr("soc") },
2157 { "/builtin/ata", "compatible", prop_cstr("mpc5200b-ata\0mpc5200-ata"), }, 2157 { "/builtin/ata", "compatible", prop_cstr("mpc5200b-ata\0mpc5200-ata"), },
2158 { "/builtin/bestcomm", "compatible", prop_cstr("mpc5200b-bestcomm\0mpc5200-bestcomm") }, 2158 { "/builtin/bestcomm", "compatible", prop_cstr("mpc5200b-bestcomm\0mpc5200-bestcomm") },
2159 { "/builtin/bestcomm", "interrupts", prop_bcomm_irq, sizeof(prop_bcomm_irq) }, 2159 { "/builtin/bestcomm", "interrupts", prop_bcomm_irq, sizeof(prop_bcomm_irq) },
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index aa40a5307294..b5c96af955c6 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -1042,3 +1042,28 @@ const void *of_get_mac_address(struct device_node *np)
1042} 1042}
1043EXPORT_SYMBOL(of_get_mac_address); 1043EXPORT_SYMBOL(of_get_mac_address);
1044 1044
1045int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
1046{
1047 int irq = irq_of_parse_and_map(dev, index);
1048
1049 /* Only dereference the resource if both the
1050 * resource and the irq are valid. */
1051 if (r && irq != NO_IRQ) {
1052 r->start = r->end = irq;
1053 r->flags = IORESOURCE_IRQ;
1054 }
1055
1056 return irq;
1057}
1058EXPORT_SYMBOL_GPL(of_irq_to_resource);
1059
1060void __iomem *of_iomap(struct device_node *np, int index)
1061{
1062 struct resource res;
1063
1064 if (of_address_to_resource(np, index, &res))
1065 return NULL;
1066
1067 return ioremap(res.start, 1 + res.end - res.start);
1068}
1069EXPORT_SYMBOL(of_iomap);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index d8e503b2e1af..22f1ef1b3100 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -176,10 +176,10 @@ static struct call_data_struct {
176#define SMP_CALL_TIMEOUT 8 176#define SMP_CALL_TIMEOUT 8
177 177
178/* 178/*
179 * This function sends a 'generic call function' IPI to all other CPUs 179 * These functions send a 'generic call function' IPI to other online
180 * in the system. 180 * CPUS in the system.
181 * 181 *
182 * [SUMMARY] Run a function on all other CPUs. 182 * [SUMMARY] Run a function on other CPUs.
183 * <func> The function to run. This must be fast and non-blocking. 183 * <func> The function to run. This must be fast and non-blocking.
184 * <info> An arbitrary pointer to pass to the function. 184 * <info> An arbitrary pointer to pass to the function.
185 * <nonatomic> currently unused. 185 * <nonatomic> currently unused.
@@ -190,18 +190,26 @@ static struct call_data_struct {
190 * You must not call this function with disabled interrupts or from a 190 * You must not call this function with disabled interrupts or from a
191 * hardware interrupt handler or from a bottom half handler. 191 * hardware interrupt handler or from a bottom half handler.
192 */ 192 */
193int smp_call_function (void (*func) (void *info), void *info, int nonatomic, 193int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
194 int wait) 194 int wait, cpumask_t map)
195{ 195{
196 struct call_data_struct data; 196 struct call_data_struct data;
197 int ret = -1, cpus; 197 int ret = -1, num_cpus;
198 int cpu;
198 u64 timeout; 199 u64 timeout;
199 200
200 /* Can deadlock when called with interrupts disabled */ 201 /* Can deadlock when called with interrupts disabled */
201 WARN_ON(irqs_disabled()); 202 WARN_ON(irqs_disabled());
202 203
204 /* remove 'self' from the map */
205 if (cpu_isset(smp_processor_id(), map))
206 cpu_clear(smp_processor_id(), map);
207
208 /* sanity check the map, remove any non-online processors. */
209 cpus_and(map, map, cpu_online_map);
210
203 if (unlikely(smp_ops == NULL)) 211 if (unlikely(smp_ops == NULL))
204 return -1; 212 return ret;
205 213
206 data.func = func; 214 data.func = func;
207 data.info = info; 215 data.info = info;
@@ -213,40 +221,42 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
213 spin_lock(&call_lock); 221 spin_lock(&call_lock);
214 /* Must grab online cpu count with preempt disabled, otherwise 222 /* Must grab online cpu count with preempt disabled, otherwise
215 * it can change. */ 223 * it can change. */
216 cpus = num_online_cpus() - 1; 224 num_cpus = num_online_cpus() - 1;
217 if (!cpus) { 225 if (!num_cpus || cpus_empty(map)) {
218 ret = 0; 226 ret = 0;
219 goto out; 227 goto out;
220 } 228 }
221 229
222 call_data = &data; 230 call_data = &data;
223 smp_wmb(); 231 smp_wmb();
224 /* Send a message to all other CPUs and wait for them to respond */ 232 /* Send a message to all CPUs in the map */
225 smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION); 233 for_each_cpu_mask(cpu, map)
234 smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNCTION);
226 235
227 timeout = get_tb() + (u64) SMP_CALL_TIMEOUT * tb_ticks_per_sec; 236 timeout = get_tb() + (u64) SMP_CALL_TIMEOUT * tb_ticks_per_sec;
228 237
229 /* Wait for response */ 238 /* Wait for indication that they have received the message */
230 while (atomic_read(&data.started) != cpus) { 239 while (atomic_read(&data.started) != num_cpus) {
231 HMT_low(); 240 HMT_low();
232 if (get_tb() >= timeout) { 241 if (get_tb() >= timeout) {
233 printk("smp_call_function on cpu %d: other cpus not " 242 printk("smp_call_function on cpu %d: other cpus not "
234 "responding (%d)\n", smp_processor_id(), 243 "responding (%d)\n", smp_processor_id(),
235 atomic_read(&data.started)); 244 atomic_read(&data.started));
236 debugger(NULL); 245 debugger(NULL);
237 goto out; 246 goto out;
238 } 247 }
239 } 248 }
240 249
250 /* optionally wait for the CPUs to complete */
241 if (wait) { 251 if (wait) {
242 while (atomic_read(&data.finished) != cpus) { 252 while (atomic_read(&data.finished) != num_cpus) {
243 HMT_low(); 253 HMT_low();
244 if (get_tb() >= timeout) { 254 if (get_tb() >= timeout) {
245 printk("smp_call_function on cpu %d: other " 255 printk("smp_call_function on cpu %d: other "
246 "cpus not finishing (%d/%d)\n", 256 "cpus not finishing (%d/%d)\n",
247 smp_processor_id(), 257 smp_processor_id(),
248 atomic_read(&data.finished), 258 atomic_read(&data.finished),
249 atomic_read(&data.started)); 259 atomic_read(&data.started));
250 debugger(NULL); 260 debugger(NULL);
251 goto out; 261 goto out;
252 } 262 }
@@ -262,8 +272,29 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
262 return ret; 272 return ret;
263} 273}
264 274
275int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
276 int wait)
277{
278 return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
279}
265EXPORT_SYMBOL(smp_call_function); 280EXPORT_SYMBOL(smp_call_function);
266 281
282int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
283 int wait)
284{
285 cpumask_t map=CPU_MASK_NONE;
286
287 if (!cpu_online(cpu))
288 return -EINVAL;
289
290 if (cpu == smp_processor_id())
291 return -EBUSY;
292
293 cpu_set(cpu, map);
294 return smp_call_function_map(func,info,nonatomic,wait,map);
295}
296EXPORT_SYMBOL(smp_call_function_single);
297
267void smp_call_function_interrupt(void) 298void smp_call_function_interrupt(void)
268{ 299{
269 void (*func) (void *info); 300 void (*func) (void *info);
diff --git a/arch/powerpc/kernel/swsusp.c b/arch/powerpc/kernel/swsusp.c
new file mode 100644
index 000000000000..064a7ba4f02c
--- /dev/null
+++ b/arch/powerpc/kernel/swsusp.c
@@ -0,0 +1,43 @@
1/*
2 * Common powerpc suspend code for 32 and 64 bits
3 *
4 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/sched.h>
13#include <asm/suspend.h>
14#include <asm/system.h>
15#include <asm/current.h>
16#include <asm/mmu_context.h>
17
18void save_processor_state(void)
19{
20 /*
21 * flush out all the special registers so we don't need
22 * to save them in the snapshot
23 */
24 flush_fp_to_thread(current);
25 flush_altivec_to_thread(current);
26 flush_spe_to_thread(current);
27
28#ifdef CONFIG_PPC64
29 hard_irq_disable();
30#endif
31
32}
33
34void restore_processor_state(void)
35{
36#ifdef CONFIG_PPC32
37 set_context(current->active_mm->context.id, current->active_mm->pgd);
38#endif
39
40#ifdef CONFIG_PPC64
41 hard_irq_enable();
42#endif
43}
diff --git a/arch/powerpc/kernel/swsusp_64.c b/arch/powerpc/kernel/swsusp_64.c
new file mode 100644
index 000000000000..6f3f0697274e
--- /dev/null
+++ b/arch/powerpc/kernel/swsusp_64.c
@@ -0,0 +1,24 @@
1/*
2 * PowerPC 64-bit swsusp implementation
3 *
4 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
5 *
6 * GPLv2
7 */
8
9#include <asm/system.h>
10#include <asm/iommu.h>
11#include <linux/irq.h>
12#include <linux/interrupt.h>
13
14void do_after_copyback(void)
15{
16 iommu_restore();
17 touch_softlockup_watchdog();
18 mb();
19}
20
21void _iommu_save(void)
22{
23 iommu_save();
24}
diff --git a/arch/powerpc/kernel/swsusp_asm64.S b/arch/powerpc/kernel/swsusp_asm64.S
new file mode 100644
index 000000000000..e092c3cbdb9b
--- /dev/null
+++ b/arch/powerpc/kernel/swsusp_asm64.S
@@ -0,0 +1,228 @@
1/*
2 * PowerPC 64-bit swsusp implementation
3 *
4 * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
5 *
6 * GPLv2
7 */
8
9#include <linux/threads.h>
10#include <asm/processor.h>
11#include <asm/page.h>
12#include <asm/cputable.h>
13#include <asm/thread_info.h>
14#include <asm/ppc_asm.h>
15#include <asm/asm-offsets.h>
16
17/*
18 * Structure for storing CPU registers on the save area.
19 */
20#define SL_r1 0x00 /* stack pointer */
21#define SL_PC 0x08
22#define SL_MSR 0x10
23#define SL_SDR1 0x18
24#define SL_XER 0x20
25#define SL_TB 0x40
26#define SL_r2 0x48
27#define SL_CR 0x50
28#define SL_LR 0x58
29#define SL_r12 0x60
30#define SL_r13 0x68
31#define SL_r14 0x70
32#define SL_r15 0x78
33#define SL_r16 0x80
34#define SL_r17 0x88
35#define SL_r18 0x90
36#define SL_r19 0x98
37#define SL_r20 0xa0
38#define SL_r21 0xa8
39#define SL_r22 0xb0
40#define SL_r23 0xb8
41#define SL_r24 0xc0
42#define SL_r25 0xc8
43#define SL_r26 0xd0
44#define SL_r27 0xd8
45#define SL_r28 0xe0
46#define SL_r29 0xe8
47#define SL_r30 0xf0
48#define SL_r31 0xf8
49#define SL_SIZE SL_r31+8
50
51/* these macros rely on the save area being
52 * pointed to by r11 */
53#define SAVE_SPECIAL(special) \
54 mf##special r0 ;\
55 std r0, SL_##special(r11)
56#define RESTORE_SPECIAL(special) \
57 ld r0, SL_##special(r11) ;\
58 mt##special r0
59#define SAVE_REGISTER(reg) \
60 std reg, SL_##reg(r11)
61#define RESTORE_REGISTER(reg) \
62 ld reg, SL_##reg(r11)
63
64/* space for storing cpu state */
65 .section .data
66 .align 5
67swsusp_save_area:
68 .space SL_SIZE
69
70 .section ".toc","aw"
71swsusp_save_area_ptr:
72 .tc swsusp_save_area[TC],swsusp_save_area
73restore_pblist_ptr:
74 .tc restore_pblist[TC],restore_pblist
75
76 .section .text
77 .align 5
78_GLOBAL(swsusp_arch_suspend)
79 ld r11,swsusp_save_area_ptr@toc(r2)
80 SAVE_SPECIAL(LR)
81 SAVE_REGISTER(r1)
82 SAVE_SPECIAL(CR)
83 SAVE_SPECIAL(TB)
84 SAVE_REGISTER(r2)
85 SAVE_REGISTER(r12)
86 SAVE_REGISTER(r13)
87 SAVE_REGISTER(r14)
88 SAVE_REGISTER(r15)
89 SAVE_REGISTER(r16)
90 SAVE_REGISTER(r17)
91 SAVE_REGISTER(r18)
92 SAVE_REGISTER(r19)
93 SAVE_REGISTER(r20)
94 SAVE_REGISTER(r21)
95 SAVE_REGISTER(r22)
96 SAVE_REGISTER(r23)
97 SAVE_REGISTER(r24)
98 SAVE_REGISTER(r25)
99 SAVE_REGISTER(r26)
100 SAVE_REGISTER(r27)
101 SAVE_REGISTER(r28)
102 SAVE_REGISTER(r29)
103 SAVE_REGISTER(r30)
104 SAVE_REGISTER(r31)
105 SAVE_SPECIAL(MSR)
106 SAVE_SPECIAL(SDR1)
107 SAVE_SPECIAL(XER)
108
109 /* we push the stack up 128 bytes but don't store the
110 * stack pointer on the stack like a real stackframe */
111 addi r1,r1,-128
112
113 bl _iommu_save
114 bl swsusp_save
115
116 /* restore LR */
117 ld r11,swsusp_save_area_ptr@toc(r2)
118 RESTORE_SPECIAL(LR)
119 addi r1,r1,128
120
121 blr
122
123/* Resume code */
124_GLOBAL(swsusp_arch_resume)
125 /* Stop pending alitvec streams and memory accesses */
126BEGIN_FTR_SECTION
127 DSSALL
128END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
129 sync
130
131 ld r12,restore_pblist_ptr@toc(r2)
132 ld r12,0(r12)
133
134 cmpdi r12,0
135 beq- nothing_to_copy
136 li r15,512
137copyloop:
138 ld r13,pbe_address(r12)
139 ld r14,pbe_orig_address(r12)
140
141 mtctr r15
142 li r10,0
143copy_page_loop:
144 ldx r0,r10,r13
145 stdx r0,r10,r14
146 addi r10,r10,8
147 bdnz copy_page_loop
148
149 ld r12,pbe_next(r12)
150 cmpdi r12,0
151 bne+ copyloop
152nothing_to_copy:
153
154 /* flush caches */
155 lis r3, 0x10
156 mtctr r3
157 li r3, 0
158 ori r3, r3, CONFIG_KERNEL_START>>48
159 li r0, 48
160 sld r3, r3, r0
161 li r0, 0
1621:
163 dcbf r0,r3
164 addi r3,r3,0x20
165 bdnz 1b
166
167 sync
168
169 tlbia
170
171 ld r11,swsusp_save_area_ptr@toc(r2)
172
173 RESTORE_SPECIAL(CR)
174
175 /* restore timebase */
176 /* load saved tb */
177 ld r1, SL_TB(r11)
178 /* get upper 32 bits of it */
179 srdi r2, r1, 32
180 /* clear tb lower to avoid wrap */
181 li r0, 0
182 mttbl r0
183 /* set tb upper */
184 mttbu r2
185 /* set tb lower */
186 mttbl r1
187
188 /* restore registers */
189 RESTORE_REGISTER(r1)
190 RESTORE_REGISTER(r2)
191 RESTORE_REGISTER(r12)
192 RESTORE_REGISTER(r13)
193 RESTORE_REGISTER(r14)
194 RESTORE_REGISTER(r15)
195 RESTORE_REGISTER(r16)
196 RESTORE_REGISTER(r17)
197 RESTORE_REGISTER(r18)
198 RESTORE_REGISTER(r19)
199 RESTORE_REGISTER(r20)
200 RESTORE_REGISTER(r21)
201 RESTORE_REGISTER(r22)
202 RESTORE_REGISTER(r23)
203 RESTORE_REGISTER(r24)
204 RESTORE_REGISTER(r25)
205 RESTORE_REGISTER(r26)
206 RESTORE_REGISTER(r27)
207 RESTORE_REGISTER(r28)
208 RESTORE_REGISTER(r29)
209 RESTORE_REGISTER(r30)
210 RESTORE_REGISTER(r31)
211 /* can't use RESTORE_SPECIAL(MSR) */
212 ld r0, SL_MSR(r11)
213 mtmsrd r0, 0
214 RESTORE_SPECIAL(SDR1)
215 RESTORE_SPECIAL(XER)
216
217 sync
218
219 addi r1,r1,-128
220 bl slb_flush_and_rebolt
221 bl do_after_copyback
222 addi r1,r1,128
223
224 ld r11,swsusp_save_area_ptr@toc(r2)
225 RESTORE_SPECIAL(LR)
226
227 li r3, 0
228 blr
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 933e214c33e8..cae39d9dfe48 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -499,4 +499,4 @@ static int __init topology_init(void)
499 499
500 return 0; 500 return 0;
501} 501}
502__initcall(topology_init); 502subsys_initcall(topology_init);
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index b2c1b67a10a7..62c1bc12ea39 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -117,7 +117,7 @@ static const struct vio_device_id *vio_match_device(
117{ 117{
118 while (ids->type[0] != '\0') { 118 while (ids->type[0] != '\0') {
119 if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) && 119 if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
120 device_is_compatible(dev->dev.archdata.of_node, 120 of_device_is_compatible(dev->dev.archdata.of_node,
121 ids->compat)) 121 ids->compat))
122 return ids; 122 return ids;
123 ids++; 123 ids++;
diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c
index 0a0a0487b334..ca4dcb07a939 100644
--- a/arch/powerpc/mm/44x_mmu.c
+++ b/arch/powerpc/mm/44x_mmu.c
@@ -24,73 +24,38 @@
24 * 24 *
25 */ 25 */
26 26
27#include <linux/signal.h>
28#include <linux/sched.h>
29#include <linux/kernel.h>
30#include <linux/errno.h>
31#include <linux/string.h>
32#include <linux/types.h>
33#include <linux/ptrace.h>
34#include <linux/mman.h>
35#include <linux/mm.h>
36#include <linux/swap.h>
37#include <linux/stddef.h>
38#include <linux/vmalloc.h>
39#include <linux/init.h> 27#include <linux/init.h>
40#include <linux/delay.h>
41#include <linux/highmem.h>
42
43#include <asm/pgalloc.h>
44#include <asm/prom.h>
45#include <asm/io.h>
46#include <asm/mmu_context.h>
47#include <asm/pgtable.h>
48#include <asm/mmu.h> 28#include <asm/mmu.h>
49#include <asm/uaccess.h> 29#include <asm/system.h>
50#include <asm/smp.h> 30#include <asm/page.h>
51#include <asm/bootx.h>
52#include <asm/machdep.h>
53#include <asm/setup.h>
54 31
55#include "mmu_decl.h" 32#include "mmu_decl.h"
56 33
57extern char etext[], _stext[];
58
59/* Used by the 44x TLB replacement exception handler. 34/* Used by the 44x TLB replacement exception handler.
60 * Just needed it declared someplace. 35 * Just needed it declared someplace.
61 */ 36 */
62unsigned int tlb_44x_index = 0; 37unsigned int tlb_44x_index; /* = 0 */
63unsigned int tlb_44x_hwater = 62; 38unsigned int tlb_44x_hwater = PPC44x_TLB_SIZE - 1 - PPC44x_EARLY_TLBS;
64 39
65/* 40/*
66 * "Pins" a 256MB TLB entry in AS0 for kernel lowmem 41 * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
67 */ 42 */
68static void __init 43static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
69ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
70{ 44{
71 unsigned long attrib = 0; 45 __asm__ __volatile__(
72 46 "tlbwe %2,%3,%4\n"
73 __asm__ __volatile__("\ 47 "tlbwe %1,%3,%5\n"
74 clrrwi %2,%2,10\n\ 48 "tlbwe %0,%3,%6\n"
75 ori %2,%2,%4\n\
76 clrrwi %1,%1,10\n\
77 li %0,0\n\
78 ori %0,%0,%5\n\
79 tlbwe %2,%3,%6\n\
80 tlbwe %1,%3,%7\n\
81 tlbwe %0,%3,%8"
82 : 49 :
83 : "r" (attrib), "r" (phys), "r" (virt), "r" (slot), 50 : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
84 "i" (PPC44x_TLB_VALID | PPC44x_TLB_256M), 51 "r" (phys),
85 "i" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G), 52 "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
53 "r" (tlb_44x_hwater--), /* slot for this TLB entry */
86 "i" (PPC44x_TLB_PAGEID), 54 "i" (PPC44x_TLB_PAGEID),
87 "i" (PPC44x_TLB_XLAT), 55 "i" (PPC44x_TLB_XLAT),
88 "i" (PPC44x_TLB_ATTRIB)); 56 "i" (PPC44x_TLB_ATTRIB));
89} 57}
90 58
91/*
92 * MMU_init_hw does the chip-specific initialization of the MMU hardware.
93 */
94void __init MMU_init_hw(void) 59void __init MMU_init_hw(void)
95{ 60{
96 flush_instruction_cache(); 61 flush_instruction_cache();
@@ -98,22 +63,13 @@ void __init MMU_init_hw(void)
98 63
99unsigned long __init mmu_mapin_ram(void) 64unsigned long __init mmu_mapin_ram(void)
100{ 65{
101 unsigned int pinned_tlbs = 1; 66 unsigned long addr;
102 int i;
103
104 /* Determine number of entries necessary to cover lowmem */
105 pinned_tlbs = (unsigned int)
106 (_ALIGN(total_lowmem, PPC_PIN_SIZE) >> PPC44x_PIN_SHIFT);
107
108 /* Write upper watermark to save location */
109 tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
110 67
111 /* If necessary, set additional pinned TLBs */ 68 /* Pin in enough TLBs to cover any lowmem not covered by the
112 if (pinned_tlbs > 1) 69 * initial 256M mapping established in head_44x.S */
113 for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) { 70 for (addr = PPC_PIN_SIZE; addr < total_lowmem;
114 unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC_PIN_SIZE; 71 addr += PPC_PIN_SIZE)
115 ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr); 72 ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
116 }
117 73
118 return total_lowmem; 74 return total_lowmem;
119} 75}
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 03aeb3a46077..a0f88026e464 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -39,37 +39,26 @@
39#include <asm/kdebug.h> 39#include <asm/kdebug.h>
40#include <asm/siginfo.h> 40#include <asm/siginfo.h>
41 41
42#ifdef CONFIG_KPROBES
43ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
44 42
45/* Hook to register for page fault notifications */ 43#ifdef CONFIG_KPROBES
46int register_page_fault_notifier(struct notifier_block *nb) 44static inline int notify_page_fault(struct pt_regs *regs)
47{
48 return atomic_notifier_chain_register(&notify_page_fault_chain, nb);
49}
50
51int unregister_page_fault_notifier(struct notifier_block *nb)
52{ 45{
53 return atomic_notifier_chain_unregister(&notify_page_fault_chain, nb); 46 int ret = 0;
54} 47
48 /* kprobe_running() needs smp_processor_id() */
49 if (!user_mode(regs)) {
50 preempt_disable();
51 if (kprobe_running() && kprobe_fault_handler(regs, 11))
52 ret = 1;
53 preempt_enable();
54 }
55 55
56static inline int notify_page_fault(enum die_val val, const char *str, 56 return ret;
57 struct pt_regs *regs, long err, int trap, int sig)
58{
59 struct die_args args = {
60 .regs = regs,
61 .str = str,
62 .err = err,
63 .trapnr = trap,
64 .signr = sig
65 };
66 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
67} 57}
68#else 58#else
69static inline int notify_page_fault(enum die_val val, const char *str, 59static inline int notify_page_fault(struct pt_regs *regs)
70 struct pt_regs *regs, long err, int trap, int sig)
71{ 60{
72 return NOTIFY_DONE; 61 return 0;
73} 62}
74#endif 63#endif
75 64
@@ -175,8 +164,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
175 is_write = error_code & ESR_DST; 164 is_write = error_code & ESR_DST;
176#endif /* CONFIG_4xx || CONFIG_BOOKE */ 165#endif /* CONFIG_4xx || CONFIG_BOOKE */
177 166
178 if (notify_page_fault(DIE_PAGE_FAULT, "page_fault", regs, error_code, 167 if (notify_page_fault(regs))
179 11, SIGSEGV) == NOTIFY_STOP)
180 return 0; 168 return 0;
181 169
182 if (trap == 0x300) { 170 if (trap == 0x300) {
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 79aedaf36f2b..7b7fe2d7b9dc 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -26,6 +26,7 @@
26#include <asm/tlb.h> 26#include <asm/tlb.h>
27#include <asm/cputable.h> 27#include <asm/cputable.h>
28#include <asm/udbg.h> 28#include <asm/udbg.h>
29#include <asm/kexec.h>
29 30
30#ifdef DEBUG_LOW 31#ifdef DEBUG_LOW
31#define DBG_LOW(fmt...) udbg_printf(fmt) 32#define DBG_LOW(fmt...) udbg_printf(fmt)
@@ -340,31 +341,70 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long va,
340 local_irq_restore(flags); 341 local_irq_restore(flags);
341} 342}
342 343
343/* 344#define LP_SHIFT 12
344 * XXX This need fixing based on page size. It's only used by 345#define LP_BITS 8
345 * native_hpte_clear() for now which needs fixing too so they 346#define LP_MASK(i) ((0xFF >> (i)) << LP_SHIFT)
346 * make a good pair...
347 */
348static unsigned long slot2va(unsigned long hpte_v, unsigned long slot)
349{
350 unsigned long avpn = HPTE_V_AVPN_VAL(hpte_v);
351 unsigned long va;
352 347
353 va = avpn << 23; 348static void hpte_decode(hpte_t *hpte, unsigned long slot,
349 int *psize, unsigned long *va)
350{
351 unsigned long hpte_r = hpte->r;
352 unsigned long hpte_v = hpte->v;
353 unsigned long avpn;
354 int i, size, shift, penc, avpnm_bits;
355
356 if (!(hpte_v & HPTE_V_LARGE))
357 size = MMU_PAGE_4K;
358 else {
359 for (i = 0; i < LP_BITS; i++) {
360 if ((hpte_r & LP_MASK(i+1)) == LP_MASK(i+1))
361 break;
362 }
363 penc = LP_MASK(i+1) >> LP_SHIFT;
364 for (size = 0; size < MMU_PAGE_COUNT; size++) {
354 365
355 if (! (hpte_v & HPTE_V_LARGE)) { 366 /* 4K pages are not represented by LP */
356 unsigned long vpi, pteg; 367 if (size == MMU_PAGE_4K)
368 continue;
357 369
358 pteg = slot / HPTES_PER_GROUP; 370 /* valid entries have a shift value */
359 if (hpte_v & HPTE_V_SECONDARY) 371 if (!mmu_psize_defs[size].shift)
360 pteg = ~pteg; 372 continue;
361 373
362 vpi = ((va >> 28) ^ pteg) & htab_hash_mask; 374 if (penc == mmu_psize_defs[size].penc)
375 break;
376 }
377 }
363 378
364 va |= vpi << PAGE_SHIFT; 379 /*
380 * FIXME, the code below works for 16M, 64K, and 4K pages as these
381 * fall under the p<=23 rules for calculating the virtual address.
382 * In the case of 16M pages, an extra bit is stolen from the AVPN
383 * field to achieve the requisite 24 bits.
384 *
385 * Does not work for 16G pages or 1 TB segments.
386 */
387 shift = mmu_psize_defs[size].shift;
388 if (mmu_psize_defs[size].avpnm)
389 avpnm_bits = __ilog2_u64(mmu_psize_defs[size].avpnm) + 1;
390 else
391 avpnm_bits = 0;
392 if (shift - avpnm_bits <= 23) {
393 avpn = HPTE_V_AVPN_VAL(hpte_v) << 23;
394
395 if (shift < 23) {
396 unsigned long vpi, pteg;
397
398 pteg = slot / HPTES_PER_GROUP;
399 if (hpte_v & HPTE_V_SECONDARY)
400 pteg = ~pteg;
401 vpi = ((avpn >> 28) ^ pteg) & htab_hash_mask;
402 avpn |= (vpi << mmu_psize_defs[size].shift);
403 }
365 } 404 }
366 405
367 return va; 406 *va = avpn;
407 *psize = size;
368} 408}
369 409
370/* 410/*
@@ -374,15 +414,14 @@ static unsigned long slot2va(unsigned long hpte_v, unsigned long slot)
374 * 414 *
375 * TODO: add batching support when enabled. remember, no dynamic memory here, 415 * TODO: add batching support when enabled. remember, no dynamic memory here,
376 * athough there is the control page available... 416 * athough there is the control page available...
377 *
378 * XXX FIXME: 4k only for now !
379 */ 417 */
380static void native_hpte_clear(void) 418static void native_hpte_clear(void)
381{ 419{
382 unsigned long slot, slots, flags; 420 unsigned long slot, slots, flags;
383 hpte_t *hptep = htab_address; 421 hpte_t *hptep = htab_address;
384 unsigned long hpte_v; 422 unsigned long hpte_v, va;
385 unsigned long pteg_count; 423 unsigned long pteg_count;
424 int psize;
386 425
387 pteg_count = htab_hash_mask + 1; 426 pteg_count = htab_hash_mask + 1;
388 427
@@ -408,8 +447,9 @@ static void native_hpte_clear(void)
408 * already hold the native_tlbie_lock. 447 * already hold the native_tlbie_lock.
409 */ 448 */
410 if (hpte_v & HPTE_V_VALID) { 449 if (hpte_v & HPTE_V_VALID) {
450 hpte_decode(hptep, slot, &psize, &va);
411 hptep->v = 0; 451 hptep->v = 0;
412 __tlbie(slot2va(hpte_v, slot), MMU_PAGE_4K); 452 __tlbie(va, psize);
413 } 453 }
414 } 454 }
415 455
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 49618461defb..9b226fa7006f 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -103,7 +103,7 @@ int mmu_ci_restrictions;
103#ifdef CONFIG_DEBUG_PAGEALLOC 103#ifdef CONFIG_DEBUG_PAGEALLOC
104static u8 *linear_map_hash_slots; 104static u8 *linear_map_hash_slots;
105static unsigned long linear_map_hash_count; 105static unsigned long linear_map_hash_count;
106static spinlock_t linear_map_hash_lock; 106static DEFINE_SPINLOCK(linear_map_hash_lock);
107#endif /* CONFIG_DEBUG_PAGEALLOC */ 107#endif /* CONFIG_DEBUG_PAGEALLOC */
108 108
109/* There are definitions of page sizes arrays to be used when none 109/* There are definitions of page sizes arrays to be used when none
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index c4bcd7546424..1a6e08f3298f 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -80,7 +80,6 @@ int page_is_ram(unsigned long pfn)
80 return 0; 80 return 0;
81#endif 81#endif
82} 82}
83EXPORT_SYMBOL(page_is_ram);
84 83
85pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 84pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
86 unsigned long size, pgprot_t vma_prot) 85 unsigned long size, pgprot_t vma_prot)
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index 9c4538bb04b0..2558c34eedaa 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -40,7 +40,8 @@ extern int __map_without_bats;
40extern unsigned long ioremap_base; 40extern unsigned long ioremap_base;
41extern unsigned int rtas_data, rtas_size; 41extern unsigned int rtas_data, rtas_size;
42 42
43extern PTE *Hash, *Hash_end; 43struct _PTE;
44extern struct _PTE *Hash, *Hash_end;
44extern unsigned long Hash_size, Hash_mask; 45extern unsigned long Hash_size, Hash_mask;
45 46
46extern unsigned int num_tlbcam_entries; 47extern unsigned int num_tlbcam_entries;
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c
index eeeacab548e6..132c6bc66ce1 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -227,7 +227,7 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
227 * the first (bolted) segment, so that do_stab_bolted won't get a 227 * the first (bolted) segment, so that do_stab_bolted won't get a
228 * recursive segment miss on the segment table itself. 228 * recursive segment miss on the segment table itself.
229 */ 229 */
230void stabs_alloc(void) 230void __init stabs_alloc(void)
231{ 231{
232 int cpu; 232 int cpu;
233 233
diff --git a/arch/powerpc/platforms/52xx/Kconfig b/arch/powerpc/platforms/52xx/Kconfig
index bc4aa4a80a12..3ffaa066c2c8 100644
--- a/arch/powerpc/platforms/52xx/Kconfig
+++ b/arch/powerpc/platforms/52xx/Kconfig
@@ -1,5 +1,6 @@
1config PPC_MPC52xx 1config PPC_MPC52xx
2 bool 2 bool
3 select FSL_SOC
3 default n 4 default n
4 5
5config PPC_MPC5200 6config PPC_MPC5200
diff --git a/arch/powerpc/platforms/52xx/Makefile b/arch/powerpc/platforms/52xx/Makefile
index 07cdbcacf156..b91e39c84d46 100644
--- a/arch/powerpc/platforms/52xx/Makefile
+++ b/arch/powerpc/platforms/52xx/Makefile
@@ -8,3 +8,5 @@ endif
8 8
9obj-$(CONFIG_PPC_EFIKA) += efika.o 9obj-$(CONFIG_PPC_EFIKA) += efika.o
10obj-$(CONFIG_PPC_LITE5200) += lite5200.o 10obj-$(CONFIG_PPC_LITE5200) += lite5200.o
11
12obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index a6bba97314eb..f591a9fc19b9 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -184,6 +184,16 @@ static void efika_show_cpuinfo(struct seq_file *m)
184 of_node_put(root); 184 of_node_put(root);
185} 185}
186 186
187#ifdef CONFIG_PM
188static void efika_suspend_prepare(void __iomem *mbar)
189{
190 u8 pin = 4; /* GPIO_WKUP_4 (GPIO_PSC6_0 - IRDA_RX) */
191 u8 level = 1; /* wakeup on high level */
192 /* IOW. to wake it up, short pins 1 and 3 on IRDA connector */
193 mpc52xx_set_wakeup_gpio(pin, level);
194}
195#endif
196
187static void __init efika_setup_arch(void) 197static void __init efika_setup_arch(void)
188{ 198{
189 rtas_initialize(); 199 rtas_initialize();
@@ -199,6 +209,11 @@ static void __init efika_setup_arch(void)
199 209
200 efika_pcisetup(); 210 efika_pcisetup();
201 211
212#ifdef CONFIG_PM
213 mpc52xx_suspend.board_suspend_prepare = efika_suspend_prepare;
214 mpc52xx_pm_init();
215#endif
216
202 if (ppc_md.progress) 217 if (ppc_md.progress)
203 ppc_md.progress("Linux/PPC " UTS_RELEASE " running on Efika ;-)\n", 0x0); 218 ppc_md.progress("Linux/PPC " UTS_RELEASE " running on Efika ;-)\n", 0x0);
204} 219}
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 8e2646ac417b..1cfc00dfb99a 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -85,6 +85,28 @@ error:
85 iounmap(gpio); 85 iounmap(gpio);
86} 86}
87 87
88#ifdef CONFIG_PM
89static u32 descr_a;
90static void lite5200_suspend_prepare(void __iomem *mbar)
91{
92 u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */
93 u8 level = 0; /* wakeup on low level */
94 mpc52xx_set_wakeup_gpio(pin, level);
95
96 /*
97 * power down usb port
98 * this needs to be called before of-ohci suspend code
99 */
100 descr_a = in_be32(mbar + 0x1048);
101 out_be32(mbar + 0x1048, (descr_a & ~0x200) | 0x100);
102}
103
104static void lite5200_resume_finish(void __iomem *mbar)
105{
106 out_be32(mbar + 0x1048, descr_a);
107}
108#endif
109
88static void __init lite5200_setup_arch(void) 110static void __init lite5200_setup_arch(void)
89{ 111{
90 struct device_node *np; 112 struct device_node *np;
@@ -107,6 +129,12 @@ static void __init lite5200_setup_arch(void)
107 mpc52xx_setup_cpu(); /* Generic */ 129 mpc52xx_setup_cpu(); /* Generic */
108 lite5200_setup_cpu(); /* Platorm specific */ 130 lite5200_setup_cpu(); /* Platorm specific */
109 131
132#ifdef CONFIG_PM
133 mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
134 mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
135 mpc52xx_pm_init();
136#endif
137
110#ifdef CONFIG_PCI 138#ifdef CONFIG_PCI
111 np = of_find_node_by_type(NULL, "pci"); 139 np = of_find_node_by_type(NULL, "pci");
112 if (np) { 140 if (np) {
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
new file mode 100644
index 000000000000..fd40044d16cd
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -0,0 +1,191 @@
1#include <linux/init.h>
2#include <linux/pm.h>
3#include <linux/io.h>
4#include <asm/time.h>
5#include <asm/cacheflush.h>
6#include <asm/mpc52xx.h>
7
8#include "mpc52xx_pic.h"
9
10
11/* these are defined in mpc52xx_sleep.S, and only used here */
12extern void mpc52xx_deep_sleep(void *sram, void *sdram_regs,
13 struct mpc52xx_cdm *, struct mpc52xx_intr *);
14extern void mpc52xx_ds_sram(void);
15extern const long mpc52xx_ds_sram_size;
16extern void mpc52xx_ds_cached(void);
17extern const long mpc52xx_ds_cached_size;
18
19static void __iomem *mbar;
20static void __iomem *sdram;
21static struct mpc52xx_cdm __iomem *cdm;
22static struct mpc52xx_intr __iomem *intr;
23static struct mpc52xx_gpio_wkup __iomem *gpiow;
24static void *sram;
25static int sram_size;
26
27struct mpc52xx_suspend mpc52xx_suspend;
28
29static int mpc52xx_pm_valid(suspend_state_t state)
30{
31 switch (state) {
32 case PM_SUSPEND_STANDBY:
33 return 1;
34 default:
35 return 0;
36 }
37}
38
39int mpc52xx_set_wakeup_gpio(u8 pin, u8 level)
40{
41 u16 tmp;
42
43 /* enable gpio */
44 out_8(&gpiow->wkup_gpioe, in_8(&gpiow->wkup_gpioe) | (1 << pin));
45 /* set as input */
46 out_8(&gpiow->wkup_ddr, in_8(&gpiow->wkup_ddr) & ~(1 << pin));
47 /* enable deep sleep interrupt */
48 out_8(&gpiow->wkup_inten, in_8(&gpiow->wkup_inten) | (1 << pin));
49 /* low/high level creates wakeup interrupt */
50 tmp = in_be16(&gpiow->wkup_itype);
51 tmp &= ~(0x3 << (pin * 2));
52 tmp |= (!level + 1) << (pin * 2);
53 out_be16(&gpiow->wkup_itype, tmp);
54 /* master enable */
55 out_8(&gpiow->wkup_maste, 1);
56
57 return 0;
58}
59
60int mpc52xx_pm_prepare(suspend_state_t state)
61{
62 if (state != PM_SUSPEND_STANDBY)
63 return -EINVAL;
64
65 /* map the whole register space */
66 mbar = mpc52xx_find_and_map("mpc5200");
67 if (!mbar) {
68 printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
69 return -ENOSYS;
70 }
71 /* these offsets are from mpc5200 users manual */
72 sdram = mbar + 0x100;
73 cdm = mbar + 0x200;
74 intr = mbar + 0x500;
75 gpiow = mbar + 0xc00;
76 sram = mbar + 0x8000; /* Those will be handled by the */
77 sram_size = 0x4000; /* bestcomm driver soon */
78
79 /* call board suspend code, if applicable */
80 if (mpc52xx_suspend.board_suspend_prepare)
81 mpc52xx_suspend.board_suspend_prepare(mbar);
82 else {
83 printk(KERN_ALERT "%s: %i don't know how to wake up the board\n",
84 __func__, __LINE__);
85 goto out_unmap;
86 }
87
88 return 0;
89
90 out_unmap:
91 iounmap(mbar);
92 return -ENOSYS;
93}
94
95
96char saved_sram[0x4000];
97
98int mpc52xx_pm_enter(suspend_state_t state)
99{
100 u32 clk_enables;
101 u32 msr, hid0;
102 u32 intr_main_mask;
103 void __iomem * irq_0x500 = (void *)CONFIG_KERNEL_START + 0x500;
104 unsigned long irq_0x500_stop = (unsigned long)irq_0x500 + mpc52xx_ds_cached_size;
105 char saved_0x500[mpc52xx_ds_cached_size];
106
107 /* disable all interrupts in PIC */
108 intr_main_mask = in_be32(&intr->main_mask);
109 out_be32(&intr->main_mask, intr_main_mask | 0x1ffff);
110
111 /* don't let DEC expire any time soon */
112 mtspr(SPRN_DEC, 0x7fffffff);
113
114 /* save SRAM */
115 memcpy(saved_sram, sram, sram_size);
116
117 /* copy low level suspend code to sram */
118 memcpy(sram, mpc52xx_ds_sram, mpc52xx_ds_sram_size);
119
120 out_8(&cdm->ccs_sleep_enable, 1);
121 out_8(&cdm->osc_sleep_enable, 1);
122 out_8(&cdm->ccs_qreq_test, 1);
123
124 /* disable all but SDRAM and bestcomm (SRAM) clocks */
125 clk_enables = in_be32(&cdm->clk_enables);
126 out_be32(&cdm->clk_enables, clk_enables & 0x00088000);
127
128 /* disable power management */
129 msr = mfmsr();
130 mtmsr(msr & ~MSR_POW);
131
132 /* enable sleep mode, disable others */
133 hid0 = mfspr(SPRN_HID0);
134 mtspr(SPRN_HID0, (hid0 & ~(HID0_DOZE | HID0_NAP | HID0_DPM)) | HID0_SLEEP);
135
136 /* save original, copy our irq handler, flush from dcache and invalidate icache */
137 memcpy(saved_0x500, irq_0x500, mpc52xx_ds_cached_size);
138 memcpy(irq_0x500, mpc52xx_ds_cached, mpc52xx_ds_cached_size);
139 flush_icache_range((unsigned long)irq_0x500, irq_0x500_stop);
140
141 /* call low-level sleep code */
142 mpc52xx_deep_sleep(sram, sdram, cdm, intr);
143
144 /* restore original irq handler */
145 memcpy(irq_0x500, saved_0x500, mpc52xx_ds_cached_size);
146 flush_icache_range((unsigned long)irq_0x500, irq_0x500_stop);
147
148 /* restore old power mode */
149 mtmsr(msr & ~MSR_POW);
150 mtspr(SPRN_HID0, hid0);
151 mtmsr(msr);
152
153 out_be32(&cdm->clk_enables, clk_enables);
154 out_8(&cdm->ccs_sleep_enable, 0);
155 out_8(&cdm->osc_sleep_enable, 0);
156
157 /* restore SRAM */
158 memcpy(sram, saved_sram, sram_size);
159
160 /* restart jiffies */
161 wakeup_decrementer();
162
163 /* reenable interrupts in PIC */
164 out_be32(&intr->main_mask, intr_main_mask);
165
166 return 0;
167}
168
169int mpc52xx_pm_finish(suspend_state_t state)
170{
171 /* call board resume code */
172 if (mpc52xx_suspend.board_resume_finish)
173 mpc52xx_suspend.board_resume_finish(mbar);
174
175 iounmap(mbar);
176
177 return 0;
178}
179
180static struct pm_ops mpc52xx_pm_ops = {
181 .valid = mpc52xx_pm_valid,
182 .prepare = mpc52xx_pm_prepare,
183 .enter = mpc52xx_pm_enter,
184 .finish = mpc52xx_pm_finish,
185};
186
187int __init mpc52xx_pm_init(void)
188{
189 pm_set_ops(&mpc52xx_pm_ops);
190 return 0;
191}
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_sleep.S b/arch/powerpc/platforms/52xx/mpc52xx_sleep.S
new file mode 100644
index 000000000000..4dc170b0ae18
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/mpc52xx_sleep.S
@@ -0,0 +1,154 @@
1#include <asm/reg.h>
2#include <asm/ppc_asm.h>
3#include <asm/processor.h>
4
5
6.text
7
8_GLOBAL(mpc52xx_deep_sleep)
9mpc52xx_deep_sleep: /* args r3-r6: SRAM, SDRAM regs, CDM regs, INTR regs */
10
11 /* enable interrupts */
12 mfmsr r7
13 ori r7, r7, 0x8000 /* EE */
14 mtmsr r7
15 sync; isync;
16
17 li r10, 0 /* flag that irq handler sets */
18
19 /* enable tmr7 (or any other) interrupt */
20 lwz r8, 0x14(r6) /* intr->main_mask */
21 ori r8, r8, 0x1
22 xori r8, r8, 0x1
23 stw r8, 0x14(r6)
24 sync
25
26 /* emulate tmr7 interrupt */
27 li r8, 0x1
28 stw r8, 0x40(r6) /* intr->main_emulate */
29 sync
30
31 /* wait for it to happen */
321:
33 cmpi cr0, r10, 1
34 bne cr0, 1b
35
36 /* lock icache */
37 mfspr r10, SPRN_HID0
38 ori r10, r10, 0x2000
39 sync; isync;
40 mtspr SPRN_HID0, r10
41 sync; isync;
42
43
44 mflr r9 /* save LR */
45
46 /* jump to sram */
47 mtlr r3
48 blrl
49
50 mtlr r9 /* restore LR */
51
52 /* unlock icache */
53 mfspr r10, SPRN_HID0
54 ori r10, r10, 0x2000
55 xori r10, r10, 0x2000
56 sync; isync;
57 mtspr SPRN_HID0, r10
58 sync; isync;
59
60
61 /* return to C code */
62 blr
63
64
65_GLOBAL(mpc52xx_ds_sram)
66mpc52xx_ds_sram:
67 /* put SDRAM into self-refresh */
68 lwz r8, 0x4(r4) /* sdram->ctrl */
69
70 oris r8, r8, 0x8000 /* mode_en */
71 stw r8, 0x4(r4)
72 sync
73
74 ori r8, r8, 0x0002 /* soft_pre */
75 stw r8, 0x4(r4)
76 sync
77 xori r8, r8, 0x0002
78
79 xoris r8, r8, 0x8000 /* !mode_en */
80 stw r8, 0x4(r4)
81 sync
82
83 oris r8, r8, 0x5000
84 xoris r8, r8, 0x4000 /* ref_en !cke */
85 stw r8, 0x4(r4)
86 sync
87
88 /* disable SDRAM clock */
89 lwz r8, 0x14(r5) /* cdm->clkenable */
90 ori r8, r8, 0x0008
91 xori r8, r8, 0x0008
92 stw r8, 0x14(r5)
93 sync
94
95
96 /* put mpc5200 to sleep */
97 mfmsr r10
98 oris r10, r10, 0x0004 /* POW = 1 */
99 sync; isync;
100 mtmsr r10
101 sync; isync;
102
103
104 /* enable clock */
105 lwz r8, 0x14(r5)
106 ori r8, r8, 0x0008
107 stw r8, 0x14(r5)
108 sync
109
110 /* get ram out of self-refresh */
111 lwz r8, 0x4(r4)
112 oris r8, r8, 0x5000 /* cke ref_en */
113 stw r8, 0x4(r4)
114 sync
115
116 blr
117_GLOBAL(mpc52xx_ds_sram_size)
118mpc52xx_ds_sram_size:
119 .long $-mpc52xx_ds_sram
120
121
122/* ### interrupt handler for wakeup from deep-sleep ### */
123_GLOBAL(mpc52xx_ds_cached)
124mpc52xx_ds_cached:
125 mtspr SPRN_SPRG0, r7
126 mtspr SPRN_SPRG1, r8
127
128 /* disable emulated interrupt */
129 mfspr r7, 311 /* MBAR */
130 addi r7, r7, 0x540 /* intr->main_emul */
131 li r8, 0
132 stw r8, 0(r7)
133 sync
134 dcbf 0, r7
135
136 /* acknowledge wakeup, so CCS releases power pown */
137 mfspr r7, 311 /* MBAR */
138 addi r7, r7, 0x524 /* intr->enc_status */
139 lwz r8, 0(r7)
140 ori r8, r8, 0x0400
141 stw r8, 0(r7)
142 sync
143 dcbf 0, r7
144
145 /* flag - we handled the interrupt */
146 li r10, 1
147
148 mfspr r8, SPRN_SPRG1
149 mfspr r7, SPRN_SPRG0
150
151 rfi
152_GLOBAL(mpc52xx_ds_cached_size)
153mpc52xx_ds_cached_size:
154 .long $-mpc52xx_ds_cached
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index fff09f5d6edf..94843ed52a93 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -111,6 +111,7 @@ static struct of_device_id mpc832x_ids[] = {
111 { .type = "soc", }, 111 { .type = "soc", },
112 { .compatible = "soc", }, 112 { .compatible = "soc", },
113 { .type = "qe", }, 113 { .type = "qe", },
114 { .type = "mdio", },
114 {}, 115 {},
115}; 116};
116 117
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 6b71e9ffb11a..b0b22bb29de7 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -73,6 +73,7 @@ static struct of_device_id mpc832x_ids[] = {
73 { .type = "soc", }, 73 { .type = "soc", },
74 { .compatible = "soc", }, 74 { .compatible = "soc", },
75 { .type = "qe", }, 75 { .type = "qe", },
76 { .type = "mdio", },
76 {}, 77 {},
77}; 78};
78 79
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 526ed090a446..bceeff8bbfd2 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -118,6 +118,7 @@ static struct of_device_id mpc836x_ids[] = {
118 { .type = "soc", }, 118 { .type = "soc", },
119 { .compatible = "soc", }, 119 { .compatible = "soc", },
120 { .type = "qe", }, 120 { .type = "qe", },
121 { .type = "mdio", },
121 {}, 122 {},
122}; 123};
123 124
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc8544_ds.c
index 2867f85e6325..bec84ffe708e 100644
--- a/arch/powerpc/platforms/85xx/mpc8544_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8544_ds.c
@@ -84,7 +84,7 @@ void __init mpc8544_ds_pic_init(void)
84#ifdef CONFIG_PPC_I8259 84#ifdef CONFIG_PPC_I8259
85 /* Initialize the i8259 controller */ 85 /* Initialize the i8259 controller */
86 for_each_node_by_type(np, "interrupt-controller") 86 for_each_node_by_type(np, "interrupt-controller")
87 if (device_is_compatible(np, "chrp,iic")) { 87 if (of_device_is_compatible(np, "chrp,iic")) {
88 cascade_node = np; 88 cascade_node = np;
89 break; 89 break;
90 } 90 }
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 7e71636f9098..1490eb3ce0d3 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -197,7 +197,7 @@ static void __init mpc85xx_cds_pic_init(void)
197#ifdef CONFIG_PPC_I8259 197#ifdef CONFIG_PPC_I8259
198 /* Initialize the i8259 controller */ 198 /* Initialize the i8259 controller */
199 for_each_node_by_type(np, "interrupt-controller") 199 for_each_node_by_type(np, "interrupt-controller")
200 if (device_is_compatible(np, "chrp,iic")) { 200 if (of_device_is_compatible(np, "chrp,iic")) {
201 cascade_node = np; 201 cascade_node = np;
202 break; 202 break;
203 } 203 }
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 54db41689954..e3dddbfe66ff 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -147,6 +147,7 @@ static struct of_device_id mpc85xx_ids[] = {
147 { .type = "soc", }, 147 { .type = "soc", },
148 { .compatible = "soc", }, 148 { .compatible = "soc", },
149 { .type = "qe", }, 149 { .type = "qe", },
150 { .type = "mdio", },
150 {}, 151 {},
151}; 152};
152 153
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 3d3d98f5bd4a..90877565caa3 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -102,7 +102,7 @@ mpc86xx_hpcn_init_irq(void)
102#ifdef CONFIG_PCI 102#ifdef CONFIG_PCI
103 /* Initialize i8259 controller */ 103 /* Initialize i8259 controller */
104 for_each_node_by_type(np, "interrupt-controller") 104 for_each_node_by_type(np, "interrupt-controller")
105 if (device_is_compatible(np, "chrp,iic")) { 105 if (of_device_is_compatible(np, "chrp,iic")) {
106 cascade_node = np; 106 cascade_node = np;
107 break; 107 break;
108 } 108 }
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 4fc4e92775d0..47264e722029 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -227,7 +227,7 @@ void iic_request_IPIs(void)
227 227
228static int iic_host_match(struct irq_host *h, struct device_node *node) 228static int iic_host_match(struct irq_host *h, struct device_node *node)
229{ 229{
230 return device_is_compatible(node, 230 return of_device_is_compatible(node,
231 "IBM,CBEA-Internal-Interrupt-Controller"); 231 "IBM,CBEA-Internal-Interrupt-Controller");
232} 232}
233 233
@@ -256,7 +256,7 @@ static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
256 unsigned int node, ext, unit, class; 256 unsigned int node, ext, unit, class;
257 const u32 *val; 257 const u32 *val;
258 258
259 if (!device_is_compatible(ct, 259 if (!of_device_is_compatible(ct,
260 "IBM,CBEA-Internal-Interrupt-Controller")) 260 "IBM,CBEA-Internal-Interrupt-Controller"))
261 return -ENODEV; 261 return -ENODEV;
262 if (intsize != 1) 262 if (intsize != 1)
@@ -324,7 +324,7 @@ static int __init setup_iic(void)
324 324
325 for (dn = NULL; 325 for (dn = NULL;
326 (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) { 326 (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) {
327 if (!device_is_compatible(dn, 327 if (!of_device_is_compatible(dn,
328 "IBM,CBEA-Internal-Interrupt-Controller")) 328 "IBM,CBEA-Internal-Interrupt-Controller"))
329 continue; 329 continue;
330 np = of_get_property(dn, "ibm,interrupt-server-ranges", NULL); 330 np = of_get_property(dn, "ibm,interrupt-server-ranges", NULL);
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 54b96183cb64..db6654272e13 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -112,7 +112,7 @@ static void __init mpic_init_IRQ(void)
112 112
113 for (dn = NULL; 113 for (dn = NULL;
114 (dn = of_find_node_by_name(dn, "interrupt-controller"));) { 114 (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
115 if (!device_is_compatible(dn, "CBEA,platform-open-pic")) 115 if (!of_device_is_compatible(dn, "CBEA,platform-open-pic"))
116 continue; 116 continue;
117 117
118 /* The MPIC driver will get everything it needs from the 118 /* The MPIC driver will get everything it needs from the
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index fb1f15797bbb..05f4b3d3d756 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -358,12 +358,12 @@ void __init spider_init_IRQ(void)
358 */ 358 */
359 for (dn = NULL; 359 for (dn = NULL;
360 (dn = of_find_node_by_name(dn, "interrupt-controller"));) { 360 (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
361 if (device_is_compatible(dn, "CBEA,platform-spider-pic")) { 361 if (of_device_is_compatible(dn, "CBEA,platform-spider-pic")) {
362 if (of_address_to_resource(dn, 0, &r)) { 362 if (of_address_to_resource(dn, 0, &r)) {
363 printk(KERN_WARNING "spider-pic: Failed\n"); 363 printk(KERN_WARNING "spider-pic: Failed\n");
364 continue; 364 continue;
365 } 365 }
366 } else if (device_is_compatible(dn, "sti,platform-spider-pic") 366 } else if (of_device_is_compatible(dn, "sti,platform-spider-pic")
367 && (chip < 2)) { 367 && (chip < 2)) {
368 static long hard_coded_pics[] = 368 static long hard_coded_pics[] =
369 { 0x24000008000ul, 0x34000008000ul}; 369 { 0x24000008000ul, 0x34000008000ul};
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 1469d6478f67..d32fedc991d3 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -267,7 +267,7 @@ chrp_find_bridges(void)
267 model = of_get_property(dev, "model", NULL); 267 model = of_get_property(dev, "model", NULL);
268 if (model == NULL) 268 if (model == NULL)
269 model = "<none>"; 269 model = "<none>";
270 if (device_is_compatible(dev, "IBM,python")) { 270 if (of_device_is_compatible(dev, "IBM,python")) {
271 setup_python(hose, dev); 271 setup_python(hose, dev);
272 } else if (is_mot 272 } else if (is_mot
273 || strncmp(model, "Motorola, Grackle", 17) == 0) { 273 || strncmp(model, "Motorola, Grackle", 17) == 0) {
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 1870038a8e0a..373de4c063db 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -448,7 +448,7 @@ static void __init chrp_find_8259(void)
448 448
449 /* Look for cascade */ 449 /* Look for cascade */
450 for_each_node_by_type(np, "interrupt-controller") 450 for_each_node_by_type(np, "interrupt-controller")
451 if (device_is_compatible(np, "chrp,iic")) { 451 if (of_device_is_compatible(np, "chrp,iic")) {
452 pic = np; 452 pic = np;
453 break; 453 break;
454 } 454 }
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 9557908ef545..8f3c2a73e165 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -20,16 +20,24 @@ config MPC7448HPC2
20 select TSI108_BRIDGE 20 select TSI108_BRIDGE
21 select DEFAULT_UIMAGE 21 select DEFAULT_UIMAGE
22 select PPC_UDBG_16550 22 select PPC_UDBG_16550
23 select MPIC
24 select MPIC_WEIRD
25 help 23 help
26 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) 24 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
27 platform 25 platform
26
27config PPC_HOLLY
28 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
29 select TSI108_BRIDGE
30 select PPC_UDBG_16550
31 help
32 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
33 Board with TSI108/9 bridge (Hickory/Holly)
28endchoice 34endchoice
29 35
30config TSI108_BRIDGE 36config TSI108_BRIDGE
31 bool 37 bool
32 depends on MPC7448HPC2 38 depends on MPC7448HPC2 || PPC_HOLLY
39 select MPIC
40 select MPIC_WEIRD
33 default y 41 default y
34 42
35config MPC10X_BRIDGE 43config MPC10X_BRIDGE
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index d3d11a3cd656..b39fe4f470d5 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -3,3 +3,4 @@
3# 3#
4obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o 4obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o
5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o 5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o
6obj-$(CONFIG_PPC_HOLLY) += holly.o
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
new file mode 100644
index 000000000000..3a0b4a01401c
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -0,0 +1,317 @@
1/*
2 * Board setup routines for the IBM 750GX/CL platform w/ TSI10x bridge
3 *
4 * Copyright 2007 IBM Corporation
5 *
6 * Stephen Winiecki <stevewin@us.ibm.com>
7 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
8 *
9 * Based on code from mpc7448_hpc2.c
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 * version 2 as published by the Free Software Foundation.
14 */
15
16#include <linux/stddef.h>
17#include <linux/kernel.h>
18#include <linux/pci.h>
19#include <linux/kdev_t.h>
20#include <linux/console.h>
21#include <linux/delay.h>
22#include <linux/irq.h>
23#include <linux/ide.h>
24#include <linux/seq_file.h>
25#include <linux/root_dev.h>
26#include <linux/serial.h>
27#include <linux/tty.h>
28#include <linux/serial_core.h>
29
30#include <asm/system.h>
31#include <asm/time.h>
32#include <asm/machdep.h>
33#include <asm/prom.h>
34#include <asm/udbg.h>
35#include <asm/tsi108.h>
36#include <asm/pci-bridge.h>
37#include <asm/reg.h>
38#include <mm/mmu_decl.h>
39#include <asm/tsi108_irq.h>
40#include <asm/tsi108_pci.h>
41#include <asm/mpic.h>
42#include <asm/of_platform.h>
43
44#undef DEBUG
45
46#define HOLLY_PCI_CFG_PHYS 0x7c000000
47
48int holly_exclude_device(u_char bus, u_char devfn)
49{
50 if (bus == 0 && PCI_SLOT(devfn) == 0)
51 return PCIBIOS_DEVICE_NOT_FOUND;
52 else
53 return PCIBIOS_SUCCESSFUL;
54}
55
56static void holly_remap_bridge(void)
57{
58 u32 lut_val, lut_addr;
59 int i;
60
61 printk(KERN_INFO "Remapping PCI bridge\n");
62
63 /* Re-init the PCI bridge and LUT registers to have mappings that don't
64 * rely on PIBS
65 */
66 lut_addr = 0x900;
67 for (i = 0; i < 31; i++) {
68 tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000201);
69 lut_addr += 4;
70 tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
71 lut_addr += 4;
72 }
73
74 /* Reserve the last LUT entry for PCI I/O space */
75 tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x00000241);
76 lut_addr += 4;
77 tsi108_write_reg(TSI108_PB_OFFSET + lut_addr, 0x0);
78
79 /* Map PCI I/O space */
80 tsi108_write_reg(TSI108_PCI_PFAB_IO_UPPER, 0x0);
81 tsi108_write_reg(TSI108_PCI_PFAB_IO, 0x1);
82
83 /* Map PCI CFG space */
84 tsi108_write_reg(TSI108_PCI_PFAB_BAR0_UPPER, 0x0);
85 tsi108_write_reg(TSI108_PCI_PFAB_BAR0, 0x7c000000 | 0x01);
86
87 /* We don't need MEM32 and PRM remapping so disable them */
88 tsi108_write_reg(TSI108_PCI_PFAB_MEM32, 0x0);
89 tsi108_write_reg(TSI108_PCI_PFAB_PFM3, 0x0);
90 tsi108_write_reg(TSI108_PCI_PFAB_PFM4, 0x0);
91
92 /* Set P2O_BAR0 */
93 tsi108_write_reg(TSI108_PCI_P2O_BAR0_UPPER, 0x0);
94 tsi108_write_reg(TSI108_PCI_P2O_BAR0, 0xc0000000);
95
96 /* Init the PCI LUTs to do no remapping */
97 lut_addr = 0x500;
98 lut_val = 0x00000002;
99
100 for (i = 0; i < 32; i++) {
101 tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, lut_val);
102 lut_addr += 4;
103 tsi108_write_reg(TSI108_PCI_OFFSET + lut_addr, 0x40000000);
104 lut_addr += 4;
105 lut_val += 0x02000000;
106 }
107 tsi108_write_reg(TSI108_PCI_P2O_PAGE_SIZES, 0x00007900);
108
109 /* Set 64-bit PCI bus address for system memory */
110 tsi108_write_reg(TSI108_PCI_P2O_BAR2_UPPER, 0x0);
111 tsi108_write_reg(TSI108_PCI_P2O_BAR2, 0x0);
112}
113
114static void __init holly_setup_arch(void)
115{
116 struct device_node *cpu;
117 struct device_node *np;
118
119 if (ppc_md.progress)
120 ppc_md.progress("holly_setup_arch():set_bridge", 0);
121
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();
134
135 /* setup PCI host bridge */
136 holly_remap_bridge();
137
138 np = of_find_node_by_type(NULL, "pci");
139 if (np)
140 tsi108_setup_pci(np, HOLLY_PCI_CFG_PHYS, 1);
141
142 ppc_md.pci_exclude_device = holly_exclude_device;
143 if (ppc_md.progress)
144 ppc_md.progress("tsi108: resources set", 0x100);
145
146 printk(KERN_INFO "PPC750GX/CL Platform\n");
147}
148
149/*
150 * Interrupt setup and service. Interrrupts on the holly come
151 * from the four external INT pins, PCI interrupts are routed via
152 * PCI interrupt control registers, it generates internal IRQ23
153 *
154 * Interrupt routing on the Holly Board:
155 * TSI108:PB_INT[0] -> CPU0:INT#
156 * TSI108:PB_INT[1] -> CPU0:MCP#
157 * TSI108:PB_INT[2] -> N/C
158 * TSI108:PB_INT[3] -> N/C
159 */
160static void __init holly_init_IRQ(void)
161{
162 struct mpic *mpic;
163 phys_addr_t mpic_paddr = 0;
164 struct device_node *tsi_pic;
165#ifdef CONFIG_PCI
166 unsigned int cascade_pci_irq;
167 struct device_node *tsi_pci;
168 struct device_node *cascade_node = NULL;
169#endif
170
171 tsi_pic = of_find_node_by_type(NULL, "open-pic");
172 if (tsi_pic) {
173 unsigned int size;
174 const void *prop = of_get_property(tsi_pic, "reg", &size);
175 mpic_paddr = of_translate_address(tsi_pic, prop);
176 }
177
178 if (mpic_paddr == 0) {
179 printk(KERN_ERR "%s: No tsi108 PIC found !\n", __func__);
180 return;
181 }
182
183 pr_debug("%s: tsi108 pic phys_addr = 0x%x\n", __func__, (u32) mpic_paddr);
184
185 mpic = mpic_alloc(tsi_pic, mpic_paddr,
186 MPIC_PRIMARY | MPIC_BIG_ENDIAN | MPIC_WANTS_RESET |
187 MPIC_SPV_EOI | MPIC_NO_PTHROU_DIS | MPIC_REGSET_TSI108,
188 24,
189 NR_IRQS-4, /* num_sources used */
190 "Tsi108_PIC");
191
192 BUG_ON(mpic == NULL);
193
194 mpic_assign_isu(mpic, 0, mpic_paddr + 0x100);
195
196 mpic_init(mpic);
197
198#ifdef CONFIG_PCI
199 tsi_pci = of_find_node_by_type(NULL, "pci");
200 if (tsi_pci == NULL) {
201 printk(KERN_ERR "%s: No tsi108 pci node found !\n", __func__);
202 return;
203 }
204
205 cascade_node = of_find_node_by_type(NULL, "pic-router");
206 if (cascade_node == NULL) {
207 printk(KERN_ERR "%s: No tsi108 pci cascade node found !\n", __func__);
208 return;
209 }
210
211 cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
212 pr_debug("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__, (u32) cascade_pci_irq);
213 tsi108_pci_int_init(cascade_node);
214 set_irq_data(cascade_pci_irq, mpic);
215 set_irq_chained_handler(cascade_pci_irq, tsi108_irq_cascade);
216#endif
217 /* Configure MPIC outputs to CPU0 */
218 tsi108_write_reg(TSI108_MPIC_OFFSET + 0x30c, 0);
219 of_node_put(tsi_pic);
220}
221
222void holly_show_cpuinfo(struct seq_file *m)
223{
224 seq_printf(m, "vendor\t\t: IBM\n");
225 seq_printf(m, "machine\t\t: PPC750 GX/CL\n");
226}
227
228void holly_restart(char *cmd)
229{
230 __be32 __iomem *ocn_bar1 = NULL;
231 unsigned long bar;
232 struct device_node *bridge = NULL;
233 const void *prop;
234 int size;
235 phys_addr_t addr = 0xc0000000;
236
237 local_irq_disable();
238
239 bridge = of_find_node_by_type(NULL, "tsi-bridge");
240 if (bridge) {
241 prop = of_get_property(bridge, "reg", &size);
242 addr = of_translate_address(bridge, prop);
243 }
244 addr += (TSI108_PB_OFFSET + 0x414);
245
246 ocn_bar1 = ioremap(addr, 0x4);
247
248 /* Turn on the BOOT bit so the addresses are correctly
249 * routed to the HLP interface */
250 bar = ioread32be(ocn_bar1);
251 bar |= 2;
252 iowrite32be(bar, ocn_bar1);
253 iosync();
254
255 /* Set SRR0 to the reset vector and turn on MSR_IP */
256 mtspr(SPRN_SRR0, 0xfff00100);
257 mtspr(SPRN_SRR1, MSR_IP);
258
259 /* Do an rfi to jump back to firmware. Somewhat evil,
260 * but it works
261 */
262 __asm__ __volatile__("rfi" : : : "memory");
263
264 /* Spin until reset happens. Shouldn't really get here */
265 for (;;) ;
266}
267
268void holly_power_off(void)
269{
270 local_irq_disable();
271 /* No way to shut power off with software */
272 for (;;) ;
273}
274
275void holly_halt(void)
276{
277 holly_power_off();
278}
279
280/*
281 * Called very early, device-tree isn't unflattened
282 */
283static int __init holly_probe(void)
284{
285 unsigned long root = of_get_flat_dt_root();
286
287 if (!of_flat_dt_is_compatible(root, "ibm,holly"))
288 return 0;
289 return 1;
290}
291
292static int ppc750_machine_check_exception(struct pt_regs *regs)
293{
294 const struct exception_table_entry *entry;
295
296 /* Are we prepared to handle this fault */
297 if ((entry = search_exception_tables(regs->nip)) != NULL) {
298 tsi108_clear_pci_cfg_error();
299 regs->msr |= MSR_RI;
300 regs->nip = entry->fixup;
301 return 1;
302 }
303 return 0;
304}
305
306define_machine(holly){
307 .name = "PPC750 GX/CL TSI",
308 .probe = holly_probe,
309 .setup_arch = holly_setup_arch,
310 .init_IRQ = holly_init_IRQ,
311 .show_cpuinfo = holly_show_cpuinfo,
312 .get_irq = mpic_get_irq,
313 .restart = holly_restart,
314 .calibrate_decr = generic_calibrate_decr,
315 .machine_check_exception = ppc750_machine_check_exception,
316 .progress = udbg_progress,
317};
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index c3f64ddb0be6..4542e0c837c0 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -41,6 +41,7 @@
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" 43#include "mpc7448_hpc2.h"
44#include <asm/tsi108_pci.h>
44#include <asm/tsi108_irq.h> 45#include <asm/tsi108_irq.h>
45#include <asm/mpic.h> 46#include <asm/mpic.h>
46 47
@@ -51,16 +52,15 @@
51#define DBG(fmt...) do { } while(0) 52#define DBG(fmt...) do { } while(0)
52#endif 53#endif
53 54
55#define MPC7448HPC2_PCI_CFG_PHYS 0xfb000000
56
54#ifndef CONFIG_PCI 57#ifndef CONFIG_PCI
55isa_io_base = MPC7448_HPC2_ISA_IO_BASE; 58isa_io_base = MPC7448_HPC2_ISA_IO_BASE;
56isa_mem_base = MPC7448_HPC2_ISA_MEM_BASE; 59isa_mem_base = MPC7448_HPC2_ISA_MEM_BASE;
57pci_dram_offset = MPC7448_HPC2_PCI_MEM_OFFSET; 60pci_dram_offset = MPC7448_HPC2_PCI_MEM_OFFSET;
58#endif 61#endif
59 62
60extern int tsi108_setup_pci(struct device_node *dev);
61extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); 63extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
62extern void tsi108_pci_int_init(struct device_node *node);
63extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
64 64
65int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn) 65int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn)
66{ 66{
@@ -72,28 +72,16 @@ int mpc7448_hpc2_exclude_device(u_char bus, u_char devfn)
72 72
73static void __init mpc7448_hpc2_setup_arch(void) 73static void __init mpc7448_hpc2_setup_arch(void)
74{ 74{
75 struct device_node *cpu;
76 struct device_node *np; 75 struct device_node *np;
77 if (ppc_md.progress) 76 if (ppc_md.progress)
78 ppc_md.progress("mpc7448_hpc2_setup_arch():set_bridge", 0); 77 ppc_md.progress("mpc7448_hpc2_setup_arch():set_bridge", 0);
79 78
80 cpu = of_find_node_by_type(NULL, "cpu");
81 if (cpu != 0) {
82 const unsigned int *fp;
83
84 fp = of_get_property(cpu, "clock-frequency", NULL);
85 if (fp != 0)
86 loops_per_jiffy = *fp / HZ;
87 else
88 loops_per_jiffy = 50000000 / HZ;
89 of_node_put(cpu);
90 }
91 tsi108_csr_vir_base = get_vir_csrbase(); 79 tsi108_csr_vir_base = get_vir_csrbase();
92 80
93 /* setup PCI host bridge */ 81 /* setup PCI host bridge */
94#ifdef CONFIG_PCI 82#ifdef CONFIG_PCI
95 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 83 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
96 tsi108_setup_pci(np); 84 tsi108_setup_pci(np, MPC7448HPC2_PCI_CFG_PHYS, 0);
97 85
98 ppc_md.pci_exclude_device = mpc7448_hpc2_exclude_device; 86 ppc_md.pci_exclude_device = mpc7448_hpc2_exclude_device;
99 if (ppc_md.progress) 87 if (ppc_md.progress)
@@ -222,7 +210,6 @@ static int __init mpc7448_hpc2_probe(void)
222 210
223static int mpc7448_machine_check_exception(struct pt_regs *regs) 211static int mpc7448_machine_check_exception(struct pt_regs *regs)
224{ 212{
225 extern void tsi108_clear_pci_cfg_error(void);
226 const struct exception_table_entry *entry; 213 const struct exception_table_entry *entry;
227 214
228 /* Are we prepared to handle this fault */ 215 /* Are we prepared to handle this fault */
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index b1d3b99c3f9d..7aaa5bbc9363 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -467,15 +467,15 @@ static int __init add_bridge(struct device_node *dev)
467 hose->last_busno = bus_range ? bus_range[1] : 0xff; 467 hose->last_busno = bus_range ? bus_range[1] : 0xff;
468 468
469 disp_name = NULL; 469 disp_name = NULL;
470 if (device_is_compatible(dev, "u3-agp")) { 470 if (of_device_is_compatible(dev, "u3-agp")) {
471 setup_u3_agp(hose); 471 setup_u3_agp(hose);
472 disp_name = "U3-AGP"; 472 disp_name = "U3-AGP";
473 primary = 0; 473 primary = 0;
474 } else if (device_is_compatible(dev, "u3-ht")) { 474 } else if (of_device_is_compatible(dev, "u3-ht")) {
475 setup_u3_ht(hose); 475 setup_u3_ht(hose);
476 disp_name = "U3-HT"; 476 disp_name = "U3-HT";
477 primary = 1; 477 primary = 1;
478 } else if (device_is_compatible(dev, "u4-pcie")) { 478 } else if (of_device_is_compatible(dev, "u4-pcie")) {
479 setup_u4_pcie(hose); 479 setup_u4_pcie(hose);
480 disp_name = "U4-PCIE"; 480 disp_name = "U4-PCIE";
481 primary = 0; 481 primary = 0;
@@ -556,12 +556,12 @@ void __init maple_pci_init(void)
556 continue; 556 continue;
557 if (strcmp(np->type, "pci") && strcmp(np->type, "ht")) 557 if (strcmp(np->type, "pci") && strcmp(np->type, "ht"))
558 continue; 558 continue;
559 if ((device_is_compatible(np, "u4-pcie") || 559 if ((of_device_is_compatible(np, "u4-pcie") ||
560 device_is_compatible(np, "u3-agp")) && 560 of_device_is_compatible(np, "u3-agp")) &&
561 add_bridge(np) == 0) 561 add_bridge(np) == 0)
562 of_node_get(np); 562 of_node_get(np);
563 563
564 if (device_is_compatible(np, "u3-ht")) { 564 if (of_device_is_compatible(np, "u3-ht")) {
565 of_node_get(np); 565 of_node_get(np);
566 ht = np; 566 ht = np;
567 } 567 }
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 2a30c5b2532e..354c05861629 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -231,7 +231,7 @@ static void __init maple_init_IRQ(void)
231 */ 231 */
232 232
233 for_each_node_by_type(np, "interrupt-controller") 233 for_each_node_by_type(np, "interrupt-controller")
234 if (device_is_compatible(np, "open-pic")) { 234 if (of_device_is_compatible(np, "open-pic")) {
235 mpic_node = np; 235 mpic_node = np;
236 break; 236 break;
237 } 237 }
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c
index 2a57d6023685..3ae083851b01 100644
--- a/arch/powerpc/platforms/pasemi/cpufreq.c
+++ b/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -31,6 +31,7 @@
31#include <asm/hw_irq.h> 31#include <asm/hw_irq.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/prom.h> 33#include <asm/prom.h>
34#include <asm/time.h>
34 35
35#define SDCASR_REG 0x0100 36#define SDCASR_REG 0x0100
36#define SDCASR_REG_STRIDE 0x1000 37#define SDCASR_REG_STRIDE 0x1000
@@ -204,6 +205,8 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
204 policy->cur = pas_freqs[cur_astate].frequency; 205 policy->cur = pas_freqs[cur_astate].frequency;
205 policy->cpus = cpu_online_map; 206 policy->cpus = cpu_online_map;
206 207
208 ppc_proc_freq = policy->cur * 1000ul;
209
207 cpufreq_frequency_table_get_attr(pas_freqs, policy->cpu); 210 cpufreq_frequency_table_get_attr(pas_freqs, policy->cpu);
208 211
209 /* this ensures that policy->cpuinfo_min and policy->cpuinfo_max 212 /* this ensures that policy->cpuinfo_min and policy->cpuinfo_max
@@ -270,6 +273,7 @@ static int pas_cpufreq_target(struct cpufreq_policy *policy,
270 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 273 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
271 mutex_unlock(&pas_switch_mutex); 274 mutex_unlock(&pas_switch_mutex);
272 275
276 ppc_proc_freq = freqs.new * 1000ul;
273 return 0; 277 return 0;
274} 278}
275 279
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index f88f0ec4c8cb..38f107b3c521 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -114,7 +114,7 @@ static __init void pas_init_IRQ(void)
114 mpic_node = NULL; 114 mpic_node = NULL;
115 115
116 for_each_node_by_type(np, "interrupt-controller") 116 for_each_node_by_type(np, "interrupt-controller")
117 if (device_is_compatible(np, "open-pic")) { 117 if (of_device_is_compatible(np, "open-pic")) {
118 mpic_node = np; 118 mpic_node = np;
119 break; 119 break;
120 } 120 }
@@ -211,7 +211,10 @@ static struct of_device_id pasemi_bus_ids[] = {
211 211
212static int __init pasemi_publish_devices(void) 212static int __init pasemi_publish_devices(void)
213{ 213{
214 /* Publish OF platform devices for southbridge IOs */ 214 if (!machine_is(pasemi))
215 return 0;
216
217 /* Publish OF platform devices for SDC and other non-PCI devices */
215 of_platform_bus_probe(NULL, pasemi_bus_ids, NULL); 218 of_platform_bus_probe(NULL, pasemi_bus_ids, NULL);
216 219
217 return 0; 220 return 0;
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 567d5523b690..00f50298c342 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -357,13 +357,13 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
357 357
358static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) 358static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
359{ 359{
360 if (policy->cpu != 0)
361 return -ENODEV;
362
363 policy->governor = CPUFREQ_DEFAULT_GOVERNOR; 360 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
364 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 361 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
365 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; 362 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
366 policy->cpus = cpu_possible_map; 363 /* secondary CPUs are tied to the primary one by the
364 * cpufreq core if in the secondary policy we tell it that
365 * it actually must be one policy together with all others. */
366 policy->cpus = cpu_online_map;
367 cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); 367 cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
368 368
369 return cpufreq_frequency_table_cpuinfo(policy, 369 return cpufreq_frequency_table_cpuinfo(policy,
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 52cfdd86c928..f29705f8047d 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1418,7 +1418,7 @@ static long g5_eth_phy_reset(struct device_node *node, long param, long value)
1418 phy = of_get_next_child(node, NULL); 1418 phy = of_get_next_child(node, NULL);
1419 if (!phy) 1419 if (!phy)
1420 return -ENODEV; 1420 return -ENODEV;
1421 need_reset = device_is_compatible(phy, "B5221"); 1421 need_reset = of_device_is_compatible(phy, "B5221");
1422 of_node_put(phy); 1422 of_node_put(phy);
1423 if (!need_reset) 1423 if (!need_reset)
1424 return 0; 1424 return 0;
@@ -2624,7 +2624,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
2624 for (node = NULL; (node = of_find_node_by_name(node, name)) != NULL;) { 2624 for (node = NULL; (node = of_find_node_by_name(node, name)) != NULL;) {
2625 if (!compat) 2625 if (!compat)
2626 break; 2626 break;
2627 if (device_is_compatible(node, compat)) 2627 if (of_device_is_compatible(node, compat))
2628 break; 2628 break;
2629 } 2629 }
2630 if (!node) 2630 if (!node)
@@ -2728,7 +2728,7 @@ initial_serial_shutdown(struct device_node *np)
2728 conn = of_get_property(np, "AAPL,connector", &len); 2728 conn = of_get_property(np, "AAPL,connector", &len);
2729 if (conn && (strcmp(conn, "infrared") == 0)) 2729 if (conn && (strcmp(conn, "infrared") == 0))
2730 port_type = PMAC_SCC_IRDA; 2730 port_type = PMAC_SCC_IRDA;
2731 else if (device_is_compatible(np, "cobalt")) 2731 else if (of_device_is_compatible(np, "cobalt"))
2732 modem = 1; 2732 modem = 1;
2733 else if (slots && slots->count > 0) { 2733 else if (slots && slots->count > 0) {
2734 if (strcmp(slots->name, "IrDA") == 0) 2734 if (strcmp(slots->name, "IrDA") == 0)
@@ -2787,7 +2787,7 @@ set_initial_features(void)
2787 */ 2787 */
2788 np = of_find_node_by_name(NULL, "ethernet"); 2788 np = of_find_node_by_name(NULL, "ethernet");
2789 while(np) { 2789 while(np) {
2790 if (device_is_compatible(np, "K2-GMAC")) 2790 if (of_device_is_compatible(np, "K2-GMAC"))
2791 g5_gmac_enable(np, 0, 1); 2791 g5_gmac_enable(np, 0, 1);
2792 np = of_find_node_by_name(np, "ethernet"); 2792 np = of_find_node_by_name(np, "ethernet");
2793 } 2793 }
@@ -2799,7 +2799,7 @@ set_initial_features(void)
2799 */ 2799 */
2800 np = of_find_node_by_name(NULL, "firewire"); 2800 np = of_find_node_by_name(NULL, "firewire");
2801 while(np) { 2801 while(np) {
2802 if (device_is_compatible(np, "pci106b,5811")) { 2802 if (of_device_is_compatible(np, "pci106b,5811")) {
2803 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2803 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
2804 g5_fw_enable(np, 0, 1); 2804 g5_fw_enable(np, 0, 1);
2805 } 2805 }
@@ -2817,8 +2817,8 @@ set_initial_features(void)
2817 np = of_find_node_by_name(NULL, "ethernet"); 2817 np = of_find_node_by_name(NULL, "ethernet");
2818 while(np) { 2818 while(np) {
2819 if (np->parent 2819 if (np->parent
2820 && device_is_compatible(np->parent, "uni-north") 2820 && of_device_is_compatible(np->parent, "uni-north")
2821 && device_is_compatible(np, "gmac")) 2821 && of_device_is_compatible(np, "gmac"))
2822 core99_gmac_enable(np, 0, 1); 2822 core99_gmac_enable(np, 0, 1);
2823 np = of_find_node_by_name(np, "ethernet"); 2823 np = of_find_node_by_name(np, "ethernet");
2824 } 2824 }
@@ -2831,10 +2831,10 @@ set_initial_features(void)
2831 np = of_find_node_by_name(NULL, "firewire"); 2831 np = of_find_node_by_name(NULL, "firewire");
2832 while(np) { 2832 while(np) {
2833 if (np->parent 2833 if (np->parent
2834 && device_is_compatible(np->parent, "uni-north") 2834 && of_device_is_compatible(np->parent, "uni-north")
2835 && (device_is_compatible(np, "pci106b,18") || 2835 && (of_device_is_compatible(np, "pci106b,18") ||
2836 device_is_compatible(np, "pci106b,30") || 2836 of_device_is_compatible(np, "pci106b,30") ||
2837 device_is_compatible(np, "pci11c1,5811"))) { 2837 of_device_is_compatible(np, "pci11c1,5811"))) {
2838 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED; 2838 macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
2839 core99_firewire_enable(np, 0, 1); 2839 core99_firewire_enable(np, 0, 1);
2840 } 2840 }
@@ -2845,8 +2845,8 @@ set_initial_features(void)
2845 np = of_find_node_by_name(NULL, "ata-6"); 2845 np = of_find_node_by_name(NULL, "ata-6");
2846 while(np) { 2846 while(np) {
2847 if (np->parent 2847 if (np->parent
2848 && device_is_compatible(np->parent, "uni-north") 2848 && of_device_is_compatible(np->parent, "uni-north")
2849 && device_is_compatible(np, "kauai-ata")) { 2849 && of_device_is_compatible(np, "kauai-ata")) {
2850 core99_ata100_enable(np, 1); 2850 core99_ata100_enable(np, 1);
2851 } 2851 }
2852 np = of_find_node_by_name(np, "ata-6"); 2852 np = of_find_node_by_name(np, "ata-6");
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index 5430e146b3e9..3f507ab9c5e5 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1207,7 +1207,7 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev,
1207 if (strcmp(np->name, p->name)) 1207 if (strcmp(np->name, p->name))
1208 continue; 1208 continue;
1209 if (p->compatible && 1209 if (p->compatible &&
1210 !device_is_compatible(np, p->compatible)) 1210 !of_device_is_compatible(np, p->compatible))
1211 continue; 1211 continue;
1212 if (p->quirks & pmac_i2c_quirk_skip) 1212 if (p->quirks & pmac_i2c_quirk_skip)
1213 break; 1213 break;
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index 692945c14919..c6f0f9e738e5 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -553,7 +553,7 @@ static int __init core99_nvram_setup(struct device_node *dp, unsigned long addr)
553 * identify the chip using flash id commands and base ourselves on 553 * identify the chip using flash id commands and base ourselves on
554 * a list of known chips IDs 554 * a list of known chips IDs
555 */ 555 */
556 if (device_is_compatible(dp, "amd-0137")) { 556 if (of_device_is_compatible(dp, "amd-0137")) {
557 core99_erase_bank = amd_erase_bank; 557 core99_erase_bank = amd_erase_bank;
558 core99_write_bank = amd_write_bank; 558 core99_write_bank = amd_write_bank;
559 } else { 559 } else {
@@ -588,7 +588,7 @@ int __init pmac_nvram_init(void)
588 } 588 }
589 } 589 }
590 590
591 is_core_99 = device_is_compatible(dp, "nvram,flash"); 591 is_core_99 = of_device_is_compatible(dp, "nvram,flash");
592 if (is_core_99) { 592 if (is_core_99) {
593 err = core99_nvram_setup(dp, r1.start); 593 err = core99_nvram_setup(dp, r1.start);
594 goto bail; 594 goto bail;
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 22c4ae4c6934..c4af9e21ac93 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -934,15 +934,15 @@ static int __init add_bridge(struct device_node *dev)
934 934
935 /* 64 bits only bridges */ 935 /* 64 bits only bridges */
936#ifdef CONFIG_PPC64 936#ifdef CONFIG_PPC64
937 if (device_is_compatible(dev, "u3-agp")) { 937 if (of_device_is_compatible(dev, "u3-agp")) {
938 setup_u3_agp(hose); 938 setup_u3_agp(hose);
939 disp_name = "U3-AGP"; 939 disp_name = "U3-AGP";
940 primary = 0; 940 primary = 0;
941 } else if (device_is_compatible(dev, "u3-ht")) { 941 } else if (of_device_is_compatible(dev, "u3-ht")) {
942 setup_u3_ht(hose); 942 setup_u3_ht(hose);
943 disp_name = "U3-HT"; 943 disp_name = "U3-HT";
944 primary = 1; 944 primary = 1;
945 } else if (device_is_compatible(dev, "u4-pcie")) { 945 } else if (of_device_is_compatible(dev, "u4-pcie")) {
946 setup_u4_pcie(hose); 946 setup_u4_pcie(hose);
947 disp_name = "U4-PCIE"; 947 disp_name = "U4-PCIE";
948 primary = 0; 948 primary = 0;
@@ -953,7 +953,7 @@ static int __init add_bridge(struct device_node *dev)
953 953
954 /* 32 bits only bridges */ 954 /* 32 bits only bridges */
955#ifdef CONFIG_PPC32 955#ifdef CONFIG_PPC32
956 if (device_is_compatible(dev, "uni-north")) { 956 if (of_device_is_compatible(dev, "uni-north")) {
957 primary = setup_uninorth(hose, &rsrc); 957 primary = setup_uninorth(hose, &rsrc);
958 disp_name = "UniNorth"; 958 disp_name = "UniNorth";
959 } else if (strcmp(dev->name, "pci") == 0) { 959 } else if (strcmp(dev->name, "pci") == 0) {
@@ -1129,21 +1129,21 @@ pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
1129 return 0; 1129 return 0;
1130 1130
1131 uninorth_child = node->parent && 1131 uninorth_child = node->parent &&
1132 device_is_compatible(node->parent, "uni-north"); 1132 of_device_is_compatible(node->parent, "uni-north");
1133 1133
1134 /* Firewire & GMAC were disabled after PCI probe, the driver is 1134 /* Firewire & GMAC were disabled after PCI probe, the driver is
1135 * claiming them, we must re-enable them now. 1135 * claiming them, we must re-enable them now.
1136 */ 1136 */
1137 if (uninorth_child && !strcmp(node->name, "firewire") && 1137 if (uninorth_child && !strcmp(node->name, "firewire") &&
1138 (device_is_compatible(node, "pci106b,18") || 1138 (of_device_is_compatible(node, "pci106b,18") ||
1139 device_is_compatible(node, "pci106b,30") || 1139 of_device_is_compatible(node, "pci106b,30") ||
1140 device_is_compatible(node, "pci11c1,5811"))) { 1140 of_device_is_compatible(node, "pci11c1,5811"))) {
1141 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, node, 0, 1); 1141 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, node, 0, 1);
1142 pmac_call_feature(PMAC_FTR_1394_ENABLE, node, 0, 1); 1142 pmac_call_feature(PMAC_FTR_1394_ENABLE, node, 0, 1);
1143 updatecfg = 1; 1143 updatecfg = 1;
1144 } 1144 }
1145 if (uninorth_child && !strcmp(node->name, "ethernet") && 1145 if (uninorth_child && !strcmp(node->name, "ethernet") &&
1146 device_is_compatible(node, "gmac")) { 1146 of_device_is_compatible(node, "gmac")) {
1147 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, node, 0, 1); 1147 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, node, 0, 1);
1148 updatecfg = 1; 1148 updatecfg = 1;
1149 } 1149 }
@@ -1203,18 +1203,18 @@ void __init pmac_pcibios_after_init(void)
1203#endif /* CONFIG_BLK_DEV_IDE */ 1203#endif /* CONFIG_BLK_DEV_IDE */
1204 1204
1205 for_each_node_by_name(nd, "firewire") { 1205 for_each_node_by_name(nd, "firewire") {
1206 if (nd->parent && (device_is_compatible(nd, "pci106b,18") || 1206 if (nd->parent && (of_device_is_compatible(nd, "pci106b,18") ||
1207 device_is_compatible(nd, "pci106b,30") || 1207 of_device_is_compatible(nd, "pci106b,30") ||
1208 device_is_compatible(nd, "pci11c1,5811")) 1208 of_device_is_compatible(nd, "pci11c1,5811"))
1209 && device_is_compatible(nd->parent, "uni-north")) { 1209 && of_device_is_compatible(nd->parent, "uni-north")) {
1210 pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0); 1210 pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0);
1211 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0); 1211 pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0);
1212 } 1212 }
1213 } 1213 }
1214 of_node_put(nd); 1214 of_node_put(nd);
1215 for_each_node_by_name(nd, "ethernet") { 1215 for_each_node_by_name(nd, "ethernet") {
1216 if (nd->parent && device_is_compatible(nd, "gmac") 1216 if (nd->parent && of_device_is_compatible(nd, "gmac")
1217 && device_is_compatible(nd->parent, "uni-north")) 1217 && of_device_is_compatible(nd->parent, "uni-north"))
1218 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0); 1218 pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0);
1219 } 1219 }
1220 of_node_put(nd); 1220 of_node_put(nd);
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index ae5097ac0378..87cd6805171a 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -364,7 +364,7 @@ static void __init pmac_pic_probe_oldstyle(void)
364 slave = of_find_node_by_name(master, "mac-io"); 364 slave = of_find_node_by_name(master, "mac-io");
365 365
366 /* Check ordering of master & slave */ 366 /* Check ordering of master & slave */
367 if (device_is_compatible(master, "gatwick")) { 367 if (of_device_is_compatible(master, "gatwick")) {
368 struct device_node *tmp; 368 struct device_node *tmp;
369 BUG_ON(slave == NULL); 369 BUG_ON(slave == NULL);
370 tmp = master; 370 tmp = master;
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index b820cabac697..a410bc76a8a8 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -439,76 +439,14 @@ static void __init find_boot_device(void)
439#endif 439#endif
440} 440}
441 441
442/* TODO: Merge the suspend-to-ram with the common code !!!
443 * currently, this is a stub implementation for suspend-to-disk
444 * only
445 */
446
447#ifdef CONFIG_SOFTWARE_SUSPEND
448
449static int pmac_pm_prepare(suspend_state_t state)
450{
451 printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
452
453 return 0;
454}
455
456static int pmac_pm_enter(suspend_state_t state)
457{
458 printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
459
460 /* Giveup the lazy FPU & vec so we don't have to back them
461 * up from the low level code
462 */
463 enable_kernel_fp();
464
465#ifdef CONFIG_ALTIVEC
466 if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
467 enable_kernel_altivec();
468#endif /* CONFIG_ALTIVEC */
469
470 return 0;
471}
472
473static int pmac_pm_finish(suspend_state_t state)
474{
475 printk(KERN_DEBUG "%s(%d)\n", __FUNCTION__, state);
476
477 /* Restore userland MMU context */
478 set_context(current->active_mm->context.id, current->active_mm->pgd);
479
480 return 0;
481}
482
483static int pmac_pm_valid(suspend_state_t state)
484{
485 switch (state) {
486 case PM_SUSPEND_DISK:
487 return 1;
488 /* can't do any other states via generic mechanism yet */
489 default:
490 return 0;
491 }
492}
493
494static struct pm_ops pmac_pm_ops = {
495 .pm_disk_mode = PM_DISK_SHUTDOWN,
496 .prepare = pmac_pm_prepare,
497 .enter = pmac_pm_enter,
498 .finish = pmac_pm_finish,
499 .valid = pmac_pm_valid,
500};
501
502#endif /* CONFIG_SOFTWARE_SUSPEND */
503
504static int initializing = 1; 442static int initializing = 1;
505 443
506static int pmac_late_init(void) 444static int pmac_late_init(void)
507{ 445{
508 initializing = 0; 446 initializing = 0;
509#ifdef CONFIG_SOFTWARE_SUSPEND 447 /* this is udbg (which is __init) and we can later use it during
510 pm_set_ops(&pmac_pm_ops); 448 * cpu hotplug (in smp_core99_kick_cpu) */
511#endif /* CONFIG_SOFTWARE_SUSPEND */ 449 ppc_md.progress = NULL;
512 return 0; 450 return 0;
513} 451}
514 452
@@ -721,12 +659,57 @@ static int pmac_pci_probe_mode(struct pci_bus *bus)
721 /* We need to use normal PCI probing for the AGP bus, 659 /* We need to use normal PCI probing for the AGP bus,
722 * since the device for the AGP bridge isn't in the tree. 660 * since the device for the AGP bridge isn't in the tree.
723 */ 661 */
724 if (bus->self == NULL && (device_is_compatible(node, "u3-agp") || 662 if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
725 device_is_compatible(node, "u4-pcie"))) 663 of_device_is_compatible(node, "u4-pcie")))
726 return PCI_PROBE_NORMAL; 664 return PCI_PROBE_NORMAL;
727 return PCI_PROBE_DEVTREE; 665 return PCI_PROBE_DEVTREE;
728} 666}
729#endif 667
668#ifdef CONFIG_HOTPLUG_CPU
669/* access per cpu vars from generic smp.c */
670DECLARE_PER_CPU(int, cpu_state);
671
672static void pmac_cpu_die(void)
673{
674 /*
675 * turn off as much as possible, we'll be
676 * kicked out as this will only be invoked
677 * on core99 platforms for now ...
678 */
679
680 printk(KERN_INFO "CPU#%d offline\n", smp_processor_id());
681 __get_cpu_var(cpu_state) = CPU_DEAD;
682 smp_wmb();
683
684 /*
685 * during the path that leads here preemption is disabled,
686 * reenable it now so that when coming up preempt count is
687 * zero correctly
688 */
689 preempt_enable();
690
691 /*
692 * hard-disable interrupts for the non-NAP case, the NAP code
693 * needs to re-enable interrupts (but soft-disables them)
694 */
695 hard_irq_disable();
696
697 while (1) {
698 /* let's not take timer interrupts too often ... */
699 set_dec(0x7fffffff);
700
701 /* should always be true at this point */
702 if (cpu_has_feature(CPU_FTR_CAN_NAP))
703 power4_cpu_offline_powersave();
704 else {
705 HMT_low();
706 HMT_very_low();
707 }
708 }
709}
710#endif /* CONFIG_HOTPLUG_CPU */
711
712#endif /* CONFIG_PPC64 */
730 713
731define_machine(powermac) { 714define_machine(powermac) {
732 .name = "PowerMac", 715 .name = "PowerMac",
@@ -763,6 +746,6 @@ define_machine(powermac) {
763 .phys_mem_access_prot = pci_phys_mem_access_prot, 746 .phys_mem_access_prot = pci_phys_mem_access_prot,
764#endif 747#endif
765#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) 748#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64)
766 .cpu_die = generic_mach_cpu_die, 749 .cpu_die = pmac_cpu_die,
767#endif 750#endif
768}; 751};
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 6f32c4eca6e5..84f1860493bb 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -562,7 +562,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
562 /* Look for the clock chip */ 562 /* Look for the clock chip */
563 while ((cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL) { 563 while ((cc = of_find_node_by_name(cc, "i2c-hwclock")) != NULL) {
564 p = of_get_parent(cc); 564 p = of_get_parent(cc);
565 ok = p && device_is_compatible(p, "uni-n-i2c"); 565 ok = p && of_device_is_compatible(p, "uni-n-i2c");
566 of_node_put(p); 566 of_node_put(p);
567 if (!ok) 567 if (!ok)
568 continue; 568 continue;
@@ -575,11 +575,11 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
575 continue; 575 continue;
576 switch (*reg) { 576 switch (*reg) {
577 case 0xd2: 577 case 0xd2:
578 if (device_is_compatible(cc,"pulsar-legacy-slewing")) { 578 if (of_device_is_compatible(cc,"pulsar-legacy-slewing")) {
579 pmac_tb_freeze = smp_core99_pulsar_tb_freeze; 579 pmac_tb_freeze = smp_core99_pulsar_tb_freeze;
580 pmac_tb_pulsar_addr = 0xd2; 580 pmac_tb_pulsar_addr = 0xd2;
581 name = "Pulsar"; 581 name = "Pulsar";
582 } else if (device_is_compatible(cc, "cy28508")) { 582 } else if (of_device_is_compatible(cc, "cy28508")) {
583 pmac_tb_freeze = smp_core99_cypress_tb_freeze; 583 pmac_tb_freeze = smp_core99_cypress_tb_freeze;
584 name = "Cypress"; 584 name = "Cypress";
585 } 585 }
@@ -900,7 +900,7 @@ void smp_core99_cpu_die(unsigned int cpu)
900 cpu_dead[cpu] = 0; 900 cpu_dead[cpu] = 0;
901} 901}
902 902
903#endif 903#endif /* CONFIG_HOTPLUG_CPU && CONFIG_PP32 */
904 904
905/* Core99 Macs (dual G4s and G5s) */ 905/* Core99 Macs (dual G4s and G5s) */
906struct smp_ops_t core99_smp_ops = { 906struct smp_ops_t core99_smp_ops = {
@@ -910,8 +910,16 @@ struct smp_ops_t core99_smp_ops = {
910 .setup_cpu = smp_core99_setup_cpu, 910 .setup_cpu = smp_core99_setup_cpu,
911 .give_timebase = smp_core99_give_timebase, 911 .give_timebase = smp_core99_give_timebase,
912 .take_timebase = smp_core99_take_timebase, 912 .take_timebase = smp_core99_take_timebase,
913#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32) 913#if defined(CONFIG_HOTPLUG_CPU)
914# if defined(CONFIG_PPC32)
914 .cpu_disable = smp_core99_cpu_disable, 915 .cpu_disable = smp_core99_cpu_disable,
915 .cpu_die = smp_core99_cpu_die, 916 .cpu_die = smp_core99_cpu_die,
917# endif
918# if defined(CONFIG_PPC64)
919 .cpu_disable = generic_cpu_disable,
920 .cpu_die = generic_cpu_die,
921 /* intentionally do *NOT* assign cpu_enable,
922 * the generic code will use kick_cpu then! */
923# endif
916#endif 924#endif
917}; 925};
diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c
index ea60c451cf87..a1409e450c70 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -273,7 +273,8 @@ void __init ps3_map_htab(void)
273 273
274 result = lv1_map_htab(0, &htab_addr); 274 result = lv1_map_htab(0, &htab_addr);
275 275
276 htab = (hpte_t *)__ioremap(htab_addr, htab_size, PAGE_READONLY_X); 276 htab = (hpte_t *)__ioremap(htab_addr, htab_size,
277 pgprot_val(PAGE_READONLY_X));
277 278
278 DBG("%s:%d: lpar %016lxh, virt %016lxh\n", __func__, __LINE__, 279 DBG("%s:%d: lpar %016lxh, virt %016lxh\n", __func__, __LINE__,
279 htab_addr, (unsigned long)htab); 280 htab_addr, (unsigned long)htab);
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index 631c30095617..9da82c266ba9 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -89,7 +89,18 @@ struct ps3_private {
89 89
90static DEFINE_PER_CPU(struct ps3_private, ps3_private); 90static DEFINE_PER_CPU(struct ps3_private, ps3_private);
91 91
92int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet, 92/**
93 * ps3_virq_setup - virq related setup.
94 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
95 * serviced on.
96 * @outlet: The HV outlet from the various create outlet routines.
97 * @virq: The assigned Linux virq.
98 *
99 * Calls irq_create_mapping() to get a virq and sets the chip data to
100 * ps3_private data.
101 */
102
103int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
93 unsigned int *virq) 104 unsigned int *virq)
94{ 105{
95 int result; 106 int result;
@@ -111,17 +122,6 @@ int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
111 goto fail_create; 122 goto fail_create;
112 } 123 }
113 124
114 /* Binds outlet to cpu + virq. */
115
116 result = lv1_connect_irq_plug_ext(pd->node, pd->cpu, *virq, outlet, 0);
117
118 if (result) {
119 pr_info("%s:%d: lv1_connect_irq_plug_ext failed: %s\n",
120 __func__, __LINE__, ps3_result(result));
121 result = -EPERM;
122 goto fail_connect;
123 }
124
125 pr_debug("%s:%d: outlet %lu => cpu %u, virq %u\n", __func__, __LINE__, 125 pr_debug("%s:%d: outlet %lu => cpu %u, virq %u\n", __func__, __LINE__,
126 outlet, cpu, *virq); 126 outlet, cpu, *virq);
127 127
@@ -136,94 +136,118 @@ int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
136 return result; 136 return result;
137 137
138fail_set: 138fail_set:
139 lv1_disconnect_irq_plug_ext(pd->node, pd->cpu, *virq);
140fail_connect:
141 irq_dispose_mapping(*virq); 139 irq_dispose_mapping(*virq);
142fail_create: 140fail_create:
143 return result; 141 return result;
144} 142}
145EXPORT_SYMBOL_GPL(ps3_alloc_irq);
146 143
147int ps3_free_irq(unsigned int virq) 144/**
145 * ps3_virq_destroy - virq related teardown.
146 * @virq: The assigned Linux virq.
147 *
148 * Clears chip data and calls irq_dispose_mapping() for the virq.
149 */
150
151int ps3_virq_destroy(unsigned int virq)
148{ 152{
149 int result;
150 const struct ps3_private *pd = get_irq_chip_data(virq); 153 const struct ps3_private *pd = get_irq_chip_data(virq);
151 154
152 pr_debug("%s:%d: node %lu, cpu %d, virq %u\n", __func__, __LINE__, 155 pr_debug("%s:%d: node %lu, cpu %d, virq %u\n", __func__, __LINE__,
153 pd->node, pd->cpu, virq); 156 pd->node, pd->cpu, virq);
154 157
155 result = lv1_disconnect_irq_plug_ext(pd->node, pd->cpu, virq);
156
157 if (result)
158 pr_info("%s:%d: lv1_disconnect_irq_plug_ext failed: %s\n",
159 __func__, __LINE__, ps3_result(result));
160
161 set_irq_chip_data(virq, NULL); 158 set_irq_chip_data(virq, NULL);
162 irq_dispose_mapping(virq); 159 irq_dispose_mapping(virq);
163 return result; 160
161 pr_debug("%s:%d <-\n", __func__, __LINE__);
162 return 0;
164} 163}
165EXPORT_SYMBOL_GPL(ps3_free_irq);
166 164
167/** 165/**
168 * ps3_alloc_io_irq - Assign a virq to a system bus device. 166 * ps3_irq_plug_setup - Generic outlet and virq related setup.
169 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be 167 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
170 * serviced on. 168 * serviced on.
171 * @interrupt_id: The device interrupt id read from the system repository. 169 * @outlet: The HV outlet from the various create outlet routines.
172 * @virq: The assigned Linux virq. 170 * @virq: The assigned Linux virq.
173 * 171 *
174 * An io irq represents a non-virtualized device interrupt. interrupt_id 172 * Sets up virq and connects the irq plug.
175 * coresponds to the interrupt number of the interrupt controller.
176 */ 173 */
177 174
178int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id, 175int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
179 unsigned int *virq) 176 unsigned int *virq)
180{ 177{
181 int result; 178 int result;
182 unsigned long outlet; 179 struct ps3_private *pd;
183 180
184 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet); 181 result = ps3_virq_setup(cpu, outlet, virq);
185 182
186 if (result) { 183 if (result) {
187 pr_debug("%s:%d: lv1_construct_io_irq_outlet failed: %s\n", 184 pr_debug("%s:%d: ps3_virq_setup failed\n", __func__, __LINE__);
188 __func__, __LINE__, ps3_result(result)); 185 goto fail_setup;
189 return result;
190 } 186 }
191 187
192 result = ps3_alloc_irq(cpu, outlet, virq); 188 pd = get_irq_chip_data(*virq);
193 BUG_ON(result); 189
190 /* Binds outlet to cpu + virq. */
191
192 result = lv1_connect_irq_plug_ext(pd->node, pd->cpu, *virq, outlet, 0);
194 193
194 if (result) {
195 pr_info("%s:%d: lv1_connect_irq_plug_ext failed: %s\n",
196 __func__, __LINE__, ps3_result(result));
197 result = -EPERM;
198 goto fail_connect;
199 }
200
201 return result;
202
203fail_connect:
204 ps3_virq_destroy(*virq);
205fail_setup:
195 return result; 206 return result;
196} 207}
197EXPORT_SYMBOL_GPL(ps3_alloc_io_irq); 208EXPORT_SYMBOL_GPL(ps3_irq_plug_setup);
209
210/**
211 * ps3_irq_plug_destroy - Generic outlet and virq related teardown.
212 * @virq: The assigned Linux virq.
213 *
214 * Disconnects the irq plug and tears down virq.
215 * Do not call for system bus event interrupts setup with
216 * ps3_sb_event_receive_port_setup().
217 */
198 218
199int ps3_free_io_irq(unsigned int virq) 219int ps3_irq_plug_destroy(unsigned int virq)
200{ 220{
201 int result; 221 int result;
222 const struct ps3_private *pd = get_irq_chip_data(virq);
202 223
203 result = lv1_destruct_io_irq_outlet(virq_to_hw(virq)); 224 pr_debug("%s:%d: node %lu, cpu %d, virq %u\n", __func__, __LINE__,
225 pd->node, pd->cpu, virq);
226
227 result = lv1_disconnect_irq_plug_ext(pd->node, pd->cpu, virq);
204 228
205 if (result) 229 if (result)
206 pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n", 230 pr_info("%s:%d: lv1_disconnect_irq_plug_ext failed: %s\n",
207 __func__, __LINE__, ps3_result(result)); 231 __func__, __LINE__, ps3_result(result));
208 232
209 ps3_free_irq(virq); 233 ps3_virq_destroy(virq);
210 234
211 return result; 235 return result;
212} 236}
213EXPORT_SYMBOL_GPL(ps3_free_io_irq); 237EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy);
214 238
215/** 239/**
216 * ps3_alloc_event_irq - Allocate a virq for use with a system event. 240 * ps3_event_receive_port_setup - Setup an event receive port.
217 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be 241 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
218 * serviced on. 242 * serviced on.
219 * @virq: The assigned Linux virq. 243 * @virq: The assigned Linux virq.
220 * 244 *
221 * The virq can be used with lv1_connect_interrupt_event_receive_port() to 245 * The virq can be used with lv1_connect_interrupt_event_receive_port() to
222 * arrange to receive events, or with ps3_send_event_locally() to signal 246 * arrange to receive interrupts from system-bus devices, or with
223 * events. 247 * ps3_send_event_locally() to signal events.
224 */ 248 */
225 249
226int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq) 250int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
227{ 251{
228 int result; 252 int result;
229 unsigned long outlet; 253 unsigned long outlet;
@@ -237,17 +261,27 @@ int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq)
237 return result; 261 return result;
238 } 262 }
239 263
240 result = ps3_alloc_irq(cpu, outlet, virq); 264 result = ps3_irq_plug_setup(cpu, outlet, virq);
241 BUG_ON(result); 265 BUG_ON(result);
242 266
243 return result; 267 return result;
244} 268}
269EXPORT_SYMBOL_GPL(ps3_event_receive_port_setup);
270
271/**
272 * ps3_event_receive_port_destroy - Destroy an event receive port.
273 * @virq: The assigned Linux virq.
274 *
275 * Since ps3_event_receive_port_destroy destroys the receive port outlet,
276 * SB devices need to call disconnect_interrupt_event_receive_port() before
277 * this.
278 */
245 279
246int ps3_free_event_irq(unsigned int virq) 280int ps3_event_receive_port_destroy(unsigned int virq)
247{ 281{
248 int result; 282 int result;
249 283
250 pr_debug(" -> %s:%d\n", __func__, __LINE__); 284 pr_debug(" -> %s:%d virq: %u\n", __func__, __LINE__, virq);
251 285
252 result = lv1_destruct_event_receive_port(virq_to_hw(virq)); 286 result = lv1_destruct_event_receive_port(virq_to_hw(virq));
253 287
@@ -255,11 +289,17 @@ int ps3_free_event_irq(unsigned int virq)
255 pr_debug("%s:%d: lv1_destruct_event_receive_port failed: %s\n", 289 pr_debug("%s:%d: lv1_destruct_event_receive_port failed: %s\n",
256 __func__, __LINE__, ps3_result(result)); 290 __func__, __LINE__, ps3_result(result));
257 291
258 ps3_free_irq(virq); 292 /* lv1_destruct_event_receive_port() destroys the IRQ plug,
293 * so don't call ps3_irq_plug_destroy() here.
294 */
295
296 result = ps3_virq_destroy(virq);
297 BUG_ON(result);
259 298
260 pr_debug(" <- %s:%d\n", __func__, __LINE__); 299 pr_debug(" <- %s:%d\n", __func__, __LINE__);
261 return result; 300 return result;
262} 301}
302EXPORT_SYMBOL_GPL(ps3_event_receive_port_destroy);
263 303
264int ps3_send_event_locally(unsigned int virq) 304int ps3_send_event_locally(unsigned int virq)
265{ 305{
@@ -267,7 +307,7 @@ int ps3_send_event_locally(unsigned int virq)
267} 307}
268 308
269/** 309/**
270 * ps3_connect_event_irq - Assign a virq to a system bus device. 310 * ps3_sb_event_receive_port_setup - Setup a system bus event receive port.
271 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be 311 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
272 * serviced on. 312 * serviced on.
273 * @did: The HV device identifier read from the system repository. 313 * @did: The HV device identifier read from the system repository.
@@ -278,13 +318,15 @@ int ps3_send_event_locally(unsigned int virq)
278 * coresponds to the software interrupt number. 318 * coresponds to the software interrupt number.
279 */ 319 */
280 320
281int ps3_connect_event_irq(enum ps3_cpu_binding cpu, 321int ps3_sb_event_receive_port_setup(enum ps3_cpu_binding cpu,
282 const struct ps3_device_id *did, unsigned int interrupt_id, 322 const struct ps3_device_id *did, unsigned int interrupt_id,
283 unsigned int *virq) 323 unsigned int *virq)
284{ 324{
325 /* this should go in system-bus.c */
326
285 int result; 327 int result;
286 328
287 result = ps3_alloc_event_irq(cpu, virq); 329 result = ps3_event_receive_port_setup(cpu, virq);
288 330
289 if (result) 331 if (result)
290 return result; 332 return result;
@@ -296,7 +338,7 @@ int ps3_connect_event_irq(enum ps3_cpu_binding cpu,
296 pr_debug("%s:%d: lv1_connect_interrupt_event_receive_port" 338 pr_debug("%s:%d: lv1_connect_interrupt_event_receive_port"
297 " failed: %s\n", __func__, __LINE__, 339 " failed: %s\n", __func__, __LINE__,
298 ps3_result(result)); 340 ps3_result(result));
299 ps3_free_event_irq(*virq); 341 ps3_event_receive_port_destroy(*virq);
300 *virq = NO_IRQ; 342 *virq = NO_IRQ;
301 return result; 343 return result;
302 } 344 }
@@ -306,10 +348,13 @@ int ps3_connect_event_irq(enum ps3_cpu_binding cpu,
306 348
307 return 0; 349 return 0;
308} 350}
351EXPORT_SYMBOL(ps3_sb_event_receive_port_setup);
309 352
310int ps3_disconnect_event_irq(const struct ps3_device_id *did, 353int ps3_sb_event_receive_port_destroy(const struct ps3_device_id *did,
311 unsigned int interrupt_id, unsigned int virq) 354 unsigned int interrupt_id, unsigned int virq)
312{ 355{
356 /* this should go in system-bus.c */
357
313 int result; 358 int result;
314 359
315 pr_debug(" -> %s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__, 360 pr_debug(" -> %s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__,
@@ -323,14 +368,65 @@ int ps3_disconnect_event_irq(const struct ps3_device_id *did,
323 " failed: %s\n", __func__, __LINE__, 368 " failed: %s\n", __func__, __LINE__,
324 ps3_result(result)); 369 ps3_result(result));
325 370
326 ps3_free_event_irq(virq); 371 result = ps3_event_receive_port_destroy(virq);
372 BUG_ON(result);
327 373
328 pr_debug(" <- %s:%d\n", __func__, __LINE__); 374 pr_debug(" <- %s:%d\n", __func__, __LINE__);
329 return result; 375 return result;
330} 376}
377EXPORT_SYMBOL(ps3_sb_event_receive_port_destroy);
331 378
332/** 379/**
333 * ps3_alloc_vuart_irq - Configure the system virtual uart virq. 380 * ps3_io_irq_setup - Setup a system bus io irq.
381 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
382 * serviced on.
383 * @interrupt_id: The device interrupt id read from the system repository.
384 * @virq: The assigned Linux virq.
385 *
386 * An io irq represents a non-virtualized device interrupt. interrupt_id
387 * coresponds to the interrupt number of the interrupt controller.
388 */
389
390int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
391 unsigned int *virq)
392{
393 int result;
394 unsigned long outlet;
395
396 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
397
398 if (result) {
399 pr_debug("%s:%d: lv1_construct_io_irq_outlet failed: %s\n",
400 __func__, __LINE__, ps3_result(result));
401 return result;
402 }
403
404 result = ps3_irq_plug_setup(cpu, outlet, virq);
405 BUG_ON(result);
406
407 return result;
408}
409EXPORT_SYMBOL_GPL(ps3_io_irq_setup);
410
411int ps3_io_irq_destroy(unsigned int virq)
412{
413 int result;
414
415 result = lv1_destruct_io_irq_outlet(virq_to_hw(virq));
416
417 if (result)
418 pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n",
419 __func__, __LINE__, ps3_result(result));
420
421 result = ps3_irq_plug_destroy(virq);
422 BUG_ON(result);
423
424 return result;
425}
426EXPORT_SYMBOL_GPL(ps3_io_irq_destroy);
427
428/**
429 * ps3_vuart_irq_setup - Setup the system virtual uart virq.
334 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be 430 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
335 * serviced on. 431 * serviced on.
336 * @virt_addr_bmp: The caller supplied virtual uart interrupt bitmap. 432 * @virt_addr_bmp: The caller supplied virtual uart interrupt bitmap.
@@ -340,7 +436,7 @@ int ps3_disconnect_event_irq(const struct ps3_device_id *did,
340 * freeing the interrupt will return a wrong state error. 436 * freeing the interrupt will return a wrong state error.
341 */ 437 */
342 438
343int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp, 439int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
344 unsigned int *virq) 440 unsigned int *virq)
345{ 441{
346 int result; 442 int result;
@@ -359,13 +455,13 @@ int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
359 return result; 455 return result;
360 } 456 }
361 457
362 result = ps3_alloc_irq(cpu, outlet, virq); 458 result = ps3_irq_plug_setup(cpu, outlet, virq);
363 BUG_ON(result); 459 BUG_ON(result);
364 460
365 return result; 461 return result;
366} 462}
367 463
368int ps3_free_vuart_irq(unsigned int virq) 464int ps3_vuart_irq_destroy(unsigned int virq)
369{ 465{
370 int result; 466 int result;
371 467
@@ -377,13 +473,14 @@ int ps3_free_vuart_irq(unsigned int virq)
377 return result; 473 return result;
378 } 474 }
379 475
380 ps3_free_irq(virq); 476 result = ps3_irq_plug_destroy(virq);
477 BUG_ON(result);
381 478
382 return result; 479 return result;
383} 480}
384 481
385/** 482/**
386 * ps3_alloc_spe_irq - Configure an spe virq. 483 * ps3_spe_irq_setup - Setup an spe virq.
387 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be 484 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
388 * serviced on. 485 * serviced on.
389 * @spe_id: The spe_id returned from lv1_construct_logical_spe(). 486 * @spe_id: The spe_id returned from lv1_construct_logical_spe().
@@ -392,7 +489,7 @@ int ps3_free_vuart_irq(unsigned int virq)
392 * 489 *
393 */ 490 */
394 491
395int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, 492int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
396 unsigned int class, unsigned int *virq) 493 unsigned int class, unsigned int *virq)
397{ 494{
398 int result; 495 int result;
@@ -408,15 +505,16 @@ int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id,
408 return result; 505 return result;
409 } 506 }
410 507
411 result = ps3_alloc_irq(cpu, outlet, virq); 508 result = ps3_irq_plug_setup(cpu, outlet, virq);
412 BUG_ON(result); 509 BUG_ON(result);
413 510
414 return result; 511 return result;
415} 512}
416 513
417int ps3_free_spe_irq(unsigned int virq) 514int ps3_spe_irq_destroy(unsigned int virq)
418{ 515{
419 ps3_free_irq(virq); 516 int result = ps3_irq_plug_destroy(virq);
517 BUG_ON(result);
420 return 0; 518 return 0;
421} 519}
422 520
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 2014d2b44449..f8a3e206c584 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -826,5 +826,4 @@ void __init ps3_mm_init(void)
826void ps3_mm_shutdown(void) 826void ps3_mm_shutdown(void)
827{ 827{
828 ps3_mm_region_destroy(&map.r1); 828 ps3_mm_region_destroy(&map.r1);
829 map.total = map.rm.size;
830} 829}
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index ac5df9688dcb..c9894933084f 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -137,6 +137,12 @@ early_param("ps3fb", early_parse_ps3fb);
137#define prealloc_ps3fb_videomemory() do { } while (0) 137#define prealloc_ps3fb_videomemory() do { } while (0)
138#endif 138#endif
139 139
140static int ps3_set_dabr(u64 dabr)
141{
142 enum {DABR_USER = 1, DABR_KERNEL = 2,};
143
144 return lv1_set_dabr(dabr, DABR_KERNEL | DABR_USER) ? -1 : 0;
145}
140 146
141static void __init ps3_setup_arch(void) 147static void __init ps3_setup_arch(void)
142{ 148{
@@ -234,6 +240,7 @@ define_machine(ps3) {
234 .get_boot_time = ps3_get_boot_time, 240 .get_boot_time = ps3_get_boot_time,
235 .set_rtc_time = ps3_set_rtc_time, 241 .set_rtc_time = ps3_set_rtc_time,
236 .get_rtc_time = ps3_get_rtc_time, 242 .get_rtc_time = ps3_get_rtc_time,
243 .set_dabr = ps3_set_dabr,
237 .calibrate_decr = ps3_calibrate_decr, 244 .calibrate_decr = ps3_calibrate_decr,
238 .progress = ps3_progress, 245 .progress = ps3_progress,
239 .restart = ps3_restart, 246 .restart = ps3_restart,
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index 6fb887961a6d..8729348c0608 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -110,7 +110,7 @@ static void __init ps3_smp_setup_cpu(int cpu)
110 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); 110 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
111 111
112 for (i = 0; i < MSG_COUNT; i++) { 112 for (i = 0; i < MSG_COUNT; i++) {
113 result = ps3_alloc_event_irq(cpu, &virqs[i]); 113 result = ps3_event_receive_port_setup(cpu, &virqs[i]);
114 114
115 if (result) 115 if (result)
116 continue; 116 continue;
@@ -134,11 +134,13 @@ void ps3_smp_cleanup_cpu(int cpu)
134 int i; 134 int i;
135 135
136 DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); 136 DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu);
137
137 for (i = 0; i < MSG_COUNT; i++) { 138 for (i = 0; i < MSG_COUNT; i++) {
138 ps3_free_event_irq(virqs[i]);
139 free_irq(virqs[i], (void*)(long)i); 139 free_irq(virqs[i], (void*)(long)i);
140 ps3_event_receive_port_destroy(virqs[i]);
140 virqs[i] = NO_IRQ; 141 virqs[i] = NO_IRQ;
141 } 142 }
143
142 DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); 144 DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);
143} 145}
144 146
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index a397e4e17c13..651437cb2c18 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -184,7 +184,7 @@ static int __init setup_areas(struct spu *spu)
184 184
185 spu_pdata(spu)->shadow = __ioremap( 185 spu_pdata(spu)->shadow = __ioremap(
186 spu_pdata(spu)->shadow_addr, sizeof(struct spe_shadow), 186 spu_pdata(spu)->shadow_addr, sizeof(struct spe_shadow),
187 PAGE_READONLY | _PAGE_NO_CACHE | _PAGE_GUARDED); 187 pgprot_val(PAGE_READONLY) | _PAGE_NO_CACHE | _PAGE_GUARDED);
188 if (!spu_pdata(spu)->shadow) { 188 if (!spu_pdata(spu)->shadow) {
189 pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__); 189 pr_debug("%s:%d: ioremap shadow failed\n", __func__, __LINE__);
190 goto fail_ioremap; 190 goto fail_ioremap;
@@ -230,19 +230,19 @@ static int __init setup_interrupts(struct spu *spu)
230{ 230{
231 int result; 231 int result;
232 232
233 result = ps3_alloc_spe_irq(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id, 233 result = ps3_spe_irq_setup(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
234 0, &spu->irqs[0]); 234 0, &spu->irqs[0]);
235 235
236 if (result) 236 if (result)
237 goto fail_alloc_0; 237 goto fail_alloc_0;
238 238
239 result = ps3_alloc_spe_irq(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id, 239 result = ps3_spe_irq_setup(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
240 1, &spu->irqs[1]); 240 1, &spu->irqs[1]);
241 241
242 if (result) 242 if (result)
243 goto fail_alloc_1; 243 goto fail_alloc_1;
244 244
245 result = ps3_alloc_spe_irq(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id, 245 result = ps3_spe_irq_setup(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
246 2, &spu->irqs[2]); 246 2, &spu->irqs[2]);
247 247
248 if (result) 248 if (result)
@@ -251,9 +251,9 @@ static int __init setup_interrupts(struct spu *spu)
251 return result; 251 return result;
252 252
253fail_alloc_2: 253fail_alloc_2:
254 ps3_free_spe_irq(spu->irqs[1]); 254 ps3_spe_irq_destroy(spu->irqs[1]);
255fail_alloc_1: 255fail_alloc_1:
256 ps3_free_spe_irq(spu->irqs[0]); 256 ps3_spe_irq_destroy(spu->irqs[0]);
257fail_alloc_0: 257fail_alloc_0:
258 spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ; 258 spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ;
259 return result; 259 return result;
@@ -301,9 +301,9 @@ static int ps3_destroy_spu(struct spu *spu)
301 result = lv1_disable_logical_spe(spu_pdata(spu)->spe_id, 0); 301 result = lv1_disable_logical_spe(spu_pdata(spu)->spe_id, 0);
302 BUG_ON(result); 302 BUG_ON(result);
303 303
304 ps3_free_spe_irq(spu->irqs[2]); 304 ps3_spe_irq_destroy(spu->irqs[2]);
305 ps3_free_spe_irq(spu->irqs[1]); 305 ps3_spe_irq_destroy(spu->irqs[1]);
306 ps3_free_spe_irq(spu->irqs[0]); 306 ps3_spe_irq_destroy(spu->irqs[0]);
307 307
308 spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ; 308 spu->irqs[0] = spu->irqs[1] = spu->irqs[2] = NO_IRQ;
309 309
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 66665c82415c..eec684a8e44e 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -504,6 +504,12 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
504 break; 504 break;
505 } 505 }
506 506
507 if (!pdn || !PCI_DN(pdn)) {
508 printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: "
509 "no DMA window found for pci dev=%s dn=%s\n",
510 pci_name(dev), dn? dn->full_name : "<null>");
511 return;
512 }
507 DBG(" parent is %s\n", pdn->full_name); 513 DBG(" parent is %s\n", pdn->full_name);
508 514
509 /* Check for parent == NULL so we don't try to setup the empty EADS 515 /* Check for parent == NULL so we don't try to setup the empty EADS
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 3a70e8ad7bc8..362dfbc260a6 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -231,13 +231,13 @@ void __init find_udbg_vterm(void)
231 goto out; 231 goto out;
232 vtermno = termno[0]; 232 vtermno = termno[0];
233 233
234 if (device_is_compatible(stdout_node, "hvterm1")) { 234 if (of_device_is_compatible(stdout_node, "hvterm1")) {
235 udbg_putc = udbg_putcLP; 235 udbg_putc = udbg_putcLP;
236 udbg_getc = udbg_getcLP; 236 udbg_getc = udbg_getcLP;
237 udbg_getc_poll = udbg_getc_pollLP; 237 udbg_getc_poll = udbg_getc_pollLP;
238 if (add_console) 238 if (add_console)
239 add_preferred_console("hvc", termno[0] & 0xff, NULL); 239 add_preferred_console("hvc", termno[0] & 0xff, NULL);
240 } else if (device_is_compatible(stdout_node, "hvterm-protocol")) { 240 } else if (of_device_is_compatible(stdout_node, "hvterm-protocol")) {
241 vtermno = termno[0]; 241 vtermno = termno[0];
242 udbg_putc = udbg_hvsi_putc; 242 udbg_putc = udbg_hvsi_putc;
243 udbg_getc = udbg_hvsi_getc; 243 udbg_getc = udbg_hvsi_getc;
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index fdc1a369f767..ffaf6c5c517b 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -79,6 +79,7 @@ pcibios_remove_pci_devices(struct pci_bus *bus)
79 pci_remove_bus_device(dev); 79 pci_remove_bus_device(dev);
80 } 80 }
81} 81}
82EXPORT_SYMBOL_GPL(pcibios_remove_pci_devices);
82 83
83/* Must be called before pci_bus_add_devices */ 84/* Must be called before pci_bus_add_devices */
84void 85void
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 33eec2822c66..470db6efaeb6 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -168,7 +168,7 @@ static void __init pseries_mpic_init_IRQ(void)
168 168
169 /* Look for cascade */ 169 /* Look for cascade */
170 for_each_node_by_type(np, "interrupt-controller") 170 for_each_node_by_type(np, "interrupt-controller")
171 if (device_is_compatible(np, "chrp,iic")) { 171 if (of_device_is_compatible(np, "chrp,iic")) {
172 cascade = np; 172 cascade = np;
173 break; 173 break;
174 } 174 }
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 896cbf340c42..b854e7f1001c 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -477,7 +477,7 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
477 * like vdevices, events, etc... The trick we use here is to match 477 * like vdevices, events, etc... The trick we use here is to match
478 * everything here except the legacy 8259 which is compatible "chrp,iic" 478 * everything here except the legacy 8259 which is compatible "chrp,iic"
479 */ 479 */
480 return !device_is_compatible(node, "chrp,iic"); 480 return !of_device_is_compatible(node, "chrp,iic");
481} 481}
482 482
483static int xics_host_map_direct(struct irq_host *h, unsigned int virq, 483static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
@@ -618,7 +618,7 @@ static void __init xics_setup_8259_cascade(void)
618 unsigned long intack = 0; 618 unsigned long intack = 0;
619 619
620 for_each_node_by_type(np, "interrupt-controller") 620 for_each_node_by_type(np, "interrupt-controller")
621 if (device_is_compatible(np, "chrp,iic")) { 621 if (of_device_is_compatible(np, "chrp,iic")) {
622 found = np; 622 found = np;
623 break; 623 break;
624 } 624 }
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 336186dd7f10..a1d2042bb304 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -36,6 +36,7 @@
36#include <linux/pci.h> 36#include <linux/pci.h>
37#include <linux/dma-mapping.h> 37#include <linux/dma-mapping.h>
38#include <linux/vmalloc.h> 38#include <linux/vmalloc.h>
39#include <linux/suspend.h>
39#include <asm/io.h> 40#include <asm/io.h>
40#include <asm/prom.h> 41#include <asm/prom.h>
41#include <asm/iommu.h> 42#include <asm/iommu.h>
@@ -54,6 +55,9 @@ static unsigned long dart_tablesize;
54 55
55/* Virtual base address of the DART table */ 56/* Virtual base address of the DART table */
56static u32 *dart_vbase; 57static u32 *dart_vbase;
58#ifdef CONFIG_PM
59static u32 *dart_copy;
60#endif
57 61
58/* Mapped base address for the dart */ 62/* Mapped base address for the dart */
59static unsigned int __iomem *dart; 63static unsigned int __iomem *dart;
@@ -346,6 +350,48 @@ void iommu_init_early_dart(void)
346 set_pci_dma_ops(&dma_direct_ops); 350 set_pci_dma_ops(&dma_direct_ops);
347} 351}
348 352
353#ifdef CONFIG_PM
354static void iommu_dart_save(void)
355{
356 memcpy(dart_copy, dart_vbase, 2*1024*1024);
357}
358
359static void iommu_dart_restore(void)
360{
361 memcpy(dart_vbase, dart_copy, 2*1024*1024);
362 dart_tlb_invalidate_all();
363}
364
365static int __init iommu_init_late_dart(void)
366{
367 unsigned long tbasepfn;
368 struct page *p;
369
370 /* if no dart table exists then we won't need to save it
371 * and the area has also not been reserved */
372 if (!dart_tablebase)
373 return 0;
374
375 tbasepfn = __pa(dart_tablebase) >> PAGE_SHIFT;
376 register_nosave_region_late(tbasepfn,
377 tbasepfn + ((1<<24) >> PAGE_SHIFT));
378
379 /* For suspend we need to copy the dart contents because
380 * it is not part of the regular mapping (see above) and
381 * thus not saved automatically. The memory for this copy
382 * must be allocated early because we need 2 MB. */
383 p = alloc_pages(GFP_KERNEL, 21 - PAGE_SHIFT);
384 BUG_ON(!p);
385 dart_copy = page_address(p);
386
387 ppc_md.iommu_save = iommu_dart_save;
388 ppc_md.iommu_restore = iommu_dart_restore;
389
390 return 0;
391}
392
393late_initcall(iommu_init_late_dart);
394#endif
349 395
350void __init alloc_dart_table(void) 396void __init alloc_dart_table(void)
351{ 397{
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 0b84b7c775d8..e88bbd5ec4c8 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -354,6 +354,12 @@ static void mpic_startup_ht_interrupt(struct mpic *mpic, unsigned int source,
354 tmp |= 0x22; 354 tmp |= 0x22;
355 writel(tmp, fixup->base + 4); 355 writel(tmp, fixup->base + 4);
356 spin_unlock_irqrestore(&mpic->fixup_lock, flags); 356 spin_unlock_irqrestore(&mpic->fixup_lock, flags);
357
358#ifdef CONFIG_PM
359 /* use the lowest bit inverted to the actual HW,
360 * set if this fixup was enabled, clear otherwise */
361 mpic->save_data[source].fixup_data = tmp | 1;
362#endif
357} 363}
358 364
359static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source, 365static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source,
@@ -375,6 +381,12 @@ static void mpic_shutdown_ht_interrupt(struct mpic *mpic, unsigned int source,
375 tmp |= 1; 381 tmp |= 1;
376 writel(tmp, fixup->base + 4); 382 writel(tmp, fixup->base + 4);
377 spin_unlock_irqrestore(&mpic->fixup_lock, flags); 383 spin_unlock_irqrestore(&mpic->fixup_lock, flags);
384
385#ifdef CONFIG_PM
386 /* use the lowest bit inverted to the actual HW,
387 * set if this fixup was enabled, clear otherwise */
388 mpic->save_data[source].fixup_data = tmp & ~1;
389#endif
378} 390}
379 391
380static void __init mpic_scan_ht_pic(struct mpic *mpic, u8 __iomem *devbase, 392static void __init mpic_scan_ht_pic(struct mpic *mpic, u8 __iomem *devbase,
@@ -1143,7 +1155,7 @@ void __init mpic_init(struct mpic *mpic)
1143 /* Do the HT PIC fixups on U3 broken mpic */ 1155 /* Do the HT PIC fixups on U3 broken mpic */
1144 DBG("MPIC flags: %x\n", mpic->flags); 1156 DBG("MPIC flags: %x\n", mpic->flags);
1145 if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY)) 1157 if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY))
1146 mpic_scan_ht_pics(mpic); 1158 mpic_scan_ht_pics(mpic);
1147 1159
1148 for (i = 0; i < mpic->num_sources; i++) { 1160 for (i = 0; i < mpic->num_sources; i++) {
1149 /* start with vector = source number, and masked */ 1161 /* start with vector = source number, and masked */
@@ -1167,6 +1179,12 @@ void __init mpic_init(struct mpic *mpic)
1167 1179
1168 /* Set current processor priority to 0 */ 1180 /* Set current processor priority to 0 */
1169 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0); 1181 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0);
1182
1183#ifdef CONFIG_PM
1184 /* allocate memory to save mpic state */
1185 mpic->save_data = alloc_bootmem(mpic->num_sources * sizeof(struct mpic_irq_save));
1186 BUG_ON(mpic->save_data == NULL);
1187#endif
1170} 1188}
1171 1189
1172void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio) 1190void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
@@ -1333,8 +1351,11 @@ unsigned int mpic_get_one_irq(struct mpic *mpic)
1333#ifdef DEBUG_LOW 1351#ifdef DEBUG_LOW
1334 DBG("%s: get_one_irq(): %d\n", mpic->name, src); 1352 DBG("%s: get_one_irq(): %d\n", mpic->name, src);
1335#endif 1353#endif
1336 if (unlikely(src == mpic->spurious_vec)) 1354 if (unlikely(src == mpic->spurious_vec)) {
1355 if (mpic->flags & MPIC_SPV_EOI)
1356 mpic_eoi(mpic);
1337 return NO_IRQ; 1357 return NO_IRQ;
1358 }
1338 return irq_linear_revmap(mpic->irqhost, src); 1359 return irq_linear_revmap(mpic->irqhost, src);
1339} 1360}
1340 1361
@@ -1417,3 +1438,79 @@ void __devinit smp_mpic_setup_cpu(int cpu)
1417 mpic_setup_this_cpu(); 1438 mpic_setup_this_cpu();
1418} 1439}
1419#endif /* CONFIG_SMP */ 1440#endif /* CONFIG_SMP */
1441
1442#ifdef CONFIG_PM
1443static int mpic_suspend(struct sys_device *dev, pm_message_t state)
1444{
1445 struct mpic *mpic = container_of(dev, struct mpic, sysdev);
1446 int i;
1447
1448 for (i = 0; i < mpic->num_sources; i++) {
1449 mpic->save_data[i].vecprio =
1450 mpic_irq_read(i, MPIC_INFO(IRQ_VECTOR_PRI));
1451 mpic->save_data[i].dest =
1452 mpic_irq_read(i, MPIC_INFO(IRQ_DESTINATION));
1453 }
1454
1455 return 0;
1456}
1457
1458static int mpic_resume(struct sys_device *dev)
1459{
1460 struct mpic *mpic = container_of(dev, struct mpic, sysdev);
1461 int i;
1462
1463 for (i = 0; i < mpic->num_sources; i++) {
1464 mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI),
1465 mpic->save_data[i].vecprio);
1466 mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION),
1467 mpic->save_data[i].dest);
1468
1469#ifdef CONFIG_MPIC_U3_HT_IRQS
1470 {
1471 struct mpic_irq_fixup *fixup = &mpic->fixups[i];
1472
1473 if (fixup->base) {
1474 /* we use the lowest bit in an inverted meaning */
1475 if ((mpic->save_data[i].fixup_data & 1) == 0)
1476 continue;
1477
1478 /* Enable and configure */
1479 writeb(0x10 + 2 * fixup->index, fixup->base + 2);
1480
1481 writel(mpic->save_data[i].fixup_data & ~1,
1482 fixup->base + 4);
1483 }
1484 }
1485#endif
1486 } /* end for loop */
1487
1488 return 0;
1489}
1490#endif
1491
1492static struct sysdev_class mpic_sysclass = {
1493#ifdef CONFIG_PM
1494 .resume = mpic_resume,
1495 .suspend = mpic_suspend,
1496#endif
1497 set_kset_name("mpic"),
1498};
1499
1500static int mpic_init_sys(void)
1501{
1502 struct mpic *mpic = mpics;
1503 int error, id = 0;
1504
1505 error = sysdev_class_register(&mpic_sysclass);
1506
1507 while (mpic && !error) {
1508 mpic->sysdev.cls = &mpic_sysclass;
1509 mpic->sysdev.id = id++;
1510 error = sysdev_register(&mpic->sysdev);
1511 mpic = mpic->next;
1512 }
1513 return error;
1514}
1515
1516device_initcall(mpic_init_sys);
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index 337039ee51e6..7d3b09b7d544 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -107,8 +107,9 @@ static int __init tsi108_eth_of_init(void)
107 goto err; 107 goto err;
108 } 108 }
109 109
110 mac_addr = of_get_property(np, "address", NULL); 110 mac_addr = of_get_mac_address(np);
111 memcpy(tsi_eth_data.mac_addr, mac_addr, 6); 111 if (mac_addr)
112 memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
112 113
113 ph = of_get_property(np, "phy-handle", NULL); 114 ph = of_get_property(np, "phy-handle", NULL);
114 phy = of_find_node_by_phandle(*ph); 115 phy = of_find_node_by_phandle(*ph);
@@ -129,6 +130,8 @@ static int __init tsi108_eth_of_init(void)
129 tsi_eth_data.phyregs = res.start; 130 tsi_eth_data.phyregs = res.start;
130 tsi_eth_data.phy = *phy_id; 131 tsi_eth_data.phy = *phy_id;
131 tsi_eth_data.irq_num = irq_of_parse_and_map(np, 0); 132 tsi_eth_data.irq_num = irq_of_parse_and_map(np, 0);
133 if (of_device_is_compatible(phy, "bcm54xx"))
134 tsi_eth_data.phy_type = TSI108_PHY_BCM54XX;
132 of_node_put(phy); 135 of_node_put(phy);
133 ret = 136 ret =
134 platform_device_add_data(tsi_eth_dev, &tsi_eth_data, 137 platform_device_add_data(tsi_eth_dev, &tsi_eth_data,
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 58b9e7f8abf2..2153163fa593 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -35,6 +35,7 @@
35#include <asm/machdep.h> 35#include <asm/machdep.h>
36#include <asm/pci-bridge.h> 36#include <asm/pci-bridge.h>
37#include <asm/tsi108.h> 37#include <asm/tsi108.h>
38#include <asm/tsi108_pci.h>
38#include <asm/tsi108_irq.h> 39#include <asm/tsi108_irq.h>
39#include <asm/prom.h> 40#include <asm/prom.h>
40 41
@@ -49,6 +50,7 @@
49 ((((bus)<<16) | ((devfunc)<<8) | (offset & 0xfc)) + tsi108_pci_cfg_base) 50 ((((bus)<<16) | ((devfunc)<<8) | (offset & 0xfc)) + tsi108_pci_cfg_base)
50 51
51u32 tsi108_pci_cfg_base; 52u32 tsi108_pci_cfg_base;
53static u32 tsi108_pci_cfg_phys;
52u32 tsi108_csr_vir_base; 54u32 tsi108_csr_vir_base;
53static struct device_node *pci_irq_node; 55static struct device_node *pci_irq_node;
54static struct irq_host *pci_irq_host; 56static struct irq_host *pci_irq_host;
@@ -185,7 +187,7 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
185 187
186void tsi108_clear_pci_cfg_error(void) 188void tsi108_clear_pci_cfg_error(void)
187{ 189{
188 tsi108_clear_pci_error(TSI108_PCI_CFG_BASE_PHYS); 190 tsi108_clear_pci_error(tsi108_pci_cfg_phys);
189} 191}
190 192
191static struct pci_ops tsi108_direct_pci_ops = { 193static struct pci_ops tsi108_direct_pci_ops = {
@@ -193,17 +195,17 @@ static struct pci_ops tsi108_direct_pci_ops = {
193 tsi108_direct_write_config 195 tsi108_direct_write_config
194}; 196};
195 197
196int __init tsi108_setup_pci(struct device_node *dev) 198int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary)
197{ 199{
198 int len; 200 int len;
199 struct pci_controller *hose; 201 struct pci_controller *hose;
200 struct resource rsrc; 202 struct resource rsrc;
201 const int *bus_range; 203 const int *bus_range;
202 int primary = 0, has_address = 0; 204 int has_address = 0;
203 205
204 /* PCI Config mapping */ 206 /* PCI Config mapping */
205 tsi108_pci_cfg_base = (u32)ioremap(TSI108_PCI_CFG_BASE_PHYS, 207 tsi108_pci_cfg_base = (u32)ioremap(cfg_phys, TSI108_PCI_CFG_SIZE);
206 TSI108_PCI_CFG_SIZE); 208 tsi108_pci_cfg_phys = cfg_phys;
207 DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __FUNCTION__, 209 DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __FUNCTION__,
208 tsi108_pci_cfg_base); 210 tsi108_pci_cfg_base);
209 211
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 968fb40af9dc..89059895a20d 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -221,7 +221,7 @@ static struct uic * __init uic_init_one(struct device_node *node)
221 const u32 *indexp, *dcrreg; 221 const u32 *indexp, *dcrreg;
222 int len; 222 int len;
223 223
224 BUG_ON(! device_is_compatible(node, "ibm,uic")); 224 BUG_ON(! of_device_is_compatible(node, "ibm,uic"));
225 225
226 uic = alloc_bootmem(sizeof(*uic)); 226 uic = alloc_bootmem(sizeof(*uic));
227 if (! uic) 227 if (! uic)
diff --git a/arch/ppc/syslib/ppc4xx_sgdma.c b/arch/ppc/syslib/ppc4xx_sgdma.c
index 5dadca3e0d61..c4b369b50f9c 100644
--- a/arch/ppc/syslib/ppc4xx_sgdma.c
+++ b/arch/ppc/syslib/ppc4xx_sgdma.c
@@ -23,10 +23,10 @@
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/dma-mapping.h>
26 27
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/io.h> 29#include <asm/io.h>
29#include <asm/dma-mapping.h>
30#include <asm/ppc4xx_dma.h> 30#include <asm/ppc4xx_dma.h>
31 31
32void 32void
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index cc07aac10e8c..17246734fe76 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -288,7 +288,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
288 /* Match it to a port node */ 288 /* Match it to a port node */
289 index = (ap == ap->host->ports[0]) ? 0 : 1; 289 index = (ap == ap->host->ports[0]) ? 0 : 1;
290 for (np = np->child; np != NULL; np = np->sibling) { 290 for (np = np->child; np != NULL; np = np->sibling) {
291 const u32 *reg = get_property(np, "reg", NULL); 291 const u32 *reg = of_get_property(np, "reg", NULL);
292 if (!reg) 292 if (!reg)
293 continue; 293 continue;
294 if (index == *reg) 294 if (index == *reg)
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 91b062126a68..42c0a600b1ac 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -613,7 +613,7 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
613 uninorth_node = of_find_node_by_name(NULL, "u3"); 613 uninorth_node = of_find_node_by_name(NULL, "u3");
614 } 614 }
615 if (uninorth_node) { 615 if (uninorth_node) {
616 const int *revprop = get_property(uninorth_node, 616 const int *revprop = of_get_property(uninorth_node,
617 "device-rev", NULL); 617 "device-rev", NULL);
618 if (revprop != NULL) 618 if (revprop != NULL)
619 uninorth_rev = *revprop & 0x3f; 619 uninorth_rev = *revprop & 0x3f;
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c
index c70d52ace8b2..ed53f541d9e8 100644
--- a/drivers/char/briq_panel.c
+++ b/drivers/char/briq_panel.c
@@ -206,7 +206,7 @@ static int __init briq_panel_init(void)
206 const char *machine; 206 const char *machine;
207 int i; 207 int i;
208 208
209 machine = get_property(root, "model", NULL); 209 machine = of_get_property(root, "model", NULL);
210 if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) { 210 if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) {
211 of_node_put(root); 211 of_node_put(root);
212 return -ENODEV; 212 return -ENODEV;
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index ec420fe8a908..b37f1d5a5be6 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -579,7 +579,7 @@ static int hvc_find_vtys(void)
579 if (!vtermno) 579 if (!vtermno)
580 continue; 580 continue;
581 581
582 if (!device_is_compatible(vty, "IBM,iSeries-vty")) 582 if (!of_device_is_compatible(vty, "IBM,iSeries-vty"))
583 continue; 583 continue;
584 584
585 if (num_found == 0) 585 if (num_found == 0)
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index 94a542e20efb..79711aa4b41d 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -157,7 +157,7 @@ static int hvc_find_vtys(void)
157 if (!vtermno) 157 if (!vtermno)
158 continue; 158 continue;
159 159
160 if (device_is_compatible(vty, "hvterm1")) { 160 if (of_device_is_compatible(vty, "hvterm1")) {
161 hvc_instantiate(*vtermno, num_found, &hvc_get_put_ops); 161 hvc_instantiate(*vtermno, num_found, &hvc_get_put_ops);
162 ++num_found; 162 ++num_found;
163 } 163 }
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index 3c852009196e..c912d8691cbd 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -47,12 +47,12 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
47 if (!dn) 47 if (!dn)
48 return NULL; 48 return NULL;
49 49
50 if (!device_is_compatible(dn, "AT97SC3201")) { 50 if (!of_device_is_compatible(dn, "AT97SC3201")) {
51 of_node_put(dn); 51 of_node_put(dn);
52 return NULL; 52 return NULL;
53 } 53 }
54 54
55 reg = get_property(dn, "reg", &reglen); 55 reg = of_get_property(dn, "reg", &reglen);
56 naddrc = of_n_addr_cells(dn); 56 naddrc = of_n_addr_cells(dn);
57 nsizec = of_n_size_cells(dn); 57 nsizec = of_n_size_cells(dn);
58 58
diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c
index f5ebad561412..dbe6a32c064e 100644
--- a/drivers/hwmon/ams/ams-core.c
+++ b/drivers/hwmon/ams/ams-core.c
@@ -144,7 +144,7 @@ int ams_sensor_attach(void)
144 const u32 *prop; 144 const u32 *prop;
145 145
146 /* Get orientation */ 146 /* Get orientation */
147 prop = get_property(ams_info.of_node, "orientation", NULL); 147 prop = of_get_property(ams_info.of_node, "orientation", NULL);
148 if (!prop) 148 if (!prop)
149 return -ENODEV; 149 return -ENODEV;
150 ams_info.orient1 = *prop; 150 ams_info.orient1 = *prop;
@@ -208,14 +208,14 @@ int __init ams_init(void)
208 208
209#ifdef CONFIG_SENSORS_AMS_I2C 209#ifdef CONFIG_SENSORS_AMS_I2C
210 np = of_find_node_by_name(NULL, "accelerometer"); 210 np = of_find_node_by_name(NULL, "accelerometer");
211 if (np && device_is_compatible(np, "AAPL,accelerometer_1")) 211 if (np && of_device_is_compatible(np, "AAPL,accelerometer_1"))
212 /* Found I2C motion sensor */ 212 /* Found I2C motion sensor */
213 return ams_i2c_init(np); 213 return ams_i2c_init(np);
214#endif 214#endif
215 215
216#ifdef CONFIG_SENSORS_AMS_PMU 216#ifdef CONFIG_SENSORS_AMS_PMU
217 np = of_find_node_by_name(NULL, "sms"); 217 np = of_find_node_by_name(NULL, "sms");
218 if (np && device_is_compatible(np, "sms")) 218 if (np && of_device_is_compatible(np, "sms"))
219 /* Found PMU motion sensor */ 219 /* Found PMU motion sensor */
220 return ams_pmu_init(np); 220 return ams_pmu_init(np);
221#endif 221#endif
diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
index 485d333bcb3e..ccd5cefae90e 100644
--- a/drivers/hwmon/ams/ams-i2c.c
+++ b/drivers/hwmon/ams/ams-i2c.c
@@ -276,7 +276,7 @@ int __init ams_i2c_init(struct device_node *np)
276 ams_info.bustype = BUS_I2C; 276 ams_info.bustype = BUS_I2C;
277 277
278 /* look for bus either using "reg" or by path */ 278 /* look for bus either using "reg" or by path */
279 prop = get_property(ams_info.of_node, "reg", NULL); 279 prop = of_get_property(ams_info.of_node, "reg", NULL);
280 if (!prop) { 280 if (!prop) {
281 result = -ENODEV; 281 result = -ENODEV;
282 282
diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c
index 1b01c215bfe7..9463e9768f6f 100644
--- a/drivers/hwmon/ams/ams-pmu.c
+++ b/drivers/hwmon/ams/ams-pmu.c
@@ -160,7 +160,7 @@ int __init ams_pmu_init(struct device_node *np)
160 ams_info.bustype = BUS_HOST; 160 ams_info.bustype = BUS_HOST;
161 161
162 /* Get PMU command, should be 0x4e, but we can never know */ 162 /* Get PMU command, should be 0x4e, but we can never know */
163 prop = get_property(ams_info.of_node, "reg", NULL); 163 prop = of_get_property(ams_info.of_node, "reg", NULL);
164 if (!prop) { 164 if (!prop) {
165 result = -ENODEV; 165 result = -ENODEV;
166 goto exit; 166 goto exit;
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 2da5cbb53566..2cdd629c653d 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -395,7 +395,7 @@ static void __devinit apple_kiwi_init(struct pci_dev *pdev)
395 unsigned int class_rev = 0; 395 unsigned int class_rev = 0;
396 u8 conf; 396 u8 conf;
397 397
398 if (np == NULL || !device_is_compatible(np, "kiwi-root")) 398 if (np == NULL || !of_device_is_compatible(np, "kiwi-root"))
399 return; 399 return;
400 400
401 pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev); 401 pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 071a030ec26e..a49ebe44babd 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1157,32 +1157,32 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1157 1157
1158 pmif->cable_80 = 0; 1158 pmif->cable_80 = 0;
1159 pmif->broken_dma = pmif->broken_dma_warn = 0; 1159 pmif->broken_dma = pmif->broken_dma_warn = 0;
1160 if (device_is_compatible(np, "shasta-ata")) 1160 if (of_device_is_compatible(np, "shasta-ata"))
1161 pmif->kind = controller_sh_ata6; 1161 pmif->kind = controller_sh_ata6;
1162 else if (device_is_compatible(np, "kauai-ata")) 1162 else if (of_device_is_compatible(np, "kauai-ata"))
1163 pmif->kind = controller_un_ata6; 1163 pmif->kind = controller_un_ata6;
1164 else if (device_is_compatible(np, "K2-UATA")) 1164 else if (of_device_is_compatible(np, "K2-UATA"))
1165 pmif->kind = controller_k2_ata6; 1165 pmif->kind = controller_k2_ata6;
1166 else if (device_is_compatible(np, "keylargo-ata")) { 1166 else if (of_device_is_compatible(np, "keylargo-ata")) {
1167 if (strcmp(np->name, "ata-4") == 0) 1167 if (strcmp(np->name, "ata-4") == 0)
1168 pmif->kind = controller_kl_ata4; 1168 pmif->kind = controller_kl_ata4;
1169 else 1169 else
1170 pmif->kind = controller_kl_ata3; 1170 pmif->kind = controller_kl_ata3;
1171 } else if (device_is_compatible(np, "heathrow-ata")) 1171 } else if (of_device_is_compatible(np, "heathrow-ata"))
1172 pmif->kind = controller_heathrow; 1172 pmif->kind = controller_heathrow;
1173 else { 1173 else {
1174 pmif->kind = controller_ohare; 1174 pmif->kind = controller_ohare;
1175 pmif->broken_dma = 1; 1175 pmif->broken_dma = 1;
1176 } 1176 }
1177 1177
1178 bidp = get_property(np, "AAPL,bus-id", NULL); 1178 bidp = of_get_property(np, "AAPL,bus-id", NULL);
1179 pmif->aapl_bus_id = bidp ? *bidp : 0; 1179 pmif->aapl_bus_id = bidp ? *bidp : 0;
1180 1180
1181 /* Get cable type from device-tree */ 1181 /* Get cable type from device-tree */
1182 if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6 1182 if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6
1183 || pmif->kind == controller_k2_ata6 1183 || pmif->kind == controller_k2_ata6
1184 || pmif->kind == controller_sh_ata6) { 1184 || pmif->kind == controller_sh_ata6) {
1185 const char* cable = get_property(np, "cable-type", NULL); 1185 const char* cable = of_get_property(np, "cable-type", NULL);
1186 if (cable && !strncmp(cable, "80-", 3)) 1186 if (cable && !strncmp(cable, "80-", 3))
1187 pmif->cable_80 = 1; 1187 pmif->cable_80 = 1;
1188 } 1188 }
@@ -1190,8 +1190,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1190 * they have a 80 conductor cable, this seem to be always the case unless 1190 * they have a 80 conductor cable, this seem to be always the case unless
1191 * the user mucked around 1191 * the user mucked around
1192 */ 1192 */
1193 if (device_is_compatible(np, "K2-UATA") || 1193 if (of_device_is_compatible(np, "K2-UATA") ||
1194 device_is_compatible(np, "shasta-ata")) 1194 of_device_is_compatible(np, "shasta-ata"))
1195 pmif->cable_80 = 1; 1195 pmif->cable_80 = 1;
1196 1196
1197 /* On Kauai-type controllers, we make sure the FCR is correct */ 1197 /* On Kauai-type controllers, we make sure the FCR is correct */
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index 2d370543e96d..fe90e7454560 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -570,7 +570,7 @@ static int __devinit ehca_probe(struct ibmebus_dev *dev,
570 struct ib_pd *ibpd; 570 struct ib_pd *ibpd;
571 int ret; 571 int ret;
572 572
573 handle = get_property(dev->ofdev.node, "ibm,hca-handle", NULL); 573 handle = of_get_property(dev->ofdev.node, "ibm,hca-handle", NULL);
574 if (!handle) { 574 if (!handle) {
575 ehca_gen_err("Cannot get eHCA handle for adapter: %s.", 575 ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
576 dev->ofdev.node->full_name); 576 dev->ofdev.node->full_name);
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 1a86387e23be..a32c91e27b3c 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -1,6 +1,10 @@
1 1
2menu "Macintosh device drivers" 2menuconfig MACINTOSH_DRIVERS
3 bool "Macintosh device drivers"
3 depends on PPC || MAC || X86 4 depends on PPC || MAC || X86
5 default y
6
7if MACINTOSH_DRIVERS
4 8
5config ADB 9config ADB
6 bool "Apple Desktop Bus (ADB) support" 10 bool "Apple Desktop Bus (ADB) support"
@@ -109,7 +113,9 @@ config PMAC_SMU
109 113
110config PMAC_APM_EMU 114config PMAC_APM_EMU
111 tristate "APM emulation" 115 tristate "APM emulation"
112 depends on PPC_PMAC && PPC32 && PM && ADB_PMU 116 select SYS_SUPPORTS_APM_EMULATION
117 select APM_EMULATION
118 depends on ADB_PMU && PM
113 119
114config PMAC_MEDIABAY 120config PMAC_MEDIABAY
115 bool "Support PowerBook hotswap media bay" 121 bool "Support PowerBook hotswap media bay"
@@ -234,4 +240,4 @@ config PMAC_RACKMETER
234 This driver procides some support to control the front panel 240 This driver procides some support to control the front panel
235 blue LEDs "vu-meter" of the XServer macs. 241 blue LEDs "vu-meter" of the XServer macs.
236 242
237endmenu 243endif # MACINTOSH_DRIVERS
diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c
index cdb0bead9917..9821e6361e60 100644
--- a/drivers/macintosh/apm_emu.c
+++ b/drivers/macintosh/apm_emu.c
@@ -1,9 +1,7 @@
1/* APM emulation layer for PowerMac 1/*
2 * 2 * APM emulation for PMU-based machines
3 * Copyright 2001 Benjamin Herrenschmidt (benh@kernel.crashing.org)
4 * 3 *
5 * Lots of code inherited from apm.c, see appropriate notice in 4 * Copyright 2001 Benjamin Herrenschmidt (benh@kernel.crashing.org)
6 * arch/i386/kernel/apm.c
7 * 5 *
8 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 7 * under the terms of the GNU General Public License as published by the
@@ -18,429 +16,39 @@
18 * 16 *
19 */ 17 */
20 18
21#include <linux/module.h>
22
23#include <linux/poll.h>
24#include <linux/types.h>
25#include <linux/stddef.h>
26#include <linux/timer.h>
27#include <linux/fcntl.h>
28#include <linux/slab.h>
29#include <linux/stat.h>
30#include <linux/proc_fs.h>
31#include <linux/miscdevice.h>
32#include <linux/apm_bios.h>
33#include <linux/init.h>
34#include <linux/sched.h>
35#include <linux/pm.h>
36#include <linux/kernel.h> 19#include <linux/kernel.h>
37#include <linux/smp_lock.h> 20#include <linux/module.h>
38 21#include <linux/apm-emulation.h>
39#include <linux/adb.h> 22#include <linux/adb.h>
40#include <linux/pmu.h> 23#include <linux/pmu.h>
41 24
42#include <asm/system.h>
43#include <asm/uaccess.h>
44#include <asm/machdep.h>
45
46#undef DEBUG
47
48#ifdef DEBUG
49#define DBG(args...) printk(KERN_DEBUG args)
50//#define DBG(args...) xmon_printf(args)
51#else
52#define DBG(args...) do { } while (0)
53#endif
54
55/*
56 * The apm_bios device is one of the misc char devices.
57 * This is its minor number.
58 */
59#define APM_MINOR_DEV 134
60
61/*
62 * Maximum number of events stored
63 */
64#define APM_MAX_EVENTS 20
65
66#define FAKE_APM_BIOS_VERSION 0x0101
67
68#define APM_USER_NOTIFY_TIMEOUT (5*HZ)
69
70/*
71 * The per-file APM data
72 */
73struct apm_user {
74 int magic;
75 struct apm_user * next;
76 int suser: 1;
77 int suspend_waiting: 1;
78 int suspends_pending;
79 int suspends_read;
80 int event_head;
81 int event_tail;
82 apm_event_t events[APM_MAX_EVENTS];
83};
84
85/*
86 * The magic number in apm_user
87 */
88#define APM_BIOS_MAGIC 0x4101
89
90/*
91 * Local variables
92 */
93static int suspends_pending;
94
95static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
96static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
97static struct apm_user * user_list;
98
99static void apm_notify_sleep(struct pmu_sleep_notifier *self, int when);
100static struct pmu_sleep_notifier apm_sleep_notifier = {
101 apm_notify_sleep,
102 SLEEP_LEVEL_USERLAND,
103};
104
105static const char driver_version[] = "0.5"; /* no spaces */
106
107#ifdef DEBUG
108static char * apm_event_name[] = {
109 "system standby",
110 "system suspend",
111 "normal resume",
112 "critical resume",
113 "low battery",
114 "power status change",
115 "update time",
116 "critical suspend",
117 "user standby",
118 "user suspend",
119 "system standby resume",
120 "capabilities change"
121};
122#define NR_APM_EVENT_NAME \
123 (sizeof(apm_event_name) / sizeof(apm_event_name[0]))
124
125#endif
126
127static int queue_empty(struct apm_user *as)
128{
129 return as->event_head == as->event_tail;
130}
131
132static apm_event_t get_queued_event(struct apm_user *as)
133{
134 as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS;
135 return as->events[as->event_tail];
136}
137
138static void queue_event(apm_event_t event, struct apm_user *sender)
139{
140 struct apm_user * as;
141
142 DBG("apm_emu: queue_event(%s)\n", apm_event_name[event-1]);
143 if (user_list == NULL)
144 return;
145 for (as = user_list; as != NULL; as = as->next) {
146 if (as == sender)
147 continue;
148 as->event_head = (as->event_head + 1) % APM_MAX_EVENTS;
149 if (as->event_head == as->event_tail) {
150 static int notified;
151
152 if (notified++ == 0)
153 printk(KERN_ERR "apm_emu: an event queue overflowed\n");
154 as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS;
155 }
156 as->events[as->event_head] = event;
157 if (!as->suser)
158 continue;
159 switch (event) {
160 case APM_SYS_SUSPEND:
161 case APM_USER_SUSPEND:
162 as->suspends_pending++;
163 suspends_pending++;
164 break;
165 case APM_NORMAL_RESUME:
166 as->suspend_waiting = 0;
167 break;
168 }
169 }
170 wake_up_interruptible(&apm_waitqueue);
171}
172
173static int check_apm_user(struct apm_user *as, const char *func)
174{
175 if ((as == NULL) || (as->magic != APM_BIOS_MAGIC)) {
176 printk(KERN_ERR "apm_emu: %s passed bad filp\n", func);
177 return 1;
178 }
179 return 0;
180}
181
182static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
183{
184 struct apm_user * as;
185 size_t i;
186 apm_event_t event;
187 DECLARE_WAITQUEUE(wait, current);
188
189 as = fp->private_data;
190 if (check_apm_user(as, "read"))
191 return -EIO;
192 if (count < sizeof(apm_event_t))
193 return -EINVAL;
194 if (queue_empty(as)) {
195 if (fp->f_flags & O_NONBLOCK)
196 return -EAGAIN;
197 add_wait_queue(&apm_waitqueue, &wait);
198repeat:
199 set_current_state(TASK_INTERRUPTIBLE);
200 if (queue_empty(as) && !signal_pending(current)) {
201 schedule();
202 goto repeat;
203 }
204 set_current_state(TASK_RUNNING);
205 remove_wait_queue(&apm_waitqueue, &wait);
206 }
207 i = count;
208 while ((i >= sizeof(event)) && !queue_empty(as)) {
209 event = get_queued_event(as);
210 DBG("apm_emu: do_read, returning: %s\n", apm_event_name[event-1]);
211 if (copy_to_user(buf, &event, sizeof(event))) {
212 if (i < count)
213 break;
214 return -EFAULT;
215 }
216 switch (event) {
217 case APM_SYS_SUSPEND:
218 case APM_USER_SUSPEND:
219 as->suspends_read++;
220 break;
221 }
222 buf += sizeof(event);
223 i -= sizeof(event);
224 }
225 if (i < count)
226 return count - i;
227 if (signal_pending(current))
228 return -ERESTARTSYS;
229 return 0;
230}
231
232static unsigned int do_poll(struct file *fp, poll_table * wait)
233{
234 struct apm_user * as;
235
236 as = fp->private_data;
237 if (check_apm_user(as, "poll"))
238 return 0;
239 poll_wait(fp, &apm_waitqueue, wait);
240 if (!queue_empty(as))
241 return POLLIN | POLLRDNORM;
242 return 0;
243}
244
245static int do_ioctl(struct inode * inode, struct file *filp,
246 u_int cmd, u_long arg)
247{
248 struct apm_user * as;
249 DECLARE_WAITQUEUE(wait, current);
250
251 as = filp->private_data;
252 if (check_apm_user(as, "ioctl"))
253 return -EIO;
254 if (!as->suser)
255 return -EPERM;
256 switch (cmd) {
257 case APM_IOC_SUSPEND:
258 /* If a suspend message was sent to userland, we
259 * consider this as a confirmation message
260 */
261 if (as->suspends_read > 0) {
262 as->suspends_read--;
263 as->suspends_pending--;
264 suspends_pending--;
265 } else {
266 // Route to PMU suspend ?
267 break;
268 }
269 as->suspend_waiting = 1;
270 add_wait_queue(&apm_waitqueue, &wait);
271 DBG("apm_emu: ioctl waking up sleep waiter !\n");
272 wake_up(&apm_suspend_waitqueue);
273 mb();
274 while(as->suspend_waiting && !signal_pending(current)) {
275 set_current_state(TASK_INTERRUPTIBLE);
276 schedule();
277 }
278 set_current_state(TASK_RUNNING);
279 remove_wait_queue(&apm_waitqueue, &wait);
280 break;
281 default:
282 return -EINVAL;
283 }
284 return 0;
285}
286
287static int do_release(struct inode * inode, struct file * filp)
288{
289 struct apm_user * as;
290
291 as = filp->private_data;
292 if (check_apm_user(as, "release"))
293 return 0;
294 filp->private_data = NULL;
295 lock_kernel();
296 if (as->suspends_pending > 0) {
297 suspends_pending -= as->suspends_pending;
298 if (suspends_pending <= 0)
299 wake_up(&apm_suspend_waitqueue);
300 }
301 if (user_list == as)
302 user_list = as->next;
303 else {
304 struct apm_user * as1;
305
306 for (as1 = user_list;
307 (as1 != NULL) && (as1->next != as);
308 as1 = as1->next)
309 ;
310 if (as1 == NULL)
311 printk(KERN_ERR "apm: filp not in user list\n");
312 else
313 as1->next = as->next;
314 }
315 unlock_kernel();
316 kfree(as);
317 return 0;
318}
319
320static int do_open(struct inode * inode, struct file * filp)
321{
322 struct apm_user * as;
323
324 as = kmalloc(sizeof(*as), GFP_KERNEL);
325 if (as == NULL) {
326 printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
327 sizeof(*as));
328 return -ENOMEM;
329 }
330 as->magic = APM_BIOS_MAGIC;
331 as->event_tail = as->event_head = 0;
332 as->suspends_pending = 0;
333 as->suspends_read = 0;
334 /*
335 * XXX - this is a tiny bit broken, when we consider BSD
336 * process accounting. If the device is opened by root, we
337 * instantly flag that we used superuser privs. Who knows,
338 * we might close the device immediately without doing a
339 * privileged operation -- cevans
340 */
341 as->suser = capable(CAP_SYS_ADMIN);
342 as->next = user_list;
343 user_list = as;
344 filp->private_data = as;
345
346 DBG("apm_emu: opened by %s, suser: %d\n", current->comm, (int)as->suser);
347
348 return 0;
349}
350
351/* Wait for all clients to ack the suspend request. APM API
352 * doesn't provide a way to NAK, but this could be added
353 * here.
354 */
355static void wait_all_suspend(void)
356{
357 DECLARE_WAITQUEUE(wait, current);
358
359 add_wait_queue(&apm_suspend_waitqueue, &wait);
360 DBG("apm_emu: wait_all_suspend(), suspends_pending: %d\n", suspends_pending);
361 while(suspends_pending > 0) {
362 set_current_state(TASK_UNINTERRUPTIBLE);
363 schedule();
364 }
365 set_current_state(TASK_RUNNING);
366 remove_wait_queue(&apm_suspend_waitqueue, &wait);
367
368 DBG("apm_emu: wait_all_suspend() - complete !\n");
369}
370
371static void apm_notify_sleep(struct pmu_sleep_notifier *self, int when)
372{
373 switch(when) {
374 case PBOOK_SLEEP_REQUEST:
375 queue_event(APM_SYS_SUSPEND, NULL);
376 wait_all_suspend();
377 break;
378 case PBOOK_WAKE:
379 queue_event(APM_NORMAL_RESUME, NULL);
380 break;
381 }
382}
383
384#define APM_CRITICAL 10 25#define APM_CRITICAL 10
385#define APM_LOW 30 26#define APM_LOW 30
386 27
387static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length) 28static void pmu_apm_get_power_status(struct apm_power_info *info)
388{ 29{
389 /* Arguments, with symbols from linux/apm_bios.h. Information is 30 int percentage = -1;
390 from the Get Power Status (0x0a) call unless otherwise noted. 31 int batteries = 0;
32 int time_units = -1;
33 int real_count = 0;
34 int i;
35 char charging = 0;
36 long charge = -1;
37 long amperage = 0;
38 unsigned long btype = 0;
39
40 info->battery_status = APM_BATTERY_STATUS_UNKNOWN;
41 info->battery_flag = APM_BATTERY_FLAG_UNKNOWN;
42 info->units = APM_UNITS_MINS;
43
44 if (pmu_power_flags & PMU_PWR_AC_PRESENT)
45 info->ac_line_status = APM_AC_ONLINE;
46 else
47 info->ac_line_status = APM_AC_OFFLINE;
391 48
392 0) Linux driver version (this will change if format changes)
393 1) APM BIOS Version. Usually 1.0, 1.1 or 1.2.
394 2) APM flags from APM Installation Check (0x00):
395 bit 0: APM_16_BIT_SUPPORT
396 bit 1: APM_32_BIT_SUPPORT
397 bit 2: APM_IDLE_SLOWS_CLOCK
398 bit 3: APM_BIOS_DISABLED
399 bit 4: APM_BIOS_DISENGAGED
400 3) AC line status
401 0x00: Off-line
402 0x01: On-line
403 0x02: On backup power (BIOS >= 1.1 only)
404 0xff: Unknown
405 4) Battery status
406 0x00: High
407 0x01: Low
408 0x02: Critical
409 0x03: Charging
410 0x04: Selected battery not present (BIOS >= 1.2 only)
411 0xff: Unknown
412 5) Battery flag
413 bit 0: High
414 bit 1: Low
415 bit 2: Critical
416 bit 3: Charging
417 bit 7: No system battery
418 0xff: Unknown
419 6) Remaining battery life (percentage of charge):
420 0-100: valid
421 -1: Unknown
422 7) Remaining battery life (time units):
423 Number of remaining minutes or seconds
424 -1: Unknown
425 8) min = minutes; sec = seconds */
426
427 unsigned short ac_line_status;
428 unsigned short battery_status = 0;
429 unsigned short battery_flag = 0xff;
430 int percentage = -1;
431 int time_units = -1;
432 int real_count = 0;
433 int i;
434 char * p = buf;
435 char charging = 0;
436 long charge = -1;
437 long amperage = 0;
438 unsigned long btype = 0;
439
440 ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0);
441 for (i=0; i<pmu_battery_count; i++) { 49 for (i=0; i<pmu_battery_count; i++) {
442 if (pmu_batteries[i].flags & PMU_BATT_PRESENT) { 50 if (pmu_batteries[i].flags & PMU_BATT_PRESENT) {
443 battery_status++; 51 batteries++;
444 if (percentage < 0) 52 if (percentage < 0)
445 percentage = 0; 53 percentage = 0;
446 if (charge < 0) 54 if (charge < 0)
@@ -456,9 +64,9 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
456 charging++; 64 charging++;
457 } 65 }
458 } 66 }
459 if (0 == battery_status) 67 if (batteries == 0)
460 ac_line_status = 1; 68 info->ac_line_status = APM_AC_ONLINE;
461 battery_status = 0xff; 69
462 if (real_count) { 70 if (real_count) {
463 if (amperage < 0) { 71 if (amperage < 0) {
464 if (btype == PMU_BATT_TYPE_SMART) 72 if (btype == PMU_BATT_TYPE_SMART)
@@ -468,85 +76,44 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
468 } 76 }
469 percentage /= real_count; 77 percentage /= real_count;
470 if (charging > 0) { 78 if (charging > 0) {
471 battery_status = 0x03; 79 info->battery_status = APM_BATTERY_STATUS_CHARGING;
472 battery_flag = 0x08; 80 info->battery_flag = APM_BATTERY_FLAG_CHARGING;
473 } else if (percentage <= APM_CRITICAL) { 81 } else if (percentage <= APM_CRITICAL) {
474 battery_status = 0x02; 82 info->battery_status = APM_BATTERY_STATUS_CRITICAL;
475 battery_flag = 0x04; 83 info->battery_flag = APM_BATTERY_FLAG_CRITICAL;
476 } else if (percentage <= APM_LOW) { 84 } else if (percentage <= APM_LOW) {
477 battery_status = 0x01; 85 info->battery_status = APM_BATTERY_STATUS_LOW;
478 battery_flag = 0x02; 86 info->battery_flag = APM_BATTERY_FLAG_LOW;
479 } else { 87 } else {
480 battery_status = 0x00; 88 info->battery_status = APM_BATTERY_STATUS_HIGH;
481 battery_flag = 0x01; 89 info->battery_flag = APM_BATTERY_FLAG_HIGH;
482 } 90 }
483 } 91 }
484 p += sprintf(p, "%s %d.%d 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
485 driver_version,
486 (FAKE_APM_BIOS_VERSION >> 8) & 0xff,
487 FAKE_APM_BIOS_VERSION & 0xff,
488 0,
489 ac_line_status,
490 battery_status,
491 battery_flag,
492 percentage,
493 time_units,
494 "min");
495 92
496 return p - buf; 93 info->battery_life = percentage;
94 info->time = time_units;
497} 95}
498 96
499static const struct file_operations apm_bios_fops = {
500 .owner = THIS_MODULE,
501 .read = do_read,
502 .poll = do_poll,
503 .ioctl = do_ioctl,
504 .open = do_open,
505 .release = do_release,
506};
507
508static struct miscdevice apm_device = {
509 APM_MINOR_DEV,
510 "apm_bios",
511 &apm_bios_fops
512};
513
514static int __init apm_emu_init(void) 97static int __init apm_emu_init(void)
515{ 98{
516 struct proc_dir_entry *apm_proc; 99 apm_get_power_status = pmu_apm_get_power_status;
517
518 if (sys_ctrler != SYS_CTRLER_PMU) {
519 printk(KERN_INFO "apm_emu: Requires a machine with a PMU.\n");
520 return -ENODEV;
521 }
522
523 apm_proc = create_proc_info_entry("apm", 0, NULL, apm_emu_get_info);
524 if (apm_proc)
525 apm_proc->owner = THIS_MODULE;
526 100
527 if (misc_register(&apm_device) != 0) 101 printk(KERN_INFO "apm_emu: PMU APM Emulation initialized.\n");
528 printk(KERN_INFO "Could not create misc. device for apm\n");
529
530 pmu_register_sleep_notifier(&apm_sleep_notifier);
531
532 printk(KERN_INFO "apm_emu: APM Emulation %s initialized.\n", driver_version);
533 102
534 return 0; 103 return 0;
535} 104}
536 105
537static void __exit apm_emu_exit(void) 106static void __exit apm_emu_exit(void)
538{ 107{
539 pmu_unregister_sleep_notifier(&apm_sleep_notifier); 108 if (apm_get_power_status == pmu_apm_get_power_status)
540 misc_deregister(&apm_device); 109 apm_get_power_status = NULL;
541 remove_proc_entry("apm", NULL);
542 110
543 printk(KERN_INFO "apm_emu: APM Emulation removed.\n"); 111 printk(KERN_INFO "apm_emu: PMU APM Emulation removed.\n");
544} 112}
545 113
546module_init(apm_emu_init); 114module_init(apm_emu_init);
547module_exit(apm_emu_exit); 115module_exit(apm_emu_exit);
548 116
549MODULE_AUTHOR("Benjamin Herrenschmidt"); 117MODULE_AUTHOR("Benjamin Herrenschmidt");
550MODULE_DESCRIPTION("APM emulation layer for PowerMac"); 118MODULE_DESCRIPTION("APM emulation for PowerMac");
551MODULE_LICENSE("GPL"); 119MODULE_LICENSE("GPL");
552
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index 1599dc34f15f..76c1e8e4a487 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -24,7 +24,7 @@ static int mouse_last_keycode;
24 24
25#if defined(CONFIG_SYSCTL) 25#if defined(CONFIG_SYSCTL)
26/* file(s) in /proc/sys/dev/mac_hid */ 26/* file(s) in /proc/sys/dev/mac_hid */
27ctl_table mac_hid_files[] = { 27static ctl_table mac_hid_files[] = {
28 { 28 {
29 .ctl_name = DEV_MAC_HID_MOUSE_BUTTON_EMULATION, 29 .ctl_name = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
30 .procname = "mouse_button_emulation", 30 .procname = "mouse_button_emulation",
@@ -53,7 +53,7 @@ ctl_table mac_hid_files[] = {
53}; 53};
54 54
55/* dir in /proc/sys/dev */ 55/* dir in /proc/sys/dev */
56ctl_table mac_hid_dir[] = { 56static ctl_table mac_hid_dir[] = {
57 { 57 {
58 .ctl_name = DEV_MAC_HID, 58 .ctl_name = DEV_MAC_HID,
59 .procname = "mac_hid", 59 .procname = "mac_hid",
@@ -65,7 +65,7 @@ ctl_table mac_hid_dir[] = {
65}; 65};
66 66
67/* /proc/sys/dev itself, in case that is not there yet */ 67/* /proc/sys/dev itself, in case that is not there yet */
68ctl_table mac_hid_root_dir[] = { 68static ctl_table mac_hid_root_dir[] = {
69 { 69 {
70 .ctl_name = CTL_DEV, 70 .ctl_name = CTL_DEV,
71 .procname = "dev", 71 .procname = "dev",
@@ -127,7 +127,7 @@ static int emumousebtn_input_register(void)
127 return ret; 127 return ret;
128} 128}
129 129
130int __init mac_hid_init(void) 130static int __init mac_hid_init(void)
131{ 131{
132 int err; 132 int err;
133 133
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c
index cc8267912656..112e5ef728f1 100644
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -41,28 +41,15 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
41static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, 41static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
42 char *buf) 42 char *buf)
43{ 43{
44 struct of_device *of; 44 struct of_device *ofdev = to_of_device(dev);
45 const char *compat; 45 int len;
46 int cplen;
47 int length;
48 46
49 of = &to_macio_device (dev)->ofdev; 47 len = of_device_get_modalias(ofdev, buf, PAGE_SIZE);
50 compat = of_get_property(of->node, "compatible", &cplen);
51 if (!compat) compat = "", cplen = 1;
52 length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type);
53 buf += length;
54 while (cplen > 0) {
55 int l;
56 l = sprintf (buf, "C%s", compat);
57 length += l;
58 buf += l;
59 l = strlen (compat) + 1;
60 compat += l;
61 cplen -= l;
62 }
63 length += sprintf(buf, "\n");
64 48
65 return length; 49 buf[len] = '\n';
50 buf[len+1] = 0;
51
52 return len+1;
66} 53}
67 54
68macio_config_of_attr (name, "%s\n"); 55macio_config_of_attr (name, "%s\n");
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index a98a328b1cfc..f8e1a135bf9d 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -606,7 +606,7 @@ static void smu_expose_childs(struct work_struct *unused)
606 struct device_node *np; 606 struct device_node *np;
607 607
608 for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) 608 for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;)
609 if (device_is_compatible(np, "smu-sensors")) 609 if (of_device_is_compatible(np, "smu-sensors"))
610 of_platform_device_create(np, "smu-sensors", 610 of_platform_device_create(np, "smu-sensors",
611 &smu->of_dev->dev); 611 &smu->of_dev->dev);
612} 612}
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 228903403cfc..178afa1fd56c 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -560,9 +560,9 @@ thermostat_init(void)
560 np = of_find_node_by_name(NULL, "fan"); 560 np = of_find_node_by_name(NULL, "fan");
561 if (!np) 561 if (!np)
562 return -ENODEV; 562 return -ENODEV;
563 if (device_is_compatible(np, "adt7460")) 563 if (of_device_is_compatible(np, "adt7460"))
564 therm_type = ADT7460; 564 therm_type = ADT7460;
565 else if (device_is_compatible(np, "adt7467")) 565 else if (of_device_is_compatible(np, "adt7467"))
566 therm_type = ADT7467; 566 therm_type = ADT7467;
567 else 567 else
568 return -ENODEV; 568 return -ENODEV;
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index fc89a7047cd0..55ad95671387 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -31,7 +31,6 @@ static spinlock_t pmu_blink_lock;
31static struct adb_request pmu_blink_req; 31static struct adb_request pmu_blink_req;
32/* -1: no change, 0: request off, 1: request on */ 32/* -1: no change, 0: request off, 1: request on */
33static int requested_change; 33static int requested_change;
34static int sleeping;
35 34
36static void pmu_req_done(struct adb_request * req) 35static void pmu_req_done(struct adb_request * req)
37{ 36{
@@ -41,7 +40,7 @@ static void pmu_req_done(struct adb_request * req)
41 /* if someone requested a change in the meantime 40 /* if someone requested a change in the meantime
42 * (we only see the last one which is fine) 41 * (we only see the last one which is fine)
43 * then apply it now */ 42 * then apply it now */
44 if (requested_change != -1 && !sleeping) 43 if (requested_change != -1 && !pmu_sys_suspended)
45 pmu_request(&pmu_blink_req, NULL, 4, 0xee, 4, 0, requested_change); 44 pmu_request(&pmu_blink_req, NULL, 4, 0xee, 4, 0, requested_change);
46 /* reset requested change */ 45 /* reset requested change */
47 requested_change = -1; 46 requested_change = -1;
@@ -66,7 +65,7 @@ static void pmu_led_set(struct led_classdev *led_cdev,
66 break; 65 break;
67 } 66 }
68 /* if request isn't done, then don't do anything */ 67 /* if request isn't done, then don't do anything */
69 if (pmu_blink_req.complete && !sleeping) 68 if (pmu_blink_req.complete && !pmu_sys_suspended)
70 pmu_request(&pmu_blink_req, NULL, 4, 0xee, 4, 0, requested_change); 69 pmu_request(&pmu_blink_req, NULL, 4, 0xee, 4, 0, requested_change);
71 out: 70 out:
72 spin_unlock_irqrestore(&pmu_blink_lock, flags); 71 spin_unlock_irqrestore(&pmu_blink_lock, flags);
@@ -80,32 +79,6 @@ static struct led_classdev pmu_led = {
80 .brightness_set = pmu_led_set, 79 .brightness_set = pmu_led_set,
81}; 80};
82 81
83#ifdef CONFIG_PM
84static void pmu_led_sleep_call(struct pmu_sleep_notifier *self, int when)
85{
86 unsigned long flags;
87
88 spin_lock_irqsave(&pmu_blink_lock, flags);
89
90 switch (when) {
91 case PBOOK_SLEEP_REQUEST:
92 sleeping = 1;
93 break;
94 case PBOOK_WAKE:
95 sleeping = 0;
96 break;
97 default:
98 /* do nothing */
99 break;
100 }
101 spin_unlock_irqrestore(&pmu_blink_lock, flags);
102}
103
104static struct pmu_sleep_notifier via_pmu_led_sleep_notif = {
105 .notifier_call = pmu_led_sleep_call,
106};
107#endif
108
109static int __init via_pmu_led_init(void) 82static int __init via_pmu_led_init(void)
110{ 83{
111 struct device_node *dt; 84 struct device_node *dt;
@@ -135,9 +108,7 @@ static int __init via_pmu_led_init(void)
135 /* no outstanding req */ 108 /* no outstanding req */
136 pmu_blink_req.complete = 1; 109 pmu_blink_req.complete = 1;
137 pmu_blink_req.done = pmu_req_done; 110 pmu_blink_req.done = pmu_req_done;
138#ifdef CONFIG_PM 111
139 pmu_register_sleep_notifier(&via_pmu_led_sleep_notif);
140#endif
141 return led_classdev_register(NULL, &pmu_led); 112 return led_classdev_register(NULL, &pmu_led);
142} 113}
143 114
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 1729d3fd7a11..157080b3b468 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -310,14 +310,14 @@ int __init find_via_pmu(void)
310 PMU_INT_TICK; 310 PMU_INT_TICK;
311 311
312 if (vias->parent->name && ((strcmp(vias->parent->name, "ohare") == 0) 312 if (vias->parent->name && ((strcmp(vias->parent->name, "ohare") == 0)
313 || device_is_compatible(vias->parent, "ohare"))) 313 || of_device_is_compatible(vias->parent, "ohare")))
314 pmu_kind = PMU_OHARE_BASED; 314 pmu_kind = PMU_OHARE_BASED;
315 else if (device_is_compatible(vias->parent, "paddington")) 315 else if (of_device_is_compatible(vias->parent, "paddington"))
316 pmu_kind = PMU_PADDINGTON_BASED; 316 pmu_kind = PMU_PADDINGTON_BASED;
317 else if (device_is_compatible(vias->parent, "heathrow")) 317 else if (of_device_is_compatible(vias->parent, "heathrow"))
318 pmu_kind = PMU_HEATHROW_BASED; 318 pmu_kind = PMU_HEATHROW_BASED;
319 else if (device_is_compatible(vias->parent, "Keylargo") 319 else if (of_device_is_compatible(vias->parent, "Keylargo")
320 || device_is_compatible(vias->parent, "K2-Keylargo")) { 320 || of_device_is_compatible(vias->parent, "K2-Keylargo")) {
321 struct device_node *gpiop; 321 struct device_node *gpiop;
322 struct device_node *adbp; 322 struct device_node *adbp;
323 u64 gaddr = OF_BAD_ADDR; 323 u64 gaddr = OF_BAD_ADDR;
@@ -2759,7 +2759,7 @@ pmu_polled_request(struct adb_request *req)
2759 2759
2760#if defined(CONFIG_PM) && defined(CONFIG_PPC32) 2760#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
2761 2761
2762static int pmu_sys_suspended; 2762int pmu_sys_suspended;
2763 2763
2764static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state) 2764static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
2765{ 2765{
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
index ab4d1b63f63e..a0fabf3c2008 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -188,10 +188,10 @@ static int wf_lm75_attach(struct i2c_adapter *adapter)
188 if (loc == NULL || addr == 0) 188 if (loc == NULL || addr == 0)
189 continue; 189 continue;
190 /* real lm75 */ 190 /* real lm75 */
191 if (device_is_compatible(dev, "lm75")) 191 if (of_device_is_compatible(dev, "lm75"))
192 wf_lm75_create(adapter, addr, 0, loc); 192 wf_lm75_create(adapter, addr, 0, loc);
193 /* ds1775 (compatible, better resolution */ 193 /* ds1775 (compatible, better resolution */
194 else if (device_is_compatible(dev, "ds1775")) 194 else if (of_device_is_compatible(dev, "ds1775"))
195 wf_lm75_create(adapter, addr, 1, loc); 195 wf_lm75_create(adapter, addr, 1, loc);
196 } 196 }
197 return 0; 197 return 0;
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c
index eaa74afa175b..5f03aab9fb5d 100644
--- a/drivers/macintosh/windfarm_max6690_sensor.c
+++ b/drivers/macintosh/windfarm_max6690_sensor.c
@@ -131,7 +131,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
131 */ 131 */
132 if (!pmac_i2c_match_adapter(dev, adapter)) 132 if (!pmac_i2c_match_adapter(dev, adapter))
133 continue; 133 continue;
134 if (!device_is_compatible(dev, "max6690")) 134 if (!of_device_is_compatible(dev, "max6690"))
135 continue; 135 continue;
136 addr = pmac_i2c_get_dev_addr(dev); 136 addr = pmac_i2c_get_dev_addr(dev);
137 loc = of_get_property(dev, "hwsensor-location", NULL); 137 loc = of_get_property(dev, "hwsensor-location", NULL);
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index ff398adc0283..58c2590f05ec 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -263,7 +263,7 @@ static int __init smu_controls_init(void)
263 /* Look for RPM fans */ 263 /* Look for RPM fans */
264 for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;) 264 for (fans = NULL; (fans = of_get_next_child(smu, fans)) != NULL;)
265 if (!strcmp(fans->name, "rpm-fans") || 265 if (!strcmp(fans->name, "rpm-fans") ||
266 device_is_compatible(fans, "smu-rpm-fans")) 266 of_device_is_compatible(fans, "smu-rpm-fans"))
267 break; 267 break;
268 for (fan = NULL; 268 for (fan = NULL;
269 fans && (fan = of_get_next_child(fans, fan)) != NULL;) { 269 fans && (fan = of_get_next_child(fans, fan)) != NULL;) {
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index 9a6c2cf8fd0e..1043b39aa123 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -380,7 +380,7 @@ static int wf_sat_attach(struct i2c_adapter *adapter)
380 busnode = pmac_i2c_get_bus_node(bus); 380 busnode = pmac_i2c_get_bus_node(bus);
381 381
382 while ((dev = of_get_next_child(busnode, dev)) != NULL) 382 while ((dev = of_get_next_child(busnode, dev)) != NULL)
383 if (device_is_compatible(dev, "smu-sat")) 383 if (of_device_is_compatible(dev, "smu-sat"))
384 wf_sat_create(adapter, dev); 384 wf_sat_create(adapter, dev);
385 return 0; 385 return 0;
386} 386}
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 7efe744ad31e..72107dc06d67 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -48,7 +48,7 @@ static int parse_flash_partitions(struct device_node *node,
48 const u32 *part; 48 const u32 *part;
49 const char *name; 49 const char *name;
50 50
51 part = get_property(node, "partitions", &plen); 51 part = of_get_property(node, "partitions", &plen);
52 if (part == NULL) 52 if (part == NULL)
53 goto err; 53 goto err;
54 54
@@ -59,7 +59,7 @@ static int parse_flash_partitions(struct device_node *node,
59 goto err; 59 goto err;
60 } 60 }
61 61
62 name = get_property(node, "partition-names", &plen); 62 name = of_get_property(node, "partition-names", &plen);
63 63
64 for (i = 0; i < retval; i++) { 64 for (i = 0; i < retval; i++) {
65 (*parts)[i].offset = *part++; 65 (*parts)[i].offset = *part++;
@@ -153,7 +153,7 @@ static int __devinit of_physmap_probe(struct of_device *dev, const struct of_dev
153 goto err_out; 153 goto err_out;
154 } 154 }
155 155
156 width = get_property(dp, "bank-width", NULL); 156 width = of_get_property(dp, "bank-width", NULL);
157 if (width == NULL) { 157 if (width == NULL) {
158 dev_err(&dev->dev, "Can't get the flash bank width!\n"); 158 dev_err(&dev->dev, "Can't get the flash bank width!\n");
159 err = -EINVAL; 159 err = -EINVAL;
@@ -174,7 +174,7 @@ static int __devinit of_physmap_probe(struct of_device *dev, const struct of_dev
174 174
175 simple_map_init(&info->map); 175 simple_map_init(&info->map);
176 176
177 of_probe = get_property(dp, "probe-type", NULL); 177 of_probe = of_get_property(dp, "probe-type", NULL);
178 if (of_probe == NULL) { 178 if (of_probe == NULL) {
179 probe_type = rom_probe_types; 179 probe_type = rom_probe_types;
180 for (; info->mtd == NULL && *probe_type != NULL; probe_type++) 180 for (; info->mtd == NULL && *probe_type != NULL; probe_type++)
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 4612725965df..9b8d7d9dbe86 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1260,9 +1260,10 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1260 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); 1260 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
1261 return -ENODEV; 1261 return -ENODEV;
1262 } 1262 }
1263 prop_addr = get_property(macio_get_of_node(mdev), "mac-address", NULL); 1263 prop_addr = of_get_property(macio_get_of_node(mdev),
1264 "mac-address", NULL);
1264 if (prop_addr == NULL) { 1265 if (prop_addr == NULL) {
1265 prop_addr = get_property(macio_get_of_node(mdev), 1266 prop_addr = of_get_property(macio_get_of_node(mdev),
1266 "local-mac-address", NULL); 1267 "local-mac-address", NULL);
1267 if (prop_addr == NULL) { 1268 if (prop_addr == NULL) {
1268 printk(KERN_ERR "BMAC: Can't get mac-address\n"); 1269 printk(KERN_ERR "BMAC: Can't get mac-address\n");
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index c7a5614e66c0..a1bd2d861d92 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2603,14 +2603,13 @@ static int ehea_setup_ports(struct ehea_adapter *adapter)
2603{ 2603{
2604 struct device_node *lhea_dn; 2604 struct device_node *lhea_dn;
2605 struct device_node *eth_dn = NULL; 2605 struct device_node *eth_dn = NULL;
2606 2606 const u32 *dn_log_port_id;
2607 u32 *dn_log_port_id;
2608 int i = 0; 2607 int i = 0;
2609 2608
2610 lhea_dn = adapter->ebus_dev->ofdev.node; 2609 lhea_dn = adapter->ebus_dev->ofdev.node;
2611 while ((eth_dn = of_get_next_child(lhea_dn, eth_dn))) { 2610 while ((eth_dn = of_get_next_child(lhea_dn, eth_dn))) {
2612 2611
2613 dn_log_port_id = (u32*)get_property(eth_dn, "ibm,hea-port-no", 2612 dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
2614 NULL); 2613 NULL);
2615 if (!dn_log_port_id) { 2614 if (!dn_log_port_id) {
2616 ehea_error("bad device node: eth_dn name=%s", 2615 ehea_error("bad device node: eth_dn name=%s",
@@ -2645,12 +2644,12 @@ static struct device_node *ehea_get_eth_dn(struct ehea_adapter *adapter,
2645{ 2644{
2646 struct device_node *lhea_dn; 2645 struct device_node *lhea_dn;
2647 struct device_node *eth_dn = NULL; 2646 struct device_node *eth_dn = NULL;
2648 u32 *dn_log_port_id; 2647 const u32 *dn_log_port_id;
2649 2648
2650 lhea_dn = adapter->ebus_dev->ofdev.node; 2649 lhea_dn = adapter->ebus_dev->ofdev.node;
2651 while ((eth_dn = of_get_next_child(lhea_dn, eth_dn))) { 2650 while ((eth_dn = of_get_next_child(lhea_dn, eth_dn))) {
2652 2651
2653 dn_log_port_id = (u32*)get_property(eth_dn, "ibm,hea-port-no", 2652 dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
2654 NULL); 2653 NULL);
2655 if (dn_log_port_id) 2654 if (dn_log_port_id)
2656 if (*dn_log_port_id == logical_port_id) 2655 if (*dn_log_port_id == logical_port_id)
@@ -2774,7 +2773,7 @@ static int __devinit ehea_probe_adapter(struct ibmebus_dev *dev,
2774 const struct of_device_id *id) 2773 const struct of_device_id *id)
2775{ 2774{
2776 struct ehea_adapter *adapter; 2775 struct ehea_adapter *adapter;
2777 u64 *adapter_handle; 2776 const u64 *adapter_handle;
2778 int ret; 2777 int ret;
2779 2778
2780 if (!dev || !dev->ofdev.node) { 2779 if (!dev || !dev->ofdev.node) {
@@ -2791,7 +2790,7 @@ static int __devinit ehea_probe_adapter(struct ibmebus_dev *dev,
2791 2790
2792 adapter->ebus_dev = dev; 2791 adapter->ebus_dev = dev;
2793 2792
2794 adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle", 2793 adapter_handle = of_get_property(dev->ofdev.node, "ibm,hea-handle",
2795 NULL); 2794 NULL);
2796 if (adapter_handle) 2795 if (adapter_handle)
2797 adapter->handle = *adapter_handle; 2796 adapter->handle = *adapter_handle;
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index b3bd62394958..52b9332810c5 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -110,9 +110,9 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
110 return -ENODEV; 110 return -ENODEV;
111 } 111 }
112 112
113 addr = get_property(mace, "mac-address", NULL); 113 addr = of_get_property(mace, "mac-address", NULL);
114 if (addr == NULL) { 114 if (addr == NULL) {
115 addr = get_property(mace, "local-mac-address", NULL); 115 addr = of_get_property(mace, "local-mac-address", NULL);
116 if (addr == NULL) { 116 if (addr == NULL) {
117 printk(KERN_ERR "Can't get mac-address for MACE %s\n", 117 printk(KERN_ERR "Can't get mac-address for MACE %s\n",
118 mace->full_name); 118 mace->full_name);
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 76fe9dd8e841..07eb9b24a97f 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -80,7 +80,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
80 return -ENOENT; 80 return -ENOENT;
81 } 81 }
82 82
83 maddr = get_property(dn, "mac-address", NULL); 83 maddr = of_get_property(dn, "mac-address", NULL);
84 if (maddr == NULL) { 84 if (maddr == NULL) {
85 dev_warn(&pdev->dev, 85 dev_warn(&pdev->dev,
86 "no mac address in device tree, not configuring\n"); 86 "no mac address in device tree, not configuring\n");
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 230da14b1b68..c15e97253ede 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1830,7 +1830,7 @@ try_host_fw:
1830 if (!dn) 1830 if (!dn)
1831 goto out_err; 1831 goto out_err;
1832 1832
1833 fw_prop = get_property(dn, "firmware", &fw_size); 1833 fw_prop = of_get_property(dn, "firmware", &fw_size);
1834 if (!fw_prop) 1834 if (!fw_prop)
1835 goto out_err; 1835 goto out_err;
1836 1836
@@ -2236,7 +2236,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
2236 if (!dn) 2236 if (!dn)
2237 return -EIO; 2237 return -EIO;
2238 2238
2239 mac = get_property(dn, "local-mac-address", NULL); 2239 mac = of_get_property(dn, "local-mac-address", NULL);
2240 if (!mac) 2240 if (!mac)
2241 return -EIO; 2241 return -EIO;
2242 memcpy(addr.sa_data, mac, ETH_ALEN); 2242 memcpy(addr.sa_data, mac, ETH_ALEN);
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 5da73212ac91..432803855034 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2903,7 +2903,7 @@ static int __devinit gem_get_device_address(struct gem *gp)
2903 struct net_device *dev = gp->dev; 2903 struct net_device *dev = gp->dev;
2904 const unsigned char *addr; 2904 const unsigned char *addr;
2905 2905
2906 addr = get_property(gp->of_node, "local-mac-address", NULL); 2906 addr = of_get_property(gp->of_node, "local-mac-address", NULL);
2907 if (addr == NULL) { 2907 if (addr == NULL) {
2908#ifdef CONFIG_SPARC 2908#ifdef CONFIG_SPARC
2909 addr = idprom->id_ethaddr; 2909 addr = idprom->id_ethaddr;
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index 56a110ca5e6f..61843fd57525 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -451,7 +451,7 @@ static int bcm5421_init(struct mii_phy* phy)
451 if (phy->platform_data) { 451 if (phy->platform_data) {
452 struct device_node *np = of_get_parent(phy->platform_data); 452 struct device_node *np = of_get_parent(phy->platform_data);
453 int can_low_power = 1; 453 int can_low_power = 1;
454 if (np == NULL || get_property(np, "no-autolowpower", NULL)) 454 if (np == NULL || of_get_property(np, "no-autolowpower", NULL))
455 can_low_power = 0; 455 can_low_power = 0;
456 if (can_low_power) { 456 if (can_low_power) {
457 /* Enable automatic low-power */ 457 /* Enable automatic low-power */
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index 0bfc2c9c1c08..1aabc91f6458 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -82,6 +82,7 @@ struct tsi108_prv_data {
82 unsigned int phy; /* Index of PHY for this interface */ 82 unsigned int phy; /* Index of PHY for this interface */
83 unsigned int irq_num; 83 unsigned int irq_num;
84 unsigned int id; 84 unsigned int id;
85 unsigned int phy_type;
85 86
86 struct timer_list timer;/* Timer that triggers the check phy function */ 87 struct timer_list timer;/* Timer that triggers the check phy function */
87 unsigned int rxtail; /* Next entry in rxring to read */ 88 unsigned int rxtail; /* Next entry in rxring to read */
@@ -1256,11 +1257,11 @@ static void tsi108_init_phy(struct net_device *dev)
1256 if (i == 0) 1257 if (i == 0)
1257 printk(KERN_ERR "%s function time out \n", __FUNCTION__); 1258 printk(KERN_ERR "%s function time out \n", __FUNCTION__);
1258 1259
1259#if (TSI108_PHY_TYPE == PHY_BCM54XX) /* Broadcom BCM54xx PHY */ 1260 if (data->phy_type == TSI108_PHY_BCM54XX) {
1260 tsi108_write_mii(data, 0x09, 0x0300); 1261 tsi108_write_mii(data, 0x09, 0x0300);
1261 tsi108_write_mii(data, 0x10, 0x1020); 1262 tsi108_write_mii(data, 0x10, 0x1020);
1262 tsi108_write_mii(data, 0x1c, 0x8c00); 1263 tsi108_write_mii(data, 0x1c, 0x8c00);
1263#endif 1264 }
1264 1265
1265 tsi108_write_mii(data, 1266 tsi108_write_mii(data,
1266 MII_BMCR, 1267 MII_BMCR,
@@ -1587,6 +1588,7 @@ tsi108_init_one(struct platform_device *pdev)
1587 data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if); 1588 data->mii_if.supports_gmii = mii_check_gmii_support(&data->mii_if);
1588 1589
1589 data->phy = einfo->phy; 1590 data->phy = einfo->phy;
1591 data->phy_type = einfo->phy_type;
1590 data->irq_num = einfo->irq_num; 1592 data->irq_num = einfo->irq_num;
1591 data->id = pdev->id; 1593 data->id = pdev->id;
1592 dev->open = tsi108_open; 1594 dev->open = tsi108_open;
diff --git a/drivers/net/tsi108_eth.h b/drivers/net/tsi108_eth.h
index 77a769df228a..5a77ae6c5f36 100644
--- a/drivers/net/tsi108_eth.h
+++ b/drivers/net/tsi108_eth.h
@@ -43,15 +43,6 @@
43 in_be32((data->phyregs + (offset))) 43 in_be32((data->phyregs + (offset)))
44 44
45/* 45/*
46 * PHY Configuration Options
47 *
48 * NOTE: Enable set of definitions corresponding to your board type
49 */
50#define PHY_MV88E 1 /* Marvel 88Exxxx PHY */
51#define PHY_BCM54XX 2 /* Broardcom BCM54xx PHY */
52#define TSI108_PHY_TYPE PHY_MV88E
53
54/*
55 * TSI108 GIGE port registers 46 * TSI108 GIGE port registers
56 */ 47 */
57 48
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 16b9acdabbe8..d7aff8189377 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3787,7 +3787,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3787 3787
3788 ugeth_vdbg("%s: IN", __FUNCTION__); 3788 ugeth_vdbg("%s: IN", __FUNCTION__);
3789 3789
3790 prop = get_property(np, "device-id", NULL); 3790 prop = of_get_property(np, "device-id", NULL);
3791 ucc_num = *prop - 1; 3791 ucc_num = *prop - 1;
3792 if ((ucc_num < 0) || (ucc_num > 7)) 3792 if ((ucc_num < 0) || (ucc_num > 7))
3793 return -ENODEV; 3793 return -ENODEV;
@@ -3795,9 +3795,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3795 ug_info = &ugeth_info[ucc_num]; 3795 ug_info = &ugeth_info[ucc_num];
3796 ug_info->uf_info.ucc_num = ucc_num; 3796 ug_info->uf_info.ucc_num = ucc_num;
3797 3797
3798 prop = get_property(np, "rx-clock", NULL); 3798 prop = of_get_property(np, "rx-clock", NULL);
3799 ug_info->uf_info.rx_clock = *prop; 3799 ug_info->uf_info.rx_clock = *prop;
3800 prop = get_property(np, "tx-clock", NULL); 3800 prop = of_get_property(np, "tx-clock", NULL);
3801 ug_info->uf_info.tx_clock = *prop; 3801 ug_info->uf_info.tx_clock = *prop;
3802 err = of_address_to_resource(np, 0, &res); 3802 err = of_address_to_resource(np, 0, &res);
3803 if (err) 3803 if (err)
@@ -3806,23 +3806,23 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3806 ug_info->uf_info.regs = res.start; 3806 ug_info->uf_info.regs = res.start;
3807 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3807 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3808 3808
3809 ph = get_property(np, "phy-handle", NULL); 3809 ph = of_get_property(np, "phy-handle", NULL);
3810 phy = of_find_node_by_phandle(*ph); 3810 phy = of_find_node_by_phandle(*ph);
3811 3811
3812 if (phy == NULL) 3812 if (phy == NULL)
3813 return -ENODEV; 3813 return -ENODEV;
3814 3814
3815 /* set the PHY address */ 3815 /* set the PHY address */
3816 prop = get_property(phy, "reg", NULL); 3816 prop = of_get_property(phy, "reg", NULL);
3817 if (prop == NULL) 3817 if (prop == NULL)
3818 return -1; 3818 return -1;
3819 ug_info->phy_address = *prop; 3819 ug_info->phy_address = *prop;
3820 3820
3821 /* get the phy interface type, or default to MII */ 3821 /* get the phy interface type, or default to MII */
3822 prop = get_property(np, "interface-type", NULL); 3822 prop = of_get_property(np, "interface-type", NULL);
3823 if (!prop) { 3823 if (!prop) {
3824 /* handle interface property present in old trees */ 3824 /* handle interface property present in old trees */
3825 prop = get_property(phy, "interface", NULL); 3825 prop = of_get_property(phy, "interface", NULL);
3826 if (prop != NULL) 3826 if (prop != NULL)
3827 phy_interface = enet_to_phy_interface[*prop]; 3827 phy_interface = enet_to_phy_interface[*prop];
3828 else 3828 else
@@ -3832,10 +3832,10 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3832 } 3832 }
3833 3833
3834 /* get speed, or derive from interface */ 3834 /* get speed, or derive from interface */
3835 prop = get_property(np, "max-speed", NULL); 3835 prop = of_get_property(np, "max-speed", NULL);
3836 if (!prop) { 3836 if (!prop) {
3837 /* handle interface property present in old trees */ 3837 /* handle interface property present in old trees */
3838 prop = get_property(phy, "interface", NULL); 3838 prop = of_get_property(phy, "interface", NULL);
3839 if (prop != NULL) 3839 if (prop != NULL)
3840 max_speed = enet_to_speed[*prop]; 3840 max_speed = enet_to_speed[*prop];
3841 } else { 3841 } else {
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 73b5a538e8f4..27a1ef3b7b06 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -172,7 +172,7 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
172 while ((child = of_get_next_child(np, child)) != NULL) { 172 while ((child = of_get_next_child(np, child)) != NULL) {
173 int irq = irq_of_parse_and_map(child, 0); 173 int irq = irq_of_parse_and_map(child, 0);
174 if (irq != NO_IRQ) { 174 if (irq != NO_IRQ) {
175 const u32 *id = get_property(child, "reg", NULL); 175 const u32 *id = of_get_property(child, "reg", NULL);
176 new_bus->irq[*id] = irq; 176 new_bus->irq[*id] = irq;
177 } 177 }
178 } 178 }
@@ -203,7 +203,7 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
203 if ((res.start >= tempres.start) && 203 if ((res.start >= tempres.start) &&
204 (res.end <= tempres.end)) { 204 (res.end <= tempres.end)) {
205 /* set this UCC to be the MII master */ 205 /* set this UCC to be the MII master */
206 const u32 *id = get_property(tempnp, "device-id", NULL); 206 const u32 *id = of_get_property(tempnp, "device-id", NULL);
207 if (id == NULL) 207 if (id == NULL)
208 goto bus_register_fail; 208 goto bus_register_fail;
209 209
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 847936fe327e..899eed002748 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -170,10 +170,10 @@ static int get_children_props(struct device_node *dn, const int **drc_indexes,
170{ 170{
171 const int *indexes, *names, *types, *domains; 171 const int *indexes, *names, *types, *domains;
172 172
173 indexes = get_property(dn, "ibm,drc-indexes", NULL); 173 indexes = of_get_property(dn, "ibm,drc-indexes", NULL);
174 names = get_property(dn, "ibm,drc-names", NULL); 174 names = of_get_property(dn, "ibm,drc-names", NULL);
175 types = get_property(dn, "ibm,drc-types", NULL); 175 types = of_get_property(dn, "ibm,drc-types", NULL);
176 domains = get_property(dn, "ibm,drc-power-domains", NULL); 176 domains = of_get_property(dn, "ibm,drc-power-domains", NULL);
177 177
178 if (!indexes || !names || !types || !domains) { 178 if (!indexes || !names || !types || !domains) {
179 /* Slot does not have dynamically-removable children */ 179 /* Slot does not have dynamically-removable children */
@@ -206,7 +206,7 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
206 char *name_tmp, *type_tmp; 206 char *name_tmp, *type_tmp;
207 int i, rc; 207 int i, rc;
208 208
209 my_index = get_property(dn, "ibm,my-drc-index", NULL); 209 my_index = of_get_property(dn, "ibm,my-drc-index", NULL);
210 if (!my_index) { 210 if (!my_index) {
211 /* Node isn't DLPAR/hotplug capable */ 211 /* Node isn't DLPAR/hotplug capable */
212 return -EINVAL; 212 return -EINVAL;
diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c
index 7d7cab1d91b4..ec2d36a1bc67 100644
--- a/drivers/ps3/vuart.c
+++ b/drivers/ps3/vuart.c
@@ -886,12 +886,12 @@ static int ps3_vuart_probe(struct device *_dev)
886 886
887 if (++vuart_bus_priv.use_count == 1) { 887 if (++vuart_bus_priv.use_count == 1) {
888 888
889 result = ps3_alloc_vuart_irq(PS3_BINDING_CPU_ANY, 889 result = ps3_vuart_irq_setup(PS3_BINDING_CPU_ANY,
890 (void*)&vuart_bus_priv.bmp.status, &vuart_bus_priv.virq); 890 (void*)&vuart_bus_priv.bmp.status, &vuart_bus_priv.virq);
891 891
892 if (result) { 892 if (result) {
893 dev_dbg(&dev->core, 893 dev_dbg(&dev->core,
894 "%s:%d: ps3_alloc_vuart_irq failed (%d)\n", 894 "%s:%d: ps3_vuart_irq_setup failed (%d)\n",
895 __func__, __LINE__, result); 895 __func__, __LINE__, result);
896 result = -EPERM; 896 result = -EPERM;
897 goto fail_alloc_irq; 897 goto fail_alloc_irq;
@@ -937,7 +937,7 @@ static int ps3_vuart_probe(struct device *_dev)
937fail_probe: 937fail_probe:
938 ps3_vuart_set_interrupt_mask(dev, 0); 938 ps3_vuart_set_interrupt_mask(dev, 0);
939fail_request_irq: 939fail_request_irq:
940 ps3_free_vuart_irq(vuart_bus_priv.virq); 940 ps3_vuart_irq_destroy(vuart_bus_priv.virq);
941 vuart_bus_priv.virq = NO_IRQ; 941 vuart_bus_priv.virq = NO_IRQ;
942fail_alloc_irq: 942fail_alloc_irq:
943 --vuart_bus_priv.use_count; 943 --vuart_bus_priv.use_count;
@@ -975,7 +975,7 @@ static int ps3_vuart_remove(struct device *_dev)
975 if (--vuart_bus_priv.use_count == 0) { 975 if (--vuart_bus_priv.use_count == 0) {
976 BUG(); 976 BUG();
977 free_irq(vuart_bus_priv.virq, &vuart_bus_priv); 977 free_irq(vuart_bus_priv.virq, &vuart_bus_priv);
978 ps3_free_vuart_irq(vuart_bus_priv.virq); 978 ps3_vuart_irq_destroy(vuart_bus_priv.virq);
979 vuart_bus_priv.virq = NO_IRQ; 979 vuart_bus_priv.virq = NO_IRQ;
980 } 980 }
981 981
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index 6d223dd76440..8ba7dd09d01d 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -892,16 +892,16 @@ static int get_system_info(void)
892 if (!rootdn) 892 if (!rootdn)
893 return -ENOENT; 893 return -ENOENT;
894 894
895 model = get_property(rootdn, "model", NULL); 895 model = of_get_property(rootdn, "model", NULL);
896 id = get_property(rootdn, "system-id", NULL); 896 id = of_get_property(rootdn, "system-id", NULL);
897 if (model && id) 897 if (model && id)
898 snprintf(system_id, sizeof(system_id), "%s-%s", model, id); 898 snprintf(system_id, sizeof(system_id), "%s-%s", model, id);
899 899
900 name = get_property(rootdn, "ibm,partition-name", NULL); 900 name = of_get_property(rootdn, "ibm,partition-name", NULL);
901 if (name) 901 if (name)
902 strncpy(partition_name, name, sizeof(partition_name)); 902 strncpy(partition_name, name, sizeof(partition_name));
903 903
904 num = get_property(rootdn, "ibm,partition-no", NULL); 904 num = of_get_property(rootdn, "ibm,partition-no", NULL);
905 if (num) 905 if (num)
906 partition_number = *num; 906 partition_number = *num;
907 907
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index 0a533f398f52..d8700aaa6114 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -162,11 +162,11 @@ static void gather_partition_info(void)
162 return; 162 return;
163 } 163 }
164 164
165 ppartition_name = get_property(rootdn, "ibm,partition-name", NULL); 165 ppartition_name = of_get_property(rootdn, "ibm,partition-name", NULL);
166 if (ppartition_name) 166 if (ppartition_name)
167 strncpy(partition_name, ppartition_name, 167 strncpy(partition_name, ppartition_name,
168 sizeof(partition_name)); 168 sizeof(partition_name));
169 p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL); 169 p_number_ptr = of_get_property(rootdn, "ibm,partition-no", NULL);
170 if (p_number_ptr) 170 if (p_number_ptr)
171 partition_number = *p_number_ptr; 171 partition_number = *p_number_ptr;
172 of_node_put(rootdn); 172 of_node_put(rootdn);
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 753d88306cd1..5806ede120a4 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -471,7 +471,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat
471 goto out_free; 471 goto out_free;
472 } 472 }
473 473
474 clkprop = get_property(node, "clock-frequency", &proplen); 474 clkprop = of_get_property(node, "clock-frequency", &proplen);
475 if (clkprop == NULL || proplen != sizeof(int)) { 475 if (clkprop == NULL || proplen != sizeof(int)) {
476 printk(KERN_ERR "%s: can't get clock frequency, " 476 printk(KERN_ERR "%s: can't get clock frequency, "
477 "assuming 25MHz\n", node->full_name); 477 "assuming 25MHz\n", node->full_name);
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 1fd3c7590d31..cf3666d7d97a 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1947,7 +1947,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
1947 ms->tgts[tgt].current_req = NULL; 1947 ms->tgts[tgt].current_req = NULL;
1948 } 1948 }
1949 1949
1950 if ((cfp = get_property(mesh, "clock-frequency", NULL))) 1950 if ((cfp = of_get_property(mesh, "clock-frequency", NULL)))
1951 ms->clk_freq = *cfp; 1951 ms->clk_freq = *cfp;
1952 else { 1952 else {
1953 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n"); 1953 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 8d24cd521056..35f8b86cc78f 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -257,9 +257,10 @@ mpc52xx_uart_shutdown(struct uart_port *port)
257{ 257{
258 struct mpc52xx_psc __iomem *psc = PSC(port); 258 struct mpc52xx_psc __iomem *psc = PSC(port);
259 259
260 /* Shut down the port, interrupt and all */ 260 /* Shut down the port. Leave TX active if on a console port */
261 out_8(&psc->command,MPC52xx_PSC_RST_RX); 261 out_8(&psc->command,MPC52xx_PSC_RST_RX);
262 out_8(&psc->command,MPC52xx_PSC_RST_TX); 262 if (!uart_console(port))
263 out_8(&psc->command,MPC52xx_PSC_RST_TX);
263 264
264 port->read_status_mask = 0; 265 port->read_status_mask = 0;
265 out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask); 266 out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
@@ -1069,7 +1070,7 @@ mpc52xx_uart_of_enumerate(void)
1069 continue; 1070 continue;
1070 1071
1071 /* Is a particular device number requested? */ 1072 /* Is a particular device number requested? */
1072 devno = get_property(np, "port-number", NULL); 1073 devno = of_get_property(np, "port-number", NULL);
1073 mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1); 1074 mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
1074 } 1075 }
1075 1076
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 336d0f4580d9..7ffdaeaf0545 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -29,8 +29,8 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
29 int ret; 29 int ret;
30 30
31 memset(port, 0, sizeof *port); 31 memset(port, 0, sizeof *port);
32 spd = get_property(np, "current-speed", NULL); 32 spd = of_get_property(np, "current-speed", NULL);
33 clk = get_property(np, "clock-frequency", NULL); 33 clk = of_get_property(np, "clock-frequency", NULL);
34 if (!clk) { 34 if (!clk) {
35 dev_warn(&ofdev->dev, "no clock-frequency property set\n"); 35 dev_warn(&ofdev->dev, "no clock-frequency property set\n");
36 return -ENODEV; 36 return -ENODEV;
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index be8d75721a85..0fa9f6761763 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -1450,14 +1450,14 @@ no_dma:
1450 /* 1450 /*
1451 * Detect port type 1451 * Detect port type
1452 */ 1452 */
1453 if (device_is_compatible(np, "cobalt")) 1453 if (of_device_is_compatible(np, "cobalt"))
1454 uap->flags |= PMACZILOG_FLAG_IS_INTMODEM; 1454 uap->flags |= PMACZILOG_FLAG_IS_INTMODEM;
1455 conn = get_property(np, "AAPL,connector", &len); 1455 conn = of_get_property(np, "AAPL,connector", &len);
1456 if (conn && (strcmp(conn, "infrared") == 0)) 1456 if (conn && (strcmp(conn, "infrared") == 0))
1457 uap->flags |= PMACZILOG_FLAG_IS_IRDA; 1457 uap->flags |= PMACZILOG_FLAG_IS_IRDA;
1458 uap->port_type = PMAC_SCC_ASYNC; 1458 uap->port_type = PMAC_SCC_ASYNC;
1459 /* 1999 Powerbook G3 has slot-names property instead */ 1459 /* 1999 Powerbook G3 has slot-names property instead */
1460 slots = get_property(np, "slot-names", &len); 1460 slots = of_get_property(np, "slot-names", &len);
1461 if (slots && slots->count > 0) { 1461 if (slots && slots->count > 0) {
1462 if (strcmp(slots->name, "IrDA") == 0) 1462 if (strcmp(slots->name, "IrDA") == 0)
1463 uap->flags |= PMACZILOG_FLAG_IS_IRDA; 1463 uap->flags |= PMACZILOG_FLAG_IS_IRDA;
@@ -1471,7 +1471,7 @@ no_dma:
1471 of_find_node_by_name(NULL, "i2c-modem"); 1471 of_find_node_by_name(NULL, "i2c-modem");
1472 if (i2c_modem) { 1472 if (i2c_modem) {
1473 const char* mid = 1473 const char* mid =
1474 get_property(i2c_modem, "modem-id", NULL); 1474 of_get_property(i2c_modem, "modem-id", NULL);
1475 if (mid) switch(*mid) { 1475 if (mid) switch(*mid) {
1476 case 0x04 : 1476 case 0x04 :
1477 case 0x05 : 1477 case 0x05 :
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 93107453f124..37b83ba09969 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -97,7 +97,7 @@ static int ps3_ehci_sb_probe(struct ps3_system_bus_device *dev)
97 dev_dbg(&dev->core, "%s:%d: mmio mapped_addr %lxh\n", __func__, 97 dev_dbg(&dev->core, "%s:%d: mmio mapped_addr %lxh\n", __func__,
98 __LINE__, dev->m_region->lpar_addr); 98 __LINE__, dev->m_region->lpar_addr);
99 99
100 result = ps3_alloc_io_irq(PS3_BINDING_CPU_ANY, dev->interrupt_id, &virq); 100 result = ps3_io_irq_setup(PS3_BINDING_CPU_ANY, dev->interrupt_id, &virq);
101 101
102 if (result) { 102 if (result) {
103 dev_dbg(&dev->core, "%s:%d: ps3_construct_io_irq(%d) failed.\n", 103 dev_dbg(&dev->core, "%s:%d: ps3_construct_io_irq(%d) failed.\n",
@@ -155,7 +155,7 @@ fail_add_hcd:
155fail_ioremap: 155fail_ioremap:
156 usb_put_hcd(hcd); 156 usb_put_hcd(hcd);
157fail_create_hcd: 157fail_create_hcd:
158 ps3_free_io_irq(virq); 158 ps3_io_irq_destroy(virq);
159fail_irq: 159fail_irq:
160 ps3_free_mmio_region(dev->m_region); 160 ps3_free_mmio_region(dev->m_region);
161fail_mmio: 161fail_mmio:
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c
index 08e237c7bc43..c43b66acd4d5 100644
--- a/drivers/usb/host/ohci-ppc-of.c
+++ b/drivers/usb/host/ohci-ppc-of.c
@@ -97,8 +97,8 @@ ohci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
97 return -ENODEV; 97 return -ENODEV;
98 98
99 is_bigendian = 99 is_bigendian =
100 device_is_compatible(dn, "ohci-bigendian") || 100 of_device_is_compatible(dn, "ohci-bigendian") ||
101 device_is_compatible(dn, "ohci-be"); 101 of_device_is_compatible(dn, "ohci-be");
102 102
103 dev_dbg(&op->dev, "initializing PPC-OF USB Controller\n"); 103 dev_dbg(&op->dev, "initializing PPC-OF USB Controller\n");
104 104
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index c849f72b508a..d7cf07288b0b 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -99,7 +99,7 @@ static int ps3_ohci_sb_probe(struct ps3_system_bus_device *dev)
99 dev_dbg(&dev->core, "%s:%d: mmio mapped_addr %lxh\n", __func__, 99 dev_dbg(&dev->core, "%s:%d: mmio mapped_addr %lxh\n", __func__,
100 __LINE__, dev->m_region->lpar_addr); 100 __LINE__, dev->m_region->lpar_addr);
101 101
102 result = ps3_alloc_io_irq(PS3_BINDING_CPU_ANY, dev->interrupt_id, &virq); 102 result = ps3_io_irq_setup(PS3_BINDING_CPU_ANY, dev->interrupt_id, &virq);
103 103
104 if (result) { 104 if (result) {
105 dev_dbg(&dev->core, "%s:%d: ps3_construct_io_irq(%d) failed.\n", 105 dev_dbg(&dev->core, "%s:%d: ps3_construct_io_irq(%d) failed.\n",
@@ -157,7 +157,7 @@ fail_add_hcd:
157fail_ioremap: 157fail_ioremap:
158 usb_put_hcd(hcd); 158 usb_put_hcd(hcd);
159fail_create_hcd: 159fail_create_hcd:
160 ps3_free_io_irq(virq); 160 ps3_io_irq_destroy(virq);
161fail_irq: 161fail_irq:
162 ps3_free_mmio_region(dev->m_region); 162 ps3_free_mmio_region(dev->m_region);
163fail_mmio: 163fail_mmio:
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index a4b3fd185de7..9d629fe1709d 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -422,7 +422,7 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
422 422
423 if (dp == NULL) 423 if (dp == NULL)
424 return -ENODEV; 424 return -ENODEV;
425 val = get_property(dp, "ATY,RefCLK", NULL); 425 val = of_get_property(dp, "ATY,RefCLK", NULL);
426 if (!val || !*val) { 426 if (!val || !*val) {
427 printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n"); 427 printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
428 return -EINVAL; 428 return -EINVAL;
@@ -430,11 +430,11 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
430 430
431 rinfo->pll.ref_clk = (*val) / 10; 431 rinfo->pll.ref_clk = (*val) / 10;
432 432
433 val = get_property(dp, "ATY,SCLK", NULL); 433 val = of_get_property(dp, "ATY,SCLK", NULL);
434 if (val && *val) 434 if (val && *val)
435 rinfo->pll.sclk = (*val) / 10; 435 rinfo->pll.sclk = (*val) / 10;
436 436
437 val = get_property(dp, "ATY,MCLK", NULL); 437 val = of_get_property(dp, "ATY,MCLK", NULL);
438 if (val && *val) 438 if (val && *val)
439 rinfo->pll.mclk = (*val) / 10; 439 rinfo->pll.mclk = (*val) / 10;
440 440
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 737b5c09dbdb..2030ed813429 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -70,7 +70,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
70 int i, mt = MT_NONE; 70 int i, mt = MT_NONE;
71 71
72 RTRACE("analyzing OF properties...\n"); 72 RTRACE("analyzing OF properties...\n");
73 pmt = get_property(dp, "display-type", NULL); 73 pmt = of_get_property(dp, "display-type", NULL);
74 if (!pmt) 74 if (!pmt)
75 return MT_NONE; 75 return MT_NONE;
76 RTRACE("display-type: %s\n", pmt); 76 RTRACE("display-type: %s\n", pmt);
@@ -89,7 +89,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
89 } 89 }
90 90
91 for (i = 0; propnames[i] != NULL; ++i) { 91 for (i = 0; propnames[i] != NULL; ++i) {
92 pedid = get_property(dp, propnames[i], NULL); 92 pedid = of_get_property(dp, propnames[i], NULL);
93 if (pedid != NULL) 93 if (pedid != NULL)
94 break; 94 break;
95 } 95 }
@@ -98,9 +98,10 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
98 * single-head cards have hdno == -1 and skip this step 98 * single-head cards have hdno == -1 and skip this step
99 */ 99 */
100 if (pedid == NULL && dp->parent && (hdno != -1)) 100 if (pedid == NULL && dp->parent && (hdno != -1))
101 pedid = get_property(dp->parent, (hdno == 0) ? "EDID1" : "EDID2", NULL); 101 pedid = of_get_property(dp->parent,
102 (hdno == 0) ? "EDID1" : "EDID2", NULL);
102 if (pedid == NULL && dp->parent && (hdno == 0)) 103 if (pedid == NULL && dp->parent && (hdno == 0))
103 pedid = get_property(dp->parent, "EDID", NULL); 104 pedid = of_get_property(dp->parent, "EDID", NULL);
104 if (pedid == NULL) 105 if (pedid == NULL)
105 return mt; 106 return mt;
106 107
@@ -130,7 +131,7 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
130 do { 131 do {
131 if (!dp) 132 if (!dp)
132 return MT_NONE; 133 return MT_NONE;
133 pname = get_property(dp, "name", NULL); 134 pname = of_get_property(dp, "name", NULL);
134 if (!pname) 135 if (!pname)
135 return MT_NONE; 136 return MT_NONE;
136 len = strlen(pname); 137 len = strlen(pname);
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index c411293cefc8..1786ae188322 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -1290,7 +1290,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
1290 if (rinfo->of_node != NULL) { 1290 if (rinfo->of_node != NULL) {
1291 int size; 1291 int size;
1292 1292
1293 mrtable = get_property(rinfo->of_node, "ATY,MRT", &size); 1293 mrtable = of_get_property(rinfo->of_node, "ATY,MRT", &size);
1294 if (mrtable) 1294 if (mrtable)
1295 mrtable_size = size >> 2; 1295 mrtable_size = size >> 2;
1296 else 1296 else
diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c
index 163a774a1b30..73afd7eb9977 100644
--- a/drivers/video/nvidia/nv_of.c
+++ b/drivers/video/nvidia/nv_of.c
@@ -46,15 +46,15 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
46 46
47 for (dp = NULL; 47 for (dp = NULL;
48 (dp = of_get_next_child(parent, dp)) != NULL;) { 48 (dp = of_get_next_child(parent, dp)) != NULL;) {
49 pname = get_property(dp, "name", NULL); 49 pname = of_get_property(dp, "name", NULL);
50 if (!pname) 50 if (!pname)
51 continue; 51 continue;
52 len = strlen(pname); 52 len = strlen(pname);
53 if ((pname[len-1] == 'A' && conn == 1) || 53 if ((pname[len-1] == 'A' && conn == 1) ||
54 (pname[len-1] == 'B' && conn == 2)) { 54 (pname[len-1] == 'B' && conn == 2)) {
55 for (i = 0; propnames[i] != NULL; ++i) { 55 for (i = 0; propnames[i] != NULL; ++i) {
56 pedid = get_property(dp, propnames[i], 56 pedid = of_get_property(dp,
57 NULL); 57 propnames[i], NULL);
58 if (pedid != NULL) 58 if (pedid != NULL)
59 break; 59 break;
60 } 60 }
@@ -65,7 +65,7 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
65 } 65 }
66 if (pedid == NULL) { 66 if (pedid == NULL) {
67 for (i = 0; propnames[i] != NULL; ++i) { 67 for (i = 0; propnames[i] != NULL; ++i) {
68 pedid = get_property(parent, propnames[i], NULL); 68 pedid = of_get_property(parent, propnames[i], NULL);
69 if (pedid != NULL) 69 if (pedid != NULL)
70 break; 70 break;
71 } 71 }
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index 9576a55eaf16..885b42836cbb 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -322,8 +322,8 @@ static void __init offb_init_fb(const char *name, const char *full_name,
322 ioremap(base + 0x7ff000, 0x1000) + 0xcc0; 322 ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
323 par->cmap_data = par->cmap_adr + 1; 323 par->cmap_data = par->cmap_adr + 1;
324 par->cmap_type = cmap_m64; 324 par->cmap_type = cmap_m64;
325 } else if (dp && (device_is_compatible(dp, "pci1014,b7") || 325 } else if (dp && (of_device_is_compatible(dp, "pci1014,b7") ||
326 device_is_compatible(dp, "pci1014,21c"))) { 326 of_device_is_compatible(dp, "pci1014,21c"))) {
327 par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); 327 par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
328 if (par->cmap_adr) 328 if (par->cmap_adr)
329 par->cmap_type = cmap_gxt2000; 329 par->cmap_type = cmap_gxt2000;
@@ -425,27 +425,27 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
425 const u32 *pp, *addrp, *up; 425 const u32 *pp, *addrp, *up;
426 u64 asize; 426 u64 asize;
427 427
428 pp = get_property(dp, "linux,bootx-depth", &len); 428 pp = of_get_property(dp, "linux,bootx-depth", &len);
429 if (pp == NULL) 429 if (pp == NULL)
430 pp = get_property(dp, "depth", &len); 430 pp = of_get_property(dp, "depth", &len);
431 if (pp && len == sizeof(u32)) 431 if (pp && len == sizeof(u32))
432 depth = *pp; 432 depth = *pp;
433 433
434 pp = get_property(dp, "linux,bootx-width", &len); 434 pp = of_get_property(dp, "linux,bootx-width", &len);
435 if (pp == NULL) 435 if (pp == NULL)
436 pp = get_property(dp, "width", &len); 436 pp = of_get_property(dp, "width", &len);
437 if (pp && len == sizeof(u32)) 437 if (pp && len == sizeof(u32))
438 width = *pp; 438 width = *pp;
439 439
440 pp = get_property(dp, "linux,bootx-height", &len); 440 pp = of_get_property(dp, "linux,bootx-height", &len);
441 if (pp == NULL) 441 if (pp == NULL)
442 pp = get_property(dp, "height", &len); 442 pp = of_get_property(dp, "height", &len);
443 if (pp && len == sizeof(u32)) 443 if (pp && len == sizeof(u32))
444 height = *pp; 444 height = *pp;
445 445
446 pp = get_property(dp, "linux,bootx-linebytes", &len); 446 pp = of_get_property(dp, "linux,bootx-linebytes", &len);
447 if (pp == NULL) 447 if (pp == NULL)
448 pp = get_property(dp, "linebytes", &len); 448 pp = of_get_property(dp, "linebytes", &len);
449 if (pp && len == sizeof(u32) && (*pp != 0xffffffffu)) 449 if (pp && len == sizeof(u32) && (*pp != 0xffffffffu))
450 pitch = *pp; 450 pitch = *pp;
451 else 451 else
@@ -463,9 +463,9 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
463 * ranges and pick one that is both big enough and if possible encloses 463 * ranges and pick one that is both big enough and if possible encloses
464 * the "address" property. If none match, we pick the biggest 464 * the "address" property. If none match, we pick the biggest
465 */ 465 */
466 up = get_property(dp, "linux,bootx-addr", &len); 466 up = of_get_property(dp, "linux,bootx-addr", &len);
467 if (up == NULL) 467 if (up == NULL)
468 up = get_property(dp, "address", &len); 468 up = of_get_property(dp, "address", &len);
469 if (up && len == sizeof(u32)) 469 if (up && len == sizeof(u32))
470 addr_prop = *up; 470 addr_prop = *up;
471 471
@@ -521,7 +521,7 @@ static int __init offb_init(void)
521 return -ENODEV; 521 return -ENODEV;
522 522
523 /* Check if we have a MacOS display without a node spec */ 523 /* Check if we have a MacOS display without a node spec */
524 if (get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) { 524 if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) {
525 /* The old code tried to work out which node was the MacOS 525 /* The old code tried to work out which node was the MacOS
526 * display based on the address. I'm dropping that since the 526 * display based on the address. I'm dropping that since the
527 * lack of a node spec only happens with old BootX versions 527 * lack of a node spec only happens with old BootX versions
@@ -532,14 +532,14 @@ static int __init offb_init(void)
532 } 532 }
533 533
534 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { 534 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
535 if (get_property(dp, "linux,opened", NULL) && 535 if (of_get_property(dp, "linux,opened", NULL) &&
536 get_property(dp, "linux,boot-display", NULL)) { 536 of_get_property(dp, "linux,boot-display", NULL)) {
537 boot_disp = dp; 537 boot_disp = dp;
538 offb_init_nodriver(dp, 0); 538 offb_init_nodriver(dp, 0);
539 } 539 }
540 } 540 }
541 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { 541 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) {
542 if (get_property(dp, "linux,opened", NULL) && 542 if (of_get_property(dp, "linux,opened", NULL) &&
543 dp != boot_disp) 543 dp != boot_disp)
544 offb_init_nodriver(dp, 0); 544 offb_init_nodriver(dp, 0);
545 } 545 }
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 07d1979bc23e..9756a728b74f 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -898,8 +898,8 @@ static int ps3fb_vsync_settings(struct gpu_driver_info *dinfo, void *dev)
898 } 898 }
899 899
900 ps3fb.dev = dev; 900 ps3fb.dev = dev;
901 error = ps3_alloc_irq(PS3_BINDING_CPU_ANY, dinfo->irq.irq_outlet, 901 error = ps3_irq_plug_setup(PS3_BINDING_CPU_ANY, dinfo->irq.irq_outlet,
902 &ps3fb.irq_no); 902 &ps3fb.irq_no);
903 if (error) { 903 if (error) {
904 printk(KERN_ERR "%s: ps3_alloc_irq failed %d\n", __func__, 904 printk(KERN_ERR "%s: ps3_alloc_irq failed %d\n", __func__,
905 error); 905 error);
@@ -911,7 +911,7 @@ static int ps3fb_vsync_settings(struct gpu_driver_info *dinfo, void *dev)
911 if (error) { 911 if (error) {
912 printk(KERN_ERR "%s: request_irq failed %d\n", __func__, 912 printk(KERN_ERR "%s: request_irq failed %d\n", __func__,
913 error); 913 error);
914 ps3_free_irq(ps3fb.irq_no); 914 ps3_irq_plug_destroy(ps3fb.irq_no);
915 return error; 915 return error;
916 } 916 }
917 917
@@ -1083,7 +1083,7 @@ err_framebuffer_release:
1083 framebuffer_release(info); 1083 framebuffer_release(info);
1084err_free_irq: 1084err_free_irq:
1085 free_irq(ps3fb.irq_no, ps3fb.dev); 1085 free_irq(ps3fb.irq_no, ps3fb.dev);
1086 ps3_free_irq(ps3fb.irq_no); 1086 ps3_irq_plug_destroy(ps3fb.irq_no);
1087err_iounmap_dinfo: 1087err_iounmap_dinfo:
1088 iounmap((u8 __iomem *)ps3fb.dinfo); 1088 iounmap((u8 __iomem *)ps3fb.dinfo);
1089err_gpu_context_free: 1089err_gpu_context_free:
@@ -1099,7 +1099,7 @@ static void ps3fb_shutdown(struct platform_device *dev)
1099 ps3fb_flip_ctl(0); /* flip off */ 1099 ps3fb_flip_ctl(0); /* flip off */
1100 ps3fb.dinfo->irq.mask = 0; 1100 ps3fb.dinfo->irq.mask = 0;
1101 free_irq(ps3fb.irq_no, ps3fb.dev); 1101 free_irq(ps3fb.irq_no, ps3fb.dev);
1102 ps3_free_irq(ps3fb.irq_no); 1102 ps3_irq_plug_destroy(ps3fb.irq_no);
1103 iounmap((u8 __iomem *)ps3fb.dinfo); 1103 iounmap((u8 __iomem *)ps3fb.dinfo);
1104} 1104}
1105 1105
@@ -1114,7 +1114,7 @@ void ps3fb_cleanup(void)
1114 } 1114 }
1115 if (ps3fb.irq_no) { 1115 if (ps3fb.irq_no) {
1116 free_irq(ps3fb.irq_no, ps3fb.dev); 1116 free_irq(ps3fb.irq_no, ps3fb.dev);
1117 ps3_free_irq(ps3fb.irq_no); 1117 ps3_irq_plug_destroy(ps3fb.irq_no);
1118 } 1118 }
1119 iounmap((u8 __iomem *)ps3fb.dinfo); 1119 iounmap((u8 __iomem *)ps3fb.dinfo);
1120 1120
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index d7ece8d17a2c..9c6bd0991852 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1760,13 +1760,13 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
1760 NVTRACE_ENTER(); 1760 NVTRACE_ENTER();
1761 dp = pci_device_to_OF_node(pd); 1761 dp = pci_device_to_OF_node(pd);
1762 for (; dp != NULL; dp = dp->child) { 1762 for (; dp != NULL; dp = dp->child) {
1763 disptype = get_property(dp, "display-type", NULL); 1763 disptype = of_get_property(dp, "display-type", NULL);
1764 if (disptype == NULL) 1764 if (disptype == NULL)
1765 continue; 1765 continue;
1766 if (strncmp(disptype, "LCD", 3) != 0) 1766 if (strncmp(disptype, "LCD", 3) != 0)
1767 continue; 1767 continue;
1768 for (i = 0; propnames[i] != NULL; ++i) { 1768 for (i = 0; propnames[i] != NULL; ++i) {
1769 pedid = get_property(dp, propnames[i], NULL); 1769 pedid = of_get_property(dp, propnames[i], NULL);
1770 if (pedid != NULL) { 1770 if (pedid != NULL) {
1771 par->EDID = (unsigned char *)pedid; 1771 par->EDID = (unsigned char *)pedid;
1772 NVTRACE("LCD found.\n"); 1772 NVTRACE("LCD found.\n");
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index b2e56b30306a..870967e47204 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -26,6 +26,7 @@
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <asm/machdep.h>
29#include <asm/types.h> 30#include <asm/types.h>
30#include <asm/bitops.h> 31#include <asm/bitops.h>
31 32
@@ -109,6 +110,19 @@ static inline void pci_iommu_init(void) { }
109#endif 110#endif
110 111
111extern void alloc_dart_table(void); 112extern void alloc_dart_table(void);
113#if defined(CONFIG_PPC64) && defined(CONFIG_PM)
114static inline void iommu_save(void)
115{
116 if (ppc_md.iommu_save)
117 ppc_md.iommu_save();
118}
119
120static inline void iommu_restore(void)
121{
122 if (ppc_md.iommu_restore)
123 ppc_md.iommu_restore();
124}
125#endif
112 126
113#endif /* __KERNEL__ */ 127#endif /* __KERNEL__ */
114#endif /* _ASM_IOMMU_H */ 128#endif /* _ASM_IOMMU_H */
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h
index 532bfee934f4..df996b933def 100644
--- a/include/asm-powerpc/kdebug.h
+++ b/include/asm-powerpc/kdebug.h
@@ -18,8 +18,20 @@ struct die_args {
18 18
19extern int register_die_notifier(struct notifier_block *); 19extern int register_die_notifier(struct notifier_block *);
20extern int unregister_die_notifier(struct notifier_block *); 20extern int unregister_die_notifier(struct notifier_block *);
21extern int register_page_fault_notifier(struct notifier_block *); 21
22extern int unregister_page_fault_notifier(struct notifier_block *); 22/*
23 * These are only here because kprobes.c wants them to implement a
24 * blatant layering violation. Will hopefully go away soon once all
25 * architectures are updated.
26 */
27static inline int register_page_fault_notifier(struct notifier_block *nb)
28{
29 return 0;
30}
31static inline int unregister_page_fault_notifier(struct notifier_block *nb)
32{
33 return 0;
34}
23extern struct atomic_notifier_head powerpc_die_chain; 35extern struct atomic_notifier_head powerpc_die_chain;
24 36
25/* Grossly misnamed. */ 37/* Grossly misnamed. */
@@ -29,7 +41,6 @@ enum die_val {
29 DIE_DABR_MATCH, 41 DIE_DABR_MATCH,
30 DIE_BPT, 42 DIE_BPT,
31 DIE_SSTEP, 43 DIE_SSTEP,
32 DIE_PAGE_FAULT,
33}; 44};
34 45
35static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) 46static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index f850ca7020ed..b0e40ff32ee0 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -64,6 +64,12 @@ typedef unsigned int kprobe_opcode_t;
64 addr = *(kprobe_opcode_t **)addr; \ 64 addr = *(kprobe_opcode_t **)addr; \
65 } else if (name[0] != '.') \ 65 } else if (name[0] != '.') \
66 addr = *(kprobe_opcode_t **)addr; \ 66 addr = *(kprobe_opcode_t **)addr; \
67 } else { \
68 char dot_name[KSYM_NAME_LEN+1]; \
69 dot_name[0] = '.'; \
70 dot_name[1] = '\0'; \
71 strncat(dot_name, name, KSYM_NAME_LEN); \
72 addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \
67 } \ 73 } \
68} 74}
69 75
@@ -110,5 +116,6 @@ struct kprobe_ctlblk {
110 116
111extern int kprobe_exceptions_notify(struct notifier_block *self, 117extern int kprobe_exceptions_notify(struct notifier_block *self,
112 unsigned long val, void *data); 118 unsigned long val, void *data);
119extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
113#endif /* __KERNEL__ */ 120#endif /* __KERNEL__ */
114#endif /* _ASM_POWERPC_KPROBES_H */ 121#endif /* _ASM_POWERPC_KPROBES_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index b204926ce913..6fdabd6dfb3e 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -91,6 +91,11 @@ struct machdep_calls {
91 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size, 91 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
92 unsigned long flags); 92 unsigned long flags);
93 void (*iounmap)(volatile void __iomem *token); 93 void (*iounmap)(volatile void __iomem *token);
94
95#ifdef CONFIG_PM
96 void (*iommu_save)(void);
97 void (*iommu_restore)(void);
98#endif
94#endif /* CONFIG_PPC64 */ 99#endif /* CONFIG_PPC64 */
95 100
96 int (*probe)(void); 101 int (*probe)(void);
@@ -248,6 +253,7 @@ struct machdep_calls {
248}; 253};
249 254
250extern void power4_idle(void); 255extern void power4_idle(void);
256extern void power4_cpu_offline_powersave(void);
251extern void ppc6xx_idle(void); 257extern void ppc6xx_idle(void);
252 258
253/* 259/*
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
new file mode 100644
index 000000000000..7bbc37e27d3c
--- /dev/null
+++ b/include/asm-powerpc/mmu-44x.h
@@ -0,0 +1,72 @@
1#ifndef _ASM_POWERPC_MMU_44X_H_
2#define _ASM_POWERPC_MMU_44X_H_
3/*
4 * PPC440 support
5 */
6
7#define PPC44x_MMUCR_TID 0x000000ff
8#define PPC44x_MMUCR_STS 0x00010000
9
10#define PPC44x_TLB_PAGEID 0
11#define PPC44x_TLB_XLAT 1
12#define PPC44x_TLB_ATTRIB 2
13
14/* Page identification fields */
15#define PPC44x_TLB_EPN_MASK 0xfffffc00 /* Effective Page Number */
16#define PPC44x_TLB_VALID 0x00000200 /* Valid flag */
17#define PPC44x_TLB_TS 0x00000100 /* Translation address space */
18#define PPC44x_TLB_1K 0x00000000 /* Page sizes */
19#define PPC44x_TLB_4K 0x00000010
20#define PPC44x_TLB_16K 0x00000020
21#define PPC44x_TLB_64K 0x00000030
22#define PPC44x_TLB_256K 0x00000040
23#define PPC44x_TLB_1M 0x00000050
24#define PPC44x_TLB_16M 0x00000070
25#define PPC44x_TLB_256M 0x00000090
26
27/* Translation fields */
28#define PPC44x_TLB_RPN_MASK 0xfffffc00 /* Real Page Number */
29#define PPC44x_TLB_ERPN_MASK 0x0000000f
30
31/* Storage attribute and access control fields */
32#define PPC44x_TLB_ATTR_MASK 0x0000ff80
33#define PPC44x_TLB_U0 0x00008000 /* User 0 */
34#define PPC44x_TLB_U1 0x00004000 /* User 1 */
35#define PPC44x_TLB_U2 0x00002000 /* User 2 */
36#define PPC44x_TLB_U3 0x00001000 /* User 3 */
37#define PPC44x_TLB_W 0x00000800 /* Caching is write-through */
38#define PPC44x_TLB_I 0x00000400 /* Caching is inhibited */
39#define PPC44x_TLB_M 0x00000200 /* Memory is coherent */
40#define PPC44x_TLB_G 0x00000100 /* Memory is guarded */
41#define PPC44x_TLB_E 0x00000080 /* Memory is guarded */
42
43#define PPC44x_TLB_PERM_MASK 0x0000003f
44#define PPC44x_TLB_UX 0x00000020 /* User execution */
45#define PPC44x_TLB_UW 0x00000010 /* User write */
46#define PPC44x_TLB_UR 0x00000008 /* User read */
47#define PPC44x_TLB_SX 0x00000004 /* Super execution */
48#define PPC44x_TLB_SW 0x00000002 /* Super write */
49#define PPC44x_TLB_SR 0x00000001 /* Super read */
50
51/* Number of TLB entries */
52#define PPC44x_TLB_SIZE 64
53
54#ifndef __ASSEMBLY__
55
56typedef unsigned long long phys_addr_t;
57
58extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t);
59
60typedef struct {
61 unsigned long id;
62 unsigned long vdso_base;
63} mm_context_t;
64
65#endif /* !__ASSEMBLY__ */
66
67#define PPC44x_EARLY_TLBS 1
68
69/* Size of the TLBs used for pinning in lowmem */
70#define PPC_PIN_SIZE (1 << 28) /* 256M */
71
72#endif /* _ASM_POWERPC_MMU_44X_H_ */
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index 06b3e6d336cb..fe510fff8907 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -5,9 +5,12 @@
5#ifdef CONFIG_PPC64 5#ifdef CONFIG_PPC64
6/* 64-bit classic hash table MMU */ 6/* 64-bit classic hash table MMU */
7# include <asm/mmu-hash64.h> 7# include <asm/mmu-hash64.h>
8#elif defined(CONFIG_44x)
9/* 44x-style software loaded TLB */
10# include <asm/mmu-44x.h>
8#else 11#else
9/* 32-bit. FIXME: split up the 32-bit MMU types, and revise for 12/* Other 32-bit. FIXME: split up the other 32-bit MMU types, and
10 * arch/powerpc */ 13 * revise for arch/powerpc */
11# include <asm-ppc/mmu.h> 14# include <asm-ppc/mmu.h>
12#endif 15#endif
13 16
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 7afd5bf94528..c4631f6dd4f9 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -253,5 +253,16 @@ extern int __init mpc52xx_add_bridge(struct device_node *node);
253 253
254#endif /* __ASSEMBLY__ */ 254#endif /* __ASSEMBLY__ */
255 255
256#ifdef CONFIG_PM
257struct mpc52xx_suspend {
258 void (*board_suspend_prepare)(void __iomem *mbar);
259 void (*board_resume_finish)(void __iomem *mbar);
260};
261
262extern struct mpc52xx_suspend mpc52xx_suspend;
263extern int __init mpc52xx_pm_init(void);
264extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
265#endif /* CONFIG_PM */
266
256#endif /* __ASM_POWERPC_MPC52xx_H__ */ 267#endif /* __ASM_POWERPC_MPC52xx_H__ */
257 268
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index e4d5fc5362a0..22c85c4f5b29 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -3,6 +3,7 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/irq.h> 5#include <linux/irq.h>
6#include <linux/sysdev.h>
6#include <asm/dcr.h> 7#include <asm/dcr.h>
7 8
8/* 9/*
@@ -228,6 +229,14 @@ struct mpic_reg_bank {
228#endif /* CONFIG_PPC_DCR */ 229#endif /* CONFIG_PPC_DCR */
229}; 230};
230 231
232struct mpic_irq_save {
233 u32 vecprio,
234 dest;
235#ifdef CONFIG_MPIC_U3_HT_IRQS
236 u32 fixup_data;
237#endif
238};
239
231/* The instance data of a given MPIC */ 240/* The instance data of a given MPIC */
232struct mpic 241struct mpic
233{ 242{
@@ -294,6 +303,12 @@ struct mpic
294 303
295 /* link */ 304 /* link */
296 struct mpic *next; 305 struct mpic *next;
306
307 struct sys_device sysdev;
308
309#ifdef CONFIG_PM
310 struct mpic_irq_save *save_data;
311#endif
297}; 312};
298 313
299/* 314/*
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h
index 4f1aabe0ce73..e9af49eb1aa8 100644
--- a/include/asm-powerpc/of_device.h
+++ b/include/asm-powerpc/of_device.h
@@ -32,6 +32,8 @@ extern int of_device_register(struct of_device *ofdev);
32extern void of_device_unregister(struct of_device *ofdev); 32extern void of_device_unregister(struct of_device *ofdev);
33extern void of_release_dev(struct device *dev); 33extern void of_release_dev(struct device *dev);
34 34
35extern ssize_t of_device_get_modalias(struct of_device *ofdev,
36 char *str, ssize_t len);
35extern int of_device_uevent(struct device *dev, 37extern int of_device_uevent(struct device *dev,
36 char **envp, int num_envp, char *buffer, int buffer_size); 38 char **envp, int num_envp, char *buffer, int buffer_size);
37 39
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index b4d38b0b15f8..f37bff0ee889 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -126,7 +126,7 @@ typedef struct { unsigned long pmd; } pmd_t;
126#define __pmd(x) ((pmd_t) { (x) }) 126#define __pmd(x) ((pmd_t) { (x) })
127 127
128/* PUD level exusts only on 4k pages */ 128/* PUD level exusts only on 4k pages */
129#ifndef CONFIG_PPC_64K_PAGES 129#if defined(CONFIG_PPC64) && !defined(CONFIG_PPC_64K_PAGES)
130typedef struct { unsigned long pud; } pud_t; 130typedef struct { unsigned long pud; } pud_t;
131#define pud_val(x) ((x).pud) 131#define pud_val(x) ((x).pud)
132#define __pud(x) ((pud_t) { (x) }) 132#define __pud(x) ((pud_t) { (x) })
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h
index 07f6d3cf5e5a..374d0db37e1c 100644
--- a/include/asm-powerpc/page_32.h
+++ b/include/asm-powerpc/page_32.h
@@ -14,11 +14,9 @@
14#ifdef CONFIG_PTE_64BIT 14#ifdef CONFIG_PTE_64BIT
15typedef unsigned long long pte_basic_t; 15typedef unsigned long long pte_basic_t;
16#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */ 16#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */
17#define PTE_FMT "%16Lx"
18#else 17#else
19typedef unsigned long pte_basic_t; 18typedef unsigned long pte_basic_t;
20#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */ 19#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
21#define PTE_FMT "%.8lx"
22#endif 20#endif
23 21
24struct page; 22struct page;
diff --git a/include/asm-powerpc/pgalloc-32.h b/include/asm-powerpc/pgalloc-32.h
new file mode 100644
index 000000000000..235aef283edf
--- /dev/null
+++ b/include/asm-powerpc/pgalloc-32.h
@@ -0,0 +1,41 @@
1#ifndef _ASM_POWERPC_PGALLOC_32_H
2#define _ASM_POWERPC_PGALLOC_32_H
3
4#include <linux/threads.h>
5
6extern void __bad_pte(pmd_t *pmd);
7
8extern pgd_t *pgd_alloc(struct mm_struct *mm);
9extern void pgd_free(pgd_t *pgd);
10
11/*
12 * We don't have any real pmd's, and this code never triggers because
13 * the pgd will always be present..
14 */
15#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); })
16#define pmd_free(x) do { } while (0)
17#define __pmd_free_tlb(tlb,x) do { } while (0)
18#define pgd_populate(mm, pmd, pte) BUG()
19
20#ifndef CONFIG_BOOKE
21#define pmd_populate_kernel(mm, pmd, pte) \
22 (pmd_val(*(pmd)) = __pa(pte) | _PMD_PRESENT)
23#define pmd_populate(mm, pmd, pte) \
24 (pmd_val(*(pmd)) = (page_to_pfn(pte) << PAGE_SHIFT) | _PMD_PRESENT)
25#else
26#define pmd_populate_kernel(mm, pmd, pte) \
27 (pmd_val(*(pmd)) = (unsigned long)pte | _PMD_PRESENT)
28#define pmd_populate(mm, pmd, pte) \
29 (pmd_val(*(pmd)) = (unsigned long)lowmem_page_address(pte) | _PMD_PRESENT)
30#endif
31
32extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
33extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr);
34extern void pte_free_kernel(pte_t *pte);
35extern void pte_free(struct page *pte);
36
37#define __pte_free_tlb(tlb, pte) pte_free((pte))
38
39#define check_pgt_cache() do { } while (0)
40
41#endif /* _ASM_POWERPC_PGALLOC_32_H */
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h
new file mode 100644
index 000000000000..30b50cf56e2c
--- /dev/null
+++ b/include/asm-powerpc/pgalloc-64.h
@@ -0,0 +1,152 @@
1#ifndef _ASM_POWERPC_PGALLOC_64_H
2#define _ASM_POWERPC_PGALLOC_64_H
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
10#include <linux/mm.h>
11#include <linux/slab.h>
12#include <linux/cpumask.h>
13#include <linux/percpu.h>
14
15extern struct kmem_cache *pgtable_cache[];
16
17#ifdef CONFIG_PPC_64K_PAGES
18#define PTE_CACHE_NUM 0
19#define PMD_CACHE_NUM 1
20#define PGD_CACHE_NUM 2
21#define HUGEPTE_CACHE_NUM 3
22#else
23#define PTE_CACHE_NUM 0
24#define PMD_CACHE_NUM 1
25#define PUD_CACHE_NUM 1
26#define PGD_CACHE_NUM 0
27#define HUGEPTE_CACHE_NUM 2
28#endif
29
30static inline pgd_t *pgd_alloc(struct mm_struct *mm)
31{
32 return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL);
33}
34
35static inline void pgd_free(pgd_t *pgd)
36{
37 kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
38}
39
40#ifndef CONFIG_PPC_64K_PAGES
41
42#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
43
44static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
45{
46 return kmem_cache_alloc(pgtable_cache[PUD_CACHE_NUM],
47 GFP_KERNEL|__GFP_REPEAT);
48}
49
50static inline void pud_free(pud_t *pud)
51{
52 kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud);
53}
54
55static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
56{
57 pud_set(pud, (unsigned long)pmd);
58}
59
60#define pmd_populate(mm, pmd, pte_page) \
61 pmd_populate_kernel(mm, pmd, page_address(pte_page))
62#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
63
64
65#else /* CONFIG_PPC_64K_PAGES */
66
67#define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd)
68
69static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
70 pte_t *pte)
71{
72 pmd_set(pmd, (unsigned long)pte);
73}
74
75#define pmd_populate(mm, pmd, pte_page) \
76 pmd_populate_kernel(mm, pmd, page_address(pte_page))
77
78#endif /* CONFIG_PPC_64K_PAGES */
79
80static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
81{
82 return kmem_cache_alloc(pgtable_cache[PMD_CACHE_NUM],
83 GFP_KERNEL|__GFP_REPEAT);
84}
85
86static inline void pmd_free(pmd_t *pmd)
87{
88 kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd);
89}
90
91static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
92 unsigned long address)
93{
94 return kmem_cache_alloc(pgtable_cache[PTE_CACHE_NUM],
95 GFP_KERNEL|__GFP_REPEAT);
96}
97
98static inline struct page *pte_alloc_one(struct mm_struct *mm,
99 unsigned long address)
100{
101 return virt_to_page(pte_alloc_one_kernel(mm, address));
102}
103
104static inline void pte_free_kernel(pte_t *pte)
105{
106 kmem_cache_free(pgtable_cache[PTE_CACHE_NUM], pte);
107}
108
109static inline void pte_free(struct page *ptepage)
110{
111 pte_free_kernel(page_address(ptepage));
112}
113
114#define PGF_CACHENUM_MASK 0x3
115
116typedef struct pgtable_free {
117 unsigned long val;
118} pgtable_free_t;
119
120static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
121 unsigned long mask)
122{
123 BUG_ON(cachenum > PGF_CACHENUM_MASK);
124
125 return (pgtable_free_t){.val = ((unsigned long) p & ~mask) | cachenum};
126}
127
128static inline void pgtable_free(pgtable_free_t pgf)
129{
130 void *p = (void *)(pgf.val & ~PGF_CACHENUM_MASK);
131 int cachenum = pgf.val & PGF_CACHENUM_MASK;
132
133 kmem_cache_free(pgtable_cache[cachenum], p);
134}
135
136extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
137
138#define __pte_free_tlb(tlb, ptepage) \
139 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
140 PTE_CACHE_NUM, PTE_TABLE_SIZE-1))
141#define __pmd_free_tlb(tlb, pmd) \
142 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
143 PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
144#ifndef CONFIG_PPC_64K_PAGES
145#define __pud_free_tlb(tlb, pud) \
146 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
147 PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
148#endif /* CONFIG_PPC_64K_PAGES */
149
150#define check_pgt_cache() do { } while (0)
151
152#endif /* _ASM_POWERPC_PGALLOC_64_H */
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h
index b0830db68f8a..b4505ed0f0f2 100644
--- a/include/asm-powerpc/pgalloc.h
+++ b/include/asm-powerpc/pgalloc.h
@@ -2,159 +2,11 @@
2#define _ASM_POWERPC_PGALLOC_H 2#define _ASM_POWERPC_PGALLOC_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#ifndef CONFIG_PPC64 5#ifdef CONFIG_PPC64
6#include <asm-ppc/pgalloc.h> 6#include <asm/pgalloc-64.h>
7#else 7#else
8 8#include <asm/pgalloc-32.h>
9#include <linux/mm.h>
10#include <linux/slab.h>
11#include <linux/cpumask.h>
12#include <linux/percpu.h>
13
14extern struct kmem_cache *pgtable_cache[];
15
16#ifdef CONFIG_PPC_64K_PAGES
17#define PTE_CACHE_NUM 0
18#define PMD_CACHE_NUM 1
19#define PGD_CACHE_NUM 2
20#define HUGEPTE_CACHE_NUM 3
21#else
22#define PTE_CACHE_NUM 0
23#define PMD_CACHE_NUM 1
24#define PUD_CACHE_NUM 1
25#define PGD_CACHE_NUM 0
26#define HUGEPTE_CACHE_NUM 2
27#endif 9#endif
28 10
29/*
30 * This program is free software; you can redistribute it and/or
31 * modify it under the terms of the GNU General Public License
32 * as published by the Free Software Foundation; either version
33 * 2 of the License, or (at your option) any later version.
34 */
35
36static inline pgd_t *pgd_alloc(struct mm_struct *mm)
37{
38 return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL);
39}
40
41static inline void pgd_free(pgd_t *pgd)
42{
43 kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
44}
45
46#ifndef CONFIG_PPC_64K_PAGES
47
48#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
49
50static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
51{
52 return kmem_cache_alloc(pgtable_cache[PUD_CACHE_NUM],
53 GFP_KERNEL|__GFP_REPEAT);
54}
55
56static inline void pud_free(pud_t *pud)
57{
58 kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud);
59}
60
61static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
62{
63 pud_set(pud, (unsigned long)pmd);
64}
65
66#define pmd_populate(mm, pmd, pte_page) \
67 pmd_populate_kernel(mm, pmd, page_address(pte_page))
68#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
69
70
71#else /* CONFIG_PPC_64K_PAGES */
72
73#define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd)
74
75static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
76 pte_t *pte)
77{
78 pmd_set(pmd, (unsigned long)pte);
79}
80
81#define pmd_populate(mm, pmd, pte_page) \
82 pmd_populate_kernel(mm, pmd, page_address(pte_page))
83
84#endif /* CONFIG_PPC_64K_PAGES */
85
86static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
87{
88 return kmem_cache_alloc(pgtable_cache[PMD_CACHE_NUM],
89 GFP_KERNEL|__GFP_REPEAT);
90}
91
92static inline void pmd_free(pmd_t *pmd)
93{
94 kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd);
95}
96
97static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
98 unsigned long address)
99{
100 return kmem_cache_alloc(pgtable_cache[PTE_CACHE_NUM],
101 GFP_KERNEL|__GFP_REPEAT);
102}
103
104static inline struct page *pte_alloc_one(struct mm_struct *mm,
105 unsigned long address)
106{
107 return virt_to_page(pte_alloc_one_kernel(mm, address));
108}
109
110static inline void pte_free_kernel(pte_t *pte)
111{
112 kmem_cache_free(pgtable_cache[PTE_CACHE_NUM], pte);
113}
114
115static inline void pte_free(struct page *ptepage)
116{
117 pte_free_kernel(page_address(ptepage));
118}
119
120#define PGF_CACHENUM_MASK 0x3
121
122typedef struct pgtable_free {
123 unsigned long val;
124} pgtable_free_t;
125
126static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
127 unsigned long mask)
128{
129 BUG_ON(cachenum > PGF_CACHENUM_MASK);
130
131 return (pgtable_free_t){.val = ((unsigned long) p & ~mask) | cachenum};
132}
133
134static inline void pgtable_free(pgtable_free_t pgf)
135{
136 void *p = (void *)(pgf.val & ~PGF_CACHENUM_MASK);
137 int cachenum = pgf.val & PGF_CACHENUM_MASK;
138
139 kmem_cache_free(pgtable_cache[cachenum], p);
140}
141
142extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
143
144#define __pte_free_tlb(tlb, ptepage) \
145 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
146 PTE_CACHE_NUM, PTE_TABLE_SIZE-1))
147#define __pmd_free_tlb(tlb, pmd) \
148 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
149 PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
150#ifndef CONFIG_PPC_64K_PAGES
151#define __pud_free_tlb(tlb, pud) \
152 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
153 PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
154#endif /* CONFIG_PPC_64K_PAGES */
155
156#define check_pgt_cache() do { } while (0)
157
158#endif /* CONFIG_PPC64 */
159#endif /* __KERNEL__ */ 11#endif /* __KERNEL__ */
160#endif /* _ASM_POWERPC_PGALLOC_H */ 12#endif /* _ASM_POWERPC_PGALLOC_H */
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h
index a28fa8bc01da..1744d6ac12a2 100644
--- a/include/asm-powerpc/pgtable-4k.h
+++ b/include/asm-powerpc/pgtable-4k.h
@@ -1,3 +1,5 @@
1#ifndef _ASM_POWERPC_PGTABLE_4K_H
2#define _ASM_POWERPC_PGTABLE_4K_H
1/* 3/*
2 * Entries per page directory level. The PTE level must use a 64b record 4 * Entries per page directory level. The PTE level must use a 64b record
3 * for each page table entry. The PMD and PGD level use a 32b record for 5 * for each page table entry. The PMD and PGD level use a 32b record for
@@ -100,3 +102,4 @@
100 102
101#define remap_4k_pfn(vma, addr, pfn, prot) \ 103#define remap_4k_pfn(vma, addr, pfn, prot) \
102 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot)) 104 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot))
105#endif /* _ASM_POWERPC_PGTABLE_4K_H */
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h
index 5e84f070eaf7..16ef4978520d 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -1,6 +1,5 @@
1#ifndef _ASM_POWERPC_PGTABLE_64K_H 1#ifndef _ASM_POWERPC_PGTABLE_64K_H
2#define _ASM_POWERPC_PGTABLE_64K_H 2#define _ASM_POWERPC_PGTABLE_64K_H
3#ifdef __KERNEL__
4 3
5#include <asm-generic/pgtable-nopud.h> 4#include <asm-generic/pgtable-nopud.h>
6 5
@@ -65,8 +64,6 @@
65/* Bits to mask out from a PGD/PUD to get to the PMD page */ 64/* Bits to mask out from a PGD/PUD to get to the PMD page */
66#define PUD_MASKED_BITS 0x1ff 65#define PUD_MASKED_BITS 0x1ff
67 66
68#ifndef __ASSEMBLY__
69
70/* Manipulate "rpte" values */ 67/* Manipulate "rpte" values */
71#define __real_pte(e,p) ((real_pte_t) { \ 68#define __real_pte(e,p) ((real_pte_t) { \
72 (e), pte_val(*((p) + PTRS_PER_PTE)) }) 69 (e), pte_val(*((p) + PTRS_PER_PTE)) })
@@ -98,6 +95,4 @@
98 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \ 95 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \
99 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN)) 96 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN))
100 97
101#endif /* __ASSEMBLY__ */
102#endif /* __KERNEL__ */
103#endif /* _ASM_POWERPC_PGTABLE_64K_H */ 98#endif /* _ASM_POWERPC_PGTABLE_64K_H */
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
new file mode 100644
index 000000000000..e704640b3e48
--- /dev/null
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -0,0 +1,839 @@
1#ifndef _ASM_POWERPC_PGTABLE_PPC32_H
2#define _ASM_POWERPC_PGTABLE_PPC32_H
3
4#include <asm-generic/4level-fixup.h>
5
6#ifndef __ASSEMBLY__
7#include <linux/sched.h>
8#include <linux/threads.h>
9#include <asm/processor.h> /* For TASK_SIZE */
10#include <asm/mmu.h>
11#include <asm/page.h>
12#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */
13struct mm_struct;
14
15extern unsigned long va_to_phys(unsigned long address);
16extern pte_t *va_to_pte(unsigned long address);
17extern unsigned long ioremap_bot, ioremap_base;
18#endif /* __ASSEMBLY__ */
19
20/*
21 * The PowerPC MMU uses a hash table containing PTEs, together with
22 * a set of 16 segment registers (on 32-bit implementations), to define
23 * the virtual to physical address mapping.
24 *
25 * We use the hash table as an extended TLB, i.e. a cache of currently
26 * active mappings. We maintain a two-level page table tree, much
27 * like that used by the i386, for the sake of the Linux memory
28 * management code. Low-level assembler code in hashtable.S
29 * (procedure hash_page) is responsible for extracting ptes from the
30 * tree and putting them into the hash table when necessary, and
31 * updating the accessed and modified bits in the page table tree.
32 */
33
34/*
35 * The PowerPC MPC8xx uses a TLB with hardware assisted, software tablewalk.
36 * We also use the two level tables, but we can put the real bits in them
37 * needed for the TLB and tablewalk. These definitions require Mx_CTR.PPM = 0,
38 * Mx_CTR.PPCS = 0, and MD_CTR.TWAM = 1. The level 2 descriptor has
39 * additional page protection (when Mx_CTR.PPCS = 1) that allows TLB hit
40 * based upon user/super access. The TLB does not have accessed nor write
41 * protect. We assume that if the TLB get loaded with an entry it is
42 * accessed, and overload the changed bit for write protect. We use
43 * two bits in the software pte that are supposed to be set to zero in
44 * the TLB entry (24 and 25) for these indicators. Although the level 1
45 * descriptor contains the guarded and writethrough/copyback bits, we can
46 * set these at the page level since they get copied from the Mx_TWC
47 * register when the TLB entry is loaded. We will use bit 27 for guard, since
48 * that is where it exists in the MD_TWC, and bit 26 for writethrough.
49 * These will get masked from the level 2 descriptor at TLB load time, and
50 * copied to the MD_TWC before it gets loaded.
51 * Large page sizes added. We currently support two sizes, 4K and 8M.
52 * This also allows a TLB hander optimization because we can directly
53 * load the PMD into MD_TWC. The 8M pages are only used for kernel
54 * mapping of well known areas. The PMD (PGD) entries contain control
55 * flags in addition to the address, so care must be taken that the
56 * software no longer assumes these are only pointers.
57 */
58
59/*
60 * At present, all PowerPC 400-class processors share a similar TLB
61 * architecture. The instruction and data sides share a unified,
62 * 64-entry, fully-associative TLB which is maintained totally under
63 * software control. In addition, the instruction side has a
64 * hardware-managed, 4-entry, fully-associative TLB which serves as a
65 * first level to the shared TLB. These two TLBs are known as the UTLB
66 * and ITLB, respectively (see "mmu.h" for definitions).
67 */
68
69/*
70 * The normal case is that PTEs are 32-bits and we have a 1-page
71 * 1024-entry pgdir pointing to 1-page 1024-entry PTE pages. -- paulus
72 *
73 * For any >32-bit physical address platform, we can use the following
74 * two level page table layout where the pgdir is 8KB and the MS 13 bits
75 * are an index to the second level table. The combined pgdir/pmd first
76 * level has 2048 entries and the second level has 512 64-bit PTE entries.
77 * -Matt
78 */
79/* PMD_SHIFT determines the size of the area mapped by the PTE pages */
80#define PMD_SHIFT (PAGE_SHIFT + PTE_SHIFT)
81#define PMD_SIZE (1UL << PMD_SHIFT)
82#define PMD_MASK (~(PMD_SIZE-1))
83
84/* PGDIR_SHIFT determines what a top-level page table entry can map */
85#define PGDIR_SHIFT PMD_SHIFT
86#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
87#define PGDIR_MASK (~(PGDIR_SIZE-1))
88
89/*
90 * entries per page directory level: our page-table tree is two-level, so
91 * we don't really have any PMD directory.
92 */
93#define PTRS_PER_PTE (1 << PTE_SHIFT)
94#define PTRS_PER_PMD 1
95#define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT))
96
97#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
98#define FIRST_USER_ADDRESS 0
99
100#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
101#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
102
103#define pte_ERROR(e) \
104 printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
105 (unsigned long long)pte_val(e))
106#define pmd_ERROR(e) \
107 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
108#define pgd_ERROR(e) \
109 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
110
111/*
112 * Just any arbitrary offset to the start of the vmalloc VM area: the
113 * current 64MB value just means that there will be a 64MB "hole" after the
114 * physical memory until the kernel virtual memory starts. That means that
115 * any out-of-bounds memory accesses will hopefully be caught.
116 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
117 * area for the same reason. ;)
118 *
119 * We no longer map larger than phys RAM with the BATs so we don't have
120 * to worry about the VMALLOC_OFFSET causing problems. We do have to worry
121 * about clashes between our early calls to ioremap() that start growing down
122 * from ioremap_base being run into the VM area allocations (growing upwards
123 * from VMALLOC_START). For this reason we have ioremap_bot to check when
124 * we actually run into our mappings setup in the early boot with the VM
125 * system. This really does become a problem for machines with good amounts
126 * of RAM. -- Cort
127 */
128#define VMALLOC_OFFSET (0x1000000) /* 16M */
129#ifdef PPC_PIN_SIZE
130#define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
131#else
132#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
133#endif
134#define VMALLOC_END ioremap_bot
135
136/*
137 * Bits in a linux-style PTE. These match the bits in the
138 * (hardware-defined) PowerPC PTE as closely as possible.
139 */
140
141#if defined(CONFIG_40x)
142
143/* There are several potential gotchas here. The 40x hardware TLBLO
144 field looks like this:
145
146 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31
147 RPN..................... 0 0 EX WR ZSEL....... W I M G
148
149 Where possible we make the Linux PTE bits match up with this
150
151 - bits 20 and 21 must be cleared, because we use 4k pages (40x can
152 support down to 1k pages), this is done in the TLBMiss exception
153 handler.
154 - We use only zones 0 (for kernel pages) and 1 (for user pages)
155 of the 16 available. Bit 24-26 of the TLB are cleared in the TLB
156 miss handler. Bit 27 is PAGE_USER, thus selecting the correct
157 zone.
158 - PRESENT *must* be in the bottom two bits because swap cache
159 entries use the top 30 bits. Because 40x doesn't support SMP
160 anyway, M is irrelevant so we borrow it for PAGE_PRESENT. Bit 30
161 is cleared in the TLB miss handler before the TLB entry is loaded.
162 - All other bits of the PTE are loaded into TLBLO without
163 modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for
164 software PTE bits. We actually use use bits 21, 24, 25, and
165 30 respectively for the software bits: ACCESSED, DIRTY, RW, and
166 PRESENT.
167*/
168
169/* Definitions for 40x embedded chips. */
170#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
171#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */
172#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
173#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
174#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
175#define _PAGE_USER 0x010 /* matches one of the zone permission bits */
176#define _PAGE_RW 0x040 /* software: Writes permitted */
177#define _PAGE_DIRTY 0x080 /* software: dirty page */
178#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */
179#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */
180#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
181
182#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */
183#define _PMD_BAD 0x802
184#define _PMD_SIZE 0x0e0 /* size field, != 0 for large-page PMD entry */
185#define _PMD_SIZE_4M 0x0c0
186#define _PMD_SIZE_16M 0x0e0
187#define PMD_PAGE_SIZE(pmdval) (1024 << (((pmdval) & _PMD_SIZE) >> 4))
188
189#elif defined(CONFIG_44x)
190/*
191 * Definitions for PPC440
192 *
193 * Because of the 3 word TLB entries to support 36-bit addressing,
194 * the attribute are difficult to map in such a fashion that they
195 * are easily loaded during exception processing. I decided to
196 * organize the entry so the ERPN is the only portion in the
197 * upper word of the PTE and the attribute bits below are packed
198 * in as sensibly as they can be in the area below a 4KB page size
199 * oriented RPN. This at least makes it easy to load the RPN and
200 * ERPN fields in the TLB. -Matt
201 *
202 * Note that these bits preclude future use of a page size
203 * less than 4KB.
204 *
205 *
206 * PPC 440 core has following TLB attribute fields;
207 *
208 * TLB1:
209 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
210 * RPN................................. - - - - - - ERPN.......
211 *
212 * TLB2:
213 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
214 * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR
215 *
216 * There are some constrains and options, to decide mapping software bits
217 * into TLB entry.
218 *
219 * - PRESENT *must* be in the bottom three bits because swap cache
220 * entries use the top 29 bits for TLB2.
221 *
222 * - FILE *must* be in the bottom three bits because swap cache
223 * entries use the top 29 bits for TLB2.
224 *
225 * - CACHE COHERENT bit (M) has no effect on PPC440 core, because it
226 * doesn't support SMP. So we can use this as software bit, like
227 * DIRTY.
228 *
229 * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used
230 * for memory protection related functions (see PTE structure in
231 * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the
232 * above bits. Note that the bit values are CPU specific, not architecture
233 * specific.
234 *
235 * The kernel PTE entry holds an arch-dependent swp_entry structure under
236 * certain situations. In other words, in such situations some portion of
237 * the PTE bits are used as a swp_entry. In the PPC implementation, the
238 * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still
239 * hold protection values. That means the three protection bits are
240 * reserved for both PTE and SWAP entry at the most significant three
241 * LSBs.
242 *
243 * There are three protection bits available for SWAP entry:
244 * _PAGE_PRESENT
245 * _PAGE_FILE
246 * _PAGE_HASHPTE (if HW has)
247 *
248 * So those three bits have to be inside of 0-2nd LSB of PTE.
249 *
250 */
251
252#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */
253#define _PAGE_RW 0x00000002 /* S: Write permission */
254#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */
255#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */
256#define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */
257#define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */
258#define _PAGE_USER 0x00000040 /* S: User page */
259#define _PAGE_ENDIAN 0x00000080 /* H: E bit */
260#define _PAGE_GUARDED 0x00000100 /* H: G bit */
261#define _PAGE_DIRTY 0x00000200 /* S: Page dirty */
262#define _PAGE_NO_CACHE 0x00000400 /* H: I bit */
263#define _PAGE_WRITETHRU 0x00000800 /* H: W bit */
264
265/* TODO: Add large page lowmem mapping support */
266#define _PMD_PRESENT 0
267#define _PMD_PRESENT_MASK (PAGE_MASK)
268#define _PMD_BAD (~PAGE_MASK)
269
270/* ERPN in a PTE never gets cleared, ignore it */
271#define _PTE_NONE_MASK 0xffffffff00000000ULL
272
273#elif defined(CONFIG_FSL_BOOKE)
274/*
275 MMU Assist Register 3:
276
277 32 33 34 35 36 ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63
278 RPN...................... 0 0 U0 U1 U2 U3 UX SX UW SW UR SR
279
280 - PRESENT *must* be in the bottom three bits because swap cache
281 entries use the top 29 bits.
282
283 - FILE *must* be in the bottom three bits because swap cache
284 entries use the top 29 bits.
285*/
286
287/* Definitions for FSL Book-E Cores */
288#define _PAGE_PRESENT 0x00001 /* S: PTE contains a translation */
289#define _PAGE_USER 0x00002 /* S: User page (maps to UR) */
290#define _PAGE_FILE 0x00002 /* S: when !present: nonlinear file mapping */
291#define _PAGE_ACCESSED 0x00004 /* S: Page referenced */
292#define _PAGE_HWWRITE 0x00008 /* H: Dirty & RW, set in exception */
293#define _PAGE_RW 0x00010 /* S: Write permission */
294#define _PAGE_HWEXEC 0x00020 /* H: UX permission */
295
296#define _PAGE_ENDIAN 0x00040 /* H: E bit */
297#define _PAGE_GUARDED 0x00080 /* H: G bit */
298#define _PAGE_COHERENT 0x00100 /* H: M bit */
299#define _PAGE_NO_CACHE 0x00200 /* H: I bit */
300#define _PAGE_WRITETHRU 0x00400 /* H: W bit */
301
302#ifdef CONFIG_PTE_64BIT
303#define _PAGE_DIRTY 0x08000 /* S: Page dirty */
304
305/* ERPN in a PTE never gets cleared, ignore it */
306#define _PTE_NONE_MASK 0xffffffffffff0000ULL
307#else
308#define _PAGE_DIRTY 0x00800 /* S: Page dirty */
309#endif
310
311#define _PMD_PRESENT 0
312#define _PMD_PRESENT_MASK (PAGE_MASK)
313#define _PMD_BAD (~PAGE_MASK)
314
315#elif defined(CONFIG_8xx)
316/* Definitions for 8xx embedded chips. */
317#define _PAGE_PRESENT 0x0001 /* Page is valid */
318#define _PAGE_FILE 0x0002 /* when !present: nonlinear file mapping */
319#define _PAGE_NO_CACHE 0x0002 /* I: cache inhibit */
320#define _PAGE_SHARED 0x0004 /* No ASID (context) compare */
321
322/* These five software bits must be masked out when the entry is loaded
323 * into the TLB.
324 */
325#define _PAGE_EXEC 0x0008 /* software: i-cache coherency required */
326#define _PAGE_GUARDED 0x0010 /* software: guarded access */
327#define _PAGE_DIRTY 0x0020 /* software: page changed */
328#define _PAGE_RW 0x0040 /* software: user write access allowed */
329#define _PAGE_ACCESSED 0x0080 /* software: page referenced */
330
331/* Setting any bits in the nibble with the follow two controls will
332 * require a TLB exception handler change. It is assumed unused bits
333 * are always zero.
334 */
335#define _PAGE_HWWRITE 0x0100 /* h/w write enable: never set in Linux PTE */
336#define _PAGE_USER 0x0800 /* One of the PP bits, the other is USER&~RW */
337
338#define _PMD_PRESENT 0x0001
339#define _PMD_BAD 0x0ff0
340#define _PMD_PAGE_MASK 0x000c
341#define _PMD_PAGE_8M 0x000c
342
343/*
344 * The 8xx TLB miss handler allegedly sets _PAGE_ACCESSED in the PTE
345 * for an address even if _PAGE_PRESENT is not set, as a performance
346 * optimization. This is a bug if you ever want to use swap unless
347 * _PAGE_ACCESSED is 2, which it isn't, or unless you have 8xx-specific
348 * definitions for __swp_entry etc. below, which would be gross.
349 * -- paulus
350 */
351#define _PTE_NONE_MASK _PAGE_ACCESSED
352
353#else /* CONFIG_6xx */
354/* Definitions for 60x, 740/750, etc. */
355#define _PAGE_PRESENT 0x001 /* software: pte contains a translation */
356#define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */
357#define _PAGE_FILE 0x004 /* when !present: nonlinear file mapping */
358#define _PAGE_USER 0x004 /* usermode access allowed */
359#define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
360#define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
361#define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
362#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
363#define _PAGE_DIRTY 0x080 /* C: page changed */
364#define _PAGE_ACCESSED 0x100 /* R: page referenced */
365#define _PAGE_EXEC 0x200 /* software: i-cache coherency required */
366#define _PAGE_RW 0x400 /* software: user write access allowed */
367
368#define _PTE_NONE_MASK _PAGE_HASHPTE
369
370#define _PMD_PRESENT 0
371#define _PMD_PRESENT_MASK (PAGE_MASK)
372#define _PMD_BAD (~PAGE_MASK)
373#endif
374
375/*
376 * Some bits are only used on some cpu families...
377 */
378#ifndef _PAGE_HASHPTE
379#define _PAGE_HASHPTE 0
380#endif
381#ifndef _PTE_NONE_MASK
382#define _PTE_NONE_MASK 0
383#endif
384#ifndef _PAGE_SHARED
385#define _PAGE_SHARED 0
386#endif
387#ifndef _PAGE_HWWRITE
388#define _PAGE_HWWRITE 0
389#endif
390#ifndef _PAGE_HWEXEC
391#define _PAGE_HWEXEC 0
392#endif
393#ifndef _PAGE_EXEC
394#define _PAGE_EXEC 0
395#endif
396#ifndef _PMD_PRESENT_MASK
397#define _PMD_PRESENT_MASK _PMD_PRESENT
398#endif
399#ifndef _PMD_SIZE
400#define _PMD_SIZE 0
401#define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
402#endif
403
404#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
405
406/*
407 * Note: the _PAGE_COHERENT bit automatically gets set in the hardware
408 * PTE if CONFIG_SMP is defined (hash_page does this); there is no need
409 * to have it in the Linux PTE, and in fact the bit could be reused for
410 * another purpose. -- paulus.
411 */
412
413#ifdef CONFIG_44x
414#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_GUARDED)
415#else
416#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED)
417#endif
418#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE)
419#define _PAGE_KERNEL (_PAGE_BASE | _PAGE_SHARED | _PAGE_WRENABLE)
420
421#ifdef CONFIG_PPC_STD_MMU
422/* On standard PPC MMU, no user access implies kernel read/write access,
423 * so to write-protect kernel memory we must turn on user access */
424#define _PAGE_KERNEL_RO (_PAGE_BASE | _PAGE_SHARED | _PAGE_USER)
425#else
426#define _PAGE_KERNEL_RO (_PAGE_BASE | _PAGE_SHARED)
427#endif
428
429#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
430#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC)
431
432#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH)
433/* We want the debuggers to be able to set breakpoints anywhere, so
434 * don't write protect the kernel text */
435#define _PAGE_RAM_TEXT _PAGE_RAM
436#else
437#define _PAGE_RAM_TEXT (_PAGE_KERNEL_RO | _PAGE_HWEXEC)
438#endif
439
440#define PAGE_NONE __pgprot(_PAGE_BASE)
441#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
442#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
443#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
444#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
445#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
446#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
447
448#define PAGE_KERNEL __pgprot(_PAGE_RAM)
449#define PAGE_KERNEL_NOCACHE __pgprot(_PAGE_IO)
450
451/*
452 * The PowerPC can only do execute protection on a segment (256MB) basis,
453 * not on a page basis. So we consider execute permission the same as read.
454 * Also, write permissions imply read permissions.
455 * This is the closest we can get..
456 */
457#define __P000 PAGE_NONE
458#define __P001 PAGE_READONLY_X
459#define __P010 PAGE_COPY
460#define __P011 PAGE_COPY_X
461#define __P100 PAGE_READONLY
462#define __P101 PAGE_READONLY_X
463#define __P110 PAGE_COPY
464#define __P111 PAGE_COPY_X
465
466#define __S000 PAGE_NONE
467#define __S001 PAGE_READONLY_X
468#define __S010 PAGE_SHARED
469#define __S011 PAGE_SHARED_X
470#define __S100 PAGE_READONLY
471#define __S101 PAGE_READONLY_X
472#define __S110 PAGE_SHARED
473#define __S111 PAGE_SHARED_X
474
475#ifndef __ASSEMBLY__
476/* Make sure we get a link error if PMD_PAGE_SIZE is ever called on a
477 * kernel without large page PMD support */
478extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
479
480/*
481 * Conversions between PTE values and page frame numbers.
482 */
483
484/* in some case we want to additionaly adjust where the pfn is in the pte to
485 * allow room for more flags */
486#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_PTE_64BIT)
487#define PFN_SHIFT_OFFSET (PAGE_SHIFT + 8)
488#else
489#define PFN_SHIFT_OFFSET (PAGE_SHIFT)
490#endif
491
492#define pte_pfn(x) (pte_val(x) >> PFN_SHIFT_OFFSET)
493#define pte_page(x) pfn_to_page(pte_pfn(x))
494
495#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\
496 pgprot_val(prot))
497#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
498
499/*
500 * ZERO_PAGE is a global shared page that is always zero: used
501 * for zero-mapped memory areas etc..
502 */
503extern unsigned long empty_zero_page[1024];
504#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
505
506#endif /* __ASSEMBLY__ */
507
508#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
509#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
510#define pte_clear(mm,addr,ptep) do { set_pte_at((mm), (addr), (ptep), __pte(0)); } while (0)
511
512#define pmd_none(pmd) (!pmd_val(pmd))
513#define pmd_bad(pmd) (pmd_val(pmd) & _PMD_BAD)
514#define pmd_present(pmd) (pmd_val(pmd) & _PMD_PRESENT_MASK)
515#define pmd_clear(pmdp) do { pmd_val(*(pmdp)) = 0; } while (0)
516
517#ifndef __ASSEMBLY__
518/*
519 * The "pgd_xxx()" functions here are trivial for a folded two-level
520 * setup: the pgd is never bad, and a pmd always exists (as it's folded
521 * into the pgd entry)
522 */
523static inline int pgd_none(pgd_t pgd) { return 0; }
524static inline int pgd_bad(pgd_t pgd) { return 0; }
525static inline int pgd_present(pgd_t pgd) { return 1; }
526#define pgd_clear(xp) do { } while (0)
527
528#define pgd_page_vaddr(pgd) \
529 ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
530
531/*
532 * The following only work if pte_present() is true.
533 * Undefined behaviour if not..
534 */
535static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
536static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
537static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
538static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
539static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
540static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
541
542static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
543static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
544
545static inline pte_t pte_rdprotect(pte_t pte) {
546 pte_val(pte) &= ~_PAGE_USER; return pte; }
547static inline pte_t pte_wrprotect(pte_t pte) {
548 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
549static inline pte_t pte_exprotect(pte_t pte) {
550 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
551static inline pte_t pte_mkclean(pte_t pte) {
552 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
553static inline pte_t pte_mkold(pte_t pte) {
554 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
555
556static inline pte_t pte_mkread(pte_t pte) {
557 pte_val(pte) |= _PAGE_USER; return pte; }
558static inline pte_t pte_mkexec(pte_t pte) {
559 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
560static inline pte_t pte_mkwrite(pte_t pte) {
561 pte_val(pte) |= _PAGE_RW; return pte; }
562static inline pte_t pte_mkdirty(pte_t pte) {
563 pte_val(pte) |= _PAGE_DIRTY; return pte; }
564static inline pte_t pte_mkyoung(pte_t pte) {
565 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
566
567static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
568{
569 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
570 return pte;
571}
572
573/*
574 * When flushing the tlb entry for a page, we also need to flush the hash
575 * table entry. flush_hash_pages is assembler (for speed) in hashtable.S.
576 */
577extern int flush_hash_pages(unsigned context, unsigned long va,
578 unsigned long pmdval, int count);
579
580/* Add an HPTE to the hash table */
581extern void add_hash_page(unsigned context, unsigned long va,
582 unsigned long pmdval);
583
584/*
585 * Atomic PTE updates.
586 *
587 * pte_update clears and sets bit atomically, and returns
588 * the old pte value. In the 64-bit PTE case we lock around the
589 * low PTE word since we expect ALL flag bits to be there
590 */
591#ifndef CONFIG_PTE_64BIT
592static inline unsigned long pte_update(pte_t *p, unsigned long clr,
593 unsigned long set)
594{
595 unsigned long old, tmp;
596
597 __asm__ __volatile__("\
5981: lwarx %0,0,%3\n\
599 andc %1,%0,%4\n\
600 or %1,%1,%5\n"
601 PPC405_ERR77(0,%3)
602" stwcx. %1,0,%3\n\
603 bne- 1b"
604 : "=&r" (old), "=&r" (tmp), "=m" (*p)
605 : "r" (p), "r" (clr), "r" (set), "m" (*p)
606 : "cc" );
607 return old;
608}
609#else
610static inline unsigned long long pte_update(pte_t *p, unsigned long clr,
611 unsigned long set)
612{
613 unsigned long long old;
614 unsigned long tmp;
615
616 __asm__ __volatile__("\
6171: lwarx %L0,0,%4\n\
618 lwzx %0,0,%3\n\
619 andc %1,%L0,%5\n\
620 or %1,%1,%6\n"
621 PPC405_ERR77(0,%3)
622" stwcx. %1,0,%4\n\
623 bne- 1b"
624 : "=&r" (old), "=&r" (tmp), "=m" (*p)
625 : "r" (p), "r" ((unsigned long)(p) + 4), "r" (clr), "r" (set), "m" (*p)
626 : "cc" );
627 return old;
628}
629#endif
630
631/*
632 * set_pte stores a linux PTE into the linux page table.
633 * On machines which use an MMU hash table we avoid changing the
634 * _PAGE_HASHPTE bit.
635 */
636static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
637 pte_t *ptep, pte_t pte)
638{
639#if _PAGE_HASHPTE != 0
640 pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte) & ~_PAGE_HASHPTE);
641#else
642 *ptep = pte;
643#endif
644}
645
646/*
647 * 2.6 calles this without flushing the TLB entry, this is wrong
648 * for our hash-based implementation, we fix that up here
649 */
650#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
651static inline int __ptep_test_and_clear_young(unsigned int context, unsigned long addr, pte_t *ptep)
652{
653 unsigned long old;
654 old = pte_update(ptep, _PAGE_ACCESSED, 0);
655#if _PAGE_HASHPTE != 0
656 if (old & _PAGE_HASHPTE) {
657 unsigned long ptephys = __pa(ptep) & PAGE_MASK;
658 flush_hash_pages(context, addr, ptephys, 1);
659 }
660#endif
661 return (old & _PAGE_ACCESSED) != 0;
662}
663#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
664 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep)
665
666#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
667static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma,
668 unsigned long addr, pte_t *ptep)
669{
670 return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
671}
672
673#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
674static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
675 pte_t *ptep)
676{
677 return __pte(pte_update(ptep, ~_PAGE_HASHPTE, 0));
678}
679
680#define __HAVE_ARCH_PTEP_SET_WRPROTECT
681static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
682 pte_t *ptep)
683{
684 pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), 0);
685}
686
687#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
688static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
689{
690 unsigned long bits = pte_val(entry) &
691 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
692 pte_update(ptep, 0, bits);
693}
694
695#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
696 do { \
697 __ptep_set_access_flags(__ptep, __entry, __dirty); \
698 flush_tlb_page_nohash(__vma, __address); \
699 } while(0)
700
701/*
702 * Macro to mark a page protection value as "uncacheable".
703 */
704#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED))
705
706struct file;
707extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
708 unsigned long size, pgprot_t vma_prot);
709#define __HAVE_PHYS_MEM_ACCESS_PROT
710
711#define __HAVE_ARCH_PTE_SAME
712#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)
713
714/*
715 * Note that on Book E processors, the pmd contains the kernel virtual
716 * (lowmem) address of the pte page. The physical address is less useful
717 * because everything runs with translation enabled (even the TLB miss
718 * handler). On everything else the pmd contains the physical address
719 * of the pte page. -- paulus
720 */
721#ifndef CONFIG_BOOKE
722#define pmd_page_vaddr(pmd) \
723 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
724#define pmd_page(pmd) \
725 (mem_map + (pmd_val(pmd) >> PAGE_SHIFT))
726#else
727#define pmd_page_vaddr(pmd) \
728 ((unsigned long) (pmd_val(pmd) & PAGE_MASK))
729#define pmd_page(pmd) \
730 (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT))
731#endif
732
733/* to find an entry in a kernel page-table-directory */
734#define pgd_offset_k(address) pgd_offset(&init_mm, address)
735
736/* to find an entry in a page-table-directory */
737#define pgd_index(address) ((address) >> PGDIR_SHIFT)
738#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
739
740/* Find an entry in the second-level page table.. */
741static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
742{
743 return (pmd_t *) dir;
744}
745
746/* Find an entry in the third-level page table.. */
747#define pte_index(address) \
748 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
749#define pte_offset_kernel(dir, addr) \
750 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
751#define pte_offset_map(dir, addr) \
752 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
753#define pte_offset_map_nested(dir, addr) \
754 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
755
756#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
757#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
758
759extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
760
761extern void paging_init(void);
762
763/*
764 * Encode and decode a swap entry.
765 * Note that the bits we use in a PTE for representing a swap entry
766 * must not include the _PAGE_PRESENT bit, the _PAGE_FILE bit, or the
767 *_PAGE_HASHPTE bit (if used). -- paulus
768 */
769#define __swp_type(entry) ((entry).val & 0x1f)
770#define __swp_offset(entry) ((entry).val >> 5)
771#define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 5) })
772#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 3 })
773#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 3 })
774
775/* Encode and decode a nonlinear file mapping entry */
776#define PTE_FILE_MAX_BITS 29
777#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
778#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
779
780/* CONFIG_APUS */
781/* For virtual address to physical address conversion */
782extern void cache_clear(__u32 addr, int length);
783extern void cache_push(__u32 addr, int length);
784extern int mm_end_of_chunk (unsigned long addr, int len);
785extern unsigned long iopa(unsigned long addr);
786extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
787
788/* Values for nocacheflag and cmode */
789/* These are not used by the APUS kernel_map, but prevents
790 compilation errors. */
791#define KERNELMAP_FULL_CACHING 0
792#define KERNELMAP_NOCACHE_SER 1
793#define KERNELMAP_NOCACHE_NONSER 2
794#define KERNELMAP_NO_COPYBACK 3
795
796/*
797 * Map some physical address range into the kernel address space.
798 */
799extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
800 int nocacheflag, unsigned long *memavailp );
801
802/*
803 * Set cache mode of (kernel space) address range.
804 */
805extern void kernel_set_cachemode (unsigned long address, unsigned long size,
806 unsigned int cmode);
807
808/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
809#define kern_addr_valid(addr) (1)
810
811#ifdef CONFIG_PHYS_64BIT
812extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
813 unsigned long paddr, unsigned long size, pgprot_t prot);
814
815static inline int io_remap_pfn_range(struct vm_area_struct *vma,
816 unsigned long vaddr,
817 unsigned long pfn,
818 unsigned long size,
819 pgprot_t prot)
820{
821 phys_addr_t paddr64 = fixup_bigphys_addr(pfn << PAGE_SHIFT, size);
822 return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot);
823}
824#else
825#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
826 remap_pfn_range(vma, vaddr, pfn, size, prot)
827#endif
828
829/*
830 * No page table caches to initialise
831 */
832#define pgtable_cache_init() do { } while (0)
833
834extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep,
835 pmd_t **pmdp);
836
837#endif /* !__ASSEMBLY__ */
838
839#endif /* _ASM_POWERPC_PGTABLE_PPC32_H */
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h
new file mode 100644
index 000000000000..704c4e669fe0
--- /dev/null
+++ b/include/asm-powerpc/pgtable-ppc64.h
@@ -0,0 +1,492 @@
1#ifndef _ASM_POWERPC_PGTABLE_PPC64_H_
2#define _ASM_POWERPC_PGTABLE_PPC64_H_
3/*
4 * This file contains the functions and defines necessary to modify and use
5 * the ppc64 hashed page table.
6 */
7
8#ifndef __ASSEMBLY__
9#include <linux/stddef.h>
10#include <asm/processor.h> /* For TASK_SIZE */
11#include <asm/mmu.h>
12#include <asm/page.h>
13#include <asm/tlbflush.h>
14struct mm_struct;
15#endif /* __ASSEMBLY__ */
16
17#ifdef CONFIG_PPC_64K_PAGES
18#include <asm/pgtable-64k.h>
19#else
20#include <asm/pgtable-4k.h>
21#endif
22
23#define FIRST_USER_ADDRESS 0
24
25/*
26 * Size of EA range mapped by our pagetables.
27 */
28#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
29 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
30#define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE)
31
32#if TASK_SIZE_USER64 > PGTABLE_RANGE
33#error TASK_SIZE_USER64 exceeds pagetable range
34#endif
35
36#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
37#error TASK_SIZE_USER64 exceeds user VSID range
38#endif
39
40/*
41 * Define the address range of the vmalloc VM area.
42 */
43#define VMALLOC_START ASM_CONST(0xD000000000000000)
44#define VMALLOC_SIZE ASM_CONST(0x80000000000)
45#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
46
47/*
48 * Define the address range of the imalloc VM area.
49 */
50#define PHBS_IO_BASE VMALLOC_END
51#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */
52#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE)
53
54/*
55 * Region IDs
56 */
57#define REGION_SHIFT 60UL
58#define REGION_MASK (0xfUL << REGION_SHIFT)
59#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT)
60
61#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
62#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
63#define USER_REGION_ID (0UL)
64
65/*
66 * Common bits in a linux-style PTE. These match the bits in the
67 * (hardware-defined) PowerPC PTE as closely as possible. Additional
68 * bits may be defined in pgtable-*.h
69 */
70#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */
71#define _PAGE_USER 0x0002 /* matches one of the PP bits */
72#define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
73#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
74#define _PAGE_GUARDED 0x0008
75#define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
76#define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
77#define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
78#define _PAGE_DIRTY 0x0080 /* C: page changed */
79#define _PAGE_ACCESSED 0x0100 /* R: page referenced */
80#define _PAGE_RW 0x0200 /* software: user write access allowed */
81#define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
82#define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
83
84#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
85
86#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY)
87
88/* __pgprot defined in asm-powerpc/page.h */
89#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
90
91#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
92#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER | _PAGE_EXEC)
93#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
94#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
95#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
96#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
97#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_WRENABLE)
98#define PAGE_KERNEL_CI __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
99 _PAGE_WRENABLE | _PAGE_NO_CACHE | _PAGE_GUARDED)
100#define PAGE_KERNEL_EXEC __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_EXEC)
101
102#define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)
103#define HAVE_PAGE_AGP
104
105/* PTEIDX nibble */
106#define _PTEIDX_SECONDARY 0x8
107#define _PTEIDX_GROUP_IX 0x7
108
109
110/*
111 * POWER4 and newer have per page execute protection, older chips can only
112 * do this on a segment (256MB) basis.
113 *
114 * Also, write permissions imply read permissions.
115 * This is the closest we can get..
116 *
117 * Note due to the way vm flags are laid out, the bits are XWR
118 */
119#define __P000 PAGE_NONE
120#define __P001 PAGE_READONLY
121#define __P010 PAGE_COPY
122#define __P011 PAGE_COPY
123#define __P100 PAGE_READONLY_X
124#define __P101 PAGE_READONLY_X
125#define __P110 PAGE_COPY_X
126#define __P111 PAGE_COPY_X
127
128#define __S000 PAGE_NONE
129#define __S001 PAGE_READONLY
130#define __S010 PAGE_SHARED
131#define __S011 PAGE_SHARED
132#define __S100 PAGE_READONLY_X
133#define __S101 PAGE_READONLY_X
134#define __S110 PAGE_SHARED_X
135#define __S111 PAGE_SHARED_X
136
137#ifndef __ASSEMBLY__
138
139/*
140 * ZERO_PAGE is a global shared page that is always zero: used
141 * for zero-mapped memory areas etc..
142 */
143extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
144#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
145#endif /* __ASSEMBLY__ */
146
147#ifdef CONFIG_HUGETLB_PAGE
148
149#define HAVE_ARCH_UNMAPPED_AREA
150#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
151
152#endif
153
154#ifndef __ASSEMBLY__
155
156/*
157 * Conversion functions: convert a page and protection to a page entry,
158 * and a page entry and page directory to the page they refer to.
159 *
160 * mk_pte takes a (struct page *) as input
161 */
162#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
163
164static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
165{
166 pte_t pte;
167
168
169 pte_val(pte) = (pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot);
170 return pte;
171}
172
173#define pte_modify(_pte, newprot) \
174 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
175
176#define pte_none(pte) ((pte_val(pte) & ~_PAGE_HPTEFLAGS) == 0)
177#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
178
179/* pte_clear moved to later in this file */
180
181#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT)))
182#define pte_page(x) pfn_to_page(pte_pfn(x))
183
184#define PMD_BAD_BITS (PTE_TABLE_SIZE-1)
185#define PUD_BAD_BITS (PMD_TABLE_SIZE-1)
186
187#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval))
188#define pmd_none(pmd) (!pmd_val(pmd))
189#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \
190 || (pmd_val(pmd) & PMD_BAD_BITS))
191#define pmd_present(pmd) (pmd_val(pmd) != 0)
192#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
193#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS)
194#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
195
196#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval))
197#define pud_none(pud) (!pud_val(pud))
198#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \
199 || (pud_val(pud) & PUD_BAD_BITS))
200#define pud_present(pud) (pud_val(pud) != 0)
201#define pud_clear(pudp) (pud_val(*(pudp)) = 0)
202#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS)
203#define pud_page(pud) virt_to_page(pud_page_vaddr(pud))
204
205#define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);})
206
207/*
208 * Find an entry in a page-table-directory. We combine the address region
209 * (the high order N bits) and the pgd portion of the address.
210 */
211/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */
212#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x1ff)
213
214#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
215
216#define pmd_offset(pudp,addr) \
217 (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
218
219#define pte_offset_kernel(dir,addr) \
220 (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
221
222#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
223#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
224#define pte_unmap(pte) do { } while(0)
225#define pte_unmap_nested(pte) do { } while(0)
226
227/* to find an entry in a kernel page-table-directory */
228/* This now only contains the vmalloc pages */
229#define pgd_offset_k(address) pgd_offset(&init_mm, address)
230
231/*
232 * The following only work if pte_present() is true.
233 * Undefined behaviour if not..
234 */
235static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER;}
236static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
237static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC;}
238static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
239static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
240static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
241
242static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
243static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
244
245static inline pte_t pte_rdprotect(pte_t pte) {
246 pte_val(pte) &= ~_PAGE_USER; return pte; }
247static inline pte_t pte_exprotect(pte_t pte) {
248 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
249static inline pte_t pte_wrprotect(pte_t pte) {
250 pte_val(pte) &= ~(_PAGE_RW); return pte; }
251static inline pte_t pte_mkclean(pte_t pte) {
252 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
253static inline pte_t pte_mkold(pte_t pte) {
254 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
255static inline pte_t pte_mkread(pte_t pte) {
256 pte_val(pte) |= _PAGE_USER; return pte; }
257static inline pte_t pte_mkexec(pte_t pte) {
258 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
259static inline pte_t pte_mkwrite(pte_t pte) {
260 pte_val(pte) |= _PAGE_RW; return pte; }
261static inline pte_t pte_mkdirty(pte_t pte) {
262 pte_val(pte) |= _PAGE_DIRTY; return pte; }
263static inline pte_t pte_mkyoung(pte_t pte) {
264 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
265static inline pte_t pte_mkhuge(pte_t pte) {
266 return pte; }
267
268/* Atomic PTE updates */
269static inline unsigned long pte_update(struct mm_struct *mm,
270 unsigned long addr,
271 pte_t *ptep, unsigned long clr,
272 int huge)
273{
274 unsigned long old, tmp;
275
276 __asm__ __volatile__(
277 "1: ldarx %0,0,%3 # pte_update\n\
278 andi. %1,%0,%6\n\
279 bne- 1b \n\
280 andc %1,%0,%4 \n\
281 stdcx. %1,0,%3 \n\
282 bne- 1b"
283 : "=&r" (old), "=&r" (tmp), "=m" (*ptep)
284 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY)
285 : "cc" );
286
287 if (old & _PAGE_HASHPTE)
288 hpte_need_flush(mm, addr, ptep, old, huge);
289 return old;
290}
291
292static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
293 unsigned long addr, pte_t *ptep)
294{
295 unsigned long old;
296
297 if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0)
298 return 0;
299 old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0);
300 return (old & _PAGE_ACCESSED) != 0;
301}
302#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
303#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
304({ \
305 int __r; \
306 __r = __ptep_test_and_clear_young((__vma)->vm_mm, __addr, __ptep); \
307 __r; \
308})
309
310/*
311 * On RW/DIRTY bit transitions we can avoid flushing the hpte. For the
312 * moment we always flush but we need to fix hpte_update and test if the
313 * optimisation is worth it.
314 */
315static inline int __ptep_test_and_clear_dirty(struct mm_struct *mm,
316 unsigned long addr, pte_t *ptep)
317{
318 unsigned long old;
319
320 if ((pte_val(*ptep) & _PAGE_DIRTY) == 0)
321 return 0;
322 old = pte_update(mm, addr, ptep, _PAGE_DIRTY, 0);
323 return (old & _PAGE_DIRTY) != 0;
324}
325#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
326#define ptep_test_and_clear_dirty(__vma, __addr, __ptep) \
327({ \
328 int __r; \
329 __r = __ptep_test_and_clear_dirty((__vma)->vm_mm, __addr, __ptep); \
330 __r; \
331})
332
333#define __HAVE_ARCH_PTEP_SET_WRPROTECT
334static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
335 pte_t *ptep)
336{
337 unsigned long old;
338
339 if ((pte_val(*ptep) & _PAGE_RW) == 0)
340 return;
341 old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
342}
343
344/*
345 * We currently remove entries from the hashtable regardless of whether
346 * the entry was young or dirty. The generic routines only flush if the
347 * entry was young or dirty which is not good enough.
348 *
349 * We should be more intelligent about this but for the moment we override
350 * these functions and force a tlb flush unconditionally
351 */
352#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
353#define ptep_clear_flush_young(__vma, __address, __ptep) \
354({ \
355 int __young = __ptep_test_and_clear_young((__vma)->vm_mm, __address, \
356 __ptep); \
357 __young; \
358})
359
360#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
361#define ptep_clear_flush_dirty(__vma, __address, __ptep) \
362({ \
363 int __dirty = __ptep_test_and_clear_dirty((__vma)->vm_mm, __address, \
364 __ptep); \
365 __dirty; \
366})
367
368#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
369static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
370 unsigned long addr, pte_t *ptep)
371{
372 unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0);
373 return __pte(old);
374}
375
376static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
377 pte_t * ptep)
378{
379 pte_update(mm, addr, ptep, ~0UL, 0);
380}
381
382/*
383 * set_pte stores a linux PTE into the linux page table.
384 */
385static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
386 pte_t *ptep, pte_t pte)
387{
388 if (pte_present(*ptep))
389 pte_clear(mm, addr, ptep);
390 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
391 *ptep = pte;
392}
393
394/* Set the dirty and/or accessed bits atomically in a linux PTE, this
395 * function doesn't need to flush the hash entry
396 */
397#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
398static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
399{
400 unsigned long bits = pte_val(entry) &
401 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
402 unsigned long old, tmp;
403
404 __asm__ __volatile__(
405 "1: ldarx %0,0,%4\n\
406 andi. %1,%0,%6\n\
407 bne- 1b \n\
408 or %0,%3,%0\n\
409 stdcx. %0,0,%4\n\
410 bne- 1b"
411 :"=&r" (old), "=&r" (tmp), "=m" (*ptep)
412 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
413 :"cc");
414}
415#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
416 do { \
417 __ptep_set_access_flags(__ptep, __entry, __dirty); \
418 flush_tlb_page_nohash(__vma, __address); \
419 } while(0)
420
421/*
422 * Macro to mark a page protection value as "uncacheable".
423 */
424#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED))
425
426struct file;
427extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
428 unsigned long size, pgprot_t vma_prot);
429#define __HAVE_PHYS_MEM_ACCESS_PROT
430
431#define __HAVE_ARCH_PTE_SAME
432#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
433
434#define pte_ERROR(e) \
435 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
436#define pmd_ERROR(e) \
437 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
438#define pgd_ERROR(e) \
439 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
440
441extern pgd_t swapper_pg_dir[];
442
443extern void paging_init(void);
444
445/* Encode and de-code a swap entry */
446#define __swp_type(entry) (((entry).val >> 1) & 0x3f)
447#define __swp_offset(entry) ((entry).val >> 8)
448#define __swp_entry(type, offset) ((swp_entry_t){((type)<< 1)|((offset)<<8)})
449#define __pte_to_swp_entry(pte) ((swp_entry_t){pte_val(pte) >> PTE_RPN_SHIFT})
450#define __swp_entry_to_pte(x) ((pte_t) { (x).val << PTE_RPN_SHIFT })
451#define pte_to_pgoff(pte) (pte_val(pte) >> PTE_RPN_SHIFT)
452#define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE})
453#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT)
454
455/*
456 * kern_addr_valid is intended to indicate whether an address is a valid
457 * kernel address. Most 32-bit archs define it as always true (like this)
458 * but most 64-bit archs actually perform a test. What should we do here?
459 * The only use is in fs/ncpfs/dir.c
460 */
461#define kern_addr_valid(addr) (1)
462
463#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
464 remap_pfn_range(vma, vaddr, pfn, size, prot)
465
466void pgtable_cache_init(void);
467
468/*
469 * find_linux_pte returns the address of a linux pte for a given
470 * effective address and directory. If not found, it returns zero.
471 */static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
472{
473 pgd_t *pg;
474 pud_t *pu;
475 pmd_t *pm;
476 pte_t *pt = NULL;
477
478 pg = pgdir + pgd_index(ea);
479 if (!pgd_none(*pg)) {
480 pu = pud_offset(pg, ea);
481 if (!pud_none(*pu)) {
482 pm = pmd_offset(pu, ea);
483 if (pmd_present(*pm))
484 pt = pte_offset_kernel(pm, ea);
485 }
486 }
487 return pt;
488}
489
490#endif /* __ASSEMBLY__ */
491
492#endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h
index 19edb6982b81..78bf4ae712a6 100644
--- a/include/asm-powerpc/pgtable.h
+++ b/include/asm-powerpc/pgtable.h
@@ -2,502 +2,15 @@
2#define _ASM_POWERPC_PGTABLE_H 2#define _ASM_POWERPC_PGTABLE_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#ifndef CONFIG_PPC64 5#if defined(CONFIG_PPC64)
6#include <asm-ppc/pgtable.h> 6# include <asm/pgtable-ppc64.h>
7#else 7#else
8 8# include <asm/pgtable-ppc32.h>
9/*
10 * This file contains the functions and defines necessary to modify and use
11 * the ppc64 hashed page table.
12 */
13
14#ifndef __ASSEMBLY__
15#include <linux/stddef.h>
16#include <asm/processor.h> /* For TASK_SIZE */
17#include <asm/mmu.h>
18#include <asm/page.h>
19#include <asm/tlbflush.h>
20struct mm_struct;
21#endif /* __ASSEMBLY__ */
22
23#ifdef CONFIG_PPC_64K_PAGES
24#include <asm/pgtable-64k.h>
25#else
26#include <asm/pgtable-4k.h>
27#endif
28
29#define FIRST_USER_ADDRESS 0
30
31/*
32 * Size of EA range mapped by our pagetables.
33 */
34#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
35 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
36#define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE)
37
38#if TASK_SIZE_USER64 > PGTABLE_RANGE
39#error TASK_SIZE_USER64 exceeds pagetable range
40#endif
41
42#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
43#error TASK_SIZE_USER64 exceeds user VSID range
44#endif 9#endif
45 10
46/*
47 * Define the address range of the vmalloc VM area.
48 */
49#define VMALLOC_START ASM_CONST(0xD000000000000000)
50#define VMALLOC_SIZE ASM_CONST(0x80000000000)
51#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
52
53/*
54 * Define the address range of the imalloc VM area.
55 */
56#define PHBS_IO_BASE VMALLOC_END
57#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */
58#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE)
59
60/*
61 * Region IDs
62 */
63#define REGION_SHIFT 60UL
64#define REGION_MASK (0xfUL << REGION_SHIFT)
65#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT)
66
67#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
68#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
69#define USER_REGION_ID (0UL)
70
71/*
72 * Common bits in a linux-style PTE. These match the bits in the
73 * (hardware-defined) PowerPC PTE as closely as possible. Additional
74 * bits may be defined in pgtable-*.h
75 */
76#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */
77#define _PAGE_USER 0x0002 /* matches one of the PP bits */
78#define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
79#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
80#define _PAGE_GUARDED 0x0008
81#define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
82#define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
83#define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
84#define _PAGE_DIRTY 0x0080 /* C: page changed */
85#define _PAGE_ACCESSED 0x0100 /* R: page referenced */
86#define _PAGE_RW 0x0200 /* software: user write access allowed */
87#define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
88#define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
89
90#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
91
92#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY)
93
94/* __pgprot defined in asm-powerpc/page.h */
95#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
96
97#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
98#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER | _PAGE_EXEC)
99#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
100#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
101#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
102#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
103#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_WRENABLE)
104#define PAGE_KERNEL_CI __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
105 _PAGE_WRENABLE | _PAGE_NO_CACHE | _PAGE_GUARDED)
106#define PAGE_KERNEL_EXEC __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_EXEC)
107
108#define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)
109#define HAVE_PAGE_AGP
110
111/* PTEIDX nibble */
112#define _PTEIDX_SECONDARY 0x8
113#define _PTEIDX_GROUP_IX 0x7
114
115
116/*
117 * POWER4 and newer have per page execute protection, older chips can only
118 * do this on a segment (256MB) basis.
119 *
120 * Also, write permissions imply read permissions.
121 * This is the closest we can get..
122 *
123 * Note due to the way vm flags are laid out, the bits are XWR
124 */
125#define __P000 PAGE_NONE
126#define __P001 PAGE_READONLY
127#define __P010 PAGE_COPY
128#define __P011 PAGE_COPY
129#define __P100 PAGE_READONLY_X
130#define __P101 PAGE_READONLY_X
131#define __P110 PAGE_COPY_X
132#define __P111 PAGE_COPY_X
133
134#define __S000 PAGE_NONE
135#define __S001 PAGE_READONLY
136#define __S010 PAGE_SHARED
137#define __S011 PAGE_SHARED
138#define __S100 PAGE_READONLY_X
139#define __S101 PAGE_READONLY_X
140#define __S110 PAGE_SHARED_X
141#define __S111 PAGE_SHARED_X
142
143#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
144
145/*
146 * ZERO_PAGE is a global shared page that is always zero: used
147 * for zero-mapped memory areas etc..
148 */
149extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
150#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
151#endif /* __ASSEMBLY__ */
152
153#ifdef CONFIG_HUGETLB_PAGE
154
155#define HAVE_ARCH_UNMAPPED_AREA
156#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
157
158#endif
159
160#ifndef __ASSEMBLY__
161
162/*
163 * Conversion functions: convert a page and protection to a page entry,
164 * and a page entry and page directory to the page they refer to.
165 *
166 * mk_pte takes a (struct page *) as input
167 */
168#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
169
170static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
171{
172 pte_t pte;
173
174
175 pte_val(pte) = (pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot);
176 return pte;
177}
178
179#define pte_modify(_pte, newprot) \
180 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
181
182#define pte_none(pte) ((pte_val(pte) & ~_PAGE_HPTEFLAGS) == 0)
183#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
184
185/* pte_clear moved to later in this file */
186
187#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT)))
188#define pte_page(x) pfn_to_page(pte_pfn(x))
189
190#define PMD_BAD_BITS (PTE_TABLE_SIZE-1)
191#define PUD_BAD_BITS (PMD_TABLE_SIZE-1)
192
193#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval))
194#define pmd_none(pmd) (!pmd_val(pmd))
195#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \
196 || (pmd_val(pmd) & PMD_BAD_BITS))
197#define pmd_present(pmd) (pmd_val(pmd) != 0)
198#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
199#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS)
200#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
201
202#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval))
203#define pud_none(pud) (!pud_val(pud))
204#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \
205 || (pud_val(pud) & PUD_BAD_BITS))
206#define pud_present(pud) (pud_val(pud) != 0)
207#define pud_clear(pudp) (pud_val(*(pudp)) = 0)
208#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS)
209#define pud_page(pud) virt_to_page(pud_page_vaddr(pud))
210
211#define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);})
212
213/*
214 * Find an entry in a page-table-directory. We combine the address region
215 * (the high order N bits) and the pgd portion of the address.
216 */
217/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */
218#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x1ff)
219
220#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
221
222#define pmd_offset(pudp,addr) \
223 (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
224
225#define pte_offset_kernel(dir,addr) \
226 (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
227
228#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
229#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
230#define pte_unmap(pte) do { } while(0)
231#define pte_unmap_nested(pte) do { } while(0)
232
233/* to find an entry in a kernel page-table-directory */
234/* This now only contains the vmalloc pages */
235#define pgd_offset_k(address) pgd_offset(&init_mm, address)
236
237/*
238 * The following only work if pte_present() is true.
239 * Undefined behaviour if not..
240 */
241static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER;}
242static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
243static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC;}
244static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
245static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
246static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
247
248static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
249static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
250
251static inline pte_t pte_rdprotect(pte_t pte) {
252 pte_val(pte) &= ~_PAGE_USER; return pte; }
253static inline pte_t pte_exprotect(pte_t pte) {
254 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
255static inline pte_t pte_wrprotect(pte_t pte) {
256 pte_val(pte) &= ~(_PAGE_RW); return pte; }
257static inline pte_t pte_mkclean(pte_t pte) {
258 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
259static inline pte_t pte_mkold(pte_t pte) {
260 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
261static inline pte_t pte_mkread(pte_t pte) {
262 pte_val(pte) |= _PAGE_USER; return pte; }
263static inline pte_t pte_mkexec(pte_t pte) {
264 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
265static inline pte_t pte_mkwrite(pte_t pte) {
266 pte_val(pte) |= _PAGE_RW; return pte; }
267static inline pte_t pte_mkdirty(pte_t pte) {
268 pte_val(pte) |= _PAGE_DIRTY; return pte; }
269static inline pte_t pte_mkyoung(pte_t pte) {
270 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
271static inline pte_t pte_mkhuge(pte_t pte) {
272 return pte; }
273
274/* Atomic PTE updates */
275static inline unsigned long pte_update(struct mm_struct *mm,
276 unsigned long addr,
277 pte_t *ptep, unsigned long clr,
278 int huge)
279{
280 unsigned long old, tmp;
281
282 __asm__ __volatile__(
283 "1: ldarx %0,0,%3 # pte_update\n\
284 andi. %1,%0,%6\n\
285 bne- 1b \n\
286 andc %1,%0,%4 \n\
287 stdcx. %1,0,%3 \n\
288 bne- 1b"
289 : "=&r" (old), "=&r" (tmp), "=m" (*ptep)
290 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY)
291 : "cc" );
292
293 if (old & _PAGE_HASHPTE)
294 hpte_need_flush(mm, addr, ptep, old, huge);
295 return old;
296}
297
298static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
299 unsigned long addr, pte_t *ptep)
300{
301 unsigned long old;
302
303 if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0)
304 return 0;
305 old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0);
306 return (old & _PAGE_ACCESSED) != 0;
307}
308#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
309#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
310({ \
311 int __r; \
312 __r = __ptep_test_and_clear_young((__vma)->vm_mm, __addr, __ptep); \
313 __r; \
314})
315
316/*
317 * On RW/DIRTY bit transitions we can avoid flushing the hpte. For the
318 * moment we always flush but we need to fix hpte_update and test if the
319 * optimisation is worth it.
320 */
321static inline int __ptep_test_and_clear_dirty(struct mm_struct *mm,
322 unsigned long addr, pte_t *ptep)
323{
324 unsigned long old;
325
326 if ((pte_val(*ptep) & _PAGE_DIRTY) == 0)
327 return 0;
328 old = pte_update(mm, addr, ptep, _PAGE_DIRTY, 0);
329 return (old & _PAGE_DIRTY) != 0;
330}
331#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
332#define ptep_test_and_clear_dirty(__vma, __addr, __ptep) \
333({ \
334 int __r; \
335 __r = __ptep_test_and_clear_dirty((__vma)->vm_mm, __addr, __ptep); \
336 __r; \
337})
338
339#define __HAVE_ARCH_PTEP_SET_WRPROTECT
340static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
341 pte_t *ptep)
342{
343 unsigned long old;
344
345 if ((pte_val(*ptep) & _PAGE_RW) == 0)
346 return;
347 old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
348}
349
350/*
351 * We currently remove entries from the hashtable regardless of whether
352 * the entry was young or dirty. The generic routines only flush if the
353 * entry was young or dirty which is not good enough.
354 *
355 * We should be more intelligent about this but for the moment we override
356 * these functions and force a tlb flush unconditionally
357 */
358#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
359#define ptep_clear_flush_young(__vma, __address, __ptep) \
360({ \
361 int __young = __ptep_test_and_clear_young((__vma)->vm_mm, __address, \
362 __ptep); \
363 __young; \
364})
365
366#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
367#define ptep_clear_flush_dirty(__vma, __address, __ptep) \
368({ \
369 int __dirty = __ptep_test_and_clear_dirty((__vma)->vm_mm, __address, \
370 __ptep); \
371 __dirty; \
372})
373
374#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
375static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
376 unsigned long addr, pte_t *ptep)
377{
378 unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0);
379 return __pte(old);
380}
381
382static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
383 pte_t * ptep)
384{
385 pte_update(mm, addr, ptep, ~0UL, 0);
386}
387
388/*
389 * set_pte stores a linux PTE into the linux page table.
390 */
391static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
392 pte_t *ptep, pte_t pte)
393{
394 if (pte_present(*ptep))
395 pte_clear(mm, addr, ptep);
396 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
397 *ptep = pte;
398}
399
400/* Set the dirty and/or accessed bits atomically in a linux PTE, this
401 * function doesn't need to flush the hash entry
402 */
403#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
404static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
405{
406 unsigned long bits = pte_val(entry) &
407 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
408 unsigned long old, tmp;
409
410 __asm__ __volatile__(
411 "1: ldarx %0,0,%4\n\
412 andi. %1,%0,%6\n\
413 bne- 1b \n\
414 or %0,%3,%0\n\
415 stdcx. %0,0,%4\n\
416 bne- 1b"
417 :"=&r" (old), "=&r" (tmp), "=m" (*ptep)
418 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
419 :"cc");
420}
421#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
422 do { \
423 __ptep_set_access_flags(__ptep, __entry, __dirty); \
424 flush_tlb_page_nohash(__vma, __address); \
425 } while(0)
426
427/*
428 * Macro to mark a page protection value as "uncacheable".
429 */
430#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED))
431
432struct file;
433extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
434 unsigned long size, pgprot_t vma_prot);
435#define __HAVE_PHYS_MEM_ACCESS_PROT
436
437#define __HAVE_ARCH_PTE_SAME
438#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
439
440#define pte_ERROR(e) \
441 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
442#define pmd_ERROR(e) \
443 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
444#define pgd_ERROR(e) \
445 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
446
447extern pgd_t swapper_pg_dir[];
448
449extern void paging_init(void);
450
451/* Encode and de-code a swap entry */
452#define __swp_type(entry) (((entry).val >> 1) & 0x3f)
453#define __swp_offset(entry) ((entry).val >> 8)
454#define __swp_entry(type, offset) ((swp_entry_t){((type)<< 1)|((offset)<<8)})
455#define __pte_to_swp_entry(pte) ((swp_entry_t){pte_val(pte) >> PTE_RPN_SHIFT})
456#define __swp_entry_to_pte(x) ((pte_t) { (x).val << PTE_RPN_SHIFT })
457#define pte_to_pgoff(pte) (pte_val(pte) >> PTE_RPN_SHIFT)
458#define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE})
459#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT)
460
461/*
462 * kern_addr_valid is intended to indicate whether an address is a valid
463 * kernel address. Most 32-bit archs define it as always true (like this)
464 * but most 64-bit archs actually perform a test. What should we do here?
465 * The only use is in fs/ncpfs/dir.c
466 */
467#define kern_addr_valid(addr) (1)
468
469#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
470 remap_pfn_range(vma, vaddr, pfn, size, prot)
471
472void pgtable_cache_init(void);
473
474/*
475 * find_linux_pte returns the address of a linux pte for a given
476 * effective address and directory. If not found, it returns zero.
477 */static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
478{
479 pgd_t *pg;
480 pud_t *pu;
481 pmd_t *pm;
482 pte_t *pt = NULL;
483
484 pg = pgdir + pgd_index(ea);
485 if (!pgd_none(*pg)) {
486 pu = pud_offset(pg, ea);
487 if (!pud_none(*pu)) {
488 pm = pmd_offset(pu, ea);
489 if (pmd_present(*pm))
490 pt = pte_offset_kernel(pm, ea);
491 }
492 }
493 return pt;
494}
495
496
497#include <asm-generic/pgtable.h> 12#include <asm-generic/pgtable.h>
498
499#endif /* __ASSEMBLY__ */ 13#endif /* __ASSEMBLY__ */
500 14
501#endif /* CONFIG_PPC64 */
502#endif /* __KERNEL__ */ 15#endif /* __KERNEL__ */
503#endif /* _ASM_POWERPC_PGTABLE_H */ 16#endif /* _ASM_POWERPC_PGTABLE_H */
diff --git a/include/asm-powerpc/pmac_feature.h b/include/asm-powerpc/pmac_feature.h
index d3599cc9aa74..d43d91beba9b 100644
--- a/include/asm-powerpc/pmac_feature.h
+++ b/include/asm-powerpc/pmac_feature.h
@@ -146,7 +146,7 @@ struct device_node;
146static inline long pmac_call_feature(int selector, struct device_node* node, 146static inline long pmac_call_feature(int selector, struct device_node* node,
147 long param, long value) 147 long param, long value)
148{ 148{
149 if (!ppc_md.feature_call) 149 if (!ppc_md.feature_call || !machine_is(powermac))
150 return -ENODEV; 150 return -ENODEV;
151 return ppc_md.feature_call(selector, node, param, value); 151 return ppc_md.feature_call(selector, node, param, value);
152} 152}
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index ec400f608e16..6845af93ba91 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -20,7 +20,6 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23#include <asm/io.h>
24 23
25/* Definitions used by the flattened device tree */ 24/* Definitions used by the flattened device tree */
26#define OF_DT_HEADER 0xd00dfeed /* marker */ 25#define OF_DT_HEADER 0xd00dfeed /* marker */
@@ -334,30 +333,17 @@ extern int of_irq_map_one(struct device_node *device, int index,
334struct pci_dev; 333struct pci_dev;
335extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 334extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
336 335
337static inline int of_irq_to_resource(struct device_node *dev, int index, struct resource *r) 336extern int of_irq_to_resource(struct device_node *dev, int index,
338{ 337 struct resource *r);
339 int irq = irq_of_parse_and_map(dev, index);
340
341 /* Only dereference the resource if both the
342 * resource and the irq are valid. */
343 if (r && irq != NO_IRQ) {
344 r->start = r->end = irq;
345 r->flags = IORESOURCE_IRQ;
346 }
347
348 return irq;
349}
350
351static inline void __iomem *of_iomap(struct device_node *np, int index)
352{
353 struct resource res;
354
355 if (of_address_to_resource(np, index, &res))
356 return NULL;
357
358 return ioremap(res.start, 1 + res.end - res.start);
359}
360 338
339/**
340 * of_iomap - Maps the memory mapped IO for a given device_node
341 * @device: the device whose io range will be mapped
342 * @index: index of the io range
343 *
344 * Returns a pointer to the mapped memory
345 */
346extern void __iomem *of_iomap(struct device_node *device, int index);
361 347
362#endif /* __KERNEL__ */ 348#endif /* __KERNEL__ */
363#endif /* _POWERPC_PROM_H */ 349#endif /* _POWERPC_PROM_H */
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 821581a8b643..13c372df99e8 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -167,26 +167,31 @@ enum ps3_cpu_binding {
167 PS3_BINDING_CPU_1 = 1, 167 PS3_BINDING_CPU_1 = 1,
168}; 168};
169 169
170int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id, 170int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
171 unsigned int *virq); 171 unsigned int *virq);
172int ps3_free_io_irq(unsigned int virq); 172int ps3_virq_destroy(unsigned int virq);
173int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq); 173int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
174int ps3_free_event_irq(unsigned int virq); 174 unsigned int *virq);
175int ps3_irq_plug_destroy(unsigned int virq);
176int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq);
177int ps3_event_receive_port_destroy(unsigned int virq);
175int ps3_send_event_locally(unsigned int virq); 178int ps3_send_event_locally(unsigned int virq);
176int ps3_connect_event_irq(enum ps3_cpu_binding cpu, 179
177 const struct ps3_device_id *did, unsigned int interrupt_id, 180int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
178 unsigned int *virq); 181 unsigned int *virq);
179int ps3_disconnect_event_irq(const struct ps3_device_id *did, 182int ps3_io_irq_destroy(unsigned int virq);
180 unsigned int interrupt_id, unsigned int virq); 183int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
181int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
182 unsigned int *virq); 184 unsigned int *virq);
183int ps3_free_vuart_irq(unsigned int virq); 185int ps3_vuart_irq_destroy(unsigned int virq);
184int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, 186int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
185 unsigned int class, unsigned int *virq); 187 unsigned int class, unsigned int *virq);
186int ps3_free_spe_irq(unsigned int virq); 188int ps3_spe_irq_destroy(unsigned int virq);
187int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet, 189
190int ps3_sb_event_receive_port_setup(enum ps3_cpu_binding cpu,
191 const struct ps3_device_id *did, unsigned int interrupt_id,
188 unsigned int *virq); 192 unsigned int *virq);
189int ps3_free_irq(unsigned int virq); 193int ps3_sb_event_receive_port_destroy(const struct ps3_device_id *did,
194 unsigned int interrupt_id, unsigned int virq);
190 195
191/* lv1 result codes */ 196/* lv1 result codes */
192 197
diff --git a/include/asm-powerpc/suspend.h b/include/asm-powerpc/suspend.h
new file mode 100644
index 000000000000..cbf2c9404c37
--- /dev/null
+++ b/include/asm-powerpc/suspend.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_POWERPC_SUSPEND_H
2#define __ASM_POWERPC_SUSPEND_H
3
4static inline int arch_prepare_suspend(void) { return 0; }
5
6void save_processor_state(void);
7void restore_processor_state(void);
8
9#endif /* __ASM_POWERPC_SUSPEND_H */
diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h
index 4e95d153be84..f8b60793b7a9 100644
--- a/include/asm-powerpc/tsi108.h
+++ b/include/asm-powerpc/tsi108.h
@@ -68,8 +68,17 @@
68#define TSI108_PB_ERRCS_ES (1 << 1) 68#define TSI108_PB_ERRCS_ES (1 << 1)
69#define TSI108_PB_ISR_PBS_RD_ERR (1 << 8) 69#define TSI108_PB_ISR_PBS_RD_ERR (1 << 8)
70 70
71#define TSI108_PCI_CFG_BASE_PHYS (0xfb000000)
72#define TSI108_PCI_CFG_SIZE (0x01000000) 71#define TSI108_PCI_CFG_SIZE (0x01000000)
72
73/*
74 * PHY Configuration Options
75 *
76 * Specify "bcm54xx" in the compatible property of your device tree phy
77 * nodes if your board uses the Broadcom PHYs
78 */
79#define TSI108_PHY_MV88E 0 /* Marvel 88Exxxx PHY */
80#define TSI108_PHY_BCM54XX 1 /* Broardcom BCM54xx PHY */
81
73/* Global variables */ 82/* Global variables */
74 83
75extern u32 tsi108_pci_cfg_base; 84extern u32 tsi108_pci_cfg_base;
@@ -93,6 +102,7 @@ typedef struct {
93 u16 phy; /* phy address */ 102 u16 phy; /* phy address */
94 u16 irq_num; /* irq number */ 103 u16 irq_num; /* irq number */
95 u8 mac_addr[6]; /* phy mac address */ 104 u8 mac_addr[6]; /* phy mac address */
105 u16 phy_type; /* type of phy on board */
96} hw_info; 106} hw_info;
97 107
98extern u32 get_vir_csrbase(void); 108extern u32 get_vir_csrbase(void);
diff --git a/include/asm-powerpc/tsi108_pci.h b/include/asm-powerpc/tsi108_pci.h
new file mode 100644
index 000000000000..a9f92f73232c
--- /dev/null
+++ b/include/asm-powerpc/tsi108_pci.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright 2007 IBM Corp
3 *
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 */
20
21#ifndef _ASM_PPC_TSI108_PCI_H
22#define _ASM_PPC_TSI108_PCI_H
23
24#include <asm/tsi108.h>
25
26/* Register definitions */
27#define TSI108_PCI_P2O_BAR0 (TSI108_PCI_OFFSET + 0x10)
28#define TSI108_PCI_P2O_BAR0_UPPER (TSI108_PCI_OFFSET + 0x14)
29#define TSI108_PCI_P2O_BAR2 (TSI108_PCI_OFFSET + 0x18)
30#define TSI108_PCI_P2O_BAR2_UPPER (TSI108_PCI_OFFSET + 0x1c)
31#define TSI108_PCI_P2O_PAGE_SIZES (TSI108_PCI_OFFSET + 0x4c)
32#define TSI108_PCI_PFAB_BAR0 (TSI108_PCI_OFFSET + 0x204)
33#define TSI108_PCI_PFAB_BAR0_UPPER (TSI108_PCI_OFFSET + 0x208)
34#define TSI108_PCI_PFAB_IO (TSI108_PCI_OFFSET + 0x20c)
35#define TSI108_PCI_PFAB_IO_UPPER (TSI108_PCI_OFFSET + 0x210)
36#define TSI108_PCI_PFAB_MEM32 (TSI108_PCI_OFFSET + 0x214)
37#define TSI108_PCI_PFAB_PFM3 (TSI108_PCI_OFFSET + 0x220)
38#define TSI108_PCI_PFAB_PFM4 (TSI108_PCI_OFFSET + 0x230)
39
40extern int tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary);
41extern void tsi108_pci_int_init(struct device_node *node);
42extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
43extern void tsi108_clear_pci_cfg_error(void);
44
45#endif /* _ASM_PPC_TSI108_PCI_H */
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index b0952e532ed5..37ca57392add 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -225,4 +225,12 @@ extern unsigned int pmu_power_flags;
225/* Backlight */ 225/* Backlight */
226extern void pmu_backlight_init(void); 226extern void pmu_backlight_init(void);
227 227
228/* some code needs to know if the PMU was suspended for hibernation */
229#ifdef CONFIG_PM
230extern int pmu_sys_suspended;
231#else
232/* if power management is not configured it can't be suspended */
233#define pmu_sys_suspended 0
234#endif
235
228#endif /* __KERNEL__ */ 236#endif /* __KERNEL__ */
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 96868be9c211..9d2aa1a12aa0 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_SWSUSP_H 1#ifndef _LINUX_SWSUSP_H
2#define _LINUX_SWSUSP_H 2#define _LINUX_SWSUSP_H
3 3
4#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32) 4#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32) || defined(CONFIG_PPC64)
5#include <asm/suspend.h> 5#include <asm/suspend.h>
6#endif 6#endif
7#include <linux/swap.h> 7#include <linux/swap.h>
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 877721708fa4..495b7d4dd330 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -79,7 +79,7 @@ config PM_SYSFS_DEPRECATED
79 79
80config SOFTWARE_SUSPEND 80config SOFTWARE_SUSPEND
81 bool "Software Suspend (Hibernation)" 81 bool "Software Suspend (Hibernation)"
82 depends on PM && SWAP && ((X86 && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)) 82 depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP))
83 ---help--- 83 ---help---
84 Enable the suspend to disk (STD) functionality, which is usually 84 Enable the suspend to disk (STD) functionality, which is usually
85 called "hibernation" in user interfaces. STD checkpoints the 85 called "hibernation" in user interfaces. STD checkpoints the
@@ -139,7 +139,7 @@ config PM_STD_PARTITION
139 139
140config SUSPEND_SMP 140config SUSPEND_SMP
141 bool 141 bool
142 depends on HOTPLUG_CPU && X86 && PM 142 depends on HOTPLUG_CPU && (X86 || PPC64) && PM
143 default y 143 default y
144 144
145config APM_EMULATION 145config APM_EMULATION
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c
index 7f980be5d060..e91f9f66f395 100644
--- a/sound/aoa/codecs/snd-aoa-codec-onyx.c
+++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c
@@ -1061,7 +1061,7 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter)
1061 busnode = pmac_i2c_get_bus_node(bus); 1061 busnode = pmac_i2c_get_bus_node(bus);
1062 1062
1063 while ((dev = of_get_next_child(busnode, dev)) != NULL) { 1063 while ((dev = of_get_next_child(busnode, dev)) != NULL) {
1064 if (device_is_compatible(dev, "pcm3052")) { 1064 if (of_device_is_compatible(dev, "pcm3052")) {
1065 const u32 *addr; 1065 const u32 *addr;
1066 printk(KERN_DEBUG PFX "found pcm3052\n"); 1066 printk(KERN_DEBUG PFX "found pcm3052\n");
1067 addr = of_get_property(dev, "reg", NULL); 1067 addr = of_get_property(dev, "reg", NULL);
@@ -1074,7 +1074,7 @@ static int onyx_i2c_attach(struct i2c_adapter *adapter)
1074 /* if that didn't work, try desperate mode for older 1074 /* if that didn't work, try desperate mode for older
1075 * machines that have stuff missing from the device tree */ 1075 * machines that have stuff missing from the device tree */
1076 1076
1077 if (!device_is_compatible(busnode, "k2-i2c")) 1077 if (!of_device_is_compatible(busnode, "k2-i2c"))
1078 return -ENODEV; 1078 return -ENODEV;
1079 1079
1080 printk(KERN_DEBUG PFX "found k2-i2c, checking if onyx chip is on it\n"); 1080 printk(KERN_DEBUG PFX "found k2-i2c, checking if onyx chip is on it\n");
diff --git a/sound/aoa/codecs/snd-aoa-codec-tas.c b/sound/aoa/codecs/snd-aoa-codec-tas.c
index ceca38486eae..041fe52cbf29 100644
--- a/sound/aoa/codecs/snd-aoa-codec-tas.c
+++ b/sound/aoa/codecs/snd-aoa-codec-tas.c
@@ -938,7 +938,7 @@ static int tas_i2c_attach(struct i2c_adapter *adapter)
938 busnode = pmac_i2c_get_bus_node(bus); 938 busnode = pmac_i2c_get_bus_node(bus);
939 939
940 while ((dev = of_get_next_child(busnode, dev)) != NULL) { 940 while ((dev = of_get_next_child(busnode, dev)) != NULL) {
941 if (device_is_compatible(dev, "tas3004")) { 941 if (of_device_is_compatible(dev, "tas3004")) {
942 const u32 *addr; 942 const u32 *addr;
943 printk(KERN_DEBUG PFX "found tas3004\n"); 943 printk(KERN_DEBUG PFX "found tas3004\n");
944 addr = of_get_property(dev, "reg", NULL); 944 addr = of_get_property(dev, "reg", NULL);
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus-core.c b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
index 79fc4bc09e5e..0fccdbf51663 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus-core.c
+++ b/sound/aoa/soundbus/i2sbus/i2sbus-core.c
@@ -336,8 +336,8 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
336 } 336 }
337 337
338 while ((np = of_get_next_child(dev->ofdev.node, np))) { 338 while ((np = of_get_next_child(dev->ofdev.node, np))) {
339 if (device_is_compatible(np, "i2sbus") || 339 if (of_device_is_compatible(np, "i2sbus") ||
340 device_is_compatible(np, "i2s-modem")) { 340 of_device_is_compatible(np, "i2s-modem")) {
341 got += i2sbus_add_dev(dev, control, np); 341 got += i2sbus_add_dev(dev, control, np);
342 } 342 }
343 } 343 }
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index 730fa1d001a5..8f6388004f44 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -362,7 +362,7 @@ setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int*
362 of_get_property(np,"audio-gpio",NULL); 362 of_get_property(np,"audio-gpio",NULL);
363 if (property != 0 && strcmp(property,name) == 0) 363 if (property != 0 && strcmp(property,name) == 0)
364 break; 364 break;
365 } else if (compatible && device_is_compatible(np, compatible)) 365 } else if (compatible && of_device_is_compatible(np, compatible))
366 break; 366 break;
367 np = of_get_next_child(gpiop, np); 367 np = of_get_next_child(gpiop, np);
368 } 368 }
@@ -2620,17 +2620,17 @@ get_codec_type(struct device_node *info)
2620 2620
2621 if (info) { 2621 if (info) {
2622 /* must do awacs first to allow screamer to overide it */ 2622 /* must do awacs first to allow screamer to overide it */
2623 if (device_is_compatible(info, "awacs")) 2623 if (of_device_is_compatible(info, "awacs"))
2624 codec = AWACS_AWACS ; 2624 codec = AWACS_AWACS ;
2625 if (device_is_compatible(info, "screamer")) 2625 if (of_device_is_compatible(info, "screamer"))
2626 codec = AWACS_SCREAMER; 2626 codec = AWACS_SCREAMER;
2627 if (device_is_compatible(info, "burgundy")) 2627 if (of_device_is_compatible(info, "burgundy"))
2628 codec = AWACS_BURGUNDY ; 2628 codec = AWACS_BURGUNDY ;
2629 if (device_is_compatible(info, "daca")) 2629 if (of_device_is_compatible(info, "daca"))
2630 codec = AWACS_DACA; 2630 codec = AWACS_DACA;
2631 if (device_is_compatible(info, "tumbler")) 2631 if (of_device_is_compatible(info, "tumbler"))
2632 codec = AWACS_TUMBLER; 2632 codec = AWACS_TUMBLER;
2633 if (device_is_compatible(info, "snapper")) 2633 if (of_device_is_compatible(info, "snapper"))
2634 codec = AWACS_SNAPPER; 2634 codec = AWACS_SNAPPER;
2635 } 2635 }
2636 return codec ; 2636 return codec ;
@@ -2772,7 +2772,7 @@ set_hw_byteswap(struct device_node *io)
2772 2772
2773 for (mio = io->parent; mio ; mio = mio->parent) { 2773 for (mio = io->parent; mio ; mio = mio->parent) {
2774 if (strcmp(mio->name, "mac-io") == 0) { 2774 if (strcmp(mio->name, "mac-io") == 0) {
2775 if (device_is_compatible(mio, "Keylargo")) 2775 if (of_device_is_compatible(mio, "Keylargo"))
2776 kl = 1; 2776 kl = 1;
2777 break; 2777 break;
2778 } 2778 }
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 2bae9c1a2b54..5a2bef44a2f5 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -843,7 +843,7 @@ static void __init detect_byte_swap(struct snd_pmac *chip)
843 /* if seems that Keylargo can't byte-swap */ 843 /* if seems that Keylargo can't byte-swap */
844 for (mio = chip->node->parent; mio; mio = mio->parent) { 844 for (mio = chip->node->parent; mio; mio = mio->parent) {
845 if (strcmp(mio->name, "mac-io") == 0) { 845 if (strcmp(mio->name, "mac-io") == 0) {
846 if (device_is_compatible(mio, "Keylargo")) 846 if (of_device_is_compatible(mio, "Keylargo"))
847 chip->can_byte_swap = 0; 847 chip->can_byte_swap = 0;
848 break; 848 break;
849 } 849 }
@@ -910,7 +910,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
910 chip->node = of_find_node_by_name(NULL, "i2s-a"); 910 chip->node = of_find_node_by_name(NULL, "i2s-a");
911 if (chip->node && chip->node->parent && 911 if (chip->node && chip->node->parent &&
912 chip->node->parent->parent) { 912 chip->node->parent->parent) {
913 if (device_is_compatible(chip->node->parent->parent, 913 if (of_device_is_compatible(chip->node->parent->parent,
914 "K2-Keylargo")) 914 "K2-Keylargo"))
915 chip->is_k2 = 1; 915 chip->is_k2 = 1;
916 } 916 }
@@ -941,22 +941,22 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
941 return -ENODEV; 941 return -ENODEV;
942 } 942 }
943 /* This should be verified on older screamers */ 943 /* This should be verified on older screamers */
944 if (device_is_compatible(sound, "screamer")) { 944 if (of_device_is_compatible(sound, "screamer")) {
945 chip->model = PMAC_SCREAMER; 945 chip->model = PMAC_SCREAMER;
946 // chip->can_byte_swap = 0; /* FIXME: check this */ 946 // chip->can_byte_swap = 0; /* FIXME: check this */
947 } 947 }
948 if (device_is_compatible(sound, "burgundy")) { 948 if (of_device_is_compatible(sound, "burgundy")) {
949 chip->model = PMAC_BURGUNDY; 949 chip->model = PMAC_BURGUNDY;
950 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */ 950 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
951 } 951 }
952 if (device_is_compatible(sound, "daca")) { 952 if (of_device_is_compatible(sound, "daca")) {
953 chip->model = PMAC_DACA; 953 chip->model = PMAC_DACA;
954 chip->can_capture = 0; /* no capture */ 954 chip->can_capture = 0; /* no capture */
955 chip->can_duplex = 0; 955 chip->can_duplex = 0;
956 // chip->can_byte_swap = 0; /* FIXME: check this */ 956 // chip->can_byte_swap = 0; /* FIXME: check this */
957 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */ 957 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
958 } 958 }
959 if (device_is_compatible(sound, "tumbler")) { 959 if (of_device_is_compatible(sound, "tumbler")) {
960 chip->model = PMAC_TUMBLER; 960 chip->model = PMAC_TUMBLER;
961 chip->can_capture = 0; /* no capture */ 961 chip->can_capture = 0; /* no capture */
962 chip->can_duplex = 0; 962 chip->can_duplex = 0;
@@ -965,7 +965,7 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
965 chip->freq_table = tumbler_freqs; 965 chip->freq_table = tumbler_freqs;
966 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */ 966 chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
967 } 967 }
968 if (device_is_compatible(sound, "snapper")) { 968 if (of_device_is_compatible(sound, "snapper")) {
969 chip->model = PMAC_SNAPPER; 969 chip->model = PMAC_SNAPPER;
970 // chip->can_byte_swap = 0; /* FIXME: check this */ 970 // chip->can_byte_swap = 0; /* FIXME: check this */
971 chip->num_freqs = ARRAY_SIZE(tumbler_freqs); 971 chip->num_freqs = ARRAY_SIZE(tumbler_freqs);
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 54e333fbb1d0..5821cdd0bec9 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1060,7 +1060,7 @@ static struct device_node *find_compatible_audio_device(const char *name)
1060 1060
1061 for (np = of_get_next_child(gpiop, NULL); np; 1061 for (np = of_get_next_child(gpiop, NULL); np;
1062 np = of_get_next_child(gpiop, np)) { 1062 np = of_get_next_child(gpiop, np)) {
1063 if (device_is_compatible(np, name)) 1063 if (of_device_is_compatible(np, name))
1064 break; 1064 break;
1065 } 1065 }
1066 of_node_put(gpiop); 1066 of_node_put(gpiop);