blob: 673fcf3b34b12d8dd7c25ae7dc0805cc270c8631 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-only
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Keystone SOC SMP platform code
4 *
5 * Copyright 2013 Texas Instruments, Inc.
6 * Cyril Chemparathy <cyril@ti.com>
7 * Santosh Shilimkar <santosh.shillimkar@ti.com>
8 *
9 * Based on platsmp.c, Copyright (C) 2002 ARM Ltd.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010 */
11
12#include <linux/init.h>
13#include <linux/smp.h>
14#include <linux/io.h>
Olivier Deprez157378f2022-04-04 15:47:50 +020015#include <linux/pgtable.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016
17#include <asm/smp_plat.h>
18#include <asm/prom.h>
19#include <asm/tlbflush.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000020
21#include "keystone.h"
22
23static int keystone_smp_boot_secondary(unsigned int cpu,
24 struct task_struct *idle)
25{
26 unsigned long start = virt_to_idmap(&secondary_startup);
27 int error;
28
29 pr_debug("keystone-smp: booting cpu %d, vector %08lx\n",
30 cpu, start);
31
32 error = keystone_cpu_smc(KEYSTONE_MON_CPU_UP_IDX, cpu, start);
33 if (error)
34 pr_err("CPU %d bringup failed with %d\n", cpu, error);
35
36 return error;
37}
38
39const struct smp_operations keystone_smp_ops __initconst = {
40 .smp_boot_secondary = keystone_smp_boot_secondary,
41};