diff options
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
| -rw-r--r-- | arch/powerpc/kernel/prom.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index f645adb57534..6a5b468edb4d 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
| @@ -48,9 +48,6 @@ | |||
| 48 | #include <asm/machdep.h> | 48 | #include <asm/machdep.h> |
| 49 | #include <asm/pSeries_reconfig.h> | 49 | #include <asm/pSeries_reconfig.h> |
| 50 | #include <asm/pci-bridge.h> | 50 | #include <asm/pci-bridge.h> |
| 51 | #ifdef CONFIG_PPC64 | ||
| 52 | #include <asm/systemcfg.h> | ||
| 53 | #endif | ||
| 54 | 51 | ||
| 55 | #ifdef DEBUG | 52 | #ifdef DEBUG |
| 56 | #define DBG(fmt...) printk(KERN_ERR fmt) | 53 | #define DBG(fmt...) printk(KERN_ERR fmt) |
| @@ -74,10 +71,6 @@ struct isa_reg_property { | |||
| 74 | typedef int interpret_func(struct device_node *, unsigned long *, | 71 | typedef int interpret_func(struct device_node *, unsigned long *, |
| 75 | int, int, int); | 72 | int, int, int); |
| 76 | 73 | ||
| 77 | extern struct rtas_t rtas; | ||
| 78 | extern struct lmb lmb; | ||
| 79 | extern unsigned long klimit; | ||
| 80 | |||
| 81 | static int __initdata dt_root_addr_cells; | 74 | static int __initdata dt_root_addr_cells; |
| 82 | static int __initdata dt_root_size_cells; | 75 | static int __initdata dt_root_size_cells; |
| 83 | 76 | ||
| @@ -391,7 +384,7 @@ static int __devinit finish_node_interrupts(struct device_node *np, | |||
| 391 | 384 | ||
| 392 | #ifdef CONFIG_PPC64 | 385 | #ifdef CONFIG_PPC64 |
| 393 | /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ | 386 | /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ |
| 394 | if (systemcfg->platform == PLATFORM_POWERMAC && ic && ic->parent) { | 387 | if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { |
| 395 | char *name = get_property(ic->parent, "name", NULL); | 388 | char *name = get_property(ic->parent, "name", NULL); |
| 396 | if (name && !strcmp(name, "u3")) | 389 | if (name && !strcmp(name, "u3")) |
| 397 | np->intrs[intrcount].line += 128; | 390 | np->intrs[intrcount].line += 128; |
| @@ -1087,9 +1080,9 @@ void __init unflatten_device_tree(void) | |||
| 1087 | static int __init early_init_dt_scan_cpus(unsigned long node, | 1080 | static int __init early_init_dt_scan_cpus(unsigned long node, |
| 1088 | const char *uname, int depth, void *data) | 1081 | const char *uname, int depth, void *data) |
| 1089 | { | 1082 | { |
| 1090 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); | ||
| 1091 | u32 *prop; | 1083 | u32 *prop; |
| 1092 | unsigned long size = 0; | 1084 | unsigned long size; |
| 1085 | char *type = of_get_flat_dt_prop(node, "device_type", &size); | ||
| 1093 | 1086 | ||
| 1094 | /* We are scanning "cpu" nodes only */ | 1087 | /* We are scanning "cpu" nodes only */ |
| 1095 | if (type == NULL || strcmp(type, "cpu") != 0) | 1088 | if (type == NULL || strcmp(type, "cpu") != 0) |
| @@ -1115,7 +1108,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
| 1115 | 1108 | ||
| 1116 | #ifdef CONFIG_ALTIVEC | 1109 | #ifdef CONFIG_ALTIVEC |
| 1117 | /* Check if we have a VMX and eventually update CPU features */ | 1110 | /* Check if we have a VMX and eventually update CPU features */ |
| 1118 | prop = (u32 *)of_get_flat_dt_prop(node, "ibm,vmx", &size); | 1111 | prop = (u32 *)of_get_flat_dt_prop(node, "ibm,vmx", NULL); |
| 1119 | if (prop && (*prop) > 0) { | 1112 | if (prop && (*prop) > 0) { |
| 1120 | cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; | 1113 | cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; |
| 1121 | cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; | 1114 | cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; |
| @@ -1161,13 +1154,9 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
| 1161 | prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); | 1154 | prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); |
| 1162 | if (prop == NULL) | 1155 | if (prop == NULL) |
| 1163 | return 0; | 1156 | return 0; |
| 1164 | #ifdef CONFIG_PPC64 | ||
| 1165 | systemcfg->platform = *prop; | ||
| 1166 | #else | ||
| 1167 | #ifdef CONFIG_PPC_MULTIPLATFORM | 1157 | #ifdef CONFIG_PPC_MULTIPLATFORM |
| 1168 | _machine = *prop; | 1158 | _machine = *prop; |
| 1169 | #endif | 1159 | #endif |
| 1170 | #endif | ||
| 1171 | 1160 | ||
| 1172 | #ifdef CONFIG_PPC64 | 1161 | #ifdef CONFIG_PPC64 |
| 1173 | /* check if iommu is forced on or off */ | 1162 | /* check if iommu is forced on or off */ |
| @@ -1264,7 +1253,14 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
| 1264 | unsigned long l; | 1253 | unsigned long l; |
| 1265 | 1254 | ||
| 1266 | /* We are scanning "memory" nodes only */ | 1255 | /* We are scanning "memory" nodes only */ |
| 1267 | if (type == NULL || strcmp(type, "memory") != 0) | 1256 | if (type == NULL) { |
| 1257 | /* | ||
| 1258 | * The longtrail doesn't have a device_type on the | ||
| 1259 | * /memory node, so look for the node called /memory@0. | ||
| 1260 | */ | ||
| 1261 | if (depth != 1 || strcmp(uname, "memory@0") != 0) | ||
| 1262 | return 0; | ||
| 1263 | } else if (strcmp(type, "memory") != 0) | ||
| 1268 | return 0; | 1264 | return 0; |
| 1269 | 1265 | ||
| 1270 | reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); | 1266 | reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); |
| @@ -1339,9 +1335,6 @@ void __init early_init_devtree(void *params) | |||
| 1339 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); | 1335 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); |
| 1340 | lmb_enforce_memory_limit(memory_limit); | 1336 | lmb_enforce_memory_limit(memory_limit); |
| 1341 | lmb_analyze(); | 1337 | lmb_analyze(); |
| 1342 | #ifdef CONFIG_PPC64 | ||
| 1343 | systemcfg->physicalMemorySize = lmb_phys_mem_size(); | ||
| 1344 | #endif | ||
| 1345 | lmb_reserve(0, __pa(klimit)); | 1338 | lmb_reserve(0, __pa(klimit)); |
| 1346 | 1339 | ||
| 1347 | DBG("Phys. mem: %lx\n", lmb_phys_mem_size()); | 1340 | DBG("Phys. mem: %lx\n", lmb_phys_mem_size()); |
| @@ -1908,7 +1901,7 @@ static int of_finish_dynamic_node(struct device_node *node, | |||
| 1908 | /* We don't support that function on PowerMac, at least | 1901 | /* We don't support that function on PowerMac, at least |
| 1909 | * not yet | 1902 | * not yet |
| 1910 | */ | 1903 | */ |
| 1911 | if (systemcfg->platform == PLATFORM_POWERMAC) | 1904 | if (_machine == PLATFORM_POWERMAC) |
| 1912 | return -ENODEV; | 1905 | return -ENODEV; |
| 1913 | 1906 | ||
| 1914 | /* fix up new node's linux_phandle field */ | 1907 | /* fix up new node's linux_phandle field */ |
| @@ -1992,9 +1985,11 @@ int prom_add_property(struct device_node* np, struct property* prop) | |||
| 1992 | *next = prop; | 1985 | *next = prop; |
| 1993 | write_unlock(&devtree_lock); | 1986 | write_unlock(&devtree_lock); |
| 1994 | 1987 | ||
| 1988 | #ifdef CONFIG_PROC_DEVICETREE | ||
| 1995 | /* try to add to proc as well if it was initialized */ | 1989 | /* try to add to proc as well if it was initialized */ |
| 1996 | if (np->pde) | 1990 | if (np->pde) |
| 1997 | proc_device_tree_add_prop(np->pde, prop); | 1991 | proc_device_tree_add_prop(np->pde, prop); |
| 1992 | #endif /* CONFIG_PROC_DEVICETREE */ | ||
| 1998 | 1993 | ||
| 1999 | return 0; | 1994 | return 0; |
| 2000 | } | 1995 | } |
