mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 14:00:19 +00:00 
			
		
		
		
	mx53loco: Allow to print CPU information at a later stage
Print CPU information within board_late_init(). This is in preparation for adding 1GHz support, which requires programming a PMIC via I2C. As I2C is only available after relocation, print the CPU information later at board_late_init(), so that the CPU frequency can be printed correctly. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Stefano Babic <sbabic@denx.de>
This commit is contained in:
		
							parent
							
								
									70cc86a630
								
							
						
					
					
						commit
						1fc56f1cb0
					
				@ -35,7 +35,7 @@
 | 
				
			|||||||
#include <fsl_esdhc.h>
 | 
					#include <fsl_esdhc.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static char *get_reset_cause(void)
 | 
					char *get_reset_cause(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u32 cause;
 | 
						u32 cause;
 | 
				
			||||||
	struct src *src_regs = (struct src *)SRC_BASE_ADDR;
 | 
						struct src *src_regs = (struct src *)SRC_BASE_ADDR;
 | 
				
			||||||
 | 
				
			|||||||
@ -37,5 +37,6 @@ void set_chipselect_size(int const);
 | 
				
			|||||||
int fecmxc_initialize(bd_t *bis);
 | 
					int fecmxc_initialize(bd_t *bis);
 | 
				
			||||||
u32 get_ahb_clk(void);
 | 
					u32 get_ahb_clk(void);
 | 
				
			||||||
u32 get_periph_clk(void);
 | 
					u32 get_periph_clk(void);
 | 
				
			||||||
 | 
					char *get_reset_cause(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
				
			|||||||
@ -299,6 +299,28 @@ int board_early_init_f(void)
 | 
				
			|||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int print_cpuinfo(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						u32 cpurev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cpurev = get_cpu_rev();
 | 
				
			||||||
 | 
						printf("CPU:   Freescale i.MX%x family rev%d.%d at %d MHz\n",
 | 
				
			||||||
 | 
							(cpurev & 0xFF000) >> 12,
 | 
				
			||||||
 | 
							(cpurev & 0x000F0) >> 4,
 | 
				
			||||||
 | 
							(cpurev & 0x0000F) >> 0,
 | 
				
			||||||
 | 
							mxc_get_clock(MXC_ARM_CLK) / 1000000);
 | 
				
			||||||
 | 
						printf("Reset cause: %s\n", get_reset_cause());
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef CONFIG_BOARD_LATE_INIT
 | 
				
			||||||
 | 
					int board_late_init(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						print_cpuinfo();
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int board_init(void)
 | 
					int board_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 | 
						gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 | 
				
			||||||
 | 
				
			|||||||
@ -27,7 +27,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define CONFIG_SYS_MX5_HCLK	24000000
 | 
					#define CONFIG_SYS_MX5_HCLK	24000000
 | 
				
			||||||
#define CONFIG_SYS_MX5_CLK32		32768
 | 
					#define CONFIG_SYS_MX5_CLK32		32768
 | 
				
			||||||
#define CONFIG_DISPLAY_CPUINFO
 | 
					 | 
				
			||||||
#define CONFIG_DISPLAY_BOARDINFO
 | 
					#define CONFIG_DISPLAY_BOARDINFO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CONFIG_MACH_TYPE	MACH_TYPE_MX53_LOCO
 | 
					#define CONFIG_MACH_TYPE	MACH_TYPE_MX53_LOCO
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user