tegra-alt: apm stack size from dt

Change add support to pass apm thread
stack size from device tree using property
"apmX-stack-size = <N>"

Bug 200389033

Change-Id: Id09703bfc5a3edfa55ec9c389d62660fdf8b6b62
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1662846
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Dipesh Gandhi
2018-02-23 11:20:04 +05:30
committed by Sameer Pujar
parent 3b6209c985
commit a6c5cba8dd

View File

@@ -99,6 +99,7 @@ static struct tegra210_adsp_app_desc {
static struct tegra210_adsp_app_desc *adsp_app_desc; static struct tegra210_adsp_app_desc *adsp_app_desc;
static unsigned int adsp_app_count; /* total number of apps initialized */ static unsigned int adsp_app_count; /* total number of apps initialized */
static int apm_stack_size[APM_IN_END - APM_IN_START + 1];
struct tegra210_adsp_app_read_data { struct tegra210_adsp_app_read_data {
int32_t data[NVFX_MAX_RAW_DATA_WSIZE]; int32_t data[NVFX_MAX_RAW_DATA_WSIZE];
@@ -812,6 +813,7 @@ static int tegra210_adsp_app_init(struct tegra210_adsp *adsp,
struct tegra210_adsp_app *apm_out = &adsp->apps[apm_out_reg]; struct tegra210_adsp_app *apm_out = &adsp->apps[apm_out_reg];
app->apm = APM_SHARED_STATE(app->info->mem.shared); app->apm = APM_SHARED_STATE(app->info->mem.shared);
app->info->stack_size = apm_stack_size[app->reg - APM_IN_START];
ret = nvadsp_mbox_open(&app->apm_mbox, ret = nvadsp_mbox_open(&app->apm_mbox,
&app->apm->mbox_id, &app->apm->mbox_id,
@@ -5047,7 +5049,7 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev)
uint32_t adma_ch_page = 0; uint32_t adma_ch_page = 0;
uint32_t adma_ch_start = TEGRA210_ADSP_ADMA_CHANNEL_START_HV; uint32_t adma_ch_start = TEGRA210_ADSP_ADMA_CHANNEL_START_HV;
uint32_t adma_ch_cnt = TEGRA210_ADSP_ADMA_CHANNEL_COUNT; uint32_t adma_ch_cnt = TEGRA210_ADSP_ADMA_CHANNEL_COUNT;
char plugin_info[20]; char plugin_info[20], apm_info[20];
#ifdef CONFIG_SND_SOC_TEGRA_VIRT_IVC_COMM #ifdef CONFIG_SND_SOC_TEGRA_VIRT_IVC_COMM
char switch_info[20]; char switch_info[20];
uint32_t adsp_switch_count; uint32_t adsp_switch_count;
@@ -5323,6 +5325,13 @@ static int tegra210_adsp_audio_platform_probe(struct platform_device *pdev)
} }
} }
#endif #endif
for (i = 0; i < (APM_IN_END - APM_IN_START + 1); i++) {
apm_stack_size[i] = 0;
memset((void *)apm_info, '\0', 20);
sprintf(apm_info, "apm%d-stack-size", i+1);
of_property_read_u32(pdev->dev.of_node, apm_info,
&apm_stack_size[i]);
}
pr_info("tegra210_adsp_audio_platform_probe probe successfull."); pr_info("tegra210_adsp_audio_platform_probe probe successfull.");
return 0; return 0;