From: Andrew Davis <afd@ti.com>
To: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
<u-boot@lists.denx.de>
Cc: Andrew Davis <afd@ti.com>
Subject: [PATCH 02/12] arm: mach-k3: Move J721e SoC detection out of common section
Date: Thu, 30 Mar 2023 15:28:47 -0500 [thread overview]
Message-ID: <20230330202857.8216-2-afd@ti.com> (raw)
In-Reply-To: <20230330202857.8216-1-afd@ti.com>
This belongs in the J721e specific file as it is the only place
this is used. Any board level users should use the SOC driver.
While here, move the J721e and J7200 SoC IDs out of sys_proto.h
and into hardware.h. Add the rest of the SoC IDs for completeness
and later use.
Signed-off-by: Andrew Davis <afd@ti.com>
---
arch/arm/mach-k3/common.c | 20 --------------------
arch/arm/mach-k3/common.h | 3 ---
arch/arm/mach-k3/include/mach/hardware.h | 8 ++++++++
arch/arm/mach-k3/include/mach/sys_proto.h | 3 ---
arch/arm/mach-k3/j721e_init.c | 20 ++++++++++++++++++++
5 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 6870f13c520..6e084de692c 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -488,26 +488,6 @@ 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;
-}
-
-bool soc_is_j7200(void)
-{
- u32 soc;
-
- soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
- JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
-
- return soc == J7200;
-}
-
#ifdef CONFIG_ARM64
void board_prep_linux(struct bootm_headers *images)
{
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 8f38fcef7f0..531be0be54c 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -9,9 +9,6 @@
#include <asm/armv7_mpu.h>
#include <asm/hardware.h>
-#define J721E 0xbb64
-#define J7200 0xbb6d
-
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 2c60ef85432..f87b4c6e5a7 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -36,6 +36,14 @@
#define JTAG_ID_VARIANT_MASK (0xf << 28)
#define JTAG_ID_PARTNO_SHIFT 12
#define JTAG_ID_PARTNO_MASK (0xffff << 12)
+#define JTAG_ID_PARTNO_AM65X 0xbb5a
+#define JTAG_ID_PARTNO_J721E 0xbb64
+#define JTAG_ID_PARTNO_J7200 0xbb6d
+#define JTAG_ID_PARTNO_AM64X 0xbb38
+#define JTAG_ID_PARTNO_J721S2 0xbb75
+#define JTAG_ID_PARTNO_AM62X 0xbb7e
+#define JTAG_ID_PARTNO_AM62AX 0xbb8d
+
#define K3_SEC_MGR_SYS_STATUS 0x44234100
#define SYS_STATUS_DEV_TYPE_SHIFT 0
#define SYS_STATUS_DEV_TYPE_MASK (0xf)
diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h
index 0b5d606eaa2..d5d4b787b7d 100644
--- a/arch/arm/mach-k3/include/mach/sys_proto.h
+++ b/arch/arm/mach-k3/include/mach/sys_proto.h
@@ -15,9 +15,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);
-bool soc_is_j7200(void);
-
void k3_spl_init(void);
void k3_mem_init(void);
bool check_rom_loaded_sysfw(void);
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 276cbb5dae2..233b867e90c 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -63,6 +63,26 @@ struct fwl_data cbass_hc_cfg0_fwls[] = {
};
#endif
+bool soc_is_j721e(void)
+{
+ u32 soc;
+
+ soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
+ JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
+
+ return soc == JTAG_ID_PARTNO_J721E;
+}
+
+bool soc_is_j7200(void)
+{
+ u32 soc;
+
+ soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
+ JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
+
+ return soc == JTAG_ID_PARTNO_J7200;
+}
+
static void ctrl_mmr_unlock(void)
{
/* Unlock all WKUP_CTRL_MMR0 module registers */
--
2.39.2
next prev parent reply other threads:[~2023-03-30 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 20:28 [PATCH 01/12] arm: mach-k3: Move MSMC fixup to SoC level Andrew Davis
2023-03-30 20:28 ` Andrew Davis [this message]
2023-03-30 20:28 ` [PATCH 03/12] soc: soc_ti_k3: Use hardware.h to remove definition duplication Andrew Davis
2023-03-30 20:28 ` [PATCH 04/12] configs: j721x_evm.h: Remove unneeded check for SYS_K3_SPL_ATF Andrew Davis
2023-03-30 20:28 ` [PATCH 05/12] configs: j721s2_evm.h: Remove refrences to J7200 EVM Andrew Davis
2023-03-30 20:28 ` [PATCH 06/12] arm: mach-k3: Make release_resources_for_core_shutdown() common Andrew Davis
2023-03-30 20:28 ` [PATCH 07/12] arm: mach-k3: Move sysfw-loader.h out of mach includes Andrew Davis
2023-03-30 20:28 ` [PATCH 08/12] arm: mach-k3: Add weak do_board_detect() to common file Andrew Davis
2023-04-02 10:44 ` Christian Gmeiner
2023-04-05 14:42 ` Andrew Davis
2023-03-30 20:28 ` [PATCH 09/12] arm: mach-k3: Remove unused fdt_disable_node() Andrew Davis
2023-03-30 20:28 ` [PATCH 10/12] arm: mach-k3: Move sdelay() and wait_on_value() declaration Andrew Davis
2023-03-30 20:28 ` [PATCH 11/12] arm: mach-k3: Move J721s2 SPL init functions to mach-k3 Andrew Davis
2023-03-30 20:28 ` [PATCH 12/12] arm: mach-k3: Remove empty sys_proto.h include Andrew Davis
2023-04-02 10:47 ` [PATCH 01/12] arm: mach-k3: Move MSMC fixup to SoC level Christian Gmeiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230330202857.8216-2-afd@ti.com \
--to=afd@ti.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox