ASoC: Intel: Skylake: Add Broxton DSP support
Subsystems (3)
cover ASoC: Intel: Skylake: Add Broxton DSP support
Broxton DSP is similar to Skylake with similar DSP capabilities but differs in a few subtle ways. It doesn't have Code Loader DMA and use HDA DMA. The DSP power up/down routines are also bit different in the two platforms. Also the FW needs to be downloaded only once and not on every power sequence as it is cached by DSP in protected memory region.
All these changes for new DSP ops are abstracted in a new BXTN-dsp ops file.
This patch series starts with moving code around to prepare for new code and also fix whitespace issue in existing code.
Since we have different loader ops we move Skylake ones to newly defined ops. Then we add device IDs and lastly the broxton ops.
Jayachandran B (1):
ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core
Jeeja KP (4):
ASoC: Intel: add dmabuffer to common sst_dsp
ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops
ASoC: hdac_hdmi: Add broxton device ID
ASoC: Intel: Bxtn: Add Broxton DSP support
Senthilnathan Veppur (1):
ASoC: Intel: Bxtn: Add Broxton PCI ID
Vinod Koul (2):
ASoC: Intel: Skylake: Move module id defines
ASoC: Intel: Skylake: Fix whitepsace issues
sound/soc/codecs/hdac_hdmi.c | 1 + sound/soc/intel/Kconfig | 1 + sound/soc/intel/common/sst-dsp-priv.h | 1 + sound/soc/intel/skylake/Makefile | 2 +- sound/soc/intel/skylake/bxt-sst.c | 328 +++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-messages.c | 182 +++++++++++++++++- sound/soc/intel/skylake/skl-sst-dsp.c | 14 +- sound/soc/intel/skylake/skl-sst-dsp.h | 20 +- sound/soc/intel/skylake/skl-sst.c | 3 - sound/soc/intel/skylake/skl.c | 7 + sound/soc/intel/skylake/skl.h | 12 +- 11 files changed, 549 insertions(+), 22 deletions(-) create mode 100644 sound/soc/intel/skylake/bxt-sst.c
Signature · 1 line
1.9.1
PATCH 1/8 ASoC: Intel: Skylake: Move module id defines
The module ID defines are common to other platforms so can be reused if moved to a common driver header so move it
--- sound/soc/intel/skylake/skl-sst-dsp.h | 4 ++++ sound/soc/intel/skylake/skl-sst.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.h +4 -0
@@ -53,6 +53,10 @@ struct sst_dsp_device;/* HIPCT */ #define SKL_ADSP_REG_HIPCT_BUSY BIT(31) +/* FW base IDs */ +#define SKL_INSTANCE_ID 0 +#define SKL_BASE_FW_MODULE_ID 0 +/* Intel HD Audio SRAM Window 1 */ #define SKL_ADSP_SRAM1_BASE 0xA000
sound/soc/intel/skylake/skl-sst.c +0 -3
@@ -35,9 +35,6 @@#define SKL_ADSP_FW_STATUS SKL_ADSP_SRAM0_BASE#define SKL_ADSP_ERROR_CODE (SKL_ADSP_FW_STATUS + 0x4) -#define SKL_INSTANCE_ID 0 -#define SKL_BASE_FW_MODULE_ID 0 -#define SKL_NUM_MODULES 1static bool skl_check_fw_status (struct sst_dsp *ctx,u32 status)
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Move module id defines" to the asoc tree
The patch
ASoC: Intel: Skylake: Move module id defines
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
39fa37d51ae904968c49ef49165df7fec66fd9eaMon Sep 17 00:00:00 2001
From: Vinod Koul <[email protected]>
Date: Fri, 11 Mar 2016 10:12:49 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Move module id defines
The module ID defines are common to other platforms so can be reused if moved to a common driver header so move it
--- sound/soc/intel/skylake/skl-sst-dsp.h | 4 ++++ sound/soc/intel/skylake/skl-sst.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.h +4 -0
@@ -53,6 +53,10 @@ struct sst_dsp_device;/* HIPCT */ #define SKL_ADSP_REG_HIPCT_BUSY BIT(31) +/* FW base IDs */ +#define SKL_INSTANCE_ID 0 +#define SKL_BASE_FW_MODULE_ID 0 +/* Intel HD Audio SRAM Window 1 */ #define SKL_ADSP_SRAM1_BASE 0xA000
sound/soc/intel/skylake/skl-sst.c +0 -3
@@ -35,9 +35,6 @@#define SKL_ADSP_FW_STATUS SKL_ADSP_SRAM0_BASE#define SKL_ADSP_ERROR_CODE (SKL_ADSP_FW_STATUS + 0x4) -#define SKL_INSTANCE_ID 0 -#define SKL_BASE_FW_MODULE_ID 0 -#define SKL_NUM_MODULES 1static bool skl_check_fw_status (struct sst_dsp *ctx,u32 status)
Signature · 1 line
2.7.0
PATCH 2/8 ASoC: Intel: Skylake: Fix whitepsace issues
In reply to Vinod KoulSome double whitespaces issues existed in driver, so fix them up.
--- sound/soc/intel/skylake/skl-sst-dsp.c | 14 +++++++------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.c +7 -7
@@ -34,7 +34,7 @@ void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state)mutex_unlock (&ctx->mutex); } -static int skl_dsp_core_set_reset_state (struct sst_dsp *ctx) +static int skl_dsp_core_set_reset_state (struct sst_dsp *ctx) {int ret;
@@ -60,7 +60,7 @@ static int skl_dsp_core_set_reset_state(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_unset_reset_state (struct sst_dsp *ctx) +static int skl_dsp_core_unset_reset_state (struct sst_dsp *ctx) {int ret;
@@ -87,7 +87,7 @@ static int skl_dsp_core_unset_reset_state(struct sst_dsp *ctx)return ret; } -static bool is_skl_dsp_core_enable (struct sst_dsp *ctx) +static bool is_skl_dsp_core_enable (struct sst_dsp *ctx) {int val;bool is_enable;
@@ -140,7 +140,7 @@ static int skl_dsp_start_core(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_power_up (struct sst_dsp *ctx) +static int skl_dsp_core_power_up (struct sst_dsp *ctx) {int ret;
@@ -166,7 +166,7 @@ static int skl_dsp_core_power_up(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_power_down (struct sst_dsp *ctx) +static int skl_dsp_core_power_down (struct sst_dsp *ctx) {/* update bits */ sst_dsp_shim_update_bits_unlocked(ctx, SKL_ADSP_REG_ADSPCS,
@@ -181,7 +181,7 @@ static int skl_dsp_core_power_down(struct sst_dsp *ctx) "Power down"); } -static int skl_dsp_enable_core (struct sst_dsp *ctx) +static int skl_dsp_enable_core (struct sst_dsp *ctx) {int ret;
@@ -195,7 +195,7 @@ static int skl_dsp_enable_core(struct sst_dsp *ctx)return skl_dsp_start_core (ctx); } -int skl_dsp_disable_core (struct sst_dsp *ctx) +int skl_dsp_disable_core (struct sst_dsp *ctx) {int ret;
sound/soc/intel/skylake/skl-sst-dsp.h +1 -1
@@ -148,7 +148,7 @@ int skl_cldma_prepare(struct sst_dsp *ctx);void skl_dsp_set_state_locked (struct sst_dsp *ctx,int state);struct sst_dsp *skl_dsp_ctx_init (struct device *dev,struct sst_dsp_device *sst_dev,int irq); -int skl_dsp_disable_core (struct sst_dsp *ctx); +int skl_dsp_disable_core (struct sst_dsp *ctx);bool is_skl_dsp_running (struct sst_dsp *ctx);irqreturn_t skl_dsp_sst_interrupt (int irq,void *dev_id);int skl_dsp_wake (struct sst_dsp *ctx);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Fix whitepsace issues" to the asoc tree
The patch
ASoC: Intel: Skylake: Fix whitepsace issues
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
a360b623fc5593d896a8762153bacdabfe29dfb9Mon Sep 17 00:00:00 2001
From: Vinod Koul <[email protected]>
Date: Fri, 11 Mar 2016 10:12:50 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix whitepsace issues
Some double whitespaces issues existed in driver, so fix them up.
--- sound/soc/intel/skylake/skl-sst-dsp.c | 14 +++++++------- sound/soc/intel/skylake/skl-sst-dsp.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.c +7 -7
@@ -34,7 +34,7 @@ void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state)mutex_unlock (&ctx->mutex); } -static int skl_dsp_core_set_reset_state (struct sst_dsp *ctx) +static int skl_dsp_core_set_reset_state (struct sst_dsp *ctx) {int ret;
@@ -60,7 +60,7 @@ static int skl_dsp_core_set_reset_state(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_unset_reset_state (struct sst_dsp *ctx) +static int skl_dsp_core_unset_reset_state (struct sst_dsp *ctx) {int ret;
@@ -87,7 +87,7 @@ static int skl_dsp_core_unset_reset_state(struct sst_dsp *ctx)return ret; } -static bool is_skl_dsp_core_enable (struct sst_dsp *ctx) +static bool is_skl_dsp_core_enable (struct sst_dsp *ctx) {int val;bool is_enable;
@@ -140,7 +140,7 @@ static int skl_dsp_start_core(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_power_up (struct sst_dsp *ctx) +static int skl_dsp_core_power_up (struct sst_dsp *ctx) {int ret;
@@ -166,7 +166,7 @@ static int skl_dsp_core_power_up(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_power_down (struct sst_dsp *ctx) +static int skl_dsp_core_power_down (struct sst_dsp *ctx) {/* update bits */ sst_dsp_shim_update_bits_unlocked(ctx, SKL_ADSP_REG_ADSPCS,
@@ -181,7 +181,7 @@ static int skl_dsp_core_power_down(struct sst_dsp *ctx) "Power down"); } -static int skl_dsp_enable_core (struct sst_dsp *ctx) +static int skl_dsp_enable_core (struct sst_dsp *ctx) {int ret;
@@ -195,7 +195,7 @@ static int skl_dsp_enable_core(struct sst_dsp *ctx)return skl_dsp_start_core (ctx); } -int skl_dsp_disable_core (struct sst_dsp *ctx) +int skl_dsp_disable_core (struct sst_dsp *ctx) {int ret;
sound/soc/intel/skylake/skl-sst-dsp.h +1 -1
@@ -148,7 +148,7 @@ int skl_cldma_prepare(struct sst_dsp *ctx);void skl_dsp_set_state_locked (struct sst_dsp *ctx,int state);struct sst_dsp *skl_dsp_ctx_init (struct device *dev,struct sst_dsp_device *sst_dev,int irq); -int skl_dsp_disable_core (struct sst_dsp *ctx); +int skl_dsp_disable_core (struct sst_dsp *ctx);bool is_skl_dsp_running (struct sst_dsp *ctx);irqreturn_t skl_dsp_sst_interrupt (int irq,void *dev_id);int skl_dsp_wake (struct sst_dsp *ctx);
Signature · 1 line
2.7.0
PATCH 3/8 ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core
In reply to Vinod KoulFrom: Jayachandran B <[email protected]>
The function skl_dsp_enable_core will be called by other parts of driver so this can no longer be a static function.
--- sound/soc/intel/skylake/skl-sst-dsp.c | 2 +- sound/soc/intel/skylake/skl-sst-dsp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-sst-dsp.c +1 -1
@@ -181,7 +181,7 @@ static int skl_dsp_core_power_down(struct sst_dsp *ctx) "Power down"); } -static int skl_dsp_enable_core (struct sst_dsp *ctx) +int skl_dsp_enable_core (struct sst_dsp *ctx) {int ret;
sound/soc/intel/skylake/skl-sst-dsp.h +1 -0
@@ -148,6 +148,7 @@ int skl_cldma_prepare(struct sst_dsp *ctx);void skl_dsp_set_state_locked (struct sst_dsp *ctx,int state);struct sst_dsp *skl_dsp_ctx_init (struct device *dev,struct sst_dsp_device *sst_dev,int irq); +int skl_dsp_enable_core (struct sst_dsp *ctx);int skl_dsp_disable_core (struct sst_dsp *ctx);bool is_skl_dsp_running (struct sst_dsp *ctx);irqreturn_t skl_dsp_sst_interrupt (int irq,void *dev_id);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core" to the asoc tree
The patch
ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
130e69a4773fb65af284d3fd1f3de762324d06e6Mon Sep 17 00:00:00 2001
From: Jayachandran B <[email protected]>
Date: Fri, 11 Mar 2016 10:12:51 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Unstatify skl_dsp_enable_core
The function skl_dsp_enable_core will be called by other parts of driver so this can no longer be a static function.
--- sound/soc/intel/skylake/skl-sst-dsp.c | 2 +- sound/soc/intel/skylake/skl-sst-dsp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-sst-dsp.c +1 -1
@@ -181,7 +181,7 @@ static int skl_dsp_core_power_down(struct sst_dsp *ctx) "Power down"); } -static int skl_dsp_enable_core (struct sst_dsp *ctx) +int skl_dsp_enable_core (struct sst_dsp *ctx) {int ret;
sound/soc/intel/skylake/skl-sst-dsp.h +1 -0
@@ -148,6 +148,7 @@ int skl_cldma_prepare(struct sst_dsp *ctx);void skl_dsp_set_state_locked (struct sst_dsp *ctx,int state);struct sst_dsp *skl_dsp_ctx_init (struct device *dev,struct sst_dsp_device *sst_dev,int irq); +int skl_dsp_enable_core (struct sst_dsp *ctx);int skl_dsp_disable_core (struct sst_dsp *ctx);bool is_skl_dsp_running (struct sst_dsp *ctx);irqreturn_t skl_dsp_sst_interrupt (int irq,void *dev_id);
Signature · 1 line
2.7.0
PATCH 4/8 ASoC: Intel: add dmabuffer to common sst_dsp
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
Broxton uses HDA DMA so needs to keep dmab in the driver context so add it
--- sound/soc/intel/common/sst-dsp-priv.h | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/common/sst-dsp-priv.h +1 -0
@@ -317,6 +317,7 @@ struct sst_dsp {struct skl_cl_dev cl_dev;u32 intr_status;const struct firmware *fw; +struct snd_dma_buffer dmab; };/* Size optimised DRAM/IRAM memcpy */
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: add dmabuffer to common sst_dsp" to the asoc tree
The patch
ASoC: Intel: add dmabuffer to common sst_dsp
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
b822ee63586c7150c10b445ae6b4bb29486f01e4Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 11 Mar 2016 10:12:52 +0530
Subject: [PATCH] ASoC: Intel: add dmabuffer to common sst_dsp
Broxton uses HDA DMA so needs to keep dmab in the driver context so add it
--- sound/soc/intel/common/sst-dsp-priv.h | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/common/sst-dsp-priv.h +1 -0
@@ -317,6 +317,7 @@ struct sst_dsp {struct skl_cl_dev cl_dev;u32 intr_status;const struct firmware *fw; +struct snd_dma_buffer dmab; };/* Size optimised DRAM/IRAM memcpy */
Signature · 1 line
2.7.0
PATCH 5/8 ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
The code loading for Skylake and other platforms is different, so add a dsp_ops and a loader_ops which can be defined for each platform.
Move the dsp init, cleanup and loader ops (alloc and free dma) to these ops
--- sound/soc/intel/skylake/skl-messages.c | 62 +++++++++++++++++++++++++++++----- sound/soc/intel/skylake/skl.h | 12 ++++++- 2 files changed, 64 insertions(+), 10 deletions(-)
sound/soc/intel/skylake/skl-messages.c +53 -9
@@ -72,17 +72,47 @@ static void skl_dsp_enable_notification(struct skl_sst *ctx, bool enable)skl_ipc_set_large_config (&ctx->ipc, &msg, (u32 *)&mask); } +static struct skl_dsp_loader_ops skl_get_loader_ops (void ) +{ +struct skl_dsp_loader_ops loader_ops; + +memset (&loader_ops,0 ,sizeof (struct skl_dsp_loader_ops )); + + loader_ops.alloc_dma_buf = skl_alloc_dma_buf; + loader_ops.free_dma_buf = skl_free_dma_buf; + +return loader_ops; +}; + +static const struct skl_dsp_ops dsp_ops[] = { + { + .id =0x9d70 , + .loader_ops = skl_get_loader_ops, + .init = skl_sst_dsp_init, + .cleanup = skl_sst_dsp_cleanup + }, +}; + +static int skl_get_dsp_ops (int pci_id) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (dsp_ops); i++) { +if (dsp_ops[i].id == pci_id) +return i; + } + +return -EINVAL ; +} +int skl_init_dsp (struct skl *skl) {void __iomem *mmio_base;struct hdac_ext_bus *ebus = &skl->ebus;struct hdac_bus *bus =ebus_to_hbus (ebus); -int irq = bus->irq;struct skl_dsp_loader_ops loader_ops; -int ret; - - loader_ops.alloc_dma_buf = skl_alloc_dma_buf; - loader_ops.free_dma_buf = skl_free_dma_buf; +int irq = bus->irq; +int ret, index;/* enable ppcap interrupt */ snd_hdac_ext_bus_ppcap_enable (&skl->ebus, true);
@@ -95,8 +125,14 @@ int skl_init_dsp(struct skl *skl)return -ENXIO ; } - ret =skl_sst_dsp_init (bus->dev, mmio_base, irq, + index =skl_get_dsp_ops (skl->pci->device); +if (index <0 ) +return -EINVAL ; + + loader_ops = dsp_ops[index].loader_ops (); + ret = dsp_ops[index].init (bus->dev, mmio_base, irq, skl->fw_name, loader_ops, &skl->skl_sst); +if (ret <0 )return ret;
@@ -106,18 +142,26 @@ int skl_init_dsp(struct skl *skl)return ret; } -void skl_free_dsp (struct skl *skl) +int skl_free_dsp (struct skl *skl) {struct hdac_ext_bus *ebus = &skl->ebus;struct hdac_bus *bus =ebus_to_hbus (ebus); -struct skl_sst *ctx = skl->skl_sst; +struct skl_sst *ctx = skl->skl_sst; +int index;/* disable ppcap interrupt */ snd_hdac_ext_bus_ppcap_int_enable (&skl->ebus, false); -skl_sst_dsp_cleanup (bus->dev, ctx); + index =skl_get_dsp_ops (skl->pci->device); +if (index <0 ) +return -EIO ; + + dsp_ops[index].cleanup (bus->dev, ctx); +if (ctx->dsp->addr.lpe)iounmap (ctx->dsp->addr.lpe); + +return 0 ; }int skl_suspend_dsp (struct skl *skl)
sound/soc/intel/skylake/skl.h +11 -1
@@ -90,6 +90,16 @@ struct skl_dma_params {u8 stream_tag; }; +struct skl_dsp_ops { +int id; +struct skl_dsp_loader_ops (*loader_ops)(void ); +int (*init)(struct device *dev,void __iomem *mmio_base, +int irq,const char *fw_name, +struct skl_dsp_loader_ops loader_ops, +struct skl_sst **skl_sst); +void (*cleanup)(struct device *dev,struct skl_sst *ctx); +}; +int skl_platform_unregister (struct device *dev);int skl_platform_register (struct device *dev);
@@ -100,7 +110,7 @@ struct nhlt_specific_cfg *skl_get_ep_blob(struct skl *skl, u32 instance,int skl_nhlt_update_topology_bin (struct skl *skl);int skl_init_dsp (struct skl *skl); -void skl_free_dsp (struct skl *skl); +int skl_free_dsp (struct skl *skl);int skl_suspend_dsp (struct skl *skl);int skl_resume_dsp (struct skl *skl);#endif /* __SOUND_SOC_SKL_H */
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops" to the asoc tree
The patch
ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
bc23ca35cfb18b0a98afa42de1df1efc7e2e9f8fMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 11 Mar 2016 10:12:53 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Move Skylake dsp ops & loader ops
The code loading for Skylake and other platforms is different, so add a dsp_ops and a loader_ops which can be defined for each platform.
Move the dsp init, cleanup and loader ops (alloc and free dma) to these ops
--- sound/soc/intel/skylake/skl-messages.c | 62 +++++++++++++++++++++++++++++----- sound/soc/intel/skylake/skl.h | 12 ++++++- 2 files changed, 64 insertions(+), 10 deletions(-)
sound/soc/intel/skylake/skl-messages.c +53 -9
@@ -72,17 +72,47 @@ static void skl_dsp_enable_notification(struct skl_sst *ctx, bool enable)skl_ipc_set_large_config (&ctx->ipc, &msg, (u32 *)&mask); } +static struct skl_dsp_loader_ops skl_get_loader_ops (void ) +{ +struct skl_dsp_loader_ops loader_ops; + +memset (&loader_ops,0 ,sizeof (struct skl_dsp_loader_ops )); + + loader_ops.alloc_dma_buf = skl_alloc_dma_buf; + loader_ops.free_dma_buf = skl_free_dma_buf; + +return loader_ops; +}; + +static const struct skl_dsp_ops dsp_ops[] = { + { + .id =0x9d70 , + .loader_ops = skl_get_loader_ops, + .init = skl_sst_dsp_init, + .cleanup = skl_sst_dsp_cleanup + }, +}; + +static int skl_get_dsp_ops (int pci_id) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (dsp_ops); i++) { +if (dsp_ops[i].id == pci_id) +return i; + } + +return -EINVAL ; +} +int skl_init_dsp (struct skl *skl) {void __iomem *mmio_base;struct hdac_ext_bus *ebus = &skl->ebus;struct hdac_bus *bus =ebus_to_hbus (ebus); -int irq = bus->irq;struct skl_dsp_loader_ops loader_ops; -int ret; - - loader_ops.alloc_dma_buf = skl_alloc_dma_buf; - loader_ops.free_dma_buf = skl_free_dma_buf; +int irq = bus->irq; +int ret, index;/* enable ppcap interrupt */ snd_hdac_ext_bus_ppcap_enable (&skl->ebus, true);
@@ -95,8 +125,14 @@ int skl_init_dsp(struct skl *skl)return -ENXIO ; } - ret =skl_sst_dsp_init (bus->dev, mmio_base, irq, + index =skl_get_dsp_ops (skl->pci->device); +if (index <0 ) +return -EINVAL ; + + loader_ops = dsp_ops[index].loader_ops (); + ret = dsp_ops[index].init (bus->dev, mmio_base, irq, skl->fw_name, loader_ops, &skl->skl_sst); +if (ret <0 )return ret;
@@ -106,18 +142,26 @@ int skl_init_dsp(struct skl *skl)return ret; } -void skl_free_dsp (struct skl *skl) +int skl_free_dsp (struct skl *skl) {struct hdac_ext_bus *ebus = &skl->ebus;struct hdac_bus *bus =ebus_to_hbus (ebus); -struct skl_sst *ctx = skl->skl_sst; +struct skl_sst *ctx = skl->skl_sst; +int index;/* disable ppcap interrupt */ snd_hdac_ext_bus_ppcap_int_enable (&skl->ebus, false); -skl_sst_dsp_cleanup (bus->dev, ctx); + index =skl_get_dsp_ops (skl->pci->device); +if (index <0 ) +return -EIO ; + + dsp_ops[index].cleanup (bus->dev, ctx); +if (ctx->dsp->addr.lpe)iounmap (ctx->dsp->addr.lpe); + +return 0 ; }int skl_suspend_dsp (struct skl *skl)
sound/soc/intel/skylake/skl.h +11 -1
@@ -90,6 +90,16 @@ struct skl_dma_params {u8 stream_tag; }; +struct skl_dsp_ops { +int id; +struct skl_dsp_loader_ops (*loader_ops)(void ); +int (*init)(struct device *dev,void __iomem *mmio_base, +int irq,const char *fw_name, +struct skl_dsp_loader_ops loader_ops, +struct skl_sst **skl_sst); +void (*cleanup)(struct device *dev,struct skl_sst *ctx); +}; +int skl_platform_unregister (struct device *dev);int skl_platform_register (struct device *dev);
@@ -100,7 +110,7 @@ struct nhlt_specific_cfg *skl_get_ep_blob(struct skl *skl, u32 instance,int skl_nhlt_update_topology_bin (struct skl *skl);int skl_init_dsp (struct skl *skl); -void skl_free_dsp (struct skl *skl); +int skl_free_dsp (struct skl *skl);int skl_suspend_dsp (struct skl *skl);int skl_resume_dsp (struct skl *skl);#endif /* __SOUND_SOC_SKL_H */
Signature · 1 line
2.7.0
PATCH 6/8 ASoC: Intel: Bxtn: Add Broxton PCI ID
In reply to Vinod KoulFrom: Senthilnathan Veppur <[email protected]>
Broxton is an Intel SoC which sports a DSP and system is quite like Skylake. So add this ID in Skylake driver
--- sound/soc/intel/skylake/skl.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/intel/skylake/skl.c +7 -0
@@ -742,11 +742,18 @@ static struct sst_acpi_mach sst_skl_devdata[] = { {} }; +static struct sst_acpi_mach sst_bxtp_devdata[] = { + {"INT343A" ,"bxt_alc298s_i2s" ,"intel/dsp_fw_bxtn.bin" ,NULL ,NULL ,NULL }, +}; +/* PCI IDs */ static const struct pci_device_id skl_ids[] = {/* Sunrise Point-LP */ {PCI_DEVICE (0x8086 ,0x9d70 ), .driver_data = (unsigned long )&sst_skl_devdata}, +/* BXT-P */ + {PCI_DEVICE (0x8086 ,0x5a98 ), + .driver_data = (unsigned long )&sst_bxtp_devdata}, {0 , } };MODULE_DEVICE_TABLE (pci, skl_ids);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Bxtn: Add Broxton PCI ID" to the asoc tree
The patch
ASoC: Intel: Bxtn: Add Broxton PCI ID
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
b379b1fad6e80274309f650f3a82c6f3c4fe9d6bMon Sep 17 00:00:00 2001
From: Senthilnathan Veppur <[email protected]>
Date: Fri, 11 Mar 2016 10:12:54 +0530
Subject: [PATCH] ASoC: Intel: Bxtn: Add Broxton PCI ID
Broxton is an Intel SoC which sports a DSP and system is quite like Skylake. So add this ID in Skylake driver
--- sound/soc/intel/skylake/skl.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/intel/skylake/skl.c +7 -0
@@ -742,11 +742,18 @@ static struct sst_acpi_mach sst_skl_devdata[] = { {} }; +static struct sst_acpi_mach sst_bxtp_devdata[] = { + {"INT343A" ,"bxt_alc298s_i2s" ,"intel/dsp_fw_bxtn.bin" ,NULL ,NULL ,NULL }, +}; +/* PCI IDs */ static const struct pci_device_id skl_ids[] = {/* Sunrise Point-LP */ {PCI_DEVICE (0x8086 ,0x9d70 ), .driver_data = (unsigned long )&sst_skl_devdata}, +/* BXT-P */ + {PCI_DEVICE (0x8086 ,0x5a98 ), + .driver_data = (unsigned long )&sst_bxtp_devdata}, {0 , } };MODULE_DEVICE_TABLE (pci, skl_ids);
Signature · 1 line
2.7.0
PATCH 7/8 ASoC: hdac_hdmi: Add broxton device ID
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
Broxton HDMI codec is similar to Skylake so add the device ID
--- sound/soc/codecs/hdac_hdmi.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/hdac_hdmi.c +1 -0
@@ -1634,6 +1634,7 @@ static const struct dev_pm_ops hdac_hdmi_pm = {static const struct hda_device_id hdmi_list[] = {HDA_CODEC_EXT_ENTRY (0x80862809 ,0x100000 ,"Skylake HDMI" ,0 ), +HDA_CODEC_EXT_ENTRY (0x8086280a ,0x100000 ,"Broxton HDMI" ,0 ), {} };
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: hdac_hdmi: Add broxton device ID" to the asoc tree
The patch
ASoC: hdac_hdmi: Add broxton device ID
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
e2304803fd05eac509c8e37bb626c192510e4e77Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 11 Mar 2016 10:12:55 +0530
Subject: [PATCH] ASoC: hdac_hdmi: Add broxton device ID
Broxton HDMI codec is similar to Skylake so add the device ID
--- sound/soc/codecs/hdac_hdmi.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/hdac_hdmi.c +1 -0
@@ -1634,6 +1634,7 @@ static const struct dev_pm_ops hdac_hdmi_pm = {static const struct hda_device_id hdmi_list[] = {HDA_CODEC_EXT_ENTRY (0x80862809 ,0x100000 ,"Skylake HDMI" ,0 ), +HDA_CODEC_EXT_ENTRY (0x8086280a ,0x100000 ,"Broxton HDMI" ,0 ), {} };
Signature · 1 line
2.7.0
PATCH 8/8 ASoC: Intel: Bxtn: Add Broxton DSP support
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
Broxton DSP is mostly similar to Skylake one but with subtle differences like no Code Load DMA and uses HDA DMA for code loading, DSP D0 and D3 sequences are different.
These changes are comprehended by adding different DSP power up and down handlers, and new loader ops and also adding prepare and trigger which HDA DSP DMA requires
--- sound/soc/intel/Kconfig | 1 + sound/soc/intel/skylake/Makefile | 2 +- sound/soc/intel/skylake/bxt-sst.c | 328 +++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-messages.c | 120 ++++++++++++ sound/soc/intel/skylake/skl-sst-dsp.h | 13 ++ 5 files changed, 463 insertions(+), 1 deletion(-) create mode 100644 sound/soc/intel/skylake/bxt-sst.c
sound/soc/intel/Kconfig +1 -0
@@ -153,6 +153,7 @@ config SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH config SND_SOC_INTEL_SKYLAKE tristate select SND_HDA_EXT_CORE + select SND_HDA_DSP_LOADER select SND_SOC_TOPOLOGY select SND_HDA_I915 select SND_SOC_INTEL_SST
sound/soc/intel/skylake/Makefile +1 -1
@@ -5,6 +5,6 @@ obj-$(CONFIG_SND_SOC_INTEL_SKYLAKE) += snd-soc-skl.o # Skylake IPC Support snd-soc-skl-ipc-objs := skl-sst-ipc.o skl-sst-dsp.o skl-sst-cldma.o \ - skl-sst.o + skl-sst.o bxt-sst.o obj-$(CONFIG_SND_SOC_INTEL_SKYLAKE) += snd-soc-skl-ipc.o
sound/soc/intel/skylake/bxt-sst.c new file +328 -0
328 lines not on this page · raw message
sound/soc/intel/skylake/skl-messages.c +120 -0
138 lines not on this page · raw message
sound/soc/intel/skylake/skl-sst-dsp.h +13 -0
@@ -124,10 +124,19 @@ struct skl_dsp_fw_ops { };struct skl_dsp_loader_ops { +int stream_tag; +int (*alloc_dma_buf)(struct device *dev,struct snd_dma_buffer *dmab,size_t size);int (*free_dma_buf)(struct device *dev,struct snd_dma_buffer *dmab); +int (*prepare)(struct device *dev,unsigned int format, +unsigned int byte_size, +struct snd_dma_buffer *bufp); +int (*trigger)(struct device *dev,bool start,int stream_tag); + +int (*cleanup)(struct device *dev,struct snd_dma_buffer *dmab, +int stream_tag); };struct skl_load_module_info {
@@ -160,6 +169,10 @@ int skl_dsp_boot(struct sst_dsp *ctx);int skl_sst_dsp_init (struct device *dev,void __iomem *mmio_base,int irq,const char *fw_name,struct skl_dsp_loader_ops dsp_ops,struct skl_sst **dsp); +int bxt_sst_dsp_init (struct device *dev,void __iomem *mmio_base,int irq, +const char *fw_name,struct skl_dsp_loader_ops dsp_ops, +struct skl_sst **dsp);void skl_sst_dsp_cleanup (struct device *dev,struct skl_sst *ctx); +void bxt_sst_dsp_cleanup (struct device *dev,struct skl_sst *ctx);#endif /*__SKL_SST_DSP_H__*/
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Bxtn: Add Broxton DSP support" to the asoc tree
The patch
ASoC: Intel: Bxtn: Add Broxton DSP support
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
040b4ab8bf025adcdd860a70d56e1aa76762b5c2Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 11 Mar 2016 10:12:56 +0530
Subject: [PATCH] ASoC: Intel: Bxtn: Add Broxton DSP support
Broxton DSP is mostly similar to Skylake one but with subtle differences like no Code Load DMA and uses HDA DMA for code loading, DSP D0 and D3 sequences are different.
These changes are comprehended by adding different DSP power up and down handlers, and new loader ops and also adding prepare and trigger which HDA DSP DMA requires
--- sound/soc/intel/Kconfig | 1 + sound/soc/intel/skylake/Makefile | 2 +- sound/soc/intel/skylake/bxt-sst.c | 328 +++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-messages.c | 120 ++++++++++++ sound/soc/intel/skylake/skl-sst-dsp.h | 13 ++ 5 files changed, 463 insertions(+), 1 deletion(-) create mode 100644 sound/soc/intel/skylake/bxt-sst.c
sound/soc/intel/Kconfig +1 -0
@@ -162,6 +162,7 @@ config SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH config SND_SOC_INTEL_SKYLAKE tristate select SND_HDA_EXT_CORE + select SND_HDA_DSP_LOADER select SND_SOC_TOPOLOGY select SND_HDA_I915 select SND_SOC_INTEL_SST
sound/soc/intel/skylake/Makefile +1 -1
@@ -5,6 +5,6 @@ obj-$(CONFIG_SND_SOC_INTEL_SKYLAKE) += snd-soc-skl.o # Skylake IPC Support snd-soc-skl-ipc-objs := skl-sst-ipc.o skl-sst-dsp.o skl-sst-cldma.o \ - skl-sst.o + skl-sst.o bxt-sst.o obj-$(CONFIG_SND_SOC_INTEL_SKYLAKE) += snd-soc-skl-ipc.o
sound/soc/intel/skylake/bxt-sst.c new file +328 -0
328 lines not on this page · raw message
sound/soc/intel/skylake/skl-messages.c +120 -0
138 lines not on this page · raw message
sound/soc/intel/skylake/skl-sst-dsp.h +13 -0
@@ -124,10 +124,19 @@ struct skl_dsp_fw_ops { };struct skl_dsp_loader_ops { +int stream_tag; +int (*alloc_dma_buf)(struct device *dev,struct snd_dma_buffer *dmab,size_t size);int (*free_dma_buf)(struct device *dev,struct snd_dma_buffer *dmab); +int (*prepare)(struct device *dev,unsigned int format, +unsigned int byte_size, +struct snd_dma_buffer *bufp); +int (*trigger)(struct device *dev,bool start,int stream_tag); + +int (*cleanup)(struct device *dev,struct snd_dma_buffer *dmab, +int stream_tag); };struct skl_load_module_info {
@@ -160,6 +169,10 @@ int skl_dsp_boot(struct sst_dsp *ctx);int skl_sst_dsp_init (struct device *dev,void __iomem *mmio_base,int irq,const char *fw_name,struct skl_dsp_loader_ops dsp_ops,struct skl_sst **dsp); +int bxt_sst_dsp_init (struct device *dev,void __iomem *mmio_base,int irq, +const char *fw_name,struct skl_dsp_loader_ops dsp_ops, +struct skl_sst **dsp);void skl_sst_dsp_cleanup (struct device *dev,struct skl_sst *ctx); +void bxt_sst_dsp_cleanup (struct device *dev,struct skl_sst *ctx);#endif /*__SKL_SST_DSP_H__*/
Signature · 1 line
2.8.0.rc3