aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/dts/k3-am65-wakeup.dtsi5
-rw-r--r--arch/arm/dts/k3-am654-base-board-u-boot.dtsi4
-rw-r--r--arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi4
-rw-r--r--arch/arm/dts/k3-j721e-mcu-wakeup.dtsi5
-rw-r--r--arch/arm/mach-k3/common.c48
-rw-r--r--arch/arm/mach-k3/common.h6
-rw-r--r--arch/arm/mach-k3/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-snapdragon/clock-snapdragon.c2
-rw-r--r--arch/arm/mach-snapdragon/pinctrl-snapdragon.c2
-rw-r--r--arch/nios2/cpu/cpu.c8
-rw-r--r--arch/sandbox/dts/test.dts4
-rw-r--r--arch/x86/cpu/apollolake/cpu.c2
-rw-r--r--arch/x86/cpu/baytrail/cpu.c4
-rw-r--r--arch/x86/cpu/broadwell/cpu_full.c4
-rw-r--r--arch/x86/cpu/cpu_x86.c6
-rw-r--r--arch/x86/cpu/ivybridge/model_206ax.c5
-rw-r--r--arch/x86/cpu/qemu/cpu.c4
-rw-r--r--arch/x86/include/asm/cpu_x86.h6
18 files changed, 64 insertions, 56 deletions
diff --git a/arch/arm/dts/k3-am65-wakeup.dtsi b/arch/arm/dts/k3-am65-wakeup.dtsi
index 2676d6035b2..666c30d0191 100644
--- a/arch/arm/dts/k3-am65-wakeup.dtsi
+++ b/arch/arm/dts/k3-am65-wakeup.dtsi
@@ -62,4 +62,9 @@
clocks = <&k3_clks 115 1>;
power-domains = <&k3_pds 115 TI_SCI_PD_EXCLUSIVE>;
};
+
+ chipid: chipid@43000014 {
+ compatible = "ti,am654-chipid";
+ reg = <0x43000014 0x4>;
+ };
};
diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi
index d9ff3ed47b2..a30680d3e02 100644
--- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi
+++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi
@@ -246,3 +246,7 @@
u-boot,dm-spl;
};
};
+
+&chipid {
+ u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
index 6e748bfebb6..cfb39325e97 100644
--- a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
@@ -211,3 +211,7 @@
&mcu_fss0_ospi1_pins_default {
u-boot,dm-spl;
};
+
+&chipid {
+ u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/k3-j721e-mcu-wakeup.dtsi b/arch/arm/dts/k3-j721e-mcu-wakeup.dtsi
index e6c99ab6980..60695f5eb91 100644
--- a/arch/arm/dts/k3-j721e-mcu-wakeup.dtsi
+++ b/arch/arm/dts/k3-j721e-mcu-wakeup.dtsi
@@ -316,4 +316,9 @@
ti,cpts-periodic-outputs = <2>;
};
};
+
+ chipid: chipid@43000014 {
+ compatible = "ti,am654-chipid";
+ reg = <0x0 0x43000014 0x0 0x4>;
+ };
};
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 63bf0606166..4335f2877b8 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;
}
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index 94cdcb56ade..ba344c5bc9d 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -8,12 +8,6 @@
#include <asm/armv7_mpu.h>
-#define AM65X 0xbb5a
-#define J721E 0xbb64
-
-#define REV_PG1_0 0
-#define REV_PG2_0 1
-
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 0ad761418bb..f2ca80af1a9 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -15,7 +15,6 @@
#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-snapdragon/clock-snapdragon.c b/arch/arm/mach-snapdragon/clock-snapdragon.c
index 85526186c60..69d65c82e3e 100644
--- a/arch/arm/mach-snapdragon/clock-snapdragon.c
+++ b/arch/arm/mach-snapdragon/clock-snapdragon.c
@@ -114,7 +114,7 @@ static int msm_clk_probe(struct udevice *dev)
{
struct msm_clk_priv *priv = dev_get_priv(dev);
- priv->base = devfdt_get_addr(dev);
+ priv->base = dev_read_addr(dev);
if (priv->base == FDT_ADDR_T_NONE)
return -EINVAL;
diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c
index 442d2362550..4c2af213082 100644
--- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c
+++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c
@@ -56,7 +56,7 @@ static int msm_pinctrl_probe(struct udevice *dev)
{
struct msm_pinctrl_priv *priv = dev_get_priv(dev);
- priv->base = devfdt_get_addr(dev);
+ priv->base = dev_read_addr(dev);
priv->data = (struct msm_pinctrl_data *)dev->driver_data;
return priv->base == FDT_ADDR_T_NONE ? -EINVAL : 0;
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 7f5e731a0f5..e7ca9882fc5 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -79,7 +79,8 @@ int arch_cpu_init_dm(void)
return 0;
}
-static int altera_nios2_get_desc(struct udevice *dev, char *buf, int size)
+static int altera_nios2_get_desc(const struct udevice *dev, char *buf,
+ int size)
{
const char *cpu_name = "Nios-II";
@@ -90,7 +91,8 @@ static int altera_nios2_get_desc(struct udevice *dev, char *buf, int size)
return 0;
}
-static int altera_nios2_get_info(struct udevice *dev, struct cpu_info *info)
+static int altera_nios2_get_info(const struct udevice *dev,
+ struct cpu_info *info)
{
info->cpu_freq = gd->cpu_clk;
info->features = (1 << CPU_FEAT_L1_CACHE) |
@@ -99,7 +101,7 @@ static int altera_nios2_get_info(struct udevice *dev, struct cpu_info *info)
return 0;
}
-static int altera_nios2_get_count(struct udevice *dev)
+static int altera_nios2_get_count(const struct udevice *dev)
{
return 1;
}
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 3744a466030..2ae42397216 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -521,6 +521,10 @@
};
};
+ chipid: chipid {
+ compatible = "sandbox,soc";
+ };
+
i2s: i2s {
compatible = "sandbox,i2s";
#sound-dai-cells = <1>;
diff --git a/arch/x86/cpu/apollolake/cpu.c b/arch/x86/cpu/apollolake/cpu.c
index aa7a3dbd63e..0a6d2ad7a4a 100644
--- a/arch/x86/cpu/apollolake/cpu.c
+++ b/arch/x86/cpu/apollolake/cpu.c
@@ -9,7 +9,7 @@
#include <asm/cpu_common.h>
#include <asm/cpu_x86.h>
-static int apl_get_info(struct udevice *dev, struct cpu_info *info)
+static int apl_get_info(const struct udevice *dev, struct cpu_info *info)
{
return cpu_intel_get_info(info, INTEL_BCLK_MHZ);
}
diff --git a/arch/x86/cpu/baytrail/cpu.c b/arch/x86/cpu/baytrail/cpu.c
index 18e48ffa532..309a50a1161 100644
--- a/arch/x86/cpu/baytrail/cpu.c
+++ b/arch/x86/cpu/baytrail/cpu.c
@@ -150,7 +150,7 @@ static unsigned long tsc_freq(void)
return bclk * ((platform_info.lo >> 8) & 0xff);
}
-static int baytrail_get_info(struct udevice *dev, struct cpu_info *info)
+static int baytrail_get_info(const struct udevice *dev, struct cpu_info *info)
{
info->cpu_freq = tsc_freq();
info->features = 1 << CPU_FEAT_L1_CACHE | 1 << CPU_FEAT_MMU;
@@ -158,7 +158,7 @@ static int baytrail_get_info(struct udevice *dev, struct cpu_info *info)
return 0;
}
-static int baytrail_get_count(struct udevice *dev)
+static int baytrail_get_count(const struct udevice *dev)
{
int ecx = 0;
diff --git a/arch/x86/cpu/broadwell/cpu_full.c b/arch/x86/cpu/broadwell/cpu_full.c
index 64a1cd414fc..706f68f63d6 100644
--- a/arch/x86/cpu/broadwell/cpu_full.c
+++ b/arch/x86/cpu/broadwell/cpu_full.c
@@ -626,12 +626,12 @@ void cpu_set_power_limits(int power_limit_1_time)
}
}
-static int broadwell_get_info(struct udevice *dev, struct cpu_info *info)
+static int broadwell_get_info(const struct udevice *dev, struct cpu_info *info)
{
return cpu_intel_get_info(info, INTEL_BCLK_MHZ);
}
-static int broadwell_get_count(struct udevice *dev)
+static int broadwell_get_count(const struct udevice *dev)
{
return 4;
}
diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 3f2ba0881e8..7e83051646c 100644
--- a/arch/x86/cpu/cpu_x86.c
+++ b/arch/x86/cpu/cpu_x86.c
@@ -26,7 +26,7 @@ int cpu_x86_bind(struct udevice *dev)
return 0;
}
-int cpu_x86_get_vendor(struct udevice *dev, char *buf, int size)
+int cpu_x86_get_vendor(const struct udevice *dev, char *buf, int size)
{
const char *vendor = cpu_vendor_name(gd->arch.x86_vendor);
@@ -38,7 +38,7 @@ int cpu_x86_get_vendor(struct udevice *dev, char *buf, int size)
return 0;
}
-int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
+int cpu_x86_get_desc(const struct udevice *dev, char *buf, int size)
{
char *ptr;
@@ -52,7 +52,7 @@ int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
return 0;
}
-int cpu_x86_get_count(struct udevice *dev)
+int cpu_x86_get_count(const struct udevice *dev)
{
int node, cpu;
int num = 0;
diff --git a/arch/x86/cpu/ivybridge/model_206ax.c b/arch/x86/cpu/ivybridge/model_206ax.c
index 5954a24873d..55f7cc2b2ec 100644
--- a/arch/x86/cpu/ivybridge/model_206ax.c
+++ b/arch/x86/cpu/ivybridge/model_206ax.c
@@ -410,14 +410,15 @@ static int model_206ax_init(struct udevice *dev)
return 0;
}
-static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info)
+static int model_206ax_get_info(const struct udevice *dev,
+ struct cpu_info *info)
{
return cpu_intel_get_info(info, INTEL_BCLK_MHZ);
return 0;
}
-static int model_206ax_get_count(struct udevice *dev)
+static int model_206ax_get_count(const struct udevice *dev)
{
return 4;
}
diff --git a/arch/x86/cpu/qemu/cpu.c b/arch/x86/cpu/qemu/cpu.c
index f40fb4d0879..9ce86b379c4 100644
--- a/arch/x86/cpu/qemu/cpu.c
+++ b/arch/x86/cpu/qemu/cpu.c
@@ -10,7 +10,7 @@
#include <qfw.h>
#include <asm/cpu.h>
-int cpu_qemu_get_desc(struct udevice *dev, char *buf, int size)
+int cpu_qemu_get_desc(const struct udevice *dev, char *buf, int size)
{
if (size < CPU_MAX_NAME_LEN)
return -ENOSPC;
@@ -20,7 +20,7 @@ int cpu_qemu_get_desc(struct udevice *dev, char *buf, int size)
return 0;
}
-static int cpu_qemu_get_count(struct udevice *dev)
+static int cpu_qemu_get_count(const struct udevice *dev)
{
return qemu_fwcfg_online_cpus();
}
diff --git a/arch/x86/include/asm/cpu_x86.h b/arch/x86/include/asm/cpu_x86.h
index ae8f4dcd5dc..4fd5f03fdcf 100644
--- a/arch/x86/include/asm/cpu_x86.h
+++ b/arch/x86/include/asm/cpu_x86.h
@@ -28,7 +28,7 @@ int cpu_x86_bind(struct udevice *dev);
* @size: Size of string space
* @return: 0 if OK, -ENOSPC if buffer is too small, other -ve on error
*/
-int cpu_x86_get_desc(struct udevice *dev, char *buf, int size);
+int cpu_x86_get_desc(const struct udevice *dev, char *buf, int size);
/**
* cpu_x86_get_count() - Get the number of cores for an x86 CPU
@@ -40,7 +40,7 @@ int cpu_x86_get_desc(struct udevice *dev, char *buf, int size);
* @return: Number of cores if successful,
* -ENOENT if not "/cpus" entry is found in the device tree
*/
-int cpu_x86_get_count(struct udevice *dev);
+int cpu_x86_get_count(const struct udevice *dev);
/**
* cpu_x86_get_vendor() - Get a vendor string for an x86 CPU
@@ -53,6 +53,6 @@ int cpu_x86_get_count(struct udevice *dev);
* @size: Size of string space
* @return: 0 if OK, -ENOSPC if buffer is too small, other -ve on error
*/
-int cpu_x86_get_vendor(struct udevice *dev, char *buf, int size);
+int cpu_x86_get_vendor(const struct udevice *dev, char *buf, int size);
#endif /* _ASM_CPU_X86_H */