aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 23:23:46 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 23:23:46 -0500
commitf093182d313edde9b1f86dbdaf40ba4da2dbd0e7 (patch)
treeecfc614d514bd5b43a98cf4c62fdd2f47d86e33c /arch/powerpc
parentd27ba47e7e8c466c18983a1779d611f82d6a354f (diff)
parent76c8e25b905f99be5ddbe999597ba7c2c33ec64b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig9
-rw-r--r--arch/powerpc/configs/g5_defconfig261
-rw-r--r--arch/powerpc/kernel/misc_64.S70
-rw-r--r--arch/powerpc/kernel/process.c4
-rw-r--r--arch/powerpc/kernel/prom.c21
-rw-r--r--arch/powerpc/kernel/prom_init.c11
-rw-r--r--arch/powerpc/kernel/rtas.c5
-rw-r--r--arch/powerpc/kernel/setup-common.c40
-rw-r--r--arch/powerpc/kernel/setup_32.c1
-rw-r--r--arch/powerpc/kernel/setup_64.c46
-rw-r--r--arch/powerpc/kernel/signal_32.c1
-rw-r--r--arch/powerpc/kernel/signal_64.c1
-rw-r--r--arch/powerpc/kernel/smp.c1
-rw-r--r--arch/powerpc/kernel/time.c5
-rw-r--r--arch/powerpc/kernel/traps.c11
-rw-r--r--arch/powerpc/lib/locks.c1
-rw-r--r--arch/powerpc/mm/fault.c17
-rw-r--r--arch/powerpc/mm/hash_utils_64.c10
-rw-r--r--arch/powerpc/mm/init_64.c1
-rw-r--r--arch/powerpc/mm/mem.c2
-rw-r--r--arch/powerpc/mm/numa.c1
-rw-r--r--arch/powerpc/mm/pgtable_64.c1
-rw-r--r--arch/powerpc/oprofile/op_model_power4.c24
-rw-r--r--arch/powerpc/platforms/iseries/irq.c5
-rw-r--r--arch/powerpc/platforms/iseries/pci.c37
-rw-r--r--arch/powerpc/platforms/iseries/setup.c4
-rw-r--r--arch/powerpc/platforms/iseries/smp.c1
-rw-r--r--arch/powerpc/platforms/powermac/Makefile3
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c (renamed from arch/powerpc/platforms/powermac/cpufreq.c)15
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c323
-rw-r--r--arch/powerpc/platforms/powermac/setup.c13
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c2
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c3
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h10
-rw-r--r--arch/powerpc/platforms/pseries/ras.c2
-rw-r--r--arch/powerpc/platforms/pseries/setup.c18
-rw-r--r--arch/powerpc/sysdev/i8259.c5
-rw-r--r--arch/powerpc/sysdev/u3_iommu.c1
38 files changed, 752 insertions, 234 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 6ffae2d2b3fa..1493c7896fe3 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -404,6 +404,14 @@ config CPU_FREQ_PMAC
404 this currently includes some models of iBook & Titanium 404 this currently includes some models of iBook & Titanium
405 PowerBook. 405 PowerBook.
406 406
407config CPU_FREQ_PMAC64
408 bool "Support for some Apple G5s"
409 depends on CPU_FREQ && PMAC_SMU && PPC64
410 select CPU_FREQ_TABLE
411 help
412 This adds support for frequency switching on Apple iMac G5,
413 and some of the more recent desktop G5 machines as well.
414
407config PPC601_SYNC_FIX 415config PPC601_SYNC_FIX
408 bool "Workarounds for PPC601 bugs" 416 bool "Workarounds for PPC601 bugs"
409 depends on 6xx && (PPC_PREP || PPC_PMAC) 417 depends on 6xx && (PPC_PREP || PPC_PMAC)
@@ -484,6 +492,7 @@ source "fs/Kconfig.binfmt"
484config FORCE_MAX_ZONEORDER 492config FORCE_MAX_ZONEORDER
485 int 493 int
486 depends on PPC64 494 depends on PPC64
495 default "9" if PPC_64K_PAGES
487 default "13" 496 default "13"
488 497
489config MATH_EMULATION 498config MATH_EMULATION
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig
index 6323065fbf2c..e76854f8c121 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -1,18 +1,32 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.14-rc4 3# Linux kernel version: 2.6.14
4# Thu Oct 20 08:30:23 2005 4# Mon Nov 7 13:37:59 2005
5# 5#
6CONFIG_PPC64=y
6CONFIG_64BIT=y 7CONFIG_64BIT=y
8CONFIG_PPC_MERGE=y
7CONFIG_MMU=y 9CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y
8CONFIG_RWSEM_XCHGADD_ALGORITHM=y 11CONFIG_RWSEM_XCHGADD_ALGORITHM=y
9CONFIG_GENERIC_CALIBRATE_DELAY=y 12CONFIG_GENERIC_CALIBRATE_DELAY=y
10CONFIG_GENERIC_ISA_DMA=y 13CONFIG_PPC=y
11CONFIG_EARLY_PRINTK=y 14CONFIG_EARLY_PRINTK=y
12CONFIG_COMPAT=y 15CONFIG_COMPAT=y
16CONFIG_SYSVIPC_COMPAT=y
13CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 17CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
14CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_ARCH_MAY_HAVE_PC_FDC=y
15CONFIG_FORCE_MAX_ZONEORDER=13 19
20#
21# Processor support
22#
23CONFIG_POWER4_ONLY=y
24CONFIG_POWER4=y
25CONFIG_PPC_FPU=y
26CONFIG_ALTIVEC=y
27CONFIG_PPC_STD_MMU=y
28CONFIG_SMP=y
29CONFIG_NR_CPUS=2
16 30
17# 31#
18# Code maturity level options 32# Code maturity level options
@@ -67,30 +81,60 @@ CONFIG_MODVERSIONS=y
67CONFIG_MODULE_SRCVERSION_ALL=y 81CONFIG_MODULE_SRCVERSION_ALL=y
68CONFIG_KMOD=y 82CONFIG_KMOD=y
69CONFIG_STOP_MACHINE=y 83CONFIG_STOP_MACHINE=y
70CONFIG_SYSVIPC_COMPAT=y
71 84
72# 85#
73# Platform support 86# Platform support
74# 87#
75# CONFIG_PPC_ISERIES is not set
76CONFIG_PPC_MULTIPLATFORM=y 88CONFIG_PPC_MULTIPLATFORM=y
89# CONFIG_PPC_ISERIES is not set
90# CONFIG_EMBEDDED6xx is not set
91# CONFIG_APUS is not set
77# CONFIG_PPC_PSERIES is not set 92# CONFIG_PPC_PSERIES is not set
78# CONFIG_PPC_BPA is not set
79CONFIG_PPC_PMAC=y 93CONFIG_PPC_PMAC=y
94CONFIG_PPC_PMAC64=y
80# CONFIG_PPC_MAPLE is not set 95# CONFIG_PPC_MAPLE is not set
81CONFIG_PPC=y 96# CONFIG_PPC_CELL is not set
82CONFIG_PPC64=y
83CONFIG_PPC_OF=y 97CONFIG_PPC_OF=y
84CONFIG_MPIC=y
85CONFIG_ALTIVEC=y
86CONFIG_KEXEC=y
87CONFIG_U3_DART=y 98CONFIG_U3_DART=y
88CONFIG_PPC_PMAC64=y 99CONFIG_MPIC=y
89CONFIG_BOOTX_TEXT=y 100# CONFIG_PPC_RTAS is not set
90CONFIG_POWER4_ONLY=y 101# CONFIG_MMIO_NVRAM is not set
102# CONFIG_PPC_MPC106 is not set
103CONFIG_GENERIC_TBSYNC=y
104CONFIG_CPU_FREQ=y
105CONFIG_CPU_FREQ_TABLE=y
106# CONFIG_CPU_FREQ_DEBUG is not set
107CONFIG_CPU_FREQ_STAT=y
108# CONFIG_CPU_FREQ_STAT_DETAILS is not set
109CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
110# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
111CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
112CONFIG_CPU_FREQ_GOV_POWERSAVE=y
113CONFIG_CPU_FREQ_GOV_USERSPACE=y
114# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
115# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
116CONFIG_CPU_FREQ_PMAC64=y
117# CONFIG_WANT_EARLY_SERIAL is not set
118
119#
120# Kernel options
121#
122# CONFIG_HZ_100 is not set
123CONFIG_HZ_250=y
124# CONFIG_HZ_1000 is not set
125CONFIG_HZ=250
126CONFIG_PREEMPT_NONE=y
127# CONFIG_PREEMPT_VOLUNTARY is not set
128# CONFIG_PREEMPT is not set
129# CONFIG_PREEMPT_BKL is not set
130CONFIG_BINFMT_ELF=y
131# CONFIG_BINFMT_MISC is not set
132CONFIG_FORCE_MAX_ZONEORDER=13
91CONFIG_IOMMU_VMERGE=y 133CONFIG_IOMMU_VMERGE=y
92CONFIG_SMP=y 134# CONFIG_HOTPLUG_CPU is not set
93CONFIG_NR_CPUS=2 135CONFIG_KEXEC=y
136CONFIG_IRQ_ALL_CPUS=y
137# CONFIG_NUMA is not set
94CONFIG_ARCH_SELECT_MEMORY_MODEL=y 138CONFIG_ARCH_SELECT_MEMORY_MODEL=y
95CONFIG_ARCH_FLATMEM_ENABLE=y 139CONFIG_ARCH_FLATMEM_ENABLE=y
96CONFIG_SELECT_MEMORY_MODEL=y 140CONFIG_SELECT_MEMORY_MODEL=y
@@ -100,28 +144,21 @@ CONFIG_FLATMEM_MANUAL=y
100CONFIG_FLATMEM=y 144CONFIG_FLATMEM=y
101CONFIG_FLAT_NODE_MEM_MAP=y 145CONFIG_FLAT_NODE_MEM_MAP=y
102# CONFIG_SPARSEMEM_STATIC is not set 146# CONFIG_SPARSEMEM_STATIC is not set
103# CONFIG_NUMA is not set 147CONFIG_SPLIT_PTLOCK_CPUS=4
148# CONFIG_PPC_64K_PAGES is not set
104# CONFIG_SCHED_SMT is not set 149# CONFIG_SCHED_SMT is not set
105CONFIG_PREEMPT_NONE=y
106# CONFIG_PREEMPT_VOLUNTARY is not set
107# CONFIG_PREEMPT is not set
108# CONFIG_PREEMPT_BKL is not set
109# CONFIG_HZ_100 is not set
110CONFIG_HZ_250=y
111# CONFIG_HZ_1000 is not set
112CONFIG_HZ=250
113CONFIG_GENERIC_HARDIRQS=y
114CONFIG_SECCOMP=y
115CONFIG_BINFMT_ELF=y
116# CONFIG_BINFMT_MISC is not set
117# CONFIG_HOTPLUG_CPU is not set
118CONFIG_PROC_DEVICETREE=y 150CONFIG_PROC_DEVICETREE=y
119# CONFIG_CMDLINE_BOOL is not set 151# CONFIG_CMDLINE_BOOL is not set
152# CONFIG_PM is not set
153CONFIG_SECCOMP=y
120CONFIG_ISA_DMA_API=y 154CONFIG_ISA_DMA_API=y
121 155
122# 156#
123# Bus Options 157# Bus options
124# 158#
159CONFIG_GENERIC_ISA_DMA=y
160# CONFIG_PPC_I8259 is not set
161# CONFIG_PPC_INDIRECT_PCI is not set
125CONFIG_PCI=y 162CONFIG_PCI=y
126CONFIG_PCI_DOMAINS=y 163CONFIG_PCI_DOMAINS=y
127CONFIG_PCI_LEGACY_PROC=y 164CONFIG_PCI_LEGACY_PROC=y
@@ -136,6 +173,7 @@ CONFIG_PCI_LEGACY_PROC=y
136# PCI Hotplug Support 173# PCI Hotplug Support
137# 174#
138# CONFIG_HOTPLUG_PCI is not set 175# CONFIG_HOTPLUG_PCI is not set
176CONFIG_KERNEL_START=0xc000000000000000
139 177
140# 178#
141# Networking 179# Networking
@@ -276,6 +314,10 @@ CONFIG_LLC=y
276# CONFIG_NET_DIVERT is not set 314# CONFIG_NET_DIVERT is not set
277# CONFIG_ECONET is not set 315# CONFIG_ECONET is not set
278# CONFIG_WAN_ROUTER is not set 316# CONFIG_WAN_ROUTER is not set
317
318#
319# QoS and/or fair queueing
320#
279# CONFIG_NET_SCHED is not set 321# CONFIG_NET_SCHED is not set
280CONFIG_NET_CLS_ROUTE=y 322CONFIG_NET_CLS_ROUTE=y
281 323
@@ -348,6 +390,11 @@ CONFIG_IOSCHED_NOOP=y
348CONFIG_IOSCHED_AS=y 390CONFIG_IOSCHED_AS=y
349CONFIG_IOSCHED_DEADLINE=y 391CONFIG_IOSCHED_DEADLINE=y
350CONFIG_IOSCHED_CFQ=y 392CONFIG_IOSCHED_CFQ=y
393CONFIG_DEFAULT_AS=y
394# CONFIG_DEFAULT_DEADLINE is not set
395# CONFIG_DEFAULT_CFQ is not set
396# CONFIG_DEFAULT_NOOP is not set
397CONFIG_DEFAULT_IOSCHED="anticipatory"
351# CONFIG_ATA_OVER_ETH is not set 398# CONFIG_ATA_OVER_ETH is not set
352 399
353# 400#
@@ -449,6 +496,7 @@ CONFIG_SCSI_SPI_ATTRS=y
449# 496#
450# SCSI low-level drivers 497# SCSI low-level drivers
451# 498#
499# CONFIG_ISCSI_TCP is not set
452# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 500# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
453# CONFIG_SCSI_3W_9XXX is not set 501# CONFIG_SCSI_3W_9XXX is not set
454# CONFIG_SCSI_ACARD is not set 502# CONFIG_SCSI_ACARD is not set
@@ -465,10 +513,12 @@ CONFIG_SCSI_SATA_SVW=y
465# CONFIG_SCSI_ATA_PIIX is not set 513# CONFIG_SCSI_ATA_PIIX is not set
466# CONFIG_SCSI_SATA_MV is not set 514# CONFIG_SCSI_SATA_MV is not set
467# CONFIG_SCSI_SATA_NV is not set 515# CONFIG_SCSI_SATA_NV is not set
468# CONFIG_SCSI_SATA_PROMISE is not set 516# CONFIG_SCSI_PDC_ADMA is not set
469# CONFIG_SCSI_SATA_QSTOR is not set 517# CONFIG_SCSI_SATA_QSTOR is not set
518# CONFIG_SCSI_SATA_PROMISE is not set
470# CONFIG_SCSI_SATA_SX4 is not set 519# CONFIG_SCSI_SATA_SX4 is not set
471# CONFIG_SCSI_SATA_SIL is not set 520# CONFIG_SCSI_SATA_SIL is not set
521# CONFIG_SCSI_SATA_SIL24 is not set
472# CONFIG_SCSI_SATA_SIS is not set 522# CONFIG_SCSI_SATA_SIS is not set
473# CONFIG_SCSI_SATA_ULI is not set 523# CONFIG_SCSI_SATA_ULI is not set
474# CONFIG_SCSI_SATA_VIA is not set 524# CONFIG_SCSI_SATA_VIA is not set
@@ -567,6 +617,9 @@ CONFIG_IEEE1394_RAWIO=y
567CONFIG_ADB_PMU=y 617CONFIG_ADB_PMU=y
568CONFIG_PMAC_SMU=y 618CONFIG_PMAC_SMU=y
569CONFIG_THERM_PM72=y 619CONFIG_THERM_PM72=y
620CONFIG_WINDFARM=y
621CONFIG_WINDFARM_PM81=y
622CONFIG_WINDFARM_PM91=y
570 623
571# 624#
572# Network device support 625# Network device support
@@ -603,6 +656,7 @@ CONFIG_SUNGEM=y
603# CONFIG_NET_TULIP is not set 656# CONFIG_NET_TULIP is not set
604# CONFIG_HP100 is not set 657# CONFIG_HP100 is not set
605# CONFIG_NET_PCI is not set 658# CONFIG_NET_PCI is not set
659# CONFIG_FEC_8XX is not set
606 660
607# 661#
608# Ethernet (1000 Mbit) 662# Ethernet (1000 Mbit)
@@ -768,6 +822,7 @@ CONFIG_MAX_RAW_DEVS=256
768# TPM devices 822# TPM devices
769# 823#
770# CONFIG_TCG_TPM is not set 824# CONFIG_TCG_TPM is not set
825# CONFIG_TELCLOCK is not set
771 826
772# 827#
773# I2C support 828# I2C support
@@ -820,6 +875,7 @@ CONFIG_I2C_PMAC_SMU=y
820# CONFIG_SENSORS_PCF8591 is not set 875# CONFIG_SENSORS_PCF8591 is not set
821# CONFIG_SENSORS_RTC8564 is not set 876# CONFIG_SENSORS_RTC8564 is not set
822# CONFIG_SENSORS_MAX6875 is not set 877# CONFIG_SENSORS_MAX6875 is not set
878# CONFIG_RTC_X1205_I2C is not set
823# CONFIG_I2C_DEBUG_CORE is not set 879# CONFIG_I2C_DEBUG_CORE is not set
824# CONFIG_I2C_DEBUG_ALGO is not set 880# CONFIG_I2C_DEBUG_ALGO is not set
825# CONFIG_I2C_DEBUG_BUS is not set 881# CONFIG_I2C_DEBUG_BUS is not set
@@ -876,10 +932,9 @@ CONFIG_FB_OF=y
876# CONFIG_FB_ASILIANT is not set 932# CONFIG_FB_ASILIANT is not set
877# CONFIG_FB_IMSTT is not set 933# CONFIG_FB_IMSTT is not set
878# CONFIG_FB_VGA16 is not set 934# CONFIG_FB_VGA16 is not set
879# CONFIG_FB_NVIDIA is not set 935CONFIG_FB_NVIDIA=y
880CONFIG_FB_RIVA=y 936CONFIG_FB_NVIDIA_I2C=y
881# CONFIG_FB_RIVA_I2C is not set 937# CONFIG_FB_RIVA is not set
882# CONFIG_FB_RIVA_DEBUG is not set
883# CONFIG_FB_MATROX is not set 938# CONFIG_FB_MATROX is not set
884# CONFIG_FB_RADEON_OLD is not set 939# CONFIG_FB_RADEON_OLD is not set
885CONFIG_FB_RADEON=y 940CONFIG_FB_RADEON=y
@@ -924,7 +979,96 @@ CONFIG_LCD_DEVICE=y
924# 979#
925# Sound 980# Sound
926# 981#
927# CONFIG_SOUND is not set 982CONFIG_SOUND=m
983
984#
985# Advanced Linux Sound Architecture
986#
987CONFIG_SND=m
988CONFIG_SND_TIMER=m
989CONFIG_SND_PCM=m
990CONFIG_SND_HWDEP=m
991CONFIG_SND_RAWMIDI=m
992CONFIG_SND_SEQUENCER=m
993# CONFIG_SND_SEQ_DUMMY is not set
994CONFIG_SND_OSSEMUL=y
995CONFIG_SND_MIXER_OSS=m
996CONFIG_SND_PCM_OSS=m
997CONFIG_SND_SEQUENCER_OSS=y
998# CONFIG_SND_VERBOSE_PRINTK is not set
999# CONFIG_SND_DEBUG is not set
1000CONFIG_SND_GENERIC_DRIVER=y
1001
1002#
1003# Generic devices
1004#
1005# CONFIG_SND_DUMMY is not set
1006# CONFIG_SND_VIRMIDI is not set
1007# CONFIG_SND_MTPAV is not set
1008# CONFIG_SND_SERIAL_U16550 is not set
1009# CONFIG_SND_MPU401 is not set
1010
1011#
1012# PCI devices
1013#
1014# CONFIG_SND_ALI5451 is not set
1015# CONFIG_SND_ATIIXP is not set
1016# CONFIG_SND_ATIIXP_MODEM is not set
1017# CONFIG_SND_AU8810 is not set
1018# CONFIG_SND_AU8820 is not set
1019# CONFIG_SND_AU8830 is not set
1020# CONFIG_SND_AZT3328 is not set
1021# CONFIG_SND_BT87X is not set
1022# CONFIG_SND_CS46XX is not set
1023# CONFIG_SND_CS4281 is not set
1024# CONFIG_SND_EMU10K1 is not set
1025# CONFIG_SND_EMU10K1X is not set
1026# CONFIG_SND_CA0106 is not set
1027# CONFIG_SND_KORG1212 is not set
1028# CONFIG_SND_MIXART is not set
1029# CONFIG_SND_NM256 is not set
1030# CONFIG_SND_RME32 is not set
1031# CONFIG_SND_RME96 is not set
1032# CONFIG_SND_RME9652 is not set
1033# CONFIG_SND_HDSP is not set
1034# CONFIG_SND_HDSPM is not set
1035# CONFIG_SND_TRIDENT is not set
1036# CONFIG_SND_YMFPCI is not set
1037# CONFIG_SND_AD1889 is not set
1038# CONFIG_SND_ALS4000 is not set
1039# CONFIG_SND_CMIPCI is not set
1040# CONFIG_SND_ENS1370 is not set
1041# CONFIG_SND_ENS1371 is not set
1042# CONFIG_SND_ES1938 is not set
1043# CONFIG_SND_ES1968 is not set
1044# CONFIG_SND_MAESTRO3 is not set
1045# CONFIG_SND_FM801 is not set
1046# CONFIG_SND_ICE1712 is not set
1047# CONFIG_SND_ICE1724 is not set
1048# CONFIG_SND_INTEL8X0 is not set
1049# CONFIG_SND_INTEL8X0M is not set
1050# CONFIG_SND_SONICVIBES is not set
1051# CONFIG_SND_VIA82XX is not set
1052# CONFIG_SND_VIA82XX_MODEM is not set
1053# CONFIG_SND_VX222 is not set
1054# CONFIG_SND_HDA_INTEL is not set
1055
1056#
1057# ALSA PowerMac devices
1058#
1059CONFIG_SND_POWERMAC=m
1060CONFIG_SND_POWERMAC_AUTO_DRC=y
1061
1062#
1063# USB devices
1064#
1065CONFIG_SND_USB_AUDIO=m
1066# CONFIG_SND_USB_USX2Y is not set
1067
1068#
1069# Open Sound System
1070#
1071# CONFIG_SOUND_PRIME is not set
928 1072
929# 1073#
930# USB support 1074# USB support
@@ -958,12 +1102,16 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
958# 1102#
959# USB Device Class drivers 1103# USB Device Class drivers
960# 1104#
961# CONFIG_USB_BLUETOOTH_TTY is not set 1105# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set
962CONFIG_USB_ACM=m 1106CONFIG_USB_ACM=m
963CONFIG_USB_PRINTER=y 1107CONFIG_USB_PRINTER=y
964 1108
965# 1109#
966# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 1110# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1111#
1112
1113#
1114# may also be needed; see USB_STORAGE Help for more information
967# 1115#
968CONFIG_USB_STORAGE=y 1116CONFIG_USB_STORAGE=y
969# CONFIG_USB_STORAGE_DEBUG is not set 1117# CONFIG_USB_STORAGE_DEBUG is not set
@@ -1074,6 +1222,7 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
1074CONFIG_USB_SERIAL_KLSI=m 1222CONFIG_USB_SERIAL_KLSI=m
1075CONFIG_USB_SERIAL_KOBIL_SCT=m 1223CONFIG_USB_SERIAL_KOBIL_SCT=m
1076CONFIG_USB_SERIAL_MCT_U232=m 1224CONFIG_USB_SERIAL_MCT_U232=m
1225# CONFIG_USB_SERIAL_NOKIA_DKU2 is not set
1077CONFIG_USB_SERIAL_PL2303=m 1226CONFIG_USB_SERIAL_PL2303=m
1078# CONFIG_USB_SERIAL_HP4X is not set 1227# CONFIG_USB_SERIAL_HP4X is not set
1079CONFIG_USB_SERIAL_SAFE=m 1228CONFIG_USB_SERIAL_SAFE=m
@@ -1311,6 +1460,20 @@ CONFIG_NLS_ISO8859_15=y
1311CONFIG_NLS_UTF8=y 1460CONFIG_NLS_UTF8=y
1312 1461
1313# 1462#
1463# Library routines
1464#
1465CONFIG_CRC_CCITT=m
1466# CONFIG_CRC16 is not set
1467CONFIG_CRC32=y
1468CONFIG_LIBCRC32C=m
1469CONFIG_ZLIB_INFLATE=y
1470CONFIG_ZLIB_DEFLATE=m
1471CONFIG_TEXTSEARCH=y
1472CONFIG_TEXTSEARCH_KMP=m
1473CONFIG_TEXTSEARCH_BM=m
1474CONFIG_TEXTSEARCH_FSM=m
1475
1476#
1314# Profiling support 1477# Profiling support
1315# 1478#
1316CONFIG_PROFILING=y 1479CONFIG_PROFILING=y
@@ -1331,12 +1494,14 @@ CONFIG_DETECT_SOFTLOCKUP=y
1331# CONFIG_DEBUG_KOBJECT is not set 1494# CONFIG_DEBUG_KOBJECT is not set
1332# CONFIG_DEBUG_INFO is not set 1495# CONFIG_DEBUG_INFO is not set
1333CONFIG_DEBUG_FS=y 1496CONFIG_DEBUG_FS=y
1497# CONFIG_DEBUG_VM is not set
1498# CONFIG_RCU_TORTURE_TEST is not set
1334# CONFIG_DEBUG_STACKOVERFLOW is not set 1499# CONFIG_DEBUG_STACKOVERFLOW is not set
1335# CONFIG_KPROBES is not set 1500# CONFIG_KPROBES is not set
1336# CONFIG_DEBUG_STACK_USAGE is not set 1501# CONFIG_DEBUG_STACK_USAGE is not set
1337# CONFIG_DEBUGGER is not set 1502# CONFIG_DEBUGGER is not set
1338# CONFIG_PPCDBG is not set
1339CONFIG_IRQSTACKS=y 1503CONFIG_IRQSTACKS=y
1504CONFIG_BOOTX_TEXT=y
1340 1505
1341# 1506#
1342# Security options 1507# Security options
@@ -1376,17 +1541,3 @@ CONFIG_CRYPTO_TEST=m
1376# 1541#
1377# Hardware crypto devices 1542# Hardware crypto devices
1378# 1543#
1379
1380#
1381# Library routines
1382#
1383CONFIG_CRC_CCITT=m
1384# CONFIG_CRC16 is not set
1385CONFIG_CRC32=y
1386CONFIG_LIBCRC32C=m
1387CONFIG_ZLIB_INFLATE=y
1388CONFIG_ZLIB_DEFLATE=m
1389CONFIG_TEXTSEARCH=y
1390CONFIG_TEXTSEARCH_KMP=m
1391CONFIG_TEXTSEARCH_BM=m
1392CONFIG_TEXTSEARCH_FSM=m
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index b3e95ff0dba0..ae1433da09b2 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -604,6 +604,76 @@ _GLOBAL(real_writeb)
604#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ 604#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
605 605
606/* 606/*
607 * SCOM access functions for 970 (FX only for now)
608 *
609 * unsigned long scom970_read(unsigned int address);
610 * void scom970_write(unsigned int address, unsigned long value);
611 *
612 * The address passed in is the 24 bits register address. This code
613 * is 970 specific and will not check the status bits, so you should
614 * know what you are doing.
615 */
616_GLOBAL(scom970_read)
617 /* interrupts off */
618 mfmsr r4
619 ori r0,r4,MSR_EE
620 xori r0,r0,MSR_EE
621 mtmsrd r0,1
622
623 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
624 * (including parity). On current CPUs they must be 0'd,
625 * and finally or in RW bit
626 */
627 rlwinm r3,r3,8,0,15
628 ori r3,r3,0x8000
629
630 /* do the actual scom read */
631 sync
632 mtspr SPRN_SCOMC,r3
633 isync
634 mfspr r3,SPRN_SCOMD
635 isync
636 mfspr r0,SPRN_SCOMC
637 isync
638
639 /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah
640 * that's the best we can do). Not implemented yet as we don't use
641 * the scom on any of the bogus CPUs yet, but may have to be done
642 * ultimately
643 */
644
645 /* restore interrupts */
646 mtmsrd r4,1
647 blr
648
649
650_GLOBAL(scom970_write)
651 /* interrupts off */
652 mfmsr r5
653 ori r0,r5,MSR_EE
654 xori r0,r0,MSR_EE
655 mtmsrd r0,1
656
657 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
658 * (including parity). On current CPUs they must be 0'd.
659 */
660
661 rlwinm r3,r3,8,0,15
662
663 sync
664 mtspr SPRN_SCOMD,r4 /* write data */
665 isync
666 mtspr SPRN_SCOMC,r3 /* write command */
667 isync
668 mfspr 3,SPRN_SCOMC
669 isync
670
671 /* restore interrupts */
672 mtmsrd r5,1
673 blr
674
675
676/*
607 * Create a kernel thread 677 * Create a kernel thread
608 * kernel_thread(fn, arg, flags) 678 * kernel_thread(fn, arg, flags)
609 */ 679 */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 7f64f0464d44..de69fb37c731 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -46,10 +46,10 @@
46#include <asm/processor.h> 46#include <asm/processor.h>
47#include <asm/mmu.h> 47#include <asm/mmu.h>
48#include <asm/prom.h> 48#include <asm/prom.h>
49#include <asm/machdep.h>
49#ifdef CONFIG_PPC64 50#ifdef CONFIG_PPC64
50#include <asm/firmware.h> 51#include <asm/firmware.h>
51#include <asm/time.h> 52#include <asm/time.h>
52#include <asm/machdep.h>
53#endif 53#endif
54 54
55extern unsigned long _get_SP(void); 55extern unsigned long _get_SP(void);
@@ -203,10 +203,8 @@ int dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
203 203
204int set_dabr(unsigned long dabr) 204int set_dabr(unsigned long dabr)
205{ 205{
206#ifdef CONFIG_PPC64
207 if (ppc_md.set_dabr) 206 if (ppc_md.set_dabr)
208 return ppc_md.set_dabr(dabr); 207 return ppc_md.set_dabr(dabr);
209#endif
210 208
211 mtspr(SPRN_DABR, dabr); 209 mtspr(SPRN_DABR, dabr);
212 return 0; 210 return 0;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 3675ef4bac90..f645adb57534 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1974,14 +1974,29 @@ EXPORT_SYMBOL(get_property);
1974/* 1974/*
1975 * Add a property to a node 1975 * Add a property to a node
1976 */ 1976 */
1977void prom_add_property(struct device_node* np, struct property* prop) 1977int prom_add_property(struct device_node* np, struct property* prop)
1978{ 1978{
1979 struct property **next = &np->properties; 1979 struct property **next;
1980 1980
1981 prop->next = NULL; 1981 prop->next = NULL;
1982 while (*next) 1982 write_lock(&devtree_lock);
1983 next = &np->properties;
1984 while (*next) {
1985 if (strcmp(prop->name, (*next)->name) == 0) {
1986 /* duplicate ! don't insert it */
1987 write_unlock(&devtree_lock);
1988 return -1;
1989 }
1983 next = &(*next)->next; 1990 next = &(*next)->next;
1991 }
1984 *next = prop; 1992 *next = prop;
1993 write_unlock(&devtree_lock);
1994
1995 /* try to add to proc as well if it was initialized */
1996 if (np->pde)
1997 proc_device_tree_add_prop(np->pde, prop);
1998
1999 return 0;
1985} 2000}
1986 2001
1987/* I quickly hacked that one, check against spec ! */ 2002/* I quickly hacked that one, check against spec ! */
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index c758b6624d7b..6dc33d19fc2a 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -403,19 +403,19 @@ static int __init prom_next_node(phandle *nodep)
403 } 403 }
404} 404}
405 405
406static int __init prom_getprop(phandle node, const char *pname, 406static int inline prom_getprop(phandle node, const char *pname,
407 void *value, size_t valuelen) 407 void *value, size_t valuelen)
408{ 408{
409 return call_prom("getprop", 4, 1, node, ADDR(pname), 409 return call_prom("getprop", 4, 1, node, ADDR(pname),
410 (u32)(unsigned long) value, (u32) valuelen); 410 (u32)(unsigned long) value, (u32) valuelen);
411} 411}
412 412
413static int __init prom_getproplen(phandle node, const char *pname) 413static int inline prom_getproplen(phandle node, const char *pname)
414{ 414{
415 return call_prom("getproplen", 2, 1, node, ADDR(pname)); 415 return call_prom("getproplen", 2, 1, node, ADDR(pname));
416} 416}
417 417
418static int __init prom_setprop(phandle node, const char *pname, 418static int inline prom_setprop(phandle node, const char *pname,
419 void *value, size_t valuelen) 419 void *value, size_t valuelen)
420{ 420{
421 return call_prom("setprop", 4, 1, node, ADDR(pname), 421 return call_prom("setprop", 4, 1, node, ADDR(pname),
@@ -1408,8 +1408,9 @@ static int __init prom_find_machine_type(void)
1408 struct prom_t *_prom = &RELOC(prom); 1408 struct prom_t *_prom = &RELOC(prom);
1409 char compat[256]; 1409 char compat[256];
1410 int len, i = 0; 1410 int len, i = 0;
1411#ifdef CONFIG_PPC64
1411 phandle rtas; 1412 phandle rtas;
1412 1413#endif
1413 len = prom_getprop(_prom->root, "compatible", 1414 len = prom_getprop(_prom->root, "compatible",
1414 compat, sizeof(compat)-1); 1415 compat, sizeof(compat)-1);
1415 if (len > 0) { 1416 if (len > 0) {
@@ -1872,7 +1873,7 @@ static void __init fixup_device_tree(void)
1872 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) 1873 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1873 == PROM_ERROR) 1874 == PROM_ERROR)
1874 return; 1875 return;
1875 if (u3_rev != 0x35 && u3_rev != 0x37) 1876 if (u3_rev < 0x35 || u3_rev > 0x39)
1876 return; 1877 return;
1877 /* does it need fixup ? */ 1878 /* does it need fixup ? */
1878 if (prom_getproplen(i2c, "interrupts") > 0) 1879 if (prom_getproplen(i2c, "interrupts") > 0)
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index b7fc2d884950..9d4e07f6f1ec 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -17,6 +17,7 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/delay.h>
20 21
21#include <asm/prom.h> 22#include <asm/prom.h>
22#include <asm/rtas.h> 23#include <asm/rtas.h>
@@ -83,7 +84,7 @@ void call_rtas_display_status_delay(unsigned char c)
83 while (width-- > 0) 84 while (width-- > 0)
84 call_rtas_display_status(' '); 85 call_rtas_display_status(' ');
85 width = 16; 86 width = 16;
86 udelay(500000); 87 mdelay(500);
87 pending_newline = 1; 88 pending_newline = 1;
88 } else { 89 } else {
89 if (pending_newline) { 90 if (pending_newline) {
@@ -608,7 +609,6 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
608 return 0; 609 return 0;
609} 610}
610 611
611#ifdef CONFIG_SMP
612/* This version can't take the spinlock, because it never returns */ 612/* This version can't take the spinlock, because it never returns */
613 613
614struct rtas_args rtas_stop_self_args = { 614struct rtas_args rtas_stop_self_args = {
@@ -633,7 +633,6 @@ void rtas_stop_self(void)
633 633
634 panic("Alas, I survived.\n"); 634 panic("Alas, I survived.\n");
635} 635}
636#endif
637 636
638/* 637/*
639 * Call early during boot, before mem init or bootmem, to retreive the RTAS 638 * Call early during boot, before mem init or bootmem, to retreive the RTAS
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index d43fa8c0e5ac..e22856ecb5a0 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -405,6 +405,46 @@ static int __init set_preferred_console(void)
405console_initcall(set_preferred_console); 405console_initcall(set_preferred_console);
406#endif /* CONFIG_PPC_MULTIPLATFORM */ 406#endif /* CONFIG_PPC_MULTIPLATFORM */
407 407
408void __init check_for_initrd(void)
409{
410#ifdef CONFIG_BLK_DEV_INITRD
411 unsigned long *prop;
412
413 DBG(" -> check_for_initrd()\n");
414
415 if (of_chosen) {
416 prop = (unsigned long *)get_property(of_chosen,
417 "linux,initrd-start", NULL);
418 if (prop != NULL) {
419 initrd_start = (unsigned long)__va(*prop);
420 prop = (unsigned long *)get_property(of_chosen,
421 "linux,initrd-end", NULL);
422 if (prop != NULL) {
423 initrd_end = (unsigned long)__va(*prop);
424 initrd_below_start_ok = 1;
425 } else
426 initrd_start = 0;
427 }
428 }
429
430 /* If we were passed an initrd, set the ROOT_DEV properly if the values
431 * look sensible. If not, clear initrd reference.
432 */
433 if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
434 initrd_end > initrd_start)
435 ROOT_DEV = Root_RAM0;
436 else {
437 printk("Bogus initrd %08lx %08lx\n", initrd_start, initrd_end);
438 initrd_start = initrd_end = 0;
439 }
440
441 if (initrd_start)
442 printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
443
444 DBG(" <- check_for_initrd()\n");
445#endif /* CONFIG_BLK_DEV_INITRD */
446}
447
408#ifdef CONFIG_SMP 448#ifdef CONFIG_SMP
409 449
410/** 450/**
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index b45eedbb4b3a..3af2631e3fab 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -286,6 +286,7 @@ void __init setup_arch(char **cmdline_p)
286 loops_per_jiffy = 500000000 / HZ; 286 loops_per_jiffy = 500000000 / HZ;
287 287
288 unflatten_device_tree(); 288 unflatten_device_tree();
289 check_for_initrd();
289 finish_device_tree(); 290 finish_device_tree();
290 291
291 smp_setup_cpu_maps(); 292 smp_setup_cpu_maps();
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index b0994050024f..0471e843b6c5 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -41,7 +41,6 @@
41#include <asm/elf.h> 41#include <asm/elf.h>
42#include <asm/machdep.h> 42#include <asm/machdep.h>
43#include <asm/paca.h> 43#include <asm/paca.h>
44#include <asm/ppcdebug.h>
45#include <asm/time.h> 44#include <asm/time.h>
46#include <asm/cputable.h> 45#include <asm/cputable.h>
47#include <asm/sections.h> 46#include <asm/sections.h>
@@ -60,6 +59,7 @@
60#include <asm/firmware.h> 59#include <asm/firmware.h>
61#include <asm/systemcfg.h> 60#include <asm/systemcfg.h>
62#include <asm/xmon.h> 61#include <asm/xmon.h>
62#include <asm/udbg.h>
63 63
64#ifdef DEBUG 64#ifdef DEBUG
65#define DBG(fmt...) udbg_printf(fmt) 65#define DBG(fmt...) udbg_printf(fmt)
@@ -244,12 +244,6 @@ void __init early_setup(unsigned long dt_ptr)
244 DBG(" -> early_setup()\n"); 244 DBG(" -> early_setup()\n");
245 245
246 /* 246 /*
247 * Fill the default DBG level (do we want to keep
248 * that old mecanism around forever ?)
249 */
250 ppcdbg_initialize();
251
252 /*
253 * Do early initializations using the flattened device 247 * Do early initializations using the flattened device
254 * tree, like retreiving the physical memory map or 248 * tree, like retreiving the physical memory map or
255 * calculating/retreiving the hash table size 249 * calculating/retreiving the hash table size
@@ -401,43 +395,6 @@ static void __init initialize_cache_info(void)
401 DBG(" <- initialize_cache_info()\n"); 395 DBG(" <- initialize_cache_info()\n");
402} 396}
403 397
404static void __init check_for_initrd(void)
405{
406#ifdef CONFIG_BLK_DEV_INITRD
407 u64 *prop;
408
409 DBG(" -> check_for_initrd()\n");
410
411 if (of_chosen) {
412 prop = (u64 *)get_property(of_chosen,
413 "linux,initrd-start", NULL);
414 if (prop != NULL) {
415 initrd_start = (unsigned long)__va(*prop);
416 prop = (u64 *)get_property(of_chosen,
417 "linux,initrd-end", NULL);
418 if (prop != NULL) {
419 initrd_end = (unsigned long)__va(*prop);
420 initrd_below_start_ok = 1;
421 } else
422 initrd_start = 0;
423 }
424 }
425
426 /* If we were passed an initrd, set the ROOT_DEV properly if the values
427 * look sensible. If not, clear initrd reference.
428 */
429 if (initrd_start >= KERNELBASE && initrd_end >= KERNELBASE &&
430 initrd_end > initrd_start)
431 ROOT_DEV = Root_RAM0;
432 else
433 initrd_start = initrd_end = 0;
434
435 if (initrd_start)
436 printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
437
438 DBG(" <- check_for_initrd()\n");
439#endif /* CONFIG_BLK_DEV_INITRD */
440}
441 398
442/* 399/*
443 * Do some initial setup of the system. The parameters are those which 400 * Do some initial setup of the system. The parameters are those which
@@ -521,7 +478,6 @@ void __init setup_system(void)
521 478
522 printk("-----------------------------------------------------\n"); 479 printk("-----------------------------------------------------\n");
523 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 480 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
524 printk("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
525 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); 481 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
526 printk("systemcfg = 0x%p\n", systemcfg); 482 printk("systemcfg = 0x%p\n", systemcfg);
527 printk("systemcfg->platform = 0x%x\n", systemcfg->platform); 483 printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 876c57c11365..081d931eae48 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -44,7 +44,6 @@
44#include <asm/cacheflush.h> 44#include <asm/cacheflush.h>
45#ifdef CONFIG_PPC64 45#ifdef CONFIG_PPC64
46#include "ppc32.h" 46#include "ppc32.h"
47#include <asm/ppcdebug.h>
48#include <asm/unistd.h> 47#include <asm/unistd.h>
49#include <asm/vdso.h> 48#include <asm/vdso.h>
50#else 49#else
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index ec9d0984b6a0..58194e150711 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -33,7 +33,6 @@
33#include <asm/ucontext.h> 33#include <asm/ucontext.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/ppcdebug.h>
37#include <asm/unistd.h> 36#include <asm/unistd.h>
38#include <asm/cacheflush.h> 37#include <asm/cacheflush.h>
39#include <asm/vdso.h> 38#include <asm/vdso.h>
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 1794a694a928..5c330c3366e4 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -40,7 +40,6 @@
40#include <asm/prom.h> 40#include <asm/prom.h>
41#include <asm/smp.h> 41#include <asm/smp.h>
42#include <asm/time.h> 42#include <asm/time.h>
43#include <asm/xmon.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/cputable.h> 44#include <asm/cputable.h>
46#include <asm/system.h> 45#include <asm/system.h>
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b1c89bc4bf90..a6282b625b44 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -61,6 +61,7 @@
61#include <asm/prom.h> 61#include <asm/prom.h>
62#include <asm/irq.h> 62#include <asm/irq.h>
63#include <asm/div64.h> 63#include <asm/div64.h>
64#include <asm/smp.h>
64#ifdef CONFIG_PPC64 65#ifdef CONFIG_PPC64
65#include <asm/systemcfg.h> 66#include <asm/systemcfg.h>
66#include <asm/firmware.h> 67#include <asm/firmware.h>
@@ -119,10 +120,6 @@ static unsigned adjusting_time = 0;
119unsigned long ppc_proc_freq; 120unsigned long ppc_proc_freq;
120unsigned long ppc_tb_freq; 121unsigned long ppc_tb_freq;
121 122
122#ifdef CONFIG_PPC32 /* XXX for now */
123#define boot_cpuid 0
124#endif
125
126u64 tb_last_jiffy __cacheline_aligned_in_smp; 123u64 tb_last_jiffy __cacheline_aligned_in_smp;
127unsigned long tb_last_stamp; 124unsigned long tb_last_stamp;
128 125
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 07e5ee40b870..32f215825e8d 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -39,7 +39,6 @@
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/machdep.h> 40#include <asm/machdep.h>
41#include <asm/rtas.h> 41#include <asm/rtas.h>
42#include <asm/xmon.h>
43#include <asm/pmc.h> 42#include <asm/pmc.h>
44#ifdef CONFIG_PPC32 43#ifdef CONFIG_PPC32
45#include <asm/reg.h> 44#include <asm/reg.h>
@@ -748,22 +747,12 @@ static int check_bug_trap(struct pt_regs *regs)
748 return 0; 747 return 0;
749 if (bug->line & BUG_WARNING_TRAP) { 748 if (bug->line & BUG_WARNING_TRAP) {
750 /* this is a WARN_ON rather than BUG/BUG_ON */ 749 /* this is a WARN_ON rather than BUG/BUG_ON */
751#ifdef CONFIG_XMON
752 xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n",
753 bug->function, bug->file,
754 bug->line & ~BUG_WARNING_TRAP);
755#endif /* CONFIG_XMON */
756 printk(KERN_ERR "Badness in %s at %s:%ld\n", 750 printk(KERN_ERR "Badness in %s at %s:%ld\n",
757 bug->function, bug->file, 751 bug->function, bug->file,
758 bug->line & ~BUG_WARNING_TRAP); 752 bug->line & ~BUG_WARNING_TRAP);
759 dump_stack(); 753 dump_stack();
760 return 1; 754 return 1;
761 } 755 }
762#ifdef CONFIG_XMON
763 xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
764 bug->function, bug->file, bug->line);
765 xmon(regs);
766#endif /* CONFIG_XMON */
767 printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n", 756 printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n",
768 bug->function, bug->file, bug->line); 757 bug->function, bug->file, bug->line);
769 758
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c
index 2a912f411eb4..35bd03c41dd1 100644
--- a/arch/powerpc/lib/locks.c
+++ b/arch/powerpc/lib/locks.c
@@ -23,6 +23,7 @@
23#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) 23#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES)
24#include <asm/hvcall.h> 24#include <asm/hvcall.h>
25#include <asm/iseries/hv_call.h> 25#include <asm/iseries/hv_call.h>
26#include <asm/smp.h>
26 27
27void __spin_yield(raw_spinlock_t *lock) 28void __spin_yield(raw_spinlock_t *lock)
28{ 29{
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 841d8b6323a8..93d4fbfdb724 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -389,5 +389,22 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
389 } 389 }
390 390
391 /* kernel has accessed a bad area */ 391 /* kernel has accessed a bad area */
392
393 printk(KERN_ALERT "Unable to handle kernel paging request for ");
394 switch (regs->trap) {
395 case 0x300:
396 case 0x380:
397 printk("data at address 0x%08lx\n", regs->dar);
398 break;
399 case 0x400:
400 case 0x480:
401 printk("instruction fetch\n");
402 break;
403 default:
404 printk("unknown fault\n");
405 }
406 printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
407 regs->nip);
408
392 die("Kernel access of bad area", regs, sig); 409 die("Kernel access of bad area", regs, sig);
393} 410}
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index f15dfb92dec0..22e474876133 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -33,7 +33,6 @@
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/signal.h> 34#include <linux/signal.h>
35 35
36#include <asm/ppcdebug.h>
37#include <asm/processor.h> 36#include <asm/processor.h>
38#include <asm/pgtable.h> 37#include <asm/pgtable.h>
39#include <asm/mmu.h> 38#include <asm/mmu.h>
@@ -409,12 +408,6 @@ void __init htab_initialize(void)
409 htab_size_bytes = htab_get_table_size(); 408 htab_size_bytes = htab_get_table_size();
410 pteg_count = htab_size_bytes >> 7; 409 pteg_count = htab_size_bytes >> 7;
411 410
412 /* For debug, make the HTAB 1/8 as big as it normally would be. */
413 ifppcdebug(PPCDBG_HTABSIZE) {
414 pteg_count >>= 3;
415 htab_size_bytes = pteg_count << 7;
416 }
417
418 htab_hash_mask = pteg_count - 1; 411 htab_hash_mask = pteg_count - 1;
419 412
420 if (systemcfg->platform & PLATFORM_LPAR) { 413 if (systemcfg->platform & PLATFORM_LPAR) {
@@ -514,6 +507,9 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
514{ 507{
515 struct page *page; 508 struct page *page;
516 509
510 if (!pfn_valid(pte_pfn(pte)))
511 return pp;
512
517 page = pte_page(pte); 513 page = pte_page(pte);
518 514
519 /* page is dirty */ 515 /* page is dirty */
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index dfe7fa37b41a..ce974c83d88a 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -57,7 +57,6 @@
57#include <asm/processor.h> 57#include <asm/processor.h>
58#include <asm/mmzone.h> 58#include <asm/mmzone.h>
59#include <asm/cputable.h> 59#include <asm/cputable.h>
60#include <asm/ppcdebug.h>
61#include <asm/sections.h> 60#include <asm/sections.h>
62#include <asm/system.h> 61#include <asm/system.h>
63#include <asm/iommu.h> 62#include <asm/iommu.h>
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 7faa46b71f21..6f55efd9be95 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -358,7 +358,7 @@ void __init mem_init(void)
358 } 358 }
359 359
360 codesize = (unsigned long)&_sdata - (unsigned long)&_stext; 360 codesize = (unsigned long)&_sdata - (unsigned long)&_stext;
361 datasize = (unsigned long)&__init_begin - (unsigned long)&_sdata; 361 datasize = (unsigned long)&_edata - (unsigned long)&_sdata;
362 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin; 362 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
363 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start; 363 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
364 364
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 4035cad8d7f1..da09ba03c424 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -21,6 +21,7 @@
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/abs_addr.h> 22#include <asm/abs_addr.h>
23#include <asm/system.h> 23#include <asm/system.h>
24#include <asm/smp.h>
24 25
25static int numa_enabled = 1; 26static int numa_enabled = 1;
26 27
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 51b786940971..900842451bd3 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -59,7 +59,6 @@
59#include <asm/processor.h> 59#include <asm/processor.h>
60#include <asm/mmzone.h> 60#include <asm/mmzone.h>
61#include <asm/cputable.h> 61#include <asm/cputable.h>
62#include <asm/ppcdebug.h>
63#include <asm/sections.h> 62#include <asm/sections.h>
64#include <asm/system.h> 63#include <asm/system.h>
65#include <asm/iommu.h> 64#include <asm/iommu.h>
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
index 886449315847..c4ee5478427b 100644
--- a/arch/powerpc/oprofile/op_model_power4.c
+++ b/arch/powerpc/oprofile/op_model_power4.c
@@ -17,6 +17,7 @@
17#include <asm/systemcfg.h> 17#include <asm/systemcfg.h>
18#include <asm/rtas.h> 18#include <asm/rtas.h>
19#include <asm/oprofile_impl.h> 19#include <asm/oprofile_impl.h>
20#include <asm/reg.h>
20 21
21#define dbg(args...) 22#define dbg(args...)
22 23
@@ -81,6 +82,26 @@ static void power4_reg_setup(struct op_counter_config *ctr,
81 82
82extern void ppc64_enable_pmcs(void); 83extern void ppc64_enable_pmcs(void);
83 84
85/*
86 * Older CPUs require the MMCRA sample bit to be always set, but newer
87 * CPUs only want it set for some groups. Eventually we will remove all
88 * knowledge of this bit in the kernel, oprofile userspace should be
89 * setting it when required.
90 *
91 * In order to keep current installations working we force the bit for
92 * those older CPUs. Once everyone has updated their oprofile userspace we
93 * can remove this hack.
94 */
95static inline int mmcra_must_set_sample(void)
96{
97 if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) ||
98 __is_processor(PV_970) || __is_processor(PV_970FX) ||
99 __is_processor(PV_970MP))
100 return 1;
101
102 return 0;
103}
104
84static void power4_cpu_setup(void *unused) 105static void power4_cpu_setup(void *unused)
85{ 106{
86 unsigned int mmcr0 = mmcr0_val; 107 unsigned int mmcr0 = mmcr0_val;
@@ -98,7 +119,8 @@ static void power4_cpu_setup(void *unused)
98 119
99 mtspr(SPRN_MMCR1, mmcr1_val); 120 mtspr(SPRN_MMCR1, mmcr1_val);
100 121
101 mmcra |= MMCRA_SAMPLE_ENABLE; 122 if (mmcra_must_set_sample())
123 mmcra |= MMCRA_SAMPLE_ENABLE;
102 mtspr(SPRN_MMCRA, mmcra); 124 mtspr(SPRN_MMCRA, mmcra);
103 125
104 dbg("setup on cpu %d, mmcr0 %lx\n", smp_processor_id(), 126 dbg("setup on cpu %d, mmcr0 %lx\n", smp_processor_id(),
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index c1135912cc05..a06603d84a45 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -35,7 +35,6 @@
35#include <linux/irq.h> 35#include <linux/irq.h>
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37 37
38#include <asm/ppcdebug.h>
39#include <asm/iseries/hv_types.h> 38#include <asm/iseries/hv_types.h>
40#include <asm/iseries/hv_lp_event.h> 39#include <asm/iseries/hv_lp_event.h>
41#include <asm/iseries/hv_call_xm.h> 40#include <asm/iseries/hv_call_xm.h>
@@ -227,8 +226,6 @@ static void iSeries_enable_IRQ(unsigned int irq)
227 /* Unmask secondary INTA */ 226 /* Unmask secondary INTA */
228 mask = 0x80000000; 227 mask = 0x80000000;
229 HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask); 228 HvCallPci_unmaskInterrupts(bus, subBus, deviceId, mask);
230 PPCDBG(PPCDBG_BUSWALK, "iSeries_enable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
231 bus, subBus, deviceId, irq);
232} 229}
233 230
234/* This is called by iSeries_activate_IRQs */ 231/* This is called by iSeries_activate_IRQs */
@@ -310,8 +307,6 @@ static void iSeries_disable_IRQ(unsigned int irq)
310 /* Mask secondary INTA */ 307 /* Mask secondary INTA */
311 mask = 0x80000000; 308 mask = 0x80000000;
312 HvCallPci_maskInterrupts(bus, subBus, deviceId, mask); 309 HvCallPci_maskInterrupts(bus, subBus, deviceId, mask);
313 PPCDBG(PPCDBG_BUSWALK, "iSeries_disable_IRQ 0x%02X.%02X.%02X 0x%04X\n",
314 bus, subBus, deviceId, irq);
315} 310}
316 311
317/* 312/*
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 7d7d5884343f..4b75131773a6 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -32,7 +32,6 @@
32#include <asm/prom.h> 32#include <asm/prom.h>
33#include <asm/machdep.h> 33#include <asm/machdep.h>
34#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
35#include <asm/ppcdebug.h>
36#include <asm/iommu.h> 35#include <asm/iommu.h>
37#include <asm/abs_addr.h> 36#include <asm/abs_addr.h>
38 37
@@ -207,10 +206,6 @@ static struct device_node *build_device_node(HvBusNumber Bus,
207 struct device_node *node; 206 struct device_node *node;
208 struct pci_dn *pdn; 207 struct pci_dn *pdn;
209 208
210 PPCDBG(PPCDBG_BUSWALK,
211 "-build_device_node 0x%02X.%02X.%02X Function: %02X\n",
212 Bus, SubBus, AgentId, Function);
213
214 node = kmalloc(sizeof(struct device_node), GFP_KERNEL); 209 node = kmalloc(sizeof(struct device_node), GFP_KERNEL);
215 if (node == NULL) 210 if (node == NULL)
216 return NULL; 211 return NULL;
@@ -243,8 +238,6 @@ unsigned long __init find_and_init_phbs(void)
243 struct pci_controller *phb; 238 struct pci_controller *phb;
244 HvBusNumber bus; 239 HvBusNumber bus;
245 240
246 PPCDBG(PPCDBG_BUSWALK, "find_and_init_phbs Entry\n");
247
248 /* Check all possible buses. */ 241 /* Check all possible buses. */
249 for (bus = 0; bus < 256; bus++) { 242 for (bus = 0; bus < 256; bus++) {
250 int ret = HvCallXm_testBus(bus); 243 int ret = HvCallXm_testBus(bus);
@@ -261,9 +254,6 @@ unsigned long __init find_and_init_phbs(void)
261 phb->last_busno = bus; 254 phb->last_busno = bus;
262 phb->ops = &iSeries_pci_ops; 255 phb->ops = &iSeries_pci_ops;
263 256
264 PPCDBG(PPCDBG_BUSWALK, "PCI:Create iSeries pci_controller(%p), Bus: %04X\n",
265 phb, bus);
266
267 /* Find and connect the devices. */ 257 /* Find and connect the devices. */
268 scan_PHB_slots(phb); 258 scan_PHB_slots(phb);
269 } 259 }
@@ -285,11 +275,9 @@ unsigned long __init find_and_init_phbs(void)
285 */ 275 */
286void iSeries_pcibios_init(void) 276void iSeries_pcibios_init(void)
287{ 277{
288 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Entry.\n");
289 iomm_table_initialize(); 278 iomm_table_initialize();
290 find_and_init_phbs(); 279 find_and_init_phbs();
291 io_page_mask = -1; 280 io_page_mask = -1;
292 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_init Exit.\n");
293} 281}
294 282
295/* 283/*
@@ -301,8 +289,6 @@ void __init iSeries_pci_final_fixup(void)
301 struct device_node *node; 289 struct device_node *node;
302 int DeviceCount = 0; 290 int DeviceCount = 0;
303 291
304 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n");
305
306 /* Fix up at the device node and pci_dev relationship */ 292 /* Fix up at the device node and pci_dev relationship */
307 mf_display_src(0xC9000100); 293 mf_display_src(0xC9000100);
308 294
@@ -316,9 +302,6 @@ void __init iSeries_pci_final_fixup(void)
316 ++DeviceCount; 302 ++DeviceCount;
317 pdev->sysdata = (void *)node; 303 pdev->sysdata = (void *)node;
318 PCI_DN(node)->pcidev = pdev; 304 PCI_DN(node)->pcidev = pdev;
319 PPCDBG(PPCDBG_BUSWALK,
320 "pdev 0x%p <==> DevNode 0x%p\n",
321 pdev, node);
322 allocate_device_bars(pdev); 305 allocate_device_bars(pdev);
323 iSeries_Device_Information(pdev, DeviceCount); 306 iSeries_Device_Information(pdev, DeviceCount);
324 iommu_devnode_init_iSeries(node); 307 iommu_devnode_init_iSeries(node);
@@ -333,13 +316,10 @@ void __init iSeries_pci_final_fixup(void)
333 316
334void pcibios_fixup_bus(struct pci_bus *PciBus) 317void pcibios_fixup_bus(struct pci_bus *PciBus)
335{ 318{
336 PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup_bus(0x%04X) Entry.\n",
337 PciBus->number);
338} 319}
339 320
340void pcibios_fixup_resources(struct pci_dev *pdev) 321void pcibios_fixup_resources(struct pci_dev *pdev)
341{ 322{
342 PPCDBG(PPCDBG_BUSWALK, "fixup_resources pdev %p\n", pdev);
343} 323}
344 324
345/* 325/*
@@ -401,9 +381,6 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
401 printk("found device at bus %d idsel %d func %d (AgentId %x)\n", 381 printk("found device at bus %d idsel %d func %d (AgentId %x)\n",
402 bus, IdSel, Function, AgentId); 382 bus, IdSel, Function, AgentId);
403 /* Connect EADs: 0x18.00.12 = 0x00 */ 383 /* Connect EADs: 0x18.00.12 = 0x00 */
404 PPCDBG(PPCDBG_BUSWALK,
405 "PCI:Connect EADs: 0x%02X.%02X.%02X\n",
406 bus, SubBus, AgentId);
407 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId, 384 HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
408 iseries_hv_addr(BridgeInfo), 385 iseries_hv_addr(BridgeInfo),
409 sizeof(struct HvCallPci_BridgeInfo)); 386 sizeof(struct HvCallPci_BridgeInfo));
@@ -414,14 +391,6 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
414 BridgeInfo->maxAgents, 391 BridgeInfo->maxAgents,
415 BridgeInfo->maxSubBusNumber, 392 BridgeInfo->maxSubBusNumber,
416 BridgeInfo->logicalSlotNumber); 393 BridgeInfo->logicalSlotNumber);
417 PPCDBG(PPCDBG_BUSWALK,
418 "PCI: BridgeInfo, Type:0x%02X, SubBus:0x%02X, MaxAgents:0x%02X, MaxSubBus: 0x%02X, LSlot: 0x%02X\n",
419 BridgeInfo->busUnitInfo.deviceType,
420 BridgeInfo->subBusNumber,
421 BridgeInfo->maxAgents,
422 BridgeInfo->maxSubBusNumber,
423 BridgeInfo->logicalSlotNumber);
424
425 if (BridgeInfo->busUnitInfo.deviceType == 394 if (BridgeInfo->busUnitInfo.deviceType ==
426 HvCallPci_BridgeDevice) { 395 HvCallPci_BridgeDevice) {
427 /* Scan_Bridge_Slot...: 0x18.00.12 */ 396 /* Scan_Bridge_Slot...: 0x18.00.12 */
@@ -454,9 +423,6 @@ static int scan_bridge_slot(HvBusNumber Bus,
454 423
455 /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */ 424 /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */
456 Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel); 425 Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel);
457 PPCDBG(PPCDBG_BUSWALK,
458 "PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n",
459 Bus, 0, EADsIdSel, Irq);
460 426
461 /* 427 /*
462 * Connect all functions of any device found. 428 * Connect all functions of any device found.
@@ -482,9 +448,6 @@ static int scan_bridge_slot(HvBusNumber Bus,
482 printk("read vendor ID: %x\n", VendorId); 448 printk("read vendor ID: %x\n", VendorId);
483 449
484 /* FoundDevice: 0x18.28.10 = 0x12AE */ 450 /* FoundDevice: 0x18.28.10 = 0x12AE */
485 PPCDBG(PPCDBG_BUSWALK,
486 "PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X, irq %d\n",
487 Bus, SubBus, AgentId, VendorId, Irq);
488 HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId, 451 HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId,
489 PCI_INTERRUPT_LINE, Irq); 452 PCI_INTERRUPT_LINE, Irq);
490 if (HvRc != 0) 453 if (HvRc != 0)
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index c5207064977d..d3e4bf756c83 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -71,8 +71,6 @@ extern void hvlog(char *fmt, ...);
71#endif 71#endif
72 72
73/* Function Prototypes */ 73/* Function Prototypes */
74extern void ppcdbg_initialize(void);
75
76static void build_iSeries_Memory_Map(void); 74static void build_iSeries_Memory_Map(void);
77static void iseries_shared_idle(void); 75static void iseries_shared_idle(void);
78static void iseries_dedicated_idle(void); 76static void iseries_dedicated_idle(void);
@@ -309,8 +307,6 @@ static void __init iSeries_init_early(void)
309 307
310 ppc64_firmware_features = FW_FEATURE_ISERIES; 308 ppc64_firmware_features = FW_FEATURE_ISERIES;
311 309
312 ppcdbg_initialize();
313
314 ppc64_interrupt_controller = IC_ISERIES; 310 ppc64_interrupt_controller = IC_ISERIES;
315 311
316#if defined(CONFIG_BLK_DEV_INITRD) 312#if defined(CONFIG_BLK_DEV_INITRD)
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index 3336bad67724..fcb094ec6aec 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -40,7 +40,6 @@
40#include <asm/paca.h> 40#include <asm/paca.h>
41#include <asm/iseries/hv_call.h> 41#include <asm/iseries/hv_call.h>
42#include <asm/time.h> 42#include <asm/time.h>
43#include <asm/ppcdebug.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/cputable.h> 44#include <asm/cputable.h>
46#include <asm/system.h> 45#include <asm/system.h>
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index 4369676f1d54..c9df44fcf571 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -1,7 +1,8 @@
1obj-y += pic.o setup.o time.o feature.o pci.o \ 1obj-y += pic.o setup.o time.o feature.o pci.o \
2 sleep.o low_i2c.o cache.o 2 sleep.o low_i2c.o cache.o
3obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o 3obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o
4obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq.o 4obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o
5obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o
5obj-$(CONFIG_NVRAM) += nvram.o 6obj-$(CONFIG_NVRAM) += nvram.o
6# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff 7# ppc64 pmac doesn't define CONFIG_NVRAM but needs nvram stuff
7obj-$(CONFIG_PPC64) += nvram.o 8obj-$(CONFIG_PPC64) += nvram.o
diff --git a/arch/powerpc/platforms/powermac/cpufreq.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index c47f8b69725c..56fd4e05fede 100644
--- a/arch/powerpc/platforms/powermac/cpufreq.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -397,18 +397,16 @@ static int pmac_cpufreq_target( struct cpufreq_policy *policy,
397 unsigned int relation) 397 unsigned int relation)
398{ 398{
399 unsigned int newstate = 0; 399 unsigned int newstate = 0;
400 int rc;
400 401
401 if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs, 402 if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs,
402 target_freq, relation, &newstate)) 403 target_freq, relation, &newstate))
403 return -EINVAL; 404 return -EINVAL;
404 405
405 return do_set_cpu_speed(newstate, 1); 406 rc = do_set_cpu_speed(newstate, 1);
406}
407 407
408unsigned int pmac_get_one_cpufreq(int i) 408 ppc_proc_freq = cur_freq * 1000ul;
409{ 409 return rc;
410 /* Supports only one CPU for now */
411 return (i == 0) ? cur_freq : 0;
412} 410}
413 411
414static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) 412static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
@@ -474,6 +472,8 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
474 do_set_cpu_speed(sleep_freq == low_freq ? 472 do_set_cpu_speed(sleep_freq == low_freq ?
475 CPUFREQ_LOW : CPUFREQ_HIGH, 0); 473 CPUFREQ_LOW : CPUFREQ_HIGH, 0);
476 474
475 ppc_proc_freq = cur_freq * 1000ul;
476
477 no_schedule = 0; 477 no_schedule = 0;
478 return 0; 478 return 0;
479} 479}
@@ -547,7 +547,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
547 */ 547 */
548 if (low_freq < 98000000) 548 if (low_freq < 98000000)
549 low_freq = 101000000; 549 low_freq = 101000000;
550 550
551 /* Convert those to CPU core clocks */ 551 /* Convert those to CPU core clocks */
552 low_freq = (low_freq * (*ratio)) / 2000; 552 low_freq = (low_freq * (*ratio)) / 2000;
553 hi_freq = (hi_freq * (*ratio)) / 2000; 553 hi_freq = (hi_freq * (*ratio)) / 2000;
@@ -714,6 +714,7 @@ out:
714 714
715 pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq; 715 pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq;
716 pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq; 716 pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq;
717 ppc_proc_freq = cur_freq * 1000ul;
717 718
718 printk(KERN_INFO "Registering PowerMac CPU frequency driver\n"); 719 printk(KERN_INFO "Registering PowerMac CPU frequency driver\n");
719 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n", 720 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n",
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
new file mode 100644
index 000000000000..39150342c6f1
--- /dev/null
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -0,0 +1,323 @@
1/*
2 * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
3 * and Markus Demleitner <msdemlei@cl.uni-heidelberg.de>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This driver adds basic cpufreq support for SMU & 970FX based G5 Macs,
10 * that is iMac G5 and latest single CPU desktop.
11 */
12
13#include <linux/config.h>
14#include <linux/module.h>
15#include <linux/types.h>
16#include <linux/errno.h>
17#include <linux/kernel.h>
18#include <linux/delay.h>
19#include <linux/sched.h>
20#include <linux/slab.h>
21#include <linux/cpufreq.h>
22#include <linux/init.h>
23#include <linux/completion.h>
24#include <asm/prom.h>
25#include <asm/machdep.h>
26#include <asm/irq.h>
27#include <asm/sections.h>
28#include <asm/cputable.h>
29#include <asm/time.h>
30#include <asm/smu.h>
31
32#undef DEBUG
33
34#ifdef DEBUG
35#define DBG(fmt...) printk(fmt)
36#else
37#define DBG(fmt...)
38#endif
39
40/* see 970FX user manual */
41
42#define SCOM_PCR 0x0aa001 /* PCR scom addr */
43
44#define PCR_HILO_SELECT 0x80000000U /* 1 = PCR, 0 = PCRH */
45#define PCR_SPEED_FULL 0x00000000U /* 1:1 speed value */
46#define PCR_SPEED_HALF 0x00020000U /* 1:2 speed value */
47#define PCR_SPEED_QUARTER 0x00040000U /* 1:4 speed value */
48#define PCR_SPEED_MASK 0x000e0000U /* speed mask */
49#define PCR_SPEED_SHIFT 17
50#define PCR_FREQ_REQ_VALID 0x00010000U /* freq request valid */
51#define PCR_VOLT_REQ_VALID 0x00008000U /* volt request valid */
52#define PCR_TARGET_TIME_MASK 0x00006000U /* target time */
53#define PCR_STATLAT_MASK 0x00001f00U /* STATLAT value */
54#define PCR_SNOOPLAT_MASK 0x000000f0U /* SNOOPLAT value */
55#define PCR_SNOOPACC_MASK 0x0000000fU /* SNOOPACC value */
56
57#define SCOM_PSR 0x408001 /* PSR scom addr */
58/* warning: PSR is a 64 bits register */
59#define PSR_CMD_RECEIVED 0x2000000000000000U /* command received */
60#define PSR_CMD_COMPLETED 0x1000000000000000U /* command completed */
61#define PSR_CUR_SPEED_MASK 0x0300000000000000U /* current speed */
62#define PSR_CUR_SPEED_SHIFT (56)
63
64/*
65 * The G5 only supports two frequencies (Quarter speed is not supported)
66 */
67#define CPUFREQ_HIGH 0
68#define CPUFREQ_LOW 1
69
70static struct cpufreq_frequency_table g5_cpu_freqs[] = {
71 {CPUFREQ_HIGH, 0},
72 {CPUFREQ_LOW, 0},
73 {0, CPUFREQ_TABLE_END},
74};
75
76static struct freq_attr* g5_cpu_freqs_attr[] = {
77 &cpufreq_freq_attr_scaling_available_freqs,
78 NULL,
79};
80
81/* Power mode data is an array of the 32 bits PCR values to use for
82 * the various frequencies, retreived from the device-tree
83 */
84static u32 *g5_pmode_data;
85static int g5_pmode_max;
86static int g5_pmode_cur;
87
88static DECLARE_MUTEX(g5_switch_mutex);
89
90
91static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */
92static int g5_fvt_count; /* number of op. points */
93static int g5_fvt_cur; /* current op. point */
94
95/* ----------------- real hardware interface */
96
97static void g5_switch_volt(int speed_mode)
98{
99 struct smu_simple_cmd cmd;
100
101 DECLARE_COMPLETION(comp);
102 smu_queue_simple(&cmd, SMU_CMD_POWER_COMMAND, 8, smu_done_complete,
103 &comp, 'V', 'S', 'L', 'E', 'W',
104 0xff, g5_fvt_cur+1, speed_mode);
105 wait_for_completion(&comp);
106}
107
108static int g5_switch_freq(int speed_mode)
109{
110 struct cpufreq_freqs freqs;
111 int to;
112
113 if (g5_pmode_cur == speed_mode)
114 return 0;
115
116 down(&g5_switch_mutex);
117
118 freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency;
119 freqs.new = g5_cpu_freqs[speed_mode].frequency;
120 freqs.cpu = 0;
121
122 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
123
124 /* If frequency is going up, first ramp up the voltage */
125 if (speed_mode < g5_pmode_cur)
126 g5_switch_volt(speed_mode);
127
128 /* Clear PCR high */
129 scom970_write(SCOM_PCR, 0);
130 /* Clear PCR low */
131 scom970_write(SCOM_PCR, PCR_HILO_SELECT | 0);
132 /* Set PCR low */
133 scom970_write(SCOM_PCR, PCR_HILO_SELECT |
134 g5_pmode_data[speed_mode]);
135
136 /* Wait for completion */
137 for (to = 0; to < 10; to++) {
138 unsigned long psr = scom970_read(SCOM_PSR);
139
140 if ((psr & PSR_CMD_RECEIVED) == 0 &&
141 (((psr >> PSR_CUR_SPEED_SHIFT) ^
142 (g5_pmode_data[speed_mode] >> PCR_SPEED_SHIFT)) & 0x3)
143 == 0)
144 break;
145 if (psr & PSR_CMD_COMPLETED)
146 break;
147 udelay(100);
148 }
149
150 /* If frequency is going down, last ramp the voltage */
151 if (speed_mode > g5_pmode_cur)
152 g5_switch_volt(speed_mode);
153
154 g5_pmode_cur = speed_mode;
155 ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul;
156
157 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
158
159 up(&g5_switch_mutex);
160
161 return 0;
162}
163
164static int g5_query_freq(void)
165{
166 unsigned long psr = scom970_read(SCOM_PSR);
167 int i;
168
169 for (i = 0; i <= g5_pmode_max; i++)
170 if ((((psr >> PSR_CUR_SPEED_SHIFT) ^
171 (g5_pmode_data[i] >> PCR_SPEED_SHIFT)) & 0x3) == 0)
172 break;
173 return i;
174}
175
176/* ----------------- cpufreq bookkeeping */
177
178static int g5_cpufreq_verify(struct cpufreq_policy *policy)
179{
180 return cpufreq_frequency_table_verify(policy, g5_cpu_freqs);
181}
182
183static int g5_cpufreq_target(struct cpufreq_policy *policy,
184 unsigned int target_freq, unsigned int relation)
185{
186 unsigned int newstate = 0;
187
188 if (cpufreq_frequency_table_target(policy, g5_cpu_freqs,
189 target_freq, relation, &newstate))
190 return -EINVAL;
191
192 return g5_switch_freq(newstate);
193}
194
195static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
196{
197 return g5_cpu_freqs[g5_pmode_cur].frequency;
198}
199
200static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
201{
202 if (policy->cpu != 0)
203 return -ENODEV;
204
205 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
206 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
207 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
208 cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
209
210 return cpufreq_frequency_table_cpuinfo(policy,
211 g5_cpu_freqs);
212}
213
214
215static struct cpufreq_driver g5_cpufreq_driver = {
216 .name = "powermac",
217 .owner = THIS_MODULE,
218 .flags = CPUFREQ_CONST_LOOPS,
219 .init = g5_cpufreq_cpu_init,
220 .verify = g5_cpufreq_verify,
221 .target = g5_cpufreq_target,
222 .get = g5_cpufreq_get_speed,
223 .attr = g5_cpu_freqs_attr,
224};
225
226
227static int __init g5_cpufreq_init(void)
228{
229 struct device_node *cpunode;
230 unsigned int psize, ssize;
231 struct smu_sdbp_header *shdr;
232 unsigned long max_freq;
233 u32 *valp;
234 int rc = -ENODEV;
235
236 /* Look for CPU and SMU nodes */
237 cpunode = of_find_node_by_type(NULL, "cpu");
238 if (!cpunode) {
239 DBG("No CPU node !\n");
240 return -ENODEV;
241 }
242
243 /* Check 970FX for now */
244 valp = (u32 *)get_property(cpunode, "cpu-version", NULL);
245 if (!valp) {
246 DBG("No cpu-version property !\n");
247 goto bail_noprops;
248 }
249 if (((*valp) >> 16) != 0x3c) {
250 DBG("Wrong CPU version: %08x\n", *valp);
251 goto bail_noprops;
252 }
253
254 /* Look for the powertune data in the device-tree */
255 g5_pmode_data = (u32 *)get_property(cpunode, "power-mode-data",&psize);
256 if (!g5_pmode_data) {
257 DBG("No power-mode-data !\n");
258 goto bail_noprops;
259 }
260 g5_pmode_max = psize / sizeof(u32) - 1;
261
262 /* Look for the FVT table */
263 shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL);
264 if (!shdr)
265 goto bail_noprops;
266 g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1];
267 ssize = (shdr->len * sizeof(u32)) - sizeof(struct smu_sdbp_header);
268 g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt);
269 g5_fvt_cur = 0;
270
271 /* Sanity checking */
272 if (g5_fvt_count < 1 || g5_pmode_max < 1)
273 goto bail_noprops;
274
275 /*
276 * From what I see, clock-frequency is always the maximal frequency.
277 * The current driver can not slew sysclk yet, so we really only deal
278 * with powertune steps for now. We also only implement full freq and
279 * half freq in this version. So far, I haven't yet seen a machine
280 * supporting anything else.
281 */
282 valp = (u32 *)get_property(cpunode, "clock-frequency", NULL);
283 if (!valp)
284 return -ENODEV;
285 max_freq = (*valp)/1000;
286 g5_cpu_freqs[0].frequency = max_freq;
287 g5_cpu_freqs[1].frequency = max_freq/2;
288
289 /* Check current frequency */
290 g5_pmode_cur = g5_query_freq();
291 if (g5_pmode_cur > 1)
292 /* We don't support anything but 1:1 and 1:2, fixup ... */
293 g5_pmode_cur = 1;
294
295 /* Force apply current frequency to make sure everything is in
296 * sync (voltage is right for example). Firmware may leave us with
297 * a strange setting ...
298 */
299 g5_switch_freq(g5_pmode_cur);
300
301 printk(KERN_INFO "Registering G5 CPU frequency driver\n");
302 printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n",
303 g5_cpu_freqs[1].frequency/1000,
304 g5_cpu_freqs[0].frequency/1000,
305 g5_cpu_freqs[g5_pmode_cur].frequency/1000);
306
307 rc = cpufreq_register_driver(&g5_cpufreq_driver);
308
309 /* We keep the CPU node on hold... hopefully, Apple G5 don't have
310 * hotplug CPU with a dynamic device-tree ...
311 */
312 return rc;
313
314 bail_noprops:
315 of_node_put(cpunode);
316
317 return rc;
318}
319
320module_init(g5_cpufreq_init);
321
322
323MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 80b58c1ec412..7acb0546671f 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -193,18 +193,6 @@ static void pmac_show_cpuinfo(struct seq_file *m)
193 pmac_newworld ? "NewWorld" : "OldWorld"); 193 pmac_newworld ? "NewWorld" : "OldWorld");
194} 194}
195 195
196static void pmac_show_percpuinfo(struct seq_file *m, int i)
197{
198#ifdef CONFIG_CPU_FREQ_PMAC
199 extern unsigned int pmac_get_one_cpufreq(int i);
200 unsigned int freq = pmac_get_one_cpufreq(i);
201 if (freq != 0) {
202 seq_printf(m, "clock\t\t: %dMHz\n", freq/1000);
203 return;
204 }
205#endif /* CONFIG_CPU_FREQ_PMAC */
206}
207
208#ifndef CONFIG_ADB_CUDA 196#ifndef CONFIG_ADB_CUDA
209int find_via_cuda(void) 197int find_via_cuda(void)
210{ 198{
@@ -767,7 +755,6 @@ struct machdep_calls __initdata pmac_md = {
767 .setup_arch = pmac_setup_arch, 755 .setup_arch = pmac_setup_arch,
768 .init_early = pmac_init_early, 756 .init_early = pmac_init_early,
769 .show_cpuinfo = pmac_show_cpuinfo, 757 .show_cpuinfo = pmac_show_cpuinfo,
770 .show_percpuinfo = pmac_show_percpuinfo,
771 .init_IRQ = pmac_pic_init, 758 .init_IRQ = pmac_pic_init,
772 .get_irq = mpic_get_irq, /* changed later */ 759 .get_irq = mpic_get_irq, /* changed later */
773 .pcibios_fixup = pmac_pcibios_fixup, 760 .pcibios_fixup = pmac_pcibios_fixup,
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 513e27231493..fcc50bfd43fd 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -37,7 +37,6 @@
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/prom.h> 38#include <asm/prom.h>
39#include <asm/rtas.h> 39#include <asm/rtas.h>
40#include <asm/ppcdebug.h>
41#include <asm/iommu.h> 40#include <asm/iommu.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
43#include <asm/machdep.h> 42#include <asm/machdep.h>
@@ -47,6 +46,7 @@
47#include <asm/firmware.h> 46#include <asm/firmware.h>
48#include <asm/tce.h> 47#include <asm/tce.h>
49#include <asm/ppc-pci.h> 48#include <asm/ppc-pci.h>
49#include <asm/udbg.h>
50 50
51#include "plpar_wrappers.h" 51#include "plpar_wrappers.h"
52 52
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index ab0c6dd6ec94..a50e5f3f396d 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -31,13 +31,14 @@
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/abs_addr.h> 32#include <asm/abs_addr.h>
33#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
34#include <asm/ppcdebug.h>
35#include <asm/iommu.h> 34#include <asm/iommu.h>
36#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
37#include <asm/tlb.h> 36#include <asm/tlb.h>
38#include <asm/prom.h> 37#include <asm/prom.h>
39#include <asm/abs_addr.h> 38#include <asm/abs_addr.h>
40#include <asm/cputable.h> 39#include <asm/cputable.h>
40#include <asm/udbg.h>
41#include <asm/smp.h>
41 42
42#include "plpar_wrappers.h" 43#include "plpar_wrappers.h"
43 44
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index 382f8c5b0e7c..3bd1b3e06003 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -107,14 +107,4 @@ static inline long plpar_put_term_char(unsigned long termno, unsigned long len,
107 lbuf[1]); 107 lbuf[1]);
108} 108}
109 109
110static inline long plpar_set_xdabr(unsigned long address, unsigned long flags)
111{
112 return plpar_hcall_norets(H_SET_XDABR, address, flags);
113}
114
115static inline long plpar_set_dabr(unsigned long val)
116{
117 return plpar_hcall_norets(H_SET_DABR, val);
118}
119
120#endif /* _PSERIES_PLPAR_WRAPPERS_H */ 110#endif /* _PSERIES_PLPAR_WRAPPERS_H */
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 6562ff4b0a82..fbd214d68b07 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -48,7 +48,7 @@
48#include <asm/ptrace.h> 48#include <asm/ptrace.h>
49#include <asm/machdep.h> 49#include <asm/machdep.h>
50#include <asm/rtas.h> 50#include <asm/rtas.h>
51#include <asm/ppcdebug.h> 51#include <asm/udbg.h>
52 52
53static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; 53static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];
54static DEFINE_SPINLOCK(ras_log_buf_lock); 54static DEFINE_SPINLOCK(ras_log_buf_lock);
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 65bee939eecc..e78c39368841 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -65,6 +65,7 @@
65#include <asm/ppc-pci.h> 65#include <asm/ppc-pci.h>
66#include <asm/i8259.h> 66#include <asm/i8259.h>
67#include <asm/udbg.h> 67#include <asm/udbg.h>
68#include <asm/smp.h>
68 69
69#include "plpar_wrappers.h" 70#include "plpar_wrappers.h"
70 71
@@ -353,14 +354,15 @@ static void pSeries_mach_cpu_die(void)
353 354
354static int pseries_set_dabr(unsigned long dabr) 355static int pseries_set_dabr(unsigned long dabr)
355{ 356{
356 if (firmware_has_feature(FW_FEATURE_XDABR)) { 357 return plpar_hcall_norets(H_SET_DABR, dabr);
357 /* We want to catch accesses from kernel and userspace */
358 return plpar_set_xdabr(dabr, H_DABRX_KERNEL | H_DABRX_USER);
359 }
360
361 return plpar_set_dabr(dabr);
362} 358}
363 359
360static int pseries_set_xdabr(unsigned long dabr)
361{
362 /* We want to catch accesses from kernel and userspace */
363 return plpar_hcall_norets(H_SET_XDABR, dabr,
364 H_DABRX_KERNEL | H_DABRX_USER);
365}
364 366
365/* 367/*
366 * Early initialization. Relocation is on but do not reference unbolted pages 368 * Early initialization. Relocation is on but do not reference unbolted pages
@@ -396,8 +398,10 @@ static void __init pSeries_init_early(void)
396 DBG("Hello World !\n"); 398 DBG("Hello World !\n");
397 } 399 }
398 400
399 if (firmware_has_feature(FW_FEATURE_XDABR | FW_FEATURE_DABR)) 401 if (firmware_has_feature(FW_FEATURE_DABR))
400 ppc_md.set_dabr = pseries_set_dabr; 402 ppc_md.set_dabr = pseries_set_dabr;
403 else if (firmware_has_feature(FW_FEATURE_XDABR))
404 ppc_md.set_dabr = pseries_set_xdabr;
401 405
402 iommu_init_early_pSeries(); 406 iommu_init_early_pSeries();
403 407
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index 90bce6e0c191..b7ac32fdd776 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -207,6 +207,9 @@ void __init i8259_init(unsigned long intack_addr, int offset)
207 207
208 spin_unlock_irqrestore(&i8259_lock, flags); 208 spin_unlock_irqrestore(&i8259_lock, flags);
209 209
210 for (i = 0; i < NUM_ISA_INTERRUPTS; ++i)
211 irq_desc[offset + i].handler = &i8259_pic;
212
210 /* reserve our resources */ 213 /* reserve our resources */
211 setup_irq(offset + 2, &i8259_irqaction); 214 setup_irq(offset + 2, &i8259_irqaction);
212 request_resource(&ioport_resource, &pic1_iores); 215 request_resource(&ioport_resource, &pic1_iores);
@@ -216,6 +219,4 @@ void __init i8259_init(unsigned long intack_addr, int offset)
216 if (intack_addr != 0) 219 if (intack_addr != 0)
217 pci_intack = ioremap(intack_addr, 1); 220 pci_intack = ioremap(intack_addr, 1);
218 221
219 for (i = 0; i < NUM_ISA_INTERRUPTS; ++i)
220 irq_desc[offset + i].handler = &i8259_pic;
221} 222}
diff --git a/arch/powerpc/sysdev/u3_iommu.c b/arch/powerpc/sysdev/u3_iommu.c
index 607722178c1a..543d65909812 100644
--- a/arch/powerpc/sysdev/u3_iommu.c
+++ b/arch/powerpc/sysdev/u3_iommu.c
@@ -37,7 +37,6 @@
37#include <linux/vmalloc.h> 37#include <linux/vmalloc.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/prom.h> 39#include <asm/prom.h>
40#include <asm/ppcdebug.h>
41#include <asm/iommu.h> 40#include <asm/iommu.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
43#include <asm/machdep.h> 42#include <asm/machdep.h>