Skip to contentSkip to conversation

crypto/fsl: Add fixup for crypto node

PATCH New Ruchika Gupta 2 participants 2 messages Dec 15, 2014 – Jan 24, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/fsl: Add fixup for crypto node

Era property is added in the crypto node in device tree. Move the code to do so from arch/powerpc/mpc8xxx/fdt.c to drivers/sec/sec.c so that it can be used across arm and powerpc platforms having crypto node.

---
 arch/arm/cpu/armv7/ls102xa/fdt.c  |  17 ++++
 arch/powerpc/cpu/mpc8xxx/fdt.c    | 170 -----------------------------------
 arch/powerpc/include/asm/config.h |   1 +
 drivers/crypto/fsl/Makefile       |   1 +
 drivers/crypto/fsl/sec.c          | 184 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 203 insertions(+), 170 deletions(-)
 create mode 100644 drivers/crypto/fsl/sec.c
arch/arm/cpu/armv7/ls102xa/fdt.c +17 -0
index 989780d..0fda694 100644
@@ -15,6 +15,8 @@
 #include <fsl_esdhc.h>
 #endif
 #include <tsec.h>
+#include <asm/arch/immap_ls102xa.h>
+#include <fsl_sec.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -77,9 +79,24 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 	int off;
 	int val;
 	const char *sysclk_path;
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+	unsigned int svr;
+	svr = in_be32(&gur->svr);
 
 	unsigned long busclk = get_bus_freq(0);
 
+	/* delete crypto node if not on an E-processor */
+	if (!IS_E_PROCESSOR(svr))
+		fdt_fixup_crypto_node(blob, 0);
+#if CONFIG_SYS_FSL_SEC_COMPAT >= 4
+	else {
+		ccsr_sec_t __iomem *sec;
+
+		sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
+		fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms));
+	}
+#endif
+
 	fdt_fixup_ethernet(blob);
 
 	off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
arch/powerpc/cpu/mpc8xxx/fdt.c +0 -170

176 lines not on this page · raw message

arch/powerpc/include/asm/config.h +1 -0
index 423a6fb..65496d0 100644
@@ -75,6 +75,7 @@
  * SEC (crypto unit) major compatible version determination
  */
 #if defined(CONFIG_MPC83xx)
+#define CONFIG_SYS_FSL_SEC_BE
 #define CONFIG_SYS_FSL_SEC_COMPAT	2
 #endif
 
drivers/crypto/fsl/Makefile +1 -0
index cb13d2e..067d0a9 100644
@@ -6,5 +6,6 @@
 # Version 2 as published by the Free Software Foundation.
 #
 
+obj-y += sec.o
 obj-$(CONFIG_FSL_CAAM) += jr.o fsl_hash.o jobdesc.o error.o
 obj-$(CONFIG_CMD_BLOB) += fsl_blob.o
drivers/crypto/fsl/sec.c new file +184 -0

184 lines not on this page · raw message

Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 crypto/fsl: Add fixup for crypto node

Quoted 7 lines · Ruchika Gupta

Era property is added in the crypto node in device tree. Move the code to do so from arch/powerpc/mpc8xxx/fdt.c to drivers/sec/sec.c so that it can be used across arm and powerpc platforms having crypto node.

---

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

York