mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-03 21:48:15 +00:00 
			
		
		
		
	arm: stm32mp: bsec: Update OTP shadow registers in SPL
Currently the upper OTP (after 57) are shadowed in U-Boot proper, when TFABOOT is not used. This choice cause an issue when U-Boot is not executed after SPL, so this BSEC initialization is moved in SPL and no more executed in U-Boot, so it is still executed only one time. After this patch this BSEC initialization is done in FSBL: SPL or TF-A. To force this initialization in all the case, the probe of the BSEC driver is forced in SPL in the arch st32mp function: spl_board_init(). Even if today BSEC driver is already probed in STM32MP15x clock driver clk_stm32mp1.c because get_cpu_type() is called in stm32mp1_get_max_opp_freq() function. Reported-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
		
							parent
							
								
									819408d001
								
							
						
					
					
						commit
						9788708f03
					
				@ -503,10 +503,9 @@ static int stm32mp_bsec_probe(struct udevice *dev)
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * update unlocked shadow for OTP cleared by the rom code
 | 
			
		||||
	 * only executed in U-Boot proper when TF-A is not used
 | 
			
		||||
	 * only executed in SPL, it is done in TF-A for TFABOOT
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	if (!IS_ENABLED(CONFIG_TFABOOT) && !IS_ENABLED(CONFIG_SPL_BUILD)) {
 | 
			
		||||
	if (IS_ENABLED(CONFIG_SPL_BUILD)) {
 | 
			
		||||
		plat = dev_get_plat(dev);
 | 
			
		||||
 | 
			
		||||
		for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++)
 | 
			
		||||
 | 
			
		||||
@ -174,7 +174,15 @@ static void dbgmcu_init(void)
 | 
			
		||||
 | 
			
		||||
void spl_board_init(void)
 | 
			
		||||
{
 | 
			
		||||
	struct udevice *dev;
 | 
			
		||||
	int ret;
 | 
			
		||||
 | 
			
		||||
	dbgmcu_init();
 | 
			
		||||
 | 
			
		||||
	/* force probe of BSEC driver to shadow the upper OTP */
 | 
			
		||||
	ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(stm32mp_bsec), &dev);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		log_warning("BSEC probe failed: %d\n", ret);
 | 
			
		||||
}
 | 
			
		||||
#endif /* !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user