Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branch 'jwb/next' into next

+186 -85
+1 -1
MAINTAINERS
··· 3876 3876 F: arch/powerpc/platforms/52xx/ 3877 3877 3878 3878 LINUX FOR POWERPC EMBEDDED PPC4XX 3879 - M: Josh Boyer <jwboyer@linux.vnet.ibm.com> 3879 + M: Josh Boyer <jwboyer@gmail.com> 3880 3880 M: Matt Porter <mporter@kernel.crashing.org> 3881 3881 W: http://www.penguinppc.org/ 3882 3882 L: linuxppc-dev@lists.ozlabs.org
+1 -1
arch/powerpc/Kconfig
··· 842 842 843 843 config RELOCATABLE 844 844 bool "Build a relocatable kernel (EXPERIMENTAL)" 845 - depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && FSL_BOOKE 845 + depends on EXPERIMENTAL && ADVANCED_OPTIONS && FLATMEM && (FSL_BOOKE || PPC_47x) 846 846 help 847 847 This builds a kernel image that is capable of running at the 848 848 location the kernel is loaded at (some alignment restrictions may
+2 -2
arch/powerpc/boot/dts/taishan.dts
··· 337 337 rx-fifo-size = <4096>; 338 338 tx-fifo-size = <2048>; 339 339 phy-mode = "rgmii"; 340 - phy-map = <0x00000001>; 340 + phy-address = <1>; 341 341 rgmii-device = <&RGMII0>; 342 342 rgmii-channel = <0>; 343 343 zmii-device = <&ZMII0>; ··· 361 361 rx-fifo-size = <4096>; 362 362 tx-fifo-size = <2048>; 363 363 phy-mode = "rgmii"; 364 - phy-map = <0x00000003>; 364 + phy-address = <3>; 365 365 rgmii-device = <&RGMII0>; 366 366 rgmii-channel = <1>; 367 367 zmii-device = <&ZMII0>;
+22 -1
arch/powerpc/boot/treeboot-iss4xx.c
··· 34 34 35 35 BSS_STACK(4096); 36 36 37 + static u32 ibm4xx_memstart; 38 + 37 39 static void iss_4xx_fixups(void) 38 40 { 39 - ibm4xx_sdram_fixup_memsize(); 41 + void *memory; 42 + u32 reg[3]; 43 + 44 + memory = finddevice("/memory"); 45 + if (!memory) 46 + fatal("Can't find memory node\n"); 47 + /* This assumes #address-cells = 2, #size-cells =1 and that */ 48 + getprop(memory, "reg", reg, sizeof(reg)); 49 + if (reg[2]) 50 + /* If the device tree specifies the memory range, use it */ 51 + ibm4xx_memstart = reg[1]; 52 + else 53 + /* othersize, read it from the SDRAM controller */ 54 + ibm4xx_sdram_fixup_memsize(); 55 + } 56 + 57 + static void *iss_4xx_vmlinux_alloc(unsigned long size) 58 + { 59 + return (void *)ibm4xx_memstart; 40 60 } 41 61 42 62 #define SPRN_PIR 0x11E /* Processor Indentification Register */ ··· 68 48 69 49 simple_alloc_init(_end, avail_ram, 128, 64); 70 50 platform_ops.fixups = iss_4xx_fixups; 51 + platform_ops.vmlinux_alloc = iss_4xx_vmlinux_alloc; 71 52 platform_ops.exit = ibm44x_dbcr_reset; 72 53 pir_reg = mfspr(SPRN_PIR); 73 54 fdt_set_boot_cpuid_phys(_dtb_start, pir_reg);
+3 -3
arch/powerpc/configs/44x/iss476-smp_defconfig
··· 3 3 CONFIG_EXPERIMENTAL=y 4 4 CONFIG_SYSVIPC=y 5 5 CONFIG_POSIX_MQUEUE=y 6 + CONFIG_SPARSE_IRQ=y 6 7 CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_SYSFS_DEPRECATED_V2=y 8 8 CONFIG_BLK_DEV_INITRD=y 9 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 10 CONFIG_EXPERT=y ··· 21 21 CONFIG_HZ_100=y 22 22 CONFIG_MATH_EMULATION=y 23 23 CONFIG_IRQ_ALL_CPUS=y 24 - CONFIG_SPARSE_IRQ=y 25 24 CONFIG_CMDLINE_BOOL=y 26 25 CONFIG_CMDLINE="root=/dev/issblk0" 27 26 # CONFIG_PCI is not set 27 + CONFIG_ADVANCED_OPTIONS=y 28 + CONFIG_RELOCATABLE=y 28 29 CONFIG_NET=y 29 30 CONFIG_PACKET=y 30 31 CONFIG_UNIX=y ··· 68 67 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 69 68 CONFIG_EXT3_FS_POSIX_ACL=y 70 69 CONFIG_EXT3_FS_SECURITY=y 71 - CONFIG_INOTIFY=y 72 70 CONFIG_PROC_KCORE=y 73 71 CONFIG_TMPFS=y 74 72 CONFIG_CRAMFS=y
+6 -1
arch/powerpc/include/asm/mmu.h
··· 125 125 return (cur_cpu_spec->mmu_features & feature); 126 126 } 127 127 128 + static inline void mmu_clear_feature(unsigned long feature) 129 + { 130 + cur_cpu_spec->mmu_features &= ~feature; 131 + } 132 + 128 133 extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup; 129 134 130 - /* MMU initialization (64-bit only fo now) */ 135 + /* MMU initialization */ 131 136 extern void early_init_mmu(void); 132 137 extern void early_init_mmu_secondary(void); 133 138
+34 -8
arch/powerpc/kernel/head_44x.S
··· 93 93 94 94 bl early_init 95 95 96 + #ifdef CONFIG_RELOCATABLE 97 + /* 98 + * r25 will contain RPN/ERPN for the start address of memory 99 + * 100 + * Add the difference between KERNELBASE and PAGE_OFFSET to the 101 + * start of physical memory to get kernstart_addr. 102 + */ 103 + lis r3,kernstart_addr@ha 104 + la r3,kernstart_addr@l(r3) 105 + 106 + lis r4,KERNELBASE@h 107 + ori r4,r4,KERNELBASE@l 108 + lis r5,PAGE_OFFSET@h 109 + ori r5,r5,PAGE_OFFSET@l 110 + subf r4,r5,r4 111 + 112 + rlwinm r6,r25,0,28,31 /* ERPN */ 113 + rlwinm r7,r25,0,0,3 /* RPN - assuming 256 MB page size */ 114 + add r7,r7,r4 115 + 116 + stw r6,0(r3) 117 + stw r7,4(r3) 118 + #endif 119 + 96 120 /* 97 121 * Decide what sort of machine this is and initialize the MMU. 98 122 */ ··· 1025 1001 lis r3,PAGE_OFFSET@h 1026 1002 ori r3,r3,PAGE_OFFSET@l 1027 1003 1028 - /* Kernel is at the base of RAM */ 1029 - li r4, 0 /* Load the kernel physical address */ 1030 - 1031 1004 /* Load the kernel PID = 0 */ 1032 1005 li r0,0 1033 1006 mtspr SPRN_PID,r0 ··· 1034 1013 clrrwi r3,r3,12 /* Mask off the effective page number */ 1035 1014 ori r3,r3,PPC47x_TLB0_VALID | PPC47x_TLB0_256M 1036 1015 1037 - /* Word 1 */ 1038 - clrrwi r4,r4,12 /* Mask off the real page number */ 1039 - /* ERPN is 0 for first 4GB page */ 1016 + /* Word 1 - use r25. RPN is the same as the original entry */ 1017 + 1040 1018 /* Word 2 */ 1041 1019 li r5,0 1042 1020 ori r5,r5,PPC47x_TLB2_S_RWX ··· 1046 1026 /* We write to way 0 and bolted 0 */ 1047 1027 lis r0,0x8800 1048 1028 tlbwe r3,r0,0 1049 - tlbwe r4,r0,1 1029 + tlbwe r25,r0,1 1050 1030 tlbwe r5,r0,2 1051 1031 1052 1032 /* ··· 1144 1124 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 1145 1125 mtspr SPRN_IVPR,r4 1146 1126 1147 - addis r22,r22,KERNELBASE@h 1127 + /* 1128 + * If the kernel was loaded at a non-zero 256 MB page, we need to 1129 + * mask off the most significant 4 bits to get the relative address 1130 + * from the start of physical memory 1131 + */ 1132 + rlwinm r22,r22,0,4,31 1133 + addis r22,r22,PAGE_OFFSET@h 1148 1134 mtlr r22 1149 1135 isync 1150 1136 blr
+2
arch/powerpc/kernel/setup_32.c
··· 127 127 /* Do some early initialization based on the flat device tree */ 128 128 early_init_devtree(__va(dt_ptr)); 129 129 130 + early_init_mmu(); 131 + 130 132 probe_machine(); 131 133 132 134 setup_kdump_trampoline();
+10 -3
arch/powerpc/mm/44x_mmu.c
··· 186 186 unsigned long __init mmu_mapin_ram(unsigned long top) 187 187 { 188 188 unsigned long addr; 189 + unsigned long memstart = memstart_addr & ~(PPC_PIN_SIZE - 1); 189 190 190 191 /* Pin in enough TLBs to cover any lowmem not covered by the 191 192 * initial 256M mapping established in head_44x.S */ 192 - for (addr = PPC_PIN_SIZE; addr < lowmem_end_addr; 193 + for (addr = memstart + PPC_PIN_SIZE; addr < lowmem_end_addr; 193 194 addr += PPC_PIN_SIZE) { 194 195 if (mmu_has_feature(MMU_FTR_TYPE_47x)) 195 196 ppc47x_pin_tlb(addr + PAGE_OFFSET, addr); ··· 219 218 void setup_initial_memory_limit(phys_addr_t first_memblock_base, 220 219 phys_addr_t first_memblock_size) 221 220 { 221 + u64 size; 222 + 223 + #ifndef CONFIG_RELOCATABLE 222 224 /* We don't currently support the first MEMBLOCK not mapping 0 223 225 * physical on those processors 224 226 */ 225 227 BUG_ON(first_memblock_base != 0); 228 + #endif 226 229 227 230 /* 44x has a 256M TLB entry pinned at boot */ 228 - memblock_set_current_limit(min_t(u64, first_memblock_size, PPC_PIN_SIZE)); 231 + size = (min_t(u64, first_memblock_size, PPC_PIN_SIZE)); 232 + memblock_set_current_limit(first_memblock_base + size); 229 233 } 230 234 231 235 #ifdef CONFIG_SMP 232 236 void __cpuinit mmu_init_secondary(int cpu) 233 237 { 234 238 unsigned long addr; 239 + unsigned long memstart = memstart_addr & ~(PPC_PIN_SIZE - 1); 235 240 236 241 /* Pin in enough TLBs to cover any lowmem not covered by the 237 242 * initial 256M mapping established in head_44x.S ··· 248 241 * stack. current (r2) isn't initialized, smp_processor_id() 249 242 * will not work, current thread info isn't accessible, ... 250 243 */ 251 - for (addr = PPC_PIN_SIZE; addr < lowmem_end_addr; 244 + for (addr = memstart + PPC_PIN_SIZE; addr < lowmem_end_addr; 252 245 addr += PPC_PIN_SIZE) { 253 246 if (mmu_has_feature(MMU_FTR_TYPE_47x)) 254 247 ppc47x_pin_tlb(addr + PAGE_OFFSET, addr);
+4
arch/powerpc/mm/tlb_hash32.c
··· 177 177 flush_range(vma->vm_mm, start, end); 178 178 } 179 179 EXPORT_SYMBOL(flush_tlb_range); 180 + 181 + void __init early_init_mmu(void) 182 + { 183 + }
+19
arch/powerpc/mm/tlb_nohash.c
··· 35 35 #include <linux/preempt.h> 36 36 #include <linux/spinlock.h> 37 37 #include <linux/memblock.h> 38 + #include <linux/of_fdt.h> 38 39 39 40 #include <asm/tlbflush.h> 40 41 #include <asm/tlb.h> ··· 272 271 EXPORT_SYMBOL(flush_tlb_page); 273 272 274 273 #endif /* CONFIG_SMP */ 274 + 275 + #ifdef CONFIG_PPC_47x 276 + void __init early_init_mmu_47x(void) 277 + { 278 + #ifdef CONFIG_SMP 279 + unsigned long root = of_get_flat_dt_root(); 280 + if (of_get_flat_dt_prop(root, "cooperative-partition", NULL)) 281 + mmu_clear_feature(MMU_FTR_USE_TLBIVAX_BCAST); 282 + #endif /* CONFIG_SMP */ 283 + } 284 + #endif /* CONFIG_PPC_47x */ 275 285 276 286 /* 277 287 * Flush kernel TLB entries in the given range ··· 610 598 611 599 /* Finally limit subsequent allocations */ 612 600 memblock_set_current_limit(first_memblock_base + ppc64_rma_size); 601 + } 602 + #else /* ! CONFIG_PPC64 */ 603 + void __init early_init_mmu(void) 604 + { 605 + #ifdef CONFIG_PPC_47x 606 + early_init_mmu_47x(); 607 + #endif 613 608 } 614 609 #endif /* CONFIG_PPC64 */
+82 -65
arch/powerpc/sysdev/ppc4xx_pci.c
··· 650 650 int (*core_init)(struct device_node *np); 651 651 int (*port_init_hw)(struct ppc4xx_pciex_port *port); 652 652 int (*setup_utl)(struct ppc4xx_pciex_port *port); 653 + void (*check_link)(struct ppc4xx_pciex_port *port); 653 654 }; 654 655 655 656 static struct ppc4xx_pciex_hwops *ppc4xx_pciex_hwops; 656 657 657 658 #ifdef CONFIG_44x 659 + 660 + static int __init ppc4xx_pciex_wait_on_sdr(struct ppc4xx_pciex_port *port, 661 + unsigned int sdr_offset, 662 + unsigned int mask, 663 + unsigned int value, 664 + int timeout_ms) 665 + { 666 + u32 val; 667 + 668 + while(timeout_ms--) { 669 + val = mfdcri(SDR0, port->sdr_base + sdr_offset); 670 + if ((val & mask) == value) { 671 + pr_debug("PCIE%d: Wait on SDR %x success with tm %d (%08x)\n", 672 + port->index, sdr_offset, timeout_ms, val); 673 + return 0; 674 + } 675 + msleep(1); 676 + } 677 + return -1; 678 + } 679 + 680 + static int __init ppc4xx_pciex_port_reset_sdr(struct ppc4xx_pciex_port *port) 681 + { 682 + /* Wait for reset to complete */ 683 + if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1 << 20, 0, 10)) { 684 + printk(KERN_WARNING "PCIE%d: PGRST failed\n", 685 + port->index); 686 + return -1; 687 + } 688 + return 0; 689 + } 690 + 691 + static void __init ppc4xx_pciex_check_link_sdr(struct ppc4xx_pciex_port *port) 692 + { 693 + printk(KERN_INFO "PCIE%d: Checking link...\n", port->index); 694 + 695 + /* Check for card presence detect if supported, if not, just wait for 696 + * link unconditionally. 697 + * 698 + * note that we don't fail if there is no link, we just filter out 699 + * config space accesses. That way, it will be easier to implement 700 + * hotplug later on. 701 + */ 702 + if (!port->has_ibpre || 703 + !ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP, 704 + 1 << 28, 1 << 28, 100)) { 705 + printk(KERN_INFO 706 + "PCIE%d: Device detected, waiting for link...\n", 707 + port->index); 708 + if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP, 709 + 0x1000, 0x1000, 2000)) 710 + printk(KERN_WARNING 711 + "PCIE%d: Link up failed\n", port->index); 712 + else { 713 + printk(KERN_INFO 714 + "PCIE%d: link is up !\n", port->index); 715 + port->link = 1; 716 + } 717 + } else 718 + printk(KERN_INFO "PCIE%d: No device detected.\n", port->index); 719 + } 658 720 659 721 /* Check various reset bits of the 440SPe PCIe core */ 660 722 static int __init ppc440spe_pciex_check_reset(struct device_node *np) ··· 868 806 dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET, 869 807 (1 << 24) | (1 << 16), 1 << 12); 870 808 871 - return 0; 809 + return ppc4xx_pciex_port_reset_sdr(port); 872 810 } 873 811 874 812 static int ppc440speA_pciex_init_port_hw(struct ppc4xx_pciex_port *port) ··· 918 856 .core_init = ppc440spe_pciex_core_init, 919 857 .port_init_hw = ppc440speA_pciex_init_port_hw, 920 858 .setup_utl = ppc440speA_pciex_init_utl, 859 + .check_link = ppc4xx_pciex_check_link_sdr, 921 860 }; 922 861 923 862 static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata = ··· 926 863 .core_init = ppc440spe_pciex_core_init, 927 864 .port_init_hw = ppc440speB_pciex_init_port_hw, 928 865 .setup_utl = ppc440speB_pciex_init_utl, 866 + .check_link = ppc4xx_pciex_check_link_sdr, 929 867 }; 930 868 931 869 static int __init ppc460ex_pciex_core_init(struct device_node *np) ··· 1008 944 1009 945 port->has_ibpre = 1; 1010 946 1011 - return 0; 947 + return ppc4xx_pciex_port_reset_sdr(port); 1012 948 } 1013 949 1014 950 static int ppc460ex_pciex_init_utl(struct ppc4xx_pciex_port *port) ··· 1036 972 .core_init = ppc460ex_pciex_core_init, 1037 973 .port_init_hw = ppc460ex_pciex_init_port_hw, 1038 974 .setup_utl = ppc460ex_pciex_init_utl, 975 + .check_link = ppc4xx_pciex_check_link_sdr, 1039 976 }; 1040 977 1041 978 static int __init ppc460sx_pciex_core_init(struct device_node *np) ··· 1140 1075 1141 1076 port->has_ibpre = 1; 1142 1077 1143 - return 0; 1078 + return ppc4xx_pciex_port_reset_sdr(port); 1144 1079 } 1145 1080 1146 1081 static int ppc460sx_pciex_init_utl(struct ppc4xx_pciex_port *port) ··· 1154 1089 .core_init = ppc460sx_pciex_core_init, 1155 1090 .port_init_hw = ppc460sx_pciex_init_port_hw, 1156 1091 .setup_utl = ppc460sx_pciex_init_utl, 1092 + .check_link = ppc4xx_pciex_check_link_sdr, 1157 1093 }; 1158 1094 1159 1095 #endif /* CONFIG_44x */ ··· 1220 1154 1221 1155 port->has_ibpre = 1; 1222 1156 1223 - return 0; 1157 + return ppc4xx_pciex_port_reset_sdr(port); 1224 1158 } 1225 1159 1226 1160 static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port) ··· 1249 1183 .core_init = ppc405ex_pciex_core_init, 1250 1184 .port_init_hw = ppc405ex_pciex_init_port_hw, 1251 1185 .setup_utl = ppc405ex_pciex_init_utl, 1186 + .check_link = ppc4xx_pciex_check_link_sdr, 1252 1187 }; 1253 1188 1254 1189 #endif /* CONFIG_40x */ 1255 - 1256 1190 1257 1191 /* Check that the core has been initied and if not, do it */ 1258 1192 static int __init ppc4xx_pciex_check_core_init(struct device_node *np) ··· 1327 1261 dcr_write(port->dcrs, DCRO_PEGPL_MSGMSK, 0); 1328 1262 } 1329 1263 1330 - static int __init ppc4xx_pciex_wait_on_sdr(struct ppc4xx_pciex_port *port, 1331 - unsigned int sdr_offset, 1332 - unsigned int mask, 1333 - unsigned int value, 1334 - int timeout_ms) 1335 - { 1336 - u32 val; 1337 - 1338 - while(timeout_ms--) { 1339 - val = mfdcri(SDR0, port->sdr_base + sdr_offset); 1340 - if ((val & mask) == value) { 1341 - pr_debug("PCIE%d: Wait on SDR %x success with tm %d (%08x)\n", 1342 - port->index, sdr_offset, timeout_ms, val); 1343 - return 0; 1344 - } 1345 - msleep(1); 1346 - } 1347 - return -1; 1348 - } 1349 - 1350 1264 static int __init ppc4xx_pciex_port_init(struct ppc4xx_pciex_port *port) 1351 1265 { 1352 1266 int rc = 0; ··· 1337 1291 if (rc != 0) 1338 1292 return rc; 1339 1293 1340 - printk(KERN_INFO "PCIE%d: Checking link...\n", 1341 - port->index); 1342 - 1343 - /* Wait for reset to complete */ 1344 - if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1 << 20, 0, 10)) { 1345 - printk(KERN_WARNING "PCIE%d: PGRST failed\n", 1346 - port->index); 1347 - return -1; 1348 - } 1349 - 1350 - /* Check for card presence detect if supported, if not, just wait for 1351 - * link unconditionally. 1352 - * 1353 - * note that we don't fail if there is no link, we just filter out 1354 - * config space accesses. That way, it will be easier to implement 1355 - * hotplug later on. 1356 - */ 1357 - if (!port->has_ibpre || 1358 - !ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP, 1359 - 1 << 28, 1 << 28, 100)) { 1360 - printk(KERN_INFO 1361 - "PCIE%d: Device detected, waiting for link...\n", 1362 - port->index); 1363 - if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP, 1364 - 0x1000, 0x1000, 2000)) 1365 - printk(KERN_WARNING 1366 - "PCIE%d: Link up failed\n", port->index); 1367 - else { 1368 - printk(KERN_INFO 1369 - "PCIE%d: link is up !\n", port->index); 1370 - port->link = 1; 1371 - } 1372 - } else 1373 - printk(KERN_INFO "PCIE%d: No device detected.\n", port->index); 1294 + if (ppc4xx_pciex_hwops->check_link) 1295 + ppc4xx_pciex_hwops->check_link(port); 1374 1296 1375 1297 /* 1376 1298 * Initialize mapping: disable all regions and configure ··· 1361 1347 /* 1362 1348 * Check for VC0 active and assert RDY. 1363 1349 */ 1364 - if (port->link && 1365 - ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1366 - 1 << 16, 1 << 16, 5000)) { 1367 - printk(KERN_INFO "PCIE%d: VC0 not active\n", port->index); 1368 - port->link = 0; 1350 + if (port->sdr_base) { 1351 + if (port->link && 1352 + ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1353 + 1 << 16, 1 << 16, 5000)) { 1354 + printk(KERN_INFO "PCIE%d: VC0 not active\n", port->index); 1355 + port->link = 0; 1356 + } 1357 + 1358 + dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET, 0, 1 << 20); 1369 1359 } 1370 1360 1371 - dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET, 0, 1 << 20); 1372 1361 msleep(100); 1373 1362 1374 1363 return 0;