Skip to content

NS Interrupt notification over async notif #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: optee
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
783e42f
arm64: dt: Remove timer from mt8173 **not for mainline**
jbech-linaro Apr 1, 2016
1ed0f96
arm64: dt: OP-TEE for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
7467a90
arm64: dt: OP-TEE for Juno **not for mainline**
jenswi-linaro Mar 29, 2016
fa58344
arm64: dt: Add no-map to the reserved-memory node for OP-TEE for foun…
jenswi-linaro Dec 2, 2016
996eb0f
arm64: dt: Add no-map to the reserved-memory node for OP-TEE for juno…
jenswi-linaro Jan 3, 2017
2f0b8ae
arm64: dt: Add OP-TEE firmware to mt8173 **not for mainline**
jbech-linaro Mar 24, 2016
e47d374
arm64: dts: hi3798cv200-poplar: memreserve for bootloader
igoropaniuk May 11, 2020
72a9576
arm64: dts: hi3798cv200-poplar: add optee node
igoropaniuk May 11, 2020
afbb325
ARM: dts: stm32: Define OP-TEE resources on stm32mp15 and enable on DK2
etienne-lms May 27, 2020
9e8b7ff
Enable Microsoft fTPM driver on Arm Foundation v8 models.
javieralso-arm Feb 2, 2021
3b88d5f
stm32mp157c-ev1.dts: Fix optee status to 'okay'
Mar 2, 2021
916de92
arm: dts: define OP-TEE resources for STM32MP1 ED1 and EV1
etienne-lms Apr 27, 2021
07b522e
arm64: dt: OP-TEE for FVP Base RevC
jenswi-linaro Jun 30, 2022
57db133
arm: dts: define OP-TEE resources for STM32MP15 DHCOM based boards
jneuhauser Feb 16, 2022
4d17ae6
arm: dts: define OP-TEE resources for STM32MP15 DHCOR based boards
jneuhauser Jul 13, 2022
e1c3d91
arm64: dt: rockpi4: disable node usbdrd_dwc3_0 **not for mainline**
jforissier Nov 14, 2022
aed8040
arm64: dt: rockpi4: add OP-TEE nodes **not for mainline**
jforissier Nov 15, 2022
97439f2
dt-bindings: arm: optee: add interrupt controller properties
etienne-lms Jan 12, 2023
9a724e5
optee: multiplex tee interrupt events on optee async notif irq
etienne-lms Mar 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ properties:
HVC #0, register assignments
register assignments are specified in drivers/tee/optee/optee_smc.h

interrupt-controller: true

"#interrupt-cells":
const: 1
description: |
OP-TEE exposes irq for irp chip controllers from OP-TEE world. Each
irq is assigned a single line number identifier used as first argument.
Line number identifiers and their meaning shall be found in the OP-TEE
firmware platform documentation.

required:
- compatible
- method
Expand All @@ -64,3 +74,31 @@ examples:
method = "hvc";
};
};

- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
firmware {
optee: optee {
compatible = "linaro,optee-tz";
method = "smc";
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>;
interrupt-controller;
#interrupt-cells = <1>;
};

scmi {
compatible = "linaro,scmi-optee";
linaro,optee-channel-id = <0>;
shmem = <&scmi_shm_tx>, <&scmi_shm_rx>;
interrupts-extended = <&optee 5>;
interrupt-names = "a2p";
#address-cells = <1>;
#size-cells = <0>;

scmi_cpu_dvfs: protocol@13 {
reg = <0x13>;
#clock-cells = <1>;
};
};
};
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/stm32mp151.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
method = "smc";
};

firmware {
optee: optee {
compatible = "linaro,optee-tz";
method = "smc";
status = "disabled";
};
};

intc: interrupt-controller@a0021000 {
compatible = "arm,cortex-a7-gic";
#interrupt-cells = <3>;
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/boot/dts/stm32mp157c-dk2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
model = "STMicroelectronics STM32MP157C-DK2 Discovery Board";
compatible = "st,stm32mp157c-dk2", "st,stm32mp157";

reserved-memory {
optee_memory: optee@0xde000000 {
reg = <0xde000000 0x02000000>;
no-map;
};
};

aliases {
ethernet0 = &ethernet0;
serial0 = &uart4;
Expand Down Expand Up @@ -99,3 +106,7 @@
pinctrl-2 = <&usart2_idle_pins_c>;
status = "disabled";
};

&optee {
status = "okay";
};
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/stm32mp157c-ed1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
reg = <0xe8000000 0x8000000>;
no-map;
};

optee_memory: optee@fe000000 {
reg = <0xfe000000 0x2000000>;
no-map;
};
};

aliases {
Expand Down Expand Up @@ -320,6 +325,10 @@
status = "okay";
};

&optee {
status = "okay";
};

&pwr_regulators {
vdd-supply = <&vdd>;
vdd_3v3_usbfs-supply = <&vdd_usb>;
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
reg = <0x38000000 0x10000>;
no-map;
};

optee_memory: optee@fe000000 {
reg = <0xfe000000 0x2000000>;
no-map;
};
};

ethernet_vio: vioregulator {
Expand Down Expand Up @@ -421,6 +426,10 @@
status = "okay";
};

&optee {
status = "okay";
};

&pwr_regulators {
vdd-supply = <&vdd>;
vdd_3v3_usbfs-supply = <&vdd_usb>;
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
reg = <0x38000000 0x10000>;
no-map;
};

optee_memory: optee@fe000000 {
reg = <0xfe000000 0x2000000>;
no-map;
};
};
};

Expand Down Expand Up @@ -240,6 +245,10 @@
status = "okay";
};

&optee {
status = "okay";
};

&pwr_regulators {
vdd-supply = <&vdd>;
vdd_3v3_usbfs-supply = <&vdd_usb>;
Expand Down
32 changes: 23 additions & 9 deletions arch/arm64/boot/dts/arm/foundation-v8.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@

aliases {
serial0 = &v2m_serial0;
serial1 = &v2m_serial1;
serial2 = &v2m_serial2;
serial3 = &v2m_serial3;
};

ftpm {
compatible = "microsoft,ftpm";
};

cpus {
#address-cells = <2>;
#size-cells = <0>;
Expand Down Expand Up @@ -68,6 +71,17 @@
<0x00000008 0x80000000 0 0x80000000>;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

optee@0x83000000 {
reg = <0x00000000 0x83000000 0 0x01000000>;
no-map;
};
};

timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
Expand Down Expand Up @@ -202,14 +216,6 @@
clock-names = "uartclk", "apb_pclk";
};

v2m_serial1: serial@a0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0a0000 0x1000>;
interrupts = <6>;
clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>;
clock-names = "uartclk", "apb_pclk";
};

v2m_serial2: serial@b0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0b0000 0x1000>;
Expand All @@ -233,4 +239,12 @@
};
};
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};

};
12 changes: 12 additions & 0 deletions arch/arm64/boot/dts/arm/fvp-base-revc.dts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
reg = <0x00000000 0x18000000 0 0x00800000>;
no-map;
};

optee@83000000 {
reg = <0x00000000 0x83000000 0 0x01000000>;
no-map;
};
};

gic: interrupt-controller@2f000000 {
Expand Down Expand Up @@ -317,4 +322,11 @@
<0 0 44 &gic 0 0 GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
<0 0 46 &gic 0 0 GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};
19 changes: 19 additions & 0 deletions arch/arm64/boot/dts/arm/juno-base.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,18 @@
<0x00000008 0x80000000 0x1 0x80000000>;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

/* Shared memory between secure and non-secure world */
optee@0xfee00000 {
reg = <0x00000000 0xfee00000 0 0x00200000>;
no-map;
};
};

bus@8000000 {
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 15>;
Expand Down Expand Up @@ -994,4 +1006,11 @@
interrupt-map-mask = <0 0>;
interrupt-map = <0 0 &gic 0 GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

/dts-v1/;
/memreserve/ 0x00000000 0x04080000;

#include <dt-bindings/gpio/gpio.h>
#include "hi3798cv200.dtsi"
Expand Down Expand Up @@ -70,6 +71,13 @@
gpio = <&gpio6 7 0>;
enable-active-high;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};

&ehci {
Expand Down
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt8173-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
gpio = <&pio 9 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};

&mfg_async {
Expand Down
9 changes: 0 additions & 9 deletions arch/arm64/boot/dts/mediatek/mt8173.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -526,15 +526,6 @@
reg = <0 0x10007000 0 0x100>;
};

timer: timer@10008000 {
compatible = "mediatek,mt8173-timer",
"mediatek,mt6577-timer";
reg = <0 0x10008000 0 0x1000>;
interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_LOW>;
clocks = <&infracfg CLK_INFRA_CLK_13M>,
<&topckgen CLK_TOP_RTC_SEL>;
};

pwrap: pwrap@1000d000 {
compatible = "mediatek,mt8173-pwrap";
reg = <0 0x1000d000 0 0x1000>;
Expand Down
20 changes: 19 additions & 1 deletion arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1400000>;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

optee@30000000 {
reg = <0x0 0x30000000 0x0 0x2400000>;
no-map;
};
};
};

&cpu_l0 {
Expand Down Expand Up @@ -765,7 +783,7 @@
};

&usbdrd_dwc3_0 {
status = "okay";
status = "disabled";
dr_mode = "host";
};

Expand Down
10 changes: 10 additions & 0 deletions drivers/tee/optee/optee_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,21 @@ struct optee_supp {
struct completion reqs_c;
};

/*
* struct optee_smc - optee smc communication struct
* @invoke_fn handler function to invoke secure monitor
* @memremaped_shm virtual address of memory in shared memory pool
* @sec_caps: secure world capabilities defined by
* OPTEE_SMC_SEC_CAP_* in optee_smc.h
* @notif_irq interrupt used as async notification by OP-TEE or 0
* @domain interrupt domain registered by OP-TEE driver
*/
struct optee_smc {
optee_invoke_fn *invoke_fn;
void *memremaped_shm;
u32 sec_caps;
unsigned int notif_irq;
struct irq_domain *domain;
};

/**
Expand Down
Loading