Changeset 27525


Ignore:
Timestamp:
2011-07-07T19:17:06+02:00 (7 years ago)
Author:
kaloz
Message:

[cns3xxx]: make smp code more similar to upstream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/cns3xxx/patches-3.0/049-cns3xxx_smp_support.patch

    r27328 r27525  
    1010--- /dev/null 
    1111+++ b/arch/arm/mach-cns3xxx/headsmp.S 
    12 @@ -0,0 +1,43 @@ 
     12@@ -0,0 +1,42 @@ 
    1313+/* 
    1414+ *  linux/arch/arm/mach-cns3xxx/headsmp.S 
    1515+ * 
     16+ *  Cloned from linux/arch/arm/plat-versatile/headsmp.S 
     17+ * 
    1618+ *  Copyright (c) 2003 ARM Limited 
    17 + *  Copyright 2011 Gateworks Corporation 
    18 + *                Chris Lang <clang@gateworks.com 
    19 + * 
    2019+ *  All Rights Reserved 
    2120+ * 
     
    3029+ 
    3130+/* 
    32 + * CNS3XXX specific entry point for secondary CPUs.  This 
    33 + * provides a "holding pen" into which all secondary cores are held 
    34 + * until we're ready for them to initialise. 
     31+ * CNS3XXX specific entry point for secondary CPUs.  This provides 
     32+ * a "holding pen" into which all secondary cores are held until we're 
     33+ * ready for them to initialise. 
    3534+ */ 
    3635+ENTRY(cns3xxx_secondary_startup) 
     
    5655--- /dev/null 
    5756+++ b/arch/arm/mach-cns3xxx/hotplug.c 
    58 @@ -0,0 +1,131 @@ 
    59 +/* 
    60 + *  linux/arch/arm/mach-cns3xxx/hotplug.c 
     57@@ -0,0 +1,130 @@ 
     58+/* linux arch/arm/mach-cns3xxx/hotplug.c 
     59+ * 
     60+ *  Cloned from linux/arch/arm/mach-realview/hotplug.c 
    6161+ * 
    6262+ *  Copyright (C) 2002 ARM Ltd. 
    63 + *  Copyright 2011 Gateworks Corporation 
    64 + *                Chris Lang <clang@gateworks.com> 
    65 + * 
    6663+ *  All Rights Reserved 
    6764+ * 
     
    6966+ * it under the terms of the GNU General Public License version 2 as 
    7067+ * published by the Free Software Foundation. 
    71 + */ 
     68+*/ 
     69+ 
    7270+#include <linux/kernel.h> 
    7371+#include <linux/errno.h> 
     
    8482+       flush_cache_all(); 
    8583+       asm volatile( 
    86 +               "mcr    p15, 0, %1, c7, c5, 0\n" 
     84+       "       mcr     p15, 0, %1, c7, c5, 0\n" 
    8785+       "       mcr     p15, 0, %1, c7, c10, 4\n" 
    8886+       /* 
     
    105103+ 
    106104+       asm volatile( 
    107 +               "mrc    p15, 0, %0, c1, c0, 0\n" 
     105+       "mrc    p15, 0, %0, c1, c0, 0\n" 
    108106+       "       orr     %0, %0, %1\n" 
    109107+       "       mcr     p15, 0, %0, c1, c0, 0\n" 
     
    190188--- /dev/null 
    191189+++ b/arch/arm/mach-cns3xxx/localtimer.c 
    192 @@ -0,0 +1,29 @@ 
    193 +/* 
    194 + *  linux/arch/arm/mach-cns3xxx/localtimer.c 
     190@@ -0,0 +1,26 @@ 
     191+/* linux/arch/arm/mach-cns3xxx/localtimer.c 
     192+ * 
     193+ * Cloned from linux/arch/arm/mach-realview/localtimer.c 
    195194+ * 
    196195+ *  Copyright (C) 2002 ARM Ltd. 
    197 + *  Copyright 2011 Gateworks Corporation 
    198 + *                Chris Lang <clang@gateworks.com> 
    199 + * 
    200196+ *  All Rights Reserved 
    201197+ * 
     
    203199+ * it under the terms of the GNU General Public License version 2 as 
    204200+ * published by the Free Software Foundation. 
    205 + */ 
    206 +#include <linux/init.h> 
    207 +#include <linux/smp.h> 
     201+*/ 
     202+ 
    208203+#include <linux/clockchips.h> 
    209204+ 
    210 +#include <asm/smp_twd.h> 
     205+#include <asm/irq.h> 
    211206+#include <asm/localtimer.h> 
    212 +#include <mach/irqs.h> 
    213207+ 
    214208+/* 
    215209+ * Setup the local clock events for a CPU. 
    216210+ */ 
    217 +void __cpuinit local_timer_setup(struct clock_event_device *evt) 
     211+int __cpuinit local_timer_setup(struct clock_event_device *evt) 
    218212+{ 
    219213+       evt->irq = IRQ_LOCALTIMER; 
    220214+       twd_timer_setup(evt); 
     215+       return 0; 
    221216+} 
    222217--- /dev/null 
    223218+++ b/arch/arm/mach-cns3xxx/platsmp.c 
    224 @@ -0,0 +1,168 @@ 
    225 +/* 
    226 + *  linux/arch/arm/mach-cns3xxx/platsmp.c 
     219@@ -0,0 +1,175 @@ 
     220+/* linux/arch/arm/mach-cns3xxx/platsmp.c 
     221+ * 
     222+ * Copyright 2011 Gateworks Corporation 
     223+ *                Chris Lang <clang@gateworks.com> 
     224+ * Cloned from linux/arch/arm/mach-vexpress/platsmp.c 
    227225+ * 
    228226+ *  Copyright (C) 2002 ARM Ltd. 
    229 + *  Copyright 2011 Gateworks Corporation 
    230 + *                Chris Lang <clang@gateworks.com> 
    231 + * 
    232227+ *  All Rights Reserved 
    233228+ * 
     
    235230+ * it under the terms of the GNU General Public License version 2 as 
    236231+ * published by the Free Software Foundation. 
    237 + */ 
     232+*/ 
     233+ 
    238234+#include <linux/init.h> 
    239235+#include <linux/errno.h> 
     
    245241+ 
    246242+#include <asm/cacheflush.h> 
     243+#include <asm/hardware/gic.h> 
    247244+#include <asm/smp_scu.h> 
    248245+#include <asm/unified.h> 
     246+ 
    249247+#include <mach/hardware.h> 
    250248+#include <mach/cns3xxx.h> 
    251249+ 
    252 +#include "core.h" 
    253 + 
    254250+extern void cns3xxx_secondary_startup(void); 
    255251+ 
     
    258254+ * boot "holding pen" 
    259255+ */ 
     256+ 
    260257+volatile int __cpuinitdata pen_release = -1; 
    261258+ 
     
    265262+ * or not.  This is necessary for the hotplug code to work reliably. 
    266263+ */ 
    267 +static void __cpuinit write_pen_release(int val) 
     264+static void write_pen_release(int val) 
    268265+{ 
    269266+       pen_release = val; 
     
    313310+ 
    314311+       /* 
    315 +        * This is really belt and braces; we hold unintended secondary 
    316 +        * CPUs in the holding pen until we're ready for them.  However, 
    317 +        * since we haven't sent them a soft interrupt, they shouldn't 
    318 +        * be there. 
     312+        * The secondary processor is waiting to be released from 
     313+        * the holding pen - release it, then wait for it to flag 
     314+        * that it has been released by resetting pen_release. 
     315+        * 
     316+        * Note that "pen_release" is the hardware CPU ID, whereas 
     317+        * "cpu" is Linux's internal ID. 
    319318+        */ 
    320319+       write_pen_release(cpu); 
     
    325324+        * and branch to the address found there. 
    326325+        */ 
    327 +       smp_cross_call(cpumask_of(cpu), 1); 
     326+       gic_raise_softirq(cpumask_of(cpu), 1); 
    328327+ 
    329328+       timeout = jiffies + (1 * HZ); 
     
    349348+ * which may be present or become present in the system. 
    350349+ */ 
     350+ 
    351351+void __init smp_init_cpus(void) 
    352352+{ 
     
    367367+       for (i = 0; i < ncores; i++) 
    368368+               set_cpu_possible(i, true); 
     369+ 
     370+       set_smp_cross_call(gic_raise_softirq); 
    369371+} 
    370372+ 
     
    389391+        */ 
    390392+       __raw_writel(virt_to_phys(cns3xxx_secondary_startup), 
    391 +                       (void __iomem *)(0xFFF07000 + 0x0600)); 
    392 +} 
    393 --- /dev/null 
    394 +++ b/arch/arm/mach-cns3xxx/include/mach/smp.h 
    395 @@ -0,0 +1,13 @@ 
    396 +#ifndef __MACH_SMP_H 
    397 +#define __MACH_SMP_H 
    398 + 
    399 +#include <asm/hardware/gic.h> 
    400 + 
    401 +/* 
    402 + * We use IRQ1 as the IPI 
    403 + */ 
    404 +static inline void smp_cross_call(const struct cpumask *mask, int ipi) 
    405 +{ 
    406 +       gic_raise_softirq(mask, ipi); 
    407 +} 
    408 +#endif 
     393+                       (void __iomem *)(CNS3XXX_MISC_BASE_VIRT + 0x0600)); 
     394+} 
    409395--- a/arch/arm/Kconfig 
    410396+++ b/arch/arm/Kconfig 
    411 @@ -1311,7 +1311,7 @@ config SMP 
     397@@ -1312,7 +1312,7 @@ config SMP 
    412398        depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ 
    413399                 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \ 
Note: See TracChangeset for help on using the changeset viewer.