Skip to content
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

Optee rev #54

Open
wants to merge 45 commits into
base: optee
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8516c25
tee: optee: fix uninitialized symbol 'parg'
jenswi-linaro May 15, 2017
0c6b38b
tee: add forward declaration for struct device
jforissier May 31, 2017
0383cf4
tee: tee_shm: Constify dma_buf_ops structures.
ArvindYadavCs Jul 1, 2017
a00c819
tee: optee: add const to tee_driver_ops and tee_desc structures
goyalbhumika Jun 29, 2017
625dacb
tee: optee: interruptible RPC sleep
tiger-yu99 May 5, 2017
87cc807
tee: indicate privileged dev in gen_caps
jenswi-linaro Feb 16, 2017
864563c
tee: optee: sync with new naming of interrupts
Feb 16, 2017
7efd6cd
tee: add kernel internal client interface
jenswi-linaro Nov 19, 2015
b599994
arm64: dt: Remove timer from mt8173 **not for mainline**
jbech-linaro Apr 1, 2016
70a4220
arm64: dt: PSCI for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
365afd8
arm64: dt: use GICv2 for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
4130908
arm64: dt: OP-TEE for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
5ca01d0
arm64: dt: OP-TEE for Juno **not for mainline**
jenswi-linaro Mar 29, 2016
a92b7fa
arm64: dt: Add no-map to the reserved-memory node for OP-TEE for foun…
jenswi-linaro Dec 2, 2016
3186541
include/linux/arm-smccc.h: avoid sign extension problem
jenswi-linaro May 24, 2016
bbfaaeb
tee: new ioctl to a register tee_shm from a dmabuf file descriptor
etienne-lms Oct 27, 2016
3b7c6c4
arm64: dt: Add no-map to the reserved-memory node for OP-TEE for juno…
jenswi-linaro Jan 3, 2017
e38b591
arm64: dt: Add OP-TEE firmware to mt8173 **not for mainline**
jbech-linaro Mar 24, 2016
962de97
tee: add tee_param_is_memref() for driver use
jenswi-linaro Dec 23, 2016
4cc5bc1
tee: add TEE_IOCTL_PARAM_ATTR_META
jenswi-linaro Dec 23, 2016
abe2d0c
optee: support asynchronous supplicant requests
jenswi-linaro Dec 23, 2016
e8c8bf8
OP-TEE Benchmark **not for mainline**
Oct 25, 2016
ed6ea82
tee: optee: optee_bench.h: remove useless include **not for mainline**
jforissier May 31, 2017
cef44f4
staging/ion: add Allwinner ION "secure" heap
etienne-lms Aug 14, 2017
60fd760
ion: "unmapped" heap for secure data path
etienne-lms Aug 14, 2017
9a5d477
staging/ion: condition unmapped heap to supported architectures
etienne-lms Sep 8, 2017
b5d85ec
staging/ion: ARM64 supports ION_UNMAPPED_HEAP
etienne-lms Sep 14, 2017
76b0502
[NEW SHM]tee: flexible shared memory pool creation
jenswi-linaro Jul 19, 2017
db3638f
[NEW SHM]tee: add register user memory
jenswi-linaro Oct 20, 2016
3a0188b
[NEW SHM]tee: shm: add accessors for buffer size and page offset
lorc Nov 29, 2016
18156eb
[NEW SHM]tee: shm: add page accessor functions
lorc Apr 5, 2017
68f26e3
[NEW SHM]tee: optee: Update protocol definitions
lorc Jul 20, 2017
0e11802
[NEW SHM]tee: optee: add page list manipulation functions
lorc Jul 20, 2017
91fa8f2
[NEW SHM]tee: optee: add shared buffer registration functions
lorc Jul 21, 2017
8d3d56e
[NEW SHM]tee: optee: add registered shared parameters handling
lorc Jul 21, 2017
76aa312
[NEW SHM]tee: optee: add registered buffers handling into RPC calls
lorc Jul 21, 2017
a7ea6e4
[NEW SHM]tee: optee: store OP-TEE capabilities in private data
lorc Jul 21, 2017
df88368
[NEW SHM]tee: optee: add optee-specific shared pool implementation
lorc Jul 21, 2017
3ca9562
[NEW SHM]tee: optee: enable dynamic SHM support
lorc Jul 21, 2017
8862a5d
[NEW SHM]tee: use reference counting for tee_context
lorc Jul 24, 2017
c7f82a0
[NEW SHM]tee: shm: inline tee_shm getter functions
lorc Aug 25, 2017
7e7a654
optee: remove registered shm argument size check
lorc Oct 9, 2017
6e954e2
staging:ion: add a no-map property to ion dmabuf attachment
etienne-lms Oct 9, 2017
eae92bd
tee: optee: GET_OS_REVISION: document a2 as a build identifier
jforissier Nov 20, 2017
3a701ec
tee: optee: report OP-TEE revision information
jforissier Nov 20, 2017
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
10 changes: 5 additions & 5 deletions arch/arm64/boot/dts/arm/foundation-v8.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
#include "foundation-v8.dtsi"

/ {
gic: interrupt-controller@2c001000 {
gic: interrupt-controller@2f000000 {
compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
#interrupt-cells = <3>;
#address-cells = <2>;
interrupt-controller;
reg = <0x0 0x2c001000 0 0x1000>,
<0x0 0x2c002000 0 0x2000>,
<0x0 0x2c004000 0 0x2000>,
<0x0 0x2c006000 0 0x2000>;
reg = <0x0 0x2f000000 0 0x10000>,
<0x0 0x2c000000 0 0x2000>,
<0x0 0x2c010000 0 0x2000>,
<0x0 0x2c02F000 0 0x2000>;
interrupts = <1 9 0xf04>;
};
};
49 changes: 32 additions & 17 deletions arch/arm64/boot/dts/arm/foundation-v8.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@

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

psci {
compatible = "arm,psci";
method = "smc";
cpu_suspend = <0xc4000001>;
cpu_off = <0x84000002>;
cpu_on = <0xc4000003>;
};


cpus {
#address-cells = <2>;
#size-cells = <0>;
Expand All @@ -32,32 +40,28 @@
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x0>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x1>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};
cpu@2 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x2>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};
cpu@3 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x3>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};

Expand All @@ -72,6 +76,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 = <1 13 0xf08>,
Expand Down Expand Up @@ -202,14 +217,6 @@
clock-names = "uartclk", "apb_pclk";
};

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

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

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

};
20 changes: 20 additions & 0 deletions arch/arm64/boot/dts/arm/juno-base.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,19 @@
<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;
};
};


smb@8000000 {
compatible = "simple-bus";
#address-cells = <2>;
Expand Down Expand Up @@ -738,4 +751,11 @@
interrupt-map-mask = <0 0>;
interrupt-map = <0 0 &gic 0 0 0 168 IRQ_TYPE_LEVEL_HIGH>;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};
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 @@ -68,6 +68,13 @@
gpio = <&pio 9 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

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

&cec {
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 @@ -339,15 +339,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
32 changes: 32 additions & 0 deletions drivers/staging/android/ion/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,35 @@ config ION_CMA_HEAP
Choose this option to enable CMA heaps with Ion. This heap is backed
by the Contiguous Memory Allocator (CMA). If your system has these
regions, you should say Y here.

config ION_UNMAPPED_HEAP
bool "ION unmapped heap support"
depends on ION && (ARM || ARM64)
help
Choose this option to enable UNMAPPED heaps with Ion. This heap is
backed in specific memory pools, carveout from the Linux memory.
Unless you know your system has these regions, you should say N here.

config ION_DUMMY_UNMAPPED_HEAP
bool "ION dummy driver define an ION unmapped heap"
depends on ION_UNMAPPED_HEAP
help
Dummy ION driver will create a unmapped heap from physical
location provided through CONFIG_ION_DUMMY_UNMAPPED_BASE and
CONFIG_ION_DUMMY_UNMAPPED_SIZE.

config ION_DUMMY_UNMAPPED_BASE
hex "Physical base address of the ION unmapped heap"
depends on ION_DUMMY_UNMAPPED_HEAP
default 0
help
Allows one the statically define an unmapped heap from the
ION dummy driver to exercice unamped heaps buffer managment.

config ION_DUMMY_UNMAPPED_SIZE
hex "Physical byte size of the ION unmapped heap"
depends on ION_DUMMY_UNMAPPED_HEAP
default 0
help
Allows one the statically define an unmapped heap from the
ION dummy driver to exercice unamped heaps buffer managment.
1 change: 1 addition & 0 deletions drivers/staging/android/ion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o
obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o
obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o
obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o
obj-$(CONFIG_ION_UNMAPPED_HEAP) += ion_unmapped_heap.o
12 changes: 12 additions & 0 deletions drivers/staging/android/ion/ion.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ struct ion_dma_buf_attachment {
struct device *dev;
struct sg_table *table;
struct list_head list;
bool no_map;
};

static int ion_dma_buf_attach(struct dma_buf *dmabuf, struct device *dev,
Expand All @@ -237,6 +238,9 @@ static int ion_dma_buf_attach(struct dma_buf *dmabuf, struct device *dev,
return -ENOMEM;
}

if (buffer->heap->type == ION_HEAP_TYPE_UNMAPPED)
a->no_map = true;

a->table = table;
a->dev = dev;
INIT_LIST_HEAD(&a->list);
Expand Down Expand Up @@ -274,6 +278,9 @@ static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment,

table = a->table;

if (a->no_map)
return table;

if (!dma_map_sg(attachment->dev, table->sgl, table->nents,
direction)){
ret = -ENOMEM;
Expand All @@ -290,6 +297,11 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment,
struct sg_table *table,
enum dma_data_direction direction)
{
struct ion_dma_buf_attachment *a = attachment->priv;

if (a->no_map)
return;

dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction);
}

Expand Down
Loading