[U-Boot] [PATCH v2 26/38] x86: Move common Intel CPU info code into a function

Bin Meng bmeng.cn at gmail.com
Wed Oct 2 14:07:17 UTC 2019


On Wed, Sep 25, 2019 at 10:13 PM Simon Glass <sjg at chromium.org> wrote:
>
> Add cpu_intel_get_info() to find out the CPU info on modern Intel CPUs.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/broadwell/cpu_full.c    |  9 +--------
>  arch/x86/cpu/intel_common/cpu.c      | 13 +++++++++++++
>  arch/x86/cpu/ivybridge/model_206ax.c |  8 ++------
>  arch/x86/include/asm/cpu_common.h    | 11 +++++++++++
>  4 files changed, 27 insertions(+), 14 deletions(-)
>

[snip]

> diff --git a/arch/x86/include/asm/cpu_common.h b/arch/x86/include/asm/cpu_common.h
> index 4c91a5daced..0d560262d5a 100644
> --- a/arch/x86/include/asm/cpu_common.h
> +++ b/arch/x86/include/asm/cpu_common.h
> @@ -8,6 +8,8 @@
>
>  #define IA32_PERF_CTL                  0x199
>
> +struct cpu_info;
> +
>  /**
>   * cpu_common_init() - Set up common CPU init
>   *
> @@ -31,4 +33,13 @@ int cpu_common_init(void);
>   */
>  int cpu_set_flex_ratio_to_tdp_nominal(void);
>
> +/**
> + * cpu_intel_get_info() - Obtain CPU info for Intel CPUs
> + *
> + * Most Intel CPUs use the same MSR to obtain the clock speed, and use the same
> + * features. This function fills in these values, given the value of the base
> + * clock in MHz (typically this should be set to 100).

nits: please add parameter and return value descriptions.

> + */
> +int cpu_intel_get_info(struct cpu_info *info, int bclk_mz);
> +
>  #endif
> --

Other than that,
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list