diff --git a/platforms/astbmc/nicole.c b/platforms/astbmc/nicole.c index 6893cddbd815..cc71924bfe24 100644 --- a/platforms/astbmc/nicole.c +++ b/platforms/astbmc/nicole.c @@ -34,6 +34,26 @@ static const struct slot_table_entry nicole_phb_table[] = { { .etype = st_end }, }; +/* Fixup the system VPD EEPROM size. + * + * Hostboot doesn't export the correct description for EEPROMs, as a result, + * all EEPROMs in the system work in "atmel,24c128" compatibility mode (16KiB). + * Nicole platform has 32KiB EEPROM for the system VPD. + */ +static void vpd_dt_fixup(void) +{ + struct dt_node* vpd_eeprom = dt_find_by_path(dt_root, + "/xscom@603fc00000000/i2cm@a2000/i2c-bus@0/eeprom@50"); + + if (vpd_eeprom) { + dt_check_del_prop(vpd_eeprom, "compatible"); + dt_add_property_string(vpd_eeprom, "compatible", "atmel,24c256"); + + dt_check_del_prop(vpd_eeprom, "label"); + dt_add_property_string(vpd_eeprom, "label", "system-vpd"); + } +} + static bool nicole_probe(void) { if (!dt_node_is_compatible(dt_root, "YADRO,nicole")) @@ -45,6 +65,9 @@ static bool nicole_probe(void) /* Setup UART for use by OPAL (Linux hvc) */ uart_set_console_policy(UART_CONSOLE_OPAL); + /* Fixup system VPD EEPROM size */ + vpd_dt_fixup(); + slot_table_init(nicole_phb_table); return true;