diff mbox series

platforms/nicole: Fixup the system VPD EEPROM size

Message ID 20191212103524.mes2eh76wywohebr@gmail.com
State Accepted
Headers show
Series platforms/nicole: Fixup the system VPD EEPROM size | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d75e82dbfbb9443efeb3f9a5921ac23605aab469)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Artem Senichev Dec. 12, 2019, 10:35 a.m. UTC
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>
---
 platforms/astbmc/nicole.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Oliver O'Halloran Feb. 3, 2020, 1:43 a.m. UTC | #1
On Thu, Dec 12, 2019 at 9:43 PM Artem Senichev <artemsen@gmail.com> wrote:
>
> 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>

Thanks, merged to master as f92920372d98ad1ff378750871ca2f76344435c5
diff mbox series

Patch

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@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;