aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-14 23:00:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-14 23:00:28 -0500
commit5393f780277165f282a37ed82dd878159ec9dad5 (patch)
tree00df86ebd8b598b5db3c4fe4612c6614409caf94
parentbca268565fd18f0b36ab8fff6e1623d8dffae2b1 (diff)
parentea0105ea3881b409e362451690184af494bce6e3 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (29 commits) powerpc/83xx: Move mcu_mpc8349emitx driver out of drivers/i2c/chips/ powerpc/83xx: Make serial ports work on MPC8315E-RDB w/ FSL U-Boots powerpc/e500mc: Doorbells need to be taken w/exceptions disabled powerpc: Enable PS3 options and QPACE in ppc64_defconfig powerpc/powermac: Fix occasional SMP boot failure powerpc/cacheinfo: Rename cache_dir per-cpu variable hvc_console: Use kzalloc() instead of kmalloc() + memset() hvc_console: Do not set low_latency when using interrupts hvc_console: Call free_irq() only if request_irq() was successful hvc_console: Change an mb() to smp_mb() and add some comments powerpc: Cleanup from l64 to ll64 change: drivers/net powerpc: Cleanup from l64 to ll64 change: drivers/char powerpc: Cleanup from l64 to ll64 change: arch code powerpc: Change u64/s64 to a long long integer type powerpc/kexec: Check crash_base for relocatable kernel powerpc: Make dummy section a valid note header Xilinx: SPI: updated driver for device tree drivers/of: Add the of_find_i2c_device_by_node function. powerpc/xsysace: add compatible string for non-ipcore instance powerpc/mpc52xx: remove dead code from GPIO driver ...
-rw-r--r--arch/powerpc/boot/dts/mpc8315erdb.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts2
-rw-r--r--arch/powerpc/configs/ppc64_defconfig26
-rw-r--r--arch/powerpc/include/asm/qe.h19
-rw-r--r--arch/powerpc/include/asm/rtas.h2
-rw-r--r--arch/powerpc/include/asm/types.h7
-rw-r--r--arch/powerpc/kernel/asm-offsets.c7
-rw-r--r--arch/powerpc/kernel/cacheinfo.c10
-rw-r--r--arch/powerpc/kernel/dma-iommu.c4
-rw-r--r--arch/powerpc/kernel/head_64.S9
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S8
-rw-r--r--arch/powerpc/kernel/iommu.c12
-rw-r--r--arch/powerpc/kernel/lparcfg.c10
-rw-r--r--arch/powerpc/kernel/machine_kexec.c25
-rw-r--r--arch/powerpc/kernel/pci_64.c6
-rw-r--r--arch/powerpc/kernel/setup_64.c6
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S4
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c9
-rw-r--r--arch/powerpc/mm/mmu_decl.h11
-rw-r--r--arch/powerpc/mm/stab.c4
-rw-r--r--arch/powerpc/oprofile/op_model_pa6t.c6
-rw-r--r--arch/powerpc/platforms/512x/clock.c4
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpio.c3
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c8
-rw-r--r--arch/powerpc/platforms/83xx/Makefile1
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c (renamed from drivers/i2c/chips/mcu_mpc8349emitx.c)0
-rw-r--r--arch/powerpc/platforms/Kconfig11
-rw-r--r--arch/powerpc/platforms/cell/beat_interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_epci.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c4
-rw-r--r--arch/powerpc/platforms/cell/ras.c8
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/fault.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c6
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c1
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/powermac/smp.c2
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c35
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c107
-rw-r--r--arch/powerpc/sysdev/mpic.c2
-rw-r--r--drivers/block/xsysace.c1
-rw-r--r--drivers/char/bsr.c2
-rw-r--r--drivers/char/hvc_console.c14
-rw-r--r--drivers/char/hvc_irq.c2
-rw-r--r--drivers/i2c/chips/Kconfig11
-rw-r--r--drivers/i2c/chips/Makefile1
-rw-r--r--drivers/net/ehea/ehea_main.c8
-rw-r--r--drivers/net/ehea/ehea_qmr.c18
-rw-r--r--drivers/net/ibmveth.c16
-rw-r--r--drivers/net/iseries_veth.c2
-rw-r--r--drivers/net/pasemi_mac.c6
-rw-r--r--drivers/of/of_i2c.c19
-rw-r--r--drivers/pcmcia/electra_cf.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c12
-rw-r--r--drivers/spi/xilinx_spi.c137
-rw-r--r--include/linux/of_i2c.h3
61 files changed, 423 insertions, 244 deletions
diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts
index 072c9b0f8c8..71784165b77 100644
--- a/arch/powerpc/boot/dts/mpc8315erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
@@ -255,7 +255,7 @@
255 device_type = "serial"; 255 device_type = "serial";
256 compatible = "ns16550"; 256 compatible = "ns16550";
257 reg = <0x4500 0x100>; 257 reg = <0x4500 0x100>;
258 clock-frequency = <0>; 258 clock-frequency = <133333333>;
259 interrupts = <9 0x8>; 259 interrupts = <9 0x8>;
260 interrupt-parent = <&ipic>; 260 interrupt-parent = <&ipic>;
261 }; 261 };
@@ -265,7 +265,7 @@
265 device_type = "serial"; 265 device_type = "serial";
266 compatible = "ns16550"; 266 compatible = "ns16550";
267 reg = <0x4600 0x100>; 267 reg = <0x4600 0x100>;
268 clock-frequency = <0>; 268 clock-frequency = <133333333>;
269 interrupts = <10 0x8>; 269 interrupts = <10 0x8>;
270 interrupt-parent = <&ipic>; 270 interrupt-parent = <&ipic>;
271 }; 271 };
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index b9da4210506..0668d104877 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -313,7 +313,7 @@
313 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>; 313 0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>;
314 clock-frequency = <33333333>; 314 clock-frequency = <33333333>;
315 interrupt-parent = <&mpic>; 315 interrupt-parent = <&mpic>;
316 interrupts = <26 2>; 316 interrupts = <25 2>;
317 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 317 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
318 interrupt-map = < 318 interrupt-map = <
319 /* IDSEL 0x0 */ 319 /* IDSEL 0x0 */
@@ -350,7 +350,7 @@
350 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>; 350 0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>;
351 clock-frequency = <33333333>; 351 clock-frequency = <33333333>;
352 interrupt-parent = <&mpic>; 352 interrupt-parent = <&mpic>;
353 interrupts = <25 2>; 353 interrupts = <26 2>;
354 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 354 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
355 interrupt-map = < 355 interrupt-map = <
356 /* IDSEL 0x0 */ 356 /* IDSEL 0x0 */
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index 21459e161d0..3dcc001b8ed 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -724,7 +724,7 @@
724 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>; 724 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x00010000>;
725 clock-frequency = <33333333>; 725 clock-frequency = <33333333>;
726 interrupt-parent = <&mpic>; 726 interrupt-parent = <&mpic>;
727 interrupts = <26 2>; 727 interrupts = <25 2>;
728 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 728 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
729 interrupt-map = < 729 interrupt-map = <
730 /* IDSEL 0x0 */ 730 /* IDSEL 0x0 */
@@ -761,7 +761,7 @@
761 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>; 761 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x00010000>;
762 clock-frequency = <33333333>; 762 clock-frequency = <33333333>;
763 interrupt-parent = <&mpic>; 763 interrupt-parent = <&mpic>;
764 interrupts = <27 2>; 764 interrupts = <26 2>;
765 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 765 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
766 interrupt-map = < 766 interrupt-map = <
767 /* IDSEL 0x0 */ 767 /* IDSEL 0x0 */
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index c114c4ee993..fd462efa9e6 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -457,7 +457,7 @@
457 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>; 457 0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>;
458 clock-frequency = <33333333>; 458 clock-frequency = <33333333>;
459 interrupt-parent = <&mpic>; 459 interrupt-parent = <&mpic>;
460 interrupts = <26 2>; 460 interrupts = <25 2>;
461 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 461 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
462 interrupt-map = < 462 interrupt-map = <
463 /* IDSEL 0x0 */ 463 /* IDSEL 0x0 */
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index 04ecda18d20..e35230f2ac9 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -208,7 +208,7 @@
208 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>; 208 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>;
209 clock-frequency = <33333333>; 209 clock-frequency = <33333333>;
210 interrupt-parent = <&mpic>; 210 interrupt-parent = <&mpic>;
211 interrupts = <27 2>; 211 interrupts = <26 2>;
212 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 212 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
213 interrupt-map = < 213 interrupt-map = <
214 /* IDSEL 0x0 */ 214 /* IDSEL 0x0 */
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 069ae1bbac2..d4685d1c0be 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -211,11 +211,28 @@ CONFIG_PPC_PASEMI=y
211CONFIG_PPC_PASEMI_IOMMU=y 211CONFIG_PPC_PASEMI_IOMMU=y
212# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set 212# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
213CONFIG_PPC_PASEMI_MDIO=y 213CONFIG_PPC_PASEMI_MDIO=y
214# CONFIG_PPC_PS3 is not set 214CONFIG_PPC_PS3=y
215
216#
217# PS3 Platform Options
218#
219# CONFIG_PS3_ADVANCED is not set
220CONFIG_PS3_HTAB_SIZE=20
221# CONFIG_PS3_DYNAMIC_DMA is not set
222CONFIG_PS3_VUART=y
223CONFIG_PS3_PS3AV=y
224CONFIG_PS3_SYS_MANAGER=y
225CONFIG_PS3_STORAGE=m
226CONFIG_PS3_DISK=m
227CONFIG_PS3_ROM=m
228CONFIG_PS3_FLASH=m
229CONFIG_PS3_LPM=m
215CONFIG_PPC_CELL=y 230CONFIG_PPC_CELL=y
231CONFIG_PPC_CELL_COMMON=y
216CONFIG_PPC_CELL_NATIVE=y 232CONFIG_PPC_CELL_NATIVE=y
217CONFIG_PPC_IBM_CELL_BLADE=y 233CONFIG_PPC_IBM_CELL_BLADE=y
218CONFIG_PPC_CELLEB=y 234CONFIG_PPC_CELLEB=y
235CONFIG_PPC_CELL_QPACE=y
219 236
220# 237#
221# Cell Broadband Engine options 238# Cell Broadband Engine options
@@ -981,6 +998,9 @@ CONFIG_E1000=y
981CONFIG_TIGON3=y 998CONFIG_TIGON3=y
982# CONFIG_BNX2 is not set 999# CONFIG_BNX2 is not set
983CONFIG_SPIDER_NET=m 1000CONFIG_SPIDER_NET=m
1001CONFIG_GELIC_NET=m
1002CONFIG_GELIC_WIRELESS=y
1003# CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE is not set
984# CONFIG_QLA3XXX is not set 1004# CONFIG_QLA3XXX is not set
985# CONFIG_ATL1 is not set 1005# CONFIG_ATL1 is not set
986# CONFIG_ATL1E is not set 1006# CONFIG_ATL1E is not set
@@ -1370,6 +1390,8 @@ CONFIG_FB_RADEON_BACKLIGHT=y
1370# CONFIG_FB_PM3 is not set 1390# CONFIG_FB_PM3 is not set
1371# CONFIG_FB_CARMINE is not set 1391# CONFIG_FB_CARMINE is not set
1372CONFIG_FB_IBM_GXT4500=y 1392CONFIG_FB_IBM_GXT4500=y
1393CONFIG_FB_PS3=m
1394CONFIG_FB_PS3_DEFAULT_SIZE_M=9
1373# CONFIG_FB_VIRTUAL is not set 1395# CONFIG_FB_VIRTUAL is not set
1374# CONFIG_FB_METRONOME is not set 1396# CONFIG_FB_METRONOME is not set
1375CONFIG_BACKLIGHT_LCD_SUPPORT=y 1397CONFIG_BACKLIGHT_LCD_SUPPORT=y
@@ -1492,6 +1514,8 @@ CONFIG_SND_PCI=y
1492CONFIG_SND_PPC=y 1514CONFIG_SND_PPC=y
1493CONFIG_SND_POWERMAC=m 1515CONFIG_SND_POWERMAC=m
1494CONFIG_SND_POWERMAC_AUTO_DRC=y 1516CONFIG_SND_POWERMAC_AUTO_DRC=y
1517CONFIG_SND_PS3=m
1518CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
1495CONFIG_SND_AOA=m 1519CONFIG_SND_AOA=m
1496CONFIG_SND_AOA_FABRIC_LAYOUT=m 1520CONFIG_SND_AOA_FABRIC_LAYOUT=m
1497CONFIG_SND_AOA_ONYX=m 1521CONFIG_SND_AOA_ONYX=m
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index a0a15311d0d..2701753d993 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -624,7 +624,7 @@ struct ucc_slow_pram {
624#define UCC_GETH_UCCE_RXF1 0x00000002 624#define UCC_GETH_UCCE_RXF1 0x00000002
625#define UCC_GETH_UCCE_RXF0 0x00000001 625#define UCC_GETH_UCCE_RXF0 0x00000001
626 626
627/* UPSMR, when used as a UART */ 627/* UCC Protocol Specific Mode Register (UPSMR), when used for UART */
628#define UCC_UART_UPSMR_FLC 0x8000 628#define UCC_UART_UPSMR_FLC 0x8000
629#define UCC_UART_UPSMR_SL 0x4000 629#define UCC_UART_UPSMR_SL 0x4000
630#define UCC_UART_UPSMR_CL_MASK 0x3000 630#define UCC_UART_UPSMR_CL_MASK 0x3000
@@ -652,6 +652,23 @@ struct ucc_slow_pram {
652#define UCC_UART_UPSMR_TPM_EVEN 0x0002 652#define UCC_UART_UPSMR_TPM_EVEN 0x0002
653#define UCC_UART_UPSMR_TPM_HIGH 0x0003 653#define UCC_UART_UPSMR_TPM_HIGH 0x0003
654 654
655/* UCC Protocol Specific Mode Register (UPSMR), when used for Ethernet */
656#define UCC_GETH_UPSMR_FTFE 0x80000000
657#define UCC_GETH_UPSMR_PTPE 0x40000000
658#define UCC_GETH_UPSMR_ECM 0x04000000
659#define UCC_GETH_UPSMR_HSE 0x02000000
660#define UCC_GETH_UPSMR_PRO 0x00400000
661#define UCC_GETH_UPSMR_CAP 0x00200000
662#define UCC_GETH_UPSMR_RSH 0x00100000
663#define UCC_GETH_UPSMR_RPM 0x00080000
664#define UCC_GETH_UPSMR_R10M 0x00040000
665#define UCC_GETH_UPSMR_RLPB 0x00020000
666#define UCC_GETH_UPSMR_TBIM 0x00010000
667#define UCC_GETH_UPSMR_RES1 0x00002000
668#define UCC_GETH_UPSMR_RMM 0x00001000
669#define UCC_GETH_UPSMR_CAM 0x00000400
670#define UCC_GETH_UPSMR_BRO 0x00000200
671
655/* UCC Transmit On Demand Register (UTODR) */ 672/* UCC Transmit On Demand Register (UTODR) */
656#define UCC_SLOW_TOD 0x8000 673#define UCC_SLOW_TOD 0x8000
657#define UCC_FAST_TOD 0x8000 674#define UCC_FAST_TOD 0x8000
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index e0175beb446..0aa0315fb7e 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#define RTAS_UNKNOWN_SERVICE (-1) 20#define RTAS_UNKNOWN_SERVICE (-1)
21#define RTAS_INSTANTIATE_MAX (1UL<<30) /* Don't instantiate rtas at/above this value */ 21#define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */
22 22
23/* Buffer size for ppc_rtas system call. */ 23/* Buffer size for ppc_rtas system call. */
24#define RTAS_RMOBUF_MAX (64 * 1024) 24#define RTAS_RMOBUF_MAX (64 * 1024)
diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h
index c004c13f291..7ce27a52bb3 100644
--- a/arch/powerpc/include/asm/types.h
+++ b/arch/powerpc/include/asm/types.h
@@ -1,7 +1,12 @@
1#ifndef _ASM_POWERPC_TYPES_H 1#ifndef _ASM_POWERPC_TYPES_H
2#define _ASM_POWERPC_TYPES_H 2#define _ASM_POWERPC_TYPES_H
3 3
4#ifdef __powerpc64__ 4/*
5 * This is here because we used to use l64 for 64bit powerpc
6 * and we don't want to impact user mode with our change to ll64
7 * in the kernel.
8 */
9#if defined(__powerpc64__) && !defined(__KERNEL__)
5# include <asm-generic/int-l64.h> 10# include <asm-generic/int-l64.h>
6#else 11#else
7# include <asm-generic/int-ll64.h> 12# include <asm-generic/int-ll64.h>
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 9937fe44555..19ee491e9e2 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -56,6 +56,10 @@
56#include "head_booke.h" 56#include "head_booke.h"
57#endif 57#endif
58 58
59#if defined(CONFIG_FSL_BOOKE)
60#include "../mm/mmu_decl.h"
61#endif
62
59int main(void) 63int main(void)
60{ 64{
61 DEFINE(THREAD, offsetof(struct task_struct, thread)); 65 DEFINE(THREAD, offsetof(struct task_struct, thread));
@@ -382,6 +386,9 @@ int main(void)
382 DEFINE(PGD_T_LOG2, PGD_T_LOG2); 386 DEFINE(PGD_T_LOG2, PGD_T_LOG2);
383 DEFINE(PTE_T_LOG2, PTE_T_LOG2); 387 DEFINE(PTE_T_LOG2, PTE_T_LOG2);
384#endif 388#endif
389#ifdef CONFIG_FSL_BOOKE
390 DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam));
391#endif
385 392
386#ifdef CONFIG_KVM_EXIT_TIMING 393#ifdef CONFIG_KVM_EXIT_TIMING
387 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu, 394 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index b33f0417a4b..bb37b1d19a5 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -113,7 +113,7 @@ struct cache {
113 struct cache *next_local; /* next cache of >= level */ 113 struct cache *next_local; /* next cache of >= level */
114}; 114};
115 115
116static DEFINE_PER_CPU(struct cache_dir *, cache_dir); 116static DEFINE_PER_CPU(struct cache_dir *, cache_dir_pcpu);
117 117
118/* traversal/modification of this list occurs only at cpu hotplug time; 118/* traversal/modification of this list occurs only at cpu hotplug time;
119 * access is serialized by cpu hotplug locking 119 * access is serialized by cpu hotplug locking
@@ -468,9 +468,9 @@ static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_i
468 468
469 cache_dir->kobj = kobj; 469 cache_dir->kobj = kobj;
470 470
471 WARN_ON_ONCE(per_cpu(cache_dir, cpu_id) != NULL); 471 WARN_ON_ONCE(per_cpu(cache_dir_pcpu, cpu_id) != NULL);
472 472
473 per_cpu(cache_dir, cpu_id) = cache_dir; 473 per_cpu(cache_dir_pcpu, cpu_id) = cache_dir;
474 474
475 return cache_dir; 475 return cache_dir;
476err: 476err:
@@ -820,13 +820,13 @@ void cacheinfo_cpu_offline(unsigned int cpu_id)
820 820
821 /* Prevent userspace from seeing inconsistent state - remove 821 /* Prevent userspace from seeing inconsistent state - remove
822 * the sysfs hierarchy first */ 822 * the sysfs hierarchy first */
823 cache_dir = per_cpu(cache_dir, cpu_id); 823 cache_dir = per_cpu(cache_dir_pcpu, cpu_id);
824 824
825 /* careful, sysfs population may have failed */ 825 /* careful, sysfs population may have failed */
826 if (cache_dir) 826 if (cache_dir)
827 remove_cache_dir(cache_dir); 827 remove_cache_dir(cache_dir);
828 828
829 per_cpu(cache_dir, cpu_id) = NULL; 829 per_cpu(cache_dir_pcpu, cpu_id) = NULL;
830 830
831 /* clear the CPU's bit in its cache chain, possibly freeing 831 /* clear the CPU's bit in its cache chain, possibly freeing
832 * cache objects */ 832 * cache objects */
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 14183af1b3f..2983adac8cc 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -79,10 +79,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask)
79 "Warning: IOMMU offset too big for device mask\n"); 79 "Warning: IOMMU offset too big for device mask\n");
80 if (tbl) 80 if (tbl)
81 printk(KERN_INFO 81 printk(KERN_INFO
82 "mask: 0x%08lx, table offset: 0x%08lx\n", 82 "mask: 0x%08llx, table offset: 0x%08lx\n",
83 mask, tbl->it_offset); 83 mask, tbl->it_offset);
84 else 84 else
85 printk(KERN_INFO "mask: 0x%08lx, table unavailable\n", 85 printk(KERN_INFO "mask: 0x%08llx, table unavailable\n",
86 mask); 86 mask);
87 return 0; 87 return 0;
88 } else 88 } else
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index b4bcf5a930f..ebaedafc8e6 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1518,6 +1518,15 @@ _GLOBAL(pmac_secondary_start)
1518 /* turn on 64-bit mode */ 1518 /* turn on 64-bit mode */
1519 bl .enable_64b_mode 1519 bl .enable_64b_mode
1520 1520
1521 li r0,0
1522 mfspr r3,SPRN_HID4
1523 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */
1524 sync
1525 mtspr SPRN_HID4,r3
1526 isync
1527 sync
1528 slbia
1529
1521 /* get TOC pointer (real address) */ 1530 /* get TOC pointer (real address) */
1522 bl .relative_toc 1531 bl .relative_toc
1523 1532
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 11b549acc03..36ffb3504a4 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -389,10 +389,6 @@ skpinv: addi r6,r6,1 /* Increment */
389#endif 389#endif
390#endif 390#endif
391 391
392 mfspr r3,SPRN_TLB1CFG
393 andi. r3,r3,0xfff
394 lis r4,num_tlbcam_entries@ha
395 stw r3,num_tlbcam_entries@l(r4)
396/* 392/*
397 * Decide what sort of machine this is and initialize the MMU. 393 * Decide what sort of machine this is and initialize the MMU.
398 */ 394 */
@@ -711,7 +707,7 @@ interrupt_base:
711 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD) 707 EXCEPTION(0x2060, PerformanceMonitor, performance_monitor_exception, EXC_XFER_STD)
712 708
713#ifdef CONFIG_PPC_E500MC 709#ifdef CONFIG_PPC_E500MC
714 EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_EE) 710 EXCEPTION(0x2070, Doorbell, unknown_exception, EXC_XFER_STD)
715#endif 711#endif
716 712
717 /* Debug Interrupt */ 713 /* Debug Interrupt */
@@ -909,7 +905,7 @@ KernelSPE:
909_GLOBAL(loadcam_entry) 905_GLOBAL(loadcam_entry)
910 lis r4,TLBCAM@ha 906 lis r4,TLBCAM@ha
911 addi r4,r4,TLBCAM@l 907 addi r4,r4,TLBCAM@l
912 mulli r5,r3,20 908 mulli r5,r3,TLBCAM_SIZE
913 add r3,r5,r4 909 add r3,r5,r4
914 lwz r4,0(r3) 910 lwz r4,0(r3)
915 mtspr SPRN_MAS0,r4 911 mtspr SPRN_MAS0,r4
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 1bfa706b96e..fd51578e29d 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
239 if (printk_ratelimit()) { 239 if (printk_ratelimit()) {
240 printk(KERN_INFO "iommu_free: invalid entry\n"); 240 printk(KERN_INFO "iommu_free: invalid entry\n");
241 printk(KERN_INFO "\tentry = 0x%lx\n", entry); 241 printk(KERN_INFO "\tentry = 0x%lx\n", entry);
242 printk(KERN_INFO "\tdma_addr = 0x%lx\n", (u64)dma_addr); 242 printk(KERN_INFO "\tdma_addr = 0x%llx\n", (u64)dma_addr);
243 printk(KERN_INFO "\tTable = 0x%lx\n", (u64)tbl); 243 printk(KERN_INFO "\tTable = 0x%llx\n", (u64)tbl);
244 printk(KERN_INFO "\tbus# = 0x%lx\n", (u64)tbl->it_busno); 244 printk(KERN_INFO "\tbus# = 0x%llx\n", (u64)tbl->it_busno);
245 printk(KERN_INFO "\tsize = 0x%lx\n", (u64)tbl->it_size); 245 printk(KERN_INFO "\tsize = 0x%llx\n", (u64)tbl->it_size);
246 printk(KERN_INFO "\tstartOff = 0x%lx\n", (u64)tbl->it_offset); 246 printk(KERN_INFO "\tstartOff = 0x%llx\n", (u64)tbl->it_offset);
247 printk(KERN_INFO "\tindex = 0x%lx\n", (u64)tbl->it_index); 247 printk(KERN_INFO "\tindex = 0x%llx\n", (u64)tbl->it_index);
248 WARN_ON(1); 248 WARN_ON(1);
249 } 249 }
250 return; 250 return;
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index d051e8cbcd0..182e0f642f3 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_file *m)
240 if (rc) 240 if (rc)
241 return; 241 return;
242 242
243 seq_printf(m, "partition_entitled_capacity=%ld\n", 243 seq_printf(m, "partition_entitled_capacity=%lld\n",
244 ppp_data.entitlement); 244 ppp_data.entitlement);
245 seq_printf(m, "group=%d\n", ppp_data.group_num); 245 seq_printf(m, "group=%d\n", ppp_data.group_num);
246 seq_printf(m, "system_active_processors=%d\n", 246 seq_printf(m, "system_active_processors=%d\n",
@@ -265,7 +265,7 @@ static void parse_ppp_data(struct seq_file *m)
265 ppp_data.unallocated_weight); 265 ppp_data.unallocated_weight);
266 seq_printf(m, "capacity_weight=%d\n", ppp_data.weight); 266 seq_printf(m, "capacity_weight=%d\n", ppp_data.weight);
267 seq_printf(m, "capped=%d\n", ppp_data.capped); 267 seq_printf(m, "capped=%d\n", ppp_data.capped);
268 seq_printf(m, "unallocated_capacity=%ld\n", 268 seq_printf(m, "unallocated_capacity=%lld\n",
269 ppp_data.unallocated_entitlement); 269 ppp_data.unallocated_entitlement);
270} 270}
271 271
@@ -509,10 +509,10 @@ static ssize_t update_ppp(u64 *entitlement, u8 *weight)
509 } else 509 } else
510 return -EINVAL; 510 return -EINVAL;
511 511
512 pr_debug("%s: current_entitled = %lu, current_weight = %u\n", 512 pr_debug("%s: current_entitled = %llu, current_weight = %u\n",
513 __func__, ppp_data.entitlement, ppp_data.weight); 513 __func__, ppp_data.entitlement, ppp_data.weight);
514 514
515 pr_debug("%s: new_entitled = %lu, new_weight = %u\n", 515 pr_debug("%s: new_entitled = %llu, new_weight = %u\n",
516 __func__, new_entitled, new_weight); 516 __func__, new_entitled, new_weight);
517 517
518 retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight); 518 retval = plpar_hcall_norets(H_SET_PPP, new_entitled, new_weight);
@@ -558,7 +558,7 @@ static ssize_t update_mpp(u64 *entitlement, u8 *weight)
558 pr_debug("%s: current_entitled = %lu, current_weight = %u\n", 558 pr_debug("%s: current_entitled = %lu, current_weight = %u\n",
559 __func__, mpp_data.entitled_mem, mpp_data.mem_weight); 559 __func__, mpp_data.entitled_mem, mpp_data.mem_weight);
560 560
561 pr_debug("%s: new_entitled = %lu, new_weight = %u\n", 561 pr_debug("%s: new_entitled = %llu, new_weight = %u\n",
562 __func__, new_entitled, new_weight); 562 __func__, new_entitled, new_weight);
563 563
564 rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight); 564 rc = plpar_hcall_norets(H_SET_MPP, new_entitled, new_weight);
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index b3abebb7ee6..d59e2b1bdcb 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -93,10 +93,35 @@ void __init reserve_crashkernel(void)
93 KDUMP_KERNELBASE); 93 KDUMP_KERNELBASE);
94 94
95 crashk_res.start = KDUMP_KERNELBASE; 95 crashk_res.start = KDUMP_KERNELBASE;
96#else
97 if (!crashk_res.start) {
98 /*
99 * unspecified address, choose a region of specified size
100 * can overlap with initrd (ignoring corruption when retained)
101 * ppc64 requires kernel and some stacks to be in first segemnt
102 */
103 crashk_res.start = KDUMP_KERNELBASE;
104 }
105
106 crash_base = PAGE_ALIGN(crashk_res.start);
107 if (crash_base != crashk_res.start) {
108 printk("Crash kernel base must be aligned to 0x%lx\n",
109 PAGE_SIZE);
110 crashk_res.start = crash_base;
111 }
112
96#endif 113#endif
97 crash_size = PAGE_ALIGN(crash_size); 114 crash_size = PAGE_ALIGN(crash_size);
98 crashk_res.end = crashk_res.start + crash_size - 1; 115 crashk_res.end = crashk_res.start + crash_size - 1;
99 116
117 /* The crash region must not overlap the current kernel */
118 if (overlaps_crashkernel(__pa(_stext), _end - _stext)) {
119 printk(KERN_WARNING
120 "Crash kernel can not overlap current kernel\n");
121 crashk_res.start = crashk_res.end = 0;
122 return;
123 }
124
100 /* Crash kernel trumps memory limit */ 125 /* Crash kernel trumps memory limit */
101 if (memory_limit && memory_limit <= crashk_res.end) { 126 if (memory_limit && memory_limit <= crashk_res.end) {
102 memory_limit = crashk_res.end + 1; 127 memory_limit = crashk_res.end + 1;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 586962f65c2..ea8eda8c87c 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -470,7 +470,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
470 if (bus->self) { 470 if (bus->self) {
471 pr_debug("IO mapping for PCI-PCI bridge %s\n", 471 pr_debug("IO mapping for PCI-PCI bridge %s\n",
472 pci_name(bus->self)); 472 pci_name(bus->self));
473 pr_debug(" virt=0x%016lx...0x%016lx\n", 473 pr_debug(" virt=0x%016llx...0x%016llx\n",
474 bus->resource[0]->start + _IO_BASE, 474 bus->resource[0]->start + _IO_BASE,
475 bus->resource[0]->end + _IO_BASE); 475 bus->resource[0]->end + _IO_BASE);
476 return 0; 476 return 0;
@@ -502,7 +502,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
502 hose->io_base_phys - phys_page); 502 hose->io_base_phys - phys_page);
503 503
504 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name); 504 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name);
505 pr_debug(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n", 505 pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n",
506 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); 506 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
507 pr_debug(" size=0x%016lx (alloc=0x%016lx)\n", 507 pr_debug(" size=0x%016lx (alloc=0x%016lx)\n",
508 hose->pci_io_size, size_page); 508 hose->pci_io_size, size_page);
@@ -517,7 +517,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
517 hose->io_resource.start += io_virt_offset; 517 hose->io_resource.start += io_virt_offset;
518 hose->io_resource.end += io_virt_offset; 518 hose->io_resource.end += io_virt_offset;
519 519
520 pr_debug(" hose->io_resource=0x%016lx...0x%016lx\n", 520 pr_debug(" hose->io_resource=0x%016llx...0x%016llx\n",
521 hose->io_resource.start, hose->io_resource.end); 521 hose->io_resource.start, hose->io_resource.end);
522 522
523 return 0; 523 return 0;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d8bd2161e73..2d34196bba8 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -434,8 +434,8 @@ void __init setup_system(void)
434 printk("Starting Linux PPC64 %s\n", init_utsname()->version); 434 printk("Starting Linux PPC64 %s\n", init_utsname()->version);
435 435
436 printk("-----------------------------------------------------\n"); 436 printk("-----------------------------------------------------\n");
437 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 437 printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
438 printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); 438 printk("physicalMemorySize = 0x%llx\n", lmb_phys_mem_size());
439 if (ppc64_caches.dline_size != 0x80) 439 if (ppc64_caches.dline_size != 0x80)
440 printk("ppc64_caches.dcache_line_size = 0x%x\n", 440 printk("ppc64_caches.dcache_line_size = 0x%x\n",
441 ppc64_caches.dline_size); 441 ppc64_caches.dline_size);
@@ -493,7 +493,7 @@ static void __init emergency_stack_init(void)
493 * bringup, we need to get at them in real mode. This means they 493 * bringup, we need to get at them in real mode. This means they
494 * must also be within the RMO region. 494 * must also be within the RMO region.
495 */ 495 */
496 limit = min(0x10000000UL, lmb.rmo_size); 496 limit = min(0x10000000ULL, lmb.rmo_size);
497 497
498 for_each_possible_cpu(i) { 498 for_each_possible_cpu(i) {
499 unsigned long sp; 499 unsigned long sp;
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 47bf15cd2c9..161b9b9691f 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -87,7 +87,9 @@ SECTIONS
87 /* The dummy segment contents for the bug workaround mentioned above 87 /* The dummy segment contents for the bug workaround mentioned above
88 near PHDRS. */ 88 near PHDRS. */
89 .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) { 89 .dummy : AT(ADDR(.dummy) - LOAD_OFFSET) {
90 LONG(0xf177) 90 LONG(0)
91 LONG(0)
92 LONG(0)
91 } :kernel :dummy 93 } :kernel :dummy
92 94
93/* 95/*
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index 23cee39534f..1971e4ee3d6 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -56,18 +56,11 @@
56 56
57extern void loadcam_entry(unsigned int index); 57extern void loadcam_entry(unsigned int index);
58unsigned int tlbcam_index; 58unsigned int tlbcam_index;
59unsigned int num_tlbcam_entries;
60static unsigned long __cam0, __cam1, __cam2; 59static unsigned long __cam0, __cam1, __cam2;
61 60
62#define NUM_TLBCAMS (16) 61#define NUM_TLBCAMS (16)
63 62
64struct tlbcam { 63struct tlbcam TLBCAM[NUM_TLBCAMS];
65 u32 MAS0;
66 u32 MAS1;
67 u32 MAS2;
68 u32 MAS3;
69 u32 MAS7;
70} TLBCAM[NUM_TLBCAMS];
71 64
72struct tlbcamrange { 65struct tlbcamrange {
73 unsigned long start; 66 unsigned long start;
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index ad123bced40..d1f9c62dc17 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -75,6 +75,15 @@ extern void _tlbia(void);
75#endif /* CONFIG_PPC_MMU_NOHASH */ 75#endif /* CONFIG_PPC_MMU_NOHASH */
76 76
77#ifdef CONFIG_PPC32 77#ifdef CONFIG_PPC32
78
79struct tlbcam {
80 u32 MAS0;
81 u32 MAS1;
82 u32 MAS2;
83 u32 MAS3;
84 u32 MAS7;
85};
86
78extern void mapin_ram(void); 87extern void mapin_ram(void);
79extern int map_page(unsigned long va, phys_addr_t pa, int flags); 88extern int map_page(unsigned long va, phys_addr_t pa, int flags);
80extern void setbat(int index, unsigned long virt, phys_addr_t phys, 89extern void setbat(int index, unsigned long virt, phys_addr_t phys,
@@ -90,8 +99,6 @@ extern unsigned int rtas_data, rtas_size;
90struct hash_pte; 99struct hash_pte;
91extern struct hash_pte *Hash, *Hash_end; 100extern struct hash_pte *Hash, *Hash_end;
92extern unsigned long Hash_size, Hash_mask; 101extern unsigned long Hash_size, Hash_mask;
93
94extern unsigned int num_tlbcam_entries;
95#endif 102#endif
96 103
97extern unsigned long ioremap_bot; 104extern unsigned long ioremap_bot;
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c
index 60e6032a808..98cd1dc2ae7 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -251,8 +251,8 @@ void __init stabs_alloc(void)
251 251
252 paca[cpu].stab_addr = newstab; 252 paca[cpu].stab_addr = newstab;
253 paca[cpu].stab_real = virt_to_abs(newstab); 253 paca[cpu].stab_real = virt_to_abs(newstab);
254 printk(KERN_INFO "Segment table for CPU %d at 0x%lx " 254 printk(KERN_INFO "Segment table for CPU %d at 0x%llx "
255 "virtual, 0x%lx absolute\n", 255 "virtual, 0x%llx absolute\n",
256 cpu, paca[cpu].stab_addr, paca[cpu].stab_real); 256 cpu, paca[cpu].stab_addr, paca[cpu].stab_real);
257 } 257 }
258} 258}
diff --git a/arch/powerpc/oprofile/op_model_pa6t.c b/arch/powerpc/oprofile/op_model_pa6t.c
index c40de461fd4..42f778dff91 100644
--- a/arch/powerpc/oprofile/op_model_pa6t.c
+++ b/arch/powerpc/oprofile/op_model_pa6t.c
@@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_counter_config *ctr,
132 for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) { 132 for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) {
133 /* counters are 40 bit. Move to cputable at some point? */ 133 /* counters are 40 bit. Move to cputable at some point? */
134 reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count; 134 reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count;
135 pr_debug("reset_value for pmc%u inited to 0x%lx\n", 135 pr_debug("reset_value for pmc%u inited to 0x%llx\n",
136 pmc, reset_value[pmc]); 136 pmc, reset_value[pmc]);
137 } 137 }
138 138
@@ -177,7 +177,7 @@ static int pa6t_start(struct op_counter_config *ctr)
177 177
178 oprofile_running = 1; 178 oprofile_running = 1;
179 179
180 pr_debug("start on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); 180 pr_debug("start on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0);
181 181
182 return 0; 182 return 0;
183} 183}
@@ -193,7 +193,7 @@ static void pa6t_stop(void)
193 193
194 oprofile_running = 0; 194 oprofile_running = 0;
195 195
196 pr_debug("stop on cpu %d, mmcr0 %lx\n", smp_processor_id(), mmcr0); 196 pr_debug("stop on cpu %d, mmcr0 %llx\n", smp_processor_id(), mmcr0);
197} 197}
198 198
199/* handle the perfmon overflow vector */ 199/* handle the perfmon overflow vector */
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index f416014ee72..1bcff94eb92 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -56,12 +56,12 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id)
56 int dev_match = 0; 56 int dev_match = 0;
57 int id_match = 0; 57 int id_match = 0;
58 58
59 if (dev == NULL && id == NULL) 59 if (dev == NULL || id == NULL)
60 return NULL; 60 return NULL;
61 61
62 mutex_lock(&clocks_mutex); 62 mutex_lock(&clocks_mutex);
63 list_for_each_entry(p, &clocks, node) { 63 list_for_each_entry(p, &clocks, node) {
64 if (dev && dev == p->dev) 64 if (dev == p->dev)
65 dev_match++; 65 dev_match++;
66 if (strcmp(id, p->name) == 0) 66 if (strcmp(id, p->name) == 0)
67 id_match++; 67 id_match++;
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
index 8a455ebce98..07f89ae46d0 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpio.c
@@ -363,11 +363,8 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
363{ 363{
364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); 364 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs; 365 struct mpc52xx_gpt __iomem *regs = mm_gc->regs;
366 unsigned int ret;
367 366
368 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0; 367 return (in_be32(&regs->status) & (1 << (31 - 23))) ? 1 : 0;
369
370 return ret;
371} 368}
372 369
373static void 370static void
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index 72865e8e4b5..0a093f03c75 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -196,6 +196,7 @@ static void mpc52xx_extirq_ack(unsigned int virq)
196 196
197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type) 197static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
198{ 198{
199 struct irq_desc *desc = get_irq_desc(virq);
199 u32 ctrl_reg, type; 200 u32 ctrl_reg, type;
200 int irq; 201 int irq;
201 int l2irq; 202 int l2irq;
@@ -222,6 +223,11 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
222 type = 0; 223 type = 0;
223 } 224 }
224 225
226 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
227 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
228 if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
229 desc->status |= IRQ_LEVEL;
230
225 ctrl_reg = in_be32(&intr->ctrl); 231 ctrl_reg = in_be32(&intr->ctrl);
226 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2))); 232 ctrl_reg &= ~(0x3 << (22 - (l2irq * 2)));
227 ctrl_reg |= (type << (22 - (l2irq * 2))); 233 ctrl_reg |= (type << (22 - (l2irq * 2)));
@@ -231,7 +237,7 @@ static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int flow_type)
231} 237}
232 238
233static struct irq_chip mpc52xx_extirq_irqchip = { 239static struct irq_chip mpc52xx_extirq_irqchip = {
234 .typename = " MPC52xx IRQ[0-3] ", 240 .typename = "MPC52xx External",
235 .mask = mpc52xx_extirq_mask, 241 .mask = mpc52xx_extirq_mask,
236 .unmask = mpc52xx_extirq_unmask, 242 .unmask = mpc52xx_extirq_unmask,
237 .ack = mpc52xx_extirq_ack, 243 .ack = mpc52xx_extirq_ack,
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile
index ba5028e2989..051777c542c 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -3,6 +3,7 @@
3# 3#
4obj-y := misc.o usb.o 4obj-y := misc.o usb.o
5obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o 5obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o
6obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o
6obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o 7obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o
7obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o 8obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o
8obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o 9obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o
diff --git a/drivers/i2c/chips/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 82a9bcb858b..82a9bcb858b 100644
--- a/drivers/i2c/chips/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 47fe2bea986..200b9cb900e 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -323,4 +323,15 @@ config SIMPLE_GPIO
323 chip-selects, Ethernet/USB PHY's power and various other small 323 chip-selects, Ethernet/USB PHY's power and various other small
324 on-board peripherals. 324 on-board peripherals.
325 325
326config MCU_MPC8349EMITX
327 tristate "MPC8349E-mITX MCU driver"
328 depends on I2C && PPC_83xx
329 select GENERIC_GPIO
330 select ARCH_REQUIRE_GPIOLIB
331 help
332 Say Y here to enable soft power-off functionality on the Freescale
333 boards with the MPC8349E-mITX-compatible MCU chips. This driver will
334 also register MCU GPIOs with the generic GPIO API, so you'll able
335 to use MCU pins as GPIOs.
336
326endmenu 337endmenu
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index 192a9350937..72254848a22 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int irq_plug)
99 err = beat_downcount_of_interrupt(irq_plug); 99 err = beat_downcount_of_interrupt(irq_plug);
100 if (err != 0) { 100 if (err != 0) {
101 if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ 101 if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */
102 panic("Failed to downcount IRQ! Error = %16lx", err); 102 panic("Failed to downcount IRQ! Error = %16llx", err);
103 103
104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug); 104 printk(KERN_ERR "IRQ over-downcounted, plug %d\n", irq_plug);
105 } 105 }
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 08c285b10e3..48ec88a38a1 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -405,7 +405,7 @@ static int __init celleb_setup_epci(struct device_node *node,
405 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); 405 hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1));
406 if (!hose->cfg_addr) 406 if (!hose->cfg_addr)
407 goto error; 407 goto error;
408 pr_debug("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\n", 408 pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n",
409 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); 409 r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1));
410 410
411 if (of_address_to_resource(node, 2, &r)) 411 if (of_address_to_resource(node, 2, &r))
@@ -413,7 +413,7 @@ static int __init celleb_setup_epci(struct device_node *node,
413 hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); 413 hose->cfg_data = ioremap(r.start, (r.end - r.start + 1));
414 if (!hose->cfg_data) 414 if (!hose->cfg_data)
415 goto error; 415 goto error;
416 pr_debug("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n", 416 pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n",
417 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); 417 r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1));
418 418
419 hose->ops = &celleb_epci_ops; 419 hose->ops = &celleb_epci_ops;
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 88d94b59a7c..ee5033eddf0 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabled(void)
855 */ 855 */
856 if (np && size < lmb_end_of_DRAM()) { 856 if (np && size < lmb_end_of_DRAM()) {
857 printk(KERN_WARNING "iommu: force-enabled, dma window" 857 printk(KERN_WARNING "iommu: force-enabled, dma window"
858 " (%ldMB) smaller than total memory (%ldMB)\n", 858 " (%ldMB) smaller than total memory (%lldMB)\n",
859 size >> 20, lmb_end_of_DRAM() >> 20); 859 size >> 20, lmb_end_of_DRAM() >> 20);
860 return -ENODEV; 860 return -ENODEV;
861 } 861 }
@@ -985,7 +985,7 @@ static void cell_dma_dev_setup_fixed(struct device *dev)
985 addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base; 985 addr = cell_iommu_get_fixed_address(dev) + dma_iommu_fixed_base;
986 archdata->dma_data = (void *)addr; 986 archdata->dma_data = (void *)addr;
987 987
988 dev_dbg(dev, "iommu: fixed addr = %lx\n", addr); 988 dev_dbg(dev, "iommu: fixed addr = %llx\n", addr);
989} 989}
990 990
991static void insert_16M_pte(unsigned long addr, unsigned long *ptab, 991static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 7b4cefa2199..5f961c464cc 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -38,16 +38,16 @@ static void dump_fir(int cpu)
38 /* Todo: do some nicer parsing of bits and based on them go down 38 /* Todo: do some nicer parsing of bits and based on them go down
39 * to other sub-units FIRs and not only IIC 39 * to other sub-units FIRs and not only IIC
40 */ 40 */
41 printk(KERN_ERR "Global Checkstop FIR : 0x%016lx\n", 41 printk(KERN_ERR "Global Checkstop FIR : 0x%016llx\n",
42 in_be64(&pregs->checkstop_fir)); 42 in_be64(&pregs->checkstop_fir));
43 printk(KERN_ERR "Global Recoverable FIR : 0x%016lx\n", 43 printk(KERN_ERR "Global Recoverable FIR : 0x%016llx\n",
44 in_be64(&pregs->checkstop_fir)); 44 in_be64(&pregs->checkstop_fir));
45 printk(KERN_ERR "Global MachineCheck FIR : 0x%016lx\n", 45 printk(KERN_ERR "Global MachineCheck FIR : 0x%016llx\n",
46 in_be64(&pregs->spec_att_mchk_fir)); 46 in_be64(&pregs->spec_att_mchk_fir));
47 47
48 if (iregs == NULL) 48 if (iregs == NULL)
49 return; 49 return;
50 printk(KERN_ERR "IOC FIR : 0x%016lx\n", 50 printk(KERN_ERR "IOC FIR : 0x%016llx\n",
51 in_be64(&iregs->ioc_fir)); 51 in_be64(&iregs->ioc_fir));
52 52
53} 53}
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index a5bdb89a17c..e487ad68ac1 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -151,7 +151,7 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
151{ 151{
152 struct spu_priv2 __iomem *priv2 = spu->priv2; 152 struct spu_priv2 __iomem *priv2 = spu->priv2;
153 153
154 pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n", 154 pr_debug("%s: adding SLB[%d] 0x%016llx 0x%016llx\n",
155 __func__, slbe, slb->vsid, slb->esid); 155 __func__, slbe, slb->vsid, slb->esid);
156 156
157 out_be64(&priv2->slb_index_W, slbe); 157 out_be64(&priv2->slb_index_W, slbe);
@@ -221,7 +221,7 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
221{ 221{
222 int ret; 222 int ret;
223 223
224 pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea); 224 pr_debug("%s, %llx, %lx\n", __func__, dsisr, ea);
225 225
226 /* 226 /*
227 * Handle kernel space hash faults immediately. User hash 227 * Handle kernel space hash faults immediately. User hash
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 19f6bfdbb93..fec1495e6b1 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s)
54 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); 54 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
55 55
56 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { 56 if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
57 pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret); 57 pr_debug("%s: invalid syscall #%lld", __func__, s->nr_ret);
58 return -ENOSYS; 58 return -ENOSYS;
59 } 59 }
60 60
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index af116aadba1..c4d4a19235e 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -42,7 +42,7 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
42 return spufs_coredump_read[num].read(ctx, buffer, size, off); 42 return spufs_coredump_read[num].read(ctx, buffer, size, off);
43 43
44 data = spufs_coredump_read[num].get(ctx); 44 data = spufs_coredump_read[num].get(ctx);
45 ret = snprintf(buffer, size, "0x%.16lx", data); 45 ret = snprintf(buffer, size, "0x%.16llx", data);
46 if (ret >= size) 46 if (ret >= size)
47 return size; 47 return size;
48 return ++ret; /* count trailing NULL */ 48 return ++ret; /* count trailing NULL */
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c b/arch/powerpc/platforms/cell/spufs/fault.c
index f093a581ac7..a4dd3ae7223 100644
--- a/arch/powerpc/platforms/cell/spufs/fault.c
+++ b/arch/powerpc/platforms/cell/spufs/fault.c
@@ -132,7 +132,7 @@ int spufs_handle_class1(struct spu_context *ctx)
132 132
133 spuctx_switch_state(ctx, SPU_UTIL_IOWAIT); 133 spuctx_switch_state(ctx, SPU_UTIL_IOWAIT);
134 134
135 pr_debug("ctx %p: ea %016lx, dsisr %016lx state %d\n", ctx, ea, 135 pr_debug("ctx %p: ea %016llx, dsisr %016llx state %d\n", ctx, ea,
136 dsisr, ctx->state); 136 dsisr, ctx->state);
137 137
138 ctx->stats.hash_flt++; 138 ctx->stats.hash_flt++;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 7106b63d401..0da7f2bf5ee 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1654,7 +1654,7 @@ out:
1654 1654
1655static int spufs_check_valid_dma(struct mfc_dma_command *cmd) 1655static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
1656{ 1656{
1657 pr_debug("queueing DMA %x %lx %x %x %x\n", cmd->lsa, 1657 pr_debug("queueing DMA %x %llx %x %x %x\n", cmd->lsa,
1658 cmd->ea, cmd->size, cmd->tag, cmd->cmd); 1658 cmd->ea, cmd->size, cmd->tag, cmd->cmd);
1659 1659
1660 switch (cmd->cmd) { 1660 switch (cmd->cmd) {
@@ -1671,7 +1671,7 @@ static int spufs_check_valid_dma(struct mfc_dma_command *cmd)
1671 } 1671 }
1672 1672
1673 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) { 1673 if ((cmd->lsa & 0xf) != (cmd->ea &0xf)) {
1674 pr_debug("invalid DMA alignment, ea %lx lsa %x\n", 1674 pr_debug("invalid DMA alignment, ea %llx lsa %x\n",
1675 cmd->ea, cmd->lsa); 1675 cmd->ea, cmd->lsa);
1676 return -EIO; 1676 return -EIO;
1677 } 1677 }
@@ -2633,7 +2633,7 @@ static int spufs_show_ctx(struct seq_file *s, void *private)
2633 } 2633 }
2634 2634
2635 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)" 2635 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)"
2636 " %c %lx %lx %lx %lx %x %x\n", 2636 " %c %llx %llx %llx %llx %x %x\n",
2637 ctx->state == SPU_STATE_SAVED ? 'S' : 'R', 2637 ctx->state == SPU_STATE_SAVED ? 'S' : 'R',
2638 ctx->flags, 2638 ctx->flags,
2639 ctx->sched_flags, 2639 ctx->sched_flags,
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 8c619963bec..1db6b9e037f 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -249,6 +249,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
249DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); 249DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
250DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249); 250DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5249, quirk_final_uli5249);
251DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575); 251DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x1575, quirk_final_uli1575);
252DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
252 253
253static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev) 254static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
254{ 255{
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index bbe828f1b88..6ed75bffc8a 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
66 66
67 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce); 67 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, tce);
68 if (rc) 68 if (rc)
69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 69 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
70 rc); 70 rc);
71 index++; 71 index++;
72 uaddr += TCE_PAGE_SIZE; 72 uaddr += TCE_PAGE_SIZE;
@@ -81,7 +81,7 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
81 while (npages--) { 81 while (npages--) {
82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0); 82 rc = HvCallXm_setTce((u64)tbl->it_index, (u64)index, 0);
83 if (rc) 83 if (rc)
84 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n", 84 panic("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n",
85 rc); 85 rc);
86 index++; 86 index++;
87 } 87 }
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 6b0711c15ec..bd8817b00fa 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -53,7 +53,7 @@
53#include <asm/pmac_low_i2c.h> 53#include <asm/pmac_low_i2c.h>
54#include <asm/pmac_pfunc.h> 54#include <asm/pmac_pfunc.h>
55 55
56#define DEBUG 56#undef DEBUG
57 57
58#ifdef DEBUG 58#ifdef DEBUG
59#define DBG(fmt...) udbg_printf(fmt) 59#define DBG(fmt...) udbg_printf(fmt)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index c90817acb47..3ee01b4f425 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
127 } 127 }
128 128
129 if (rc && printk_ratelimit()) { 129 if (rc && printk_ratelimit()) {
130 printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 130 printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
131 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 131 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
132 printk("\ttcenum = 0x%lx\n", (u64)tcenum); 132 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
133 printk("\ttce val = 0x%lx\n", tce ); 133 printk("\ttce val = 0x%llx\n", tce );
134 show_stack(current, (unsigned long *)__get_SP()); 134 show_stack(current, (unsigned long *)__get_SP());
135 } 135 }
136 136
@@ -210,10 +210,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
210 } 210 }
211 211
212 if (rc && printk_ratelimit()) { 212 if (rc && printk_ratelimit()) {
213 printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 213 printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
214 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 214 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
215 printk("\tnpages = 0x%lx\n", (u64)npages); 215 printk("\tnpages = 0x%llx\n", (u64)npages);
216 printk("\ttce[0] val = 0x%lx\n", tcep[0]); 216 printk("\ttce[0] val = 0x%llx\n", tcep[0]);
217 show_stack(current, (unsigned long *)__get_SP()); 217 show_stack(current, (unsigned long *)__get_SP());
218 } 218 }
219 return ret; 219 return ret;
@@ -227,9 +227,9 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
227 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0); 227 rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, 0);
228 228
229 if (rc && printk_ratelimit()) { 229 if (rc && printk_ratelimit()) {
230 printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc); 230 printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
231 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 231 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
232 printk("\ttcenum = 0x%lx\n", (u64)tcenum); 232 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
233 show_stack(current, (unsigned long *)__get_SP()); 233 show_stack(current, (unsigned long *)__get_SP());
234 } 234 }
235 235
@@ -246,9 +246,9 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
246 246
247 if (rc && printk_ratelimit()) { 247 if (rc && printk_ratelimit()) {
248 printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n"); 248 printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n");
249 printk("\trc = %ld\n", rc); 249 printk("\trc = %lld\n", rc);
250 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 250 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
251 printk("\tnpages = 0x%lx\n", (u64)npages); 251 printk("\tnpages = 0x%llx\n", (u64)npages);
252 show_stack(current, (unsigned long *)__get_SP()); 252 show_stack(current, (unsigned long *)__get_SP());
253 } 253 }
254} 254}
@@ -261,10 +261,9 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
261 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret); 261 rc = plpar_tce_get((u64)tbl->it_index, (u64)tcenum << 12, &tce_ret);
262 262
263 if (rc && printk_ratelimit()) { 263 if (rc && printk_ratelimit()) {
264 printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%ld\n", 264 printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc);
265 rc); 265 printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
266 printk("\tindex = 0x%lx\n", (u64)tbl->it_index); 266 printk("\ttcenum = 0x%llx\n", (u64)tcenum);
267 printk("\ttcenum = 0x%lx\n", (u64)tcenum);
268 show_stack(current, (unsigned long *)__get_SP()); 267 show_stack(current, (unsigned long *)__get_SP());
269 } 268 }
270 269
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index f611d0369cc..9817f63723d 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -28,63 +28,104 @@
28#include <sysdev/fsl_pci.h> 28#include <sysdev/fsl_pci.h>
29 29
30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) 30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
31static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
32 unsigned int index, const struct resource *res,
33 resource_size_t offset)
34{
35 resource_size_t pci_addr = res->start - offset;
36 resource_size_t phys_addr = res->start;
37 resource_size_t size = res->end - res->start + 1;
38 u32 flags = 0x80044000; /* enable & mem R/W */
39 unsigned int i;
40
41 pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
42 (u64)res->start, (u64)size);
43
44 if (res->flags & IORESOURCE_PREFETCH)
45 flags |= 0x10000000; /* enable relaxed ordering */
46
47 for (i = 0; size > 0; i++) {
48 unsigned int bits = min(__ilog2(size),
49 __ffs(pci_addr | phys_addr));
50
51 if (index + i >= 5)
52 return -1;
53
54 out_be32(&pci->pow[index + i].potar, pci_addr >> 12);
55 out_be32(&pci->pow[index + i].potear, (u64)pci_addr >> 44);
56 out_be32(&pci->pow[index + i].powbar, phys_addr >> 12);
57 out_be32(&pci->pow[index + i].powar, flags | (bits - 1));
58
59 pci_addr += (resource_size_t)1U << bits;
60 phys_addr += (resource_size_t)1U << bits;
61 size -= (resource_size_t)1U << bits;
62 }
63
64 return i;
65}
66
31/* atmu setup for fsl pci/pcie controller */ 67/* atmu setup for fsl pci/pcie controller */
32static void __init setup_pci_atmu(struct pci_controller *hose, 68static void __init setup_pci_atmu(struct pci_controller *hose,
33 struct resource *rsrc) 69 struct resource *rsrc)
34{ 70{
35 struct ccsr_pci __iomem *pci; 71 struct ccsr_pci __iomem *pci;
36 int i; 72 int i, j, n;
37 73
38 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", 74 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
39 (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); 75 (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
40 pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); 76 pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
77 if (!pci) {
78 dev_err(hose->parent, "Unable to map ATMU registers\n");
79 return;
80 }
41 81
42 /* Disable all windows (except powar0 since its ignored) */ 82 /* Disable all windows (except powar0 since it's ignored) */
43 for(i = 1; i < 5; i++) 83 for(i = 1; i < 5; i++)
44 out_be32(&pci->pow[i].powar, 0); 84 out_be32(&pci->pow[i].powar, 0);
45 for(i = 0; i < 3; i++) 85 for(i = 0; i < 3; i++)
46 out_be32(&pci->piw[i].piwar, 0); 86 out_be32(&pci->piw[i].piwar, 0);
47 87
48 /* Setup outbound MEM window */ 88 /* Setup outbound MEM window */
49 for(i = 0; i < 3; i++) 89 for(i = 0, j = 1; i < 3; i++) {
50 if (hose->mem_resources[i].flags & IORESOURCE_MEM){ 90 if (!(hose->mem_resources[i].flags & IORESOURCE_MEM))
51 resource_size_t pci_addr_start = 91 continue;
52 hose->mem_resources[i].start - 92
53 hose->pci_mem_offset; 93 n = setup_one_atmu(pci, j, &hose->mem_resources[i],
54 pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n", 94 hose->pci_mem_offset);
55 (u64)hose->mem_resources[i].start, 95
56 (u64)hose->mem_resources[i].end 96 if (n < 0 || j >= 5) {
57 - (u64)hose->mem_resources[i].start + 1); 97 pr_err("Ran out of outbound PCI ATMUs for resource %d!\n", i);
58 out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12)); 98 hose->mem_resources[i].flags |= IORESOURCE_DISABLED;
59 out_be32(&pci->pow[i+1].potear, 0); 99 } else
60 out_be32(&pci->pow[i+1].powbar, 100 j += n;
61 (hose->mem_resources[i].start >> 12)); 101 }
62 /* Enable, Mem R/W */
63 out_be32(&pci->pow[i+1].powar, 0x80044000
64 | (__ilog2(hose->mem_resources[i].end
65 - hose->mem_resources[i].start + 1) - 1));
66 }
67 102
68 /* Setup outbound IO window */ 103 /* Setup outbound IO window */
69 if (hose->io_resource.flags & IORESOURCE_IO){ 104 if (hose->io_resource.flags & IORESOURCE_IO) {
70 pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " 105 if (j >= 5) {
71 "phy base 0x%016llx.\n", 106 pr_err("Ran out of outbound PCI ATMUs for IO resource\n");
72 (u64)hose->io_resource.start, 107 } else {
73 (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1, 108 pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
74 (u64)hose->io_base_phys); 109 "phy base 0x%016llx.\n",
75 out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12)); 110 (u64)hose->io_resource.start,
76 out_be32(&pci->pow[i+1].potear, 0); 111 (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
77 out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12)); 112 (u64)hose->io_base_phys);
78 /* Enable, IO R/W */ 113 out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12));
79 out_be32(&pci->pow[i+1].powar, 0x80088000 114 out_be32(&pci->pow[j].potear, 0);
80 | (__ilog2(hose->io_resource.end 115 out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12));
81 - hose->io_resource.start + 1) - 1)); 116 /* Enable, IO R/W */
117 out_be32(&pci->pow[j].powar, 0x80088000
118 | (__ilog2(hose->io_resource.end
119 - hose->io_resource.start + 1) - 1));
120 }
82 } 121 }
83 122
84 /* Setup 2G inbound Memory Window @ 1 */ 123 /* Setup 2G inbound Memory Window @ 1 */
85 out_be32(&pci->piw[2].pitar, 0x00000000); 124 out_be32(&pci->piw[2].pitar, 0x00000000);
86 out_be32(&pci->piw[2].piwbar,0x00000000); 125 out_be32(&pci->piw[2].piwbar,0x00000000);
87 out_be32(&pci->piw[2].piwar, PIWAR_2G); 126 out_be32(&pci->piw[2].piwar, PIWAR_2G);
127
128 iounmap(pci);
88} 129}
89 130
90static void __init setup_pci_cmd(struct pci_controller *hose) 131static void __init setup_pci_cmd(struct pci_controller *hose)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 3e0d89dcdba..a35297dbac2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -435,7 +435,7 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase,
435 addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32); 435 addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32);
436 } 436 }
437 437
438 printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%lx\n", 438 printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
439 PCI_SLOT(devfn), PCI_FUNC(devfn), 439 PCI_SLOT(devfn), PCI_FUNC(devfn),
440 flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr); 440 flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr);
441 441
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 29e1dfafb7c..381d686fc1a 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1206,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = {
1206 { .compatible = "xlnx,opb-sysace-1.00.b", }, 1206 { .compatible = "xlnx,opb-sysace-1.00.b", },
1207 { .compatible = "xlnx,opb-sysace-1.00.c", }, 1207 { .compatible = "xlnx,opb-sysace-1.00.c", },
1208 { .compatible = "xlnx,xps-sysace-1.00.a", }, 1208 { .compatible = "xlnx,xps-sysace-1.00.a", },
1209 { .compatible = "xlnx,sysace", },
1209 {}, 1210 {},
1210}; 1211};
1211MODULE_DEVICE_TABLE(of, ace_of_match); 1212MODULE_DEVICE_TABLE(of, ace_of_match);
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 977dfb1096a..f6094ae0ef3 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -103,7 +103,7 @@ static ssize_t
103bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) 103bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf)
104{ 104{
105 struct bsr_dev *bsr_dev = dev_get_drvdata(dev); 105 struct bsr_dev *bsr_dev = dev_get_drvdata(dev);
106 return sprintf(buf, "%lu\n", bsr_dev->bsr_len); 106 return sprintf(buf, "%llu\n", bsr_dev->bsr_len);
107} 107}
108 108
109static struct device_attribute bsr_dev_attrs[] = { 109static struct device_attribute bsr_dev_attrs[] = {
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 5a8a4c28c86..09676b4e5d8 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -318,7 +318,8 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
318 } /* else count == 0 */ 318 } /* else count == 0 */
319 319
320 tty->driver_data = hp; 320 tty->driver_data = hp;
321 tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ 321 if (!hp->irq_requested)
322 tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */
322 323
323 hp->tty = tty; 324 hp->tty = tty;
324 325
@@ -764,13 +765,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data,
764 return ERR_PTR(err); 765 return ERR_PTR(err);
765 } 766 }
766 767
767 hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, 768 hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
768 GFP_KERNEL); 769 GFP_KERNEL);
769 if (!hp) 770 if (!hp)
770 return ERR_PTR(-ENOMEM); 771 return ERR_PTR(-ENOMEM);
771 772
772 memset(hp, 0x00, sizeof(*hp));
773
774 hp->vtermno = vtermno; 773 hp->vtermno = vtermno;
775 hp->data = data; 774 hp->data = data;
776 hp->ops = ops; 775 hp->ops = ops;
@@ -876,8 +875,11 @@ static int hvc_init(void)
876 goto stop_thread; 875 goto stop_thread;
877 } 876 }
878 877
879 /* FIXME: This mb() seems completely random. Remove it. */ 878 /*
880 mb(); 879 * Make sure tty is fully registered before allowing it to be
880 * found by hvc_console_device.
881 */
882 smp_mb();
881 hvc_driver = drv; 883 hvc_driver = drv;
882 return 0; 884 return 0;
883 885
diff --git a/drivers/char/hvc_irq.c b/drivers/char/hvc_irq.c
index d09e5688d44..2623e177e8d 100644
--- a/drivers/char/hvc_irq.c
+++ b/drivers/char/hvc_irq.c
@@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)
37 37
38void notifier_del_irq(struct hvc_struct *hp, int irq) 38void notifier_del_irq(struct hvc_struct *hp, int irq)
39{ 39{
40 if (!irq) 40 if (!hp->irq_requested)
41 return; 41 return;
42 free_irq(irq, hp); 42 free_irq(irq, hp);
43 hp->irq_requested = 0; 43 hp->irq_requested = 0;
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 59c3d23f5bd..b9bef04b7be 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -139,15 +139,4 @@ config SENSORS_TSL2550
139 This driver can also be built as a module. If so, the module 139 This driver can also be built as a module. If so, the module
140 will be called tsl2550. 140 will be called tsl2550.
141 141
142config MCU_MPC8349EMITX
143 tristate "MPC8349E-mITX MCU driver"
144 depends on I2C && PPC_83xx
145 select GENERIC_GPIO
146 select ARCH_REQUIRE_GPIOLIB
147 help
148 Say Y here to enable soft power-off functionality on the Freescale
149 boards with the MPC8349E-mITX-compatible MCU chips. This driver will
150 also register MCU GPIOs with the generic GPIO API, so you'll able
151 to use MCU pins as GPIOs.
152
153endmenu 142endmenu
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 83accaaf816..00fcb5193ac 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -19,7 +19,6 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o
19obj-$(CONFIG_PCF8575) += pcf8575.o 19obj-$(CONFIG_PCF8575) += pcf8575.o
20obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o 20obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
21obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o 21obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o
22obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o
23 22
24ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) 23ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
25EXTRA_CFLAGS += -DDEBUG 24EXTRA_CFLAGS += -DDEBUG
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index e3131ea629c..dfe92264e82 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -132,7 +132,7 @@ void ehea_dump(void *adr, int len, char *msg)
132 int x; 132 int x;
133 unsigned char *deb = adr; 133 unsigned char *deb = adr;
134 for (x = 0; x < len; x += 16) { 134 for (x = 0; x < len; x += 16) {
135 printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg, 135 printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg,
136 deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); 136 deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
137 deb += 16; 137 deb += 16;
138 } 138 }
@@ -883,7 +883,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
883 883
884 while (eqe) { 884 while (eqe) {
885 qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); 885 qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
886 ehea_error("QP aff_err: entry=0x%lx, token=0x%x", 886 ehea_error("QP aff_err: entry=0x%llx, token=0x%x",
887 eqe->entry, qp_token); 887 eqe->entry, qp_token);
888 888
889 qp = port->port_res[qp_token].qp; 889 qp = port->port_res[qp_token].qp;
@@ -1159,7 +1159,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
1159 netif_stop_queue(port->netdev); 1159 netif_stop_queue(port->netdev);
1160 break; 1160 break;
1161 default: 1161 default:
1162 ehea_error("unknown event code %x, eqe=0x%lX", ec, eqe); 1162 ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe);
1163 break; 1163 break;
1164 } 1164 }
1165} 1165}
@@ -1971,7 +1971,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
1971 } 1971 }
1972 1972
1973 if (dev->mc_count > port->adapter->max_mc_mac) { 1973 if (dev->mc_count > port->adapter->max_mc_mac) {
1974 ehea_info("Mcast registration limit reached (0x%lx). " 1974 ehea_info("Mcast registration limit reached (0x%llx). "
1975 "Use ALLMULTI!", 1975 "Use ALLMULTI!",
1976 port->adapter->max_mc_mac); 1976 port->adapter->max_mc_mac);
1977 goto out; 1977 goto out;
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c
index 225c692b5d9..49d766ebbcf 100644
--- a/drivers/net/ehea/ehea_qmr.c
+++ b/drivers/net/ehea/ehea_qmr.c
@@ -168,7 +168,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
168 cq->fw_handle, rpage, 1); 168 cq->fw_handle, rpage, 1);
169 if (hret < H_SUCCESS) { 169 if (hret < H_SUCCESS) {
170 ehea_error("register_rpage_cq failed ehea_cq=%p " 170 ehea_error("register_rpage_cq failed ehea_cq=%p "
171 "hret=%lx counter=%i act_pages=%i", 171 "hret=%llx counter=%i act_pages=%i",
172 cq, hret, counter, cq->attr.nr_pages); 172 cq, hret, counter, cq->attr.nr_pages);
173 goto out_kill_hwq; 173 goto out_kill_hwq;
174 } 174 }
@@ -178,13 +178,13 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
178 178
179 if ((hret != H_SUCCESS) || (vpage)) { 179 if ((hret != H_SUCCESS) || (vpage)) {
180 ehea_error("registration of pages not " 180 ehea_error("registration of pages not "
181 "complete hret=%lx\n", hret); 181 "complete hret=%llx\n", hret);
182 goto out_kill_hwq; 182 goto out_kill_hwq;
183 } 183 }
184 } else { 184 } else {
185 if (hret != H_PAGE_REGISTERED) { 185 if (hret != H_PAGE_REGISTERED) {
186 ehea_error("CQ: registration of page failed " 186 ehea_error("CQ: registration of page failed "
187 "hret=%lx\n", hret); 187 "hret=%llx\n", hret);
188 goto out_kill_hwq; 188 goto out_kill_hwq;
189 } 189 }
190 } 190 }
@@ -986,15 +986,15 @@ void print_error_data(u64 *data)
986 length = EHEA_PAGESIZE; 986 length = EHEA_PAGESIZE;
987 987
988 if (type == 0x8) /* Queue Pair */ 988 if (type == 0x8) /* Queue Pair */
989 ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, " 989 ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
990 "port=%lX", resource, data[6], data[12], data[22]); 990 "port=%llX", resource, data[6], data[12], data[22]);
991 991
992 if (type == 0x4) /* Completion Queue */ 992 if (type == 0x4) /* Completion Queue */
993 ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource, 993 ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,
994 data[6]); 994 data[6]);
995 995
996 if (type == 0x3) /* Event Queue */ 996 if (type == 0x3) /* Event Queue */
997 ehea_error("EQ (resource=%lX) state: AER=0x%lX", resource, 997 ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource,
998 data[6]); 998 data[6]);
999 999
1000 ehea_dump(data, length, "error data"); 1000 ehea_dump(data, length, "error data");
@@ -1016,11 +1016,11 @@ void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle)
1016 rblock); 1016 rblock);
1017 1017
1018 if (ret == H_R_STATE) 1018 if (ret == H_R_STATE)
1019 ehea_error("No error data is available: %lX.", res_handle); 1019 ehea_error("No error data is available: %llX.", res_handle);
1020 else if (ret == H_SUCCESS) 1020 else if (ret == H_SUCCESS)
1021 print_error_data(rblock); 1021 print_error_data(rblock);
1022 else 1022 else
1023 ehea_error("Error data could not be fetched: %lX", res_handle); 1023 ehea_error("Error data could not be fetched: %llX", res_handle);
1024 1024
1025 kfree(rblock); 1025 kfree(rblock);
1026} 1026}
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index ca3bb9f7321..dfa6348ac1d 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -602,7 +602,7 @@ static int ibmveth_open(struct net_device *netdev)
602 602
603 if(lpar_rc != H_SUCCESS) { 603 if(lpar_rc != H_SUCCESS) {
604 ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); 604 ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc);
605 ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n", 605 ibmveth_error_printk("buffer TCE:0x%llx filter TCE:0x%llx rxq desc:0x%llx MAC:0x%llx\n",
606 adapter->buffer_list_dma, 606 adapter->buffer_list_dma,
607 adapter->filter_list_dma, 607 adapter->filter_list_dma,
608 rxq_desc.desc, 608 rxq_desc.desc,
@@ -1378,13 +1378,13 @@ static int ibmveth_show(struct seq_file *seq, void *v)
1378 seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); 1378 seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac);
1379 1379
1380 seq_printf(seq, "\nAdapter Statistics:\n"); 1380 seq_printf(seq, "\nAdapter Statistics:\n");
1381 seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); 1381 seq_printf(seq, " TX: vio_map_single failres: %lld\n", adapter->tx_map_failed);
1382 seq_printf(seq, " send failures: %ld\n", adapter->tx_send_failed); 1382 seq_printf(seq, " send failures: %lld\n", adapter->tx_send_failed);
1383 seq_printf(seq, " RX: replenish task cycles: %ld\n", adapter->replenish_task_cycles); 1383 seq_printf(seq, " RX: replenish task cycles: %lld\n", adapter->replenish_task_cycles);
1384 seq_printf(seq, " alloc_skb_failures: %ld\n", adapter->replenish_no_mem); 1384 seq_printf(seq, " alloc_skb_failures: %lld\n", adapter->replenish_no_mem);
1385 seq_printf(seq, " add buffer failures: %ld\n", adapter->replenish_add_buff_failure); 1385 seq_printf(seq, " add buffer failures: %lld\n", adapter->replenish_add_buff_failure);
1386 seq_printf(seq, " invalid buffers: %ld\n", adapter->rx_invalid_buffer); 1386 seq_printf(seq, " invalid buffers: %lld\n", adapter->rx_invalid_buffer);
1387 seq_printf(seq, " no buffers: %ld\n", adapter->rx_no_buffer); 1387 seq_printf(seq, " no buffers: %lld\n", adapter->rx_no_buffer);
1388 1388
1389 return 0; 1389 return 0;
1390} 1390}
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index c7457f97259..cb793c2bade 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -429,7 +429,7 @@ SIMPLE_PORT_ATTR(promiscuous);
429SIMPLE_PORT_ATTR(num_mcast); 429SIMPLE_PORT_ATTR(num_mcast);
430CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); 430CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map);
431CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); 431CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map);
432CUSTOM_PORT_ATTR(mac_addr, "0x%lX\n", port->mac_addr); 432CUSTOM_PORT_ATTR(mac_addr, "0x%llX\n", port->mac_addr);
433 433
434#define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) 434#define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr)
435static struct attribute *veth_port_default_attrs[] = { 435static struct attribute *veth_port_default_attrs[] = {
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 5b7a574ce57..d0349e7d73e 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(const struct pasemi_mac *mac,
712 rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); 712 rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if));
713 ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); 713 ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno));
714 714
715 printk(KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\n", 715 printk(KERN_ERR "pasemi_mac: rx error. macrx %016llx, rx status %llx\n",
716 macrx, *chan->status); 716 macrx, *chan->status);
717 717
718 printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", 718 printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n",
@@ -730,8 +730,8 @@ static inline void pasemi_mac_tx_error(const struct pasemi_mac *mac,
730 730
731 cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); 731 cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno));
732 732
733 printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, "\ 733 printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016llx, "\
734 "tx status 0x%016lx\n", mactx, *chan->status); 734 "tx status 0x%016llx\n", mactx, *chan->status);
735 735
736 printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); 736 printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta);
737} 737}
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c
index e1b0ad6e918..fa65a2b2ae2 100644
--- a/drivers/of/of_i2c.c
+++ b/drivers/of/of_i2c.c
@@ -66,4 +66,23 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
66} 66}
67EXPORT_SYMBOL(of_register_i2c_devices); 67EXPORT_SYMBOL(of_register_i2c_devices);
68 68
69static int of_dev_node_match(struct device *dev, void *data)
70{
71 return dev_archdata_get_node(&dev->archdata) == data;
72}
73
74/* must call put_device() when done with returned i2c_client device */
75struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
76{
77 struct device *dev;
78
79 dev = bus_find_device(&i2c_bus_type, NULL, node,
80 of_dev_node_match);
81 if (!dev)
82 return NULL;
83
84 return to_i2c_client(dev);
85}
86EXPORT_SYMBOL(of_find_i2c_device_by_node);
87
69MODULE_LICENSE("GPL"); 88MODULE_LICENSE("GPL");
diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c
index a34284b1482..d187ba4c5e0 100644
--- a/drivers/pcmcia/electra_cf.c
+++ b/drivers/pcmcia/electra_cf.c
@@ -297,7 +297,7 @@ static int __devinit electra_cf_probe(struct of_device *ofdev,
297 goto fail3; 297 goto fail3;
298 } 298 }
299 299
300 dev_info(device, "at mem 0x%lx io 0x%lx irq %d\n", 300 dev_info(device, "at mem 0x%lx io 0x%llx irq %d\n",
301 cf->mem_phys, io.start, cf->irq); 301 cf->mem_phys, io.start, cf->irq);
302 302
303 cf->active = 1; 303 cf->active = 1;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 5c541f7850f..74d07d137da 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1061,7 +1061,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1061 } 1061 }
1062 1062
1063 sdev_printk(KERN_INFO, cmd->device, 1063 sdev_printk(KERN_INFO, cmd->device,
1064 "aborting command. lun 0x%lx, tag 0x%lx\n", 1064 "aborting command. lun 0x%llx, tag 0x%llx\n",
1065 (((u64) lun) << 48), (u64) found_evt); 1065 (((u64) lun) << 48), (u64) found_evt);
1066 1066
1067 wait_for_completion(&evt->comp); 1067 wait_for_completion(&evt->comp);
@@ -1082,7 +1082,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1082 if (rsp_rc) { 1082 if (rsp_rc) {
1083 if (printk_ratelimit()) 1083 if (printk_ratelimit())
1084 sdev_printk(KERN_WARNING, cmd->device, 1084 sdev_printk(KERN_WARNING, cmd->device,
1085 "abort code %d for task tag 0x%lx\n", 1085 "abort code %d for task tag 0x%llx\n",
1086 rsp_rc, tsk_mgmt->task_tag); 1086 rsp_rc, tsk_mgmt->task_tag);
1087 return FAILED; 1087 return FAILED;
1088 } 1088 }
@@ -1102,12 +1102,12 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1102 1102
1103 if (found_evt == NULL) { 1103 if (found_evt == NULL) {
1104 spin_unlock_irqrestore(hostdata->host->host_lock, flags); 1104 spin_unlock_irqrestore(hostdata->host->host_lock, flags);
1105 sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n", 1105 sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%llx completed\n",
1106 tsk_mgmt->task_tag); 1106 tsk_mgmt->task_tag);
1107 return SUCCESS; 1107 return SUCCESS;
1108 } 1108 }
1109 1109
1110 sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%lx\n", 1110 sdev_printk(KERN_INFO, cmd->device, "successfully aborted task tag 0x%llx\n",
1111 tsk_mgmt->task_tag); 1111 tsk_mgmt->task_tag);
1112 1112
1113 cmd->result = (DID_ABORT << 16); 1113 cmd->result = (DID_ABORT << 16);
@@ -1182,7 +1182,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1182 return FAILED; 1182 return FAILED;
1183 } 1183 }
1184 1184
1185 sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%lx\n", 1185 sdev_printk(KERN_INFO, cmd->device, "resetting device. lun 0x%llx\n",
1186 (((u64) lun) << 48)); 1186 (((u64) lun) << 48));
1187 1187
1188 wait_for_completion(&evt->comp); 1188 wait_for_completion(&evt->comp);
@@ -1203,7 +1203,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1203 if (rsp_rc) { 1203 if (rsp_rc) {
1204 if (printk_ratelimit()) 1204 if (printk_ratelimit())
1205 sdev_printk(KERN_WARNING, cmd->device, 1205 sdev_printk(KERN_WARNING, cmd->device,
1206 "reset code %d for task tag 0x%lx\n", 1206 "reset code %d for task tag 0x%llx\n",
1207 rsp_rc, tsk_mgmt->task_tag); 1207 rsp_rc, tsk_mgmt->task_tag);
1208 return FAILED; 1208 return FAILED;
1209 } 1209 }
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 68d6f4988fb..fe7e5f35e5d 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -15,12 +15,15 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18
19#include <linux/of_platform.h>
20#include <linux/of_device.h>
21#include <linux/of_spi.h>
22
18#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
19#include <linux/spi/spi_bitbang.h> 24#include <linux/spi/spi_bitbang.h>
20#include <linux/io.h> 25#include <linux/io.h>
21 26
22#include <syslib/virtex_devices.h>
23
24#define XILINX_SPI_NAME "xilinx_spi" 27#define XILINX_SPI_NAME "xilinx_spi"
25 28
26/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) 29/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
@@ -144,23 +147,14 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi,
144 struct spi_transfer *t) 147 struct spi_transfer *t)
145{ 148{
146 u8 bits_per_word; 149 u8 bits_per_word;
147 u32 hz;
148 struct xilinx_spi *xspi = spi_master_get_devdata(spi->master);
149 150
150 bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; 151 bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word;
151 hz = (t) ? t->speed_hz : spi->max_speed_hz;
152 if (bits_per_word != 8) { 152 if (bits_per_word != 8) {
153 dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", 153 dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
154 __func__, bits_per_word); 154 __func__, bits_per_word);
155 return -EINVAL; 155 return -EINVAL;
156 } 156 }
157 157
158 if (hz && xspi->speed_hz > hz) {
159 dev_err(&spi->dev, "%s, unsupported clock rate %uHz\n",
160 __func__, hz);
161 return -EINVAL;
162 }
163
164 return 0; 158 return 0;
165} 159}
166 160
@@ -304,32 +298,38 @@ static irqreturn_t xilinx_spi_irq(int irq, void *dev_id)
304 return IRQ_HANDLED; 298 return IRQ_HANDLED;
305} 299}
306 300
307static int __init xilinx_spi_probe(struct platform_device *dev) 301static int __init xilinx_spi_of_probe(struct of_device *ofdev,
302 const struct of_device_id *match)
308{ 303{
309 int ret = 0;
310 struct spi_master *master; 304 struct spi_master *master;
311 struct xilinx_spi *xspi; 305 struct xilinx_spi *xspi;
312 struct xspi_platform_data *pdata; 306 struct resource r_irq_struct;
313 struct resource *r; 307 struct resource r_mem_struct;
308
309 struct resource *r_irq = &r_irq_struct;
310 struct resource *r_mem = &r_mem_struct;
311 int rc = 0;
312 const u32 *prop;
313 int len;
314 314
315 /* Get resources(memory, IRQ) associated with the device */ 315 /* Get resources(memory, IRQ) associated with the device */
316 master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi)); 316 master = spi_alloc_master(&ofdev->dev, sizeof(struct xilinx_spi));
317 317
318 if (master == NULL) { 318 if (master == NULL) {
319 return -ENOMEM; 319 return -ENOMEM;
320 } 320 }
321 321
322 platform_set_drvdata(dev, master); 322 dev_set_drvdata(&ofdev->dev, master);
323 pdata = dev->dev.platform_data;
324 323
325 if (pdata == NULL) { 324 rc = of_address_to_resource(ofdev->node, 0, r_mem);
326 ret = -ENODEV; 325 if (rc) {
326 dev_warn(&ofdev->dev, "invalid address\n");
327 goto put_master; 327 goto put_master;
328 } 328 }
329 329
330 r = platform_get_resource(dev, IORESOURCE_MEM, 0); 330 rc = of_irq_to_resource(ofdev->node, 0, r_irq);
331 if (r == NULL) { 331 if (rc == NO_IRQ) {
332 ret = -ENODEV; 332 dev_warn(&ofdev->dev, "no IRQ found\n");
333 goto put_master; 333 goto put_master;
334 } 334 }
335 335
@@ -341,47 +341,57 @@ static int __init xilinx_spi_probe(struct platform_device *dev)
341 xspi->bitbang.master->setup = xilinx_spi_setup; 341 xspi->bitbang.master->setup = xilinx_spi_setup;
342 init_completion(&xspi->done); 342 init_completion(&xspi->done);
343 343
344 if (!request_mem_region(r->start, 344 xspi->irq = r_irq->start;
345 r->end - r->start + 1, XILINX_SPI_NAME)) { 345
346 ret = -ENXIO; 346 if (!request_mem_region(r_mem->start,
347 r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
348 rc = -ENXIO;
349 dev_warn(&ofdev->dev, "memory request failure\n");
347 goto put_master; 350 goto put_master;
348 } 351 }
349 352
350 xspi->regs = ioremap(r->start, r->end - r->start + 1); 353 xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
351 if (xspi->regs == NULL) { 354 if (xspi->regs == NULL) {
352 ret = -ENOMEM; 355 rc = -ENOMEM;
356 dev_warn(&ofdev->dev, "ioremap failure\n");
353 goto put_master; 357 goto put_master;
354 } 358 }
359 xspi->irq = r_irq->start;
355 360
356 ret = platform_get_irq(dev, 0); 361 /* dynamic bus assignment */
357 if (ret < 0) { 362 master->bus_num = -1;
358 ret = -ENXIO;
359 goto unmap_io;
360 }
361 xspi->irq = ret;
362 363
363 master->bus_num = pdata->bus_num; 364 /* number of slave select bits is required */
364 master->num_chipselect = pdata->num_chipselect; 365 prop = of_get_property(ofdev->node, "xlnx,num-ss-bits", &len);
365 xspi->speed_hz = pdata->speed_hz; 366 if (!prop || len < sizeof(*prop)) {
367 dev_warn(&ofdev->dev, "no 'xlnx,num-ss-bits' property\n");
368 goto put_master;
369 }
370 master->num_chipselect = *prop;
366 371
367 /* SPI controller initializations */ 372 /* SPI controller initializations */
368 xspi_init_hw(xspi->regs); 373 xspi_init_hw(xspi->regs);
369 374
370 /* Register for SPI Interrupt */ 375 /* Register for SPI Interrupt */
371 ret = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi); 376 rc = request_irq(xspi->irq, xilinx_spi_irq, 0, XILINX_SPI_NAME, xspi);
372 if (ret != 0) 377 if (rc != 0) {
378 dev_warn(&ofdev->dev, "irq request failure: %d\n", xspi->irq);
373 goto unmap_io; 379 goto unmap_io;
380 }
374 381
375 ret = spi_bitbang_start(&xspi->bitbang); 382 rc = spi_bitbang_start(&xspi->bitbang);
376 if (ret != 0) { 383 if (rc != 0) {
377 dev_err(&dev->dev, "spi_bitbang_start FAILED\n"); 384 dev_err(&ofdev->dev, "spi_bitbang_start FAILED\n");
378 goto free_irq; 385 goto free_irq;
379 } 386 }
380 387
381 dev_info(&dev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n", 388 dev_info(&ofdev->dev, "at 0x%08X mapped to 0x%08X, irq=%d\n",
382 r->start, (u32)xspi->regs, xspi->irq); 389 (unsigned int)r_mem->start, (u32)xspi->regs, xspi->irq);
383 390
384 return ret; 391 /* Add any subnodes on the SPI bus */
392 of_register_spi_devices(master, ofdev->node);
393
394 return rc;
385 395
386free_irq: 396free_irq:
387 free_irq(xspi->irq, xspi); 397 free_irq(xspi->irq, xspi);
@@ -389,21 +399,21 @@ unmap_io:
389 iounmap(xspi->regs); 399 iounmap(xspi->regs);
390put_master: 400put_master:
391 spi_master_put(master); 401 spi_master_put(master);
392 return ret; 402 return rc;
393} 403}
394 404
395static int __devexit xilinx_spi_remove(struct platform_device *dev) 405static int __devexit xilinx_spi_remove(struct of_device *ofdev)
396{ 406{
397 struct xilinx_spi *xspi; 407 struct xilinx_spi *xspi;
398 struct spi_master *master; 408 struct spi_master *master;
399 409
400 master = platform_get_drvdata(dev); 410 master = platform_get_drvdata(ofdev);
401 xspi = spi_master_get_devdata(master); 411 xspi = spi_master_get_devdata(master);
402 412
403 spi_bitbang_stop(&xspi->bitbang); 413 spi_bitbang_stop(&xspi->bitbang);
404 free_irq(xspi->irq, xspi); 414 free_irq(xspi->irq, xspi);
405 iounmap(xspi->regs); 415 iounmap(xspi->regs);
406 platform_set_drvdata(dev, 0); 416 dev_set_drvdata(&ofdev->dev, 0);
407 spi_master_put(xspi->bitbang.master); 417 spi_master_put(xspi->bitbang.master);
408 418
409 return 0; 419 return 0;
@@ -412,27 +422,42 @@ static int __devexit xilinx_spi_remove(struct platform_device *dev)
412/* work with hotplug and coldplug */ 422/* work with hotplug and coldplug */
413MODULE_ALIAS("platform:" XILINX_SPI_NAME); 423MODULE_ALIAS("platform:" XILINX_SPI_NAME);
414 424
415static struct platform_driver xilinx_spi_driver = { 425static int __exit xilinx_spi_of_remove(struct of_device *op)
416 .probe = xilinx_spi_probe, 426{
417 .remove = __devexit_p(xilinx_spi_remove), 427 return xilinx_spi_remove(op);
428}
429
430static struct of_device_id xilinx_spi_of_match[] = {
431 { .compatible = "xlnx,xps-spi-2.00.a", },
432 { .compatible = "xlnx,xps-spi-2.00.b", },
433 {}
434};
435
436MODULE_DEVICE_TABLE(of, xilinx_spi_of_match);
437
438static struct of_platform_driver xilinx_spi_of_driver = {
439 .owner = THIS_MODULE,
440 .name = "xilinx-xps-spi",
441 .match_table = xilinx_spi_of_match,
442 .probe = xilinx_spi_of_probe,
443 .remove = __exit_p(xilinx_spi_of_remove),
418 .driver = { 444 .driver = {
419 .name = XILINX_SPI_NAME, 445 .name = "xilinx-xps-spi",
420 .owner = THIS_MODULE, 446 .owner = THIS_MODULE,
421 }, 447 },
422}; 448};
423 449
424static int __init xilinx_spi_init(void) 450static int __init xilinx_spi_init(void)
425{ 451{
426 return platform_driver_register(&xilinx_spi_driver); 452 return of_register_platform_driver(&xilinx_spi_of_driver);
427} 453}
428module_init(xilinx_spi_init); 454module_init(xilinx_spi_init);
429 455
430static void __exit xilinx_spi_exit(void) 456static void __exit xilinx_spi_exit(void)
431{ 457{
432 platform_driver_unregister(&xilinx_spi_driver); 458 of_unregister_platform_driver(&xilinx_spi_of_driver);
433} 459}
434module_exit(xilinx_spi_exit); 460module_exit(xilinx_spi_exit);
435
436MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); 461MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
437MODULE_DESCRIPTION("Xilinx SPI driver"); 462MODULE_DESCRIPTION("Xilinx SPI driver");
438MODULE_LICENSE("GPL"); 463MODULE_LICENSE("GPL");
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
index bd2a870ec29..34974b5a76f 100644
--- a/include/linux/of_i2c.h
+++ b/include/linux/of_i2c.h
@@ -17,4 +17,7 @@
17void of_register_i2c_devices(struct i2c_adapter *adap, 17void of_register_i2c_devices(struct i2c_adapter *adap,
18 struct device_node *adap_node); 18 struct device_node *adap_node);
19 19
20/* must call put_device() when done with returned i2c_client device */
21struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
22
20#endif /* __LINUX_OF_I2C_H */ 23#endif /* __LINUX_OF_I2C_H */