On Thu, Oct 8, 2026 at 9:51 PM Desapogu Jayaramudu
<[email protected]> wrote:
>
> 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]>
> ---
> Changes in v5:
> - updated comments in arch/x86/include/asm/u-boot-x86.h
> - leaving the function x86_cpu_init_f() as it was.
>
>  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(-)
>  create mode 100644 arch/x86/cpu/vendor.c
>

Reviewed-by: Bin Meng <[email protected]>

Reply via email to