Can read the eeprom content once and hardcode into u-boot?
yes, pretty easy :
edit board/ti/am335x/evm.c
void spl_board_init(void)
{
uchar pmic_status_reg;
/* init board_id, configure muxes */
board_init();
if(1){ // assum we use bone
// if (!strncmp("A335BONE", [header.name](http://header.name), 8)) {
/* BeagleBone PMIC Code */
if (i2c_probe(TPS65217_CHIP_PM))
return;
if (tps65217_reg_read(STATUS, &pmic_status_reg))
return;
/* Increase USB current limit to 1300mA */
if (tps65217_reg_write(PROT_LEVEL_NONE, POWER_PATH,
USB_INPUT_CUR_LIMIT_1300MA,
USB_INPUT_CUR_LIMIT_MASK))
printf("tps65217_reg_write failure\n");
/* Only perform PMIC configurations if board rev > A1 */
if (!strncmp(header.version, "00A1", 4))
return;
/* Set DCDC2 (MPU) voltage to 1.275V */
if (tps65217_voltage_update(DEFDCDC2,
DCDC_VOLT_SEL_1275MV)) {
printf("tps65217_voltage_update failure\n");
return;
}
/* Set LDO3, LDO4 output voltage to 3.3V */
if (tps65217_reg_write(PROT_LEVEL_2, DEFLS1,
LDO_VOLTAGE_OUT_3_3, LDO_MASK))
printf("tps65217_reg_write failure\n");
if (tps65217_reg_write(PROT_LEVEL_2, DEFLS2,
LDO_VOLTAGE_OUT_3_3, LDO_MASK))
printf("tps65217_reg_write failure\n");
if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
printf("No AC power, disabling frequency switch\n");
return;
}
/* Set MPU Frequency to 720MHz */
mpu_pll_config(MPUPLL_M_720);
...
yes, pretty easy :
edit board/ti/am335x/evm.c
void spl_board_init(void) { uchar pmic_status_reg; /* init board_id, configure muxes */ board_init(); if(1){ // assum we use bone // if (!strncmp("A335BONE", [header.name](http://header.name), 8)) { /* BeagleBone PMIC Code */ if (i2c_probe(TPS65217_CHIP_PM)) return; if (tps65217_reg_read(STATUS, &pmic_status_reg)) return; /* Increase USB current limit to 1300mA */ if (tps65217_reg_write(PROT_LEVEL_NONE, POWER_PATH, USB_INPUT_CUR_LIMIT_1300MA, USB_INPUT_CUR_LIMIT_MASK)) printf("tps65217_reg_write failure\n"); /* Only perform PMIC configurations if board rev > A1 */ if (!strncmp(header.version, "00A1", 4)) return; /* Set DCDC2 (MPU) voltage to 1.275V */ if (tps65217_voltage_update(DEFDCDC2, DCDC_VOLT_SEL_1275MV)) { printf("tps65217_voltage_update failure\n"); return; } /* Set LDO3, LDO4 output voltage to 3.3V */ if (tps65217_reg_write(PROT_LEVEL_2, DEFLS1, LDO_VOLTAGE_OUT_3_3, LDO_MASK)) printf("tps65217_reg_write failure\n"); if (tps65217_reg_write(PROT_LEVEL_2, DEFLS2, LDO_VOLTAGE_OUT_3_3, LDO_MASK)) printf("tps65217_reg_write failure\n"); if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) { printf("No AC power, disabling frequency switch\n"); return; } /* Set MPU Frequency to 720MHz */ mpu_pll_config(MPUPLL_M_720);
This will not do. A lot of the code (and even a bit more when you start talking Black) depend on the EEPROM contents to see which of the 4 boards and their variations we’re on. If you MUST go this way, what you want to do is make read_eeprom populate the in-memory copy of the EEPROM data as pretending to be the board you almost have.
Please tell the eeprom address for reading on bbb