diff mbox

[U-Boot,PATCHv4,3/6] ls1021a: adding a secondary core boot address and kick functions

Message ID 1416562859-37857-4-git-send-email-Li.Xiubo@freescale.com
State Accepted
Delegated to: York Sun
Headers show

Commit Message

Xiubo Li Nov. 21, 2014, 9:40 a.m. UTC
Define the board specific smp_set_cpu_boot_addr() function to set
the start address for secondary cores in the LS1021A specific manner.

Define the board specific smp_kick_all_cpus() functioin to boot a
secondary core. Here the BRR contains control bits for enabling boot
for each core. On exiting HRESET or PORESET, the RCW BOOT_HO field
optionally allows for logical core 0 to be released for booting or to
remain in boot holdoff. All other cores remain in boot holdoff until
their corresponding bit is set.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: York Sun <yorksun@freescale.com>
---
 arch/arm/cpu/armv7/ls102xa/cpu.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

York Sun Dec. 11, 2014, 7:27 p.m. UTC | #1
On 11/21/2014 01:40 AM, Xiubo Li wrote:
> Define the board specific smp_set_cpu_boot_addr() function to set
> the start address for secondary cores in the LS1021A specific manner.
> 
> Define the board specific smp_kick_all_cpus() functioin to boot a
> secondary core. Here the BRR contains control bits for enabling boot
> for each core. On exiting HRESET or PORESET, the RCW BOOT_HO field
> optionally allows for logical core 0 to be released for booting or to
> remain in boot holdoff. All other cores remain in boot holdoff until
> their corresponding bit is set.
> 
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
> Acked-by: York Sun <yorksun@freescale.com>
> ---

Applied to u-boot-fsl-qoriq master, awaiting upstream.

York
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index b7dde45..32b09e0 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -101,3 +101,21 @@  int cpu_eth_init(bd_t *bis)
 
 	return 0;
 }
+
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+/* Set the address at which the secondary core starts from.*/
+void smp_set_core_boot_addr(unsigned long addr, int corenr)
+{
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+
+	out_be32(&gur->scratchrw[0], addr);
+}
+
+/* Release the secondary core from holdoff state and kick it */
+void smp_kick_all_cpus(void)
+{
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+
+	out_be32(&gur->brrl, 0x2);
+}
+#endif