aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3/common.c
diff options
context:
space:
mode:
authorDave Gerlach <d-gerlach@ti.com>2020-07-15 23:40:04 -0500
committerSimon Glass <sjg@chromium.org>2020-07-25 14:46:57 -0600
commit5ab71ea4b18dce9fe5599075c4309ea39b62954f (patch)
treeee3be63d86aa6e89cf9ac66678b2fa4eedeebf3c /arch/arm/mach-k3/common.c
parent29eb1c4aa6a0fa0894cb76db9d24642fda6dae0b (diff)
downloadu-boot-5ab71ea4b18dce9fe5599075c4309ea39b62954f.zip
u-boot-5ab71ea4b18dce9fe5599075c4309ea39b62954f.tar.gz
u-boot-5ab71ea4b18dce9fe5599075c4309ea39b62954f.tar.bz2
arm: mach-k3: Use SOC driver for device identification
Make use of UCLASS_SOC to find device family and revision for print_cpuinfo. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Diffstat (limited to 'arch/arm/mach-k3/common.c')
-rw-r--r--arch/arm/mach-k3/common.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 63bf060..4335f28 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -25,6 +25,7 @@
#include <fs.h>
#include <env.h>
#include <elf.h>
+#include <soc.h>
struct ti_sci_handle *get_ti_sci_handle(void)
{
@@ -308,38 +309,27 @@ void reset_cpu(ulong ignored)
#if defined(CONFIG_DISPLAY_CPUINFO)
int print_cpuinfo(void)
{
- u32 soc, rev;
- char *name;
-
- soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
- JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
- rev = (readl(CTRLMMR_WKUP_JTAG_ID) &
- JTAG_ID_VARIANT_MASK) >> JTAG_ID_VARIANT_SHIFT;
+ struct udevice *soc;
+ char name[64];
+ int ret;
printf("SoC: ");
- switch (soc) {
- case AM65X:
- name = "AM65x";
- break;
- case J721E:
- name = "J721E";
- break;
- default:
- name = "Unknown Silicon";
- };
- printf("%s SR ", name);
- switch (rev) {
- case REV_PG1_0:
- name = "1.0";
- break;
- case REV_PG2_0:
- name = "2.0";
- break;
- default:
- name = "Unknown Revision";
- };
- printf("%s\n", name);
+ ret = soc_get(&soc);
+ if (ret) {
+ printf("UNKNOWN\n");
+ return 0;
+ }
+
+ ret = soc_get_family(soc, name, 64);
+ if (!ret) {
+ printf("%s ", name);
+ }
+
+ ret = soc_get_revision(soc, name, 64);
+ if (!ret) {
+ printf("%s\n", name);
+ }
return 0;
}