diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-03-28 07:15:54 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 07:15:54 -0500 |
commit | e8222502ee6157e2713da9e0792c21f4ad458d50 (patch) | |
tree | 0f970fb99912c257a7e5254f863a53f79d22ab14 /arch/powerpc | |
parent | 056cb48a2fb6fb31debf665695a9f97b45cfb8ec (diff) |
[PATCH] powerpc: Kill _machine and hard-coded platform numbers
This removes statically assigned platform numbers and reworks the
powerpc platform probe code to use a better mechanism. With this,
board support files can simply declare a new machine type with a
macro, and implement a probe() function that uses the flattened
device-tree to detect if they apply for a given machine.
We now have a machine_is() macro that replaces the comparisons of
_machine with the various PLATFORM_* constants. This commit also
changes various drivers to use the new macro instead of looking at
_machine.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
33 files changed, 451 insertions, 459 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 882889b1592..54b48f33005 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -105,8 +105,6 @@ int main(void) | |||
105 | DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); | 105 | DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); |
106 | DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); | 106 | DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); |
107 | DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); | 107 | DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); |
108 | DEFINE(PLATFORM_LPAR, PLATFORM_LPAR); | ||
109 | |||
110 | /* paca */ | 108 | /* paca */ |
111 | DEFINE(PACA_SIZE, sizeof(struct paca_struct)); | 109 | DEFINE(PACA_SIZE, sizeof(struct paca_struct)); |
112 | DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); | 110 | DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); |
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 6c3989f6247..ada50aa5b60 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -160,7 +160,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file, | |||
160 | case IOC_NVRAM_GET_OFFSET: { | 160 | case IOC_NVRAM_GET_OFFSET: { |
161 | int part, offset; | 161 | int part, offset; |
162 | 162 | ||
163 | if (_machine != PLATFORM_POWERMAC) | 163 | if (!machine_is(powermac)) |
164 | return -EINVAL; | 164 | return -EINVAL; |
165 | if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) | 165 | if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) |
166 | return -EFAULT; | 166 | return -EFAULT; |
@@ -444,7 +444,7 @@ static int nvram_setup_partition(void) | |||
444 | * in our nvram, as Apple defined partitions use pretty much | 444 | * in our nvram, as Apple defined partitions use pretty much |
445 | * all of the space | 445 | * all of the space |
446 | */ | 446 | */ |
447 | if (_machine == PLATFORM_POWERMAC) | 447 | if (machine_is(powermac)) |
448 | return -ENOSPC; | 448 | return -ENOSPC; |
449 | 449 | ||
450 | /* see if we have an OS partition that meets our needs. | 450 | /* see if we have an OS partition that meets our needs. |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 704c846b2b0..b129d2e4b75 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -787,7 +787,7 @@ pci_busdev_to_OF_node(struct pci_bus *bus, int devfn) | |||
787 | * fix has to be done by making the remapping per-host and always | 787 | * fix has to be done by making the remapping per-host and always |
788 | * filling the pci_to_OF map. --BenH | 788 | * filling the pci_to_OF map. --BenH |
789 | */ | 789 | */ |
790 | if (_machine == _MACH_Pmac && busnr >= 0xf0) | 790 | if (machine_is(powermac) && busnr >= 0xf0) |
791 | busnr -= 0xf0; | 791 | busnr -= 0xf0; |
792 | else | 792 | else |
793 | #endif | 793 | #endif |
@@ -1728,7 +1728,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) | |||
1728 | * (bus 0 is HT root), we return the AGP one instead. | 1728 | * (bus 0 is HT root), we return the AGP one instead. |
1729 | */ | 1729 | */ |
1730 | #ifdef CONFIG_PPC_PMAC | 1730 | #ifdef CONFIG_PPC_PMAC |
1731 | if (_machine == _MACH_Pmac && machine_is_compatible("MacRISC4")) | 1731 | if (machine_is(powermac) && machine_is_compatible("MacRISC4")) |
1732 | if (bus == 0) | 1732 | if (bus == 0) |
1733 | bus = 0xf0; | 1733 | bus = 0xf0; |
1734 | #endif /* CONFIG_PPC_PMAC */ | 1734 | #endif /* CONFIG_PPC_PMAC */ |
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index 7ba42a405f4..3c2cf661f6d 100644 --- a/arch/powerpc/kernel/proc_ppc64.c +++ b/arch/powerpc/kernel/proc_ppc64.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | 25 | ||
26 | #include <asm/machdep.h> | ||
26 | #include <asm/vdso_datapage.h> | 27 | #include <asm/vdso_datapage.h> |
27 | #include <asm/rtas.h> | 28 | #include <asm/rtas.h> |
28 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
@@ -51,7 +52,7 @@ static int __init proc_ppc64_create(void) | |||
51 | if (!root) | 52 | if (!root) |
52 | return 1; | 53 | return 1; |
53 | 54 | ||
54 | if (!(platform_is_pseries() || _machine == PLATFORM_CELL)) | 55 | if (!machine_is(pseries) && !machine_is(cell)) |
55 | return 0; | 56 | return 0; |
56 | 57 | ||
57 | if (!proc_mkdir("rtas", root)) | 58 | if (!proc_mkdir("rtas", root)) |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index a2bc433f361..4336390bcf3 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -383,14 +383,14 @@ static int __devinit finish_node_interrupts(struct device_node *np, | |||
383 | /* Apple uses bits in there in a different way, let's | 383 | /* Apple uses bits in there in a different way, let's |
384 | * only keep the real sense bit on macs | 384 | * only keep the real sense bit on macs |
385 | */ | 385 | */ |
386 | if (_machine == PLATFORM_POWERMAC) | 386 | if (machine_is(powermac)) |
387 | sense &= 0x1; | 387 | sense &= 0x1; |
388 | np->intrs[intrcount].sense = map_mpic_senses[sense]; | 388 | np->intrs[intrcount].sense = map_mpic_senses[sense]; |
389 | } | 389 | } |
390 | 390 | ||
391 | #ifdef CONFIG_PPC64 | 391 | #ifdef CONFIG_PPC64 |
392 | /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ | 392 | /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ |
393 | if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { | 393 | if (machine_is(powermac) && ic && ic->parent) { |
394 | char *name = get_property(ic->parent, "name", NULL); | 394 | char *name = get_property(ic->parent, "name", NULL); |
395 | if (name && !strcmp(name, "u3")) | 395 | if (name && !strcmp(name, "u3")) |
396 | np->intrs[intrcount].line += 128; | 396 | np->intrs[intrcount].line += 128; |
@@ -570,6 +570,18 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, | |||
570 | return rc; | 570 | return rc; |
571 | } | 571 | } |
572 | 572 | ||
573 | unsigned long __init of_get_flat_dt_root(void) | ||
574 | { | ||
575 | unsigned long p = ((unsigned long)initial_boot_params) + | ||
576 | initial_boot_params->off_dt_struct; | ||
577 | |||
578 | while(*((u32 *)p) == OF_DT_NOP) | ||
579 | p += 4; | ||
580 | BUG_ON (*((u32 *)p) != OF_DT_BEGIN_NODE); | ||
581 | p += 4; | ||
582 | return _ALIGN(p + strlen((char *)p) + 1, 4); | ||
583 | } | ||
584 | |||
573 | /** | 585 | /** |
574 | * This function can be used within scan_flattened_dt callback to get | 586 | * This function can be used within scan_flattened_dt callback to get |
575 | * access to properties | 587 | * access to properties |
@@ -612,6 +624,25 @@ void* __init of_get_flat_dt_prop(unsigned long node, const char *name, | |||
612 | } while(1); | 624 | } while(1); |
613 | } | 625 | } |
614 | 626 | ||
627 | int __init of_flat_dt_is_compatible(unsigned long node, const char *compat) | ||
628 | { | ||
629 | const char* cp; | ||
630 | unsigned long cplen, l; | ||
631 | |||
632 | cp = of_get_flat_dt_prop(node, "compatible", &cplen); | ||
633 | if (cp == NULL) | ||
634 | return 0; | ||
635 | while (cplen > 0) { | ||
636 | if (strncasecmp(cp, compat, strlen(compat)) == 0) | ||
637 | return 1; | ||
638 | l = strlen(cp) + 1; | ||
639 | cp += l; | ||
640 | cplen -= l; | ||
641 | } | ||
642 | |||
643 | return 0; | ||
644 | } | ||
645 | |||
615 | static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size, | 646 | static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size, |
616 | unsigned long align) | 647 | unsigned long align) |
617 | { | 648 | { |
@@ -686,7 +717,7 @@ static unsigned long __init unflatten_dt_node(unsigned long mem, | |||
686 | #ifdef DEBUG | 717 | #ifdef DEBUG |
687 | if ((strlen(p) + l + 1) != allocl) { | 718 | if ((strlen(p) + l + 1) != allocl) { |
688 | DBG("%s: p: %d, l: %d, a: %d\n", | 719 | DBG("%s: p: %d, l: %d, a: %d\n", |
689 | pathp, strlen(p), l, allocl); | 720 | pathp, (int)strlen(p), l, allocl); |
690 | } | 721 | } |
691 | #endif | 722 | #endif |
692 | p += strlen(p); | 723 | p += strlen(p); |
@@ -951,7 +982,6 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
951 | static int __init early_init_dt_scan_chosen(unsigned long node, | 982 | static int __init early_init_dt_scan_chosen(unsigned long node, |
952 | const char *uname, int depth, void *data) | 983 | const char *uname, int depth, void *data) |
953 | { | 984 | { |
954 | u32 *prop; | ||
955 | unsigned long *lprop; | 985 | unsigned long *lprop; |
956 | unsigned long l; | 986 | unsigned long l; |
957 | char *p; | 987 | char *p; |
@@ -962,14 +992,6 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
962 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) | 992 | (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) |
963 | return 0; | 993 | return 0; |
964 | 994 | ||
965 | /* get platform type */ | ||
966 | prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); | ||
967 | if (prop == NULL) | ||
968 | return 0; | ||
969 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
970 | _machine = *prop; | ||
971 | #endif | ||
972 | |||
973 | #ifdef CONFIG_PPC64 | 995 | #ifdef CONFIG_PPC64 |
974 | /* check if iommu is forced on or off */ | 996 | /* check if iommu is forced on or off */ |
975 | if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) | 997 | if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) |
@@ -996,15 +1018,15 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
996 | * set of RTAS infos now if available | 1018 | * set of RTAS infos now if available |
997 | */ | 1019 | */ |
998 | { | 1020 | { |
999 | u64 *basep, *entryp; | 1021 | u64 *basep, *entryp, *sizep; |
1000 | 1022 | ||
1001 | basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); | 1023 | basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); |
1002 | entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); | 1024 | entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); |
1003 | prop = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); | 1025 | sizep = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); |
1004 | if (basep && entryp && prop) { | 1026 | if (basep && entryp && sizep) { |
1005 | rtas.base = *basep; | 1027 | rtas.base = *basep; |
1006 | rtas.entry = *entryp; | 1028 | rtas.entry = *entryp; |
1007 | rtas.size = *prop; | 1029 | rtas.size = *sizep; |
1008 | } | 1030 | } |
1009 | } | 1031 | } |
1010 | #endif /* CONFIG_PPC_RTAS */ | 1032 | #endif /* CONFIG_PPC_RTAS */ |
@@ -1775,7 +1797,7 @@ static int of_finish_dynamic_node(struct device_node *node) | |||
1775 | /* We don't support that function on PowerMac, at least | 1797 | /* We don't support that function on PowerMac, at least |
1776 | * not yet | 1798 | * not yet |
1777 | */ | 1799 | */ |
1778 | if (_machine == PLATFORM_POWERMAC) | 1800 | if (machine_is(powermac)) |
1779 | return -ENODEV; | 1801 | return -ENODEV; |
1780 | 1802 | ||
1781 | /* fix up new node's linux_phandle field */ | 1803 | /* fix up new node's linux_phandle field */ |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 0d088784450..d66c5e77fcf 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -180,6 +180,16 @@ static unsigned long __initdata prom_tce_alloc_start; | |||
180 | static unsigned long __initdata prom_tce_alloc_end; | 180 | static unsigned long __initdata prom_tce_alloc_end; |
181 | #endif | 181 | #endif |
182 | 182 | ||
183 | /* Platforms codes are now obsolete in the kernel. Now only used within this | ||
184 | * file and ultimately gone too. Feel free to change them if you need, they | ||
185 | * are not shared with anything outside of this file anymore | ||
186 | */ | ||
187 | #define PLATFORM_PSERIES 0x0100 | ||
188 | #define PLATFORM_PSERIES_LPAR 0x0101 | ||
189 | #define PLATFORM_LPAR 0x0001 | ||
190 | #define PLATFORM_POWERMAC 0x0400 | ||
191 | #define PLATFORM_GENERIC 0x0500 | ||
192 | |||
183 | static int __initdata of_platform; | 193 | static int __initdata of_platform; |
184 | 194 | ||
185 | static char __initdata prom_cmd_line[COMMAND_LINE_SIZE]; | 195 | static char __initdata prom_cmd_line[COMMAND_LINE_SIZE]; |
@@ -1492,7 +1502,10 @@ static int __init prom_find_machine_type(void) | |||
1492 | int len, i = 0; | 1502 | int len, i = 0; |
1493 | #ifdef CONFIG_PPC64 | 1503 | #ifdef CONFIG_PPC64 |
1494 | phandle rtas; | 1504 | phandle rtas; |
1505 | int x; | ||
1495 | #endif | 1506 | #endif |
1507 | |||
1508 | /* Look for a PowerMac */ | ||
1496 | len = prom_getprop(_prom->root, "compatible", | 1509 | len = prom_getprop(_prom->root, "compatible", |
1497 | compat, sizeof(compat)-1); | 1510 | compat, sizeof(compat)-1); |
1498 | if (len > 0) { | 1511 | if (len > 0) { |
@@ -1505,28 +1518,36 @@ static int __init prom_find_machine_type(void) | |||
1505 | if (strstr(p, RELOC("Power Macintosh")) || | 1518 | if (strstr(p, RELOC("Power Macintosh")) || |
1506 | strstr(p, RELOC("MacRISC"))) | 1519 | strstr(p, RELOC("MacRISC"))) |
1507 | return PLATFORM_POWERMAC; | 1520 | return PLATFORM_POWERMAC; |
1508 | #ifdef CONFIG_PPC64 | ||
1509 | if (strstr(p, RELOC("Momentum,Maple"))) | ||
1510 | return PLATFORM_MAPLE; | ||
1511 | if (strstr(p, RELOC("IBM,CPB"))) | ||
1512 | return PLATFORM_CELL; | ||
1513 | #endif | ||
1514 | i += sl + 1; | 1521 | i += sl + 1; |
1515 | } | 1522 | } |
1516 | } | 1523 | } |
1517 | #ifdef CONFIG_PPC64 | 1524 | #ifdef CONFIG_PPC64 |
1525 | /* If not a mac, try to figure out if it's an IBM pSeries or any other | ||
1526 | * PAPR compliant platform. We assume it is if : | ||
1527 | * - /device_type is "chrp" (please, do NOT use that for future | ||
1528 | * non-IBM designs ! | ||
1529 | * - it has /rtas | ||
1530 | */ | ||
1531 | len = prom_getprop(_prom->root, "model", | ||
1532 | compat, sizeof(compat)-1); | ||
1533 | if (len <= 0) | ||
1534 | return PLATFORM_GENERIC; | ||
1535 | compat[len] = 0; | ||
1536 | if (strcmp(compat, "chrp")) | ||
1537 | return PLATFORM_GENERIC; | ||
1538 | |||
1518 | /* Default to pSeries. We need to know if we are running LPAR */ | 1539 | /* Default to pSeries. We need to know if we are running LPAR */ |
1519 | rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); | 1540 | rtas = call_prom("finddevice", 1, 1, ADDR("/rtas")); |
1520 | if (PHANDLE_VALID(rtas)) { | 1541 | if (!PHANDLE_VALID(rtas)) |
1521 | int x = prom_getproplen(rtas, "ibm,hypertas-functions"); | 1542 | return PLATFORM_GENERIC; |
1522 | if (x != PROM_ERROR) { | 1543 | x = prom_getproplen(rtas, "ibm,hypertas-functions"); |
1523 | prom_printf("Hypertas detected, assuming LPAR !\n"); | 1544 | if (x != PROM_ERROR) { |
1524 | return PLATFORM_PSERIES_LPAR; | 1545 | prom_printf("Hypertas detected, assuming LPAR !\n"); |
1525 | } | 1546 | return PLATFORM_PSERIES_LPAR; |
1526 | } | 1547 | } |
1527 | return PLATFORM_PSERIES; | 1548 | return PLATFORM_PSERIES; |
1528 | #else | 1549 | #else |
1529 | return PLATFORM_CHRP; | 1550 | return PLATFORM_GENERIC; |
1530 | #endif | 1551 | #endif |
1531 | } | 1552 | } |
1532 | 1553 | ||
@@ -2034,7 +2055,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, | |||
2034 | { | 2055 | { |
2035 | struct prom_t *_prom; | 2056 | struct prom_t *_prom; |
2036 | unsigned long hdr; | 2057 | unsigned long hdr; |
2037 | u32 getprop_rval; | ||
2038 | unsigned long offset = reloc_offset(); | 2058 | unsigned long offset = reloc_offset(); |
2039 | 2059 | ||
2040 | #ifdef CONFIG_PPC32 | 2060 | #ifdef CONFIG_PPC32 |
@@ -2070,9 +2090,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, | |||
2070 | * between pSeries SMP and pSeries LPAR | 2090 | * between pSeries SMP and pSeries LPAR |
2071 | */ | 2091 | */ |
2072 | RELOC(of_platform) = prom_find_machine_type(); | 2092 | RELOC(of_platform) = prom_find_machine_type(); |
2073 | getprop_rval = RELOC(of_platform); | ||
2074 | prom_setprop(_prom->chosen, "/chosen", "linux,platform", | ||
2075 | &getprop_rval, sizeof(getprop_rval)); | ||
2076 | 2093 | ||
2077 | /* Bail if this is a kdump kernel. */ | 2094 | /* Bail if this is a kdump kernel. */ |
2078 | if (PHYSICAL_START > 0) | 2095 | if (PHYSICAL_START > 0) |
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index 1f03fb28cc0..456286cf1d1 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c | |||
@@ -257,7 +257,7 @@ static int __init proc_rtas_init(void) | |||
257 | { | 257 | { |
258 | struct proc_dir_entry *entry; | 258 | struct proc_dir_entry *entry; |
259 | 259 | ||
260 | if (_machine != PLATFORM_PSERIES && _machine != PLATFORM_PSERIES_LPAR) | 260 | if (!machine_is(pseries)) |
261 | return 1; | 261 | return 1; |
262 | 262 | ||
263 | rtas_node = of_find_node_by_name(NULL, "rtas"); | 263 | rtas_node = of_find_node_by_name(NULL, "rtas"); |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 142d818a31a..4b78ee0e586 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/hvcall.h> | 25 | #include <asm/hvcall.h> |
26 | #include <asm/semaphore.h> | 26 | #include <asm/semaphore.h> |
27 | #include <asm/machdep.h> | 27 | #include <asm/machdep.h> |
28 | #include <asm/firmware.h> | ||
28 | #include <asm/page.h> | 29 | #include <asm/page.h> |
29 | #include <asm/param.h> | 30 | #include <asm/param.h> |
30 | #include <asm/system.h> | 31 | #include <asm/system.h> |
@@ -768,7 +769,7 @@ void __init rtas_initialize(void) | |||
768 | * the stop-self token if any | 769 | * the stop-self token if any |
769 | */ | 770 | */ |
770 | #ifdef CONFIG_PPC64 | 771 | #ifdef CONFIG_PPC64 |
771 | if (_machine == PLATFORM_PSERIES_LPAR) { | 772 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) { |
772 | rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); | 773 | rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); |
773 | ibm_suspend_me_token = rtas_token("ibm,suspend-me"); | 774 | ibm_suspend_me_token = rtas_token("ibm,suspend-me"); |
774 | } | 775 | } |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index b17630ad4ac..3473cb9cb0a 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -9,6 +9,9 @@ | |||
9 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | */ | 11 | */ |
12 | |||
13 | #undef DEBUG | ||
14 | |||
12 | #include <linux/config.h> | 15 | #include <linux/config.h> |
13 | #include <linux/module.h> | 16 | #include <linux/module.h> |
14 | #include <linux/string.h> | 17 | #include <linux/string.h> |
@@ -41,6 +44,7 @@ | |||
41 | #include <asm/time.h> | 44 | #include <asm/time.h> |
42 | #include <asm/cputable.h> | 45 | #include <asm/cputable.h> |
43 | #include <asm/sections.h> | 46 | #include <asm/sections.h> |
47 | #include <asm/firmware.h> | ||
44 | #include <asm/btext.h> | 48 | #include <asm/btext.h> |
45 | #include <asm/nvram.h> | 49 | #include <asm/nvram.h> |
46 | #include <asm/setup.h> | 50 | #include <asm/setup.h> |
@@ -56,8 +60,6 @@ | |||
56 | 60 | ||
57 | #include "setup.h" | 61 | #include "setup.h" |
58 | 62 | ||
59 | #undef DEBUG | ||
60 | |||
61 | #ifdef DEBUG | 63 | #ifdef DEBUG |
62 | #include <asm/udbg.h> | 64 | #include <asm/udbg.h> |
63 | #define DBG(fmt...) udbg_printf(fmt) | 65 | #define DBG(fmt...) udbg_printf(fmt) |
@@ -65,10 +67,12 @@ | |||
65 | #define DBG(fmt...) | 67 | #define DBG(fmt...) |
66 | #endif | 68 | #endif |
67 | 69 | ||
68 | #ifdef CONFIG_PPC_MULTIPLATFORM | 70 | /* The main machine-dep calls structure |
69 | int _machine = 0; | 71 | */ |
70 | EXPORT_SYMBOL(_machine); | 72 | struct machdep_calls ppc_md; |
71 | #endif | 73 | EXPORT_SYMBOL(ppc_md); |
74 | struct machdep_calls *machine_id; | ||
75 | EXPORT_SYMBOL(machine_id); | ||
72 | 76 | ||
73 | unsigned long klimit = (unsigned long) _end; | 77 | unsigned long klimit = (unsigned long) _end; |
74 | 78 | ||
@@ -168,7 +172,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
168 | bogosum/(500000/HZ), bogosum/(5000/HZ) % 100); | 172 | bogosum/(500000/HZ), bogosum/(5000/HZ) % 100); |
169 | #endif /* CONFIG_SMP && CONFIG_PPC32 */ | 173 | #endif /* CONFIG_SMP && CONFIG_PPC32 */ |
170 | seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq); | 174 | seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq); |
171 | 175 | if (ppc_md.name) | |
176 | seq_printf(m, "platform\t: %s\n", ppc_md.name); | ||
172 | if (ppc_md.show_cpuinfo != NULL) | 177 | if (ppc_md.show_cpuinfo != NULL) |
173 | ppc_md.show_cpuinfo(m); | 178 | ppc_md.show_cpuinfo(m); |
174 | 179 | ||
@@ -387,7 +392,7 @@ void __init smp_setup_cpu_maps(void) | |||
387 | * On pSeries LPAR, we need to know how many cpus | 392 | * On pSeries LPAR, we need to know how many cpus |
388 | * could possibly be added to this partition. | 393 | * could possibly be added to this partition. |
389 | */ | 394 | */ |
390 | if (_machine == PLATFORM_PSERIES_LPAR && | 395 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && |
391 | (dn = of_find_node_by_path("/rtas"))) { | 396 | (dn = of_find_node_by_path("/rtas"))) { |
392 | int num_addr_cell, num_size_cell, maxcpus; | 397 | int num_addr_cell, num_size_cell, maxcpus; |
393 | unsigned int *ireg; | 398 | unsigned int *ireg; |
@@ -456,3 +461,34 @@ static int __init early_xmon(char *p) | |||
456 | } | 461 | } |
457 | early_param("xmon", early_xmon); | 462 | early_param("xmon", early_xmon); |
458 | #endif | 463 | #endif |
464 | |||
465 | void probe_machine(void) | ||
466 | { | ||
467 | extern struct machdep_calls __machine_desc_start; | ||
468 | extern struct machdep_calls __machine_desc_end; | ||
469 | |||
470 | /* | ||
471 | * Iterate all ppc_md structures until we find the proper | ||
472 | * one for the current machine type | ||
473 | */ | ||
474 | DBG("Probing machine type ...\n"); | ||
475 | |||
476 | for (machine_id = &__machine_desc_start; | ||
477 | machine_id < &__machine_desc_end; | ||
478 | machine_id++) { | ||
479 | DBG(" %s ...", machine_id->name); | ||
480 | memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls)); | ||
481 | if (ppc_md.probe()) { | ||
482 | DBG(" match !\n"); | ||
483 | break; | ||
484 | } | ||
485 | DBG("\n"); | ||
486 | } | ||
487 | /* What can we do if we didn't find ? */ | ||
488 | if (machine_id >= &__machine_desc_end) { | ||
489 | DBG("No suitable machine found !\n"); | ||
490 | for (;;); | ||
491 | } | ||
492 | |||
493 | printk(KERN_INFO "Using %s machine description\n", ppc_md.name); | ||
494 | } | ||
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index a2c89435abe..ae9c33d7073 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -67,10 +67,6 @@ unsigned int DMA_MODE_WRITE; | |||
67 | int have_of = 1; | 67 | int have_of = 1; |
68 | 68 | ||
69 | #ifdef CONFIG_PPC_MULTIPLATFORM | 69 | #ifdef CONFIG_PPC_MULTIPLATFORM |
70 | extern void prep_init(void); | ||
71 | extern void pmac_init(void); | ||
72 | extern void chrp_init(void); | ||
73 | |||
74 | dev_t boot_dev; | 70 | dev_t boot_dev; |
75 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 71 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
76 | 72 | ||
@@ -82,9 +78,6 @@ unsigned long SYSRQ_KEY = 0x54; | |||
82 | unsigned long vgacon_remap_base; | 78 | unsigned long vgacon_remap_base; |
83 | #endif | 79 | #endif |
84 | 80 | ||
85 | struct machdep_calls ppc_md; | ||
86 | EXPORT_SYMBOL(ppc_md); | ||
87 | |||
88 | /* | 81 | /* |
89 | * These are used in binfmt_elf.c to put aux entries on the stack | 82 | * These are used in binfmt_elf.c to put aux entries on the stack |
90 | * for each elf executable being started. | 83 | * for each elf executable being started. |
@@ -120,48 +113,6 @@ unsigned long __init early_init(unsigned long dt_ptr) | |||
120 | return KERNELBASE + offset; | 113 | return KERNELBASE + offset; |
121 | } | 114 | } |
122 | 115 | ||
123 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
124 | /* | ||
125 | * The PPC_MULTIPLATFORM version of platform_init... | ||
126 | */ | ||
127 | void __init platform_init(void) | ||
128 | { | ||
129 | /* if we didn't get any bootinfo telling us what we are... */ | ||
130 | if (_machine == 0) { | ||
131 | /* prep boot loader tells us if we're prep or not */ | ||
132 | if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) ) | ||
133 | _machine = _MACH_prep; | ||
134 | } | ||
135 | |||
136 | #ifdef CONFIG_PPC_PREP | ||
137 | /* not much more to do here, if prep */ | ||
138 | if (_machine == _MACH_prep) { | ||
139 | prep_init(); | ||
140 | return; | ||
141 | } | ||
142 | #endif | ||
143 | |||
144 | #ifdef CONFIG_ADB | ||
145 | if (strstr(cmd_line, "adb_sync")) { | ||
146 | extern int __adb_probe_sync; | ||
147 | __adb_probe_sync = 1; | ||
148 | } | ||
149 | #endif /* CONFIG_ADB */ | ||
150 | |||
151 | switch (_machine) { | ||
152 | #ifdef CONFIG_PPC_PMAC | ||
153 | case _MACH_Pmac: | ||
154 | pmac_init(); | ||
155 | break; | ||
156 | #endif | ||
157 | #ifdef CONFIG_PPC_CHRP | ||
158 | case _MACH_chrp: | ||
159 | chrp_init(); | ||
160 | break; | ||
161 | #endif | ||
162 | } | ||
163 | } | ||
164 | #endif | ||
165 | 116 | ||
166 | /* | 117 | /* |
167 | * Find out what kind of machine we're on and save any data we need | 118 | * Find out what kind of machine we're on and save any data we need |
@@ -187,8 +138,12 @@ void __init machine_init(unsigned long dt_ptr, unsigned long phys) | |||
187 | strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); | 138 | strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); |
188 | #endif /* CONFIG_CMDLINE */ | 139 | #endif /* CONFIG_CMDLINE */ |
189 | 140 | ||
190 | /* Base init based on machine type */ | 141 | #ifdef CONFIG_PPC_MULTIPLATFORM |
142 | probe_machine(); | ||
143 | #else | ||
144 | /* Base init based on machine type. Obsoloete, please kill ! */ | ||
191 | platform_init(); | 145 | platform_init(); |
146 | #endif | ||
192 | 147 | ||
193 | #ifdef CONFIG_6xx | 148 | #ifdef CONFIG_6xx |
194 | if (cpu_has_feature(CPU_FTR_CAN_DOZE) || | 149 | if (cpu_has_feature(CPU_FTR_CAN_DOZE) || |
@@ -359,7 +314,4 @@ void __init setup_arch(char **cmdline_p) | |||
359 | if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); | 314 | if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); |
360 | 315 | ||
361 | paging_init(); | 316 | paging_init(); |
362 | |||
363 | /* this is for modules since _machine can be a define -- Cort */ | ||
364 | ppc_md.ppc_machine = _machine; | ||
365 | } | 317 | } |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 5b63a861ef4..6aea1fb74b6 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -95,11 +95,6 @@ int dcache_bsize; | |||
95 | int icache_bsize; | 95 | int icache_bsize; |
96 | int ucache_bsize; | 96 | int ucache_bsize; |
97 | 97 | ||
98 | /* The main machine-dep calls structure | ||
99 | */ | ||
100 | struct machdep_calls ppc_md; | ||
101 | EXPORT_SYMBOL(ppc_md); | ||
102 | |||
103 | #ifdef CONFIG_MAGIC_SYSRQ | 98 | #ifdef CONFIG_MAGIC_SYSRQ |
104 | unsigned long SYSRQ_KEY; | 99 | unsigned long SYSRQ_KEY; |
105 | #endif /* CONFIG_MAGIC_SYSRQ */ | 100 | #endif /* CONFIG_MAGIC_SYSRQ */ |
@@ -160,32 +155,6 @@ early_param("smt-enabled", early_smt_enabled); | |||
160 | #define check_smt_enabled() | 155 | #define check_smt_enabled() |
161 | #endif /* CONFIG_SMP */ | 156 | #endif /* CONFIG_SMP */ |
162 | 157 | ||
163 | extern struct machdep_calls pSeries_md; | ||
164 | extern struct machdep_calls pmac_md; | ||
165 | extern struct machdep_calls maple_md; | ||
166 | extern struct machdep_calls cell_md; | ||
167 | extern struct machdep_calls iseries_md; | ||
168 | |||
169 | /* Ultimately, stuff them in an elf section like initcalls... */ | ||
170 | static struct machdep_calls __initdata *machines[] = { | ||
171 | #ifdef CONFIG_PPC_PSERIES | ||
172 | &pSeries_md, | ||
173 | #endif /* CONFIG_PPC_PSERIES */ | ||
174 | #ifdef CONFIG_PPC_PMAC | ||
175 | &pmac_md, | ||
176 | #endif /* CONFIG_PPC_PMAC */ | ||
177 | #ifdef CONFIG_PPC_MAPLE | ||
178 | &maple_md, | ||
179 | #endif /* CONFIG_PPC_MAPLE */ | ||
180 | #ifdef CONFIG_PPC_CELL | ||
181 | &cell_md, | ||
182 | #endif | ||
183 | #ifdef CONFIG_PPC_ISERIES | ||
184 | &iseries_md, | ||
185 | #endif | ||
186 | NULL | ||
187 | }; | ||
188 | |||
189 | /* | 158 | /* |
190 | * Early initialization entry point. This is called by head.S | 159 | * Early initialization entry point. This is called by head.S |
191 | * with MMU translation disabled. We rely on the "feature" of | 160 | * with MMU translation disabled. We rely on the "feature" of |
@@ -207,12 +176,10 @@ static struct machdep_calls __initdata *machines[] = { | |||
207 | 176 | ||
208 | void __init early_setup(unsigned long dt_ptr) | 177 | void __init early_setup(unsigned long dt_ptr) |
209 | { | 178 | { |
210 | static struct machdep_calls **mach; | ||
211 | |||
212 | /* Enable early debugging if any specified (see udbg.h) */ | 179 | /* Enable early debugging if any specified (see udbg.h) */ |
213 | udbg_early_init(); | 180 | udbg_early_init(); |
214 | 181 | ||
215 | DBG(" -> early_setup()\n"); | 182 | DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr); |
216 | 183 | ||
217 | /* | 184 | /* |
218 | * Do early initializations using the flattened device | 185 | * Do early initializations using the flattened device |
@@ -229,22 +196,8 @@ void __init early_setup(unsigned long dt_ptr) | |||
229 | get_paca()->stab_real = __pa((u64)&initial_stab); | 196 | get_paca()->stab_real = __pa((u64)&initial_stab); |
230 | get_paca()->stab_addr = (u64)&initial_stab; | 197 | get_paca()->stab_addr = (u64)&initial_stab; |
231 | 198 | ||
232 | /* | 199 | /* Probe the machine type */ |
233 | * Iterate all ppc_md structures until we find the proper | 200 | probe_machine(); |
234 | * one for the current machine type | ||
235 | */ | ||
236 | DBG("Probing machine type for platform %x...\n", _machine); | ||
237 | |||
238 | for (mach = machines; *mach; mach++) { | ||
239 | if ((*mach)->probe(_machine)) | ||
240 | break; | ||
241 | } | ||
242 | /* What can we do if we didn't find ? */ | ||
243 | if (*mach == NULL) { | ||
244 | DBG("No suitable machine found !\n"); | ||
245 | for (;;); | ||
246 | } | ||
247 | ppc_md = **mach; | ||
248 | 201 | ||
249 | #ifdef CONFIG_CRASH_DUMP | 202 | #ifdef CONFIG_CRASH_DUMP |
250 | kdump_setup(); | 203 | kdump_setup(); |
@@ -346,7 +299,7 @@ static void __init initialize_cache_info(void) | |||
346 | const char *dc, *ic; | 299 | const char *dc, *ic; |
347 | 300 | ||
348 | /* Then read cache informations */ | 301 | /* Then read cache informations */ |
349 | if (_machine == PLATFORM_POWERMAC) { | 302 | if (machine_is(powermac)) { |
350 | dc = "d-cache-block-size"; | 303 | dc = "d-cache-block-size"; |
351 | ic = "i-cache-block-size"; | 304 | ic = "i-cache-block-size"; |
352 | } else { | 305 | } else { |
@@ -490,7 +443,6 @@ void __init setup_system(void) | |||
490 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); | 443 | printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); |
491 | printk("ppc64_interrupt_controller = 0x%ld\n", | 444 | printk("ppc64_interrupt_controller = 0x%ld\n", |
492 | ppc64_interrupt_controller); | 445 | ppc64_interrupt_controller); |
493 | printk("platform = 0x%x\n", _machine); | ||
494 | printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); | 446 | printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); |
495 | printk("ppc64_caches.dcache_line_size = 0x%x\n", | 447 | printk("ppc64_caches.dcache_line_size = 0x%x\n", |
496 | ppc64_caches.dline_size); | 448 | ppc64_caches.dline_size); |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 98660aedeeb..27600c9432b 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock); | |||
97 | int die(const char *str, struct pt_regs *regs, long err) | 97 | int die(const char *str, struct pt_regs *regs, long err) |
98 | { | 98 | { |
99 | static int die_counter, crash_dump_start = 0; | 99 | static int die_counter, crash_dump_start = 0; |
100 | int nl = 0; | ||
101 | 100 | ||
102 | if (debugger(regs)) | 101 | if (debugger(regs)) |
103 | return 1; | 102 | return 1; |
@@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
106 | spin_lock_irq(&die_lock); | 105 | spin_lock_irq(&die_lock); |
107 | bust_spinlocks(1); | 106 | bust_spinlocks(1); |
108 | #ifdef CONFIG_PMAC_BACKLIGHT | 107 | #ifdef CONFIG_PMAC_BACKLIGHT |
109 | if (_machine == _MACH_Pmac) { | 108 | if (machine_is(powermac)) { |
110 | set_backlight_enable(1); | 109 | set_backlight_enable(1); |
111 | set_backlight_level(BACKLIGHT_MAX); | 110 | set_backlight_level(BACKLIGHT_MAX); |
112 | } | 111 | } |
@@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
114 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); | 113 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); |
115 | #ifdef CONFIG_PREEMPT | 114 | #ifdef CONFIG_PREEMPT |
116 | printk("PREEMPT "); | 115 | printk("PREEMPT "); |
117 | nl = 1; | ||
118 | #endif | 116 | #endif |
119 | #ifdef CONFIG_SMP | 117 | #ifdef CONFIG_SMP |
120 | printk("SMP NR_CPUS=%d ", NR_CPUS); | 118 | printk("SMP NR_CPUS=%d ", NR_CPUS); |
121 | nl = 1; | ||
122 | #endif | 119 | #endif |
123 | #ifdef CONFIG_DEBUG_PAGEALLOC | 120 | #ifdef CONFIG_DEBUG_PAGEALLOC |
124 | printk("DEBUG_PAGEALLOC "); | 121 | printk("DEBUG_PAGEALLOC "); |
125 | nl = 1; | ||
126 | #endif | 122 | #endif |
127 | #ifdef CONFIG_NUMA | 123 | #ifdef CONFIG_NUMA |
128 | printk("NUMA "); | 124 | printk("NUMA "); |
129 | nl = 1; | ||
130 | #endif | 125 | #endif |
131 | #ifdef CONFIG_PPC64 | 126 | printk("%s\n", ppc_md.name ? "" : ppc_md.name); |
132 | switch (_machine) { | 127 | |
133 | case PLATFORM_PSERIES: | ||
134 | printk("PSERIES "); | ||
135 | nl = 1; | ||
136 | break; | ||
137 | case PLATFORM_PSERIES_LPAR: | ||
138 | printk("PSERIES LPAR "); | ||
139 | nl = 1; | ||
140 | break; | ||
141 | case PLATFORM_ISERIES_LPAR: | ||
142 | printk("ISERIES LPAR "); | ||
143 | nl = 1; | ||
144 | break; | ||
145 | case PLATFORM_POWERMAC: | ||
146 | printk("POWERMAC "); | ||
147 | nl = 1; | ||
148 | break; | ||
149 | case PLATFORM_CELL: | ||
150 | printk("CELL "); | ||
151 | nl = 1; | ||
152 | break; | ||
153 | } | ||
154 | #endif | ||
155 | if (nl) | ||
156 | printk("\n"); | ||
157 | print_modules(); | 128 | print_modules(); |
158 | show_regs(regs); | 129 | show_regs(regs); |
159 | bust_spinlocks(0); | 130 | bust_spinlocks(0); |
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index ec837036842..573afb68d69 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/machdep.h> | 33 | #include <asm/machdep.h> |
34 | #include <asm/cputable.h> | 34 | #include <asm/cputable.h> |
35 | #include <asm/sections.h> | 35 | #include <asm/sections.h> |
36 | #include <asm/firmware.h> | ||
36 | #include <asm/vdso.h> | 37 | #include <asm/vdso.h> |
37 | #include <asm/vdso_datapage.h> | 38 | #include <asm/vdso_datapage.h> |
38 | 39 | ||
@@ -667,7 +668,13 @@ void __init vdso_init(void) | |||
667 | vdso_data->version.major = SYSTEMCFG_MAJOR; | 668 | vdso_data->version.major = SYSTEMCFG_MAJOR; |
668 | vdso_data->version.minor = SYSTEMCFG_MINOR; | 669 | vdso_data->version.minor = SYSTEMCFG_MINOR; |
669 | vdso_data->processor = mfspr(SPRN_PVR); | 670 | vdso_data->processor = mfspr(SPRN_PVR); |
670 | vdso_data->platform = _machine; | 671 | /* |
672 | * Fake the old platform number for pSeries and iSeries and add | ||
673 | * in LPAR bit if necessary | ||
674 | */ | ||
675 | vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100; | ||
676 | if (firmware_has_feature(FW_FEATURE_LPAR)) | ||
677 | vdso_data->platform |= 1; | ||
671 | vdso_data->physicalMemorySize = lmb_phys_mem_size(); | 678 | vdso_data->physicalMemorySize = lmb_phys_mem_size(); |
672 | vdso_data->dcache_size = ppc64_caches.dsize; | 679 | vdso_data->dcache_size = ppc64_caches.dsize; |
673 | vdso_data->dcache_line_size = ppc64_caches.dline_size; | 680 | vdso_data->dcache_line_size = ppc64_caches.dline_size; |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 7fa7b15fd8e..fe79c2584cb 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -1,9 +1,11 @@ | |||
1 | #include <linux/config.h> | 1 | #include <linux/config.h> |
2 | #ifdef CONFIG_PPC64 | 2 | #ifdef CONFIG_PPC64 |
3 | #include <asm/page.h> | 3 | #include <asm/page.h> |
4 | #define PROVIDE32(x) PROVIDE(__unused__##x) | ||
4 | #else | 5 | #else |
5 | #define PAGE_SIZE 4096 | 6 | #define PAGE_SIZE 4096 |
6 | #define KERNELBASE CONFIG_KERNEL_START | 7 | #define KERNELBASE CONFIG_KERNEL_START |
8 | #define PROVIDE32(x) PROVIDE(x) | ||
7 | #endif | 9 | #endif |
8 | #include <asm-generic/vmlinux.lds.h> | 10 | #include <asm-generic/vmlinux.lds.h> |
9 | 11 | ||
@@ -18,43 +20,42 @@ jiffies = jiffies_64 + 4; | |||
18 | #endif | 20 | #endif |
19 | SECTIONS | 21 | SECTIONS |
20 | { | 22 | { |
21 | /* Sections to be discarded. */ | 23 | /* Sections to be discarded. */ |
22 | /DISCARD/ : { | 24 | /DISCARD/ : { |
23 | *(.exitcall.exit) | 25 | *(.exitcall.exit) |
24 | *(.exit.data) | 26 | *(.exit.data) |
25 | } | 27 | } |
26 | |||
27 | . = KERNELBASE; | ||
28 | |||
29 | /* Read-only sections, merged into text segment: */ | ||
30 | .text : { | ||
31 | *(.text .text.*) | ||
32 | SCHED_TEXT | ||
33 | LOCK_TEXT | ||
34 | KPROBES_TEXT | ||
35 | *(.fixup) | ||
36 | #ifdef CONFIG_PPC32 | ||
37 | *(.got1) | ||
38 | __got2_start = .; | ||
39 | *(.got2) | ||
40 | __got2_end = .; | ||
41 | #else | ||
42 | . = ALIGN(PAGE_SIZE); | ||
43 | _etext = .; | ||
44 | #endif | ||
45 | } | ||
46 | #ifdef CONFIG_PPC32 | ||
47 | _etext = .; | ||
48 | PROVIDE (etext = .); | ||
49 | 28 | ||
50 | RODATA | 29 | . = KERNELBASE; |
51 | .fini : { *(.fini) } =0 | ||
52 | .ctors : { *(.ctors) } | ||
53 | .dtors : { *(.dtors) } | ||
54 | 30 | ||
55 | .fixup : { *(.fixup) } | 31 | /* |
56 | #endif | 32 | * Text, read only data and other permanent read-only sections |
33 | */ | ||
34 | |||
35 | /* Text and gots */ | ||
36 | .text : { | ||
37 | *(.text .text.*) | ||
38 | SCHED_TEXT | ||
39 | LOCK_TEXT | ||
40 | KPROBES_TEXT | ||
41 | *(.fixup) | ||
57 | 42 | ||
43 | #ifdef CONFIG_PPC32 | ||
44 | *(.got1) | ||
45 | __got2_start = .; | ||
46 | *(.got2) | ||
47 | __got2_end = .; | ||
48 | #endif /* CONFIG_PPC32 */ | ||
49 | |||
50 | . = ALIGN(PAGE_SIZE); | ||
51 | _etext = .; | ||
52 | PROVIDE32 (etext = .); | ||
53 | } | ||
54 | |||
55 | /* Read-only data */ | ||
56 | RODATA | ||
57 | |||
58 | /* Exception & bug tables */ | ||
58 | __ex_table : { | 59 | __ex_table : { |
59 | __start___ex_table = .; | 60 | __start___ex_table = .; |
60 | *(__ex_table) | 61 | *(__ex_table) |
@@ -67,192 +68,172 @@ SECTIONS | |||
67 | __stop___bug_table = .; | 68 | __stop___bug_table = .; |
68 | } | 69 | } |
69 | 70 | ||
70 | #ifdef CONFIG_PPC64 | 71 | /* |
72 | * Init sections discarded at runtime | ||
73 | */ | ||
74 | . = ALIGN(PAGE_SIZE); | ||
75 | __init_begin = .; | ||
76 | |||
77 | .init.text : { | ||
78 | _sinittext = .; | ||
79 | *(.init.text) | ||
80 | _einittext = .; | ||
81 | } | ||
82 | |||
83 | /* .exit.text is discarded at runtime, not link time, | ||
84 | * to deal with references from __bug_table | ||
85 | */ | ||
86 | .exit.text : { *(.exit.text) } | ||
87 | |||
88 | .init.data : { | ||
89 | *(.init.data); | ||
90 | __vtop_table_begin = .; | ||
91 | *(.vtop_fixup); | ||
92 | __vtop_table_end = .; | ||
93 | __ptov_table_begin = .; | ||
94 | *(.ptov_fixup); | ||
95 | __ptov_table_end = .; | ||
96 | } | ||
97 | |||
98 | . = ALIGN(16); | ||
99 | .init.setup : { | ||
100 | __setup_start = .; | ||
101 | *(.init.setup) | ||
102 | __setup_end = .; | ||
103 | } | ||
104 | |||
105 | .initcall.init : { | ||
106 | __initcall_start = .; | ||
107 | *(.initcall1.init) | ||
108 | *(.initcall2.init) | ||
109 | *(.initcall3.init) | ||
110 | *(.initcall4.init) | ||
111 | *(.initcall5.init) | ||
112 | *(.initcall6.init) | ||
113 | *(.initcall7.init) | ||
114 | __initcall_end = .; | ||
115 | } | ||
116 | |||
117 | .con_initcall.init : { | ||
118 | __con_initcall_start = .; | ||
119 | *(.con_initcall.init) | ||
120 | __con_initcall_end = .; | ||
121 | } | ||
122 | |||
123 | SECURITY_INIT | ||
124 | |||
125 | . = ALIGN(8); | ||
71 | __ftr_fixup : { | 126 | __ftr_fixup : { |
72 | __start___ftr_fixup = .; | 127 | __start___ftr_fixup = .; |
73 | *(__ftr_fixup) | 128 | *(__ftr_fixup) |
74 | __stop___ftr_fixup = .; | 129 | __stop___ftr_fixup = .; |
75 | } | 130 | } |
76 | 131 | ||
77 | RODATA | 132 | . = ALIGN(PAGE_SIZE); |
78 | #endif | 133 | .init.ramfs : { |
134 | __initramfs_start = .; | ||
135 | *(.init.ramfs) | ||
136 | __initramfs_end = .; | ||
137 | } | ||
79 | 138 | ||
80 | #ifdef CONFIG_PPC32 | 139 | #ifdef CONFIG_PPC32 |
81 | /* Read-write section, merged into data segment: */ | 140 | . = ALIGN(32); |
82 | . = ALIGN(PAGE_SIZE); | 141 | #else |
83 | _sdata = .; | 142 | . = ALIGN(128); |
84 | .data : | ||
85 | { | ||
86 | *(.data) | ||
87 | *(.data1) | ||
88 | *(.sdata) | ||
89 | *(.sdata2) | ||
90 | *(.got.plt) *(.got) | ||
91 | *(.dynamic) | ||
92 | CONSTRUCTORS | ||
93 | } | ||
94 | |||
95 | . = ALIGN(PAGE_SIZE); | ||
96 | __nosave_begin = .; | ||
97 | .data_nosave : { *(.data.nosave) } | ||
98 | . = ALIGN(PAGE_SIZE); | ||
99 | __nosave_end = .; | ||
100 | |||
101 | . = ALIGN(32); | ||
102 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } | ||
103 | |||
104 | _edata = .; | ||
105 | PROVIDE (edata = .); | ||
106 | |||
107 | . = ALIGN(8192); | ||
108 | .data.init_task : { *(.data.init_task) } | ||
109 | #endif | 143 | #endif |
144 | .data.percpu : { | ||
145 | __per_cpu_start = .; | ||
146 | *(.data.percpu) | ||
147 | __per_cpu_end = .; | ||
148 | } | ||
110 | 149 | ||
111 | /* will be freed after init */ | 150 | . = ALIGN(8); |
112 | . = ALIGN(PAGE_SIZE); | 151 | .machine.desc : { |
113 | __init_begin = .; | 152 | __machine_desc_start = . ; |
114 | .init.text : { | 153 | *(.machine.desc) |
115 | _sinittext = .; | 154 | __machine_desc_end = . ; |
116 | *(.init.text) | 155 | } |
117 | _einittext = .; | 156 | |
118 | } | 157 | /* freed after init ends here */ |
119 | #ifdef CONFIG_PPC32 | 158 | . = ALIGN(PAGE_SIZE); |
120 | /* .exit.text is discarded at runtime, not link time, | 159 | __init_end = .; |
121 | to deal with references from __bug_table */ | 160 | |
122 | .exit.text : { *(.exit.text) } | 161 | /* |
123 | #endif | 162 | * And now the various read/write data |
124 | .init.data : { | 163 | */ |
125 | *(.init.data); | 164 | |
126 | __vtop_table_begin = .; | 165 | . = ALIGN(PAGE_SIZE); |
127 | *(.vtop_fixup); | 166 | _sdata = .; |
128 | __vtop_table_end = .; | ||
129 | __ptov_table_begin = .; | ||
130 | *(.ptov_fixup); | ||
131 | __ptov_table_end = .; | ||
132 | } | ||
133 | |||
134 | . = ALIGN(16); | ||
135 | .init.setup : { | ||
136 | __setup_start = .; | ||
137 | *(.init.setup) | ||
138 | __setup_end = .; | ||
139 | } | ||
140 | |||
141 | .initcall.init : { | ||
142 | __initcall_start = .; | ||
143 | *(.initcall1.init) | ||
144 | *(.initcall2.init) | ||
145 | *(.initcall3.init) | ||
146 | *(.initcall4.init) | ||
147 | *(.initcall5.init) | ||
148 | *(.initcall6.init) | ||
149 | *(.initcall7.init) | ||
150 | __initcall_end = .; | ||
151 | } | ||
152 | |||
153 | .con_initcall.init : { | ||
154 | __con_initcall_start = .; | ||
155 | *(.con_initcall.init) | ||
156 | __con_initcall_end = .; | ||
157 | } | ||
158 | |||
159 | SECURITY_INIT | ||
160 | 167 | ||
161 | #ifdef CONFIG_PPC32 | 168 | #ifdef CONFIG_PPC32 |
162 | __start___ftr_fixup = .; | 169 | .data : |
163 | __ftr_fixup : { *(__ftr_fixup) } | 170 | { |
164 | __stop___ftr_fixup = .; | 171 | *(.data) |
172 | *(.sdata) | ||
173 | *(.got.plt) *(.got) | ||
174 | } | ||
165 | #else | 175 | #else |
166 | . = ALIGN(PAGE_SIZE); | 176 | .data : { |
167 | .init.ramfs : { | 177 | *(.data .data.rel* .toc1) |
168 | __initramfs_start = .; | 178 | *(.branch_lt) |
169 | *(.init.ramfs) | 179 | } |
170 | __initramfs_end = .; | ||
171 | } | ||
172 | #endif | ||
173 | 180 | ||
174 | #ifdef CONFIG_PPC32 | 181 | .opd : { |
175 | . = ALIGN(32); | 182 | *(.opd) |
183 | } | ||
184 | |||
185 | .got : { | ||
186 | __toc_start = .; | ||
187 | *(.got) | ||
188 | *(.toc) | ||
189 | } | ||
176 | #endif | 190 | #endif |
177 | .data.percpu : { | ||
178 | __per_cpu_start = .; | ||
179 | *(.data.percpu) | ||
180 | __per_cpu_end = .; | ||
181 | } | ||
182 | 191 | ||
183 | . = ALIGN(PAGE_SIZE); | 192 | . = ALIGN(PAGE_SIZE); |
184 | #ifdef CONFIG_PPC64 | 193 | _edata = .; |
185 | . = ALIGN(16384); | 194 | PROVIDE32 (edata = .); |
186 | __init_end = .; | 195 | |
187 | /* freed after init ends here */ | 196 | /* The initial task and kernel stack */ |
188 | 197 | #ifdef CONFIG_PPC32 | |
189 | /* Read/write sections */ | 198 | . = ALIGN(8192); |
190 | . = ALIGN(PAGE_SIZE); | ||
191 | . = ALIGN(16384); | ||
192 | _sdata = .; | ||
193 | /* The initial task and kernel stack */ | ||
194 | .data.init_task : { | ||
195 | *(.data.init_task) | ||
196 | } | ||
197 | |||
198 | . = ALIGN(PAGE_SIZE); | ||
199 | .data.page_aligned : { | ||
200 | *(.data.page_aligned) | ||
201 | } | ||
202 | |||
203 | .data.cacheline_aligned : { | ||
204 | *(.data.cacheline_aligned) | ||
205 | } | ||
206 | |||
207 | .data : { | ||
208 | *(.data .data.rel* .toc1) | ||
209 | *(.branch_lt) | ||
210 | } | ||
211 | |||
212 | .opd : { | ||
213 | *(.opd) | ||
214 | } | ||
215 | |||
216 | .got : { | ||
217 | __toc_start = .; | ||
218 | *(.got) | ||
219 | *(.toc) | ||
220 | . = ALIGN(PAGE_SIZE); | ||
221 | _edata = .; | ||
222 | } | ||
223 | |||
224 | . = ALIGN(PAGE_SIZE); | ||
225 | #else | 199 | #else |
226 | __initramfs_start = .; | 200 | . = ALIGN(16384); |
227 | .init.ramfs : { | 201 | #endif |
228 | *(.init.ramfs) | 202 | .data.init_task : { |
229 | } | 203 | *(.data.init_task) |
230 | __initramfs_end = .; | 204 | } |
231 | 205 | ||
232 | . = ALIGN(4096); | 206 | . = ALIGN(PAGE_SIZE); |
233 | __init_end = .; | 207 | .data.page_aligned : { |
208 | *(.data.page_aligned) | ||
209 | } | ||
234 | 210 | ||
235 | . = ALIGN(4096); | 211 | .data.cacheline_aligned : { |
236 | _sextratext = .; | 212 | *(.data.cacheline_aligned) |
237 | _eextratext = .; | 213 | } |
238 | 214 | ||
239 | __bss_start = .; | 215 | . = ALIGN(PAGE_SIZE); |
240 | #endif | 216 | __data_nosave : { |
217 | __nosave_begin = .; | ||
218 | *(.data.nosave) | ||
219 | . = ALIGN(PAGE_SIZE); | ||
220 | __nosave_end = .; | ||
221 | } | ||
241 | 222 | ||
242 | .bss : { | 223 | /* |
243 | __bss_start = .; | 224 | * And finally the bss |
244 | *(.sbss) *(.scommon) | 225 | */ |
245 | *(.dynbss) | 226 | |
246 | *(.bss) | 227 | .bss : { |
247 | *(COMMON) | 228 | __bss_start = .; |
248 | __bss_stop = .; | 229 | *(.sbss) *(.scommon) |
249 | } | 230 | *(.dynbss) |
231 | *(.bss) | ||
232 | *(COMMON) | ||
233 | __bss_stop = .; | ||
234 | } | ||
250 | 235 | ||
251 | #ifdef CONFIG_PPC64 | 236 | . = ALIGN(PAGE_SIZE); |
252 | . = ALIGN(PAGE_SIZE); | 237 | _end = . ; |
253 | #endif | 238 | PROVIDE32 (end = .); |
254 | _end = . ; | ||
255 | #ifdef CONFIG_PPC32 | ||
256 | PROVIDE (end = .); | ||
257 | #endif | ||
258 | } | 239 | } |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 89b35c18131..c006d903963 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -167,7 +167,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
167 | * normal insert callback here. | 167 | * normal insert callback here. |
168 | */ | 168 | */ |
169 | #ifdef CONFIG_PPC_ISERIES | 169 | #ifdef CONFIG_PPC_ISERIES |
170 | if (_machine == PLATFORM_ISERIES_LPAR) | 170 | if (machine_is(iseries)) |
171 | ret = iSeries_hpte_insert(hpteg, va, | 171 | ret = iSeries_hpte_insert(hpteg, va, |
172 | paddr, | 172 | paddr, |
173 | tmp_mode, | 173 | tmp_mode, |
@@ -176,7 +176,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
176 | else | 176 | else |
177 | #endif | 177 | #endif |
178 | #ifdef CONFIG_PPC_PSERIES | 178 | #ifdef CONFIG_PPC_PSERIES |
179 | if (_machine & PLATFORM_LPAR) | 179 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) |
180 | ret = pSeries_lpar_hpte_insert(hpteg, va, | 180 | ret = pSeries_lpar_hpte_insert(hpteg, va, |
181 | paddr, | 181 | paddr, |
182 | tmp_mode, | 182 | tmp_mode, |
@@ -295,8 +295,7 @@ static void __init htab_init_page_sizes(void) | |||
295 | * Not in the device-tree, let's fallback on known size | 295 | * Not in the device-tree, let's fallback on known size |
296 | * list for 16M capable GP & GR | 296 | * list for 16M capable GP & GR |
297 | */ | 297 | */ |
298 | if ((_machine != PLATFORM_ISERIES_LPAR) && | 298 | if (cpu_has_feature(CPU_FTR_16M_PAGE) && !machine_is(iseries)) |
299 | cpu_has_feature(CPU_FTR_16M_PAGE)) | ||
300 | memcpy(mmu_psize_defs, mmu_psize_defaults_gp, | 299 | memcpy(mmu_psize_defs, mmu_psize_defaults_gp, |
301 | sizeof(mmu_psize_defaults_gp)); | 300 | sizeof(mmu_psize_defaults_gp)); |
302 | found: | 301 | found: |
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index fec8e65b36e..dac5d0365fd 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -195,9 +195,13 @@ static void __init cell_init_early(void) | |||
195 | } | 195 | } |
196 | 196 | ||
197 | 197 | ||
198 | static int __init cell_probe(int platform) | 198 | static int __init cell_probe(void) |
199 | { | 199 | { |
200 | if (platform != PLATFORM_CELL) | 200 | /* XXX This is temporary, the Cell maintainer will come up with |
201 | * more appropriate detection logic | ||
202 | */ | ||
203 | unsigned long root = of_get_flat_dt_root(); | ||
204 | if (!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) | ||
201 | return 0; | 205 | return 0; |
202 | 206 | ||
203 | return 1; | 207 | return 1; |
@@ -212,7 +216,8 @@ static int cell_check_legacy_ioport(unsigned int baseport) | |||
212 | return -ENODEV; | 216 | return -ENODEV; |
213 | } | 217 | } |
214 | 218 | ||
215 | struct machdep_calls __initdata cell_md = { | 219 | define_machine(cell) { |
220 | .name = "Cell", | ||
216 | .probe = cell_probe, | 221 | .probe = cell_probe, |
217 | .setup_arch = cell_setup_arch, | 222 | .setup_arch = cell_setup_arch, |
218 | .init_early = cell_init_early, | 223 | .init_early = cell_init_early, |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 9c718bb2305..23a20171870 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -292,6 +292,10 @@ void __init chrp_setup_arch(void) | |||
292 | 292 | ||
293 | pci_create_OF_bus_map(); | 293 | pci_create_OF_bus_map(); |
294 | 294 | ||
295 | #ifdef CONFIG_SMP | ||
296 | smp_ops = &chrp_smp_ops; | ||
297 | #endif /* CONFIG_SMP */ | ||
298 | |||
295 | /* | 299 | /* |
296 | * Print the banner, then scroll down so boot progress | 300 | * Print the banner, then scroll down so boot progress |
297 | * can be printed. -- Cort | 301 | * can be printed. -- Cort |
@@ -506,8 +510,15 @@ chrp_init2(void) | |||
506 | ppc_md.progress(" Have fun! ", 0x7777); | 510 | ppc_md.progress(" Have fun! ", 0x7777); |
507 | } | 511 | } |
508 | 512 | ||
509 | void __init chrp_init(void) | 513 | static int __init chrp_probe(void) |
510 | { | 514 | { |
515 | char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(), | ||
516 | "device_type", NULL); | ||
517 | if (dtype == NULL) | ||
518 | return 0; | ||
519 | if (strcmp(dtype, "chrp")) | ||
520 | return 0; | ||
521 | |||
511 | ISA_DMA_THRESHOLD = ~0L; | 522 | ISA_DMA_THRESHOLD = ~0L; |
512 | DMA_MODE_READ = 0x44; | 523 | DMA_MODE_READ = 0x44; |
513 | DMA_MODE_WRITE = 0x48; | 524 | DMA_MODE_WRITE = 0x48; |
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 155aa690e4b..6ce8a404ba6 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -675,9 +675,10 @@ static void iseries_dedicated_idle(void) | |||
675 | void __init iSeries_init_IRQ(void) { } | 675 | void __init iSeries_init_IRQ(void) { } |
676 | #endif | 676 | #endif |
677 | 677 | ||
678 | static int __init iseries_probe(int platform) | 678 | static int __init iseries_probe(void) |
679 | { | 679 | { |
680 | if (PLATFORM_ISERIES_LPAR != platform) | 680 | unsigned long root = of_get_flat_dt_root(); |
681 | if (!of_flat_dt_is_compatible(root, "IBM,iSeries")) | ||
681 | return 0; | 682 | return 0; |
682 | 683 | ||
683 | powerpc_firmware_features |= FW_FEATURE_ISERIES; | 684 | powerpc_firmware_features |= FW_FEATURE_ISERIES; |
@@ -686,7 +687,8 @@ static int __init iseries_probe(int platform) | |||
686 | return 1; | 687 | return 1; |
687 | } | 688 | } |
688 | 689 | ||
689 | struct machdep_calls __initdata iseries_md = { | 690 | define_machine(iseries) { |
691 | .name = "iSeries", | ||
690 | .setup_arch = iSeries_setup_arch, | 692 | .setup_arch = iSeries_setup_arch, |
691 | .show_cpuinfo = iSeries_show_cpuinfo, | 693 | .show_cpuinfo = iSeries_show_cpuinfo, |
692 | .init_IRQ = iSeries_init_IRQ, | 694 | .init_IRQ = iSeries_init_IRQ, |
@@ -930,7 +932,6 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size) | |||
930 | 932 | ||
931 | /* /chosen */ | 933 | /* /chosen */ |
932 | dt_start_node(dt, "chosen"); | 934 | dt_start_node(dt, "chosen"); |
933 | dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); | ||
934 | dt_prop_str(dt, "bootargs", cmd_line); | 935 | dt_prop_str(dt, "bootargs", cmd_line); |
935 | if (cmd_mem_limit) | 936 | if (cmd_mem_limit) |
936 | dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); | 937 | dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); |
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 137d6063182..24c0aef4ea3 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -259,9 +259,10 @@ static void __init maple_progress(char *s, unsigned short hex) | |||
259 | /* | 259 | /* |
260 | * Called very early, MMU is off, device-tree isn't unflattened | 260 | * Called very early, MMU is off, device-tree isn't unflattened |
261 | */ | 261 | */ |
262 | static int __init maple_probe(int platform) | 262 | static int __init maple_probe(void) |
263 | { | 263 | { |
264 | if (platform != PLATFORM_MAPLE) | 264 | unsigned long root = of_get_flat_dt_root(); |
265 | if (!of_flat_dt_is_compatible(root, "Momentum,Maple")) | ||
265 | return 0; | 266 | return 0; |
266 | /* | 267 | /* |
267 | * On U3, the DART (iommu) must be allocated now since it | 268 | * On U3, the DART (iommu) must be allocated now since it |
@@ -274,7 +275,8 @@ static int __init maple_probe(int platform) | |||
274 | return 1; | 275 | return 1; |
275 | } | 276 | } |
276 | 277 | ||
277 | struct machdep_calls __initdata maple_md = { | 278 | define_machine(maple_md) { |
279 | .name = "Maple", | ||
278 | .probe = maple_probe, | 280 | .probe = maple_probe, |
279 | .setup_arch = maple_setup_arch, | 281 | .setup_arch = maple_setup_arch, |
280 | .init_early = maple_init_early, | 282 | .init_early = maple_init_early, |
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c index a94571be65c..eacbfd9beab 100644 --- a/arch/powerpc/platforms/powermac/bootx_init.c +++ b/arch/powerpc/platforms/powermac/bootx_init.c | |||
@@ -161,9 +161,7 @@ static void __init bootx_dt_add_prop(char *name, void *data, int size, | |||
161 | static void __init bootx_add_chosen_props(unsigned long base, | 161 | static void __init bootx_add_chosen_props(unsigned long base, |
162 | unsigned long *mem_end) | 162 | unsigned long *mem_end) |
163 | { | 163 | { |
164 | u32 val = _MACH_Pmac; | 164 | u32 val; |
165 | |||
166 | bootx_dt_add_prop("linux,platform", &val, 4, mem_end); | ||
167 | 165 | ||
168 | if (bootx_info->kernelParamsOffset) { | 166 | if (bootx_info->kernelParamsOffset) { |
169 | char *args = (char *)((unsigned long)bootx_info) + | 167 | char *args = (char *)((unsigned long)bootx_info) + |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index e49eddd5042..a5063cd675c 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2951,7 +2951,7 @@ static void *pmac_early_vresume_data; | |||
2951 | 2951 | ||
2952 | void pmac_set_early_video_resume(void (*proc)(void *data), void *data) | 2952 | void pmac_set_early_video_resume(void (*proc)(void *data), void *data) |
2953 | { | 2953 | { |
2954 | if (_machine != _MACH_Pmac) | 2954 | if (!machine_is(powermac)) |
2955 | return; | 2955 | return; |
2956 | preempt_disable(); | 2956 | preempt_disable(); |
2957 | pmac_early_vresume_proc = proc; | 2957 | pmac_early_vresume_proc = proc; |
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index 87eb6bb7f0e..e14f9ac55cf 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -1457,6 +1457,9 @@ int __init pmac_i2c_init(void) | |||
1457 | return 0; | 1457 | return 0; |
1458 | i2c_inited = 1; | 1458 | i2c_inited = 1; |
1459 | 1459 | ||
1460 | if (!machine_is(powermac)) | ||
1461 | return 0; | ||
1462 | |||
1460 | /* Probe keywest-i2c busses */ | 1463 | /* Probe keywest-i2c busses */ |
1461 | kw_i2c_probe(); | 1464 | kw_i2c_probe(); |
1462 | 1465 | ||
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c index 3aa3477b86f..262f967b880 100644 --- a/arch/powerpc/platforms/powermac/nvram.c +++ b/arch/powerpc/platforms/powermac/nvram.c | |||
@@ -597,7 +597,7 @@ int __init pmac_nvram_init(void) | |||
597 | } | 597 | } |
598 | 598 | ||
599 | #ifdef CONFIG_PPC32 | 599 | #ifdef CONFIG_PPC32 |
600 | if (_machine == _MACH_chrp && nvram_naddrs == 1) { | 600 | if (machine_is(chrp) && nvram_naddrs == 1) { |
601 | nvram_data = ioremap(r1.start, s1); | 601 | nvram_data = ioremap(r1.start, s1); |
602 | nvram_mult = 1; | 602 | nvram_mult = 1; |
603 | ppc_md.nvram_read_val = direct_nvram_read_byte; | 603 | ppc_md.nvram_read_val = direct_nvram_read_byte; |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index de3f30e6b33..f5d8d15d74f 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -1201,7 +1201,7 @@ void __init pmac_pcibios_after_init(void) | |||
1201 | #ifdef CONFIG_PPC32 | 1201 | #ifdef CONFIG_PPC32 |
1202 | void pmac_pci_fixup_cardbus(struct pci_dev* dev) | 1202 | void pmac_pci_fixup_cardbus(struct pci_dev* dev) |
1203 | { | 1203 | { |
1204 | if (_machine != _MACH_Pmac) | 1204 | if (!machine_is(powermac)) |
1205 | return; | 1205 | return; |
1206 | /* | 1206 | /* |
1207 | * Fix the interrupt routing on the various cardbus bridges | 1207 | * Fix the interrupt routing on the various cardbus bridges |
@@ -1244,8 +1244,9 @@ void pmac_pci_fixup_pciata(struct pci_dev* dev) | |||
1244 | * On PowerMacs, we try to switch any PCI ATA controller to | 1244 | * On PowerMacs, we try to switch any PCI ATA controller to |
1245 | * fully native mode | 1245 | * fully native mode |
1246 | */ | 1246 | */ |
1247 | if (_machine != _MACH_Pmac) | 1247 | if (!machine_is(powermac)) |
1248 | return; | 1248 | return; |
1249 | |||
1249 | /* Some controllers don't have the class IDE */ | 1250 | /* Some controllers don't have the class IDE */ |
1250 | if (dev->vendor == PCI_VENDOR_ID_PROMISE) | 1251 | if (dev->vendor == PCI_VENDOR_ID_PROMISE) |
1251 | switch(dev->device) { | 1252 | switch(dev->device) { |
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c index 9b7150f1041..a3bd3e728fa 100644 --- a/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/arch/powerpc/platforms/powermac/pfunc_base.c | |||
@@ -336,6 +336,8 @@ int __init pmac_pfunc_base_install(void) | |||
336 | return 0; | 336 | return 0; |
337 | pfbase_inited = 1; | 337 | pfbase_inited = 1; |
338 | 338 | ||
339 | if (!machine_is(powermac)) | ||
340 | return 0; | ||
339 | 341 | ||
340 | DBG("Installing base platform functions...\n"); | 342 | DBG("Installing base platform functions...\n"); |
341 | 343 | ||
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index c2696d00672..4d15e396655 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -350,6 +350,13 @@ static void __init pmac_setup_arch(void) | |||
350 | smp_ops = &psurge_smp_ops; | 350 | smp_ops = &psurge_smp_ops; |
351 | #endif | 351 | #endif |
352 | #endif /* CONFIG_SMP */ | 352 | #endif /* CONFIG_SMP */ |
353 | |||
354 | #ifdef CONFIG_ADB | ||
355 | if (strstr(cmd_line, "adb_sync")) { | ||
356 | extern int __adb_probe_sync; | ||
357 | __adb_probe_sync = 1; | ||
358 | } | ||
359 | #endif /* CONFIG_ADB */ | ||
353 | } | 360 | } |
354 | 361 | ||
355 | char *bootpath; | 362 | char *bootpath; |
@@ -576,30 +583,6 @@ pmac_halt(void) | |||
576 | pmac_power_off(); | 583 | pmac_power_off(); |
577 | } | 584 | } |
578 | 585 | ||
579 | #ifdef CONFIG_PPC32 | ||
580 | void __init pmac_init(void) | ||
581 | { | ||
582 | /* isa_io_base gets set in pmac_pci_init */ | ||
583 | isa_mem_base = PMAC_ISA_MEM_BASE; | ||
584 | pci_dram_offset = PMAC_PCI_DRAM_OFFSET; | ||
585 | ISA_DMA_THRESHOLD = ~0L; | ||
586 | DMA_MODE_READ = 1; | ||
587 | DMA_MODE_WRITE = 2; | ||
588 | |||
589 | ppc_md = pmac_md; | ||
590 | |||
591 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) | ||
592 | #ifdef CONFIG_BLK_DEV_IDE_PMAC | ||
593 | ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; | ||
594 | ppc_ide_md.default_io_base = pmac_ide_get_base; | ||
595 | #endif /* CONFIG_BLK_DEV_IDE_PMAC */ | ||
596 | #endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */ | ||
597 | |||
598 | if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0); | ||
599 | |||
600 | } | ||
601 | #endif | ||
602 | |||
603 | /* | 586 | /* |
604 | * Early initialization. | 587 | * Early initialization. |
605 | */ | 588 | */ |
@@ -646,6 +629,12 @@ static int __init pmac_declare_of_platform_devices(void) | |||
646 | { | 629 | { |
647 | struct device_node *np; | 630 | struct device_node *np; |
648 | 631 | ||
632 | if (machine_is(chrp)) | ||
633 | return -1; | ||
634 | |||
635 | if (!machine_is(powermac)) | ||
636 | return 0; | ||
637 | |||
649 | np = of_find_node_by_name(NULL, "valkyrie"); | 638 | np = of_find_node_by_name(NULL, "valkyrie"); |
650 | if (np) | 639 | if (np) |
651 | of_platform_device_create(np, "valkyrie", NULL); | 640 | of_platform_device_create(np, "valkyrie", NULL); |
@@ -666,12 +655,15 @@ device_initcall(pmac_declare_of_platform_devices); | |||
666 | /* | 655 | /* |
667 | * Called very early, MMU is off, device-tree isn't unflattened | 656 | * Called very early, MMU is off, device-tree isn't unflattened |
668 | */ | 657 | */ |
669 | static int __init pmac_probe(int platform) | 658 | static int __init pmac_probe(void) |
670 | { | 659 | { |
671 | #ifdef CONFIG_PPC64 | 660 | unsigned long root = of_get_flat_dt_root(); |
672 | if (platform != PLATFORM_POWERMAC) | 661 | |
662 | if (!of_flat_dt_is_compatible(root, "Power Macintosh") && | ||
663 | !of_flat_dt_is_compatible(root, "MacRISC")) | ||
673 | return 0; | 664 | return 0; |
674 | 665 | ||
666 | #ifdef CONFIG_PPC64 | ||
675 | /* | 667 | /* |
676 | * On U3, the DART (iommu) must be allocated now since it | 668 | * On U3, the DART (iommu) must be allocated now since it |
677 | * has an impact on htab_initialize (due to the large page it | 669 | * has an impact on htab_initialize (due to the large page it |
@@ -681,6 +673,23 @@ static int __init pmac_probe(int platform) | |||
681 | alloc_dart_table(); | 673 | alloc_dart_table(); |
682 | #endif | 674 | #endif |
683 | 675 | ||
676 | #ifdef CONFIG_PPC32 | ||
677 | /* isa_io_base gets set in pmac_pci_init */ | ||
678 | isa_mem_base = PMAC_ISA_MEM_BASE; | ||
679 | pci_dram_offset = PMAC_PCI_DRAM_OFFSET; | ||
680 | ISA_DMA_THRESHOLD = ~0L; | ||
681 | DMA_MODE_READ = 1; | ||
682 | DMA_MODE_WRITE = 2; | ||
683 | |||
684 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) | ||
685 | #ifdef CONFIG_BLK_DEV_IDE_PMAC | ||
686 | ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; | ||
687 | ppc_ide_md.default_io_base = pmac_ide_get_base; | ||
688 | #endif /* CONFIG_BLK_DEV_IDE_PMAC */ | ||
689 | #endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */ | ||
690 | |||
691 | #endif /* CONFIG_PPC32 */ | ||
692 | |||
684 | #ifdef CONFIG_PMAC_SMU | 693 | #ifdef CONFIG_PMAC_SMU |
685 | /* | 694 | /* |
686 | * SMU based G5s need some memory below 2Gb, at least the current | 695 | * SMU based G5s need some memory below 2Gb, at least the current |
@@ -709,10 +718,8 @@ static int pmac_pci_probe_mode(struct pci_bus *bus) | |||
709 | } | 718 | } |
710 | #endif | 719 | #endif |
711 | 720 | ||
712 | struct machdep_calls __initdata pmac_md = { | 721 | define_machine(powermac) { |
713 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) | 722 | .name = "PowerMac", |
714 | .cpu_die = generic_mach_cpu_die, | ||
715 | #endif | ||
716 | .probe = pmac_probe, | 723 | .probe = pmac_probe, |
717 | .setup_arch = pmac_setup_arch, | 724 | .setup_arch = pmac_setup_arch, |
718 | .init_early = pmac_init_early, | 725 | .init_early = pmac_init_early, |
@@ -746,4 +753,7 @@ struct machdep_calls __initdata pmac_md = { | |||
746 | .pcibios_after_init = pmac_pcibios_after_init, | 753 | .pcibios_after_init = pmac_pcibios_after_init, |
747 | .phys_mem_access_prot = pci_phys_mem_access_prot, | 754 | .phys_mem_access_prot = pci_phys_mem_access_prot, |
748 | #endif | 755 | #endif |
756 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) | ||
757 | .cpu_die = generic_mach_cpu_die, | ||
758 | #endif | ||
749 | }; | 759 | }; |
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index 5d9afa1fa02..890758aa966 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
@@ -336,10 +336,10 @@ static struct pmu_sleep_notifier time_sleep_notifier = { | |||
336 | */ | 336 | */ |
337 | void __init pmac_calibrate_decr(void) | 337 | void __init pmac_calibrate_decr(void) |
338 | { | 338 | { |
339 | #ifdef CONFIG_PM | 339 | #if defined(CONFIG_PM) && defined(CONFIG_ADB_PMU) |
340 | /* XXX why here? */ | 340 | /* XXX why here? */ |
341 | pmu_register_sleep_notifier(&time_sleep_notifier); | 341 | pmu_register_sleep_notifier(&time_sleep_notifier); |
342 | #endif /* CONFIG_PM */ | 342 | #endif |
343 | 343 | ||
344 | generic_calibrate_decr(); | 344 | generic_calibrate_decr(); |
345 | 345 | ||
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 2ab9dcdfb41..9b2b1cb117b 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -1018,7 +1018,7 @@ static int __init eeh_init_proc(void) | |||
1018 | { | 1018 | { |
1019 | struct proc_dir_entry *e; | 1019 | struct proc_dir_entry *e; |
1020 | 1020 | ||
1021 | if (platform_is_pseries()) { | 1021 | if (machine_is(pseries)) { |
1022 | e = create_proc_entry("ppc64/eeh", 0, NULL); | 1022 | e = create_proc_entry("ppc64/eeh", 0, NULL); |
1023 | if (e) | 1023 | if (e) |
1024 | e->proc_fops = &proc_eeh_operations; | 1024 | e->proc_fops = &proc_eeh_operations; |
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 946ad59e335..e97e67f5e07 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -120,7 +120,7 @@ static void fixup_winbond_82c105(struct pci_dev* dev) | |||
120 | int i; | 120 | int i; |
121 | unsigned int reg; | 121 | unsigned int reg; |
122 | 122 | ||
123 | if (!platform_is_pseries()) | 123 | if (!machine_is(pseries)) |
124 | return; | 124 | return; |
125 | 125 | ||
126 | printk("Using INTC for W82c105 IDE controller.\n"); | 126 | printk("Using INTC for W82c105 IDE controller.\n"); |
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index b3c2dcb1e4f..6bfacc21708 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
29 | #include <asm/pci-bridge.h> | 29 | #include <asm/pci-bridge.h> |
30 | #include <asm/ppc-pci.h> | 30 | #include <asm/ppc-pci.h> |
31 | #include <asm/firmware.h> | ||
31 | 32 | ||
32 | static struct pci_bus * | 33 | static struct pci_bus * |
33 | find_bus_among_children(struct pci_bus *bus, | 34 | find_bus_among_children(struct pci_bus *bus, |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 86cfa6ecdcf..9a4b592e40b 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -17,8 +17,9 @@ | |||
17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
18 | 18 | ||
19 | #include <asm/prom.h> | 19 | #include <asm/prom.h> |
20 | #include <asm/pSeries_reconfig.h> | 20 | #include <asm/machdep.h> |
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | #include <asm/pSeries_reconfig.h> | ||
22 | 23 | ||
23 | 24 | ||
24 | 25 | ||
@@ -508,7 +509,7 @@ static int proc_ppc64_create_ofdt(void) | |||
508 | { | 509 | { |
509 | struct proc_dir_entry *ent; | 510 | struct proc_dir_entry *ent; |
510 | 511 | ||
511 | if (!platform_is_pseries()) | 512 | if (!machine_is(pseries)) |
512 | return 0; | 513 | return 0; |
513 | 514 | ||
514 | ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); | 515 | ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); |
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index a6f628d4c9d..fcc4d561a23 100644 --- a/arch/powerpc/platforms/pseries/rtasd.c +++ b/arch/powerpc/platforms/pseries/rtasd.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/prom.h> | 27 | #include <asm/prom.h> |
28 | #include <asm/nvram.h> | 28 | #include <asm/nvram.h> |
29 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
30 | #include <asm/machdep.h> | ||
30 | 31 | ||
31 | #if 0 | 32 | #if 0 |
32 | #define DEBUG(A...) printk(KERN_ERR A) | 33 | #define DEBUG(A...) printk(KERN_ERR A) |
@@ -481,7 +482,7 @@ static int __init rtas_init(void) | |||
481 | { | 482 | { |
482 | struct proc_dir_entry *entry; | 483 | struct proc_dir_entry *entry; |
483 | 484 | ||
484 | if (!platform_is_pseries()) | 485 | if (!machine_is(pseries)) |
485 | return 0; | 486 | return 0; |
486 | 487 | ||
487 | /* No RTAS */ | 488 | /* No RTAS */ |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 1b0c4c034a2..b2fbf8ba8fb 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -372,24 +372,42 @@ static int pSeries_check_legacy_ioport(unsigned int baseport) | |||
372 | /* | 372 | /* |
373 | * Called very early, MMU is off, device-tree isn't unflattened | 373 | * Called very early, MMU is off, device-tree isn't unflattened |
374 | */ | 374 | */ |
375 | extern struct machdep_calls pSeries_md; | ||
376 | 375 | ||
377 | static int __init pSeries_probe(int platform) | 376 | static int __init pSeries_probe_hypertas(unsigned long node, |
377 | const char *uname, int depth, | ||
378 | void *data) | ||
378 | { | 379 | { |
379 | if (platform != PLATFORM_PSERIES && | 380 | if (depth != 1 || |
380 | platform != PLATFORM_PSERIES_LPAR) | 381 | (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) |
382 | return 0; | ||
383 | |||
384 | if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) | ||
385 | powerpc_firmware_features |= FW_FEATURE_LPAR; | ||
386 | |||
387 | return 1; | ||
388 | } | ||
389 | |||
390 | static int __init pSeries_probe(void) | ||
391 | { | ||
392 | char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(), | ||
393 | "device_type", NULL); | ||
394 | if (dtype == NULL) | ||
395 | return 0; | ||
396 | if (strcmp(dtype, "chrp")) | ||
381 | return 0; | 397 | return 0; |
382 | 398 | ||
383 | /* if we have some ppc_md fixups for LPAR to do, do | 399 | DBG("pSeries detected, looking for LPAR capability...\n"); |
384 | * it here ... | ||
385 | */ | ||
386 | 400 | ||
387 | if (platform == PLATFORM_PSERIES_LPAR) | 401 | /* Now try to figure out if we are running on LPAR */ |
388 | powerpc_firmware_features |= FW_FEATURE_LPAR; | 402 | of_scan_flat_dt(pSeries_probe_hypertas, NULL); |
403 | |||
404 | DBG("Machine is%s LPAR !\n", | ||
405 | (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not"); | ||
389 | 406 | ||
390 | return 1; | 407 | return 1; |
391 | } | 408 | } |
392 | 409 | ||
410 | |||
393 | DECLARE_PER_CPU(unsigned long, smt_snooze_delay); | 411 | DECLARE_PER_CPU(unsigned long, smt_snooze_delay); |
394 | 412 | ||
395 | static void pseries_dedicated_idle_sleep(void) | 413 | static void pseries_dedicated_idle_sleep(void) |
@@ -501,7 +519,8 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) | |||
501 | } | 519 | } |
502 | #endif | 520 | #endif |
503 | 521 | ||
504 | struct machdep_calls __initdata pSeries_md = { | 522 | define_machine(pseries) { |
523 | .name = "pSeries", | ||
505 | .probe = pSeries_probe, | 524 | .probe = pSeries_probe, |
506 | .setup_arch = pSeries_setup_arch, | 525 | .setup_arch = pSeries_setup_arch, |
507 | .init_early = pSeries_init_early, | 526 | .init_early = pSeries_init_early, |