mirror of
https://xff.cz/git/u-boot/
synced 2025-09-06 19:22:11 +02:00
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>
This commit is contained in:
committed by
Simon Glass
parent
4c2718f9b1
commit
469f04e882
@@ -25,6 +25,7 @@
|
|||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
#include <env.h>
|
#include <env.h>
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
|
#include <soc.h>
|
||||||
|
|
||||||
struct ti_sci_handle *get_ti_sci_handle(void)
|
struct ti_sci_handle *get_ti_sci_handle(void)
|
||||||
{
|
{
|
||||||
@@ -308,38 +309,27 @@ void reset_cpu(ulong ignored)
|
|||||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||||
int print_cpuinfo(void)
|
int print_cpuinfo(void)
|
||||||
{
|
{
|
||||||
u32 soc, rev;
|
struct udevice *soc;
|
||||||
char *name;
|
char name[64];
|
||||||
|
int ret;
|
||||||
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;
|
|
||||||
|
|
||||||
printf("SoC: ");
|
printf("SoC: ");
|
||||||
switch (soc) {
|
|
||||||
case AM65X:
|
|
||||||
name = "AM65x";
|
|
||||||
break;
|
|
||||||
case J721E:
|
|
||||||
name = "J721E";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
name = "Unknown Silicon";
|
|
||||||
};
|
|
||||||
|
|
||||||
printf("%s SR ", name);
|
ret = soc_get(&soc);
|
||||||
switch (rev) {
|
if (ret) {
|
||||||
case REV_PG1_0:
|
printf("UNKNOWN\n");
|
||||||
name = "1.0";
|
return 0;
|
||||||
break;
|
}
|
||||||
case REV_PG2_0:
|
|
||||||
name = "2.0";
|
ret = soc_get_family(soc, name, 64);
|
||||||
break;
|
if (!ret) {
|
||||||
default:
|
printf("%s ", name);
|
||||||
name = "Unknown Revision";
|
}
|
||||||
};
|
|
||||||
printf("%s\n", name);
|
ret = soc_get_revision(soc, name, 64);
|
||||||
|
if (!ret) {
|
||||||
|
printf("%s\n", name);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -8,12 +8,6 @@
|
|||||||
|
|
||||||
#include <asm/armv7_mpu.h>
|
#include <asm/armv7_mpu.h>
|
||||||
|
|
||||||
#define AM65X 0xbb5a
|
|
||||||
#define J721E 0xbb64
|
|
||||||
|
|
||||||
#define REV_PG1_0 0
|
|
||||||
#define REV_PG2_0 1
|
|
||||||
|
|
||||||
struct fwl_data {
|
struct fwl_data {
|
||||||
const char *name;
|
const char *name;
|
||||||
u16 fwl_id;
|
u16 fwl_id;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Assuming these addresses and definitions stay common across K3 devices */
|
/* 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_SHIFT 28
|
||||||
#define JTAG_ID_VARIANT_MASK (0xf << 28)
|
#define JTAG_ID_VARIANT_MASK (0xf << 28)
|
||||||
#define JTAG_ID_PARTNO_SHIFT 12
|
#define JTAG_ID_PARTNO_SHIFT 12
|
||||||
|
Reference in New Issue
Block a user