[Skiboot] [PATCH 23/61] VAS: Enable VAS on P10

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Jul 19 23:19:34 AEST 2021


From: Haren Myneni <haren at linux.ibm.com>

Enable VAS on P10 based on "ibm,power10-vas-x" compatible string
and export the new compatible property to kernel.

Signed-off-by: Haren Myneni <haren at linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/vas.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/hw/vas.c b/hw/vas.c
index c9639831f..8617b8d59 100644
--- a/hw/vas.c
+++ b/hw/vas.c
@@ -462,6 +462,7 @@ static void create_mm_dt_node(struct proc_chip *chip)
 {
 	struct dt_node *dn;
 	struct vas *vas;
+	const char *compat;
 	uint64_t hvwc_start, hvwc_len;
 	uint64_t uwc_start, uwc_len;
 	uint64_t pbf_start, pbf_nbits;
@@ -473,9 +474,14 @@ static void create_mm_dt_node(struct proc_chip *chip)
 	get_paste_bar(chip->id, &pbar_start, &pbar_len);
 	get_paste_bitfield(&pbf_start, &pbf_nbits);
 
+	if (proc_gen == proc_gen_p9)
+		compat = "ibm,power9-vas";
+	else
+		compat = "ibm,power10-vas";
+
 	dn = dt_new_addr(dt_root, "vas", hvwc_start);
 
-	dt_add_property_strings(dn, "compatible", "ibm,power9-vas",
+	dt_add_property_strings(dn, "compatible", compat,
 					"ibm,vas");
 
 	dt_add_property_u64s(dn, "reg", hvwc_start, hvwc_len,
@@ -579,13 +585,18 @@ void vas_init(void)
 {
 	bool enabled;
 	struct dt_node *np;
+	const char *compat;
 
-	if (proc_gen != proc_gen_p9)
+	if (proc_gen == proc_gen_p9)
+		compat = "ibm,power9-vas-x";
+	else if (proc_gen == proc_gen_p10)
+		compat = "ibm,power10-vas-x";
+	else
 		return;
 
 	enabled = vas_nx_enabled();
 
-	dt_for_each_compatible(dt_root, np, "ibm,power9-vas-x") {
+	dt_for_each_compatible(dt_root, np, compat) {
 		if (init_vas_inst(np, enabled))
 			goto out;
 	}
@@ -594,7 +605,7 @@ void vas_init(void)
 	return;
 
 out:
-	dt_for_each_compatible(dt_root, np, "ibm,power9-vas-x")
+	dt_for_each_compatible(dt_root, np, compat)
 		disable_vas_inst(np);
 
 	vas_err("Disabled (failed initialization)\n");
-- 
2.31.1



More information about the Skiboot mailing list