1 // SPDX-License-Identifier: GPL-2.0-or-later
2 // Copyright (C) ASPEED Technology Inc.
5 #include <linux/of_address.h>
10 #define BOOT_ADDR 0x00
13 static struct device_node
*secboot_node
;
15 static int aspeed_g6_boot_secondary(unsigned int cpu
, struct task_struct
*idle
)
19 base
= of_iomap(secboot_node
, 0);
21 pr_err("could not map the secondary boot base!");
25 writel_relaxed(0, base
+ BOOT_ADDR
);
26 writel_relaxed(__pa_symbol(secondary_startup_arm
), base
+ BOOT_ADDR
);
27 writel_relaxed((0xABBAAB00 | (cpu
& 0xff)), base
+ BOOT_SIG
);
36 static void __init
aspeed_g6_smp_prepare_cpus(unsigned int max_cpus
)
40 secboot_node
= of_find_compatible_node(NULL
, NULL
, "aspeed,ast2600-smpmem");
42 pr_err("secboot device node found!!\n");
46 base
= of_iomap(secboot_node
, 0);
48 pr_err("could not map the secondary boot base!");
51 __raw_writel(0xBADABABA, base
+ BOOT_SIG
);
56 static const struct smp_operations aspeed_smp_ops __initconst
= {
57 .smp_prepare_cpus
= aspeed_g6_smp_prepare_cpus
,
58 .smp_boot_secondary
= aspeed_g6_boot_secondary
,
61 CPU_METHOD_OF_DECLARE(aspeed_smp
, "aspeed,ast2600-smp", &aspeed_smp_ops
);