board: ti: j721e: Add support for detecting multiple device trees
Update the board_fit_config_name_match() to choose the right dtb based on the board name read from EEPROM. Also restrict multpile EEPROM reads by verifying if EEPROM is already read. Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
This commit is contained in:
		
							parent
							
								
									ee59fa45c8
								
							
						
					
					
						commit
						d8004919aa
					
				| 
						 | 
					@ -88,8 +88,17 @@ int dram_init_banksize(void)
 | 
				
			||||||
#ifdef CONFIG_SPL_LOAD_FIT
 | 
					#ifdef CONFIG_SPL_LOAD_FIT
 | 
				
			||||||
int board_fit_config_name_match(const char *name)
 | 
					int board_fit_config_name_match(const char *name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!strcmp(name, "k3-j721e-common-proc-board"))
 | 
						bool eeprom_read = board_ti_was_eeprom_read();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!eeprom_read || board_is_j721e_som()) {
 | 
				
			||||||
 | 
							if (!strcmp(name, "k3-j721e-common-proc-board") ||
 | 
				
			||||||
 | 
							    !strcmp(name, "k3-j721e-r5-common-proc-board"))
 | 
				
			||||||
			return 0;
 | 
								return 0;
 | 
				
			||||||
 | 
						} else if (board_is_j721e_sk()) {
 | 
				
			||||||
 | 
							if (!strcmp(name, "k3-j721e-sk") ||
 | 
				
			||||||
 | 
							    !strcmp(name, "k3-j721e-r5-sk"))
 | 
				
			||||||
 | 
								return 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -153,6 +162,9 @@ int do_board_detect(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (board_ti_was_eeprom_read())
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
 | 
						ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
 | 
				
			||||||
					 CONFIG_EEPROM_CHIP_ADDRESS);
 | 
										 CONFIG_EEPROM_CHIP_ADDRESS);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue