Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * SMP support for Emma Mobile EV2
0004  *
0005  * Copyright (C) 2012  Renesas Solutions Corp.
0006  * Copyright (C) 2012  Magnus Damm
0007  */
0008 #include <linux/kernel.h>
0009 #include <linux/init.h>
0010 #include <linux/smp.h>
0011 #include <linux/spinlock.h>
0012 #include <linux/io.h>
0013 #include <linux/delay.h>
0014 #include <asm/smp_plat.h>
0015 #include <asm/smp_scu.h>
0016 
0017 #include "common.h"
0018 #include "emev2.h"
0019 
0020 #define EMEV2_SCU_BASE 0x1e000000
0021 #define EMEV2_SMU_BASE 0xe0110000
0022 #define SMU_GENERAL_REG0 0x7c0
0023 
0024 static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
0025 {
0026     arch_send_wakeup_ipi_mask(cpumask_of(cpu_logical_map(cpu)));
0027     return 0;
0028 }
0029 
0030 static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
0031 {
0032     void __iomem *smu;
0033 
0034     /* Tell ROM loader about our vector (in headsmp.S) */
0035     smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
0036     if (smu) {
0037         iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0);
0038         iounmap(smu);
0039     }
0040 
0041     /* setup EMEV2 specific SCU bits */
0042     shmobile_smp_scu_prepare_cpus(EMEV2_SCU_BASE, max_cpus);
0043 }
0044 
0045 const struct smp_operations emev2_smp_ops __initconst = {
0046     .smp_prepare_cpus   = emev2_smp_prepare_cpus,
0047     .smp_boot_secondary = emev2_boot_secondary,
0048 };