Part Number: AM4376
As customer board also mount a EEPROM on board, but it is connected on I2C2. so need to modify SPL to enable it.
I add I2C2 pinmux in board/ti/am437x/board.c
void gpi2c_init(void)
{
/* When needed to be invoked prior to BSS initialization */
static bool first_time = true;
if (first_time) {
enable_i2c0_pin_mux();
enable_i2c2_pin_mux();
#ifndef CONFIG_DM_I2C
i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED,
CONFIG_SYS_OMAP24_I2C_SLAVE);
#endif
first_time = false;
}
}
and add I2C clock in arch/arm/mach-omap2/am33xx/clock_am43xx.c
u32 *const clk_modules_explicit_en[] = {
&cmper->l3clkctrl,
&cmper->l4lsclkctrl,
&cmper->l4fwclkctrl,
&cmwkup->wkl4wkclkctrl,
&cmper->l3instrclkctrl,
&cmper->l4hsclkctrl,
&cmwkup->wkgpio0clkctrl,
&cmwkup->wkctrlclkctrl,
&cmper->timer2clkctrl,
&cmper->gpmcclkctrl,
&cmper->elmclkctrl,
&cmper->mmc0clkctrl,
&cmper->mmc1clkctrl,
&cmwkup->wkup_i2c0ctrl,
&cmper->gpio1clkctrl,
&cmper->gpio2clkctrl,
&cmper->gpio3clkctrl,
&cmper->gpio4clkctrl,
&cmper->gpio5clkctrl,
&cmper->i2c1clkctrl,
&cmper->i2c2clkctrl, /* add to support I2C2*/
&cmper->cpgmac0clkctrl,
&cmper->emiffwclkctrl,
&cmper->emifclkctrl,
&cmper->otfaemifclkctrl,
&cmper->qspiclkctrl,
&cmper->spi0clkctrl,
0
};
but in board/ti/am43xx/board.c, need to change CONFIG_EEPROM_BUS_ADDRESS definition in Autoconf.h which is autogenerated.
#ifdef CONFIG_TI_I2C_BOARD_DETECT
void do_board_detect(void)
{
/* Ensure I2C is initialized for EEPROM access*/
gpi2c_init();
if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
CONFIG_EEPROM_CHIP_ADDRESS))
printf("ti_i2c_eeprom_init failed\n");
}
Where to change the auto defined macro? I don't know where it is pre-defined.
And any other modification to enable I2C2 in SPL?