-
Notifications
You must be signed in to change notification settings - Fork 143
ALSA/ASoC/SOF: Initial NVL-S (Nova Lake) support #5508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
402a30d
b08583a
b1d7610
b7469bd
f4fb173
b878d2a
cf72c99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| // SPDX-License-Identifier: GPL-2.0-only | ||
| /* | ||
| * soc-acpi-intel-nvl-match.c - tables and support for NVL ACPI enumeration. | ||
| * | ||
| * Copyright (c) 2025, Intel Corporation. | ||
| * | ||
| */ | ||
|
|
||
| #include <sound/soc-acpi.h> | ||
| #include <sound/soc-acpi-intel-match.h> | ||
| #include "soc-acpi-intel-sdw-mockup-match.h" | ||
|
|
||
| struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_machines[] = { | ||
| {}, | ||
| }; | ||
| EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_nvl_machines); | ||
|
|
||
| /* | ||
| * Multi-function codecs with three endpoints created for | ||
| * headset, amp and dmic functions. | ||
| */ | ||
| static const struct snd_soc_acpi_endpoint rt_mf_endpoints[] = { | ||
| { | ||
| .num = 0, | ||
| .aggregated = 0, | ||
| .group_position = 0, | ||
| .group_id = 0, | ||
| }, | ||
| { | ||
| .num = 1, | ||
| .aggregated = 0, | ||
| .group_position = 0, | ||
| .group_id = 0, | ||
| }, | ||
| { | ||
| .num = 2, | ||
| .aggregated = 0, | ||
| .group_position = 0, | ||
| .group_id = 0, | ||
| }, | ||
| }; | ||
|
|
||
| static const struct snd_soc_acpi_adr_device rt722_3_single_adr[] = { | ||
| { | ||
| .adr = 0x000330025d072201ull, | ||
| .num_endpoints = ARRAY_SIZE(rt_mf_endpoints), | ||
| .endpoints = rt_mf_endpoints, | ||
| .name_prefix = "rt722" | ||
| } | ||
| }; | ||
|
|
||
| static const struct snd_soc_acpi_link_adr nvl_rt722_l3[] = { | ||
| { | ||
| .mask = BIT(3), | ||
| .num_adr = ARRAY_SIZE(rt722_3_single_adr), | ||
| .adr_d = rt722_3_single_adr, | ||
| }, | ||
| {} | ||
| }; | ||
|
|
||
| /* this table is used when there is no I2S codec present */ | ||
| struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_sdw_machines[] = { | ||
| /* mockup tests need to be first */ | ||
| { | ||
| .link_mask = GENMASK(3, 0), | ||
| .links = sdw_mockup_headset_2amps_mic, | ||
| .drv_name = "sof_sdw", | ||
| .sof_tplg_filename = "sof-nvl-rt711-rt1308-rt715.tplg", | ||
| }, | ||
| { | ||
| .link_mask = BIT(0) | BIT(1) | BIT(3), | ||
| .links = sdw_mockup_headset_1amp_mic, | ||
| .drv_name = "sof_sdw", | ||
| .sof_tplg_filename = "sof-nvl-rt711-rt1308-mono-rt715.tplg", | ||
| }, | ||
| { | ||
| .link_mask = GENMASK(2, 0), | ||
| .links = sdw_mockup_mic_headset_1amp, | ||
| .drv_name = "sof_sdw", | ||
| .sof_tplg_filename = "sof-nvl-rt715-rt711-rt1308-mono.tplg", | ||
| }, | ||
| { | ||
| .link_mask = BIT(3), | ||
| .links = nvl_rt722_l3, | ||
| .drv_name = "sof_sdw", | ||
| .sof_tplg_filename = "sof-nvl-rt722.tplg", | ||
| }, | ||
| {}, | ||
| }; | ||
| EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_nvl_sdw_machines); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) | ||
| // | ||
| // Copyright(c) 2025 Intel Corporation | ||
|
|
||
| /* | ||
| * Hardware interface for audio DSP on NovaLake. | ||
| */ | ||
|
|
||
| #include <sound/hda_register.h> | ||
| #include <sound/hda-mlink.h> | ||
| #include <sound/sof/ipc4/header.h> | ||
| #include "../ipc4-priv.h" | ||
| #include "../ops.h" | ||
| #include "hda.h" | ||
| #include "hda-ipc.h" | ||
| #include "../sof-audio.h" | ||
| #include "mtl.h" | ||
| #include "lnl.h" | ||
| #include "ptl.h" | ||
| #include "nvl.h" | ||
|
|
||
| int sof_nvl_set_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *dsp_ops) | ||
| { | ||
| /* Use PTL ops for NVL */ | ||
| return sof_ptl_set_ops(sdev, dsp_ops); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in similar platform-inheritance cases (even across ACE major versions) - would it make sense to add a comment, stating that inheritance explicitly? |
||
| }; | ||
| EXPORT_SYMBOL_NS(sof_nvl_set_ops, "SND_SOC_SOF_INTEL_NVL"); | ||
|
|
||
| const struct sof_intel_dsp_desc nvl_s_chip_info = { | ||
| .cores_num = 2, | ||
| .init_core_mask = BIT(0), | ||
| .host_managed_cores_mask = BIT(0), | ||
| .ipc_req = MTL_DSP_REG_HFIPCXIDR, | ||
| .ipc_req_mask = MTL_DSP_REG_HFIPCXIDR_BUSY, | ||
| .ipc_ack = MTL_DSP_REG_HFIPCXIDA, | ||
| .ipc_ack_mask = MTL_DSP_REG_HFIPCXIDA_DONE, | ||
| .ipc_ctl = MTL_DSP_REG_HFIPCXCTL, | ||
| .rom_status_reg = LNL_DSP_REG_HFDSC, | ||
| .rom_init_timeout = 300, | ||
| .ssp_count = MTL_SSP_COUNT, | ||
| .d0i3_offset = MTL_HDA_VS_D0I3C, | ||
| .read_sdw_lcount = hda_sdw_check_lcount_ext, | ||
| .check_sdw_irq = lnl_dsp_check_sdw_irq, | ||
| .check_sdw_wakeen_irq = lnl_sdw_check_wakeen_irq, | ||
| .sdw_process_wakeen = hda_sdw_process_wakeen_common, | ||
| .check_ipc_irq = mtl_dsp_check_ipc_irq, | ||
| .cl_init = mtl_dsp_cl_init, | ||
| .power_down_dsp = mtl_power_down_dsp, | ||
| .disable_interrupts = lnl_dsp_disable_interrupts, | ||
| .hw_ip_version = SOF_INTEL_ACE_4_0, | ||
| }; | ||
|
|
||
| MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_MTL"); | ||
| MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_LNL"); | ||
| MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_PTL"); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ | ||
| /* | ||
| * This file is provided under a dual BSD/GPLv2 license. When using or | ||
| * redistributing this file, you may do so under either license. | ||
| * | ||
| * Copyright(c) 2025 Intel Corporation | ||
| */ | ||
|
|
||
| #ifndef __SOF_INTEL_NVL_H | ||
| #define __SOF_INTEL_NVL_H | ||
|
|
||
| int sof_nvl_set_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *dsp_ops); | ||
|
|
||
| #endif /* __SOF_INTEL_NVL_H */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) | ||
| // | ||
| // This file is provided under a dual BSD/GPLv2 license. When using or | ||
| // redistributing this file, you may do so under either license. | ||
| // | ||
| // Copyright(c) 2025 Intel Corporation. | ||
| // | ||
|
|
||
| #include <linux/module.h> | ||
| #include <linux/pci.h> | ||
| #include <sound/soc-acpi.h> | ||
| #include <sound/soc-acpi-intel-match.h> | ||
| #include <sound/sof.h> | ||
| #include "../ops.h" | ||
| #include "../sof-pci-dev.h" | ||
|
|
||
| /* platform specific devices */ | ||
| #include "hda.h" | ||
| #include "nvl.h" | ||
|
|
||
| /* PantherLake ops */ | ||
| static struct snd_sof_dsp_ops sof_nvl_ops; | ||
|
|
||
| static int sof_nvl_ops_init(struct snd_sof_dev *sdev) | ||
| { | ||
| return sof_nvl_set_ops(sdev, &sof_nvl_ops); | ||
| } | ||
|
|
||
| static const struct sof_dev_desc nvl_s_desc = { | ||
| .use_acpi_target_states = true, | ||
| .machines = snd_soc_acpi_intel_nvl_machines, | ||
| .alt_machines = snd_soc_acpi_intel_nvl_sdw_machines, | ||
| .resindex_lpe_base = 0, | ||
| .resindex_pcicfg_base = -1, | ||
| .resindex_imr_base = -1, | ||
| .irqindex_host_ipc = -1, | ||
| .chip_info = &nvl_s_chip_info, | ||
| .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), | ||
| .ipc_default = SOF_IPC_TYPE_4, | ||
| .dspless_mode_supported = true, | ||
| .default_fw_path = { | ||
| [SOF_IPC_TYPE_4] = "intel/sof-ipc4/nvl-s", | ||
| }, | ||
| .default_lib_path = { | ||
| [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/nvl-s", | ||
| }, | ||
| .default_tplg_path = { | ||
| [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg", | ||
| }, | ||
| .default_fw_filename = { | ||
| [SOF_IPC_TYPE_4] = "sof-nvl-s.ri", | ||
| }, | ||
| .nocodec_tplg_filename = "sof-nvl-nocodec.tplg", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will NVL use the same nocodec topology as NVL-S?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, historically we did this on all platforms tgl/tgl-h is using sof-tgl-nocodec, arl/arl-s is using sof-arl-nocodec, adl/adl-s/adl-n is using sof-adl-nocodec. I think these nocodec topologies could be present per DSP architecture: I would leave it like this. |
||
| .ops = &sof_nvl_ops, | ||
| .ops_init = sof_nvl_ops_init, | ||
| }; | ||
|
|
||
| /* PCI IDs */ | ||
| static const struct pci_device_id sof_pci_ids[] = { | ||
| { PCI_DEVICE_DATA(INTEL, HDA_NVL_S, &nvl_s_desc) }, /* NVL-S */ | ||
| { 0, } | ||
| }; | ||
| MODULE_DEVICE_TABLE(pci, sof_pci_ids); | ||
|
|
||
| /* pci_driver definition */ | ||
| static struct pci_driver snd_sof_pci_intel_nvl_driver = { | ||
| .name = "sof-audio-pci-intel-nvl", | ||
| .id_table = sof_pci_ids, | ||
| .probe = hda_pci_intel_probe, | ||
| .remove = sof_pci_remove, | ||
| .shutdown = sof_pci_shutdown, | ||
| .driver = { | ||
| .pm = pm_ptr(&sof_pci_pm), | ||
| }, | ||
| }; | ||
| module_pci_driver(snd_sof_pci_intel_nvl_driver); | ||
|
|
||
| MODULE_LICENSE("Dual BSD/GPL"); | ||
| MODULE_DESCRIPTION("SOF support for NovaLake platforms"); | ||
| MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_HDA_GENERIC"); | ||
| MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_HDA_COMMON"); | ||
| MODULE_IMPORT_NS("SND_SOC_SOF_PCI_DEV"); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message says headset codec support but the commit only adds mockup devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll drop the headset part from the message.