[Skiboot] [PATCH 2/2] hdata/i2c: Add status property to I2C devices

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Sat Sep 22 00:14:41 AEST 2018


If compatible property is NULL, then Linux cannot do much with those
devices. Lets mark such device as 'reserved'.

Suggested-by: Oliver O'Halloran <oohall at gmail.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hdata/i2c.c       | 6 +++++-
 libstb/tpm_chip.c | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/hdata/i2c.c b/hdata/i2c.c
index 8d4403e4e..81a7695e2 100644
--- a/hdata/i2c.c
+++ b/hdata/i2c.c
@@ -340,8 +340,12 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
 		dt_add_property_cells(node, "reg", dev_addr);
 		dt_add_property_cells(node, "link-id",
 			be32_to_cpu(dev->i2c_link));
-		if (compat)
+		if (compat) {
 			dt_add_property_string(node, "compatible", compat);
+			dt_add_property_string(node, "status", "okay");
+		} else {
+			dt_add_property_string(node, "status", "reserved");
+		}
 		if (label)
 			dt_add_property_string(node, "label", label);
 
diff --git a/libstb/tpm_chip.c b/libstb/tpm_chip.c
index 2858cafb1..58e5f7530 100644
--- a/libstb/tpm_chip.c
+++ b/libstb/tpm_chip.c
@@ -313,6 +313,7 @@ int tpm_extendl(TPM_Pcr pcr,
 void tpm_add_status_property(void) {
 	struct tpm_chip *tpm;
 	list_for_each(&tpm_list, tpm, link) {
+		dt_check_del_prop(tpm->node, "status");
 		dt_add_property_string(tpm->node, "status",
 				       tpm->enabled ? "okay" : "disabled");
 	}
-- 
2.14.3



More information about the Skiboot mailing list