This seems to be a more official, common, simple way to check if the CPU is dual core or single core.
Signed-off-by: Zheng Bao zheng.bao@amd.com
Index: src/southbridge/amd/sb600/sb600_early_setup.c =================================================================== --- src/southbridge/amd/sb600/sb600_early_setup.c (revision 4413) +++ src/southbridge/amd/sb600/sb600_early_setup.c (working copy) @@ -125,11 +125,7 @@
static u8 dual_core() { - if(((cpuid_eax(0x80000000) & ~0xff) >= 8)) { - if(cpuid_ecx(0x80000008) & 1) - return 1; - } - return 0; + return (pci_read_config32(PCI_DEV(0, 0x18, 3), 0xE8) & (0x3<<12)) != 0; }
/*
The title should be "in sb600" instead of "is sb600".
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of Bao, Zheng Sent: Friday, July 10, 2009 11:01 AM To: Coreboot Subject: [coreboot] [patch]:new dual core check function is sb600.
This seems to be a more official, common, simple way to check if the CPU is dual core or single core.
Signed-off-by: Zheng Bao zheng.bao@amd.com
Index: src/southbridge/amd/sb600/sb600_early_setup.c =================================================================== --- src/southbridge/amd/sb600/sb600_early_setup.c (revision 4413) +++ src/southbridge/amd/sb600/sb600_early_setup.c (working copy) @@ -125,11 +125,7 @@
static u8 dual_core() { - if(((cpuid_eax(0x80000000) & ~0xff) >= 8)) { - if(cpuid_ecx(0x80000008) & 1) - return 1; - } - return 0; + return (pci_read_config32(PCI_DEV(0, 0x18, 3), 0xE8) & (0x3<<12)) != 0; }
/*
Acked-by: Ronald G. Minnich rminnich@gmail.com
It still looks good :-)