[coreboot-gerrit] Change in coreboot[master]: lib/nhlt: add support for passing sub_systemid in nhlt_init()

HARSHAPRIYA N (Code Review) gerrit at coreboot.org
Fri May 4 03:16:36 CEST 2018


HARSHAPRIYA N has uploaded this change for review. ( https://review.coreboot.org/26046


Change subject: lib/nhlt: add support for passing sub_systemid in nhlt_init()
......................................................................

lib/nhlt: add support for passing sub_systemid in nhlt_init()

This patch adds support in nhlt_init() function to recieve the
subsystem_id and set it in every ssp endpoint.

This patch also changes every instance of nhlt_init() function call
to pass the subsystem id. For eve its set to 0x006B. For other boards
its set to default value.

Change-Id: Iad53f27e958f50e02e928cd8fa60d8397ca0eb06
Signed-off-by: Harsha Priya <harshapriya.n at intel.com>
---
M src/include/nhlt.h
M src/lib/nhlt.c
M src/mainboard/google/chell/mainboard.c
M src/mainboard/google/eve/mainboard.c
M src/mainboard/google/fizz/mainboard.c
M src/mainboard/google/glados/mainboard.c
M src/mainboard/google/lars/mainboard.c
M src/mainboard/google/octopus/mainboard.c
M src/mainboard/google/poppy/mainboard.c
M src/mainboard/google/reef/mainboard.c
M src/mainboard/google/zoombini/mainboard.c
M src/mainboard/intel/cannonlake_rvp/mainboard.c
M src/mainboard/intel/glkrvp/mainboard.c
M src/mainboard/intel/kunimitsu/mainboard.c
14 files changed, 22 insertions(+), 16 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/26046/1

diff --git a/src/include/nhlt.h b/src/include/nhlt.h
index ddebd5f..754b9f8 100644
--- a/src/include/nhlt.h
+++ b/src/include/nhlt.h
@@ -44,7 +44,7 @@
  *
  * An example sequence:
  *
- * nhlt = nhlt_init()
+ * nhlt = nhlt_init(ssid)
  * ep = nhlt_add_endpoint()
  * nhlt_endpoint_append_config(ep)
  * nhlt_endpoint_add_formats(ep)
@@ -52,7 +52,7 @@
  */
 
 /* Obtain an nhlt object for adding endpoints. Returns NULL on error. */
-struct nhlt *nhlt_init(void);
+struct nhlt *nhlt_init(int);
 
 /* Return the size of the NHLT table including APCI header. */
 size_t nhlt_current_size(struct nhlt *nhlt);
diff --git a/src/lib/nhlt.c b/src/lib/nhlt.c
index e849f8b..5e24632 100644
--- a/src/lib/nhlt.c
+++ b/src/lib/nhlt.c
@@ -33,10 +33,14 @@
 	.data4 = { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 },
 };
 
-struct nhlt *nhlt_init(void)
+static int subsystem_id = NHLT_SSID;
+
+struct nhlt *nhlt_init(int ssid)
 {
 	struct nhlt *nhlt;
 
+	subsystem_id = ssid;
+
 	nhlt = malloc(sizeof(*nhlt));
 
 	if (nhlt == NULL)
@@ -66,7 +70,7 @@
 	endp->vendor_id = vid;
 	endp->device_id = did;
 	endp->revision_id = NHLT_RID;
-	endp->subsystem_id = NHLT_SSID;
+	endp->subsystem_id = subsystem_id;
 	endp->device_type = device_type;
 	endp->direction = dir;
 	endp->virtual_bus_id = DEFAULT_VIRTUAL_BUS_ID;
diff --git a/src/mainboard/google/chell/mainboard.c b/src/mainboard/google/chell/mainboard.c
index bfa79b4..8796531 100644
--- a/src/mainboard/google/chell/mainboard.c
+++ b/src/mainboard/google/chell/mainboard.c
@@ -37,7 +37,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/google/eve/mainboard.c b/src/mainboard/google/eve/mainboard.c
index 3f444f1..33e67ab 100644
--- a/src/mainboard/google/eve/mainboard.c
+++ b/src/mainboard/google/eve/mainboard.c
@@ -21,6 +21,8 @@
 #include <vendorcode/google/chromeos/chromeos.h>
 #include <soc/nhlt.h>
 
+#define SUBSYSTEM_ID 0x006B
+
 static const char *oem_id_maxim = "GOOGLE";
 static const char *oem_table_id_maxim = "EVEMAX";
 
@@ -38,7 +40,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(SUBSYSTEM_ID);
 	if (!nhlt)
 		return start_addr;
 
diff --git a/src/mainboard/google/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c
index e6a0296..3689b8b 100644
--- a/src/mainboard/google/fizz/mainboard.c
+++ b/src/mainboard/google/fizz/mainboard.c
@@ -243,7 +243,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 	if (!nhlt)
 		return start_addr;
 
diff --git a/src/mainboard/google/glados/mainboard.c b/src/mainboard/google/glados/mainboard.c
index 855d69d..0d07012 100644
--- a/src/mainboard/google/glados/mainboard.c
+++ b/src/mainboard/google/glados/mainboard.c
@@ -37,7 +37,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/google/lars/mainboard.c b/src/mainboard/google/lars/mainboard.c
index e044405..def58a1 100644
--- a/src/mainboard/google/lars/mainboard.c
+++ b/src/mainboard/google/lars/mainboard.c
@@ -37,7 +37,7 @@
 
 		start_addr = current;
 
-		nhlt = nhlt_init();
+		nhlt = nhlt_init(NHLT_SSID);
 
 		if (nhlt == NULL)
 			return start_addr;
diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c
index 3709823..75f4987 100644
--- a/src/mainboard/google/octopus/mainboard.c
+++ b/src/mainboard/google/octopus/mainboard.c
@@ -50,7 +50,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/google/poppy/mainboard.c b/src/mainboard/google/poppy/mainboard.c
index 743a920..6064637 100644
--- a/src/mainboard/google/poppy/mainboard.c
+++ b/src/mainboard/google/poppy/mainboard.c
@@ -38,7 +38,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c
index 7f5a1b3..e358feb 100644
--- a/src/mainboard/google/reef/mainboard.c
+++ b/src/mainboard/google/reef/mainboard.c
@@ -118,7 +118,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/google/zoombini/mainboard.c b/src/mainboard/google/zoombini/mainboard.c
index eee2d74..bbbe611 100644
--- a/src/mainboard/google/zoombini/mainboard.c
+++ b/src/mainboard/google/zoombini/mainboard.c
@@ -34,7 +34,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/intel/cannonlake_rvp/mainboard.c b/src/mainboard/intel/cannonlake_rvp/mainboard.c
index 316485d..9044209 100644
--- a/src/mainboard/intel/cannonlake_rvp/mainboard.c
+++ b/src/mainboard/intel/cannonlake_rvp/mainboard.c
@@ -40,7 +40,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/intel/glkrvp/mainboard.c b/src/mainboard/intel/glkrvp/mainboard.c
index ac5e973..be84ac2 100644
--- a/src/mainboard/intel/glkrvp/mainboard.c
+++ b/src/mainboard/intel/glkrvp/mainboard.c
@@ -50,7 +50,7 @@
 
 	start_addr = current;
 
-	nhlt = nhlt_init();
+	nhlt = nhlt_init(NHLT_SSID);
 
 	if (nhlt == NULL)
 		return start_addr;
diff --git a/src/mainboard/intel/kunimitsu/mainboard.c b/src/mainboard/intel/kunimitsu/mainboard.c
index cbadc2e..02dc6b9 100644
--- a/src/mainboard/intel/kunimitsu/mainboard.c
+++ b/src/mainboard/intel/kunimitsu/mainboard.c
@@ -52,7 +52,7 @@
 
 		start_addr = current;
 
-		nhlt = nhlt_init();
+		nhlt = nhlt_init(NHLT_SSID);
 
 		if (nhlt == NULL)
 			return start_addr;

-- 
To view, visit https://review.coreboot.org/26046
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad53f27e958f50e02e928cd8fa60d8397ca0eb06
Gerrit-Change-Number: 26046
Gerrit-PatchSet: 1
Gerrit-Owner: HARSHAPRIYA N <harshapriya.n at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180504/931c2801/attachment.html>


More information about the coreboot-gerrit mailing list