From e8b83ca0aeac0d3a0365a69325cc7746fdfa4c62 Mon Sep 17 00:00:00 2001 From: Rohit Khanna Date: Fri, 27 Jan 2017 15:10:12 -0800 Subject: tegra: T194 cpu macro Add a macro to detect if a CPU core is Carmel or not. Bug 1814444 Bug 1827294 Change-Id: I5797f80ff990ffbbb59342a11f68ed22ea2b184c Signed-off-by: Rohit Khanna Reviewed-on: http://git-master/r/1295512 Reviewed-by: Krishna Sitaraman Tested-by: Krishna Sitaraman Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Alexander Van Brunt --- include/linux/platform/tegra/tegra-cpu.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/linux/platform/tegra/tegra-cpu.h (limited to 'include/linux') diff --git a/include/linux/platform/tegra/tegra-cpu.h b/include/linux/platform/tegra/tegra-cpu.h new file mode 100644 index 000000000..a85c4ab9a --- /dev/null +++ b/include/linux/platform/tegra/tegra-cpu.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include + +#define MIDR_CPU_MASK 0xFF0FFFF0 +#define MIDR_CPU_CARMEL 0x4E0F0040 + +static inline u8 tegra_is_cpu_carmel(u8 cpu) +{ + struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, cpu); + return ((cpuinfo->reg_midr & MIDR_CPU_MASK) == MIDR_CPU_CARMEL); +} -- cgit v1.2.2