aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-11 19:09:49 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-11 19:09:49 -0400
commit75ecb1a4d148b274aa9acd1d6ccaca0a4654784e (patch)
tree7fa39362bfb1a4dbd3f4227f98b85c2e5d36d398
parent73819b2d26aeb7719bb501c0136687b89d5ac3ef (diff)
parentd1f5a77f2c9db5b8a565eabdf8b534b02e32cc44 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: [POWERPC] Fix size check for hugetlbfs [POWERPC] Fix initialization and usage of dma_mask [POWERPC] Fix more section mismatches in head_64.S [POWERPC] Revert "[POWERPC] Add 'mdio' to bus scan id list for platforms with QE UEC" [POWERPC] PS3: Update ps3_defconfig [POWERPC] PS3: Remove text saying PS3 support is incomplete [POWERPC] PS3: Fix storage probe logic [POWERPC] cell: Move SPU affinity init to spu_management_of_ops [POWERPC] Fix potential duplicate entry in SLB shadow buffer
-rw-r--r--arch/powerpc/configs/ps3_defconfig200
-rw-r--r--arch/powerpc/kernel/head_64.S16
-rw-r--r--arch/powerpc/kernel/pci_64.c1
-rw-r--r--arch/powerpc/mm/slb.c45
-rw-r--r--arch/powerpc/mm/slice.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c141
-rw-r--r--arch/powerpc/platforms/cell/spu_manage.c163
-rw-r--r--arch/powerpc/platforms/ps3/Kconfig10
-rw-r--r--arch/powerpc/platforms/ps3/device-init.c37
-rw-r--r--arch/powerpc/platforms/ps3/spu.c6
-rw-r--r--include/asm-powerpc/dma-mapping.h2
-rw-r--r--include/asm-powerpc/spu_priv1.h7
16 files changed, 295 insertions, 339 deletions
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index d0b43df44426..ca7a197998ee 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -1,9 +1,23 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.22-rc6 3# Linux kernel version: 2.6.23-rc2
4# Tue Jun 26 14:15:19 2007 4# Tue Aug 7 19:17:26 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7
8#
9# Processor support
10#
11# CONFIG_POWER4_ONLY is not set
12CONFIG_POWER3=y
13CONFIG_POWER4=y
14CONFIG_PPC_FPU=y
15CONFIG_ALTIVEC=y
16CONFIG_PPC_STD_MMU=y
17# CONFIG_PPC_MM_SLICES is not set
18CONFIG_VIRT_CPU_ACCOUNTING=y
19CONFIG_SMP=y
20CONFIG_NR_CPUS=2
7CONFIG_64BIT=y 21CONFIG_64BIT=y
8CONFIG_PPC_MERGE=y 22CONFIG_PPC_MERGE=y
9CONFIG_MMU=y 23CONFIG_MMU=y
@@ -15,6 +29,7 @@ CONFIG_ARCH_HAS_ILOG2_U64=y
15CONFIG_GENERIC_HWEIGHT=y 29CONFIG_GENERIC_HWEIGHT=y
16CONFIG_GENERIC_CALIBRATE_DELAY=y 30CONFIG_GENERIC_CALIBRATE_DELAY=y
17CONFIG_GENERIC_FIND_NEXT_BIT=y 31CONFIG_GENERIC_FIND_NEXT_BIT=y
32CONFIG_ARCH_NO_VIRT_TO_BUS=y
18CONFIG_PPC=y 33CONFIG_PPC=y
19CONFIG_EARLY_PRINTK=y 34CONFIG_EARLY_PRINTK=y
20CONFIG_COMPAT=y 35CONFIG_COMPAT=y
@@ -22,50 +37,32 @@ CONFIG_SYSVIPC_COMPAT=y
22CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 37CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
23CONFIG_ARCH_MAY_HAVE_PC_FDC=y 38CONFIG_ARCH_MAY_HAVE_PC_FDC=y
24CONFIG_PPC_OF=y 39CONFIG_PPC_OF=y
40CONFIG_OF=y
25# CONFIG_PPC_UDBG_16550 is not set 41# CONFIG_PPC_UDBG_16550 is not set
26# CONFIG_GENERIC_TBSYNC is not set 42# CONFIG_GENERIC_TBSYNC is not set
27CONFIG_AUDIT_ARCH=y 43CONFIG_AUDIT_ARCH=y
28CONFIG_GENERIC_BUG=y 44CONFIG_GENERIC_BUG=y
29# CONFIG_DEFAULT_UIMAGE is not set 45# CONFIG_DEFAULT_UIMAGE is not set
30
31#
32# Processor support
33#
34# CONFIG_POWER4_ONLY is not set
35CONFIG_POWER3=y
36CONFIG_POWER4=y
37CONFIG_PPC_FPU=y
38# CONFIG_PPC_DCR_NATIVE is not set 46# CONFIG_PPC_DCR_NATIVE is not set
39# CONFIG_PPC_DCR_MMIO is not set 47# CONFIG_PPC_DCR_MMIO is not set
40# CONFIG_PPC_OF_PLATFORM_PCI is not set 48# CONFIG_PPC_OF_PLATFORM_PCI is not set
41CONFIG_ALTIVEC=y
42CONFIG_PPC_STD_MMU=y
43# CONFIG_PPC_MM_SLICES is not set
44CONFIG_VIRT_CPU_ACCOUNTING=y
45CONFIG_SMP=y
46CONFIG_NR_CPUS=2
47CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 49CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
48 50
49# 51#
50# Code maturity level options 52# General setup
51# 53#
52CONFIG_EXPERIMENTAL=y 54CONFIG_EXPERIMENTAL=y
53CONFIG_LOCK_KERNEL=y 55CONFIG_LOCK_KERNEL=y
54CONFIG_INIT_ENV_ARG_LIMIT=32 56CONFIG_INIT_ENV_ARG_LIMIT=32
55
56#
57# General setup
58#
59CONFIG_LOCALVERSION="" 57CONFIG_LOCALVERSION=""
60CONFIG_LOCALVERSION_AUTO=y 58CONFIG_LOCALVERSION_AUTO=y
61CONFIG_SWAP=y 59CONFIG_SWAP=y
62CONFIG_SYSVIPC=y 60CONFIG_SYSVIPC=y
63# CONFIG_IPC_NS is not set
64CONFIG_SYSVIPC_SYSCTL=y 61CONFIG_SYSVIPC_SYSCTL=y
65# CONFIG_POSIX_MQUEUE is not set 62# CONFIG_POSIX_MQUEUE is not set
66# CONFIG_BSD_PROCESS_ACCT is not set 63# CONFIG_BSD_PROCESS_ACCT is not set
67# CONFIG_TASKSTATS is not set 64# CONFIG_TASKSTATS is not set
68# CONFIG_UTS_NS is not set 65# CONFIG_USER_NS is not set
69# CONFIG_AUDIT is not set 66# CONFIG_AUDIT is not set
70# CONFIG_IKCONFIG is not set 67# CONFIG_IKCONFIG is not set
71CONFIG_LOG_BUF_SHIFT=17 68CONFIG_LOG_BUF_SHIFT=17
@@ -100,10 +97,6 @@ CONFIG_SLAB=y
100CONFIG_RT_MUTEXES=y 97CONFIG_RT_MUTEXES=y
101# CONFIG_TINY_SHMEM is not set 98# CONFIG_TINY_SHMEM is not set
102CONFIG_BASE_SMALL=0 99CONFIG_BASE_SMALL=0
103
104#
105# Loadable module support
106#
107CONFIG_MODULES=y 100CONFIG_MODULES=y
108CONFIG_MODULE_UNLOAD=y 101CONFIG_MODULE_UNLOAD=y
109# CONFIG_MODULE_FORCE_UNLOAD is not set 102# CONFIG_MODULE_FORCE_UNLOAD is not set
@@ -111,12 +104,9 @@ CONFIG_MODULE_UNLOAD=y
111# CONFIG_MODULE_SRCVERSION_ALL is not set 104# CONFIG_MODULE_SRCVERSION_ALL is not set
112CONFIG_KMOD=y 105CONFIG_KMOD=y
113CONFIG_STOP_MACHINE=y 106CONFIG_STOP_MACHINE=y
114
115#
116# Block layer
117#
118CONFIG_BLOCK=y 107CONFIG_BLOCK=y
119# CONFIG_BLK_DEV_IO_TRACE is not set 108# CONFIG_BLK_DEV_IO_TRACE is not set
109CONFIG_BLK_DEV_BSG=y
120 110
121# 111#
122# IO Schedulers 112# IO Schedulers
@@ -136,7 +126,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
136# 126#
137CONFIG_PPC_MULTIPLATFORM=y 127CONFIG_PPC_MULTIPLATFORM=y
138# CONFIG_EMBEDDED6xx is not set 128# CONFIG_EMBEDDED6xx is not set
139# CONFIG_APUS is not set 129# CONFIG_PPC_82xx is not set
130# CONFIG_PPC_83xx is not set
131# CONFIG_PPC_86xx is not set
140# CONFIG_PPC_PSERIES is not set 132# CONFIG_PPC_PSERIES is not set
141# CONFIG_PPC_ISERIES is not set 133# CONFIG_PPC_ISERIES is not set
142# CONFIG_PPC_MPC52xx is not set 134# CONFIG_PPC_MPC52xx is not set
@@ -223,6 +215,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y
223CONFIG_SPLIT_PTLOCK_CPUS=4 215CONFIG_SPLIT_PTLOCK_CPUS=4
224CONFIG_RESOURCES_64BIT=y 216CONFIG_RESOURCES_64BIT=y
225CONFIG_ZONE_DMA_FLAG=1 217CONFIG_ZONE_DMA_FLAG=1
218CONFIG_BOUNCE=y
226CONFIG_ARCH_MEMORY_PROBE=y 219CONFIG_ARCH_MEMORY_PROBE=y
227# CONFIG_PPC_HAS_HASH_64K is not set 220# CONFIG_PPC_HAS_HASH_64K is not set
228# CONFIG_PPC_64K_PAGES is not set 221# CONFIG_PPC_64K_PAGES is not set
@@ -241,6 +234,7 @@ CONFIG_ZONE_DMA=y
241CONFIG_GENERIC_ISA_DMA=y 234CONFIG_GENERIC_ISA_DMA=y
242# CONFIG_PCI is not set 235# CONFIG_PCI is not set
243# CONFIG_PCI_DOMAINS is not set 236# CONFIG_PCI_DOMAINS is not set
237# CONFIG_PCI_SYSCALL is not set
244# CONFIG_ARCH_SUPPORTS_MSI is not set 238# CONFIG_ARCH_SUPPORTS_MSI is not set
245 239
246# 240#
@@ -365,6 +359,7 @@ CONFIG_WIRELESS_EXT=y
365# CONFIG_MAC80211 is not set 359# CONFIG_MAC80211 is not set
366# CONFIG_IEEE80211 is not set 360# CONFIG_IEEE80211 is not set
367# CONFIG_RFKILL is not set 361# CONFIG_RFKILL is not set
362# CONFIG_NET_9P is not set
368 363
369# 364#
370# Device Drivers 365# Device Drivers
@@ -379,26 +374,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
379# CONFIG_DEBUG_DRIVER is not set 374# CONFIG_DEBUG_DRIVER is not set
380# CONFIG_DEBUG_DEVRES is not set 375# CONFIG_DEBUG_DEVRES is not set
381# CONFIG_SYS_HYPERVISOR is not set 376# CONFIG_SYS_HYPERVISOR is not set
382
383#
384# Connector - unified userspace <-> kernelspace linker
385#
386# CONFIG_CONNECTOR is not set 377# CONFIG_CONNECTOR is not set
387# CONFIG_MTD is not set 378# CONFIG_MTD is not set
388 379CONFIG_OF_DEVICE=y
389#
390# Parallel port support
391#
392# CONFIG_PARPORT is not set 380# CONFIG_PARPORT is not set
393 381CONFIG_BLK_DEV=y
394#
395# Plug and Play support
396#
397# CONFIG_PNPACPI is not set
398
399#
400# Block devices
401#
402# CONFIG_BLK_DEV_FD is not set 382# CONFIG_BLK_DEV_FD is not set
403# CONFIG_BLK_DEV_COW_COMMON is not set 383# CONFIG_BLK_DEV_COW_COMMON is not set
404CONFIG_BLK_DEV_LOOP=y 384CONFIG_BLK_DEV_LOOP=y
@@ -411,11 +391,8 @@ CONFIG_BLK_DEV_RAM_SIZE=65535
411CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 391CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
412# CONFIG_CDROM_PKTCDVD is not set 392# CONFIG_CDROM_PKTCDVD is not set
413# CONFIG_ATA_OVER_ETH is not set 393# CONFIG_ATA_OVER_ETH is not set
414 394CONFIG_MISC_DEVICES=y
415# 395# CONFIG_EEPROM_93CX6 is not set
416# Misc devices
417#
418# CONFIG_BLINK is not set
419# CONFIG_IDE is not set 396# CONFIG_IDE is not set
420 397
421# 398#
@@ -423,6 +400,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
423# 400#
424# CONFIG_RAID_ATTRS is not set 401# CONFIG_RAID_ATTRS is not set
425CONFIG_SCSI=y 402CONFIG_SCSI=y
403CONFIG_SCSI_DMA=y
426# CONFIG_SCSI_TGT is not set 404# CONFIG_SCSI_TGT is not set
427# CONFIG_SCSI_NETLINK is not set 405# CONFIG_SCSI_NETLINK is not set
428CONFIG_SCSI_PROC_FS=y 406CONFIG_SCSI_PROC_FS=y
@@ -455,37 +433,22 @@ CONFIG_SCSI_WAIT_SCAN=m
455# CONFIG_SCSI_ISCSI_ATTRS is not set 433# CONFIG_SCSI_ISCSI_ATTRS is not set
456# CONFIG_SCSI_SAS_ATTRS is not set 434# CONFIG_SCSI_SAS_ATTRS is not set
457# CONFIG_SCSI_SAS_LIBSAS is not set 435# CONFIG_SCSI_SAS_LIBSAS is not set
458 436# CONFIG_SCSI_LOWLEVEL is not set
459#
460# SCSI low-level drivers
461#
462# CONFIG_ISCSI_TCP is not set
463# CONFIG_SCSI_DEBUG is not set
464# CONFIG_ATA is not set 437# CONFIG_ATA is not set
465
466#
467# Multi-device support (RAID and LVM)
468#
469# CONFIG_MD is not set 438# CONFIG_MD is not set
470# CONFIG_MACINTOSH_DRIVERS is not set 439# CONFIG_MACINTOSH_DRIVERS is not set
471
472#
473# Network device support
474#
475CONFIG_NETDEVICES=y 440CONFIG_NETDEVICES=y
441# CONFIG_NETDEVICES_MULTIQUEUE is not set
476# CONFIG_DUMMY is not set 442# CONFIG_DUMMY is not set
477# CONFIG_BONDING is not set 443# CONFIG_BONDING is not set
444# CONFIG_MACVLAN is not set
478# CONFIG_EQUALIZER is not set 445# CONFIG_EQUALIZER is not set
479# CONFIG_TUN is not set 446# CONFIG_TUN is not set
480
481#
482# Ethernet (10 or 100Mbit)
483#
484# CONFIG_NET_ETHERNET is not set 447# CONFIG_NET_ETHERNET is not set
485CONFIG_MII=m 448CONFIG_MII=m
486CONFIG_NETDEV_1000=y 449CONFIG_NETDEV_1000=y
487CONFIG_NETDEV_10000=y
488CONFIG_GELIC_NET=y 450CONFIG_GELIC_NET=y
451# CONFIG_NETDEV_10000 is not set
489 452
490# 453#
491# Wireless LAN 454# Wireless LAN
@@ -518,15 +481,7 @@ CONFIG_USB_NET_MCS7830=m
518# CONFIG_NETCONSOLE is not set 481# CONFIG_NETCONSOLE is not set
519# CONFIG_NETPOLL is not set 482# CONFIG_NETPOLL is not set
520# CONFIG_NET_POLL_CONTROLLER is not set 483# CONFIG_NET_POLL_CONTROLLER is not set
521
522#
523# ISDN subsystem
524#
525# CONFIG_ISDN is not set 484# CONFIG_ISDN is not set
526
527#
528# Telephony Support
529#
530# CONFIG_PHONE is not set 485# CONFIG_PHONE is not set
531 486
532# 487#
@@ -604,10 +559,6 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
604CONFIG_UNIX98_PTYS=y 559CONFIG_UNIX98_PTYS=y
605CONFIG_LEGACY_PTYS=y 560CONFIG_LEGACY_PTYS=y
606CONFIG_LEGACY_PTY_COUNT=16 561CONFIG_LEGACY_PTY_COUNT=16
607
608#
609# IPMI
610#
611# CONFIG_IPMI_HANDLER is not set 562# CONFIG_IPMI_HANDLER is not set
612# CONFIG_WATCHDOG is not set 563# CONFIG_WATCHDOG is not set
613# CONFIG_HW_RANDOM is not set 564# CONFIG_HW_RANDOM is not set
@@ -616,10 +567,6 @@ CONFIG_GEN_RTC=y
616# CONFIG_R3964 is not set 567# CONFIG_R3964 is not set
617# CONFIG_RAW_DRIVER is not set 568# CONFIG_RAW_DRIVER is not set
618# CONFIG_HANGCHECK_TIMER is not set 569# CONFIG_HANGCHECK_TIMER is not set
619
620#
621# TPM devices
622#
623# CONFIG_TCG_TPM is not set 570# CONFIG_TCG_TPM is not set
624# CONFIG_I2C is not set 571# CONFIG_I2C is not set
625 572
@@ -628,11 +575,8 @@ CONFIG_GEN_RTC=y
628# 575#
629# CONFIG_SPI is not set 576# CONFIG_SPI is not set
630# CONFIG_SPI_MASTER is not set 577# CONFIG_SPI_MASTER is not set
631
632#
633# Dallas's 1-wire bus
634#
635# CONFIG_W1 is not set 578# CONFIG_W1 is not set
579# CONFIG_POWER_SUPPLY is not set
636# CONFIG_HWMON is not set 580# CONFIG_HWMON is not set
637 581
638# 582#
@@ -657,6 +601,7 @@ CONFIG_GEN_RTC=y
657# 601#
658# CONFIG_DISPLAY_SUPPORT is not set 602# CONFIG_DISPLAY_SUPPORT is not set
659# CONFIG_VGASTATE is not set 603# CONFIG_VGASTATE is not set
604CONFIG_VIDEO_OUTPUT_CONTROL=m
660CONFIG_FB=y 605CONFIG_FB=y
661# CONFIG_FIRMWARE_EDID is not set 606# CONFIG_FIRMWARE_EDID is not set
662# CONFIG_FB_DDC is not set 607# CONFIG_FB_DDC is not set
@@ -691,11 +636,13 @@ CONFIG_FB_PS3_DEFAULT_SIZE_M=18
691# CONFIG_VGA_CONSOLE is not set 636# CONFIG_VGA_CONSOLE is not set
692CONFIG_DUMMY_CONSOLE=y 637CONFIG_DUMMY_CONSOLE=y
693CONFIG_FRAMEBUFFER_CONSOLE=y 638CONFIG_FRAMEBUFFER_CONSOLE=y
639CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
694CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y 640CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
695# CONFIG_FONTS is not set 641# CONFIG_FONTS is not set
696CONFIG_FONT_8x8=y 642CONFIG_FONT_8x8=y
697CONFIG_FONT_8x16=y 643CONFIG_FONT_8x16=y
698CONFIG_LOGO=y 644CONFIG_LOGO=y
645CONFIG_FB_LOGO_EXTRA=y
699# CONFIG_LOGO_LINUX_MONO is not set 646# CONFIG_LOGO_LINUX_MONO is not set
700# CONFIG_LOGO_LINUX_VGA16 is not set 647# CONFIG_LOGO_LINUX_VGA16 is not set
701CONFIG_LOGO_LINUX_CLUT224=y 648CONFIG_LOGO_LINUX_CLUT224=y
@@ -709,6 +656,8 @@ CONFIG_SOUND=y
709# Advanced Linux Sound Architecture 656# Advanced Linux Sound Architecture
710# 657#
711CONFIG_SND=y 658CONFIG_SND=y
659CONFIG_SND_TIMER=y
660CONFIG_SND_PCM=y
712# CONFIG_SND_SEQUENCER is not set 661# CONFIG_SND_SEQUENCER is not set
713# CONFIG_SND_MIXER_OSS is not set 662# CONFIG_SND_MIXER_OSS is not set
714# CONFIG_SND_PCM_OSS is not set 663# CONFIG_SND_PCM_OSS is not set
@@ -735,6 +684,12 @@ CONFIG_SND_VERBOSE_PROCFS=y
735# 684#
736 685
737# 686#
687# ALSA PowerPC devices
688#
689CONFIG_SND_PS3=y
690CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
691
692#
738# USB devices 693# USB devices
739# 694#
740# CONFIG_SND_USB_AUDIO is not set 695# CONFIG_SND_USB_AUDIO is not set
@@ -747,13 +702,14 @@ CONFIG_SND_VERBOSE_PROCFS=y
747# CONFIG_SND_SOC is not set 702# CONFIG_SND_SOC is not set
748 703
749# 704#
750# Open Sound System 705# SoC Audio support for SuperH
751# 706#
752# CONFIG_SOUND_PRIME is not set
753 707
754# 708#
755# HID Devices 709# Open Sound System
756# 710#
711# CONFIG_SOUND_PRIME is not set
712CONFIG_HID_SUPPORT=y
757CONFIG_HID=y 713CONFIG_HID=y
758# CONFIG_HID_DEBUG is not set 714# CONFIG_HID_DEBUG is not set
759 715
@@ -770,10 +726,7 @@ CONFIG_USB_HID=m
770# 726#
771# CONFIG_USB_KBD is not set 727# CONFIG_USB_KBD is not set
772# CONFIG_USB_MOUSE is not set 728# CONFIG_USB_MOUSE is not set
773 729CONFIG_USB_SUPPORT=y
774#
775# USB support
776#
777CONFIG_USB_ARCH_HAS_HCD=y 730CONFIG_USB_ARCH_HAS_HCD=y
778CONFIG_USB_ARCH_HAS_OHCI=y 731CONFIG_USB_ARCH_HAS_OHCI=y
779CONFIG_USB_ARCH_HAS_EHCI=y 732CONFIG_USB_ARCH_HAS_EHCI=y
@@ -803,6 +756,7 @@ CONFIG_USB_OHCI_HCD=y
803CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 756CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
804CONFIG_USB_OHCI_LITTLE_ENDIAN=y 757CONFIG_USB_OHCI_LITTLE_ENDIAN=y
805# CONFIG_USB_SL811_HCD is not set 758# CONFIG_USB_SL811_HCD is not set
759# CONFIG_USB_R8A66597_HCD is not set
806 760
807# 761#
808# USB Device Class drivers 762# USB Device Class drivers
@@ -879,31 +833,8 @@ CONFIG_USB_MON=y
879# 833#
880# CONFIG_USB_GADGET is not set 834# CONFIG_USB_GADGET is not set
881# CONFIG_MMC is not set 835# CONFIG_MMC is not set
882
883#
884# LED devices
885#
886# CONFIG_NEW_LEDS is not set 836# CONFIG_NEW_LEDS is not set
887 837# CONFIG_EDAC is not set
888#
889# LED drivers
890#
891
892#
893# LED Triggers
894#
895
896#
897# InfiniBand support
898#
899
900#
901# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
902#
903
904#
905# Real Time Clock
906#
907# CONFIG_RTC_CLASS is not set 838# CONFIG_RTC_CLASS is not set
908 839
909# 840#
@@ -920,6 +851,11 @@ CONFIG_USB_MON=y
920# 851#
921 852
922# 853#
854# Userspace I/O
855#
856# CONFIG_UIO is not set
857
858#
923# File systems 859# File systems
924# 860#
925CONFIG_EXT2_FS=m 861CONFIG_EXT2_FS=m
@@ -948,8 +884,8 @@ CONFIG_QUOTA=y
948CONFIG_QFMT_V2=y 884CONFIG_QFMT_V2=y
949CONFIG_QUOTACTL=y 885CONFIG_QUOTACTL=y
950CONFIG_DNOTIFY=y 886CONFIG_DNOTIFY=y
951# CONFIG_AUTOFS_FS is not set 887CONFIG_AUTOFS_FS=m
952CONFIG_AUTOFS4_FS=y 888CONFIG_AUTOFS4_FS=m
953# CONFIG_FUSE_FS is not set 889# CONFIG_FUSE_FS is not set
954 890
955# 891#
@@ -1030,7 +966,6 @@ CONFIG_CIFS=m
1030# CONFIG_NCP_FS is not set 966# CONFIG_NCP_FS is not set
1031# CONFIG_CODA_FS is not set 967# CONFIG_CODA_FS is not set
1032# CONFIG_AFS_FS is not set 968# CONFIG_AFS_FS is not set
1033# CONFIG_9P_FS is not set
1034 969
1035# 970#
1036# Partition Types 971# Partition Types
@@ -1096,6 +1031,7 @@ CONFIG_BITREVERSE=y
1096# CONFIG_CRC16 is not set 1031# CONFIG_CRC16 is not set
1097# CONFIG_CRC_ITU_T is not set 1032# CONFIG_CRC_ITU_T is not set
1098CONFIG_CRC32=y 1033CONFIG_CRC32=y
1034# CONFIG_CRC7 is not set
1099# CONFIG_LIBCRC32C is not set 1035# CONFIG_LIBCRC32C is not set
1100CONFIG_PLIST=y 1036CONFIG_PLIST=y
1101CONFIG_HAS_IOMEM=y 1037CONFIG_HAS_IOMEM=y
@@ -1120,6 +1056,7 @@ CONFIG_MAGIC_SYSRQ=y
1120CONFIG_DEBUG_KERNEL=y 1056CONFIG_DEBUG_KERNEL=y
1121# CONFIG_DEBUG_SHIRQ is not set 1057# CONFIG_DEBUG_SHIRQ is not set
1122CONFIG_DETECT_SOFTLOCKUP=y 1058CONFIG_DETECT_SOFTLOCKUP=y
1059CONFIG_SCHED_DEBUG=y
1123# CONFIG_SCHEDSTATS is not set 1060# CONFIG_SCHEDSTATS is not set
1124# CONFIG_TIMER_STATS is not set 1061# CONFIG_TIMER_STATS is not set
1125# CONFIG_DEBUG_SLAB is not set 1062# CONFIG_DEBUG_SLAB is not set
@@ -1150,10 +1087,6 @@ CONFIG_IRQSTACKS=y
1150# 1087#
1151# CONFIG_KEYS is not set 1088# CONFIG_KEYS is not set
1152# CONFIG_SECURITY is not set 1089# CONFIG_SECURITY is not set
1153
1154#
1155# Cryptographic options
1156#
1157CONFIG_CRYPTO=y 1090CONFIG_CRYPTO=y
1158CONFIG_CRYPTO_ALGAPI=y 1091CONFIG_CRYPTO_ALGAPI=y
1159CONFIG_CRYPTO_BLKCIPHER=y 1092CONFIG_CRYPTO_BLKCIPHER=y
@@ -1191,7 +1124,4 @@ CONFIG_CRYPTO_DES=y
1191# CONFIG_CRYPTO_CRC32C is not set 1124# CONFIG_CRYPTO_CRC32C is not set
1192# CONFIG_CRYPTO_CAMELLIA is not set 1125# CONFIG_CRYPTO_CAMELLIA is not set
1193# CONFIG_CRYPTO_TEST is not set 1126# CONFIG_CRYPTO_TEST is not set
1194 1127CONFIG_CRYPTO_HW=y
1195#
1196# Hardware crypto devices
1197#
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 1448af92c6a9..171800002ede 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1672,8 +1672,9 @@ _GLOBAL(__start_initialization_multiplatform)
1672 * Are we booted from a PROM Of-type client-interface ? 1672 * Are we booted from a PROM Of-type client-interface ?
1673 */ 1673 */
1674 cmpldi cr0,r5,0 1674 cmpldi cr0,r5,0
1675 bne .__boot_from_prom /* yes -> prom */ 1675 beq 1f
1676 1676 b .__boot_from_prom /* yes -> prom */
16771:
1677 /* Save parameters */ 1678 /* Save parameters */
1678 mr r31,r3 1679 mr r31,r3
1679 mr r30,r4 1680 mr r30,r4
@@ -1701,7 +1702,7 @@ _GLOBAL(__start_initialization_multiplatform)
1701 bl .__mmu_off 1702 bl .__mmu_off
1702 b .__after_prom_start 1703 b .__after_prom_start
1703 1704
1704_STATIC(__boot_from_prom) 1705_INIT_STATIC(__boot_from_prom)
1705 /* Save parameters */ 1706 /* Save parameters */
1706 mr r31,r3 1707 mr r31,r3
1707 mr r30,r4 1708 mr r30,r4
@@ -1768,9 +1769,10 @@ _STATIC(__after_prom_start)
1768 /* the source addr */ 1769 /* the source addr */
1769 1770
1770 cmpdi r4,0 /* In some cases the loader may */ 1771 cmpdi r4,0 /* In some cases the loader may */
1771 beq .start_here_multiplatform /* have already put us at zero */ 1772 bne 1f
1773 b .start_here_multiplatform /* have already put us at zero */
1772 /* so we can skip the copy. */ 1774 /* so we can skip the copy. */
1773 LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */ 17751: LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
1774 sub r5,r5,r27 1776 sub r5,r5,r27
1775 1777
1776 li r6,0x100 /* Start offset, the first 0x100 */ 1778 li r6,0x100 /* Start offset, the first 0x100 */
@@ -1957,7 +1959,7 @@ _GLOBAL(enable_64b_mode)
1957/* 1959/*
1958 * This is where the main kernel code starts. 1960 * This is where the main kernel code starts.
1959 */ 1961 */
1960_STATIC(start_here_multiplatform) 1962_INIT_STATIC(start_here_multiplatform)
1961 /* get a new offset, now that the kernel has moved. */ 1963 /* get a new offset, now that the kernel has moved. */
1962 bl .reloc_offset 1964 bl .reloc_offset
1963 mr r26,r3 1965 mr r26,r3
@@ -2019,7 +2021,7 @@ _STATIC(start_here_multiplatform)
2019 b . /* prevent speculative execution */ 2021 b . /* prevent speculative execution */
2020 2022
2021 /* This is where all platforms converge execution */ 2023 /* This is where all platforms converge execution */
2022_STATIC(start_here_common) 2024_INIT_STATIC(start_here_common)
2023 /* relocation is on at this point */ 2025 /* relocation is on at this point */
2024 2026
2025 /* The following code sets up the SP and TOC now that we are */ 2027 /* The following code sets up the SP and TOC now that we are */
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index a97e23ac1976..291ffbc360c9 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -313,6 +313,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
313 313
314 dev->current_state = 4; /* unknown power state */ 314 dev->current_state = 4; /* unknown power state */
315 dev->error_state = pci_channel_io_normal; 315 dev->error_state = pci_channel_io_normal;
316 dev->dma_mask = 0xffffffff;
316 317
317 if (!strcmp(type, "pci") || !strcmp(type, "pciex")) { 318 if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
318 /* a PCI-PCI bridge */ 319 /* a PCI-PCI bridge */
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index b0697017d0e8..a73d2d700973 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -69,20 +69,9 @@ static inline void slb_shadow_update(unsigned long ea,
69 smp_wmb(); 69 smp_wmb();
70} 70}
71 71
72static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags, 72static inline void slb_shadow_clear(unsigned long entry)
73 unsigned long entry)
74{ 73{
75 /* 74 get_slb_shadow()->save_area[entry].esid = 0;
76 * Updating the shadow buffer before writing the SLB ensures
77 * we don't get a stale entry here if we get preempted by PHYP
78 * between these two statements.
79 */
80 slb_shadow_update(ea, flags, entry);
81
82 asm volatile("slbmte %0,%1" :
83 : "r" (mk_vsid_data(ea, flags)),
84 "r" (mk_esid_data(ea, entry))
85 : "memory" );
86} 75}
87 76
88void slb_flush_and_rebolt(void) 77void slb_flush_and_rebolt(void)
@@ -100,11 +89,13 @@ void slb_flush_and_rebolt(void)
100 vflags = SLB_VSID_KERNEL | vmalloc_llp; 89 vflags = SLB_VSID_KERNEL | vmalloc_llp;
101 90
102 ksp_esid_data = mk_esid_data(get_paca()->kstack, 2); 91 ksp_esid_data = mk_esid_data(get_paca()->kstack, 2);
103 if ((ksp_esid_data & ESID_MASK) == PAGE_OFFSET) 92 if ((ksp_esid_data & ESID_MASK) == PAGE_OFFSET) {
104 ksp_esid_data &= ~SLB_ESID_V; 93 ksp_esid_data &= ~SLB_ESID_V;
105 94 slb_shadow_clear(2);
106 /* Only third entry (stack) may change here so only resave that */ 95 } else {
107 slb_shadow_update(get_paca()->kstack, lflags, 2); 96 /* Update stack entry; others don't change */
97 slb_shadow_update(get_paca()->kstack, lflags, 2);
98 }
108 99
109 /* We need to do this all in asm, so we're sure we don't touch 100 /* We need to do this all in asm, so we're sure we don't touch
110 * the stack between the slbia and rebolting it. */ 101 * the stack between the slbia and rebolting it. */
@@ -235,16 +226,12 @@ void slb_initialize(void)
235 vflags = SLB_VSID_KERNEL | vmalloc_llp; 226 vflags = SLB_VSID_KERNEL | vmalloc_llp;
236 227
237 /* Invalidate the entire SLB (even slot 0) & all the ERATS */ 228 /* Invalidate the entire SLB (even slot 0) & all the ERATS */
238 asm volatile("isync":::"memory"); 229 slb_shadow_update(PAGE_OFFSET, lflags, 0);
239 asm volatile("slbmte %0,%0"::"r" (0) : "memory"); 230 asm volatile("isync; slbia; sync; slbmte %0,%1; isync" ::
240 asm volatile("isync; slbia; isync":::"memory"); 231 "r" (get_slb_shadow()->save_area[0].vsid),
241 create_shadowed_slbe(PAGE_OFFSET, lflags, 0); 232 "r" (get_slb_shadow()->save_area[0].esid) : "memory");
242 233
243 create_shadowed_slbe(VMALLOC_START, vflags, 1); 234 slb_shadow_update(VMALLOC_START, vflags, 1);
244 235
245 /* We don't bolt the stack for the time being - we're in boot, 236 slb_flush_and_rebolt();
246 * so the stack is in the bolted segment. By the time it goes
247 * elsewhere, we'll call _switch() which will bolt in the new
248 * one. */
249 asm volatile("isync":::"memory");
250} 237}
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index f833dba2a028..d5fd3909d13a 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -405,6 +405,8 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
405 405
406 if (len > mm->task_size) 406 if (len > mm->task_size)
407 return -ENOMEM; 407 return -ENOMEM;
408 if (len & ((1ul << pshift) - 1))
409 return -EINVAL;
408 if (fixed && (addr & ((1ul << pshift) - 1))) 410 if (fixed && (addr & ((1ul << pshift) - 1)))
409 return -EINVAL; 411 return -EINVAL;
410 if (fixed && addr > (mm->task_size - len)) 412 if (fixed && addr > (mm->task_size - len))
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index b39cb52c6fb9..2c8e641a739b 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -106,7 +106,6 @@ static struct of_device_id mpc832x_ids[] = {
106 { .type = "soc", }, 106 { .type = "soc", },
107 { .compatible = "soc", }, 107 { .compatible = "soc", },
108 { .type = "qe", }, 108 { .type = "qe", },
109 { .type = "mdio", },
110 {}, 109 {},
111}; 110};
112 111
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index b2b28a44738c..090906170a41 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -70,7 +70,6 @@ static struct of_device_id mpc832x_ids[] = {
70 { .type = "soc", }, 70 { .type = "soc", },
71 { .compatible = "soc", }, 71 { .compatible = "soc", },
72 { .type = "qe", }, 72 { .type = "qe", },
73 { .type = "mdio", },
74 {}, 73 {},
75}; 74};
76 75
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 0e615fd65c1f..84b58934aafd 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -113,7 +113,6 @@ static struct of_device_id mpc836x_ids[] = {
113 { .type = "soc", }, 113 { .type = "soc", },
114 { .compatible = "soc", }, 114 { .compatible = "soc", },
115 { .type = "qe", }, 115 { .type = "qe", },
116 { .type = "mdio", },
117 {}, 116 {},
118}; 117};
119 118
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e8003bf00c9a..be25ecd911ba 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -142,7 +142,6 @@ static struct of_device_id mpc85xx_ids[] = {
142 { .type = "soc", }, 142 { .type = "soc", },
143 { .compatible = "soc", }, 143 { .compatible = "soc", },
144 { .type = "qe", }, 144 { .type = "qe", },
145 { .type = "mdio", },
146 {}, 145 {},
147}; 146};
148 147
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 90124228b8f4..095a30304c56 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -36,7 +36,6 @@
36#include <asm/spu_priv1.h> 36#include <asm/spu_priv1.h>
37#include <asm/xmon.h> 37#include <asm/xmon.h>
38#include <asm/prom.h> 38#include <asm/prom.h>
39#include "spu_priv1_mmio.h"
40 39
41const struct spu_management_ops *spu_management_ops; 40const struct spu_management_ops *spu_management_ops;
42EXPORT_SYMBOL_GPL(spu_management_ops); 41EXPORT_SYMBOL_GPL(spu_management_ops);
@@ -636,138 +635,6 @@ static ssize_t spu_stat_show(struct sys_device *sysdev, char *buf)
636 635
637static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); 636static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL);
638 637
639/* Hardcoded affinity idxs for QS20 */
640#define SPES_PER_BE 8
641static int QS20_reg_idxs[SPES_PER_BE] = { 0, 2, 4, 6, 7, 5, 3, 1 };
642static int QS20_reg_memory[SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
643
644static struct spu *spu_lookup_reg(int node, u32 reg)
645{
646 struct spu *spu;
647
648 list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
649 if (*(u32 *)get_property(spu_devnode(spu), "reg", NULL) == reg)
650 return spu;
651 }
652 return NULL;
653}
654
655static void init_aff_QS20_harcoded(void)
656{
657 int node, i;
658 struct spu *last_spu, *spu;
659 u32 reg;
660
661 for (node = 0; node < MAX_NUMNODES; node++) {
662 last_spu = NULL;
663 for (i = 0; i < SPES_PER_BE; i++) {
664 reg = QS20_reg_idxs[i];
665 spu = spu_lookup_reg(node, reg);
666 if (!spu)
667 continue;
668 spu->has_mem_affinity = QS20_reg_memory[reg];
669 if (last_spu)
670 list_add_tail(&spu->aff_list,
671 &last_spu->aff_list);
672 last_spu = spu;
673 }
674 }
675}
676
677static int of_has_vicinity(void)
678{
679 struct spu* spu;
680
681 spu = list_entry(cbe_spu_info[0].spus.next, struct spu, cbe_list);
682 return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
683}
684
685static struct spu *aff_devnode_spu(int cbe, struct device_node *dn)
686{
687 struct spu *spu;
688
689 list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list)
690 if (spu_devnode(spu) == dn)
691 return spu;
692 return NULL;
693}
694
695static struct spu *
696aff_node_next_to(int cbe, struct device_node *target, struct device_node *avoid)
697{
698 struct spu *spu;
699 const phandle *vic_handles;
700 int lenp, i;
701
702 list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list) {
703 if (spu_devnode(spu) == avoid)
704 continue;
705 vic_handles = get_property(spu_devnode(spu), "vicinity", &lenp);
706 for (i=0; i < (lenp / sizeof(phandle)); i++) {
707 if (vic_handles[i] == target->linux_phandle)
708 return spu;
709 }
710 }
711 return NULL;
712}
713
714static void init_aff_fw_vicinity_node(int cbe)
715{
716 struct spu *spu, *last_spu;
717 struct device_node *vic_dn, *last_spu_dn;
718 phandle avoid_ph;
719 const phandle *vic_handles;
720 const char *name;
721 int lenp, i, added, mem_aff;
722
723 last_spu = list_entry(cbe_spu_info[cbe].spus.next, struct spu, cbe_list);
724 avoid_ph = 0;
725 for (added = 1; added < cbe_spu_info[cbe].n_spus; added++) {
726 last_spu_dn = spu_devnode(last_spu);
727 vic_handles = get_property(last_spu_dn, "vicinity", &lenp);
728
729 for (i = 0; i < (lenp / sizeof(phandle)); i++) {
730 if (vic_handles[i] == avoid_ph)
731 continue;
732
733 vic_dn = of_find_node_by_phandle(vic_handles[i]);
734 if (!vic_dn)
735 continue;
736
737 name = get_property(vic_dn, "name", NULL);
738 if (strcmp(name, "spe") == 0) {
739 spu = aff_devnode_spu(cbe, vic_dn);
740 avoid_ph = last_spu_dn->linux_phandle;
741 }
742 else {
743 mem_aff = strcmp(name, "mic-tm") == 0;
744 spu = aff_node_next_to(cbe, vic_dn, last_spu_dn);
745 if (!spu)
746 continue;
747 if (mem_aff) {
748 last_spu->has_mem_affinity = 1;
749 spu->has_mem_affinity = 1;
750 }
751 avoid_ph = vic_dn->linux_phandle;
752 }
753 list_add_tail(&spu->aff_list, &last_spu->aff_list);
754 last_spu = spu;
755 break;
756 }
757 }
758}
759
760static void init_aff_fw_vicinity(void)
761{
762 int cbe;
763
764 /* sets has_mem_affinity for each spu, as long as the
765 * spu->aff_list list, linking each spu to its neighbors
766 */
767 for (cbe = 0; cbe < MAX_NUMNODES; cbe++)
768 init_aff_fw_vicinity_node(cbe);
769}
770
771static int __init init_spu_base(void) 638static int __init init_spu_base(void)
772{ 639{
773 int i, ret = 0; 640 int i, ret = 0;
@@ -811,13 +678,7 @@ static int __init init_spu_base(void)
811 mutex_unlock(&spu_full_list_mutex); 678 mutex_unlock(&spu_full_list_mutex);
812 spu_add_sysdev_attr(&attr_stat); 679 spu_add_sysdev_attr(&attr_stat);
813 680
814 if (of_has_vicinity()) { 681 spu_init_affinity();
815 init_aff_fw_vicinity();
816 } else {
817 long root = of_get_flat_dt_root();
818 if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
819 init_aff_QS20_harcoded();
820 }
821 682
822 return 0; 683 return 0;
823 684
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index 75ed50fcc3db..5eb88346181a 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -361,8 +361,171 @@ static int of_destroy_spu(struct spu *spu)
361 return 0; 361 return 0;
362} 362}
363 363
364/* Hardcoded affinity idxs for qs20 */
365#define QS20_SPES_PER_BE 8
366static int qs20_reg_idxs[QS20_SPES_PER_BE] = { 0, 2, 4, 6, 7, 5, 3, 1 };
367static int qs20_reg_memory[QS20_SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
368
369static struct spu *spu_lookup_reg(int node, u32 reg)
370{
371 struct spu *spu;
372 u32 *spu_reg;
373
374 list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
375 spu_reg = (u32*)of_get_property(spu_devnode(spu), "reg", NULL);
376 if (*spu_reg == reg)
377 return spu;
378 }
379 return NULL;
380}
381
382static void init_affinity_qs20_harcoded(void)
383{
384 int node, i;
385 struct spu *last_spu, *spu;
386 u32 reg;
387
388 for (node = 0; node < MAX_NUMNODES; node++) {
389 last_spu = NULL;
390 for (i = 0; i < QS20_SPES_PER_BE; i++) {
391 reg = qs20_reg_idxs[i];
392 spu = spu_lookup_reg(node, reg);
393 if (!spu)
394 continue;
395 spu->has_mem_affinity = qs20_reg_memory[reg];
396 if (last_spu)
397 list_add_tail(&spu->aff_list,
398 &last_spu->aff_list);
399 last_spu = spu;
400 }
401 }
402}
403
404static int of_has_vicinity(void)
405{
406 struct spu* spu;
407
408 spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list);
409 return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
410}
411
412static struct spu *devnode_spu(int cbe, struct device_node *dn)
413{
414 struct spu *spu;
415
416 list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list)
417 if (spu_devnode(spu) == dn)
418 return spu;
419 return NULL;
420}
421
422static struct spu *
423neighbour_spu(int cbe, struct device_node *target, struct device_node *avoid)
424{
425 struct spu *spu;
426 struct device_node *spu_dn;
427 const phandle *vic_handles;
428 int lenp, i;
429
430 list_for_each_entry(spu, &cbe_spu_info[cbe].spus, cbe_list) {
431 spu_dn = spu_devnode(spu);
432 if (spu_dn == avoid)
433 continue;
434 vic_handles = of_get_property(spu_dn, "vicinity", &lenp);
435 for (i=0; i < (lenp / sizeof(phandle)); i++) {
436 if (vic_handles[i] == target->linux_phandle)
437 return spu;
438 }
439 }
440 return NULL;
441}
442
443static void init_affinity_node(int cbe)
444{
445 struct spu *spu, *last_spu;
446 struct device_node *vic_dn, *last_spu_dn;
447 phandle avoid_ph;
448 const phandle *vic_handles;
449 const char *name;
450 int lenp, i, added;
451
452 last_spu = list_first_entry(&cbe_spu_info[cbe].spus, struct spu,
453 cbe_list);
454 avoid_ph = 0;
455 for (added = 1; added < cbe_spu_info[cbe].n_spus; added++) {
456 last_spu_dn = spu_devnode(last_spu);
457 vic_handles = of_get_property(last_spu_dn, "vicinity", &lenp);
458
459 /*
460 * Walk through each phandle in vicinity property of the spu
461 * (tipically two vicinity phandles per spe node)
462 */
463 for (i = 0; i < (lenp / sizeof(phandle)); i++) {
464 if (vic_handles[i] == avoid_ph)
465 continue;
466
467 vic_dn = of_find_node_by_phandle(vic_handles[i]);
468 if (!vic_dn)
469 continue;
470
471 /* a neighbour might be spe, mic-tm, or bif0 */
472 name = of_get_property(vic_dn, "name", NULL);
473 if (!name)
474 continue;
475
476 if (strcmp(name, "spe") == 0) {
477 spu = devnode_spu(cbe, vic_dn);
478 avoid_ph = last_spu_dn->linux_phandle;
479 } else {
480 /*
481 * "mic-tm" and "bif0" nodes do not have
482 * vicinity property. So we need to find the
483 * spe which has vic_dn as neighbour, but
484 * skipping the one we came from (last_spu_dn)
485 */
486 spu = neighbour_spu(cbe, vic_dn, last_spu_dn);
487 if (!spu)
488 continue;
489 if (!strcmp(name, "mic-tm")) {
490 last_spu->has_mem_affinity = 1;
491 spu->has_mem_affinity = 1;
492 }
493 avoid_ph = vic_dn->linux_phandle;
494 }
495
496 list_add_tail(&spu->aff_list, &last_spu->aff_list);
497 last_spu = spu;
498 break;
499 }
500 }
501}
502
503static void init_affinity_fw(void)
504{
505 int cbe;
506
507 for (cbe = 0; cbe < MAX_NUMNODES; cbe++)
508 init_affinity_node(cbe);
509}
510
511static int __init init_affinity(void)
512{
513 if (of_has_vicinity()) {
514 init_affinity_fw();
515 } else {
516 long root = of_get_flat_dt_root();
517 if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
518 init_affinity_qs20_harcoded();
519 else
520 printk("No affinity configuration found");
521 }
522
523 return 0;
524}
525
364const struct spu_management_ops spu_management_of_ops = { 526const struct spu_management_ops spu_management_of_ops = {
365 .enumerate_spus = of_enumerate_spus, 527 .enumerate_spus = of_enumerate_spus,
366 .create_spu = of_create_spu, 528 .create_spu = of_create_spu,
367 .destroy_spu = of_destroy_spu, 529 .destroy_spu = of_destroy_spu,
530 .init_affinity = init_affinity,
368}; 531};
diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig
index d4fc74f7bb15..67144d1d1405 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -1,5 +1,5 @@
1config PPC_PS3 1config PPC_PS3
2 bool "Sony PS3 (incomplete)" 2 bool "Sony PS3"
3 depends on PPC_MULTIPLATFORM && PPC64 3 depends on PPC_MULTIPLATFORM && PPC64
4 select PPC_CELL 4 select PPC_CELL
5 select USB_ARCH_HAS_OHCI 5 select USB_ARCH_HAS_OHCI
@@ -10,10 +10,10 @@ config PPC_PS3
10 select MEMORY_HOTPLUG 10 select MEMORY_HOTPLUG
11 help 11 help
12 This option enables support for the Sony PS3 game console 12 This option enables support for the Sony PS3 game console
13 and other platforms using the PS3 hypervisor. 13 and other platforms using the PS3 hypervisor. Enabling this
14 Support for this platform is not yet complete, so 14 option will allow building otheros.bld, a kernel image suitable
15 enabling this will not result in a bootable kernel on a 15 for programming into flash memory, and vmlinux, a kernel image
16 PS3 system. 16 suitable for loading via kexec.
17 17
18menu "PS3 Platform Options" 18menu "PS3 Platform Options"
19 depends on PPC_PS3 19 depends on PPC_PS3
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index 825ebb2cbc2a..e23a5a874ad3 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -273,55 +273,58 @@ static int ps3stor_wait_for_completion(u64 dev_id, u64 tag,
273 273
274static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo) 274static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
275{ 275{
276 int error = -ENODEV;
276 int result; 277 int result;
277 const u64 notification_dev_id = (u64)-1LL; 278 const u64 notification_dev_id = (u64)-1LL;
278 const unsigned int timeout = HZ; 279 const unsigned int timeout = HZ;
279 u64 lpar; 280 u64 lpar;
280 u64 tag; 281 u64 tag;
282 void *buf;
283 enum ps3_notify_type {
284 notify_device_ready = 0,
285 notify_region_probe = 1,
286 notify_region_update = 2,
287 };
281 struct { 288 struct {
282 u64 operation_code; /* must be zero */ 289 u64 operation_code; /* must be zero */
283 u64 event_mask; /* 1 = device ready */ 290 u64 event_mask; /* OR of 1UL << enum ps3_notify_type */
284 } *notify_cmd; 291 } *notify_cmd;
285 struct { 292 struct {
286 u64 event_type; /* notify_device_ready */ 293 u64 event_type; /* enum ps3_notify_type */
287 u64 bus_id; 294 u64 bus_id;
288 u64 dev_id; 295 u64 dev_id;
289 u64 dev_type; 296 u64 dev_type;
290 u64 dev_port; 297 u64 dev_port;
291 } *notify_event; 298 } *notify_event;
292 enum {
293 notify_device_ready = 1
294 };
295 299
296 pr_debug(" -> %s:%u: bus_id %u, dev_id %u, dev_type %u\n", __func__, 300 pr_debug(" -> %s:%u: bus_id %u, dev_id %u, dev_type %u\n", __func__,
297 __LINE__, repo->bus_id, repo->dev_id, repo->dev_type); 301 __LINE__, repo->bus_id, repo->dev_id, repo->dev_type);
298 302
299 notify_cmd = kzalloc(512, GFP_KERNEL); 303 buf = kzalloc(512, GFP_KERNEL);
300 notify_event = (void *)notify_cmd; 304 if (!buf)
301 if (!notify_cmd)
302 return -ENOMEM; 305 return -ENOMEM;
303 306
304 lpar = ps3_mm_phys_to_lpar(__pa(notify_cmd)); 307 lpar = ps3_mm_phys_to_lpar(__pa(buf));
308 notify_cmd = buf;
309 notify_event = buf;
305 310
306 result = lv1_open_device(repo->bus_id, notification_dev_id, 0); 311 result = lv1_open_device(repo->bus_id, notification_dev_id, 0);
307 if (result) { 312 if (result) {
308 printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__, 313 printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,
309 __LINE__, ps3_result(result)); 314 __LINE__, ps3_result(result));
310 result = -ENODEV;
311 goto fail_free; 315 goto fail_free;
312 } 316 }
313 317
314 /* Setup and write the request for device notification. */ 318 /* Setup and write the request for device notification. */
315 319
316 notify_cmd->operation_code = 0; /* must be zero */ 320 notify_cmd->operation_code = 0; /* must be zero */
317 notify_cmd->event_mask = 0x01; /* device ready */ 321 notify_cmd->event_mask = 1UL << notify_region_probe;
318 322
319 result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar, 323 result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
320 &tag); 324 &tag);
321 if (result) { 325 if (result) {
322 printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__, 326 printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,
323 ps3_result(result)); 327 ps3_result(result));
324 result = -ENODEV;
325 goto fail_close; 328 goto fail_close;
326 } 329 }
327 330
@@ -332,13 +335,11 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
332 if (result) { 335 if (result) {
333 printk(KERN_ERR "%s:%u: write not completed %s\n", __func__, 336 printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,
334 __LINE__, ps3_result(result)); 337 __LINE__, ps3_result(result));
335 result = -ENODEV;
336 goto fail_close; 338 goto fail_close;
337 } 339 }
338 340
339 /* Loop here processing the requested notification events. */ 341 /* Loop here processing the requested notification events. */
340 342
341 result = -ENODEV;
342 while (1) { 343 while (1) {
343 memset(notify_event, 0, sizeof(*notify_event)); 344 memset(notify_event, 0, sizeof(*notify_event));
344 345
@@ -358,7 +359,7 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
358 break; 359 break;
359 } 360 }
360 361
361 if (notify_event->event_type != notify_device_ready || 362 if (notify_event->event_type != notify_region_probe ||
362 notify_event->bus_id != repo->bus_id) { 363 notify_event->bus_id != repo->bus_id) {
363 pr_debug("%s:%u: bad notify_event: event %lu, " 364 pr_debug("%s:%u: bad notify_event: event %lu, "
364 "dev_id %lu, dev_type %lu\n", 365 "dev_id %lu, dev_type %lu\n",
@@ -386,9 +387,9 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
386fail_close: 387fail_close:
387 lv1_close_device(repo->bus_id, notification_dev_id); 388 lv1_close_device(repo->bus_id, notification_dev_id);
388fail_free: 389fail_free:
389 kfree(notify_cmd); 390 kfree(buf);
390 pr_debug(" <- %s:%u\n", __func__, __LINE__); 391 pr_debug(" <- %s:%u\n", __func__, __LINE__);
391 return result; 392 return error;
392} 393}
393 394
394static int ps3_setup_storage_dev(const struct ps3_repository_device *repo, 395static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
diff --git a/arch/powerpc/platforms/ps3/spu.c b/arch/powerpc/platforms/ps3/spu.c
index 502d80ed982b..ac2a4b8a4c14 100644
--- a/arch/powerpc/platforms/ps3/spu.c
+++ b/arch/powerpc/platforms/ps3/spu.c
@@ -414,10 +414,16 @@ static int __init ps3_enumerate_spus(int (*fn)(void *data))
414 return num_resource_id; 414 return num_resource_id;
415} 415}
416 416
417static int ps3_init_affinity(void)
418{
419 return 0;
420}
421
417const struct spu_management_ops spu_management_ps3_ops = { 422const struct spu_management_ops spu_management_ps3_ops = {
418 .enumerate_spus = ps3_enumerate_spus, 423 .enumerate_spus = ps3_enumerate_spus,
419 .create_spu = ps3_create_spu, 424 .create_spu = ps3_create_spu,
420 .destroy_spu = ps3_destroy_spu, 425 .destroy_spu = ps3_destroy_spu,
426 .init_affinity = ps3_init_affinity,
421}; 427};
422 428
423/* spu_priv1_ops */ 429/* spu_priv1_ops */
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index f6bd804d9090..744d6bb24116 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -95,7 +95,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
95 return -EIO; 95 return -EIO;
96 if (dma_ops->set_dma_mask != NULL) 96 if (dma_ops->set_dma_mask != NULL)
97 return dma_ops->set_dma_mask(dev, dma_mask); 97 return dma_ops->set_dma_mask(dev, dma_mask);
98 if (!dev->dma_mask || !dma_supported(dev, *dev->dma_mask)) 98 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
99 return -EIO; 99 return -EIO;
100 *dev->dma_mask = dma_mask; 100 *dev->dma_mask = dma_mask;
101 return 0; 101 return 0;
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h
index 7e78f6a1ab8b..0f37c7c90820 100644
--- a/include/asm-powerpc/spu_priv1.h
+++ b/include/asm-powerpc/spu_priv1.h
@@ -178,6 +178,7 @@ struct spu_management_ops {
178 int (*enumerate_spus)(int (*fn)(void *data)); 178 int (*enumerate_spus)(int (*fn)(void *data));
179 int (*create_spu)(struct spu *spu, void *data); 179 int (*create_spu)(struct spu *spu, void *data);
180 int (*destroy_spu)(struct spu *spu); 180 int (*destroy_spu)(struct spu *spu);
181 int (*init_affinity)(void);
181}; 182};
182 183
183extern const struct spu_management_ops* spu_management_ops; 184extern const struct spu_management_ops* spu_management_ops;
@@ -200,6 +201,12 @@ spu_destroy_spu (struct spu *spu)
200 return spu_management_ops->destroy_spu(spu); 201 return spu_management_ops->destroy_spu(spu);
201} 202}
202 203
204static inline int
205spu_init_affinity (void)
206{
207 return spu_management_ops->init_affinity();
208}
209
203/* 210/*
204 * The declarations folowing are put here for convenience 211 * The declarations folowing are put here for convenience
205 * and only intended to be used by the platform setup code. 212 * and only intended to be used by the platform setup code.