Skip to content

Commit

Permalink
platforms/nicole: Fixup the system VPD EEPROM size
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Artem Senichev <a.senichev@yadro.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
artemsen authored and oohal committed Jan 29, 2020
1 parent 518ab49 commit f929203
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions platforms/astbmc/nicole.c
Expand Up @@ -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"))
Expand All @@ -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;
Expand Down

0 comments on commit f929203

Please sign in to comment.