diff mbox series

witherspoon: Fix VPD EEPROM type

Message ID 20180124225310.19280-1-oohall@gmail.com
State Accepted
Headers show
Series witherspoon: Fix VPD EEPROM type | expand

Commit Message

Oliver O'Halloran Jan. 24, 2018, 10:53 p.m. UTC
There are userspace tools that update the planar VPD via the sysfs
interface. Currently we do not get correct information from hostboot
about the exact type of the EEPROM so we need to manually fix it up
here. This needs to be done as a platform specific fix since there is
not standardised VPD EEPROM type.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 platforms/astbmc/witherspoon.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Stewart Smith Feb. 1, 2018, 8:23 a.m. UTC | #1
Oliver O'Halloran <oohall@gmail.com> writes:
> There are userspace tools that update the planar VPD via the sysfs
> interface. Currently we do not get correct information from hostboot
> about the exact type of the EEPROM so we need to manually fix it up
> here. This needs to be done as a platform specific fix since there is
> not standardised VPD EEPROM type.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>  platforms/astbmc/witherspoon.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)

Thanks, merged to master as of 0e2541f1c6648d20174b6fe080649cee828a43a3.

One day we should go through all these random hacks and ensure that the
cause of them is fixed...
diff mbox series

Patch

diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c
index 9460b6d15fb4..cb09eefe048c 100644
--- a/platforms/astbmc/witherspoon.c
+++ b/platforms/astbmc/witherspoon.c
@@ -30,6 +30,24 @@ 
 
 #include "astbmc.h"
 
+/*
+ * 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 witherspoon_probe(void)
 {
 	if (!dt_node_is_compatible(dt_root, "ibm,witherspoon"))
@@ -41,6 +59,8 @@  static bool witherspoon_probe(void)
 	/* Setup UART for use by OPAL (Linux hvc) */
 	uart_set_console_policy(UART_CONSOLE_OPAL);
 
+	vpd_dt_fixup();
+
 	return true;
 }