This source file includes following definitions.
- r9a06g032_smp_boot_secondary
 
- r9a06g032_smp_prepare_cpus
 
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 #include <linux/io.h>
  12 #include <linux/of.h>
  13 #include <linux/of_address.h>
  14 #include <linux/smp.h>
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 
  28 
  29 
  30 static void __iomem *cpu_bootaddr;
  31 
  32 static DEFINE_SPINLOCK(cpu_lock);
  33 
  34 static int
  35 r9a06g032_smp_boot_secondary(unsigned int cpu,
  36                              struct task_struct *idle)
  37 {
  38         if (!cpu_bootaddr)
  39                 return -ENODEV;
  40 
  41         spin_lock(&cpu_lock);
  42 
  43         writel(__pa_symbol(secondary_startup), cpu_bootaddr);
  44         arch_send_wakeup_ipi_mask(cpumask_of(cpu));
  45 
  46         spin_unlock(&cpu_lock);
  47 
  48         return 0;
  49 }
  50 
  51 static void __init r9a06g032_smp_prepare_cpus(unsigned int max_cpus)
  52 {
  53         struct device_node *dn;
  54         int ret = -EINVAL, dns;
  55         u32 bootaddr;
  56 
  57         dn = of_get_cpu_node(1, NULL);
  58         if (!dn) {
  59                 pr_err("CPU#1: missing device tree node\n");
  60                 return;
  61         }
  62         
  63 
  64 
  65 
  66 
  67         if (of_find_property(dn, "cpu-release-addr", &dns)) {
  68                 if (dns == sizeof(u64)) {
  69                         u64 temp;
  70 
  71                         ret = of_property_read_u64(dn,
  72                                                    "cpu-release-addr", &temp);
  73                         bootaddr = temp;
  74                 } else {
  75                         ret = of_property_read_u32(dn,
  76                                                    "cpu-release-addr",
  77                                                    &bootaddr);
  78                 }
  79         }
  80         of_node_put(dn);
  81         if (ret) {
  82                 pr_err("CPU#1: invalid cpu-release-addr property\n");
  83                 return;
  84         }
  85         pr_info("CPU#1: cpu-release-addr %08x\n", bootaddr);
  86 
  87         cpu_bootaddr = ioremap(bootaddr, sizeof(bootaddr));
  88 }
  89 
  90 static const struct smp_operations r9a06g032_smp_ops __initconst = {
  91         .smp_prepare_cpus = r9a06g032_smp_prepare_cpus,
  92         .smp_boot_secondary = r9a06g032_smp_boot_secondary,
  93 };
  94 
  95 CPU_METHOD_OF_DECLARE(r9a06g032_smp,
  96                       "renesas,r9a06g032-smp", &r9a06g032_smp_ops);