]> git.sur5r.net Git - u-boot/commitdiff
cpu: Add DMTF id and family fields
authorAlexander Graf <agraf@suse.de>
Thu, 18 Aug 2016 23:23:26 +0000 (01:23 +0200)
committerAlexander Graf <agraf@suse.de>
Wed, 19 Oct 2016 07:01:51 +0000 (09:01 +0200)
For SMBIOS tables we need to know the CPU family as well as CPU IDs. This
patches allocates some space for them in the cpu device and populates it
on x86.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/cpu_x86.c
include/cpu.h

index 09410416a1ff07aee6698adc94165f37af958fa5..39004ee5f0f5f889362b440444abdc9a43171440 100644 (file)
@@ -15,9 +15,14 @@ DECLARE_GLOBAL_DATA_PTR;
 int cpu_x86_bind(struct udevice *dev)
 {
        struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+       struct cpuid_result res;
 
        plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
                                      "intel,apic-id", -1);
+       plat->family = gd->arch.x86;
+       res = cpuid(1);
+       plat->id[0] = res.eax;
+       plat->id[1] = res.edx;
 
        return 0;
 }
index bda53150a6fb2bc1ebcb351f48ad4c175bcd8f3f..7d4486bbf3394c3ecb0adfdd80549419268c1071 100644 (file)
@@ -21,6 +21,8 @@ struct cpu_platdata {
        int cpu_id;
        int ucode_version;
        ulong device_id;
+       u16 family;             /* DMTF CPU Family */
+       u32 id[2];              /* DMTF CPU Processor IDs */
 };
 
 /* CPU features - mostly just a placeholder for now */