Unverified Commit aa446b5d authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Intel: avs: Add support for FCL platform

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

The patchset is fairly straightforward - add support for Automotive
platforms based on new DSP architecture, Frisco Lake (FCL), a
PantherLake (PTL)-based platform is an example of.  The cAVS
architecture which all Intel AudioDSP followed for years ends with
RaptorLake familty.  Like all the major updates, this one received new
name too - Audio Context Engine (ACE).

While the range of improvements and changes on the firmware/hardware
side is large, software survives this evolution without need of any
major refactoring.  Additional hardware changes brought with LunarLake
(LNL, ACE 2.0) call for update in PCM-area.  The GPDMAs previously
utilized for non-HDAudio transfer types are no longer there, everything
is running through HDAudio LINK on the Back-End side now.

In terms of code, the mtl.c file, provided with patch 05 'ASoC: Intel:
avs: PTL-based platforms support' hosts largest number of new handlers -
new IRQ and INT control and DSP-cores management.  Combined with lnl.c
and ptl.c which layer the architecture changes done over ACE
generations, provide support for PTL-based platforms e.g.: FCL.
The inheritance in summary:

	mtl.c <- lnl.c <- ptl.c

The functional update to HDAudio library is there to help avs-driver
read certain capabilities directly from the hardware.  Once the pointer
to LINK is obtained, there is no need to call AudioDSP firmware to get
the caps.
parents 25293be4 387ddbc7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3070,6 +3070,7 @@
#define PCI_DEVICE_ID_INTEL_5100_21	0x65f5
#define PCI_DEVICE_ID_INTEL_5100_22	0x65f6
#define PCI_DEVICE_ID_INTEL_IOAT_SCNB	0x65ff
#define PCI_DEVICE_ID_INTEL_HDA_FCL	0x67a8
#define PCI_DEVICE_ID_INTEL_82371SB_0	0x7000
#define PCI_DEVICE_ID_INTEL_82371SB_1	0x7010
#define PCI_DEVICE_ID_INTEL_82371SB_2	0x7020
+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ void snd_hdac_ext_bus_ppcap_enable(struct hdac_bus *chip, bool enable);
void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *chip, bool enable);

int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus);
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_id(struct hdac_bus *bus, u32 id);
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_addr(struct hdac_bus *bus, int addr);
struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_name(struct hdac_bus *bus,
							 const char *codec_name);
@@ -97,12 +98,17 @@ struct hdac_ext_link {
	void __iomem *ml_addr; /* link output stream reg pointer */
	u32 lcaps;   /* link capablities */
	u16 lsdiid;  /* link sdi identifier */
	u32 id;
	u8 slcount;

	int ref_count;

	struct list_head list;
};

#define hdac_ext_link_alt(link)		((link)->lcaps & AZX_ML_HDA_LCAP_ALT)
#define hdac_ext_link_ofls(link)	((link)->lcaps & AZX_ML_HDA_LCAP_OFLS)

int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink);
int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink);
int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus);
+19 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <sound/hda_register.h>
@@ -81,6 +82,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus)
	int idx;
	u32 link_count;
	struct hdac_ext_link *hlink;
	u32 leptr;

	link_count = readl(bus->mlcap + AZX_REG_ML_MLCD) + 1;

@@ -96,6 +98,12 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus)
					(AZX_ML_INTERVAL * idx);
		hlink->lcaps  = readl(hlink->ml_addr + AZX_REG_ML_LCAP);
		hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID);
		hlink->slcount = FIELD_GET(AZX_ML_HDA_LCAP_SLCOUNT, hlink->lcaps) + 1;

		if (hdac_ext_link_alt(hlink)) {
			leptr = readl(hlink->ml_addr + AZX_REG_ML_LEPTR);
			hlink->id = FIELD_GET(AZX_REG_ML_LEPTR_ID, leptr);
		}

		/* since link in On, update the ref */
		hlink->ref_count = 1;
@@ -125,6 +133,17 @@ void snd_hdac_ext_link_free_all(struct hdac_bus *bus)
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_link_free_all);

struct hdac_ext_link *snd_hdac_ext_bus_get_hlink_by_id(struct hdac_bus *bus, u32 id)
{
	struct hdac_ext_link *hlink;

	list_for_each_entry(hlink, &bus->hlink_list, list)
		if (hdac_ext_link_alt(hlink) && hlink->id == id)
			return hlink;
	return NULL;
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_hlink_by_id);

/**
 * snd_hdac_ext_bus_get_hlink_by_addr - get hlink at specified address
 * @bus: hlink's parent bus device
+4 −0
Original line number Diff line number Diff line
@@ -112,6 +112,10 @@ static const struct config_entry config_table[] = {
		.flags = FLAG_SST,
		.device = PCI_DEVICE_ID_INTEL_HDA_RPL_M,
	},
	{
		.flags = FLAG_SST,
		.device = PCI_DEVICE_ID_INTEL_HDA_FCL,
	},
#endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
	{
+3 −3
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ snd-soc-avs-y := dsp.o ipc.o messages.o utils.o core.o loader.o \
		 topology.o path.o pcm.o board_selection.o control.o \
		 sysfs.o
snd-soc-avs-y += cldma.o
snd-soc-avs-y += skl.o apl.o cnl.o icl.o tgl.o
snd-soc-avs-y += skl.o apl.o cnl.o icl.o tgl.o mtl.o lnl.o ptl.o

snd-soc-avs-y += trace.o
# tell define_trace.h where to find the trace header
Loading