mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
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. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
This commit is contained in:
parent
7c5e6f7a5d
commit
b0261b1212
2 changed files with 40 additions and 2 deletions
|
@ -188,12 +188,46 @@ int arch_cpu_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
#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)
|
int print_cpuinfo(void)
|
||||||
{
|
{
|
||||||
struct mx28_spl_data *data = (struct mx28_spl_data *)
|
struct mx28_spl_data *data = (struct mx28_spl_data *)
|
||||||
((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf);
|
((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf);
|
||||||
|
|
||||||
printf("Freescale i.MX28 family at %d MHz\n",
|
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);
|
mxc_get_clock(MXC_ARM_CLK) / 1000000);
|
||||||
printf("BOOT: %s\n", mx28_boot_modes[data->boot_mode_idx].mode);
|
printf("BOOT: %s\n", mx28_boot_modes[data->boot_mode_idx].mode);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -152,4 +152,8 @@ struct mx28_digctl_regs {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Product code identification */
|
||||||
|
#define HW_DIGCTL_CHIPID_MASK (0xffff << 16)
|
||||||
|
#define HW_DIGCTL_CHIPID_MX28 (0x2800 << 16)
|
||||||
|
|
||||||
#endif /* __MX28_REGS_DIGCTL_H__ */
|
#endif /* __MX28_REGS_DIGCTL_H__ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue