Update source to Armbian-dev-202610.A311Y3
This commit is contained in:
@@ -250,7 +250,7 @@ static int tee_msg_os_revision(u32 *major, u32 *minor)
|
||||
union {
|
||||
struct arm_smccc_res smccc;
|
||||
struct tee_smc_calls_revision_result result;
|
||||
} res;
|
||||
} res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_CALL_GET_OS_REVISION,
|
||||
0, 0, 0, 0, 0, 0, 0, &res.smccc);
|
||||
@@ -303,8 +303,9 @@ static int tee_get_sys_info(char *buf)
|
||||
|
||||
for (i = 0; i < param[0].u.memref.size / sizeof(struct tee_sys_info); i++) {
|
||||
sys_info = (struct tee_sys_info *)shm_data;
|
||||
sprintf(buf + buf_offs, "%-55s | %s\n", sys_info->module, sys_info->status);
|
||||
buf_offs = strlen(buf);
|
||||
// after kernel 5.10 for sysfs show
|
||||
buf_offs += sysfs_emit_at(buf, buf_offs,
|
||||
"%-55s | %s\n", sys_info->module, sys_info->status);
|
||||
shm_data += sizeof(struct tee_sys_info);
|
||||
}
|
||||
}
|
||||
@@ -377,7 +378,7 @@ static int tee_msg_api_revision(u32 *major, u32 *minor)
|
||||
union {
|
||||
struct arm_smccc_res smccc;
|
||||
struct tee_smc_calls_revision_result result;
|
||||
} res;
|
||||
} res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_CALLS_REVISION,
|
||||
0, 0, 0, 0, 0, 0, 0, &res.smccc);
|
||||
@@ -389,7 +390,7 @@ static int tee_msg_api_revision(u32 *major, u32 *minor)
|
||||
|
||||
static int tee_set_sys_boot_complete(void)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
static int inited;
|
||||
|
||||
res.a0 = 0;
|
||||
@@ -407,7 +408,7 @@ static int tee_set_sys_boot_complete(void)
|
||||
|
||||
static int tee_get_sys_boot_complete(void)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
res.a0 = 0;
|
||||
|
||||
@@ -421,14 +422,15 @@ static ssize_t os_version_show(const struct class *class,
|
||||
const struct class_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int ret;
|
||||
u32 major, minor;
|
||||
int ret = 0;
|
||||
u32 major = 0, minor = 0;
|
||||
|
||||
ret = tee_msg_os_revision(&major, &minor);
|
||||
if (ret)
|
||||
return 0;
|
||||
|
||||
ret = sprintf(buf, "os version: V%d.%d\n", major, minor);
|
||||
// after kernel 5.10 for sysfs show
|
||||
ret = sysfs_emit(buf, "os version: V%d.%d\n", major, minor);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -437,7 +439,7 @@ static ssize_t sys_info_show(const struct class *class,
|
||||
const struct class_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
ret = tee_get_sys_info(buf);
|
||||
if (ret)
|
||||
@@ -451,14 +453,15 @@ static ssize_t api_version_show(const struct class *class,
|
||||
const struct class_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int ret;
|
||||
u32 major, minor;
|
||||
int ret = 0;
|
||||
u32 major = 0, minor = 0;
|
||||
|
||||
ret = tee_msg_api_revision(&major, &minor);
|
||||
if (ret)
|
||||
return 0;
|
||||
|
||||
ret = sprintf(buf, "api version: V%d.%d\n", major, minor);
|
||||
// after kernel 5.10 for sysfs show
|
||||
ret = sysfs_emit(buf, "api version: V%d.%d\n", major, minor);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -469,7 +472,8 @@ static ssize_t log_mode_show(const struct class *class,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = sprintf(buf, " 0:uart\n 1:kmsg\n");
|
||||
// after kernel 5.10 for sysfs show
|
||||
ret = sysfs_emit(buf, " 0:uart\n 1:kmsg\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -480,7 +484,8 @@ static ssize_t log_level_show(const struct class *class,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = sprintf(buf, " 0:NO LOG\n 1:ERROR\n 2:INFO\n 3:DEBUG\n 4:FLOW\n");
|
||||
// after kernel 5.10 for sysfs show
|
||||
ret = sysfs_emit(buf, " 0:NO LOG\n 1:ERROR\n 2:INFO\n 3:DEBUG\n 4:FLOW\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -495,10 +500,11 @@ static ssize_t sys_boot_complete_show(const struct class *class,
|
||||
* return 0xFFFFFFFF means BL32 is not supported tee_get_sys_boot_complete
|
||||
*/
|
||||
ret = tee_get_sys_boot_complete();
|
||||
// after kernel 5.10 for sysfs show
|
||||
if (ret == 1)
|
||||
ret = sprintf(buf, "1\n");
|
||||
ret = sysfs_emit(buf, "1\n");
|
||||
else
|
||||
ret = sprintf(buf, "0\n");
|
||||
ret = sysfs_emit(buf, "0\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -510,13 +516,15 @@ static ssize_t modules_log_level_show(const struct class *class,
|
||||
int ret = 0;
|
||||
int trace_level = 0;
|
||||
int i = 0;
|
||||
u32 len = 0;
|
||||
|
||||
for (i = 0; i < MODULE_ID_MAX; i++) {
|
||||
tee_get_trace_ext_level(i, &trace_level);
|
||||
sprintf(buf + strlen(buf), "%-55s | %d\n", tee_module_name[i], trace_level);
|
||||
// after kernel 5.10 for sysfs show
|
||||
len += sysfs_emit_at(buf, len, "%-55s | %d\n", tee_module_name[i], trace_level);
|
||||
}
|
||||
|
||||
ret = strlen(buf);
|
||||
ret = len;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -524,7 +532,7 @@ static ssize_t sys_boot_complete_store(const struct class *class,
|
||||
const struct class_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
bool val;
|
||||
bool val = 0;
|
||||
int ret = 0;
|
||||
|
||||
if (kstrtobool(buf, &val))
|
||||
@@ -543,7 +551,7 @@ static ssize_t log_mode_store(const struct class *class,
|
||||
const struct class_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
int val = 0;
|
||||
|
||||
if (memcmp(buf, "1", 1) == 0)
|
||||
@@ -570,7 +578,7 @@ static ssize_t log_level_store(const struct class *class,
|
||||
const struct class_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
int val = 0;
|
||||
|
||||
res.a0 = 0;
|
||||
@@ -621,9 +629,29 @@ static CLASS_ATTR_RW(modules_log_level);
|
||||
* index: firmware index
|
||||
* vdec: vdec type(0: compatible, 1: legency vdec, 2: HEVC vdec)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PREEMPT_RT
|
||||
int tee_query_fw_addrs(u32 index, u32 vdec, u32 is_swap, unsigned long *addr)
|
||||
{
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
if (!addr)
|
||||
return -EINVAL;
|
||||
|
||||
arm_smccc_smc(TEE_SMC_LOAD_VIDEO_FW,
|
||||
index, vdec, is_swap, 0, 0, 0, 0, &res);
|
||||
|
||||
addr[0] = res.a1;
|
||||
addr[1] = res.a2;
|
||||
|
||||
return res.a0;
|
||||
}
|
||||
EXPORT_SYMBOL(tee_query_fw_addrs);
|
||||
#endif
|
||||
|
||||
static int tee_load_firmware(u32 index, u32 vdec, bool is_swap)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_LOAD_VIDEO_FW,
|
||||
index, vdec, is_swap, 0, 0, 0, 0, &res);
|
||||
@@ -645,7 +673,7 @@ EXPORT_SYMBOL(tee_load_video_fw_swap);
|
||||
|
||||
bool tee_enabled(void)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
if (disable_flag == 1)
|
||||
return false;
|
||||
@@ -833,7 +861,7 @@ EXPORT_SYMBOL(tee_register_mem);
|
||||
|
||||
int tee_config_device_state(int dev_id, int secure)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_CONFIG_DEVICE_SECURE,
|
||||
dev_id, secure, 0, 0, 0, 0, 0, &res);
|
||||
@@ -844,7 +872,7 @@ EXPORT_SYMBOL(tee_config_device_state);
|
||||
|
||||
int tee_config_device_state_lock(int dev_id, int secure)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
mutex_lock(&tee_config_mutex);
|
||||
arm_smccc_smc(TEE_SMC_CONFIG_DEVICE_SECURE,
|
||||
@@ -857,7 +885,7 @@ EXPORT_SYMBOL(tee_config_device_state_lock);
|
||||
|
||||
void tee_demux_config_pipeline(int tsn_in, int tsn_out)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_DEMUX_CONFIG_PIPELINE,
|
||||
tsn_in, tsn_out, 0, 0, 0, 0, 0, &res);
|
||||
@@ -866,7 +894,7 @@ EXPORT_SYMBOL(tee_demux_config_pipeline);
|
||||
|
||||
int tee_demux_config_pad(int reg, int val)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_DEMUX_CONFIG_PAD,
|
||||
reg, val, 0, 0, 0, 0, 0, &res);
|
||||
@@ -877,7 +905,7 @@ EXPORT_SYMBOL(tee_demux_config_pad);
|
||||
|
||||
int tee_read_reg_bits(u32 reg, u32 *val, u32 offset, u32 length)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_READ_REG,
|
||||
reg, 0, offset, length, 0, 0, 0, &res);
|
||||
@@ -890,7 +918,7 @@ EXPORT_SYMBOL(tee_read_reg_bits);
|
||||
|
||||
int tee_write_reg_bits(u32 reg, u32 val, u32 offset, u32 length)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_WRITE_REG,
|
||||
reg, val, offset, length, 0, 0, 0, &res);
|
||||
@@ -902,7 +930,7 @@ EXPORT_SYMBOL(tee_write_reg_bits);
|
||||
int tee_vp9_prob_process(u32 cur_frame_type, u32 prev_frame_type,
|
||||
u32 prob_status, u32 prob_addr)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_VP9_PROB_PROCESS,
|
||||
cur_frame_type, prev_frame_type, prob_status,
|
||||
@@ -914,7 +942,7 @@ EXPORT_SYMBOL(tee_vp9_prob_process);
|
||||
|
||||
int tee_vp9_prob_malloc(u32 *prob_addr)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
if (!prob_addr)
|
||||
return 0xFFFF0006;
|
||||
@@ -930,7 +958,7 @@ EXPORT_SYMBOL(tee_vp9_prob_malloc);
|
||||
|
||||
int tee_vp9_prob_free(u32 prob_addr)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
arm_smccc_smc(TEE_SMC_VP9_PROB_FREE,
|
||||
prob_addr, 0, 0, 0, 0, 0, 0, &res);
|
||||
@@ -1084,7 +1112,7 @@ EXPORT_SYMBOL(tee_sectbl_secmem_set);
|
||||
|
||||
int tee_create_sysfs(void)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
tee_sys_class = class_create(DRIVER_NAME);
|
||||
ret = class_create_file(tee_sys_class, &class_attr_os_version);
|
||||
|
||||
@@ -33,7 +33,7 @@ static int get_share_memory(void)
|
||||
|
||||
int tee_demux_set(enum tee_dmx_cmd cmd, void *data, u32 len)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
if (!data || !len || get_share_memory())
|
||||
return -1;
|
||||
@@ -50,7 +50,7 @@ EXPORT_SYMBOL(tee_demux_set);
|
||||
int tee_demux_get(enum tee_dmx_cmd cmd,
|
||||
void *in, u32 in_len, void *out, u32 out_len)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
struct arm_smccc_res res = { 0 };
|
||||
|
||||
if (!out || !out_len || get_share_memory())
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user