From 071106ecf68c401173c58808b1cf5f68cc50d390 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 05 Jan 2024 08:39:27 +0000
Subject: [PATCH] change wifi driver to cypress

---
 u-boot/arch/arm/cpu/armv8/start.S |   74 +++++++++++++++++++++++++++++++++++++
 1 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/u-boot/arch/arm/cpu/armv8/start.S b/u-boot/arch/arm/cpu/armv8/start.S
index 8447fc6..f84932d 100644
--- a/u-boot/arch/arm/cpu/armv8/start.S
+++ b/u-boot/arch/arm/cpu/armv8/start.S
@@ -117,6 +117,43 @@
 0:
 
 	/*
+	 * Enable instruction cache (if required), stack pointer,
+	 * data access alignment checks and SError.
+	 */
+#ifndef CONFIG_SYS_ICACHE_OFF
+	mov x1, #CR_I
+#else
+	mov x1, #0
+#endif
+	switch_el x2, 3f, 2f, 1f
+3:	mrs	x0, sctlr_el3
+	orr	x0, x0, x1
+	msr	sctlr_el3, x0
+#ifndef CONFIG_SUPPORT_USBPLUG
+	msr	daifclr, #4			/* Enable SError. SCR_EL3.EA=1 was already set in start.S */
+#endif
+	b	0f
+2:	mrs	x0, sctlr_el2
+	orr	x0, x0, x1
+	msr	sctlr_el2, x0
+
+	mrs	x0, hcr_el2
+	orr	x0, x0, #HCR_EL2_TGE
+	orr	x0, x0, #HCR_EL2_AMO
+#if CONFIG_IS_ENABLED(IRQ)
+	orr	x0, x0, #HCR_EL2_IMO
+#endif
+	msr	hcr_el2, x0
+	msr	daifclr, #4
+	b	0f
+1:	mrs	x0, sctlr_el1
+	orr	x0, x0, x1
+	msr	sctlr_el1, x0
+	msr	daifclr, #4
+0:
+	isb
+
+	/*
 	 * Enable SMPEN bit for coherency.
 	 * This register is not architectural but at the moment
 	 * this bit should be set for A53/A57/A72.
@@ -160,6 +197,43 @@
 	cbz	x0, slave_cpu
 	br	x0			/* branch to the given address */
 #endif /* CONFIG_ARMV8_MULTIENTRY */
+
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARM_SMP)
+	mrs	x0, mpidr_el1
+	and x0, x0, #0xfff
+	cmp x0, #0
+	beq master_cpu
+
+#ifdef SMP_CPU1
+	cmp x0, #(SMP_CPU1)
+	ldr x1, =(SMP_CPU1_STACK)
+	beq slave_cpu
+#endif
+
+#ifdef SMP_CPU2
+	cmp x0, #(SMP_CPU2)
+	ldr x1, =(SMP_CPU2_STACK)
+	beq slave_cpu
+#endif
+
+#ifdef SMP_CPU3
+	cmp x0, #(SMP_CPU3)
+	ldr x1, =(SMP_CPU3_STACK)
+	beq slave_cpu
+#endif
+	dsb sy
+	isb
+
+loop:
+	wfe
+	b loop
+
+slave_cpu:
+	bic	sp, x1, #0xf
+	bl	smp_entry
+	b	loop
+#endif
+
 master_cpu:
 	bl	_main
 

--
Gitblit v1.6.2