Skip to content

Commit 8937a29

Browse files
committed
drivers: gud: Exynos7870 MobiCore Driver
* Experimental * Minor changes , mainly secure_os booster Signed-off-by: Anan Jaser <ananjaser@gmail.com>
1 parent adae6dc commit 8937a29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+399
-13469
lines changed

drivers/gud/Kconfig

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
# Mobicore Configuration
33
#
44

5-
config SOC_EXYNOS8890_KINIBI311
6-
bool "Enable kinibi311"
7-
default n
8-
9-
10-
if SOC_EXYNOS8890 && SOC_EXYNOS8890_KINIBI311
11-
source "drivers/gud/gud-exynos8890_kinibi311/Kconfig"
12-
source "drivers/gud/TlcTui/Kconfig"
13-
endif
14-
15-
if SOC_EXYNOS8890 && !SOC_EXYNOS8890_KINIBI311
5+
if SOC_EXYNOS8890
166
source "drivers/gud/gud-exynos8890/Kconfig"
17-
source "drivers/gud/TlcTui/Kconfig"
187
endif

drivers/gud/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
ifeq ($(CONFIG_SOC_EXYNOS8890_KINIBI311), y)
2-
obj-$(CONFIG_SOC_EXYNOS8890_KINIBI311) += gud-exynos8890_kinibi311/
3-
obj-$(CONFIG_TRUSTONIC_TRUSTED_UI) += TlcTui/
4-
else ifeq ($(CONFIG_SOC_EXYNOS8890), y)
51
obj-$(CONFIG_SOC_EXYNOS8890) += gud-exynos8890/
6-
obj-$(CONFIG_TRUSTONIC_TRUSTED_UI) += TlcTui/
7-
endif
2+

drivers/gud/TlcTui/Makefile

Lines changed: 0 additions & 51 deletions
This file was deleted.

drivers/gud/TlcTui/build_tag.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

drivers/gud/gud-exynos8890/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ config TRUSTONIC_TRUSTED_UI
3131

3232
config TRUSTONIC_TRUSTED_UI_FB_BLANK
3333
bool "Trustonic Trusted UI with fb_blank"
34+
default y
3435
depends on TRUSTONIC_TRUSTED_UI
3536
---help---
3637
Blank the framebuffer before starting a TUI session
3738

39+
config TRUSTED_UI_TOUCH_ENABLE
40+
bool "TBase Trusted UI use touch related code"
41+
default y
42+
depends on TRUSTONIC_TRUSTED_UI
43+
3844
source "drivers/gud/gud-exynos8890/sec-os-ctrl/Kconfig"
3945
source "drivers/gud/gud-exynos8890/sec-os-booster/Kconfig"

drivers/gud/gud-exynos8890/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
obj-$(CONFIG_TRUSTONIC_TEE) := MobiCoreDriver/
6-
#obj-$(CONFIG_TRUSTONIC_TRUSTED_UI) += TlcTui/
6+
obj-$(CONFIG_TRUSTONIC_TRUSTED_UI) += TlcTui/
77

88
obj-$(CONFIG_SECURE_OS_CONTROL) += sec-os-ctrl/
99
obj-$(CONFIG_SECURE_OS_BOOSTER_API) += sec-os-booster/

