From e1ceaadd3bdade6f87c20b06097ee531e736c89d Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Fri, 31 Aug 2018 15:17:44 +0800 Subject: [PATCH] tee: cpuid: change function of getting cpuid for arm32 PD#170391 Change getting cpuid function for 32bit kernel compile. Change-Id: Ibccfc8ab1df599b23555fd14efc63c1d4df07895 Signed-off-by: Yan Wang --- drivers/amlogic/tee/tee.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/tee/tee.c b/drivers/amlogic/tee/tee.c index a9665a5..2d2e224 100644 --- a/drivers/amlogic/tee/tee.c +++ b/drivers/amlogic/tee/tee.c @@ -23,6 +23,7 @@ #include #include #include +#include #define DRIVER_NAME "tee_info" #define DRIVER_DESC "Amlogic tee driver" @@ -77,7 +78,7 @@ static int tee_msg_os_revision(uint32_t *major, uint32_t *minor) if (get_meson_cpu_version(MESON_CPU_VERSION_LVL_MAJOR) == MESON_CPU_MAJOR_ID_G12B) { set_cpus_allowed_ptr(current, cpumask_of(0)); - __asm__ volatile("mrs %0, mpidr_el1":"=r"(cpu)); + cpu = read_cpuid_mpidr(); cpu &= 0xfff; if (cpu != 0x0) usleep_range(10, 20); @@ -105,7 +106,7 @@ static int tee_msg_api_revision(uint32_t *major, uint32_t *minor) if (get_meson_cpu_version(MESON_CPU_VERSION_LVL_MAJOR) == MESON_CPU_MAJOR_ID_G12B) { set_cpus_allowed_ptr(current, cpumask_of(0)); - __asm__ volatile("mrs %0, mpidr_el1":"=r"(cpu)); + cpu = read_cpuid_mpidr(); cpu &= 0xfff; if (cpu != 0x0) usleep_range(10, 20); @@ -169,7 +170,7 @@ int tee_load_video_fw(uint32_t index, uint32_t vdec) if (get_meson_cpu_version(MESON_CPU_VERSION_LVL_MAJOR) == MESON_CPU_MAJOR_ID_G12B) { set_cpus_allowed_ptr(current, cpumask_of(0)); - __asm__ volatile("mrs %0, mpidr_el1":"=r"(cpu)); + cpu = read_cpuid_mpidr(); cpu &= 0xfff; if (cpu != 0x0) usleep_range(10, 20); @@ -196,7 +197,7 @@ bool tee_enabled(void) if (get_meson_cpu_version(MESON_CPU_VERSION_LVL_MAJOR) == MESON_CPU_MAJOR_ID_G12B) { set_cpus_allowed_ptr(current, cpumask_of(0)); - __asm__ volatile("mrs %0, mpidr_el1":"=r"(cpu)); + cpu = read_cpuid_mpidr(); cpu &= 0xfff; if (cpu != 0x0) usleep_range(10, 20); -- 2.7.4