summaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2020-08-05 22:44:19 +0530
committerLokesh Vutla <lokeshvutla@ti.com>2020-08-11 20:34:46 +0530
commit2a18be77def6ce8967cb24770a2c0838125d2da5 (patch)
treeabfdec3e278d6c0dfbe33ed2fe093fda76e8a768 /arch/arm/mach-k3
parentdc57a554a5af936f1127d2af03fa9281a6c1d4e1 (diff)
arm: mach-k3: j721e: Add detection for j721e
Add an api soc_is_j721e(), and use it to enable certain functionality that is available only on j721e. This detection is needed when DT is not available. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'arch/arm/mach-k3')
-rw-r--r--arch/arm/mach-k3/common.c10
-rw-r--r--arch/arm/mach-k3/common.h2
-rw-r--r--arch/arm/mach-k3/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-k3/include/mach/sys_proto.h2
-rw-r--r--arch/arm/mach-k3/j721e_init.c3
5 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 178dc210c3..4e366f8fff 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -345,6 +345,16 @@ int print_cpuinfo(void)
}
#endif
+bool soc_is_j721e(void)
+{
+ u32 soc;
+
+ soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
+ JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
+
+ return soc == J721E;
+}
+
#ifdef CONFIG_ARM64
void board_prep_linux(bootm_headers_t *images)
{
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 44cf94a174..9c6c3595a2 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -8,6 +8,8 @@
#include <asm/armv7_mpu.h>
+#define J721E 0xbb64
+
struct fwl_data {
const char *name;
u16 fwl_id;
diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h
index f2ca80af1a..0ad761418b 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -15,6 +15,7 @@
#endif
/* Assuming these addresses and definitions stay common across K3 devices */
+#define CTRLMMR_WKUP_JTAG_ID 0x43000014
#define JTAG_ID_VARIANT_SHIFT 28
#define JTAG_ID_VARIANT_MASK (0xf << 28)
#define JTAG_ID_PARTNO_SHIFT 12
diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h
index 3c825aa3d1..48b11178c3 100644
--- a/arch/arm/mach-k3/include/mach/sys_proto.h
+++ b/arch/arm/mach-k3/include/mach/sys_proto.h
@@ -16,4 +16,6 @@ int do_board_detect(void);
void release_resources_for_core_shutdown(void);
int fdt_disable_node(void *blob, char *node_path);
+bool soc_is_j721e(void);
+
#endif
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 461a9d7f8f..3b15da2d7c 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -361,6 +361,9 @@ void start_non_linux_remote_cores(void)
int size = 0, ret;
u32 loadaddr = 0;
+ if (!soc_is_j721e())
+ return;
+
size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load",
&loadaddr);
if (size <= 0)