From patchwork Tue May 1 20:49:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 10374425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09D4160234 for ; Tue, 1 May 2018 20:49:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDE7328CD6 for ; Tue, 1 May 2018 20:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E270228CED; Tue, 1 May 2018 20:49:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D863928CD9 for ; Tue, 1 May 2018 20:49:11 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C09EA2675D4; Tue, 1 May 2018 22:49:10 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4C41D267623; Tue, 1 May 2018 22:49:09 +0200 (CEST) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0060.outbound.protection.outlook.com [104.47.37.60]) by alsa0.perex.cz (Postfix) with ESMTP id 665B9266F0F for ; Tue, 1 May 2018 22:49:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4Vk39zfFUMWy0n6zerHU3onTSfIhrWvck3wjgqIELaI=; b=gD8ehhVGeSdg+PQXy1FS0uE0k5TOUjbyh5bbakRrWuTDl994/DWD4u1v7qxKIhXu+r5efeDNa62daYFmcwlcAfQWpG+e4s1SPPqubagii4wVyk8Lm4wVy/v9BM7pKuFL4L1hY7Pbk2zGJjOkzy8fhf5L5K+NSg4EbwcOPnVI8PE= Received: from CY1PR1201CA0017.namprd12.prod.outlook.com (2a01:111:e400:5b9a::27) by BN4PR12MB0756.namprd12.prod.outlook.com (2a01:111:e400:59bc::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.715.18; Tue, 1 May 2018 20:49:02 +0000 Received: from DM3NAM03FT020.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::209) by CY1PR1201CA0017.outlook.office365.com (2a01:111:e400:5b9a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.715.18 via Frontend Transport; Tue, 1 May 2018 20:49:01 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; nexb.com; dkim=none (message not signed) header.d=none; nexb.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT020.mail.protection.outlook.com (10.152.82.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.13 via Frontend Transport; Tue, 1 May 2018 20:49:00 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Tue, 1 May 2018 15:48:59 -0500 From: Vijendar Mukunda To: Date: Wed, 2 May 2018 02:19:58 +0530 Message-ID: <1525207810-1305-4-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525207810-1305-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1525207810-1305-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(39380400002)(39860400002)(2980300002)(428003)(199004)(189003)(7416002)(316002)(109986005)(76176011)(305945005)(7696005)(68736007)(86362001)(104016004)(54906003)(97736004)(16586007)(5660300001)(51416003)(26005)(53936002)(476003)(81166006)(72206003)(8936002)(186003)(478600001)(47776003)(36756003)(50226002)(11346002)(106466001)(1671002)(4326008)(50466002)(81156014)(8676002)(486006)(2906002)(48376002)(77096007)(53416004)(336012)(2616005)(426003)(126002)(446003)(39060400002)(356003)(105586002)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0756; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT020; 1:ihCXoMsAfTjbZjf4erVh3xPd0K4bNaxKrpT/kZ1gJfMuF06Id0hQxU2tHhdLnb1Bt3oYJ7JAU80dH8iVcnJxBZ6W6AQVBfuIqFhNYJW0kwFJ1y8/GQb6Jd21Yq3UR6vQ X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BN4PR12MB0756; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0756; 3:xvOXd/Lz1iuZzx0n6eYCWzI6VtIOl6cOF5BmL9w1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9xxTT1MYxSZtJ9xfKZh7VUxltLxKZXx0m0Cm25z4+28293ai/SphjZ9imOeaewsfr6ggtoHo60WJ4dgXKdS7MCESemMKybXfD7aUZzPKTfhdOu0BtThrfOSujiCjDVjERTKSwvGVrCjvTXeUU9k5KNwVSh1+/Xy5pgenxb4bRYa6qlKYbfJdVBVksXJt2S01TxT6qRFbxZTU9aKjZjurL9mvQ4Vyuko2KIdvpI25UdPM6YgZNpGx9uF4ssUMQ7/u31FSdj29QAbhLeBo1VfziGcl911HsfJWrJjl0hoeDCgF0aWGFxuomdXenOm1Jz1gMx8DOxMlIwUqPK4Dr152iBxxwbC7oHpJazdbA3W8CG14LaxQsx0Fznz4mvbV8Azr8jaW6DjkJIkUvCAYi9iBOB2+nmOEVPswVzIV04V X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93003095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:BN4PR12MB0756; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0756; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0756; 4:CEkmfJ6lfgwhT8Kjx5P0A3b6V0Kq92Yi3/7pfi0g/LTRv4VKagApmfPc/VEGiouwI7SYf24Nci8udpxrAa+AIs18hrBw76uFrTQFFnD6vL0WqO45I6DHzJmgbnN8LZwVz4pvXMkF2/bizuKxTtvxh5BqJCN7J2MCsmqrfILJj0NsH5KsNTR5+nZ3QUoLEoMyqlTyo7jQbUD6Ttapmfq8kh/tRlrR/cvawp7XS7R2fWeZq7PdHjg71CZjuhrkXLnNvAj6x3BdfAXt8V8844dv/ePj25B43PTlIGJ7fC23gSHeUv8SD/CTGXvbKEB/M4Rk X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR12MB0756; 23:yQxdNuAuxobvRxrgVbDipnyW93V8tY7XT6zs8c42W?= =?us-ascii?Q?59F6PL+xoJVTMZRsnh8Of64FKCo6WaRNr2ZFQzNPfwt/GegngmJhZtiRqKrD?= =?us-ascii?Q?JXNxVARDunD6Q2SOYdjc8clCX1i8YkmuecYv90EIP+YZZIMF9lK6mVa5zSTa?= =?us-ascii?Q?1lz20s2OJzzILuUPfh9nLnUf2flzPptlIo3NWSDRVCaIwSR1KcuK6x2gkH3F?= =?us-ascii?Q?FTZ+xJbTlu1wN+u1EvVf9eNUzLYfG/wzl9opmNAoAOUy+rybifFdTmcZN46B?= =?us-ascii?Q?k9QPqYldCiyiKIYotzOI6n4aU7w2msORugW/pYOygsoddj5R3Ys4BXz3l9U0?= =?us-ascii?Q?ZCcpJdxxGUs4GOh3DkPSY96YlWVmB2DwjY21kebHgCci9aaSKh1nhij9SHjj?= =?us-ascii?Q?wJ895YGwwH3IG3FyqZ9qQE5U3tiSTEeSWDd619frX4FtW+WbWDRptyu5dA+W?= =?us-ascii?Q?vFw6T+jcs2bq8mzC9Ywl4gyatagN+j1ngnz9HbvkA4GFtAiqbRk3icCXOBXh?= =?us-ascii?Q?ibDtn3vuCrIHuox9lpHWwqDgikprWWBpH4bHV94gC+yjLOdN0mRtuB8n+kVN?= =?us-ascii?Q?ZUUQuVb8xsK89dzNFDYaOj4Q/vQygVsuFxapgrWUGhdVaeNuw4Y/+ewY4bDp?= =?us-ascii?Q?M69LVCd8mENPPaGuvvEUtL0Zd9VWEEF7Z+kQZOk6C29KNYT/EpVQ64YkOun0?= =?us-ascii?Q?Jni1aMG1D1WMRwRDGfIDXCKgnAEozX5Y2OtsAcoEsHS6ncrwHFEXMU0whn9L?= =?us-ascii?Q?KdS8JaNWT909LvpfcgDmfipkHCl6foQRxiC3RgsuA1TXovW/IGdTr7j35RfJ?= =?us-asc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365-Filtering-Correlation-Id: 468a437f-1757-4f56-4852-08d5afa4f7b6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2018 20:49:00.2896 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 468a437f-1757-4f56-4852-08d5afa4f7b6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0756 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Kuninori Morimoto , Liam Girdwood , Greg Kroah-Hartman , Philippe Ombredanne , Takashi Iwai , Jason Clinton , Mark Brown , Vijendar Mukunda , Alex Deucher , Akshu Agrawal , Guenter Roeck Subject: [alsa-devel] [PATCH V2 04/10] ASoC: amd: pte offset related dma driver changes X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Added pte offset variable in audio_substream_data structure. Added Stoney related PTE offset macros in acp header file. Modified hw_params callback to assign the pte offset value based on asic_type. PTE Offset macros used to calculate no of PTE entries need to be programmed when memory allocated for audio buffer. Depending upon allocated audio buffer size, PTE offset values will change. Compared to CZ, Stoney has SRAM memory limitation i.e 48k It is required to define separate PTE Offset macros for Stoney. Signed-off-by: Vijendar Mukunda --- v1->v2: Modified commit message sound/soc/amd/acp-pcm-dma.c | 26 +++++++++++++++++++------- sound/soc/amd/acp.h | 5 +++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 862c1cf..39597fb 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -320,13 +320,11 @@ static void config_acp_dma(void __iomem *acp_mmio, struct audio_substream_data *rtd, u32 asic_type) { - u32 pte_offset, sram_bank; + u32 sram_bank; - if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { - pte_offset = ACP_PLAYBACK_PTE_OFFSET; + if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) sram_bank = ACP_SHARED_RAM_BANK_1_ADDRESS; - } else { - pte_offset = ACP_CAPTURE_PTE_OFFSET; + else { switch (asic_type) { case CHIP_STONEY: sram_bank = ACP_SHARED_RAM_BANK_3_ADDRESS; @@ -336,10 +334,10 @@ static void config_acp_dma(void __iomem *acp_mmio, } } acp_pte_config(acp_mmio, rtd->pg, rtd->num_of_pages, - pte_offset); + rtd->pte_offset); /* Configure System memory <-> ACP SRAM DMA descriptors */ set_acp_sysmem_dma_descriptors(acp_mmio, rtd->size, - rtd->direction, pte_offset, + rtd->direction, rtd->pte_offset, rtd->ch1, sram_bank, rtd->dma_dscr_idx_1, asic_type); /* Configure ACP SRAM <-> I2S DMA descriptors */ @@ -788,6 +786,13 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, } if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + switch (adata->asic_type) { + case CHIP_STONEY: + rtd->pte_offset = ACP_ST_PLAYBACK_PTE_OFFSET; + break; + default: + rtd->pte_offset = ACP_PLAYBACK_PTE_OFFSET; + } rtd->ch1 = SYSRAM_TO_ACP_CH_NUM; rtd->ch2 = ACP_TO_I2S_DMA_CH_NUM; rtd->destination = TO_ACP_I2S_1; @@ -797,6 +802,13 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, mmACP_I2S_TRANSMIT_BYTE_CNT_HIGH; rtd->byte_cnt_low_reg_offset = mmACP_I2S_TRANSMIT_BYTE_CNT_LOW; } else { + switch (adata->asic_type) { + case CHIP_STONEY: + rtd->pte_offset = ACP_ST_CAPTURE_PTE_OFFSET; + break; + default: + rtd->pte_offset = ACP_CAPTURE_PTE_OFFSET; + } rtd->ch1 = ACP_TO_SYSRAM_CH_NUM; rtd->ch2 = I2S_TO_ACP_DMA_CH_NUM; rtd->destination = FROM_ACP_I2S_1; diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h index 82470bc..2f48d1d 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -10,6 +10,10 @@ #define ACP_PLAYBACK_PTE_OFFSET 10 #define ACP_CAPTURE_PTE_OFFSET 0 +/* Playback and Capture Offset for Stoney */ +#define ACP_ST_PLAYBACK_PTE_OFFSET 0x04 +#define ACP_ST_CAPTURE_PTE_OFFSET 0x00 + #define ACP_GARLIC_CNTL_DEFAULT 0x00000FB4 #define ACP_ONION_CNTL_DEFAULT 0x00000FB4 @@ -90,6 +94,7 @@ struct audio_substream_data { u16 destination; u16 dma_dscr_idx_1; u16 dma_dscr_idx_2; + u32 pte_offset; u32 byte_cnt_high_reg_offset; u32 byte_cnt_low_reg_offset; uint64_t size;