Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Keystone SOC SMP platform code |
| 3 | * |
| 4 | * Copyright 2013 Texas Instruments, Inc. |
| 5 | * Cyril Chemparathy <cyril@ti.com> |
| 6 | * Santosh Shilimkar <santosh.shillimkar@ti.com> |
| 7 | * |
| 8 | * Based on platsmp.c, Copyright (C) 2002 ARM Ltd. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify it |
| 11 | * under the terms and conditions of the GNU General Public License, |
| 12 | * version 2, as published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/smp.h> |
| 17 | #include <linux/io.h> |
| 18 | |
| 19 | #include <asm/smp_plat.h> |
Santosh Shilimkar | 5eb3da7 | 2013-06-13 19:24:39 -0400 | [diff] [blame] | 20 | #include <asm/prom.h> |
| 21 | #include <asm/tlbflush.h> |
| 22 | #include <asm/pgtable.h> |
Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 23 | |
| 24 | #include "keystone.h" |
| 25 | |
Paul Gortmaker | 8bd26e3 | 2013-06-17 15:43:14 -0400 | [diff] [blame] | 26 | static int keystone_smp_boot_secondary(unsigned int cpu, |
Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 27 | struct task_struct *idle) |
| 28 | { |
Santosh Shilimkar | 5eb3da7 | 2013-06-13 19:24:39 -0400 | [diff] [blame] | 29 | unsigned long start = virt_to_idmap(&secondary_startup); |
Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 30 | int error; |
| 31 | |
| 32 | pr_debug("keystone-smp: booting cpu %d, vector %08lx\n", |
| 33 | cpu, start); |
| 34 | |
Santosh Shilimkar | 3aae7ab | 2013-06-21 18:54:47 -0400 | [diff] [blame] | 35 | error = keystone_cpu_smc(KEYSTONE_MON_CPU_UP_IDX, cpu, start); |
| 36 | if (error) |
| 37 | pr_err("CPU %d bringup failed with %d\n", cpu, error); |
Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 38 | |
| 39 | return error; |
| 40 | } |
| 41 | |
Masahiro Yamada | 7530527 | 2015-11-15 10:39:53 +0900 | [diff] [blame] | 42 | const struct smp_operations keystone_smp_ops __initconst = { |
Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 43 | .smp_boot_secondary = keystone_smp_boot_secondary, |
Santosh Shilimkar | f07cb6a | 2013-06-10 12:20:17 -0400 | [diff] [blame] | 44 | }; |