blob: 5971ad256b8b055db4bead72cb088c97dce8dcba [file] [log] [blame]
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09001/*
2 * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <mapmem.h>
9#include <linux/io.h>
10#include <linux/sizes.h>
11
12#define UNIPHIER_SMPCTRL_ROM_RSV0 0x59801200
13
14void uniphier_smp_setup(void);
15void uniphier_secondary_startup(void);
16
17void uniphier_smp_kick_all_cpus(void)
18{
19 void __iomem *rom_boot_rsv0;
20
21 rom_boot_rsv0 = map_sysmem(UNIPHIER_SMPCTRL_ROM_RSV0, SZ_8);
22
23 writeq((u64)uniphier_secondary_startup, rom_boot_rsv0);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090024
25 unmap_sysmem(rom_boot_rsv0);
26
27 uniphier_smp_setup();
28
Masahiro Yamadaf627ef12016-06-08 18:02:32 +090029 asm("dsb ishst\n" /* Ensure the write to ROM_RSV0 is visible */
30 "sev"); /* Bring up all secondary CPUs from Boot ROM into U-Boot */
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090031}