Message ID | 20201014090954.31552-2-Lulu_Su@wistron.com |
---|---|
State | Superseded |
Headers | show |
Series | platform/mowgli: modify VPD to export correct data to system VPD EEPROM | expand |
On 10/14/20 2:39 PM, Lulu Su wrote: > From: LuluTHSu <Lulu_Su@wistron.com> > > Hostboot doesn't export the correct data for the system VPD EEPROM for this system. > So add vpd_dt_fixup(). > > Cc: skiboot-stable@lists.ozlabs.org Hi Lulu, My understanding is Mowgli is using latest skiboot. Do you still want this patch in stable branch? If so can you tell me in which branch you want this fix? -Vasant > Signed-off-by: LuluTHSu <Lulu_Su@wistron.com> > --- > platforms/astbmc/mowgli.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/platforms/astbmc/mowgli.c b/platforms/astbmc/mowgli.c > index 265cab3..e61a109 100644 > --- a/platforms/astbmc/mowgli.c > +++ b/platforms/astbmc/mowgli.c > @@ -30,6 +30,24 @@ static const struct slot_table_entry mowgli_phb_table[] = { > { .etype = st_end }, > }; > > +/* > + * HACK: Hostboot doesn't export the correct data for the system VPD EEPROM > + * for this system. So we need to work around it here. > + */ > +static void vpd_dt_fixup(void) > +{ > + struct dt_node *n = dt_find_by_path(dt_root, > + "/xscom@603fc00000000/i2cm@a2000/i2c-bus@0/eeprom@50"); > + > + if (n) { > + dt_check_del_prop(n, "compatible"); > + dt_add_property_string(n, "compatible", "atmel,24c512"); > + > + dt_check_del_prop(n, "label"); > + dt_add_property_string(n, "label", "system-vpd"); > + } > +} > + > static bool mowgli_probe(void) > { > if (!dt_node_is_compatible(dt_root, "ibm,mowgli")) > @@ -41,6 +59,8 @@ static bool mowgli_probe(void) > /* Setup UART for use by OPAL (Linux hvc) */ > uart_set_console_policy(UART_CONSOLE_OPAL); > > + vpd_dt_fixup(); > + > slot_table_init(mowgli_phb_table); > > return true; >
diff --git a/platforms/astbmc/mowgli.c b/platforms/astbmc/mowgli.c index 265cab3..e61a109 100644 --- a/platforms/astbmc/mowgli.c +++ b/platforms/astbmc/mowgli.c @@ -30,6 +30,24 @@ static const struct slot_table_entry mowgli_phb_table[] = { { .etype = st_end }, }; +/* + * HACK: Hostboot doesn't export the correct data for the system VPD EEPROM + * for this system. So we need to work around it here. + */ +static void vpd_dt_fixup(void) +{ + struct dt_node *n = dt_find_by_path(dt_root, + "/xscom@603fc00000000/i2cm@a2000/i2c-bus@0/eeprom@50"); + + if (n) { + dt_check_del_prop(n, "compatible"); + dt_add_property_string(n, "compatible", "atmel,24c512"); + + dt_check_del_prop(n, "label"); + dt_add_property_string(n, "label", "system-vpd"); + } +} + static bool mowgli_probe(void) { if (!dt_node_is_compatible(dt_root, "ibm,mowgli")) @@ -41,6 +59,8 @@ static bool mowgli_probe(void) /* Setup UART for use by OPAL (Linux hvc) */ uart_set_console_policy(UART_CONSOLE_OPAL); + vpd_dt_fixup(); + slot_table_init(mowgli_phb_table); return true;