[U-Boot,3/4] powerpc: mpc85xx: crypto: Implement mpc85xxx specific job-ring fix
diff mbox series

Message ID 20190423101948.24898-4-bryan.odonoghue@linaro.org
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series
  • imx: Implement job-ring context switching
Related show

Commit Message

Bryan O'Donoghue April 23, 2019, 10:19 a.m. UTC
The mpc85xxx has more than one sec block. As a result we need to have an
architecture specific version of:

void sec_set_jr_context_secure(void);
void sec_set_jr_context_normal(void);

This patch implements those functions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 arch/powerpc/cpu/mpc85xx/cpu_init.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Patch
diff mbox series

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index cbcd62e19a..7f007f4f88 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -1056,3 +1056,25 @@  int board_late_init(void)
 	return 0;
 }
 #endif
+
+#if defined(CONFIG_ARCH_C29X)
+void sec_set_jr_context_secure(void)
+{
+	if ((SVR_SOC_VER(svr) == SVR_C292) ||
+	    (SVR_SOC_VER(svr) == SVR_C293))
+		sec_set_jr_context_secure(1);
+
+	if (SVR_SOC_VER(svr) == SVR_C293)
+		sec_set_jr_context_secure(2);
+}
+
+void sec_set_jr_context_normal(void)
+{
+	if ((SVR_SOC_VER(svr) == SVR_C292) ||
+	    (SVR_SOC_VER(svr) == SVR_C293))
+		sec_set_jr_context_normal(1);
+
+	if (SVR_SOC_VER(svr) == SVR_C293)
+		sec_set_jr_context_normal(2);
+}
+#endif