]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
soc: soc_ti_k3: Use hardware.h to remove definition duplication
authorAndrew Davis <afd@ti.com>
Thu, 6 Apr 2023 16:38:12 +0000 (11:38 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 24 Apr 2023 17:18:47 +0000 (13:18 -0400)
The K3 JTAG and SoC ID information is already stored in the K3 arch
hardware file, include that and use its definitions here.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
drivers/soc/Kconfig
drivers/soc/soc_ti_k3.c

index acf555baaec214ae812ba4e6b890fcd761e22286..85dac9de78a443e615397287e0d0f6d61ad20a01 100644 (file)
@@ -10,7 +10,7 @@ config SOC_DEVICE
          specific device variant in use.
 
 config SOC_DEVICE_TI_K3
-       depends on SOC_DEVICE
+       depends on SOC_DEVICE && ARCH_K3
        bool "Enable SoC Device ID driver for TI K3 SoCs"
        help
          This allows Texas Instruments Keystone 3 SoCs to identify
index 8af0ac7051925887c370a4fe590b963c5307cf2b..42430d79a7ad6601fcd7e32d7fe35f0ae94bd270 100644 (file)
@@ -8,21 +8,9 @@
 #include <dm.h>
 #include <soc.h>
 
+#include <asm/arch/hardware.h>
 #include <asm/io.h>
 
-#define AM65X                  0xbb5a
-#define J721E                  0xbb64
-#define J7200                  0xbb6d
-#define AM64X                  0xbb38
-#define J721S2                 0xbb75
-#define AM62X                  0xbb7e
-#define AM62AX                 0xbb8d
-
-#define JTAG_ID_VARIANT_SHIFT  28
-#define JTAG_ID_VARIANT_MASK   (0xf << 28)
-#define JTAG_ID_PARTNO_SHIFT   12
-#define JTAG_ID_PARTNO_MASK    (0xffff << 12)
-
 struct soc_ti_k3_plat {
        const char *family;
        const char *revision;
@@ -36,25 +24,25 @@ static const char *get_family_string(u32 idreg)
        soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
 
        switch (soc) {
-       case AM65X:
+       case JTAG_ID_PARTNO_AM65X:
                family = "AM65X";
                break;
-       case J721E:
+       case JTAG_ID_PARTNO_J721E:
                family = "J721E";
                break;
-       case J7200:
+       case JTAG_ID_PARTNO_J7200:
                family = "J7200";
                break;
-       case AM64X:
+       case JTAG_ID_PARTNO_AM64X:
                family = "AM64X";
                break;
-       case J721S2:
+       case JTAG_ID_PARTNO_J721S2:
                family = "J721S2";
                break;
-       case AM62X:
+       case JTAG_ID_PARTNO_AM62X:
                family = "AM62X";
                break;
-       case AM62AX:
+       case JTAG_ID_PARTNO_AM62AX:
                family = "AM62AX";
                break;
        default:
@@ -81,7 +69,7 @@ static const char *get_rev_string(u32 idreg)
        soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
 
        switch (soc) {
-       case J721E:
+       case JTAG_ID_PARTNO_J721E:
                if (rev > ARRAY_SIZE(j721e_rev_string_map))
                        goto bail;
                return j721e_rev_string_map[rev];