This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

When am335x_evm_setup(...) is called ?

Other Parts Discussed in Thread: TLC59108, TPS65910

Hi,

I am using beaglebone. I don't know when am335x_evm_setup( ... ) will be called in the process of booting the board?

static struct at24_platform_data am335x_baseboard_eeprom_info = {
.byte_len = (256*1024) / 8,
.page_size = 64,
.flags = AT24_FLAG_ADDR16,
.setup = am335x_evm_setup,
.context = (void *)NULL,
};

static struct i2c_board_info __initdata am335x_i2c_boardinfo[] = {
{
/* Daughter Board EEPROM */
I2C_BOARD_INFO("24c256", DAUG_BOARD_I2C_ADDR),
.platform_data = &am335x_daughter_board_eeprom_info,
},
{
/* Baseboard board EEPROM */
I2C_BOARD_INFO("24c256", BASEBOARD_I2C_ADDR),
.platform_data = &am335x_baseboard_eeprom_info,
},
{
I2C_BOARD_INFO("cpld_reg", 0x35),
},
{
I2C_BOARD_INFO("tlc59108", 0x40),
},
{
I2C_BOARD_INFO("tps65910", TPS65910_I2C_ID1),
.platform_data = &am335x_tps65910_info,
},

};

MACHINE_START(AM335XEVM, "am335xevm")
/* Maintainer: Texas Instruments */
.atag_offset = 0x100,
.map_io = am335x_evm_map_io,
.init_irq = ti816x_init_irq,
.init_early = am335x_init_early,
.timer = &omap3_am33xx_timer,
.init_machine = am335x_evm_init,
MACHINE_END

  • in linux-src/arch/arm/mach-omap2/board-am335xevm.c

    am335x_evm_init() --> am335x_evm_i2c_init()

    am335x_evm_i2c_init() registers i2c bus with board info am335x_i2c_boardinfo and says that it has eeprom @ addr DAUG_BOARD_I2C_ADDR

    static struct at24_platform_data am335x_baseboard_eeprom_info = {
        .byte_len       = (256*1024) / 8,
        .page_size      = 64,
        .flags          = AT24_FLAG_ADDR16,
        .setup          = am335x_evm_setup,
        .context        = (void *)NULL,
    };


    static struct i2c_board_info __initdata am335x_i2c_boardinfo[] = {
        {
            /* Daughter Board EEPROM */
            I2C_BOARD_INFO("24c256", DAUG_BOARD_I2C_ADDR),
            .platform_data  = &am335x_daughter_board_eeprom_info,
        },
        {
            /* Baseboard board EEPROM */
            I2C_BOARD_INFO("24c256", BASEBOARD_I2C_ADDR),
            .platform_data  = &am335x_baseboard_eeprom_info,
        },

    i2c bus initializes & calls device setup for devices sitting on the i2c bus

    This calls drivers/misc/eeprom.c which internally calls drivers/misc/at24.c

    in at24.c, at24_probe() checks for chip>setup & if presents calls this setup.

    voila there comes the call to am335x_evm_setup because for our chip (eeprom) this points to am335x_evm_setup().

    Hope this helps

    Regards

    Gururaja