[U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo()

Fabio Estevam festevam at gmail.com
Sun Jun 17 15:10:59 CEST 2012


On Sun, Jun 17, 2012 at 9:58 AM, Otavio Salvador
<otavio at ossystems.com.br> wrote:
> The information now is gathered from HW_DIGCTL_CHIPID register and
> includes the revision of the chip on the output.
>
> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Stefano Babic <sbabic at denx.de>
> Cc: Fabio Estevam <fabio.estevam at freescale.com>
> ---
>  arch/arm/cpu/arm926ejs/mx28/mx28.c |   29 +++++++++++++++++++++++++++--
>  1 file changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c
> index a82ff25..ac2f2e0 100644
> --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
> @@ -190,13 +190,38 @@ int arch_cpu_init(void)
>  #endif
>
>  #if defined(CONFIG_DISPLAY_CPUINFO)
> +static const char *get_cpu_type(void)
> +{
> +       struct mx28_digctl_regs *digctl_regs =
> +               (struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
> +
> +       switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) {
> +       case 0x2800:
> +               return "28";
> +       case 0x3728:
> +               return "23";
> +       default:
> +               return "<unidentified>";
> +       }
> +}
> +
> +static u8 get_cpu_rev(void)
> +{
> +       struct mx28_digctl_regs *digctl_regs =
> +               (struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
> +
> +       return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F;
> +}
> +
>  int print_cpuinfo(void)
>  {
>        struct mx28_spl_data *data = (struct mx28_spl_data *)
>                ((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf);
>
> -       printf("Freescale i.MX28 family at %d MHz\n",
> -                       mxc_get_clock(MXC_ARM_CLK) / 1000000);
> +       printf("CPU:   Freescale i.MX%s rev%d at %d MHz\n",

In all other i.MX SoCs we display the revision as rev%d.%d, for example:

rev1.0 , rev1.1 , etc.

I think we should print it in the same format here (x.y)


More information about the U-Boot mailing list