diff mbox series

[2/2] x86: apl: Use cpu_x86_get_count() for cpu_ops.get_count

Message ID 20200225121949.35950-3-wolfgang.wallner@br-automation.com
State Accepted
Commit 2c64d11e3239b5b3cf29c911fd9cdb6ebb3880d6
Headers show
Series x86: apl: Add support for different number of cores | expand

Commit Message

Wolfgang Wallner Feb. 25, 2020, 12:19 p.m. UTC
Use cpu_x86_get_count() to read the number of cores.

cpu_x86_get_count() reads the number of CPUs from the device tree.
Using this function we can support multiple Apollo Lake
variants, e.g.: E3940 (4 cores) and E3930 (2 cores).

This was tested on the E3940 and E3930 Apollo Lake variants.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>

---

 arch/x86/cpu/apollolake/cpu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Bin Meng Feb. 25, 2020, 1:15 p.m. UTC | #1
On Tue, Feb 25, 2020 at 8:19 PM Wolfgang Wallner
<wolfgang.wallner at br-automation.com> wrote:
>
> Use cpu_x86_get_count() to read the number of cores.
>
> cpu_x86_get_count() reads the number of CPUs from the device tree.
> Using this function we can support multiple Apollo Lake
> variants, e.g.: E3940 (4 cores) and E3930 (2 cores).
>
> This was tested on the E3940 and E3930 Apollo Lake variants.
>
> Signed-off-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
>
> ---
>
>  arch/x86/cpu/apollolake/cpu.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/apollolake/cpu.c b/arch/x86/cpu/apollolake/cpu.c
index 3d05c82a5c..aa7a3dbd63 100644
--- a/arch/x86/cpu/apollolake/cpu.c
+++ b/arch/x86/cpu/apollolake/cpu.c
@@ -14,15 +14,10 @@  static int apl_get_info(struct udevice *dev, struct cpu_info *info)
 	return cpu_intel_get_info(info, INTEL_BCLK_MHZ);
 }
 
-static int apl_get_count(struct udevice *dev)
-{
-	return 4;
-}
-
 static const struct cpu_ops cpu_x86_apl_ops = {
 	.get_desc	= cpu_x86_get_desc,
 	.get_info	= apl_get_info,
-	.get_count	= apl_get_count,
+	.get_count	= cpu_x86_get_count,
 	.get_vendor	= cpu_x86_get_vendor,
 };