blob: 4f08963118a346449e7addef5f438adebc12db8a [file] [log] [blame]
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09001/*
Masahiro Yamadafa1f73f2016-07-19 21:56:13 +09002 * Copyright (C) 2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09008#include <linux/io.h>
9#include <linux/sizes.h>
10
11#define UNIPHIER_SMPCTRL_ROM_RSV0 0x59801200
12
13void uniphier_smp_setup(void);
14void uniphier_secondary_startup(void);
15
16void uniphier_smp_kick_all_cpus(void)
17{
18 void __iomem *rom_boot_rsv0;
19
Masahiro Yamadafa1f73f2016-07-19 21:56:13 +090020 rom_boot_rsv0 = ioremap(UNIPHIER_SMPCTRL_ROM_RSV0, SZ_8);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090021
22 writeq((u64)uniphier_secondary_startup, rom_boot_rsv0);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090023
Masahiro Yamadafa1f73f2016-07-19 21:56:13 +090024 iounmap(rom_boot_rsv0);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090025
26 uniphier_smp_setup();
27
Masahiro Yamadaf627ef12016-06-08 18:02:32 +090028 asm("dsb ishst\n" /* Ensure the write to ROM_RSV0 is visible */
29 "sev"); /* Bring up all secondary CPUs from Boot ROM into U-Boot */
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090030}