Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 1 | /* |
| 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 | |
| 14 | void uniphier_smp_setup(void); |
| 15 | void uniphier_secondary_startup(void); |
| 16 | |
| 17 | void 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 Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 24 | |
| 25 | unmap_sysmem(rom_boot_rsv0); |
| 26 | |
| 27 | uniphier_smp_setup(); |
| 28 | |
Masahiro Yamada | f627ef1 | 2016-06-08 18:02:32 +0900 | [diff] [blame] | 29 | 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 Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 31 | } |