diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 13 | ||||
-rw-r--r-- | arch/powerpc/kernel/machine_kexec_64.c | 13 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 61 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init_check.sh | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/udbg_16550.c | 2 |
5 files changed, 28 insertions, 63 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index e70d0483fb4..b1eb834bc0f 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -1277,6 +1277,19 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
1277 | .machine_check = machine_check_4xx, | 1277 | .machine_check = machine_check_4xx, |
1278 | .platform = "ppc405", | 1278 | .platform = "ppc405", |
1279 | }, | 1279 | }, |
1280 | { | ||
1281 | /* 405EZ */ | ||
1282 | .pvr_mask = 0xffff0000, | ||
1283 | .pvr_value = 0x41510000, | ||
1284 | .cpu_name = "405EZ", | ||
1285 | .cpu_features = CPU_FTRS_40X, | ||
1286 | .cpu_user_features = PPC_FEATURE_32 | | ||
1287 | PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, | ||
1288 | .icache_bsize = 32, | ||
1289 | .dcache_bsize = 32, | ||
1290 | .machine_check = machine_check_4xx, | ||
1291 | .platform = "ppc405", | ||
1292 | }, | ||
1280 | { /* default match */ | 1293 | { /* default match */ |
1281 | .pvr_mask = 0x00000000, | 1294 | .pvr_mask = 0x00000000, |
1282 | .pvr_value = 0x00000000, | 1295 | .pvr_value = 0x00000000, |
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index a168514d860..4bd8b4f5e70 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -312,11 +312,24 @@ static struct property kernel_end_prop = { | |||
312 | static void __init export_htab_values(void) | 312 | static void __init export_htab_values(void) |
313 | { | 313 | { |
314 | struct device_node *node; | 314 | struct device_node *node; |
315 | struct property *prop; | ||
315 | 316 | ||
316 | node = of_find_node_by_path("/chosen"); | 317 | node = of_find_node_by_path("/chosen"); |
317 | if (!node) | 318 | if (!node) |
318 | return; | 319 | return; |
319 | 320 | ||
321 | /* remove any stale propertys so ours can be found */ | ||
322 | prop = of_find_property(node, kernel_end_prop.name, NULL); | ||
323 | if (prop) | ||
324 | prom_remove_property(node, prop); | ||
325 | prop = of_find_property(node, htab_base_prop.name, NULL); | ||
326 | if (prop) | ||
327 | prom_remove_property(node, prop); | ||
328 | prop = of_find_property(node, htab_size_prop.name, NULL); | ||
329 | if (prop) | ||
330 | prom_remove_property(node, prop); | ||
331 | |||
332 | /* information needed by userspace when using default_machine_kexec */ | ||
320 | kernel_end = __pa(_end); | 333 | kernel_end = __pa(_end); |
321 | prom_add_property(node, &kernel_end_prop); | 334 | prom_add_property(node, &kernel_end_prop); |
322 | 335 | ||
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 2fdbc18ae94..23e0db20332 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -487,67 +487,6 @@ static int __init prom_setprop(phandle node, const char *nodename, | |||
487 | return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd); | 487 | return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd); |
488 | } | 488 | } |
489 | 489 | ||
490 | /* We can't use the standard versions because of RELOC headaches. */ | ||
491 | #define isxdigit(c) (('0' <= (c) && (c) <= '9') \ | ||
492 | || ('a' <= (c) && (c) <= 'f') \ | ||
493 | || ('A' <= (c) && (c) <= 'F')) | ||
494 | |||
495 | #define isdigit(c) ('0' <= (c) && (c) <= '9') | ||
496 | #define islower(c) ('a' <= (c) && (c) <= 'z') | ||
497 | #define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c)) | ||
498 | |||
499 | unsigned long prom_strtoul(const char *cp, const char **endp) | ||
500 | { | ||
501 | unsigned long result = 0, base = 10, value; | ||
502 | |||
503 | if (*cp == '0') { | ||
504 | base = 8; | ||
505 | cp++; | ||
506 | if (toupper(*cp) == 'X') { | ||
507 | cp++; | ||
508 | base = 16; | ||
509 | } | ||
510 | } | ||
511 | |||
512 | while (isxdigit(*cp) && | ||
513 | (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) { | ||
514 | result = result * base + value; | ||
515 | cp++; | ||
516 | } | ||
517 | |||
518 | if (endp) | ||
519 | *endp = cp; | ||
520 | |||
521 | return result; | ||
522 | } | ||
523 | |||
524 | unsigned long prom_memparse(const char *ptr, const char **retptr) | ||
525 | { | ||
526 | unsigned long ret = prom_strtoul(ptr, retptr); | ||
527 | int shift = 0; | ||
528 | |||
529 | /* | ||
530 | * We can't use a switch here because GCC *may* generate a | ||
531 | * jump table which won't work, because we're not running at | ||
532 | * the address we're linked at. | ||
533 | */ | ||
534 | if ('G' == **retptr || 'g' == **retptr) | ||
535 | shift = 30; | ||
536 | |||
537 | if ('M' == **retptr || 'm' == **retptr) | ||
538 | shift = 20; | ||
539 | |||
540 | if ('K' == **retptr || 'k' == **retptr) | ||
541 | shift = 10; | ||
542 | |||
543 | if (shift) { | ||
544 | ret <<= shift; | ||
545 | (*retptr)++; | ||
546 | } | ||
547 | |||
548 | return ret; | ||
549 | } | ||
550 | |||
551 | /* | 490 | /* |
552 | * Early parsing of the command line passed to the kernel, used for | 491 | * Early parsing of the command line passed to the kernel, used for |
553 | * "mem=x" and the options that affect the iommu | 492 | * "mem=x" and the options that affect the iommu |
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh index 2c7e8e87f77..ea3a2ec03ff 100644 --- a/arch/powerpc/kernel/prom_init_check.sh +++ b/arch/powerpc/kernel/prom_init_check.sh | |||
@@ -20,7 +20,7 @@ WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush | |||
20 | _end enter_prom memcpy memset reloc_offset __secondary_hold | 20 | _end enter_prom memcpy memset reloc_offset __secondary_hold |
21 | __secondary_hold_acknowledge __secondary_hold_spinloop __start | 21 | __secondary_hold_acknowledge __secondary_hold_spinloop __start |
22 | strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224 | 22 | strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224 |
23 | reloc_got2 kernstart_addr" | 23 | reloc_got2 kernstart_addr memstart_addr" |
24 | 24 | ||
25 | NM="$1" | 25 | NM="$1" |
26 | OBJ="$2" | 26 | OBJ="$2" |
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c index cb01ebc5938..7b7da8cfd5e 100644 --- a/arch/powerpc/kernel/udbg_16550.c +++ b/arch/powerpc/kernel/udbg_16550.c | |||
@@ -142,7 +142,7 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock) | |||
142 | speed = (clock / prescaler) / (divisor * 16); | 142 | speed = (clock / prescaler) / (divisor * 16); |
143 | 143 | ||
144 | /* sanity check */ | 144 | /* sanity check */ |
145 | if (speed < 0 || speed > (clock / 16)) | 145 | if (speed > (clock / 16)) |
146 | speed = 9600; | 146 | speed = 9600; |
147 | 147 | ||
148 | return speed; | 148 | return speed; |