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

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