[coreboot-gerrit] Patch set updated for coreboot: soc/intel/apollolake: Add NHLT device & vendor ids and get_nhlt_link_type method

Saurabh Satija (saurabh.satija@intel.com) gerrit at coreboot.org
Thu Jun 23 04:29:40 CEST 2016


Saurabh Satija (saurabh.satija at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15311

-gerrit

commit a0f041b7ca8835acdb1b9d7c9dcd570bf2424967
Author: Saurabh Satija <saurabh.satija at intel.com>
Date:   Tue Jun 21 14:22:16 2016 -0700

    soc/intel/apollolake: Add NHLT device & vendor ids and
    get_nhlt_link_type method
    
    Define vendor id for NHLT and device ids for NHLT Bluetooth, DMIC
    & SSPs. These ids are used to add NHLT endpoints for different audio
    codecs. These ids are platform dependent.
    
    get_nhlt_link_type() returns a corresponding NHLT link type based on
    audio soc hardware interface passed as an argument.
    
    Change-Id: Ic9bd26ebe8d6df60af23733e122fd8f3c0432e1f
    Signed-off-by: Saurabh Satija <saurabh.satija at intel.com>
---
 src/soc/intel/apollolake/Makefile.inc           |  1 +
 src/soc/intel/apollolake/include/soc/nhlt_ids.h | 40 +++++++++++++++++++
 src/soc/intel/apollolake/nhlt_ids.c             | 51 +++++++++++++++++++++++++
 3 files changed, 92 insertions(+)

diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 38ed07d..392b75e 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -55,6 +55,7 @@ ramstage-y += pmutil.c
 ramstage-y += pmc.c
 ramstage-y += smi.c
 ramstage-y += reset.c
+ramstage-y += nhlt_ids.c
 
 postcar-y += exit_car.S
 postcar-y += memmap.c
diff --git a/src/soc/intel/apollolake/include/soc/nhlt_ids.h b/src/soc/intel/apollolake/include/soc/nhlt_ids.h
new file mode 100644
index 0000000..df8b65c
--- /dev/null
+++ b/src/soc/intel/apollolake/include/soc/nhlt_ids.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _NHLT_IDS_H_
+#define _NHLT_IDS_H_
+
+#define NHLT_VID 0x8086
+#define NHLT_DID_DMIC 0xae20
+#define NHLT_DID_BT 0xae30
+#define NHLT_DID_SSP 0xae34
+
+enum {
+        AUDIO_LINK_SSP0,
+        AUDIO_LINK_SSP1,
+        AUDIO_LINK_SSP2,
+        AUDIO_LINK_SSP3,
+        AUDIO_LINK_SSP4,
+        AUDIO_LINK_SSP5,
+        AUDIO_LINK_DMIC,
+};
+
+/* Returns corresponding nhlt link type based on hardware link number.
+ * Defined in nhlt_ids.c
+ */
+int get_nhlt_link_type (int hwlink, int soc_devtype);
+
+#endif
diff --git a/src/soc/intel/apollolake/nhlt_ids.c b/src/soc/intel/apollolake/nhlt_ids.c
new file mode 100644
index 0000000..b43c049
--- /dev/null
+++ b/src/soc/intel/apollolake/nhlt_ids.c
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <soc/nhlt_ids.h>
+#include <drivers/intel/audio/audio.h>
+
+int get_nhlt_link_type (int hwlink, int soc_devtype) {
+	int nhlt_link_type;
+
+	switch (hwlink) {
+		case AUDIO_LINK_SSP0:
+		case AUDIO_LINK_SSP1:
+		case AUDIO_LINK_SSP3:
+		case AUDIO_LINK_SSP4:
+		case AUDIO_LINK_SSP5:
+			/* Only I2S devices. */
+			if (soc_devtype != AUDIO_DEV_I2S)
+				return -1;
+			nhlt_link_type = NHLT_LINK_SSP;
+			break;
+		case AUDIO_LINK_SSP2:
+			/* Only Bluetooth devices on SSP2. */
+	                if (soc_devtype != AUDIO_DEV_BT)
+                	        return -1;
+        	        nhlt_link_type = NHLT_LINK_SSP;
+	                break;
+		case AUDIO_LINK_DMIC:
+			// Only DMIC devices on DMIC links.
+			if (soc_devtype != AUDIO_DEV_DMIC)
+				return -1;
+			nhlt_link_type = NHLT_LINK_PDM;
+			break;
+		default:
+			return -1;
+	}
+
+	return nhlt_link_type;
+}



More information about the coreboot-gerrit mailing list