[Skiboot] [PATCH] platforms/nicole: Fixup the system VPD EEPROM size

Artem Senichev artemsen at gmail.com
Thu Dec 12 21:35:24 AEDT 2019


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 at yadro.com>
---
 platforms/astbmc/nicole.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/platforms/astbmc/nicole.c b/platforms/astbmc/nicole.c
index 6893cddb..31247934 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 at 603fc00000000/i2cm at a2000/i2c-bus at 0/eeprom at 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;
-- 
2.24.0



More information about the Skiboot mailing list