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

Saurabh Satija (saurabh.satija@intel.com) gerrit at coreboot.org
Fri Jun 24 03:36:16 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 7efc1bbca652e2163ee9a4241609a730952742d3
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 nhlt_get_link_type
    
    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.h | 40 ++++++++++++++++++++++
 src/soc/intel/apollolake/nhlt.c             | 52 +++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+)

diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 38ed07d..c335e39 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.c
 
 postcar-y += exit_car.S
 postcar-y += memmap.c
diff --git a/src/soc/intel/apollolake/include/soc/nhlt.h b/src/soc/intel/apollolake/include/soc/nhlt.h
new file mode 100644
index 0000000..9b0b584
--- /dev/null
+++ b/src/soc/intel/apollolake/include/soc/nhlt.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 _SOC_APOLLOLAKE_NHLT_H_
+#define _SOC_APOLLOLAKE_NHLT_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 nhlt_get_link_type(int hwlink, int soc_devtype);
+
+#endif
diff --git a/src/soc/intel/apollolake/nhlt.c b/src/soc/intel/apollolake/nhlt.c
new file mode 100644
index 0000000..feade1d
--- /dev/null
+++ b/src/soc/intel/apollolake/nhlt.c
@@ -0,0 +1,52 @@
+/*
+ * 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 <nhlt.h>
+#include <soc/nhlt.h>
+
+int nhlt_get_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