drivers/gud/gud-exynos8890/MobiCoreDriver/admin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,10 @@ static void mc_admin_sendcrashdump(void)
496496
{
497497
int ret = 0;
498498

499+
/* ExySp: to be updated in official release */
500+
/* Prevent daemon reconnection */
501+
admin_ctx.last_start_ret = -EHOSTUNREACH;
502+
499503
/* Lock communication channel */
500504
channel_lock();
501505

drivers/gud/gud-exynos8890/MobiCoreDriver/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2015 TRUSTONIC LIMITED
2+
* Copyright (c) 2013-2017 TRUSTONIC LIMITED
33
* All Rights Reserved.
44
*
55
* This program is free software; you can redistribute it and/or

drivers/gud/gud-exynos8890/MobiCoreDriver/fastcall.c

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2015 TRUSTONIC LIMITED
2+
* Copyright (c) 2013-2017 TRUSTONIC LIMITED
33
* All Rights Reserved.
44
*
55
* This program is free software; you can redistribute it and/or
@@ -37,10 +37,6 @@
3737
#include "clock.h" /* mc_clock_enable, mc_clock_disable */
3838
#include "fastcall.h"
3939

40-
#ifdef CONFIG_RKP_CFP_FIX_SMC_BUG
41-
#include <linux/rkp_cfp.h>
42-
#endif
43-
4440
/* ExySp: Lock for core switch processing */
4541
#ifdef CONFIG_SECURE_OS_BOOSTER_API
4642
struct mutex core_switch_lock;
@@ -52,7 +48,7 @@ int __mc_switch_core(int cpu);
5248
#endif
5349

5450
#if KERNEL_VERSION(3, 15, 0) > LINUX_VERSION_CODE
55-
#define MIN_NICE -20
51+
#define MIN_NICE -20
5652
#endif
5753

5854
struct fastcall_work {
@@ -178,13 +174,7 @@ static inline int _smc(union mc_fc_generic *mc_fc_generic)
178174
* the asm code might clobber them.
179175
*/
180176
__asm__ volatile (
181-
#ifdef CONFIG_RKP_CFP_FIX_SMC_BUG
182-
PRE_SMC_INLINE
183-
#endif
184177
"smc #0\n"
185-
#ifdef CONFIG_RKP_CFP_FIX_SMC_BUG
186-
POST_SMC_INLINE
187-
#endif
188178
: "+r"(reg0), "+r"(reg1), "+r"(reg2), "+r"(reg3)
189179
:
190180
: "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11",
@@ -205,13 +195,7 @@ static inline int _smc(union mc_fc_generic *mc_fc_generic)
205195
*/
206196
".arch_extension sec\n"
207197
#endif /* MC_ARCH_EXTENSION_SEC */
208-
#ifdef CONFIG_RKP_CFP_FIX_SMC_BUG
209-
PRE_SMC_INLINE
210-
#endif
211198
"smc #0\n"
212-
#ifdef CONFIG_RKP_CFP_FIX_SMC_BUG
213-
POST_SMC_INLINE
214-
#endif
215199
: "+r"(reg0), "+r"(reg1), "+r"(reg2), "+r"(reg3)
216200
);
217201

@@ -323,7 +307,7 @@ static int mobicore_cpu_callback(struct notifier_block *nfb,
323307
unsigned long action, void *hcpu)
324308
{
325309
int cpu = (int)(uintptr_t)hcpu;
326-
310+
327311
switch (action) {
328312
#ifdef CONFIG_SECURE_OS_BOOSTER_API
329313
/* ExySp: for sos performance */
@@ -444,7 +428,6 @@ static void fastcall_work_func(struct work_struct *work)
444428
}
445429
#endif
446430
_smc(mc_fc_generic);
447-
448431
/* ExySp: for sos performance */
449432
#ifdef CONFIG_SECURE_OS_BOOSTER_API
450433
if (irq_check_cnt) {
@@ -509,7 +492,7 @@ int mc_fastcall_init(void)
509492
mc_dev_err("cannot create fastcall wq: %d\n", ret);
510493
return ret;
511494
}
512-
495+
513496
set_user_nice(fastcall_thread, MIN_NICE);
514497

515498
/* this thread MUST run on CPU 0 at startup */
@@ -749,16 +732,16 @@ int mc_switch_core(int cpu)
749732
#ifdef CONFIG_SECURE_OS_BOOSTER_API
750733
int mc_switch_core(int cpu)
751734
{
752-
int ret;
753-
mutex_lock(&core_switch_lock);
754-
if (!(core_status & (0x1 << cpu))){
755-
mc_dev_devel("Core status... core #%d is off line\n", cpu);
756-
mutex_unlock(&core_switch_lock);
757-
return 1;
758-
}
759-
ret = __mc_switch_core(cpu);
760-
mutex_unlock(&core_switch_lock);
761-
return ret;
735+
int ret;
736+
mutex_lock(&core_switch_lock);
737+
if (!(core_status & (0x1 << cpu))){
738+
mc_dev_devel("Core status... core #%d is off line\n", cpu);
739+
mutex_unlock(&core_switch_lock);
740+
return 1;
741+
}
742+
ret = __mc_switch_core(cpu);
743+
mutex_unlock(&core_switch_lock);
744+
return ret;
762745
}
763746
#endif
764747
#endif

drivers/gud/gud-exynos8890/MobiCoreDriver/main.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ static inline void kasnprintf_buf_reset(struct kasnprintf_buf *buf)
121121
}
122122

123123
ssize_t debug_generic_read(struct file *file, char __user *user_buf,
124-
size_t count, loff_t *ppos,
125-
int (*function)(struct kasnprintf_buf *buf))
124+
size_t count, loff_t *ppos,
125+
int (*function)(struct kasnprintf_buf *buf))
126126
{
127127
struct kasnprintf_buf *buf = file->private_data;
128128
int ret = 0;
@@ -132,19 +132,19 @@ ssize_t debug_generic_read(struct file *file, char __user *user_buf,
132132
if (!*ppos) {
133133
kasnprintf_buf_reset(buf);
134134
ret = function(buf);
135-
if (ret < 0) {
135+
if (ret < 0) {
136136
kasnprintf_buf_reset(buf);
137137
goto end;
138138
}
139-
}
139+
}
140140

141141
ret = simple_read_from_buffer(user_buf, count, ppos, buf->buf,
142142
buf->off);
143143

144144
end:
145145
mutex_unlock(&buf->mutex);
146146
return ret;
147-
}
147+
}
148148

149149
int debug_generic_open(struct inode *inode, struct file *file)
150150
{
@@ -655,9 +655,9 @@ static int mobicore_probe(struct platform_device *pdev)
655655
}
656656

657657
/*
658-
* Create admin dev so that daemon can already communicate with
659-
* the driver
660-
*/
658+
* Create admin dev so that daemon can already communicate with
659+
* the driver
660+
*/
661661
err = device_admin_init();
662662
if (err)
663663
goto fail_creat_dev_admin;
@@ -674,7 +674,7 @@ static int mobicore_probe(struct platform_device *pdev)
674674
*/
675675
mc_switch_core(NONBOOT_LITTLE_CORE);
676676

677-
return 0;
677+
return 0;
678678

679679
fail_start:
680680
device_admin_exit();

0 commit comments

Comments
 (0)