From 2dd3c0016090543e12aa0c5aee574ded6a88b886 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sun, 4 Nov 2007 15:44:15 -0600 Subject: [POWERPC] pasemi: clean up mdio_gpio a bit Misc cleanups of mdio_gpio: * Better error handling/unrolling in case of init/alloc failures * Go through child nodes and get their interrupts instead of using hardcoded values * Remap the GPIO registers at module load/driver init instead of during probe * Coding style and other misc cleanups Signed-off-by: Olof Johansson --- arch/powerpc/platforms/pasemi/gpio_mdio.c | 88 ++++++++++++++++++------------- 1 file changed, 51 insertions(+), 37 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index dae9f658122e..95d0c78cf634 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -218,45 +218,27 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, const struct of_device_id *match) { struct device *dev = &ofdev->dev; - struct device_node *np = ofdev->node; - struct device_node *gpio_np; + struct device_node *phy_dn, *np = ofdev->node; struct mii_bus *new_bus; - struct resource res; struct gpio_priv *priv; const unsigned int *prop; - int err = 0; + int err; int i; - gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio"); - - if (!gpio_np) - return -ENODEV; - - err = of_address_to_resource(gpio_np, 0, &res); - of_node_put(gpio_np); - - if (err) - return -EINVAL; - - if (!gpio_regs) - gpio_regs = ioremap(res.start, 0x100); - - if (!gpio_regs) - return -EPERM; - + err = -ENOMEM; priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL); - if (priv == NULL) - return -ENOMEM; + if (!priv) + goto out; new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); - if (new_bus == NULL) - return -ENOMEM; + if (!new_bus) + goto out_free_priv; - new_bus->name = "pasemi gpio mdio bus", - new_bus->read = &gpio_mdio_read, - new_bus->write = &gpio_mdio_write, - new_bus->reset = &gpio_mdio_reset, + new_bus->name = "pasemi gpio mdio bus"; + new_bus->read = &gpio_mdio_read; + new_bus->write = &gpio_mdio_write; + new_bus->reset = &gpio_mdio_reset; prop = of_get_property(np, "reg", NULL); new_bus->id = *prop; @@ -265,9 +247,24 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, new_bus->phy_mask = 0; new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); - for(i = 0; i < PHY_MAX_ADDR; ++i) - new_bus->irq[i] = irq_create_mapping(NULL, 10); + if (!new_bus->irq) + goto out_free_bus; + + for (i = 0; i < PHY_MAX_ADDR; i++) + new_bus->irq[i] = NO_IRQ; + + for (phy_dn = of_get_next_child(np, NULL); + phy_dn != NULL; + phy_dn = of_get_next_child(np, phy_dn)) { + const unsigned int *ip, *regp; + + ip = of_get_property(phy_dn, "interrupts", NULL); + regp = of_get_property(phy_dn, "reg", NULL); + if (!ip || !regp || *regp >= PHY_MAX_ADDR) + continue; + new_bus->irq[*regp] = irq_create_mapping(NULL, *ip); + } prop = of_get_property(np, "mdc-pin", NULL); priv->mdc_pin = *prop; @@ -280,17 +277,21 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, err = mdiobus_register(new_bus); - if (0 != err) { + if (err != 0) { printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n", new_bus->name, err); - goto bus_register_fail; + goto out_free_irq; } return 0; -bus_register_fail: +out_free_irq: + kfree(new_bus->irq); +out_free_bus: kfree(new_bus); - +out_free_priv: + kfree(priv); +out: return err; } @@ -330,12 +331,25 @@ static struct of_platform_driver gpio_mdio_driver = int gpio_mdio_init(void) { + struct device_node *np; + + np = of_find_compatible_node(NULL, "gpio", "1682m-gpio"); + if (!np) + return -ENODEV; + gpio_regs = of_iomap(np, 0); + of_node_put(np); + + if (!gpio_regs) + return -ENODEV; + return of_register_platform_driver(&gpio_mdio_driver); } +module_init(gpio_mdio_init); void gpio_mdio_exit(void) { of_unregister_platform_driver(&gpio_mdio_driver); + if (gpio_regs) + iounmap(gpio_regs); } -device_initcall(gpio_mdio_init); - +module_exit(gpio_mdio_exit); -- cgit v1.2.3 From 0d08a84770cb03aea24268e515342d44df8ea588 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sun, 4 Nov 2007 20:57:45 -0600 Subject: [POWERPC] pasemi: Broaden specific references to 1682M There will be more product numbers in the future than just PA6T-1682M, but they will share much of the features. Remove some of the explicit references and compatibility checks with 1682M, and replace most of them with the more generic term "PWRficient". Signed-off-by: Olof Johansson Acked-by: Michael Buesch Acked-by: Doug Thompson --- arch/powerpc/platforms/pasemi/Kconfig | 2 +- arch/powerpc/platforms/pasemi/cpufreq.c | 13 ++++++++++--- arch/powerpc/platforms/pasemi/gpio_mdio.c | 5 ++++- arch/powerpc/platforms/pasemi/setup.c | 9 +++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig index 735e1536cbfc..2f4dd6e4aac1 100644 --- a/arch/powerpc/platforms/pasemi/Kconfig +++ b/arch/powerpc/platforms/pasemi/Kconfig @@ -17,7 +17,7 @@ config PPC_PASEMI_IOMMU bool "PA Semi IOMMU support" depends on PPC_PASEMI help - IOMMU support for PA6T-1682M + IOMMU support for PA Semi PWRficient config PPC_PASEMI_IOMMU_DMA_FORCE bool "Force DMA engine to use IOMMU" diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 1cfb8b0c8fec..8caa1667cf34 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c @@ -147,7 +147,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) if (!cpu) goto out; - dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc"); + dn = of_find_compatible_node(NULL, NULL, "1682m-sdc"); + if (!dn) + dn = of_find_compatible_node(NULL, NULL, + "pasemi,pwrficient-sdc"); if (!dn) goto out; err = of_address_to_resource(dn, 0, &res); @@ -160,7 +163,10 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) goto out; } - dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo"); + dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo"); + if (!dn) + dn = of_find_compatible_node(NULL, NULL, + "pasemi,pwrficient-gizmo"); if (!dn) { err = -ENODEV; goto out_unmap_sdcasr; @@ -292,7 +298,8 @@ static struct cpufreq_driver pas_cpufreq_driver = { static int __init pas_cpufreq_init(void) { - if (!machine_is_compatible("PA6T-1682M")) + if (!machine_is_compatible("PA6T-1682M") && + !machine_is_compatible("pasemi,pwrficient")) return -ENODEV; return cpufreq_register_driver(&pas_cpufreq_driver); diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index 95d0c78cf634..b0298045df7e 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -333,7 +333,10 @@ int gpio_mdio_init(void) { struct device_node *np; - np = of_find_compatible_node(NULL, "gpio", "1682m-gpio"); + np = of_find_compatible_node(NULL, NULL, "1682m-gpio"); + if (!np) + np = of_find_compatible_node(NULL, NULL, + "pasemi,pwrficient-gpio"); if (!np) return -ENODEV; gpio_regs = of_iomap(np, 0); diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 3d62060498b4..bd85853bc9da 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -362,8 +362,12 @@ static inline void pasemi_pcmcia_init(void) static struct of_device_id pasemi_bus_ids[] = { + /* Unfortunately needed for legacy firmwares */ { .type = "localbus", }, { .type = "sdc", }, + /* These are the proper entries, which newer firmware uses */ + { .compatible = "pasemi,localbus", }, + { .compatible = "pasemi,sdc", }, {}, }; @@ -389,7 +393,8 @@ static int __init pas_probe(void) { unsigned long root = of_get_flat_dt_root(); - if (!of_flat_dt_is_compatible(root, "PA6T-1682M")) + if (!of_flat_dt_is_compatible(root, "PA6T-1682M") && + !of_flat_dt_is_compatible(root, "pasemi,pwrficient")) return 0; hpte_init_native(); @@ -400,7 +405,7 @@ static int __init pas_probe(void) } define_machine(pasemi) { - .name = "PA Semi PA6T-1682M", + .name = "PA Semi PWRficient", .probe = pas_probe, .setup_arch = pas_setup_arch, .init_early = pas_init_early, -- cgit v1.2.3 From 8b32bc03256c82a6a4fcb3c2520b54469b74ec82 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Wed, 7 Nov 2007 09:26:06 -0600 Subject: [POWERPC] pasemi: Don't enter powersaving states from elevated astates When the PWRficient cpus are entered into powersavings states, the astate is automatically dropped down to 0. While we still restore it when we come out of idle, it can still cause some weird effects with respect to performance (especially since it takes a while to ramp up to higher astates). So, to avoid this, don't enter power savings when the cpufreq driver (or user) has set higher astates than 0. The restore is still required, since there's a chance the astate has been raised from the other cpu while the idling one was asleep. Signed-off-by: Olof Johansson --- arch/powerpc/platforms/pasemi/cpufreq.c | 6 ++++++ arch/powerpc/platforms/pasemi/pasemi.h | 6 ++++++ arch/powerpc/platforms/pasemi/powersave.S | 11 ++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 8caa1667cf34..58556b028a4c 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c @@ -32,6 +32,7 @@ #include #include #include +#include #define SDCASR_REG 0x0100 #define SDCASR_REG_STRIDE 0x1000 @@ -124,6 +125,11 @@ static void set_astate(int cpu, unsigned int astate) local_irq_restore(flags); } +int check_astate(void) +{ + return get_cur_astate(hard_smp_processor_id()); +} + void restore_astate(int cpu) { set_astate(cpu, current_astate); diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h index 516acabb4e96..c96127b029b6 100644 --- a/arch/powerpc/platforms/pasemi/pasemi.h +++ b/arch/powerpc/platforms/pasemi/pasemi.h @@ -16,8 +16,14 @@ extern void idle_doze(void); /* Restore astate to last set */ #ifdef CONFIG_PPC_PASEMI_CPUFREQ +extern int check_astate(void); extern void restore_astate(int cpu); #else +static inline int check_astate(void) +{ + /* Always return >0 so we never power save */ + return 1; +} static inline void restore_astate(int cpu) { } diff --git a/arch/powerpc/platforms/pasemi/powersave.S b/arch/powerpc/platforms/pasemi/powersave.S index 6d0fba6aab17..56f45adcd089 100644 --- a/arch/powerpc/platforms/pasemi/powersave.S +++ b/arch/powerpc/platforms/pasemi/powersave.S @@ -62,7 +62,16 @@ sleep_common: mflr r0 std r0, 16(r1) stdu r1,-64(r1) +#ifdef CONFIG_PPC_PASEMI_CPUFREQ + std r3, 48(r1) + /* Only do power savings when in astate 0 */ + bl .check_astate + cmpwi r3,0 + bne 1f + + ld r3, 48(r1) +#endif LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE) mfmsr r4 andc r5,r4,r6 @@ -73,7 +82,7 @@ sleep_common: mtmsrd r4,0 - addi r1,r1,64 +1: addi r1,r1,64 ld r0,16(r1) mtlr r0 blr -- cgit v1.2.3 From 32e2b55eec7116a859b384dbcc4b52a54a156869 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Wed, 7 Nov 2007 09:31:06 -0600 Subject: [POWERPC] pasemi: Move cpus to hold loop before restart Use smp_send_stop() to move all cpus besides the one executing reboot into a hold loop, to keep them from being in powersavings mode at the time of reboot. Signed-off-by: Olof Johansson --- arch/powerpc/platforms/pasemi/setup.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index bd85853bc9da..2b638659d1ea 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -43,6 +43,10 @@ #include "pasemi.h" +#if !defined(CONFIG_SMP) +static void smp_send_stop(void) {} +#endif + /* SDC reset register, must be pre-mapped at reset time */ static void __iomem *reset_reg; @@ -60,6 +64,9 @@ static int num_mce_regs; static void pas_restart(char *cmd) { + /* Need to put others cpu in hold loop so they're not sleeping */ + smp_send_stop(); + udelay(10000); printk("Restarting...\n"); while (1) out_le32(reset_reg, 0x6000000); -- cgit v1.2.3 From 8d089085a4e6d8a91c954130cb4caebd50788a08 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Thu, 25 Oct 2007 15:27:44 +1000 Subject: [POWERPC] Cleanup SMT thread handling This cleans up the SMT thread handling, removing some hard coded assumptions and providing a set of helpers to convert between linux cpu numbers, thread numbers and cores. This implementation requires the number of threads per core to be a power of 2 and identical on all cores in the system, but it's an implementation detail, not an API requirement and so this limitation can be lifted in the future if anybody ever needs it. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/setup-common.c | 78 ++++++++++++++++++++++++++++++------ arch/powerpc/platforms/cell/smp.c | 3 +- arch/powerpc/platforms/pseries/smp.c | 3 +- 3 files changed, 69 insertions(+), 15 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2de00f870edc..6adb5a1e98bb 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,7 @@ #include #include #include +#include #include "setup.h" @@ -327,6 +329,31 @@ void __init check_for_initrd(void) #ifdef CONFIG_SMP +int threads_per_core, threads_shift; +cpumask_t threads_core_mask; + +static void __init cpu_init_thread_core_maps(int tpc) +{ + int i; + + threads_per_core = tpc; + threads_core_mask = CPU_MASK_NONE; + + /* This implementation only supports power of 2 number of threads + * for simplicity and performance + */ + threads_shift = ilog2(tpc); + BUG_ON(tpc != (1 << threads_shift)); + + for (i = 0; i < tpc; i++) + cpu_set(i, threads_core_mask); + + printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n", + tpc, tpc > 1 ? "s" : ""); + printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift); +} + + /** * setup_cpu_maps - initialize the following cpu maps: * cpu_possible_map @@ -350,22 +377,32 @@ void __init smp_setup_cpu_maps(void) { struct device_node *dn = NULL; int cpu = 0; + int nthreads = 1; + + DBG("smp_setup_cpu_maps()\n"); while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) { const int *intserv; - int j, len = sizeof(u32), nthreads = 1; + int j, len; + + DBG(" * %s...\n", dn->full_name); intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); - if (intserv) + if (intserv) { nthreads = len / sizeof(int); - else { + DBG(" ibm,ppc-interrupt-server#s -> %d threads\n", + nthreads); + } else { + DBG(" no ibm,ppc-interrupt-server#s -> 1 thread\n"); intserv = of_get_property(dn, "reg", NULL); if (!intserv) intserv = &cpu; /* assume logical == phys */ } for (j = 0; j < nthreads && cpu < NR_CPUS; j++) { + DBG(" thread %d -> cpu %d (hard id %d)\n", + j, cpu, intserv[j]); cpu_set(cpu, cpu_present_map); set_hard_smp_processor_id(cpu, intserv[j]); cpu_set(cpu, cpu_possible_map); @@ -373,6 +410,12 @@ void __init smp_setup_cpu_maps(void) } } + /* If no SMT supported, nthreads is forced to 1 */ + if (!cpu_has_feature(CPU_FTR_SMT)) { + DBG(" SMT disabled ! nthreads forced to 1\n"); + nthreads = 1; + } + #ifdef CONFIG_PPC64 /* * On pSeries LPAR, we need to know how many cpus @@ -395,7 +438,7 @@ void __init smp_setup_cpu_maps(void) /* Double maxcpus for processors which have SMT capability */ if (cpu_has_feature(CPU_FTR_SMT)) - maxcpus *= 2; + maxcpus *= nthreads; if (maxcpus > NR_CPUS) { printk(KERN_WARNING @@ -412,9 +455,16 @@ void __init smp_setup_cpu_maps(void) out: of_node_put(dn); } - vdso_data->processorCount = num_present_cpus(); #endif /* CONFIG_PPC64 */ + + /* Initialize CPU <=> thread mapping/ + * + * WARNING: We assume that the number of threads is the same for + * every CPU in the system. If that is not the case, then some code + * here will have to be reworked + */ + cpu_init_thread_core_maps(nthreads); } /* @@ -424,17 +474,19 @@ void __init smp_setup_cpu_maps(void) */ void __init smp_setup_cpu_sibling_map(void) { -#if defined(CONFIG_PPC64) - int cpu; +#ifdef CONFIG_PPC64 + int i, cpu, base; - /* - * Do the sibling map; assume only two threads per processor. - */ for_each_possible_cpu(cpu) { - cpu_set(cpu, per_cpu(cpu_sibling_map, cpu)); - if (cpu_has_feature(CPU_FTR_SMT)) - cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu)); + DBG("Sibling map for CPU %d:", cpu); + base = cpu_first_thread_in_core(cpu); + for (i = 0; i < threads_per_core; i++) { + cpu_set(base + i, per_cpu(cpu_sibling_map, cpu)); + DBG(" %d", base + i); + } + DBG("\n"); } + #endif /* CONFIG_PPC64 */ } #endif /* CONFIG_SMP */ diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index e4438456c867..efb3964457b1 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "interrupt.h" #include @@ -182,7 +183,7 @@ static int smp_cell_cpu_bootable(unsigned int nr) */ if (system_state < SYSTEM_RUNNING && cpu_has_feature(CPU_FTR_SMT) && - !smt_enabled_at_boot && nr % 2 != 0) + !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) return 0; return 1; diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 116305b22a2b..ea4c65917a64 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c @@ -46,6 +46,7 @@ #include #include #include +#include #include "plpar_wrappers.h" #include "pseries.h" @@ -202,7 +203,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr) */ if (system_state < SYSTEM_RUNNING && cpu_has_feature(CPU_FTR_SMT) && - !smt_enabled_at_boot && nr % 2 != 0) + !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0) return 0; return 1; -- cgit v1.2.3 From d65dded426e1315f5fbe3e1bc2ffe2140c69ceec Mon Sep 17 00:00:00 2001 From: Nathan Lynch Date: Tue, 13 Nov 2007 09:51:16 +1100 Subject: [POWERPC] Remove prod_processor() prod_processor() is unused, and that's a good thing, since it does not supply the required proc id parameter to H_PROD. Signed-off-by: Nathan Lynch Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/plpar_wrappers.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index d003c80fa31d..d8680b589dc9 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h @@ -8,11 +8,6 @@ static inline long poll_pending(void) return plpar_hcall_norets(H_POLL_PENDING); } -static inline long prod_processor(void) -{ - return plpar_hcall_norets(H_PROD); -} - static inline long cede_processor(void) { return plpar_hcall_norets(H_CEDE); -- cgit v1.2.3 From 6215762064311efea0618c9496cc6360cd75243d Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 14 Nov 2007 05:17:20 +1100 Subject: [POWERPC] powermac: Fix warning in time.c arch/powerpc/platforms/powermac/time.c:88: warning: 'to_rtc_time' defined but not used This fixes the warning by making the relevant code depend on the users. Signed-off-by: Johannes Berg Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/powermac/time.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index bf9da56942e8..bbbefd64ab59 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c @@ -84,12 +84,14 @@ long __init pmac_time_init(void) return delta; } +#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU) static void to_rtc_time(unsigned long now, struct rtc_time *tm) { to_tm(now, tm); tm->tm_year -= 1900; tm->tm_mon -= 1; } +#endif static unsigned long from_rtc_time(struct rtc_time *tm) { -- cgit v1.2.3 From 307d46e83291ef58b2c3b6d33b7ec6dd163d58b9 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Fri, 16 Nov 2007 05:56:23 +1100 Subject: [POWERPC] EEH: Work with device endpoint, always Perform all error checking at the "partitonable endpoint" of the device. Signed-off-by: Linas Vepstas Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/eeh.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index fb3d636e088b..42a30b6628a9 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c @@ -480,6 +480,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) no_dn++; return 0; } + dn = find_device_pe(dn); pdn = PCI_DN(dn); /* Access to IO BARs might get this far and still not want checking. */ -- cgit v1.2.3 From c9b65a7da694bd774398283b9bd860f7e3234432 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Fri, 16 Nov 2007 05:57:27 +1100 Subject: [POWERPC] EEH: Be careful when identifying "empty" slots. If an "empty" slot is failing, make sure its a permanent failure; else process the error normally. Signed-off-by: Linas Vepstas Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/eeh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 42a30b6628a9..aa14a8559edb 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c @@ -546,7 +546,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) /* Note that config-io to empty slots may fail; * they are empty when they don't have children. */ - if ((rets[0] == 5) && (dn->child == NULL)) { + if ((rets[0] == 5) && (rets[2] == 0) && (dn->child == NULL)) { false_positives++; pdn->eeh_false_positives ++; rc = 0; -- cgit v1.2.3 From 5f1a7c811bb1aa5259afb8967c704f1306eaacb3 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Fri, 16 Nov 2007 05:58:36 +1100 Subject: [POWERPC] EEH: Report errors as soon as possible Do not wait for the pci slot status before reporting an error to the device driver. Some systems may take many seconds to report the slot status, and this can confuse unsuspecting device drivers. Signed-off-by: Linas Vepstas Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/pseries/eeh_driver.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index 57e025e84ab4..06b89b56d0e9 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c @@ -354,13 +354,6 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) goto excess_failures; - /* Get the current PCI slot state. */ - rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000); - if (rc < 0) { - printk(KERN_WARNING "EEH: Permanent failure\n"); - goto hard_fail; - } - printk(KERN_WARNING "EEH: This PCI device has failed %d times in the last hour:\n", frozen_pdn->eeh_freeze_count); @@ -376,6 +369,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) */ pci_walk_bus(frozen_bus, eeh_report_error, &result); + /* Get the current PCI slot state. This can take a long time, + * sometimes over 3 seconds for certain systems. */ + rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000); + if (rc < 0) { + printk(KERN_WARNING "EEH: Permanent failure\n"); + goto hard_fail; + } + /* Since rtas may enable MMIO when posting the error log, * don't post the error log until after all dev drivers * have been informed. -- cgit v1.2.3 From 5a8a1a28bb35a62561367c0a1144dbc5dcb95230 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 16 Nov 2007 18:23:33 +1100 Subject: [POWERPC] Add xmon function to dump 44x TLB This adds a function to xmon to dump the content of the 44x processor TLB with a little bit of decoding (but not much). Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/powerpc/xmon/xmon.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 121b04d165d1..381d467cf55b 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -153,6 +153,10 @@ static const char *getvecname(unsigned long vec); static int do_spu_cmd(void); +#ifdef CONFIG_44x +static void dump_tlb_44x(void); +#endif + int xmon_no_auto_backtrace; extern void xmon_enter(void); @@ -231,6 +235,9 @@ Commands:\n\ #ifdef CONFIG_PPC_STD_MMU_32 " u dump segment registers\n" #endif +#ifdef CONFIG_44x +" u dump TLB\n" +#endif " ? help\n" " zr reboot\n\ zh halt\n" @@ -855,6 +862,11 @@ cmds(struct pt_regs *excp) case 'u': dump_segments(); break; +#endif +#ifdef CONFIG_4xx + case 'u': + dump_tlb_44x(); + break; #endif default: printf("Unrecognized command: "); @@ -2581,6 +2593,32 @@ void dump_segments(void) } #endif +#ifdef CONFIG_44x +static void dump_tlb_44x(void) +{ + int i; + + for (i = 0; i < PPC44x_TLB_SIZE; i++) { + unsigned long w0,w1,w2; + asm volatile("tlbre %0,%1,0" : "=r" (w0) : "r" (i)); + asm volatile("tlbre %0,%1,1" : "=r" (w1) : "r" (i)); + asm volatile("tlbre %0,%1,2" : "=r" (w2) : "r" (i)); + printf("[%02x] %08x %08x %08x ", i, w0, w1, w2); + if (w0 & PPC44x_TLB_VALID) { + printf("V %08x -> %01x%08x %c%c%c%c%c", + w0 & PPC44x_TLB_EPN_MASK, + w1 & PPC44x_TLB_ERPN_MASK, + w1 & PPC44x_TLB_RPN_MASK, + (w2 & PPC44x_TLB_W) ? 'W' : 'w', + (w2 & PPC44x_TLB_I) ? 'I' : 'i', + (w2 & PPC44x_TLB_M) ? 'M' : 'm', + (w2 & PPC44x_TLB_G) ? 'G' : 'g', + (w2 & PPC44x_TLB_E) ? 'E' : 'e'); + } + printf("\n"); + } +} +#endif /* CONFIG_44x */ void xmon_init(int enable) { #ifdef CONFIG_PPC_ISERIES -- cgit v1.2.3 From ebfc00f78c13d0643c858ccc61c5bb8be0a5dbf0 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 19 Nov 2007 16:56:15 +1100 Subject: [POWERPC] Make global_phb_number static since it's not used outside of arch/powerpc/kernel/pci-common.c. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/pci-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 2ae3b6f778a3..742ff7295de6 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(hose_spinlock); /* XXX kill that some day ... */ -int global_phb_number; /* Global phb counter */ +static int global_phb_number; /* Global phb counter */ extern struct list_head hose_list; -- cgit v1.2.3 From 1e10590475b4a6d848e20c19fb22b074075c9ef3 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 19 Nov 2007 17:03:59 +1100 Subject: [POWERPC] iSeries: Mark two functions __init Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/iseries/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index da87162000f0..a74d1e1966dd 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c @@ -87,7 +87,7 @@ static DEFINE_SPINLOCK(iomm_table_lock); * - CurrentIndex is incremented to keep track of the last entry. * - Builds the resource entry for allocated BARs. */ -static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) +static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) { struct resource *bar_res = &dev->resource[bar_num]; long bar_size = pci_resource_len(dev, bar_num); @@ -130,7 +130,7 @@ static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) * - Loops through The Bar resources(0 - 5) including the ROM * is resource(6). */ -static void allocate_device_bars(struct pci_dev *dev) +static void __init allocate_device_bars(struct pci_dev *dev) { int bar_num; -- cgit v1.2.3 From 26b6d5b170815ab0586ff983b4ce7c8cc19e1e81 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 19 Nov 2007 17:06:56 +1100 Subject: [POWERPC] iSeries: Declare iSeries_pci_final_fixup in pci.h Fixes sparse warning: arch/powerpc/platforms/iseries/pci.c:169:13: warning: symbol 'iSeries_pci_final_fixup' was not declared. Should it be static? Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/iseries/pci.h | 5 +++++ arch/powerpc/platforms/iseries/setup.c | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/iseries/pci.h b/arch/powerpc/platforms/iseries/pci.h index 33a8489fde54..730986bc917a 100644 --- a/arch/powerpc/platforms/iseries/pci.h +++ b/arch/powerpc/platforms/iseries/pci.h @@ -59,5 +59,10 @@ static inline u64 iseries_ds_addr(struct device_node *node) } extern void iSeries_Device_Information(struct pci_dev*, int); +#ifdef CONFIG_PCI +extern void iSeries_pci_final_fixup(void); +#else +static void iSeries_pci_final_fixup(void) { } +#endif #endif /* _PLATFORMS_ISERIES_PCI_H */ diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 0877a8834110..8a652da2afc3 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c @@ -63,6 +63,7 @@ #include "main_store.h" #include "call_sm.h" #include "call_hpt.h" +#include "pci.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -74,11 +75,6 @@ static unsigned long build_iSeries_Memory_Map(void); static void iseries_shared_idle(void); static void iseries_dedicated_idle(void); -#ifdef CONFIG_PCI -extern void iSeries_pci_final_fixup(void); -#else -static void iSeries_pci_final_fixup(void) { } -#endif struct MemoryBlock { -- cgit v1.2.3 From 5db9abd9361c491411448edbf2ef1696caef9fee Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 19 Nov 2007 17:10:57 +1100 Subject: [POWERPC] iSeries: Fix sparse warnings in setup.c arch/powerpc/platforms/iseries/setup.c:111:27: warning: constant 0x100000000 is so big it is long arch/powerpc/platforms/iseries/setup.c:113:23: warning: constant 0x100000000 is so big it is long arch/powerpc/platforms/iseries/setup.c:117:27: warning: constant 0x000fffffffffffff is so big it is long arch/powerpc/platforms/iseries/setup.c:127:28: warning: constant 0x100000000 is so big it is long arch/powerpc/platforms/iseries/setup.c:129:24: warning: constant 0x100000000 is so big it is long arch/powerpc/platforms/iseries/setup.c:233:5: warning: constant 0x000fffffffffffff is so big it is long arch/powerpc/platforms/iseries/setup.c:235:5: warning: constant 0x000fffffffffffff is so big it is long arch/powerpc/platforms/iseries/setup.c:319:6: warning: symbol 'mschunks_alloc' was not declared. Should it be static? arch/powerpc/platforms/iseries/setup.c:661:6: warning: symbol 'iSeries_early_setup' was not declared. Should it be static? Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/iseries/setup.c | 16 ++++++++-------- arch/powerpc/platforms/iseries/setup.h | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 8a652da2afc3..2175a71800d5 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c @@ -108,13 +108,13 @@ static unsigned long iSeries_process_Condor_mainstore_vpd( * correctly. */ mb_array[0].logicalStart = 0; - mb_array[0].logicalEnd = 0x100000000; + mb_array[0].logicalEnd = 0x100000000UL; mb_array[0].absStart = 0; - mb_array[0].absEnd = 0x100000000; + mb_array[0].absEnd = 0x100000000UL; if (holeSize) { numMemoryBlocks = 2; - holeStart = holeStart & 0x000fffffffffffff; + holeStart = holeStart & 0x000fffffffffffffUL; holeStart = addr_to_chunk(holeStart); holeFirstChunk = holeStart; holeSize = addr_to_chunk(holeSize); @@ -124,9 +124,9 @@ static unsigned long iSeries_process_Condor_mainstore_vpd( mb_array[0].logicalEnd = holeFirstChunk; mb_array[0].absEnd = holeFirstChunk; mb_array[1].logicalStart = holeFirstChunk; - mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks; + mb_array[1].logicalEnd = 0x100000000UL - holeSizeChunks; mb_array[1].absStart = holeFirstChunk + holeSizeChunks; - mb_array[1].absEnd = 0x100000000; + mb_array[1].absEnd = 0x100000000UL; } return numMemoryBlocks; } @@ -230,9 +230,9 @@ static unsigned long iSeries_process_Regatta_mainstore_vpd( mb_array[i].logicalEnd, mb_array[i].absStart, mb_array[i].absEnd); mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart & - 0x000fffffffffffff); + 0x000fffffffffffffUL); mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd & - 0x000fffffffffffff); + 0x000fffffffffffffUL); mb_array[i].logicalStart = addr_to_chunk(mb_array[i].logicalStart); mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd); @@ -316,7 +316,7 @@ struct mschunks_map mschunks_map = { }; EXPORT_SYMBOL(mschunks_map); -void mschunks_alloc(unsigned long num_chunks) +static void mschunks_alloc(unsigned long num_chunks) { klimit = _ALIGN(klimit, sizeof(u32)); mschunks_map.mapping = (u32 *)klimit; diff --git a/arch/powerpc/platforms/iseries/setup.h b/arch/powerpc/platforms/iseries/setup.h index 0a47ac53c959..729754bbb018 100644 --- a/arch/powerpc/platforms/iseries/setup.h +++ b/arch/powerpc/platforms/iseries/setup.h @@ -17,6 +17,7 @@ #ifndef __ISERIES_SETUP_H__ #define __ISERIES_SETUP_H__ +extern void *iSeries_early_setup(void); extern unsigned long iSeries_get_boot_time(void); extern int iSeries_set_rtc_time(struct rtc_time *tm); extern void iSeries_get_rtc_time(struct rtc_time *tm); -- cgit v1.2.3 From 215a5575b56b1cc87773442beba09fbfff689464 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 19 Nov 2007 17:17:07 +1100 Subject: [POWERPC] Remove redundant declaration of hose_list It is already declared in ppc-pci.h which is included. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/pci-common.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 742ff7295de6..15ec71a84f78 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -50,8 +50,6 @@ static DEFINE_SPINLOCK(hose_spinlock); /* XXX kill that some day ... */ static int global_phb_number; /* Global phb counter */ -extern struct list_head hose_list; - /* * pci_controller(phb) initialized common variables. */ -- cgit v1.2.3 From df3c9019ed20dbd46b945adeec09c0e82034252a Mon Sep 17 00:00:00 2001 From: "joe@perches.com" Date: Tue, 20 Nov 2007 12:47:55 +1100 Subject: [POWERPC] Add missing spaces in printk formats Signed-off-by: Joe Perches Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/isa-bridge.c | 4 ++-- arch/powerpc/mm/fault.c | 2 +- arch/powerpc/platforms/8xx/m8xx_setup.c | 2 +- arch/powerpc/platforms/celleb/io-workarounds.c | 2 +- arch/powerpc/platforms/celleb/scc_epci.c | 2 +- arch/powerpc/sysdev/fsl_pci.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/isa-bridge.c b/arch/powerpc/kernel/isa-bridge.c index f0f49d1be3d5..965bfcc9ad2d 100644 --- a/arch/powerpc/kernel/isa-bridge.c +++ b/arch/powerpc/kernel/isa-bridge.c @@ -108,7 +108,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, if (size > 0x10000) size = 0x10000; - printk(KERN_ERR "no ISA IO ranges or unexpected isa range," + printk(KERN_ERR "no ISA IO ranges or unexpected isa range, " "mapping 64k\n"); __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE, @@ -116,7 +116,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node, return; inval_range: - printk(KERN_ERR "no ISA IO ranges or unexpected isa range," + printk(KERN_ERR "no ISA IO ranges or unexpected isa range, " "mapping 64k\n"); __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE, 0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED); diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 8135da06e0a4..10dda224a361 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -189,7 +189,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address, return SIGSEGV; /* in_atomic() in user mode is really bad, as is current->mm == NULL. */ - printk(KERN_EMERG "Page fault in user mode with" + printk(KERN_EMERG "Page fault in user mode with " "in_atomic() = %d mm = %p\n", in_atomic(), mm); printk(KERN_EMERG "NIP = %lx MSR = %lx\n", regs->nip, regs->msr); diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index d35eda80e9e6..ba645c2b63f6 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -120,7 +120,7 @@ void __init mpc8xx_calibrate_decr(void) ppc_tb_freq /= 16; ppc_proc_freq = 50000000; if (!get_freq("clock-frequency", &ppc_proc_freq)) - printk(KERN_ERR "WARNING: Estimating processor frequency" + printk(KERN_ERR "WARNING: Estimating processor frequency " "(not found)\n"); printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); diff --git a/arch/powerpc/platforms/celleb/io-workarounds.c b/arch/powerpc/platforms/celleb/io-workarounds.c index 2b912140bcbb..32b9cecfda15 100644 --- a/arch/powerpc/platforms/celleb/io-workarounds.c +++ b/arch/powerpc/platforms/celleb/io-workarounds.c @@ -256,7 +256,7 @@ int __init celleb_pci_workaround_init(void) celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!celleb_dummy_page_va) { - printk(KERN_ERR "Celleb: dummy read disabled." + printk(KERN_ERR "Celleb: dummy read disabled. " "Alloc celleb_dummy_page_va failed\n"); return 1; } diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c index 9d076426676c..a3c7cfbcb323 100644 --- a/arch/powerpc/platforms/celleb/scc_epci.c +++ b/arch/powerpc/platforms/celleb/scc_epci.c @@ -95,7 +95,7 @@ void __init epci_workaround_init(struct pci_controller *hose) private->dummy_page_da = dma_map_single(hose->parent, celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE); if (private->dummy_page_da == DMA_ERROR_CODE) { - printk(KERN_ERR "EPCI: dummy read disabled." + printk(KERN_ERR "EPCI: dummy read disabled. " "Map dummy page failed.\n"); return; } diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 33df4c347ca7..87e58e09b500 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -222,7 +222,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary) hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK; } - printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx." + printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. " "Firmware bus number: %d->%d\n", (unsigned long long)rsrc.start, hose->first_busno, hose->last_busno); -- cgit v1.2.3 From 44032af0e7d5467b12f998dbf2f1cd23c5324fd5 Mon Sep 17 00:00:00 2001 From: "joe@perches.com" Date: Tue, 20 Nov 2007 12:47:56 +1100 Subject: [POWERPC] Add missing spaces in printk formats in arch/ppc Signed-off-by: Joe Perches Signed-off-by: Paul Mackerras --- arch/ppc/platforms/ev64260.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/ppc/platforms/ev64260.c b/arch/ppc/platforms/ev64260.c index 976270d537c1..c1f77e1d368e 100644 --- a/arch/ppc/platforms/ev64260.c +++ b/arch/ppc/platforms/ev64260.c @@ -336,7 +336,7 @@ ev64260_early_serial_map(void) #endif if (early_serial_setup(&port) != 0) - printk(KERN_WARNING "Early serial init of port 0" + printk(KERN_WARNING "Early serial init of port 0 " "failed\n"); first_time = 0; @@ -388,7 +388,7 @@ ev64260_setup_arch(void) ev64260_early_serial_map(); #endif - printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc." + printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. " "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE); if (ppc_md.progress) -- cgit v1.2.3 From 5619965fecf5679ea32350905c54d087b27cc8ea Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sun, 2 Dec 2007 22:35:25 -0600 Subject: [POWERPC] pasemi: Fix module information for gpio-mdio Fix up the module information for gpio-mdio, it wouldn't load because of lacking license, and wouldn't auto-load because of missing MODULE_DEVICE_TABLE. Signed-off-by: Olof Johansson --- arch/powerpc/platforms/pasemi/gpio_mdio.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index b0298045df7e..04a8686e6084 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -318,6 +318,7 @@ static struct of_device_id gpio_mdio_match[] = }, {}, }; +MODULE_DEVICE_TABLE(of, gpio_mdio_match); static struct of_platform_driver gpio_mdio_driver = { @@ -356,3 +357,7 @@ void gpio_mdio_exit(void) iounmap(gpio_regs); } module_exit(gpio_mdio_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Olof Johansson "); +MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards"); -- cgit v1.2.3 From 5f867dc7989023935317d0dc5c04215ea0592bfc Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Wed, 14 Nov 2007 04:13:03 +1100 Subject: [POWERPC] Clean out asm/of_{platform, device}.h Convert #include of asm/of_{platform, device}.h into linux/of_{platform,device}.h for a few scattered platforms. Signed-off-by: Jon Loeliger Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/embedded6xx/holly.c | 2 +- arch/powerpc/platforms/pasemi/gpio_mdio.c | 2 +- arch/powerpc/platforms/pasemi/setup.c | 2 +- arch/powerpc/platforms/powermac/setup.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c index b6de2b5223dd..ce91787f3c7c 100644 --- a/arch/powerpc/platforms/embedded6xx/holly.c +++ b/arch/powerpc/platforms/embedded6xx/holly.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #undef DEBUG diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index 04a8686e6084..b46542990cf8 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #define DELAY 1 diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 2b638659d1ea..5748194a667f 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 02c533096627..3acb59d5cdf5 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include #include @@ -68,8 +70,6 @@ #include #include #include -#include -#include #include #include #include -- cgit v1.2.3 From eb8f2763412893147c00e065773f46be5634f263 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Wed, 14 Nov 2007 04:13:09 +1100 Subject: [POWERPC] Clean out asm/of_{platform, device}.h from sysdev/ Convert #include of asm/of_{platform, device}.h into linux/of_{platform,device}.h for remaining arch/powerpc files. Signed-off-by: Jon Loeliger Signed-off-by: Paul Mackerras --- arch/powerpc/sysdev/axonram.c | 5 +++-- arch/powerpc/sysdev/pmi.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index 5eaf3e3f4b8b..d359d6e92975 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c @@ -42,8 +42,9 @@ #include #include #include -#include -#include +#include +#include + #include #include diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c index 20edd1e94eff..c858749263e0 100644 --- a/arch/powerpc/sysdev/pmi.c +++ b/arch/powerpc/sysdev/pmi.c @@ -28,9 +28,9 @@ #include #include #include +#include +#include -#include -#include #include #include #include -- cgit v1.2.3 From 3a1c81f4faa8f93a36533fa8900a2f488528aab9 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 29 Nov 2007 18:44:18 +1100 Subject: [POWERPC] CELLEB: Fix possible NULL pointer dereference This adds checking for NULL returned value from of_get_property to prevent possible NULL pointer dereference in the case when expected properties are not present. Signed-off-by: Cyrill Gorcunov Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/celleb/pci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c index 6bc32fda7a6b..13ec4a606b96 100644 --- a/arch/powerpc/platforms/celleb/pci.c +++ b/arch/powerpc/platforms/celleb/pci.c @@ -138,8 +138,6 @@ static void celleb_config_read_fake(unsigned char *config, int where, *val = celleb_fake_config_readl(p); break; } - - return; } static void celleb_config_write_fake(unsigned char *config, int where, @@ -158,7 +156,6 @@ static void celleb_config_write_fake(unsigned char *config, int where, celleb_fake_config_writel(val, p); break; } - return; } static int celleb_fake_pci_read_config(struct pci_bus *bus, @@ -351,6 +348,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, wi1 = of_get_property(node, "vendor-id", NULL); wi2 = of_get_property(node, "class-code", NULL); wi3 = of_get_property(node, "revision-id", NULL); + if (!wi0 || !wi1 || !wi2 || !wi3) { + printk(KERN_ERR "PCI: Missing device tree properties.\n"); + goto error; + } celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff); celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff); @@ -372,6 +373,10 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node, celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr); li = of_get_property(node, "interrupts", &rlen); + if (!li) { + printk(KERN_ERR "PCI: interrupts not found.\n"); + goto error; + } val = li[0]; celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1); celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val); -- cgit v1.2.3 From 928b9695592921957289d038ee75f613d9485a0a Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 3 Dec 2007 13:48:03 +1100 Subject: [POWERPC] Create otheros.bld next to specified output file, not in $object directory The bootwrapper script currently generates an 'otheros.bld' file in addition to the file specified by the -o option, when asked to build a wrapper for PS3. It should do that in the same directory as the output, not the directory where the wrapper objects are kept (which might potentially not be writable when the script runs). Arguably, the 'otheros.bld' ought to be created with the filename specified as the -o argument. But that's a more intrusive change. Signed-off-by: David Woodhouse Acked-by: Geoff Levand Signed-off-by: Paul Mackerras --- arch/powerpc/boot/wrapper | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 31147a037728..221b8c87f57e 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -287,8 +287,6 @@ ps3) overlay_dest="256" overlay_size="256" - rm -f "$object/otheros.bld" - ${CROSS}objcopy -O binary "$ofile" "$ofile.bin" dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ @@ -299,6 +297,8 @@ ps3) skip=$system_reset_overlay seek=$overlay_dest \ count=$overlay_size bs=1 - gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld" + odir="$(dirname "$ofile.bin")" + rm -f "$odir/otheros.bld" + gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld" ;; esac -- cgit v1.2.3 From 701172d1b8a90d87532e49b946966ff37f948cc2 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 3 Dec 2007 13:49:24 +1100 Subject: [POWERPC] Find device-tree source file in default directory If a .dts file is given to the bootwrapper script without a full path name, look in a sensible place for it. Signed-off-by: David Woodhouse Signed-off-by: Paul Mackerras --- arch/powerpc/boot/wrapper | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 221b8c87f57e..b8e4856af759 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -116,6 +116,9 @@ while [ "$#" -gt 0 ]; do done if [ -n "$dts" ]; then + if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then + dts="$object/dts/$dts" + fi if [ -z "$dtb" ]; then dtb="$platform.dtb" fi -- cgit v1.2.3 From 5c539ee38263c12121d777c2e7119807742e9368 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 3 Dec 2007 13:52:05 +1100 Subject: [POWERPC] Allow for bootwrapper utilities being in different directory to objects It's possible that the executables which are built as helpers for the bootwrapper stuff might end up in a different place to the intermediate object files. Handle that. Signed-off-by: David Woodhouse Signed-off-by: Paul Mackerras --- arch/powerpc/boot/wrapper | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index b8e4856af759..a591ced47875 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -45,6 +45,7 @@ CROSS= # directory for object and other files used by this script object=arch/powerpc/boot +objbin=$object # directory for working files tmpdir=. @@ -95,6 +96,7 @@ while [ "$#" -gt 0 ]; do shift [ "$#" -gt 0 ] || usage object="$1" + objbin="$1" ;; -W) shift @@ -249,11 +251,11 @@ fi # post-processing needed for some platforms case "$platform" in pseries|chrp) - $object/addnote "$ofile" + $objbin/addnote "$ofile" ;; coff) ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" - $object/hack-coff "$ofile" + $objbin/hack-coff "$ofile" ;; cuboot*) gzip -f -9 "$ofile" @@ -262,7 +264,7 @@ cuboot*) ;; treeboot*) mv "$ofile" "$ofile.elf" - $object/mktree "$ofile.elf" "$ofile" "$base" "$entry" + $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry" if [ -z "$cacheit" ]; then rm -f "$ofile.elf" fi -- cgit v1.2.3 From 773f76b1601d53dc8485675736b845cc3644921a Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 3 Dec 2007 13:56:58 +1100 Subject: [POWERPC] Implement 'make bootwrapper_install' This adds a 'bootwrapper_install' make target for the powerpc architecture, which installs the wrapper script, intermediate object files and device-tree sources for later use. This will then allow bootable zImages to be created other than in the context of a kernel build. Signed-off-by: David Woodhouse Signed-off-by: Paul Mackerras --- arch/powerpc/Makefile | 3 +++ arch/powerpc/boot/Makefile | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index bd87626c1f60..f70df9b64f8f 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -167,6 +167,9 @@ boot := arch/$(ARCH)/boot $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) +bootwrapper_install: + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) + define archhelp @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' @echo ' install - Install kernel using' diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 18e32719d0ed..e1c73e9afa59 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -243,3 +243,51 @@ clean-kernel := vmlinux.strip vmlinux.bin clean-kernel += $(addsuffix .gz,$(clean-kernel)) # If not absolute clean-files are relative to $(obj). clean-files += $(addprefix $(objtree)/, $(clean-kernel)) + +WRAPPER_OBJDIR := /usr/lib/kernel-wrapper +WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts +WRAPPER_BINDIR := /usr/sbin +INSTALL := install + +extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) +hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) +wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper +dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts)) + +all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed) + +quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) + cmd_mkdir = mkdir -p $@ + +quiet_cmd_install = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@) + cmd_install = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@ + +quiet_cmd_install_dts = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@) + cmd_install_dts = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@ + +quiet_cmd_install_exe = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@) + cmd_install_exe = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@ + +quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@) + cmd_install_wrapper = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\ + sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \ + -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \ + + +$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR): + $(call cmd,mkdir) + +$(extra-installed) : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR) + $(call cmd,install) + +$(hostprogs-installed) : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR) + $(call cmd,install_exe) + +$(dts-installed) : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR) + $(call cmd,install_dts) + +$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR) + $(call cmd,install_wrapper) + +$(obj)/bootwrapper_install: $(all-installed) + -- cgit v1.2.3 From 18cce5d321cf01413f416d7fe9fb00404cba04fd Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 17 Oct 2007 13:43:34 +1000 Subject: [POWERPC] Use of_register_driver to implement of_register_platform_driver Also use of_unregister_driver to implement of_unregister_platform_driver. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/of_platform.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index aeaa20268ce2..79c04d151ddb 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c @@ -64,26 +64,6 @@ static int __init of_bus_driver_init(void) postcore_initcall(of_bus_driver_init); -int of_register_platform_driver(struct of_platform_driver *drv) -{ - /* initialize common driver fields */ - if (!drv->driver.name) - drv->driver.name = drv->name; - if (!drv->driver.owner) - drv->driver.owner = drv->owner; - drv->driver.bus = &of_platform_bus_type; - - /* register with core */ - return driver_register(&drv->driver); -} -EXPORT_SYMBOL(of_register_platform_driver); - -void of_unregister_platform_driver(struct of_platform_driver *drv) -{ - driver_unregister(&drv->driver); -} -EXPORT_SYMBOL(of_unregister_platform_driver); - struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id, struct device *parent) -- cgit v1.2.3 From 94b146ceeee18b801ad65ea78ec02449398e8221 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 28 Nov 2007 11:13:02 +1100 Subject: [POWERPC] kernel_execve is identical in 32 and 64 bit so consolidate it into misc.S. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/misc.S | 8 ++++++++ arch/powerpc/kernel/misc_32.S | 7 ------- arch/powerpc/kernel/misc_64.S | 7 ------- 3 files changed, 8 insertions(+), 14 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S index 330c9dc7db86..74ce0c7a7b1e 100644 --- a/arch/powerpc/kernel/misc.S +++ b/arch/powerpc/kernel/misc.S @@ -14,6 +14,7 @@ * 2 of the License, or (at your option) any later version. */ #include +#include .text @@ -43,3 +44,10 @@ _GLOBAL(add_reloc_offset) add r3,r3,r5 mtlr r0 blr + +_GLOBAL(kernel_execve) + li r0,__NR_execve + sc + bnslr + neg r3,r3 + blr diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 8b642ab26d37..ea1137851a4a 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S @@ -793,13 +793,6 @@ _GLOBAL(kernel_thread) addi r1,r1,16 blr -_GLOBAL(kernel_execve) - li r0,__NR_execve - sc - bnslr - neg r3,r3 - blr - /* * This routine is just here to keep GCC happy - sigh... */ diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index bbb3ba54c51c..a3c491e88a72 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -518,13 +518,6 @@ _GLOBAL(giveup_altivec) #endif /* CONFIG_ALTIVEC */ -_GLOBAL(kernel_execve) - li r0,__NR_execve - sc - bnslr - neg r3,r3 - blr - /* kexec_wait(phys_cpu) * * wait for the flag to change, indicating this kernel is going away but -- cgit v1.2.3 From c7a3f93d00726b9c51b2517ddfa4767422e9e631 Mon Sep 17 00:00:00 2001 From: Ishizaki Kou Date: Tue, 4 Dec 2007 19:34:53 +1100 Subject: [POWERPC] cell: Fix undefined reference to mmio_nvram_init This fixes the following link error with CONFIG_PPC_CELL_NATIVE=y and CONFIG_PPC_CELL_BLADE=n: arch/powerpc/platforms/built-in.o: In function `.cell_setup_arch': setup.c:(.init.text+0xe80): undefined reference to `.mmio_nvram_init' Signed-off-by: Kou Ishizaki Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/cell/setup.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 98e7ef8e6fc6..6a56b6474f52 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c @@ -179,7 +179,9 @@ static void __init cell_setup_arch(void) conswitchp = &dummy_con; #endif +#ifdef CONFIG_MMIO_NVRAM mmio_nvram_init(); +#endif } static int __init cell_probe(void) -- cgit v1.2.3 From 9858ee8ac52117cb38d7ef79b4db3382ea465a2a Mon Sep 17 00:00:00 2001 From: Ishizaki Kou Date: Tue, 4 Dec 2007 19:38:24 +1100 Subject: [POWERPC] celleb: Add support for native CBE This adds support for native CBE on Celleb, that is, without the BEAT hypervisor. Many codes in platforms/cell/ are used in native CBE environment. Signed-off-by: Kou Ishizaki Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/cell/iommu.c | 4 +- arch/powerpc/platforms/celleb/Kconfig | 2 + arch/powerpc/platforms/celleb/iommu.c | 3 +- arch/powerpc/platforms/celleb/setup.c | 99 +++++++++++++++++++++++++++-------- 4 files changed, 85 insertions(+), 23 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index faabc3fdc130..b465494cc24c 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "interrupt.h" @@ -699,7 +700,8 @@ static int __init cell_iommu_