From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Fri, 19 Aug 2016 01:23:26 +0200 Subject: [U-Boot] [PATCH v6 05/10] cpu: Add DMTF id and family fields In-Reply-To: <1471562611-93794-1-git-send-email-agraf@suse.de> References: <1471562611-93794-1-git-send-email-agraf@suse.de> Message-ID: <1471562611-93794-7-git-send-email-agraf@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- arch/x86/cpu/cpu_x86.c | 5 +++++ include/cpu.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c index 0941041..39004ee 100644 --- a/arch/x86/cpu/cpu_x86.c +++ b/arch/x86/cpu/cpu_x86.c @@ -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; } diff --git a/include/cpu.h b/include/cpu.h index bda5315..7d4486b 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -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 */ -- 1.8.5.6