~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-realview/platsmp-dt.c

Version: ~ [ linux-5.2-rc5 ] ~ [ linux-5.1.12 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.53 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.128 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.182 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.182 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.68 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2015 Linus Walleij
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  */
  8 #include <linux/smp.h>
  9 #include <linux/io.h>
 10 #include <linux/of.h>
 11 #include <linux/of_address.h>
 12 #include <linux/regmap.h>
 13 #include <linux/mfd/syscon.h>
 14 
 15 #include <asm/cacheflush.h>
 16 #include <asm/smp_plat.h>
 17 #include <asm/smp_scu.h>
 18 
 19 #include <plat/platsmp.h>
 20 #include "hotplug.h"
 21 
 22 #define REALVIEW_SYS_FLAGSSET_OFFSET    0x30
 23 
 24 static const struct of_device_id realview_scu_match[] = {
 25         { .compatible = "arm,arm11mp-scu", },
 26         { .compatible = "arm,cortex-a9-scu", },
 27         { .compatible = "arm,cortex-a5-scu", },
 28         { }
 29 };
 30 
 31 static const struct of_device_id realview_syscon_match[] = {
 32         { .compatible = "arm,core-module-integrator", },
 33         { .compatible = "arm,realview-eb-syscon", },
 34         { .compatible = "arm,realview-pb11mp-syscon", },
 35         { .compatible = "arm,realview-pbx-syscon", },
 36         { },
 37 };
 38 
 39 static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
 40 {
 41         struct device_node *np;
 42         void __iomem *scu_base;
 43         struct regmap *map;
 44         unsigned int ncores;
 45         int i;
 46 
 47         np = of_find_matching_node(NULL, realview_scu_match);
 48         if (!np) {
 49                 pr_err("PLATSMP: No SCU base address\n");
 50                 return;
 51         }
 52         scu_base = of_iomap(np, 0);
 53         of_node_put(np);
 54         if (!scu_base) {
 55                 pr_err("PLATSMP: No SCU remap\n");
 56                 return;
 57         }
 58 
 59         scu_enable(scu_base);
 60         ncores = scu_get_core_count(scu_base);
 61         pr_info("SCU: %d cores detected\n", ncores);
 62         for (i = 0; i < ncores; i++)
 63                 set_cpu_possible(i, true);
 64         iounmap(scu_base);
 65 
 66         /* The syscon contains the magic SMP start address registers */
 67         np = of_find_matching_node(NULL, realview_syscon_match);
 68         if (!np) {
 69                 pr_err("PLATSMP: No syscon match\n");
 70                 return;
 71         }
 72         map = syscon_node_to_regmap(np);
 73         if (IS_ERR(map)) {
 74                 pr_err("PLATSMP: No syscon regmap\n");
 75                 return;
 76         }
 77         /* Put the boot address in this magic register */
 78         regmap_write(map, REALVIEW_SYS_FLAGSSET_OFFSET,
 79                      __pa_symbol(versatile_secondary_startup));
 80 }
 81 
 82 static const struct smp_operations realview_dt_smp_ops __initconst = {
 83         .smp_prepare_cpus       = realview_smp_prepare_cpus,
 84         .smp_secondary_init     = versatile_secondary_init,
 85         .smp_boot_secondary     = versatile_boot_secondary,
 86 #ifdef CONFIG_HOTPLUG_CPU
 87         .cpu_die                = realview_cpu_die,
 88 #endif
 89 };
 90 CPU_METHOD_OF_DECLARE(realview_smp, "arm,realview-smp", &realview_dt_smp_ops);
 91 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp