Skip to contentSkip to conversation

add optee support for broadcom NS3 soc

PATCH New Rayagonda Kokatanur 3 participants 10 messages May 17, 2020 – May 25, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover add optee support for broadcom NS3 soc

This is fourth patch set series prepared on top of third patch set ("add FIT image support for broadcom NS3 soc").

This patch adds optee support.

Vikas Gupta (3):
board: ns3: add optee based bnxt fw load driver
configs: ns3: enable tee and optee driver
arm: dts: ns3: add optee node

 arch/arm/dts/ns3.dtsi               |   7 ++
 board/broadcom/bcmns3/Kconfig       |   5 +
 board/broadcom/bcmns3/Makefile      |   1 +
 board/broadcom/bcmns3/chimp_optee.c | 154 ++++++++++++++++++++++++++++
 configs/bcm_ns3_defconfig           |   5 +-
 include/brcm/chimp.h                |  40 ++++++++
 6 files changed, 211 insertions(+), 1 deletion(-)
 create mode 100644 board/broadcom/bcmns3/chimp_optee.c
 create mode 100644 include/brcm/chimp.h
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 board: ns3: add optee based bnxt fw load driver

From: Vikas Gupta <[email protected]>

Add optee based bnxt fw load driver.

---
 board/broadcom/bcmns3/Kconfig       |   5 +
 board/broadcom/bcmns3/Makefile      |   1 +
 board/broadcom/bcmns3/chimp_optee.c | 154 ++++++++++++++++++++++++++++
 include/brcm/chimp.h                |  40 ++++++++
 4 files changed, 200 insertions(+)
 create mode 100644 board/broadcom/bcmns3/chimp_optee.c
 create mode 100644 include/brcm/chimp.h
board/broadcom/bcmns3/Kconfig +5 -0
index 8ce21f980d..84daad9415 100644
@@ -12,4 +12,9 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "bcm_ns3"
 
+config CHIMP_OPTEE
+	bool "Enable secure ChiMP firmware loading"
+	depends on OPTEE
+	default y
+
 endif
board/broadcom/bcmns3/Makefile +1 -0
index 3404260148..08e1d7203b 100644
@@ -3,3 +3,4 @@
 # Copyright 2020 Broadcom.
 
 obj-y	:= ns3.o
+obj-$(CONFIG_CHIMP_OPTEE) += chimp_optee.o
board/broadcom/bcmns3/chimp_optee.c new file +154 -0

154 lines not on this page · raw message

include/brcm/chimp.h new file +40 -0
new file mode 100644
index 0000000000..c3d4594c4b
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 Broadcom.
+ *
+ */
+
+#ifndef __CHIMP_H__
+#define __CHIMP_H__
+
+#include <common.h>
+#include <linux/compiler.h>
+
+#define BCM_CHIMP_SUCCESS	0
+#define BCM_CHIMP_FAILURE	(!BCM_CHIMP_SUCCESS)
+
+#ifdef CONFIG_CHIMP_OPTEE
+int chimp_fastboot_optee(void);
+int chimp_health_status_optee(u32 *status);
+int chimp_handshake_status_optee(u32 timeout, u32 *hstatus);
+#else
+static inline int chimp_handshake_status_optee(u32 timeout, u32 *status)
+{
+	printf("ChiMP handshake status fail (OPTEE not enabled)\n");
+	return BCM_CHIMP_FAILURE;
+}
+
+static inline int chimp_health_status_optee(u32 *status)
+{
+	printf("ChiMP health status fail (OPTEE not enabled)\n");
+	return BCM_CHIMP_FAILURE;
+}
+
+static inline int chimp_fastboot_optee(void)
+{
+	printf("ChiMP secure boot fail (OPTEE not enabled)\n");
+	return BCM_CHIMP_FAILURE;
+}
+#endif
+
+#endif
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/3 board: ns3: add optee based bnxt fw load driver

Hi Rayagonda and Vikas,

Quoted 3 lines · Rayagonda Kokatanur

From: Vikas Gupta <[email protected]>

Add optee based bnxt fw load driver.

What is "bnxt"? Maybe you could add a comment explaining what it is, or at least expanding it if it's an acronym?

Thanks,
Thomas

#3 lore raw

PATCH 1/3 board: ns3: add optee based bnxt fw load driver

Hi,

Quoted 12 lines · Thomas Fitzsimmons

Hi Rayagonda and Vikas,

Quoted 3 lines · Rayagonda Kokatanur

From: Vikas Gupta <[email protected]>

Add optee based bnxt fw load driver.

What is "bnxt"? Maybe you could add a comment explaining what it is, or at least expanding it if it's an acronym?

Also how about putting it in drivers/ ?

Also are there docs somewhere on how an image is put together?

- Simon

#4 lore raw

PATCH 1/3 board: ns3: add optee based bnxt fw load driver

Hi Simon,

Quoted 9 lines · Simon Glass

Hi,

Quoted 5 lines · Thomas Fitzsimmons

Hi Rayagonda and Vikas,

Rayagonda Kokatanur <[email protected]> writes:

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

From: Vikas Gupta <[email protected]>

Add optee based bnxt fw load driver.

What is "bnxt"? Maybe you could add a comment explaining what it is, or at least expanding it if it's an acronym?

Also how about putting it in drivers/ ?

Okay, I will move the driver file to drivers/tee/broadcom and header file to include/broadcom/.

Quoted 2 lines

Also are there docs somewhere on how an image is put together?

We do not have any docs on how the bnxt( Broadcom NetXtreme controller) binary is created.
We receive it as a binary and using OpTEE we load the binary to bnxt.

Quoted 3 lines

- Simon

#5 lore raw

PATCH 1/3 board: ns3: add optee based bnxt fw load driver

In reply to Thomas Fitzsimmons
Quoted 11 lines · Thomas Fitzsimmons

Hi Rayagonda and Vikas,

Quoted 3 lines · Rayagonda Kokatanur

From: Vikas Gupta <[email protected]>

Add optee based bnxt fw load driver.

What is "bnxt"? Maybe you could add a comment explaining what it is, or at least expanding it if it's an acronym?

bnxt is Broadcom NetXtreme controller ethernet cards. I will expand it in the commit message.

Quoted 3 lines

Thanks,
Thomas

#6 lore raw

PATCH 2/3 configs: ns3: enable tee and optee driver

In reply to Rayagonda Kokatanur

From: Vikas Gupta <[email protected]>

Enable tee and optee drivers.

---
 configs/bcm_ns3_defconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
configs/bcm_ns3_defconfig +4 -1
index b52c6d7d93..13fe9d439e 100644
@@ -4,12 +4,12 @@ CONFIG_TARGET_BCMNS3=y
 CONFIG_SYS_TEXT_BASE=0xFF000000
 CONFIG_ENV_SIZE=0x80000
 CONFIG_NR_DRAM_BANKS=2
-CONFIG_OF_BOARD_SETUP=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_SIGNATURE_MAX_SIZE=0x20000000
 CONFIG_FIT_VERBOSE=y
 CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_LOGLEVEL=7
 CONFIG_SILENT_CONSOLE=y
 CONFIG_SILENT_U_BOOT_ONLY=y
@@ -42,6 +42,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+# CONFIG_OPTEE_TA_AVB is not set
 # CONFIG_WATCHDOG is not set
 CONFIG_WDT=y
 CONFIG_WDT_SP805=y
Signature · 1 line
2.17.1
#8 lore raw

PATCH 3/3 arm: dts: ns3: add optee node

In reply to Rayagonda Kokatanur

From: Vikas Gupta <[email protected]>

Add support for optee

---
 arch/arm/dts/ns3.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/ns3.dtsi +7 -0
index 6962e658d3..509818e23e 100644
@@ -21,6 +21,13 @@
 			<0x8 0x80000000 0x1 0x80000000>;
 	};
 
+	firmware {
+		optee {
+			compatible = "linaro,optee-tz";
+			method = "smc";
+		};
+	};
+
 	hsls {
 		compatible = "simple-bus";
 		dma-ranges;
Signature · 1 line
2.17.1