arm: omap: Detect boot mode very early
ROM stores the boot params information in a known location and passes it to SPL. This information needs to be copied very early during boot or else there is a chance of getting corrupted by SPL. So move this boot device detection very early during boot. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
		
							parent
							
								
									d754254f20
								
							
						
					
					
						commit
						4bd754d8ab
					
				|  | @ -333,6 +333,14 @@ void early_system_init(void) | ||||||
| 	set_uart_mux_conf(); | 	set_uart_mux_conf(); | ||||||
| 	setup_early_clocks(); | 	setup_early_clocks(); | ||||||
| 	uart_soft_reset(); | 	uart_soft_reset(); | ||||||
|  | #ifdef CONFIG_SPL_BUILD | ||||||
|  | 	/*
 | ||||||
|  | 	 * Save the boot parameters passed from romcode. | ||||||
|  | 	 * We cannot delay the saving further than this, | ||||||
|  | 	 * to prevent overwrites. | ||||||
|  | 	 */ | ||||||
|  | 	save_omap_boot_params(); | ||||||
|  | #endif | ||||||
| #ifdef CONFIG_DEBUG_UART_OMAP | #ifdef CONFIG_DEBUG_UART_OMAP | ||||||
| 	debug_uart_init(); | 	debug_uart_init(); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | @ -195,13 +195,6 @@ u32 spl_boot_mode(const u32 boot_device) | ||||||
| 
 | 
 | ||||||
| void spl_board_init(void) | void spl_board_init(void) | ||||||
| { | { | ||||||
| 	/*
 |  | ||||||
| 	 * Save the boot parameters passed from romcode. |  | ||||||
| 	 * We cannot delay the saving further than this, |  | ||||||
| 	 * to prevent overwrites. |  | ||||||
| 	 */ |  | ||||||
| 	save_omap_boot_params(); |  | ||||||
| 
 |  | ||||||
| 	/* Prepare console output */ | 	/* Prepare console output */ | ||||||
| 	preloader_console_init(); | 	preloader_console_init(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -158,6 +158,14 @@ void early_system_init(void) | ||||||
| 	do_io_settings(); | 	do_io_settings(); | ||||||
| #endif | #endif | ||||||
| 	setup_early_clocks(); | 	setup_early_clocks(); | ||||||
|  | #ifdef CONFIG_SPL_BUILD | ||||||
|  | 	/*
 | ||||||
|  | 	 * Save the boot parameters passed from romcode. | ||||||
|  | 	 * We cannot delay the saving further than this, | ||||||
|  | 	 * to prevent overwrites. | ||||||
|  | 	 */ | ||||||
|  | 	save_omap_boot_params(); | ||||||
|  | #endif | ||||||
| 	do_board_detect(); | 	do_board_detect(); | ||||||
| 	vcores_init(); | 	vcores_init(); | ||||||
| #ifdef CONFIG_DEBUG_UART_OMAP | #ifdef CONFIG_DEBUG_UART_OMAP | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue