On 2026-10-08T13:50:24, Desapogu Jayaramudu <[email protected]> wrote: > x86: cpu: x86_64: Detect CPU vendor and device ID using cpuid > > When U-Boot is configured as a coreboot payload on x86_64, the current > code leaves the CPU identity at the default Intel vendor and device ID > 0x0, even on non-Intel platforms. > > Read CPUID leaf 0 and build the 12-byte vendor string from EBX:EDX:ECX > to identify the CPU vendor at runtime. Set gd->arch.x86_vendor to Intel/AMD > when matched, with fallback to X86_VENDOR_ANY for unknown vendors. Also > store cpuid_eax(1) in gd->arch.x86_device so later x86 code can use the > detected CPU identity. > > This avoids relying on a fixed vendor value and keeps vendor-sensitive > paths (e.g. TSC calibration) aligned with the actual CPU. > > Signed-off-by: Desapogu Jayaramudu <[email protected]> > Reviewed-by: Bin Meng <[email protected]> > > arch/x86/cpu/Makefile | 1 + > arch/x86/cpu/i386/cpu.c | 51 ++------------------------------------ > arch/x86/cpu/vendor.c | 52 > +++++++++++++++++++++++++++++++++++++++ > arch/x86/cpu/x86_64/cpu.c | 24 +++++++++++++++--- > arch/x86/include/asm/u-boot-x86.h | 16 ++++++++++++ > 5 files changed, 92 insertions(+), 52 deletions(-)
Reviewed-by: Simon Glass <[email protected]>
