File: platsmp.c

package info (click to toggle)
linux 6.17.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,734,788 kB
  • sloc: ansic: 26,682,992; asm: 271,227; sh: 147,381; python: 75,980; makefile: 57,306; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (32 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (31)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
 */
#include <linux/io.h>
#include <asm/smp_scu.h>
#include <asm/smp.h>
#include "addr-map.h"

#define SW_BRANCH_VIRT_ADDR	CIU_REG(0x24)

static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
	/*
	 * Apparently, the boot ROM on the second core spins on this
	 * register becoming non-zero and then jumps to the address written
	 * there. No IPIs involved.
	 */
	__raw_writel(__pa_symbol(secondary_startup), SW_BRANCH_VIRT_ADDR);
	return 0;
}

static void mmp3_smp_prepare_cpus(unsigned int max_cpus)
{
	scu_enable(SCU_VIRT_BASE);
}

static const struct smp_operations mmp3_smp_ops __initconst = {
	.smp_prepare_cpus	= mmp3_smp_prepare_cpus,
	.smp_boot_secondary	= mmp3_boot_secondary,
};
CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops);