GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_optee.git
3 days agoAllow g12b to opt-out of using this lineage-20 lineage-21
Nolen Johnson [Mon, 22 Apr 2024 23:59:57 +0000 (19:59 -0400)]
Allow g12b to opt-out of using this

Change-Id: I551f9d57e4911b0db2c73f2b862f5d52b54357bf

6 months agooptee: Strip modules using llvm-strip
Bruno Martins [Fri, 20 Oct 2023 23:24:58 +0000 (00:24 +0100)]
optee: Strip modules using llvm-strip

With this, the GCC dependency is gone for good.

Change-Id: I5f08e4f32ea223f39aaee9e762f3c825c82e5d41

8 months agoamlogic: Add 5.4 socs to guard
Vitaliy Tomin [Tue, 1 Aug 2023 04:24:03 +0000 (12:24 +0800)]
amlogic: Add 5.4 socs to guard

* optee module code is same for 4.9 and 5.4

Change-Id: Ic1cd96a047b70f662cd7bb3c570bf351f4842deb

14 months agoamlogic: Compile kernel modules with clang
Christian Hoffmann [Sat, 11 Feb 2023 10:54:17 +0000 (11:54 +0100)]
amlogic: Compile kernel modules with clang

Change-Id: I0b17a4a893412f0f68bdf9600a0caa6ead660b55

16 months agoGuard for g12a, g12b and sm1 SOCs
Vitaliy Tomin [Sun, 29 May 2022 18:52:00 +0000 (14:52 -0400)]
Guard for g12a, g12b and sm1 SOCs

Change-Id: Ic900996019110fe5f05c9865efe04950eac8ae80

16 months agoReplace android makefile with one to build modules inline
Aaron Kling [Thu, 24 Jun 2021 20:41:13 +0000 (15:41 -0500)]
Replace android makefile with one to build modules inline

Change-Id: I3ed6ce47161f6fb28aeb1581c65463f94ccfb6b4

22 months agoGuard for g12a, g12b and sm1 SOCs lineage-19.1 staging/lineage-20
Vitaliy Tomin [Sun, 29 May 2022 18:52:00 +0000 (14:52 -0400)]
Guard for g12a, g12b and sm1 SOCs

Change-Id: Ic900996019110fe5f05c9865efe04950eac8ae80

23 months agoFix private modules install path
Hongguang [Tue, 24 May 2022 02:23:36 +0000 (19:23 -0700)]
Fix private modules install path

Bug: 220644706
Test: make and find the private modules in dist.
Change-Id: I25d123128fab6a0a3bfcf73de1aadd19a69d1f7a

23 months agoInstall private modules into private/modules
Hongguang [Tue, 24 May 2022 01:20:21 +0000 (18:20 -0700)]
Install private modules into private/modules

Bug: 220644706
Test: make and find the private modules in dist.
Change-Id: I7be1f94d02a57f6206afd42f2b6801c3be0e641d

23 months agoPrivate modules should be installed into private
Hongguang [Mon, 23 May 2022 23:17:34 +0000 (16:17 -0700)]
Private modules should be installed into private

Bug: 220644706
Test: make and find the private modules in dist.
Change-Id: Ic5528b95b81205062b267885e0bb2be8f842d893

2 years agoReplace android makefile with one to build modules inline
Aaron Kling [Thu, 24 Jun 2021 20:41:13 +0000 (15:41 -0500)]
Replace android makefile with one to build modules inline

Change-Id: I3ed6ce47161f6fb28aeb1581c65463f94ccfb6b4

2 years agoReplace android makefile with one to build modules inline lineage-18.1
Aaron Kling [Thu, 24 Jun 2021 20:41:13 +0000 (15:41 -0500)]
Replace android makefile with one to build modules inline

Change-Id: I3ed6ce47161f6fb28aeb1581c65463f94ccfb6b4

2 years agoadt3-S optee_linuxdriver source code [1/1]
Liang Ji [Tue, 15 Jun 2021 04:47:49 +0000 (12:47 +0800)]
adt3-S optee_linuxdriver source code [1/1]

internal tot CL:

optee: remove registered shm argument size check

RSP-1789

We don't need to return error if output shm size is larger than
allocated buffer. This is pefrectly fine. In this way TEE or TA
reports that it needs larger buffer (as described in
TEE Client API Specification v1.0, section 3.2.5.).

Change-Id(I41627f02f94a76a6e4fb70f7f6a96111297bba8f)
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Pengguang Zhu <pengguang.zhu@amlogic.com>
Signed-off-by: Liang Ji <liang.ji@amlogic.com>
Change-Id: I0cc82536ba403403cd3c98ef0c177f09b62df280

3 years agooptee: change vmx-socket API from socket to ioctl [2/2]
Liqiang Jin [Thu, 14 Jan 2021 14:43:18 +0000 (22:43 +0800)]
optee: change vmx-socket API from socket to ioctl [2/2]

PD#SWPL-40058

Problem:
selinux blocks the socket

Solution:
change vmx-socket API from socket to ioctl

Verify:
Android Q + AH212(SC2)

Change-Id: If3dcc92b1a7dc50776406c2438e2dcdf213c397e
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
3 years agooptee_driver: fix compile error on buildroot [1/1]
Pengguang Zhu [Wed, 2 Dec 2020 07:21:03 +0000 (15:21 +0800)]
optee_driver: fix compile error on buildroot [1/1]

PD#SWPL-36509

Problem:
compile fail on buildroot

Solution:
fix compile error on buildroot

Verify:
Android Q/R + AH212

Change-Id: I8c969b64090c0119961a837cbdc769a8e2763951
Signed-off-by: Pengguang Zhu <pengguang.zhu@amlogic.com>
3 years agooptee_driver: support standalone build for R [5/6]
Pengguang Zhu [Fri, 27 Nov 2020 03:02:01 +0000 (11:02 +0800)]
optee_driver: support standalone build for R [5/6]

PD#SWPL-36509

Problem:
need to support modules standalone build

Solution:
support modules standalone build

Verify:
Android Q/R + AH212

Change-Id: I37217f5c83cf88409443cbbb36c6e0dba7a957e5
Signed-off-by: Pengguang Zhu <pengguang.zhu@amlogic.com>
3 years agolinuxdriver: add Watermark flush mechanism [2/2]
Liqiang Jin [Mon, 9 Nov 2020 08:12:51 +0000 (16:12 +0800)]
linuxdriver: add Watermark flush mechanism [2/2]

PD#SWPL-36395

Problem:
1) if Verimatrix Watermark enable, OSD flicker when the TV station changes
2) if screen resolution changes, NexGuard Watermark display is abnormal

Solution:
add Watermark flush mechanism

Verify:
Android Q + AH212(SC2)

Change-Id: I096ecf01eca522cb3b6c2f943cd57ab813eb92ed
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
3 years agolinuxdriver: support dump tee log [1/1]
Pengguang Zhu [Wed, 24 Jun 2020 03:06:38 +0000 (11:06 +0800)]
linuxdriver: support dump tee log [1/1]

PD#TV-20362

Problem:
Save the key information like fatal error
to buffer when OPTEE process crash

Solution:
add sysfs node to dump the log buffer

Verify:
Android Q + franklin

Change-Id: I4b292a07034ee424911a14f86a885890d21e7be4
Signed-off-by: Pengguang Zhu <pengguang.zhu@amlogic.com>
3 years agolinuxdriver: update tdk linux driver path [1/1]
Hangyu Li [Wed, 27 May 2020 07:18:35 +0000 (15:18 +0800)]
linuxdriver: update tdk linux driver path [1/1]

PD#SWPL-20734

Problem:
need move tdk linuxdriver from common/tdk/linuxdriver
to common/tdk_linuxdriver

Solution:
move common/tdk/linuxdriver
to common/tdk_linuxdriver, update Android.mk
to pass compile

Verify:
Android Q + franklin

Change-Id: I30c87dc4776e2f6f0a78f5aa97e827eb578250fd
Signed-off-by: Hangyu Li <hangyu.li@amlogic.com>
4 years agotimer: support TEE timer callback [2/2]
Liqiang Jin [Mon, 28 Oct 2019 10:16:32 +0000 (18:16 +0800)]
timer: support TEE timer callback [2/2]

PD#SWPL-1120

Problem:
TEE not support timer callback, but it is required by customer

Solution:
Implement TEE timer

Verify:
Android O + P212

Change-Id: Ic2fea99ce1570d6d6f83bbaa50e801fea4a64c87
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
4 years agooptee: fix uninitialized symbol 'parg' [1/1]
Jens Wiklander [Thu, 22 Aug 2019 05:44:06 +0000 (13:44 +0800)]
optee: fix uninitialized symbol 'parg' [1/1]

PD#SWPL-8608

Problem:
** SYNC FROM linaro **
uninitialized symbol 'parg'.

Solution:
Fixes the static checker warning in optee_release().

Verify:
none

Change-Id: Idd3305534a88e6759d9af54a41dd6c6a931c1848

4 years agobuild: fix uninitialized-use when build with prebuilt toolchain [1/1]
Chia-hung Duan [Wed, 3 Jul 2019 06:47:16 +0000 (14:47 +0800)]
build: fix uninitialized-use when build with prebuilt toolchain [1/1]

PD#SWPL-8241

Problem:
** SYNC FROM GOOGLE **
Build failed due to uninitialzed variable

Solution:
Init to reasonable value

Verify:
Build with Android prebuilt toolchain

Change-Id: I41614aa257d4306efe190539e7a54f9756fcb78c

4 years agolog: kernel4.19 compile error [1/1]
Liqiang Jin [Tue, 23 Jul 2019 10:31:25 +0000 (18:31 +0800)]
log: kernel4.19 compile error [1/1]

PD#SWPL-9652

Problem:
init_timer() function not exist in kernel4.19

Solution:
1) use setup_timer() to init timer in kernel4.9
2) use timer_setup() to init timer in kernel4.19

Verify:
Android P + U200

Change-Id: Ie9e12494a9b16eb6432a01cf8b503bae4c019023
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
4 years agolog: output TEE Errors to KMSG for debugging [2/2]
Liqiang Jin [Tue, 11 Jun 2019 02:14:03 +0000 (10:14 +0800)]
log: output TEE Errors to KMSG for debugging [2/2]

PD#SWPL-9652

Problem:
TEE logs are output to UART and not via kmsg.
Secure OS should support routing TEE logs into kmsg.

Solution:
1) reserve system share-mem as logger mem.
2) add API to support routing TEE logs to REE kmsg.

Verify:
Android P + U200

Change-Id: I7a43827f1d25a2e72ff15082751351bcad7c68f4
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
4 years agoInitial empty repository
Inna Palant [Fri, 21 Jun 2019 20:53:54 +0000 (13:53 -0700)]
Initial empty repository

4 years agotee: integrate tee module build to android build system [1/2]
Shuide Chen [Tue, 28 May 2019 06:06:41 +0000 (14:06 +0800)]
tee: integrate tee module build to android build system [1/2]

PD#SWPL-9058

Problem:
optee module build trigged at scanning Android.mk stage, it's too early
and the module not depend to kernel, which may introduce very strange
errors, and it customize toolchain and configures, which made the system
very hard to maintain.

Solution:
Rewrite the makefile and structure for the above problem
This CL also support build on Q

Verify:
locally

Change-Id: I8d883735d926c54848a4135518e4be139594a147
Signed-off-by: Shuide Chen <shuide.chen@amlogic.com>
4 years agolinuxdriver: update kernel4.9(4.9.113 -> 4.9.180) compile error [1/1]
Liqiang Jin [Mon, 10 Jun 2019 08:55:22 +0000 (16:55 +0800)]
linuxdriver: update kernel4.9(4.9.113 -> 4.9.180) compile error [1/1]

PD#SWPL-8875

Problem:
macro "u64_to_user_ptr(x)" redefinition

Solution:
delete the macro

Verify:
kernel4.19 + arm64
kernel4.19 + arm
kernel4.9 + arm64
kernel4.9 + arm

Change-Id: Ie2549b1bddbc9fd819511a3c6d1b40c21561ccef
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
4 years agolinuxdriver: check supplicant status before send message [1/1]
Pengguang Zhu [Thu, 16 May 2019 06:07:13 +0000 (14:07 +0800)]
linuxdriver: check supplicant status before send message [1/1]

PD#TV-5392

Problem:
when playing netflix movies, press power button, TV can not
power down and console hang.
previous commit will check supplicant status, but there is gap
that thread will scheduled and meanwhile the supplicant status
may change.

Solution:
move the status check before wait_for_completion

Verify:
TXLX + Android P

Change-Id: I445619192a1c6cf047a3fe51f3660dad7aa39601
Signed-off-by: Pengguang Zhu <pengguang.zhu@amlogic.com>
4 years agotee: optee: avoid possible double list_del() [1/1]
Zhizhou Zhang [Wed, 21 Nov 2018 03:01:43 +0000 (11:01 +0800)]
tee: optee: avoid possible double list_del() [1/1]

PD#OTT-3799

Problem:
This bug occurs when:

- a new request arrives, one thread(let's call it A) is pending in
  optee_supp_req() with req->busy is initial value false.

- tee-supplicant is killed, then optee_supp_release() is called, this
  function calls list_del(&req->link), and set supp->ctx to NULL. And
  it also wake up process A.

- process A continues, it firstly checks supp->ctx which is NULL,
  then checks req->busy which is false, at last run list_del(&req->link).
  This triggers double list_del() and results kernel panic.

Solution:
For solve this problem, we rename req->busy to req->in_queue, and
associate it with state of whether req is linked to supp->reqs. So we
can just only check req->in_queue to make decision calling list_del()
or not.

Verify:
Android P + S922X

Change-Id: I14a71d1bda933573c7216774954c08fa3161be6c
Signed-off-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
4 years agolinuxdriver: check supplicant status before send message [1/1]
Pengguang Zhu [Sun, 5 May 2019 09:37:53 +0000 (17:37 +0800)]
linuxdriver: check supplicant status before send message [1/1]

PD#TV-5392

Problem:
when playing netflix movies, press power button, TV can not
power down and console hang.

Solution:
1. check supplicant status before send message

Test: manual - mm

Verify:
TXLX + Android P

Change-Id: Ia4829ba22de97ee06273632f7b824ddfa5909ee4
Signed-off-by: Pengguang Zhu <pengguang.zhu@amlogic.com>
5 years agolinuxdriver: kernel4.19 "struct dma_buf_ops" have changed [1/1]
Liqiang Jin [Wed, 9 Jan 2019 06:44:59 +0000 (14:44 +0800)]
linuxdriver: kernel4.19 "struct dma_buf_ops" have changed [1/1]

PD#SWPL-2814

Problem:
because "struct dma_buf_ops" have changed, so compile failed

Solution:
use "struct dma_buf_ops" according to the kernel version

Verify:
Android P + G12A(U200)

Change-Id: I47573d1cfcdc942e4de2ac2c92938ebc4bc975d9
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
5 years agolinuxdriver: Change the compiled output directory [1/1]
Chao Liu [Mon, 19 Nov 2018 11:36:47 +0000 (19:36 +0800)]
linuxdriver: Change the compiled output directory [1/1]

PD#SWPL-2236

Problem:
optee.mod.c and optee_armtz.mod.c has no license declaration

Solution:
Switch compilation directory to $(PRODUCT_OUT)/obj/optee_modules

Verify:
Verified on U200

Change-Id: I6d370a35a7324a89d949dc41e3c5175648d85975
Signed-off-by: Chao Liu <chao.liu@amlogic.com>
5 years agolinuxdriver: revert g12b binding a53 [1/1]
Chao Liu [Thu, 25 Oct 2018 06:37:56 +0000 (14:37 +0800)]
linuxdriver: revert g12b binding a53 [1/1]

PD#SWPL-981

Problem:
kernel 3.14 compile failed. and these commits are not required

Solution:
revert g12b binging a53
android o tdk commit: f07bf39d83405d29158fe59f7df6e4d5c9a77e43

Verify:
Android O + g12b_skt

Change-Id: Id30f271a8f858f50be5355d8002fe3d0dc95e2dc
Signed-off-by: Chao Liu <chao.liu@amlogic.com>
5 years agoupdate code to the latest commit of the tdk-v2.4 branch of tdk
Chao Liu [Mon, 8 Oct 2018 07:00:36 +0000 (15:00 +0800)]
update code to the latest commit of the tdk-v2.4 branch of tdk

commit: bca0ab730d6e9701730fdc1f3015ccb0abfe60b9

Change-Id: I42b4bcf14c3a2d6be864d7f31564a40cfc8a6f9c
Signed-off-by: Chao Liu <chao.liu@amlogic.com>
5 years agoInitial empty repository
Lei Qian [Fri, 21 Sep 2018 05:52:47 +0000 (13:52 +0800)]
Initial empty repository