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

[PATCH] powerpc: merge code values for identifying platforms

This patch merges platform codes. systemcfg->platform is no longer used,
systemcfg use in general is deprecated as much as possible (and renamed
_systemcfg before it gets completely moved elsewhere in a future patch),
_machine is now used on ppc64 along as ppc32. Platform codes aren't gone
yet but we are getting a step closer. A bunch of asm code in head[_64].S
is also turned into C code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

+234 -331
-1
arch/powerpc/kernel/asm-offsets.c
··· 106 106 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); 107 107 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); 108 108 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); 109 - DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); 110 109 DEFINE(PLATFORM_LPAR, PLATFORM_LPAR); 111 110 112 111 /* paca */
+7 -82
arch/powerpc/kernel/head_64.S
··· 28 28 #include <asm/reg.h> 29 29 #include <asm/page.h> 30 30 #include <asm/mmu.h> 31 - #include <asm/systemcfg.h> 32 31 #include <asm/ppc_asm.h> 33 32 #include <asm/asm-offsets.h> 34 33 #include <asm/bug.h> ··· 1696 1697 * SPRG3 = paca virtual address 1697 1698 */ 1698 1699 _GLOBAL(__secondary_start) 1700 + /* Set thread priority to MEDIUM */ 1701 + HMT_MEDIUM 1699 1702 1700 - HMT_MEDIUM /* Set thread priority to MEDIUM */ 1701 - 1703 + /* Load TOC */ 1702 1704 ld r2,PACATOC(r13) 1703 - li r6,0 1704 - stb r6,PACAPROCENABLED(r13) 1705 1705 1706 - #ifndef CONFIG_PPC_ISERIES 1707 - /* Initialize the page table pointer register. */ 1708 - LOADADDR(r6,_SDR1) 1709 - ld r6,0(r6) /* get the value of _SDR1 */ 1710 - mtspr SPRN_SDR1,r6 /* set the htab location */ 1711 - #endif 1712 - /* Initialize the first segment table (or SLB) entry */ 1713 - ld r3,PACASTABVIRT(r13) /* get addr of segment table */ 1714 - BEGIN_FTR_SECTION 1715 - bl .stab_initialize 1716 - END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 1717 - bl .slb_initialize 1706 + /* Do early setup for that CPU (stab, slb, hash table pointer) */ 1707 + bl .early_setup_secondary 1718 1708 1719 1709 /* Initialize the kernel stack. Just a repeat for iSeries. */ 1720 1710 LOADADDR(r3,current_set) ··· 1712 1724 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD 1713 1725 std r1,PACAKSAVE(r13) 1714 1726 1715 - ld r3,PACASTABREAL(r13) /* get raddr of segment table */ 1716 - ori r4,r3,1 /* turn on valid bit */ 1717 - 1718 - #ifdef CONFIG_PPC_ISERIES 1719 - li r0,-1 /* hypervisor call */ 1720 - li r3,1 1721 - sldi r3,r3,63 /* 0x8000000000000000 */ 1722 - ori r3,r3,4 /* 0x8000000000000004 */ 1723 - sc /* HvCall_setASR */ 1724 - #else 1725 - /* set the ASR */ 1726 - ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */ 1727 - ld r3,0(r3) 1728 - lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1729 - andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1730 - beq 98f /* branch if result is 0 */ 1731 - mfspr r3,SPRN_PVR 1732 - srwi r3,r3,16 1733 - cmpwi r3,0x37 /* SStar */ 1734 - beq 97f 1735 - cmpwi r3,0x36 /* IStar */ 1736 - beq 97f 1737 - cmpwi r3,0x34 /* Pulsar */ 1738 - bne 98f 1739 - 97: li r3,H_SET_ASR /* hcall = H_SET_ASR */ 1740 - HVSC /* Invoking hcall */ 1741 - b 99f 1742 - 98: /* !(rpa hypervisor) || !(star) */ 1743 - mtasr r4 /* set the stab location */ 1744 - 99: 1745 - #endif 1727 + /* Clear backchain so we get nice backtraces */ 1746 1728 li r7,0 1747 1729 mtlr r7 1748 1730 ··· 1735 1777 li r3,0 1736 1778 std r3,0(r1) /* Zero the stack frame pointer */ 1737 1779 bl .start_secondary 1780 + b . 1738 1781 #endif 1739 1782 1740 1783 /* ··· 1855 1896 mr r3,r31 1856 1897 bl .early_setup 1857 1898 1858 - /* set the ASR */ 1859 - ld r3,PACASTABREAL(r13) 1860 - ori r4,r3,1 /* turn on valid bit */ 1861 - ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */ 1862 - ld r3,0(r3) 1863 - lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1864 - andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1865 - beq 98f /* branch if result is 0 */ 1866 - mfspr r3,SPRN_PVR 1867 - srwi r3,r3,16 1868 - cmpwi r3,0x37 /* SStar */ 1869 - beq 97f 1870 - cmpwi r3,0x36 /* IStar */ 1871 - beq 97f 1872 - cmpwi r3,0x34 /* Pulsar */ 1873 - bne 98f 1874 - 97: li r3,H_SET_ASR /* hcall = H_SET_ASR */ 1875 - HVSC /* Invoking hcall */ 1876 - b 99f 1877 - 98: /* !(rpa hypervisor) || !(star) */ 1878 - mtasr r4 /* set the stab location */ 1879 - 99: 1880 - /* Set SDR1 (hash table pointer) */ 1881 - ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */ 1882 - ld r3,0(r3) 1883 - lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1884 - /* Test if bit 0 is set (LPAR bit) */ 1885 - andi. r3,r3,PLATFORM_LPAR 1886 - bne 98f /* branch if result is !0 */ 1887 - LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ 1888 - add r6,r6,r26 1889 - ld r6,0(r6) /* get the value of _SDR1 */ 1890 - mtspr SPRN_SDR1,r6 /* set the htab location */ 1891 - 98: 1892 1899 LOADADDR(r3,.start_here_common) 1893 1900 SET_REG_TO_CONST(r4, MSR_KERNEL) 1894 1901 mtspr SPRN_SRR0,r3
+2 -3
arch/powerpc/kernel/paca.c
··· 15 15 #include <asm/processor.h> 16 16 #include <asm/ptrace.h> 17 17 #include <asm/page.h> 18 - 18 + #include <asm/systemcfg.h> 19 19 #include <asm/lppaca.h> 20 20 #include <asm/iseries/it_lp_queue.h> 21 21 #include <asm/paca.h> ··· 24 24 struct systemcfg data; 25 25 u8 page[PAGE_SIZE]; 26 26 } systemcfg_store __attribute__((__section__(".data.page.aligned"))); 27 - struct systemcfg *systemcfg = &systemcfg_store.data; 28 - EXPORT_SYMBOL(systemcfg); 27 + struct systemcfg *_systemcfg = &systemcfg_store.data; 29 28 30 29 31 30 /* This symbol is provided by the linker - let it fill in the paca
-3
arch/powerpc/kernel/ppc_ksyms.c
··· 188 188 EXPORT_SYMBOL(cuda_request); 189 189 EXPORT_SYMBOL(cuda_poll); 190 190 #endif /* CONFIG_ADB_CUDA */ 191 - #if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_PPC32) 192 - EXPORT_SYMBOL(_machine); 193 - #endif 194 191 #ifdef CONFIG_PPC_PMAC 195 192 EXPORT_SYMBOL(sys_ctrler); 196 193 #endif
+4 -12
arch/powerpc/kernel/prom.c
··· 48 48 #include <asm/machdep.h> 49 49 #include <asm/pSeries_reconfig.h> 50 50 #include <asm/pci-bridge.h> 51 - #ifdef CONFIG_PPC64 52 - #include <asm/systemcfg.h> 53 - #endif 54 51 55 52 #ifdef DEBUG 56 53 #define DBG(fmt...) printk(KERN_ERR fmt) ··· 388 391 389 392 #ifdef CONFIG_PPC64 390 393 /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ 391 - if (systemcfg->platform == PLATFORM_POWERMAC && ic && ic->parent) { 394 + if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { 392 395 char *name = get_property(ic->parent, "name", NULL); 393 396 if (name && !strcmp(name, "u3")) 394 397 np->intrs[intrcount].line += 128; ··· 1158 1161 prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); 1159 1162 if (prop == NULL) 1160 1163 return 0; 1161 - #ifdef CONFIG_PPC64 1162 - systemcfg->platform = *prop; 1163 - #else 1164 1164 #ifdef CONFIG_PPC_MULTIPLATFORM 1165 1165 _machine = *prop; 1166 - #endif 1167 1166 #endif 1168 1167 1169 1168 #ifdef CONFIG_PPC64 ··· 1339 1346 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 1340 1347 lmb_enforce_memory_limit(memory_limit); 1341 1348 lmb_analyze(); 1342 - #ifdef CONFIG_PPC64 1343 - systemcfg->physicalMemorySize = lmb_phys_mem_size(); 1344 - #endif 1345 1349 lmb_reserve(0, __pa(klimit)); 1346 1350 1347 1351 DBG("Phys. mem: %lx\n", lmb_phys_mem_size()); ··· 1905 1915 /* We don't support that function on PowerMac, at least 1906 1916 * not yet 1907 1917 */ 1908 - if (systemcfg->platform == PLATFORM_POWERMAC) 1918 + if (_machine == PLATFORM_POWERMAC) 1909 1919 return -ENODEV; 1910 1920 1911 1921 /* fix up new node's linux_phandle field */ ··· 1989 1999 *next = prop; 1990 2000 write_unlock(&devtree_lock); 1991 2001 2002 + #ifdef CONFIG_PROC_DEVICETREE 1992 2003 /* try to add to proc as well if it was initialized */ 1993 2004 if (np->pde) 1994 2005 proc_device_tree_add_prop(np->pde, prop); 2006 + #endif /* CONFIG_PROC_DEVICETREE */ 1995 2007 1996 2008 return 0; 1997 2009 }
+2 -6
arch/powerpc/kernel/prom_init.c
··· 117 117 #define prom_debug(x...) 118 118 #endif 119 119 120 - #ifdef CONFIG_PPC32 121 - #define PLATFORM_POWERMAC _MACH_Pmac 122 - #define PLATFORM_CHRP _MACH_chrp 123 - #endif 124 - 125 120 126 121 typedef u32 prom_arg_t; 127 122 ··· 2073 2078 /* 2074 2079 * On pSeries, inform the firmware about our capabilities 2075 2080 */ 2076 - if (RELOC(of_platform) & PLATFORM_PSERIES) 2081 + if (RELOC(of_platform) == PLATFORM_PSERIES || 2082 + RELOC(of_platform) == PLATFORM_PSERIES_LPAR) 2077 2083 prom_send_capabilities(); 2078 2084 #endif 2079 2085
+1 -1
arch/powerpc/kernel/rtas-proc.c
··· 259 259 { 260 260 struct proc_dir_entry *entry; 261 261 262 - if (!(systemcfg->platform & PLATFORM_PSERIES)) 262 + if (_machine != PLATFORM_PSERIES && _machine != PLATFORM_PSERIES_LPAR) 263 263 return 1; 264 264 265 265 rtas_node = of_find_node_by_name(NULL, "rtas");
+1 -4
arch/powerpc/kernel/rtas.c
··· 29 29 #include <asm/delay.h> 30 30 #include <asm/uaccess.h> 31 31 #include <asm/lmb.h> 32 - #ifdef CONFIG_PPC64 33 - #include <asm/systemcfg.h> 34 - #endif 35 32 36 33 struct rtas_t rtas = { 37 34 .lock = SPIN_LOCK_UNLOCKED ··· 668 671 * the stop-self token if any 669 672 */ 670 673 #ifdef CONFIG_PPC64 671 - if (systemcfg->platform == PLATFORM_PSERIES_LPAR) 674 + if (_machine == PLATFORM_PSERIES_LPAR) 672 675 rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); 673 676 #endif 674 677 rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region);
+9 -3
arch/powerpc/kernel/setup-common.c
··· 33 33 #include <asm/io.h> 34 34 #include <asm/prom.h> 35 35 #include <asm/processor.h> 36 + #include <asm/systemcfg.h> 36 37 #include <asm/pgtable.h> 37 38 #include <asm/smp.h> 38 39 #include <asm/elf.h> ··· 62 61 #define DBG(fmt...) udbg_printf(fmt) 63 62 #else 64 63 #define DBG(fmt...) 64 + #endif 65 + 66 + #ifdef CONFIG_PPC_MULTIPLATFORM 67 + int _machine = 0; 68 + EXPORT_SYMBOL(_machine); 65 69 #endif 66 70 67 71 /* ··· 519 513 * On pSeries LPAR, we need to know how many cpus 520 514 * could possibly be added to this partition. 521 515 */ 522 - if (systemcfg->platform == PLATFORM_PSERIES_LPAR && 523 - (dn = of_find_node_by_path("/rtas"))) { 516 + if (_machine == PLATFORM_PSERIES_LPAR && 517 + (dn = of_find_node_by_path("/rtas"))) { 524 518 int num_addr_cell, num_size_cell, maxcpus; 525 519 unsigned int *ireg; 526 520 ··· 564 558 cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]); 565 559 } 566 560 567 - systemcfg->processorCount = num_present_cpus(); 561 + _systemcfg->processorCount = num_present_cpus(); 568 562 #endif /* CONFIG_PPC64 */ 569 563 } 570 564 #endif /* CONFIG_SMP */
-2
arch/powerpc/kernel/setup_32.c
··· 72 72 int have_of = 1; 73 73 74 74 #ifdef CONFIG_PPC_MULTIPLATFORM 75 - int _machine = 0; 76 - 77 75 extern void prep_init(void); 78 76 extern void pmac_init(void); 79 77 extern void chrp_init(void);
+44 -21
arch/powerpc/kernel/setup_64.c
··· 100 100 extern unsigned long klimit; 101 101 102 102 extern void mm_init_ppc64(void); 103 - extern void stab_initialize(unsigned long stab); 104 - extern void htab_initialize(void); 105 103 extern void early_init_devtree(void *flat_dt); 106 104 extern void unflatten_device_tree(void); 105 + extern void check_for_initrd(void); 107 106 108 107 int have_of = 1; 109 108 int boot_cpuid = 0; ··· 255 256 * Iterate all ppc_md structures until we find the proper 256 257 * one for the current machine type 257 258 */ 258 - DBG("Probing machine type for platform %x...\n", 259 - systemcfg->platform); 259 + DBG("Probing machine type for platform %x...\n", _machine); 260 260 261 261 for (mach = machines; *mach; mach++) { 262 - if ((*mach)->probe(systemcfg->platform)) 262 + if ((*mach)->probe(_machine)) 263 263 break; 264 264 } 265 265 /* What can we do if we didn't find ? */ ··· 290 292 DBG(" <- early_setup()\n"); 291 293 } 292 294 295 + #ifdef CONFIG_SMP 296 + void early_setup_secondary(void) 297 + { 298 + struct paca_struct *lpaca = get_paca(); 299 + 300 + /* Mark enabled in PACA */ 301 + lpaca->proc_enabled = 0; 302 + 303 + /* Initialize hash table for that CPU */ 304 + htab_initialize_secondary(); 305 + 306 + /* Initialize STAB/SLB. We use a virtual address as it works 307 + * in real mode on pSeries and we want a virutal address on 308 + * iSeries anyway 309 + */ 310 + if (cpu_has_feature(CPU_FTR_SLB)) 311 + slb_initialize(); 312 + else 313 + stab_initialize(lpaca->stab_addr); 314 + } 315 + 316 + #endif /* CONFIG_SMP */ 293 317 294 318 #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) 295 319 void smp_release_cpus(void) ··· 337 317 #endif /* CONFIG_SMP || CONFIG_KEXEC */ 338 318 339 319 /* 340 - * Initialize some remaining members of the ppc64_caches and systemcfg structures 320 + * Initialize some remaining members of the ppc64_caches and systemcfg 321 + * structures 341 322 * (at least until we get rid of them completely). This is mostly some 342 323 * cache informations about the CPU that will be used by cache flush 343 324 * routines and/or provided to userland ··· 363 342 const char *dc, *ic; 364 343 365 344 /* Then read cache informations */ 366 - if (systemcfg->platform == PLATFORM_POWERMAC) { 345 + if (_machine == PLATFORM_POWERMAC) { 367 346 dc = "d-cache-block-size"; 368 347 ic = "i-cache-block-size"; 369 348 } else { ··· 383 362 DBG("Argh, can't find dcache properties ! " 384 363 "sizep: %p, lsizep: %p\n", sizep, lsizep); 385 364 386 - systemcfg->dcache_size = ppc64_caches.dsize = size; 387 - systemcfg->dcache_line_size = 365 + _systemcfg->dcache_size = ppc64_caches.dsize = size; 366 + _systemcfg->dcache_line_size = 388 367 ppc64_caches.dline_size = lsize; 389 368 ppc64_caches.log_dline_size = __ilog2(lsize); 390 369 ppc64_caches.dlines_per_page = PAGE_SIZE / lsize; ··· 401 380 DBG("Argh, can't find icache properties ! " 402 381 "sizep: %p, lsizep: %p\n", sizep, lsizep); 403 382 404 - systemcfg->icache_size = ppc64_caches.isize = size; 405 - systemcfg->icache_line_size = 383 + _systemcfg->icache_size = ppc64_caches.isize = size; 384 + _systemcfg->icache_line_size = 406 385 ppc64_caches.iline_size = lsize; 407 386 ppc64_caches.log_iline_size = __ilog2(lsize); 408 387 ppc64_caches.ilines_per_page = PAGE_SIZE / lsize; ··· 410 389 } 411 390 412 391 /* Add an eye catcher and the systemcfg layout version number */ 413 - strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); 414 - systemcfg->version.major = SYSTEMCFG_MAJOR; 415 - systemcfg->version.minor = SYSTEMCFG_MINOR; 416 - systemcfg->processor = mfspr(SPRN_PVR); 392 + strcpy(_systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); 393 + _systemcfg->version.major = SYSTEMCFG_MAJOR; 394 + _systemcfg->version.minor = SYSTEMCFG_MINOR; 395 + _systemcfg->processor = mfspr(SPRN_PVR); 396 + _systemcfg->platform = _machine; 397 + _systemcfg->physicalMemorySize = lmb_phys_mem_size(); 417 398 418 399 DBG(" <- initialize_cache_info()\n"); 419 400 } ··· 504 481 printk("-----------------------------------------------------\n"); 505 482 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 506 483 printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); 507 - printk("systemcfg = 0x%p\n", systemcfg); 508 - printk("systemcfg->platform = 0x%x\n", systemcfg->platform); 509 - printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount); 510 - printk("systemcfg->physicalMemorySize = 0x%lx\n", systemcfg->physicalMemorySize); 484 + printk("systemcfg = 0x%p\n", _systemcfg); 485 + printk("systemcfg->platform = 0x%x\n", _systemcfg->platform); 486 + printk("systemcfg->processorCount = 0x%lx\n", _systemcfg->processorCount); 487 + printk("systemcfg->physicalMemorySize = 0x%lx\n", _systemcfg->physicalMemorySize); 511 488 printk("ppc64_caches.dcache_line_size = 0x%x\n", 512 489 ppc64_caches.dline_size); 513 490 printk("ppc64_caches.icache_line_size = 0x%x\n", ··· 589 566 for (i = 0; i < __NR_syscalls; i++) { 590 567 if (sys_call_table[i*2] != sys_ni_syscall) { 591 568 count64++; 592 - systemcfg->syscall_map_64[i >> 5] |= 569 + _systemcfg->syscall_map_64[i >> 5] |= 593 570 0x80000000UL >> (i & 0x1f); 594 571 } 595 572 if (sys_call_table[i*2+1] != sys_ni_syscall) { 596 573 count32++; 597 - systemcfg->syscall_map_32[i >> 5] |= 574 + _systemcfg->syscall_map_32[i >> 5] |= 598 575 0x80000000UL >> (i & 0x1f); 599 576 } 600 577 }
+4 -1
arch/powerpc/kernel/smp.c
··· 44 44 #include <asm/cputable.h> 45 45 #include <asm/system.h> 46 46 #include <asm/mpic.h> 47 + #include <asm/systemcfg.h> 47 48 #ifdef CONFIG_PPC64 48 49 #include <asm/paca.h> 49 50 #endif ··· 369 368 if (cpu == boot_cpuid) 370 369 return -EBUSY; 371 370 372 - systemcfg->processorCount--; 371 + #ifdef CONFIG_PPC64 372 + _systemcfg->processorCount--; 373 + #endif 373 374 cpu_clear(cpu, cpu_online_map); 374 375 fixup_irqs(cpu_online_map); 375 376 return 0;
-1
arch/powerpc/kernel/sys_ppc32.c
··· 52 52 #include <asm/semaphore.h> 53 53 #include <asm/time.h> 54 54 #include <asm/mmu_context.h> 55 - #include <asm/systemcfg.h> 56 55 #include <asm/ppc-pci.h> 57 56 58 57 /* readdir & getdents */
+15 -14
arch/powerpc/kernel/time.c
··· 271 271 * tb_to_xs and stamp_xsec values are consistent. If not, then it 272 272 * loops back and reads them again until this criteria is met. 273 273 */ 274 - ++(systemcfg->tb_update_count); 274 + ++(_systemcfg->tb_update_count); 275 275 smp_wmb(); 276 - systemcfg->tb_orig_stamp = new_tb_stamp; 277 - systemcfg->stamp_xsec = new_stamp_xsec; 278 - systemcfg->tb_to_xs = new_tb_to_xs; 276 + _systemcfg->tb_orig_stamp = new_tb_stamp; 277 + _systemcfg->stamp_xsec = new_stamp_xsec; 278 + _systemcfg->tb_to_xs = new_tb_to_xs; 279 279 smp_wmb(); 280 - ++(systemcfg->tb_update_count); 280 + ++(_systemcfg->tb_update_count); 281 281 #endif 282 282 } 283 283 ··· 357 357 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 358 358 tb_to_xs = divres.result_low; 359 359 do_gtod.varp->tb_to_xs = tb_to_xs; 360 - systemcfg->tb_ticks_per_sec = tb_ticks_per_sec; 361 - systemcfg->tb_to_xs = tb_to_xs; 360 + _systemcfg->tb_ticks_per_sec = 361 + tb_ticks_per_sec; 362 + _systemcfg->tb_to_xs = tb_to_xs; 362 363 } 363 364 else { 364 365 printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" ··· 560 559 update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs); 561 560 562 561 #ifdef CONFIG_PPC64 563 - systemcfg->tz_minuteswest = sys_tz.tz_minuteswest; 564 - systemcfg->tz_dsttime = sys_tz.tz_dsttime; 562 + _systemcfg->tz_minuteswest = sys_tz.tz_minuteswest; 563 + _systemcfg->tz_dsttime = sys_tz.tz_dsttime; 565 564 #endif 566 565 567 566 write_sequnlock_irqrestore(&xtime_lock, flags); ··· 712 711 do_gtod.varp->tb_to_xs = tb_to_xs; 713 712 do_gtod.tb_to_us = tb_to_us; 714 713 #ifdef CONFIG_PPC64 715 - systemcfg->tb_orig_stamp = tb_last_jiffy; 716 - systemcfg->tb_update_count = 0; 717 - systemcfg->tb_ticks_per_sec = tb_ticks_per_sec; 718 - systemcfg->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; 719 - systemcfg->tb_to_xs = tb_to_xs; 714 + _systemcfg->tb_orig_stamp = tb_last_jiffy; 715 + _systemcfg->tb_update_count = 0; 716 + _systemcfg->tb_ticks_per_sec = tb_ticks_per_sec; 717 + _systemcfg->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; 718 + _systemcfg->tb_to_xs = tb_to_xs; 720 719 #endif 721 720 722 721 time_freq = 0;
+1 -1
arch/powerpc/kernel/traps.c
··· 129 129 nl = 1; 130 130 #endif 131 131 #ifdef CONFIG_PPC64 132 - switch (systemcfg->platform) { 132 + switch (_machine) { 133 133 case PLATFORM_PSERIES: 134 134 printk("PSERIES "); 135 135 nl = 1;
+20 -9
arch/powerpc/mm/hash_utils_64.c
··· 84 84 extern unsigned long dart_tablebase; 85 85 #endif /* CONFIG_U3_DART */ 86 86 87 + static unsigned long _SDR1; 88 + struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; 89 + 87 90 hpte_t *htab_address; 88 91 unsigned long htab_hash_mask; 89 - unsigned long _SDR1; 90 - struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; 91 92 int mmu_linear_psize = MMU_PAGE_4K; 92 93 int mmu_virtual_psize = MMU_PAGE_4K; 93 94 #ifdef CONFIG_HUGETLB_PAGE ··· 166 165 * normal insert callback here. 167 166 */ 168 167 #ifdef CONFIG_PPC_ISERIES 169 - if (systemcfg->platform == PLATFORM_ISERIES_LPAR) 168 + if (_machine == PLATFORM_ISERIES_LPAR) 170 169 ret = iSeries_hpte_insert(hpteg, va, 171 170 virt_to_abs(paddr), 172 171 tmp_mode, ··· 175 174 else 176 175 #endif 177 176 #ifdef CONFIG_PPC_PSERIES 178 - if (systemcfg->platform & PLATFORM_LPAR) 177 + if (_machine & PLATFORM_LPAR) 179 178 ret = pSeries_lpar_hpte_insert(hpteg, va, 180 179 virt_to_abs(paddr), 181 180 tmp_mode, ··· 294 293 * Not in the device-tree, let's fallback on known size 295 294 * list for 16M capable GP & GR 296 295 */ 297 - if ((systemcfg->platform != PLATFORM_ISERIES_LPAR) && 296 + if ((_machine != PLATFORM_ISERIES_LPAR) && 298 297 cpu_has_feature(CPU_FTR_16M_PAGE)) 299 298 memcpy(mmu_psize_defs, mmu_psize_defaults_gp, 300 299 sizeof(mmu_psize_defaults_gp)); ··· 365 364 366 365 static unsigned long __init htab_get_table_size(void) 367 366 { 368 - unsigned long rnd_mem_size, pteg_count; 367 + unsigned long mem_size, rnd_mem_size, pteg_count; 369 368 370 369 /* If hash size isn't already provided by the platform, we try to 371 370 * retreive it from the device-tree. If it's not there neither, we ··· 377 376 return 1UL << ppc64_pft_size; 378 377 379 378 /* round mem_size up to next power of 2 */ 380 - rnd_mem_size = 1UL << __ilog2(systemcfg->physicalMemorySize); 381 - if (rnd_mem_size < systemcfg->physicalMemorySize) 379 + mem_size = lmb_phys_mem_size(); 380 + rnd_mem_size = 1UL << __ilog2(mem_size); 381 + if (rnd_mem_size < mem_size) 382 382 rnd_mem_size <<= 1; 383 383 384 384 /* # pages / 2 */ ··· 421 419 422 420 htab_hash_mask = pteg_count - 1; 423 421 424 - if (systemcfg->platform & PLATFORM_LPAR) { 422 + if (platform_is_lpar()) { 425 423 /* Using a hypervisor which owns the htab */ 426 424 htab_address = NULL; 427 425 _SDR1 = 0; ··· 442 440 443 441 /* Initialize the HPT with no entries */ 444 442 memset((void *)table, 0, htab_size_bytes); 443 + 444 + /* Set SDR1 */ 445 + mtspr(SPRN_SDR1, _SDR1); 445 446 } 446 447 447 448 mode_rw = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX; ··· 513 508 } 514 509 #undef KB 515 510 #undef MB 511 + 512 + void __init htab_initialize_secondary(void) 513 + { 514 + if (!platform_is_lpar()) 515 + mtspr(SPRN_SDR1, _SDR1); 516 + } 516 517 517 518 /* 518 519 * Called by asm hashtable.S for doing lazy icache flush
+20 -1
arch/powerpc/mm/stab.c
··· 20 20 #include <asm/cputable.h> 21 21 #include <asm/lmb.h> 22 22 #include <asm/abs_addr.h> 23 + #include <asm/firmware.h> 23 24 24 25 struct stab_entry { 25 26 unsigned long esid_data; ··· 257 256 258 257 paca[cpu].stab_addr = newstab; 259 258 paca[cpu].stab_real = virt_to_abs(newstab); 260 - printk(KERN_DEBUG "Segment table for CPU %d at 0x%lx " 259 + printk(KERN_INFO "Segment table for CPU %d at 0x%lx " 261 260 "virtual, 0x%lx absolute\n", 262 261 cpu, paca[cpu].stab_addr, paca[cpu].stab_real); 263 262 } ··· 271 270 void stab_initialize(unsigned long stab) 272 271 { 273 272 unsigned long vsid = get_kernel_vsid(KERNELBASE); 273 + unsigned long stabreal; 274 274 275 275 asm volatile("isync; slbia; isync":::"memory"); 276 276 make_ste(stab, GET_ESID(KERNELBASE), vsid); 277 277 278 278 /* Order update */ 279 279 asm volatile("sync":::"memory"); 280 + 281 + /* Set ASR */ 282 + stabreal = get_paca()->stab_real | 0x1ul; 283 + 284 + #ifdef CONFIG_PPC_ISERIES 285 + if (firmware_has_feature(FW_FEATURE_ISERIES)) { 286 + HvCall1(HvCallBaseSetASR, stabreal); 287 + return; 288 + } 289 + #endif /* CONFIG_PPC_ISERIES */ 290 + #ifdef CONFIG_PPC_PSERIES 291 + if (platform_is_lpar()) { 292 + plpar_hcall_norets(H_SET_ASR, stabreal); 293 + return; 294 + } 295 + #endif 296 + mtspr(SPRN_ASR, stabreal); 280 297 }
+1 -2
arch/powerpc/oprofile/op_model_power4.c
··· 233 233 mmcra = mfspr(SPRN_MMCRA); 234 234 235 235 /* Were we in the hypervisor? */ 236 - if ((systemcfg->platform == PLATFORM_PSERIES_LPAR) && 237 - (mmcra & MMCRA_SIHV)) 236 + if (platform_is_lpar() && (mmcra & MMCRA_SIHV)) 238 237 /* function descriptor madness */ 239 238 return *((unsigned long *)hypervisor_bucket); 240 239
+14 -9
arch/powerpc/platforms/iseries/setup.c
··· 39 39 #include <asm/sections.h> 40 40 #include <asm/iommu.h> 41 41 #include <asm/firmware.h> 42 + #include <asm/systemcfg.h> 42 43 43 44 #include <asm/time.h> 44 45 #include <asm/paca.h> ··· 72 71 #endif 73 72 74 73 /* Function Prototypes */ 75 - static void build_iSeries_Memory_Map(void); 74 + static unsigned long build_iSeries_Memory_Map(void); 76 75 static void iseries_shared_idle(void); 77 76 static void iseries_dedicated_idle(void); 78 77 #ifdef CONFIG_PCI ··· 404 403 * a table used to translate Linux's physical addresses to these 405 404 * absolute addresses. Absolute addresses are needed when 406 405 * communicating with the hypervisor (e.g. to build HPT entries) 406 + * 407 + * Returns the physical memory size 407 408 */ 408 409 409 - static void __init build_iSeries_Memory_Map(void) 410 + static unsigned long __init build_iSeries_Memory_Map(void) 410 411 { 411 412 u32 loadAreaFirstChunk, loadAreaLastChunk, loadAreaSize; 412 413 u32 nextPhysChunk; ··· 541 538 * which should be equal to 542 539 * nextPhysChunk 543 540 */ 544 - systemcfg->physicalMemorySize = chunk_to_addr(nextPhysChunk); 541 + return chunk_to_addr(nextPhysChunk); 545 542 } 546 543 547 544 /* ··· 567 564 printk("Max physical processors = %d\n", 568 565 itVpdAreas.xSlicMaxPhysicalProcs); 569 566 570 - systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR; 571 - printk("Processor version = %x\n", systemcfg->processor); 567 + _systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR; 568 + printk("Processor version = %x\n", _systemcfg->processor); 572 569 } 573 570 574 571 static void iSeries_show_cpuinfo(struct seq_file *m) ··· 932 929 dt_end_node(dt); 933 930 } 934 931 935 - void build_flat_dt(struct iseries_flat_dt *dt) 932 + void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size) 936 933 { 937 934 u64 tmp[2]; 938 935 ··· 948 945 dt_prop_str(dt, "name", "memory"); 949 946 dt_prop_str(dt, "device_type", "memory"); 950 947 tmp[0] = 0; 951 - tmp[1] = systemcfg->physicalMemorySize; 948 + tmp[1] = phys_mem_size; 952 949 dt_prop_u64_list(dt, "reg", tmp, 2); 953 950 dt_end_node(dt); 954 951 ··· 968 965 969 966 void * __init iSeries_early_setup(void) 970 967 { 968 + unsigned long phys_mem_size; 969 + 971 970 iSeries_fixup_klimit(); 972 971 973 972 /* 974 973 * Initialize the table which translate Linux physical addresses to 975 974 * AS/400 absolute addresses 976 975 */ 977 - build_iSeries_Memory_Map(); 976 + phys_mem_size = build_iSeries_Memory_Map(); 978 977 979 978 iSeries_get_cmdline(); 980 979 ··· 986 981 /* Parse early parameters, in particular mem=x */ 987 982 parse_early_param(); 988 983 989 - build_flat_dt(&iseries_dt); 984 + build_flat_dt(&iseries_dt, phys_mem_size); 990 985 991 986 return (void *) __pa(&iseries_dt); 992 987 }
+1 -2
arch/powerpc/platforms/pseries/eeh.c
··· 32 32 #include <asm/machdep.h> 33 33 #include <asm/ppc-pci.h> 34 34 #include <asm/rtas.h> 35 - #include <asm/systemcfg.h> 36 35 37 36 #undef DEBUG 38 37 ··· 1185 1186 { 1186 1187 struct proc_dir_entry *e; 1187 1188 1188 - if (systemcfg->platform & PLATFORM_PSERIES) { 1189 + if (platform_is_pseries()) { 1189 1190 e = create_proc_entry("ppc64/eeh", 0, NULL); 1190 1191 if (e) 1191 1192 e->proc_fops = &proc_eeh_operations;
+1 -2
arch/powerpc/platforms/pseries/iommu.c
··· 42 42 #include <asm/machdep.h> 43 43 #include <asm/abs_addr.h> 44 44 #include <asm/pSeries_reconfig.h> 45 - #include <asm/systemcfg.h> 46 45 #include <asm/firmware.h> 47 46 #include <asm/tce.h> 48 47 #include <asm/ppc-pci.h> ··· 581 582 return; 582 583 } 583 584 584 - if (systemcfg->platform & PLATFORM_LPAR) { 585 + if (platform_is_lpar()) { 585 586 if (firmware_has_feature(FW_FEATURE_MULTITCE)) { 586 587 ppc_md.tce_build = tce_buildmulti_pSeriesLP; 587 588 ppc_md.tce_free = tce_freemulti_pSeriesLP;
+1 -1
arch/powerpc/platforms/pseries/pci.c
··· 123 123 int i; 124 124 unsigned int reg; 125 125 126 - if (!(systemcfg->platform & PLATFORM_PSERIES)) 126 + if (!platform_is_pseries()) 127 127 return; 128 128 129 129 printk("Using INTC for W82c105 IDE controller.\n");
+1 -1
arch/powerpc/platforms/pseries/reconfig.c
··· 408 408 { 409 409 struct proc_dir_entry *ent; 410 410 411 - if (!(systemcfg->platform & PLATFORM_PSERIES)) 411 + if (!platform_is_pseries()) 412 412 return 0; 413 413 414 414 ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
+5 -3
arch/powerpc/platforms/pseries/rtasd.c
··· 482 482 { 483 483 struct proc_dir_entry *entry; 484 484 485 - /* No RTAS, only warn if we are on a pSeries box */ 485 + if (!platform_is_pseries()) 486 + return 0; 487 + 488 + /* No RTAS */ 486 489 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { 487 - if (systemcfg->platform & PLATFORM_PSERIES) 488 - printk(KERN_INFO "rtasd: no event-scan on system\n"); 490 + printk(KERN_INFO "rtasd: no event-scan on system\n"); 489 491 return 1; 490 492 } 491 493
+4 -4
arch/powerpc/platforms/pseries/setup.c
··· 249 249 ppc_md.idle_loop = default_idle; 250 250 } 251 251 252 - if (systemcfg->platform & PLATFORM_LPAR) 252 + if (platform_is_lpar()) 253 253 ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; 254 254 else 255 255 ppc_md.enable_pmcs = power4_enable_pmcs; ··· 378 378 379 379 fw_feature_init(); 380 380 381 - if (systemcfg->platform & PLATFORM_LPAR) 381 + if (platform_is_lpar()) 382 382 hpte_init_lpar(); 383 383 else { 384 384 hpte_init_native(); ··· 388 388 389 389 generic_find_legacy_serial_ports(&physport, &default_speed); 390 390 391 - if (systemcfg->platform & PLATFORM_LPAR) 391 + if (platform_is_lpar()) 392 392 find_udbg_vterm(); 393 393 else if (physport) { 394 394 /* Map the uart for udbg. */ ··· 592 592 593 593 static int pSeries_pci_probe_mode(struct pci_bus *bus) 594 594 { 595 - if (systemcfg->platform & PLATFORM_LPAR) 595 + if (platform_is_lpar()) 596 596 return PCI_PROBE_DEVTREE; 597 597 return PCI_PROBE_NORMAL; 598 598 }
+3 -2
arch/powerpc/platforms/pseries/smp.c
··· 46 46 #include <asm/rtas.h> 47 47 #include <asm/pSeries_reconfig.h> 48 48 #include <asm/mpic.h> 49 + #include <asm/systemcfg.h> 49 50 50 51 #include "plpar_wrappers.h" 51 52 ··· 97 96 int cpu = smp_processor_id(); 98 97 99 98 cpu_clear(cpu, cpu_online_map); 100 - systemcfg->processorCount--; 99 + _systemcfg->processorCount--; 101 100 102 101 /*fix boot_cpuid here*/ 103 102 if (cpu == boot_cpuid) ··· 442 441 smp_ops->cpu_die = pSeries_cpu_die; 443 442 444 443 /* Processors can be added/removed only on LPAR */ 445 - if (systemcfg->platform == PLATFORM_PSERIES_LPAR) 444 + if (platform_is_lpar()) 446 445 pSeries_reconfig_notifier_register(&pSeries_smp_nb); 447 446 #endif 448 447
+3 -3
arch/powerpc/platforms/pseries/xics.c
··· 545 545 of_node_put(np); 546 546 } 547 547 548 - if (systemcfg->platform == PLATFORM_PSERIES) { 548 + if (platform_is_lpar()) 549 + ops = &pSeriesLP_ops; 550 + else { 549 551 #ifdef CONFIG_SMP 550 552 for_each_cpu(i) { 551 553 int hard_id; ··· 563 561 #else 564 562 xics_per_cpu[0] = ioremap(intr_base, intr_size); 565 563 #endif /* CONFIG_SMP */ 566 - } else if (systemcfg->platform == PLATFORM_PSERIES_LPAR) { 567 - ops = &pSeriesLP_ops; 568 564 } 569 565 570 566 xics_8259_pic.enable = i8259_pic.enable;
-3
arch/ppc/kernel/ppc_ksyms.c
··· 217 217 EXPORT_SYMBOL(cuda_request); 218 218 EXPORT_SYMBOL(cuda_poll); 219 219 #endif /* CONFIG_ADB_CUDA */ 220 - #ifdef CONFIG_PPC_MULTIPLATFORM 221 - EXPORT_SYMBOL(_machine); 222 - #endif 223 220 #ifdef CONFIG_PPC_PMAC 224 221 EXPORT_SYMBOL(sys_ctrler); 225 222 EXPORT_SYMBOL(pmac_newworld);
+1
arch/ppc/kernel/setup.c
··· 76 76 77 77 #ifdef CONFIG_PPC_MULTIPLATFORM 78 78 int _machine = 0; 79 + EXPORT_SYMBOL(_machine); 79 80 80 81 extern void prep_init(unsigned long r3, unsigned long r4, 81 82 unsigned long r5, unsigned long r6, unsigned long r7);
-1
arch/ppc64/kernel/asm-offsets.c
··· 74 74 DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); 75 75 DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); 76 76 DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); 77 - DEFINE(PLATFORM, offsetof(struct systemcfg, platform)); 78 77 DEFINE(PLATFORM_LPAR, PLATFORM_LPAR); 79 78 80 79 /* paca */
+2 -80
arch/ppc64/kernel/head.S
··· 28 28 #include <asm/processor.h> 29 29 #include <asm/page.h> 30 30 #include <asm/mmu.h> 31 - #include <asm/systemcfg.h> 32 31 #include <asm/ppc_asm.h> 33 32 #include <asm/asm-offsets.h> 34 33 #include <asm/bug.h> ··· 1700 1701 HMT_MEDIUM /* Set thread priority to MEDIUM */ 1701 1702 1702 1703 ld r2,PACATOC(r13) 1703 - li r6,0 1704 - stb r6,PACAPROCENABLED(r13) 1705 1704 1706 - #ifndef CONFIG_PPC_ISERIES 1707 - /* Initialize the page table pointer register. */ 1708 - LOADADDR(r6,_SDR1) 1709 - ld r6,0(r6) /* get the value of _SDR1 */ 1710 - mtspr SPRN_SDR1,r6 /* set the htab location */ 1711 - #endif 1712 - /* Initialize the first segment table (or SLB) entry */ 1713 - ld r3,PACASTABVIRT(r13) /* get addr of segment table */ 1714 - BEGIN_FTR_SECTION 1715 - bl .stab_initialize 1716 - END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 1717 - bl .slb_initialize 1705 + /* Do early setup for that CPU */ 1706 + bl .early_setup_secondary 1718 1707 1719 1708 /* Initialize the kernel stack. Just a repeat for iSeries. */ 1720 1709 LOADADDR(r3,current_set) ··· 1711 1724 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD 1712 1725 std r1,PACAKSAVE(r13) 1713 1726 1714 - ld r3,PACASTABREAL(r13) /* get raddr of segment table */ 1715 - ori r4,r3,1 /* turn on valid bit */ 1716 - 1717 - #ifdef CONFIG_PPC_ISERIES 1718 - li r0,-1 /* hypervisor call */ 1719 - li r3,1 1720 - sldi r3,r3,63 /* 0x8000000000000000 */ 1721 - ori r3,r3,4 /* 0x8000000000000004 */ 1722 - sc /* HvCall_setASR */ 1723 - #else 1724 - /* set the ASR */ 1725 - ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */ 1726 - ld r3,0(r3) 1727 - lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1728 - andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1729 - beq 98f /* branch if result is 0 */ 1730 - mfspr r3,SPRN_PVR 1731 - srwi r3,r3,16 1732 - cmpwi r3,0x37 /* SStar */ 1733 - beq 97f 1734 - cmpwi r3,0x36 /* IStar */ 1735 - beq 97f 1736 - cmpwi r3,0x34 /* Pulsar */ 1737 - bne 98f 1738 - 97: li r3,H_SET_ASR /* hcall = H_SET_ASR */ 1739 - HVSC /* Invoking hcall */ 1740 - b 99f 1741 - 98: /* !(rpa hypervisor) || !(star) */ 1742 - mtasr r4 /* set the stab location */ 1743 - 99: 1744 - #endif 1745 1727 li r7,0 1746 1728 mtlr r7 1747 1729 ··· 1852 1896 mr r3,r31 1853 1897 bl .early_setup 1854 1898 1855 - /* set the ASR */ 1856 - ld r3,PACASTABREAL(r13) 1857 - ori r4,r3,1 /* turn on valid bit */ 1858 - ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */ 1859 - ld r3,0(r3) 1860 - lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1861 - andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ 1862 - beq 98f /* branch if result is 0 */ 1863 - mfspr r3,SPRN_PVR 1864 - srwi r3,r3,16 1865 - cmpwi r3,0x37 /* SStar */ 1866 - beq 97f 1867 - cmpwi r3,0x36 /* IStar */ 1868 - beq 97f 1869 - cmpwi r3,0x34 /* Pulsar */ 1870 - bne 98f 1871 - 97: li r3,H_SET_ASR /* hcall = H_SET_ASR */ 1872 - HVSC /* Invoking hcall */ 1873 - b 99f 1874 - 98: /* !(rpa hypervisor) || !(star) */ 1875 - mtasr r4 /* set the stab location */ 1876 - 99: 1877 - /* Set SDR1 (hash table pointer) */ 1878 - ld r3,systemcfg@got(r2) /* r3 = ptr to systemcfg */ 1879 - ld r3,0(r3) 1880 - lwz r3,PLATFORM(r3) /* r3 = platform flags */ 1881 - /* Test if bit 0 is set (LPAR bit) */ 1882 - andi. r3,r3,PLATFORM_LPAR 1883 - bne 98f /* branch if result is !0 */ 1884 - LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ 1885 - sub r6,r6,r26 1886 - ld r6,0(r6) /* get the value of _SDR1 */ 1887 - mtspr SPRN_SDR1,r6 /* set the htab location */ 1888 - 98: 1889 1899 LOADADDR(r3,.start_here_common) 1890 1900 SET_REG_TO_CONST(r4, MSR_KERNEL) 1891 1901 mtspr SPRN_SRR0,r3
-1
arch/ppc64/kernel/idle.c
··· 26 26 #include <asm/processor.h> 27 27 #include <asm/cputable.h> 28 28 #include <asm/time.h> 29 - #include <asm/systemcfg.h> 30 29 #include <asm/machdep.h> 31 30 #include <asm/smp.h> 32 31
+2 -1
arch/ppc64/kernel/lparcfg.c
··· 35 35 #include <asm/time.h> 36 36 #include <asm/iseries/it_exp_vpd_panel.h> 37 37 #include <asm/prom.h> 38 + #include <asm/systemcfg.h> 38 39 39 40 #define MODULE_VERS "1.6" 40 41 #define MODULE_NAME "lparcfg" ··· 372 371 lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL); 373 372 374 373 if (lrdrp == NULL) { 375 - partition_potential_processors = systemcfg->processorCount; 374 + partition_potential_processors = _systemcfg->processorCount; 376 375 } else { 377 376 partition_potential_processors = *(lrdrp + 4); 378 377 }
+2 -3
arch/ppc64/kernel/nvram.c
··· 31 31 #include <asm/rtas.h> 32 32 #include <asm/prom.h> 33 33 #include <asm/machdep.h> 34 - #include <asm/systemcfg.h> 35 34 36 35 #undef DEBUG_NVRAM 37 36 ··· 166 167 case IOC_NVRAM_GET_OFFSET: { 167 168 int part, offset; 168 169 169 - if (systemcfg->platform != PLATFORM_POWERMAC) 170 + if (_machine != PLATFORM_POWERMAC) 170 171 return -EINVAL; 171 172 if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) 172 173 return -EFAULT; ··· 449 450 * in our nvram, as Apple defined partitions use pretty much 450 451 * all of the space 451 452 */ 452 - if (systemcfg->platform == PLATFORM_POWERMAC) 453 + if (_machine == PLATFORM_POWERMAC) 453 454 return -ENOSPC; 454 455 455 456 /* see if we have an OS partition that meets our needs.
+1 -4
arch/ppc64/kernel/pci.c
··· 1277 1277 * G5 machines... So when something asks for bus 0 io base 1278 1278 * (bus 0 is HT root), we return the AGP one instead. 1279 1279 */ 1280 - #ifdef CONFIG_PPC_PMAC 1281 - if (systemcfg->platform == PLATFORM_POWERMAC && 1282 - machine_is_compatible("MacRISC4")) 1280 + if (machine_is_compatible("MacRISC4")) 1283 1281 if (in_bus == 0) 1284 1282 in_bus = 0xf0; 1285 - #endif /* CONFIG_PPC_PMAC */ 1286 1283 1287 1284 /* That syscall isn't quite compatible with PCI domains, but it's 1288 1285 * used on pre-domains setup. We return the first match
+2 -2
arch/ppc64/kernel/proc_ppc64.c
··· 53 53 if (!root) 54 54 return 1; 55 55 56 - if (!(systemcfg->platform & (PLATFORM_PSERIES | PLATFORM_CELL))) 56 + if (!(platform_is_pseries() || _machine == PLATFORM_CELL)) 57 57 return 0; 58 58 59 59 if (!proc_mkdir("rtas", root)) ··· 74 74 if (!pde) 75 75 return 1; 76 76 pde->nlink = 1; 77 - pde->data = systemcfg; 77 + pde->data = _systemcfg; 78 78 pde->size = PAGE_SIZE; 79 79 pde->proc_fops = &page_map_fops; 80 80
+3 -6
arch/ppc64/kernel/prom.c
··· 318 318 } 319 319 320 320 /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ 321 - if (systemcfg->platform == PLATFORM_POWERMAC && ic && ic->parent) { 321 + if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { 322 322 char *name = get_property(ic->parent, "name", NULL); 323 323 if (name && !strcmp(name, "u3")) 324 324 np->intrs[intrcount].line += 128; ··· 1065 1065 prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); 1066 1066 if (prop == NULL) 1067 1067 return 0; 1068 - systemcfg->platform = *prop; 1068 + _machine = *prop; 1069 1069 1070 1070 /* check if iommu is forced on or off */ 1071 1071 if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) ··· 1230 1230 of_scan_flat_dt(early_init_dt_scan_memory, NULL); 1231 1231 lmb_enforce_memory_limit(memory_limit); 1232 1232 lmb_analyze(); 1233 - systemcfg->physicalMemorySize = lmb_phys_mem_size(); 1234 1233 lmb_reserve(0, __pa(klimit)); 1235 - 1236 - DBG("Phys. mem: %lx\n", systemcfg->physicalMemorySize); 1237 1234 1238 1235 /* Reserve LMB regions used by kernel, initrd, dt, etc... */ 1239 1236 early_reserve_mem(); ··· 1750 1753 /* We don't support that function on PowerMac, at least 1751 1754 * not yet 1752 1755 */ 1753 - if (systemcfg->platform == PLATFORM_POWERMAC) 1756 + if (_machine == PLATFORM_POWERMAC) 1754 1757 return -ENODEV; 1755 1758 1756 1759 /* fix up new node's linux_phandle field */
+2 -1
arch/ppc64/kernel/prom_init.c
··· 1934 1934 /* 1935 1935 * On pSeries, inform the firmware about our capabilities 1936 1936 */ 1937 - if (RELOC(of_platform) & PLATFORM_PSERIES) 1937 + if (RELOC(of_platform) == PLATFORM_PSERIES || 1938 + RELOC(of_platform) == PLATFORM_PSERIES_LPAR) 1938 1939 prom_send_capabilities(); 1939 1940 1940 1941 /*
+3 -2
arch/ppc64/kernel/vdso.c
··· 34 34 #include <asm/machdep.h> 35 35 #include <asm/cputable.h> 36 36 #include <asm/sections.h> 37 + #include <asm/systemcfg.h> 37 38 #include <asm/vdso.h> 38 39 39 40 #undef DEBUG ··· 180 179 * Last page is systemcfg. 181 180 */ 182 181 if ((vma->vm_end - address) <= PAGE_SIZE) 183 - pg = virt_to_page(systemcfg); 182 + pg = virt_to_page(_systemcfg); 184 183 else 185 184 pg = virt_to_page(vbase + offset); 186 185 ··· 605 604 get_page(pg); 606 605 } 607 606 608 - get_page(virt_to_page(systemcfg)); 607 + get_page(virt_to_page(_systemcfg)); 609 608 } 610 609 611 610 int in_gate_area_no_task(unsigned long addr)
+6
include/asm-powerpc/firmware.h
··· 43 43 #define FW_FEATURE_ISERIES (1UL<<21) 44 44 45 45 enum { 46 + #ifdef CONFIG_PPC64 46 47 FW_FEATURE_PSERIES_POSSIBLE = FW_FEATURE_PFT | FW_FEATURE_TCE | 47 48 FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY | 48 49 FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM | ··· 71 70 FW_FEATURE_ISERIES_ALWAYS & 72 71 #endif 73 72 FW_FEATURE_POSSIBLE, 73 + 74 + #else /* CONFIG_PPC64 */ 75 + FW_FEATURE_POSSIBLE = 0, 76 + FW_FEATURE_ALWAYS = 0, 77 + #endif 74 78 }; 75 79 76 80 /* This is used to identify firmware features which are available
+39 -30
include/asm-powerpc/processor.h
··· 17 17 #include <linux/compiler.h> 18 18 #include <asm/ptrace.h> 19 19 #include <asm/types.h> 20 - #ifdef CONFIG_PPC64 21 - #include <asm/systemcfg.h> 22 - #endif 23 20 24 - #ifdef CONFIG_PPC32 25 - /* 32-bit platform types */ 26 - /* We only need to define a new _MACH_xxx for machines which are part of 27 - * a configuration which supports more than one type of different machine. 28 - * This is currently limited to CONFIG_PPC_MULTIPLATFORM and CHRP/PReP/PMac. 29 - * -- Tom 21 + /* We do _not_ want to define new machine types at all, those must die 22 + * in favor of using the device-tree 23 + * -- BenH. 30 24 */ 31 - #define _MACH_prep 0x00000001 32 - #define _MACH_Pmac 0x00000002 /* pmac or pmac clone (non-chrp) */ 33 - #define _MACH_chrp 0x00000004 /* chrp machine */ 34 25 35 - /* see residual.h for these */ 26 + /* Platforms codes (to be obsoleted) */ 27 + #define PLATFORM_PSERIES 0x0100 28 + #define PLATFORM_PSERIES_LPAR 0x0101 29 + #define PLATFORM_ISERIES_LPAR 0x0201 30 + #define PLATFORM_LPAR 0x0001 31 + #define PLATFORM_POWERMAC 0x0400 32 + #define PLATFORM_MAPLE 0x0500 33 + #define PLATFORM_PREP 0x0600 34 + #define PLATFORM_CHRP 0x0700 35 + #define PLATFORM_CELL 0x1000 36 + 37 + /* Compat platform codes for 32 bits */ 38 + #define _MACH_prep PLATFORM_PREP 39 + #define _MACH_Pmac PLATFORM_POWERMAC 40 + #define _MACH_chrp PLATFORM_CHRP 41 + 42 + /* PREP sub-platform types see residual.h for these */ 36 43 #define _PREP_Motorola 0x01 /* motorola prep */ 37 44 #define _PREP_Firm 0x02 /* firmworks prep */ 38 45 #define _PREP_IBM 0x00 /* ibm prep */ 39 46 #define _PREP_Bull 0x03 /* bull prep */ 40 47 41 - /* these are arbitrary */ 48 + /* CHRP sub-platform types. These are arbitrary */ 42 49 #define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */ 43 50 #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ 44 51 #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ 45 52 46 - #ifdef CONFIG_PPC_MULTIPLATFORM 53 + #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ 54 + _machine == PLATFORM_PSERIES_LPAR) 55 + #define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) 56 + 57 + #if defined(CONFIG_PPC_MULTIPLATFORM) 47 58 extern int _machine; 59 + 60 + #ifdef CONFIG_PPC32 48 61 49 62 /* what kind of prep workstation we are */ 50 63 extern int _prep_type; ··· 65 52 66 53 /* 67 54 * This is used to identify the board type from a given PReP board 68 - * vendor. Board revision is also made available. 55 + * vendor. Board revision is also made available. This will be moved 56 + * elsewhere soon 69 57 */ 70 58 extern unsigned char ucSystemType; 71 59 extern unsigned char ucBoardRev; 72 60 extern unsigned char ucBoardRevMaj, ucBoardRevMin; 61 + 62 + #endif /* CONFIG_PPC32 */ 63 + 64 + #elif defined(CONFIG_PPC_ISERIES) 65 + /* 66 + * iSeries is soon to become MULTIPLATFORM hopefully ... 67 + */ 68 + #define _machine CONFIG_PPC_ISERIES_LPAR 73 69 #else 74 70 #define _machine 0 75 71 #endif /* CONFIG_PPC_MULTIPLATFORM */ 76 - #endif /* CONFIG_PPC32 */ 77 72 78 - #ifdef CONFIG_PPC64 79 - /* Platforms supported by PPC64 */ 80 - #define PLATFORM_PSERIES 0x0100 81 - #define PLATFORM_PSERIES_LPAR 0x0101 82 - #define PLATFORM_ISERIES_LPAR 0x0201 83 - #define PLATFORM_LPAR 0x0001 84 - #define PLATFORM_POWERMAC 0x0400 85 - #define PLATFORM_MAPLE 0x0500 86 - #define PLATFORM_CELL 0x1000 87 73 88 - /* Compatibility with drivers coming from PPC32 world */ 89 - #define _machine (systemcfg->platform) 90 - #define _MACH_Pmac PLATFORM_POWERMAC 91 - #endif 74 + 92 75 93 76 /* 94 77 * Default implementation of macro that returns current
+1
include/asm-powerpc/reg.h
··· 363 363 #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ 364 364 #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ 365 365 #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ 366 + #define SPRN_ASR 0x118 /* Address Space Register */ 366 367 #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ 367 368 #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ 368 369 #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */
+3
include/asm-ppc64/mmu.h
··· 224 224 unsigned long pstart, unsigned long mode, 225 225 int psize); 226 226 227 + extern void htab_initialize(void); 228 + extern void htab_initialize_secondary(void); 227 229 extern void hpte_init_native(void); 228 230 extern void hpte_init_lpar(void); 229 231 extern void hpte_init_iSeries(void); ··· 247 245 248 246 extern void stabs_alloc(void); 249 247 extern void slb_initialize(void); 248 + extern void stab_initialize(unsigned long stab); 250 249 251 250 #endif /* __ASSEMBLY__ */ 252 251
+3 -3
include/asm-ppc64/systemcfg.h include/asm-powerpc/systemcfg.h
··· 1 1 #ifndef _SYSTEMCFG_H 2 2 #define _SYSTEMCFG_H 3 3 4 - /* 4 + /* 5 5 * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM 6 6 * 7 7 * This program is free software; you can redistribute it and/or ··· 12 12 13 13 /* Change Activity: 14 14 * 2002/09/30 : bergner : Created 15 - * End Change Activity 15 + * End Change Activity 16 16 */ 17 17 18 18 /* ··· 56 56 }; 57 57 58 58 #ifdef __KERNEL__ 59 - extern struct systemcfg *systemcfg; 59 + extern struct systemcfg *_systemcfg; /* to be renamed */ 60 60 #endif 61 61 62 62 #endif /* __ASSEMBLY__ */