diff options
| author | Tom Rini <[email protected]> | 2024-02-03 09:11:25 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-02-03 09:11:25 -0500 |
| commit | 819abd0a1eaff9a921f5b917e152b85dab302e33 (patch) | |
| tree | d1d299e98db982d1379cb1d2a009e1c437dbb454 /drivers/cpu | |
| parent | 050a9b981d6a835133521b599be3ae189ce70f41 (diff) | |
| parent | 406c410ef747d66e16f2f5494cbf88ba1307224f (diff) | |
Merge tag 'smbios-2024-04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request smbios-2024-04-rc2
* In smbios command
- write 'Not Specified' for missing strings
- show correct table size for SMBIOS2.1 entry point
- adjust formatting of handle numbers
- add missing colon after UUID
* In generated SMBIOS table
- avoid introducing 'Unknown' string for missing properties
- provide RISC-V vendor ID in the type 4 structure
- provide the correct chassis handle in structure type 2
* Rename Structure Table Maximum Size field in SMBIOS 3 entry point
Diffstat (limited to 'drivers/cpu')
| -rw-r--r-- | drivers/cpu/riscv_cpu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c index a9b253719f7..5d1026b37da 100644 --- a/drivers/cpu/riscv_cpu.c +++ b/drivers/cpu/riscv_cpu.c @@ -11,6 +11,7 @@ #include <errno.h> #include <log.h> #include <asm/global_data.h> +#include <asm/sbi.h> #include <dm/device-internal.h> #include <dm/lists.h> #include <linux/bitops.h> @@ -94,13 +95,24 @@ static int riscv_cpu_bind(struct udevice *dev) struct cpu_plat *plat = dev_get_parent_plat(dev); struct driver *drv; int ret; + long mvendorid; /* save the hart id */ plat->cpu_id = dev_read_addr(dev); + /* provide data for SMBIOS */ if (IS_ENABLED(CONFIG_64BIT)) plat->family = 0x201; else plat->family = 0x200; + if (CONFIG_IS_ENABLED(RISCV_SMODE)) { + /* + * For RISC-V CPUs the SMBIOS Processor ID field contains + * the Machine Vendor ID from CSR mvendorid. + */ + ret = sbi_get_mvendorid(&mvendorid); + if (!ret) + plat->id[0] = mvendorid; + } /* first examine the property in current cpu node */ ret = dev_read_u32(dev, "timebase-frequency", &plat->timebase_freq); /* if not found, then look at the parent /cpus node */ |
