Unverified Commit e2379d4a authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: SOF: Intel: add initial SKL/KBL hardware support



In preparation of the IPCv4 IPC support, this patch adds
support for SkyLake and KabyLake boot and descriptors
used when probing the PCI driver.

The work was initially contributed in 2018 by Liam Girdwood and Zhu
Yingjiang, and abandoned due to firmware signature issues. With the
upcoming support of IPC v4, and hence the Intel closed-source
firmware, it's time to re-add this capability.

The SKL ops will be added in the next patch.

Tested with the IPC4 and closed-source firmware on Dell XPS 9350
and KBL NUC with HDaudio codecs. The SSP and DMIC interfaces are not
supported at this time.

Co-developed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220920131700.133103-4-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c712be34
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -95,6 +95,31 @@ config SND_SOC_SOF_MERRIFIELD
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_INTEL_SKL
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_IPC4

config SND_SOC_SOF_SKYLAKE
	tristate "SOF support for SkyLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_SKL
	help
	  This adds support for the Intel(R) platforms using the SkyLake processors.
	  Say Y if you have such a device.
	  If unsure select "N".
	  This is intended only for developers and not a recommend option for distros.

config SND_SOC_SOF_KABYLAKE
	tristate "SOF support for KabyLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_SKL
	help
	  This adds support for the Intel(R) platforms using the KabyLake processors.
	  Say Y if you have such a device.
	  If unsure select "N".
	  This is intended only for developers and not a recommend option for distros.

config SND_SOC_SOF_INTEL_APL
	tristate
	select SND_SOC_SOF_HDA_COMMON
+4 −0
Original line number Diff line number Diff line
@@ -6,7 +6,9 @@ snd-sof-acpi-intel-bdw-objs := bdw.o
snd-sof-intel-hda-common-objs := hda.o hda-loader.o hda-stream.o hda-trace.o \
				 hda-dsp.o hda-ipc.o hda-ctrl.o hda-pcm.o \
				 hda-dai.o hda-bus.o \
				 skl.o hda-loader-skl.o \
				 apl.o cnl.o tgl.o icl.o mtl.o hda-common-ops.o

snd-sof-intel-hda-common-$(CONFIG_SND_SOC_SOF_HDA_PROBES) += hda-probes.o

snd-sof-intel-hda-objs := hda-codec.o
@@ -20,6 +22,7 @@ obj-$(CONFIG_SND_SOC_SOF_HDA_COMMON) += snd-sof-intel-hda-common.o
obj-$(CONFIG_SND_SOC_SOF_HDA) += snd-sof-intel-hda.o

snd-sof-pci-intel-tng-objs := pci-tng.o
snd-sof-pci-intel-skl-objs := pci-skl.o
snd-sof-pci-intel-apl-objs := pci-apl.o
snd-sof-pci-intel-cnl-objs := pci-cnl.o
snd-sof-pci-intel-icl-objs := pci-icl.o
@@ -27,6 +30,7 @@ snd-sof-pci-intel-tgl-objs := pci-tgl.o
snd-sof-pci-intel-mtl-objs := pci-mtl.o

obj-$(CONFIG_SND_SOC_SOF_MERRIFIELD) += snd-sof-pci-intel-tng.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_SKL) += snd-sof-pci-intel-skl.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_APL) += snd-sof-pci-intel-apl.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_CNL) += snd-sof-pci-intel-cnl.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_ICL) += snd-sof-pci-intel-icl.o
+8 −0
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context)
/* Check if an IPC IRQ occurred */
bool hda_dsp_check_ipc_irq(struct snd_sof_dev *sdev)
{
	struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
	bool ret = false;
	u32 irq_status;

@@ -319,6 +320,13 @@ bool hda_dsp_check_ipc_irq(struct snd_sof_dev *sdev)
	if (irq_status & HDA_DSP_ADSPIS_IPC)
		ret = true;

	/* CLDMA message ? */
	if (irq_status & HDA_DSP_ADSPIS_CL_DMA) {
		hda->code_loading = 0;
		wake_up(&hda->waitq);
		ret = false;
	}

out:
	return ret;
}
+2 −5
Original line number Diff line number Diff line
@@ -93,17 +93,14 @@

/* Buffer Descriptor List Lower Base Address */
#define HDA_CL_SD_BDLPLBA_SHIFT		7
#define HDA_CL_SD_BDLPLBA_MASK		(0x1ffffff << HDA_CL_SD_BDLPLBA_SHIFT)
#define HDA_CL_SD_BDLPLBA_MASK		GENMASK(31, 7)
#define HDA_CL_SD_BDLPLBA(x)		\
	((BDL_ALIGN(lower_32_bits(x)) << HDA_CL_SD_BDLPLBA_SHIFT) & \
	 HDA_CL_SD_BDLPLBA_MASK)

/* Buffer Descriptor List Upper Base Address */
#define HDA_CL_SD_BDLPUBA_SHIFT		0
#define HDA_CL_SD_BDLPUBA_MASK		(0xffffffff << HDA_CL_SD_BDLPUBA_SHIFT)
#define HDA_CL_SD_BDLPUBA(x)		\
		((upper_32_bits(x) << HDA_CL_SD_BDLPUBA_SHIFT) & \
		 HDA_CL_SD_BDLPUBA_MASK)
			(upper_32_bits(x))

/* Software Position in Buffer Enable */
#define HDA_CL_SPBFIFO_SPBFCCTL_SPIBE_SHIFT	0
+2 −0
Original line number Diff line number Diff line
@@ -1136,6 +1136,8 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)

	INIT_DELAYED_WORK(&hdev->d0i3_work, hda_dsp_d0i3_work);

	init_waitqueue_head(&hdev->waitq);

	hdev->nhlt = intel_nhlt_init(sdev->dev);

	return 0;
Loading