i.MX28: extend print_cpuinfo() to use chip information
PATCH v3 1/1 i.MX28: extend print_cpuinfo() to use chip information
The information now is gathered from HW_DIGCTL_CHIPID register and includes the chip modem and revision on the output.
---
Changes in v2:
- use ?? for unidentified revision and cpu type
- use numeric revisions
Changes in v3:
- drop mx23 data as it will be posted in a later patch
- fix info order (first rev, then clock)
arch/arm/cpu/arm926ejs/mx28/mx28.c | 38 ++++++++++++++++++++++++-- arch/arm/include/asm/arch-mx28/regs-digctl.h | 4 +++ 2 files changed, 40 insertions(+), 2 deletions(-)
arch/arm/cpu/arm926ejs/mx28/mx28.c +36 -2
@@ -188,13 +188,47 @@ int arch_cpu_init(void) }#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) &HW_DIGCTL_CHIPID_MASK ) { +case HW_DIGCTL_CHIPID_MX28 : +return "28" ; +default : +return "??" ; + } +} + +static const char *get_cpu_rev (void ) +{ +struct mx28_digctl_regs *digctl_regs = + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE ; +uint8_t rev =readl (&digctl_regs->hw_digctl_chipid) &0x000000FF ; + +switch (readl (&digctl_regs->hw_digctl_chipid) &HW_DIGCTL_CHIPID_MASK ) { +case HW_DIGCTL_CHIPID_MX28 : +switch (rev) { +case 0x1 : +return "1.2" ; +default : +return "??" ; + } +default : +return "??" ; + } +} +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%s at %d MHz\n" , +get_cpu_type (), +get_cpu_rev (), +mxc_get_clock (MXC_ARM_CLK ) /1000000 );printf ("BOOT: %s\n" , mx28_boot_modes[data->boot_mode_idx].mode);return 0 ; }
arch/arm/include/asm/arch-mx28/regs-digctl.h +4 -0
@@ -152,4 +152,8 @@ struct mx28_digctl_regs { };#endif +/* Product code identification */ +#define HW_DIGCTL_CHIPID_MASK (0xffff << 16) +#define HW_DIGCTL_CHIPID_MX28 (0x2800 << 16) +#endif /* __MX28_REGS_DIGCTL_H__ */
Signature · 1 line
1.7.10.4
PATCH v3 1/1 i.MX28: extend print_cpuinfo() to use chip information
Dear Otavio Salvador,
Quoted 4 lines
The information now is gathered from
HW_DIGCTL_CHIPIDregister and includes the chip modem and revision on the output.Signed-off-by Otavio Salvador <[email protected]>
This one is OK with me, queue for next maybe?
Quoted 74 lines
---
Changes in v2:
- use ?? for unidentified revision and cpu type
- use numeric revisionsChanges in v3:
- drop mx23 data as it will be posted in a later patch
- fix info order (first rev, then clock)arch/arm/cpu/arm926ejs/mx28/mx28.c | 38 ++++++++++++++++++++++++-- arch/arm/include/asm/arch-mx28/regs-digctl.h | 4 +++ 2 files changed, 40 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/arch/arm/cpu/arm926ejs/mx28/mx28.cindex ff25772..cf7a50f 100644arch/arm/cpu/arm926ejs/mx28/mx28.c +36
-2@@ -188,13 +188,47 @@ int arch_cpu_init(void) }#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) &HW_DIGCTL_CHIPID_MASK ) { +case HW_DIGCTL_CHIPID_MX28 : +return "28" ; +default : +return "??" ; + } +} + +static const char *get_cpu_rev (void ) +{ +struct mx28_digctl_regs *digctl_regs = + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE ; +uint8_t rev =readl (&digctl_regs->hw_digctl_chipid) &0x000000FF ; + +switch (readl (&digctl_regs->hw_digctl_chipid) &HW_DIGCTL_CHIPID_MASK ) { +case HW_DIGCTL_CHIPID_MX28 : +switch (rev) { +case 0x1 : +return "1.2" ; +default : +return "??" ; + } +default : +return "??" ; + } +} +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%s at %d MHz\n" , +get_cpu_type (), +get_cpu_rev (), +mxc_get_clock (MXC_ARM_CLK ) /1000000 );printf ("BOOT: %s\n" , mx28_boot_modes[data->boot_mode_idx].mode);return 0 ; }(quoted diff) +0
-0
b/arch/arm/include/asm/arch-mx28/regs-digctl.hindex 9a63594..247da6e 100644
arch/arm/include/asm/arch-mx28/regs-digctl.h struct mx28_digctl_regs { · line 159
Quoted 8 lines
arch/arm/include/asm/arch-mx28/regs-digctl.h +4
-0@@ -152,4 +152,8 @@ struct mx28_digctl_regs { };#endif +/* Product code identification */ +#define HW_DIGCTL_CHIPID_MASK (0xffff << 16) +#define HW_DIGCTL_CHIPID_MX28 (0x2800 << 16) +#endif /* __MX28_REGS_DIGCTL_H__ */
Best regards,
Marek Vasut
PATCH v3 1/1 i.MX28: extend print_cpuinfo() to use chip information
Quoted 6 lines · Marek Vasut
Quoted 4 lines
The information now is gathered from
HW_DIGCTL_CHIPIDregister and includes the chip modem and revision on the output.Signed-off-by Otavio Salvador <[email protected]>This one is OK with me, queue for next maybe?
Fine with me. This is not urgent but a nice to have one.
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: otavio at ossystems.com.br http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH v3 1/1 i.MX28: extend print_cpuinfo() to use chip information
In reply to Otavio SalvadorQuoted 5 lines · Otavio Salvador
The information now is gathered from
HW_DIGCTL_CHIPIDregister and includes the chip modem and revision on the output.Signed-off-by Otavio Salvador <[email protected]>---
Applied to u-boot-imx, next branch, thanks.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================