Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3308716rwd; Mon, 22 May 2023 11:39:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73OAgaHdPkdkztyb+NJi66hYTMdljIhVke/rima5giBgklXl81Fd/iC9XviiJf13Z3huIS X-Received: by 2002:a17:903:1c3:b0:1af:bd10:4045 with SMTP id e3-20020a17090301c300b001afbd104045mr2768721plh.6.1684780758242; Mon, 22 May 2023 11:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684780758; cv=none; d=google.com; s=arc-20160816; b=Ao42YUykc1EVinH/PF98QfUjJ5SeClmesv9CEm0OfW89uJZ/DhFcZAaiQWNNoiw4OA ayLMFsEUcDQpeMMKsHjQLGElCS5hpo2Mvy1Dqgu/KAjM0ozGwzqswm2CPw8wdBLkOYOa nleRTB41ub1fkf5i0ASDM1yJ9lFOFeSs7s+M2cLJFCmB9Z6IEjJ9sgEWlBbuZPe9ghmB MIFjMzUzadHoireNY90e+eRnQbqHR1LL/IR0fpXtaDVTj/8WUdXU2/MRbKfq1gxEt8Qa b6Zod5QUQOZwB9PyJsw6ax3IZPOa7oqi7T0Ewe7t3KLVohFOcoSIsuaijMo78lsDpETS OzuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VOM11gDXyTscAOHq/0Rl7wFMekze3dA+7zxyOSvpIrA=; b=GYEIm4nTaIVOyKxxI2BncDkAFh+D7tae/XAa8jGceORbuAYmjo/hld2Nl48gPruigQ 5S/jnnptJ7Z203k3pbOILNIvM157T8e6imOiomKS9SSXTFH61m/6aZmj3YR9XUI1EQnG x8WcewECNmyBScGwglmcU+ZtSUCp0lhzvMekO1q07bnfLiyDmH8+dj69ynsmKoGu8Rym /04X5YscyYmnV/3eki6UFm7PHEhIgRbAzHc3dR5AzkBvLYAlTvW4/9FPoDZ0I1d/5QTj PnqmjoybjxHLH1QVjC1Fgch56GTcGOPSarLaeXLlpFwvuAKN3njrr2NtUttb37v7EFhN Ditg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DvB0xvSC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a170902680800b001aae90dbcc3si12103plk.231.2023.05.22.11.39.04; Mon, 22 May 2023 11:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DvB0xvSC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233791AbjEVScR (ORCPT + 99 others); Mon, 22 May 2023 14:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233711AbjEVScL (ORCPT ); Mon, 22 May 2023 14:32:11 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9BA210D for ; Mon, 22 May 2023 11:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684780328; x=1716316328; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=m2u1Fynpu0Q6HiRGvTPXsGDwoeAMSJbQ90gprxvwMVE=; b=DvB0xvSCJx0YTujK2WG9D/2oN7R+FtfXGXQYy0iIZro6cFvJAZQtizF2 vQBeyYV/x96Hhxbtu3X09PW3lTCTPdIsGV0XfI/ovgFMzv+AR3povwxmP 08Hgkuov2dUH99hI4FVrnafKNp60flZ07ukjAYxG3b7GL+Q8sAYJENwR9 PH8ctSMYvIDF/Av8fnf/k7BjJw+XdhTbAvDKA5STw363VxlvtmhMLY1jF gCUJZ8OZNYeOJavT0/t36kCBh8xBy/Qocrpft4a4+bxI0pB7QAPpsEbED dn2TFWzOQI7HClrhkprYhzNsTrXtgxkPB/GOeJ7YzQjxRXXPTfUPv6j2h A==; X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="356235149" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="356235149" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 11:31:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="697740840" X-IronPort-AV: E=Sophos;i="6.00,184,1681196400"; d="scan'208";a="697740840" Received: from ljgreene-mobl.amr.corp.intel.com (HELO [10.209.124.121]) ([10.209.124.121]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2023 11:31:48 -0700 Message-ID: <42774a4f-ae1e-7d25-6b01-67f5af8400a4@linux.intel.com> Date: Mon, 22 May 2023 11:39:49 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH V2 4/9] ASoC: amd: ps: add SoundWire dma driver dma ops Content-Language: en-US To: Vijendar Mukunda , broonie@kernel.org Cc: alsa-devel@alsa-project.org, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, Mastan.Katragadda@amd.com, Arungopal.kondaveeti@amd.com, mario.limonciello@amd.com, Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , open list References: <20230522133122.166841-1-Vijendar.Mukunda@amd.com> <20230522133122.166841-5-Vijendar.Mukunda@amd.com> From: Pierre-Louis Bossart In-Reply-To: <20230522133122.166841-5-Vijendar.Mukunda@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +union acp_sdw_dma_count { > + struct { > + u32 low; > + u32 high; > + } bcount; indentation seems off? > + u64 bytescount; > +}; > + > +struct sdw_dma_ring_buf_reg { > + u32 reg_dma_size; > + u32 reg_fifo_addr; > + u32 reg_fifo_size; > + u32 reg_ring_buf_size; > + u32 reg_ring_buf_addr; > + u32 water_mark_size_reg; > + u32 pos_low_reg; > + u32 pos_high_reg; > }; >\ > +static void acp63_config_dma(struct acp_sdw_dma_stream *stream, void __iomem *acp_base, > + u32 stream_id) > +{ > + u16 page_idx; > + u32 low, high, val; > + u32 sdw_dma_pte_offset; > + dma_addr_t addr; > + > + addr = stream->dma_addr; > + sdw_dma_pte_offset = SDW_PTE_OFFSET(stream->instance); > + val = sdw_dma_pte_offset + (stream_id * 256); what is this 256 magic value? use a defined or << 8 ? > + > + /* Group Enable */ > + writel(ACP_SDW_SRAM_PTE_OFFSET | BIT(31), acp_base + ACPAXI2AXI_ATU_BASE_ADDR_GRP_2); > + writel(PAGE_SIZE_4K_ENABLE, acp_base + ACPAXI2AXI_ATU_PAGE_SIZE_GRP_2); > + for (page_idx = 0; page_idx < stream->num_pages; page_idx++) { > + /* Load the low address of page int ACP SRAM through SRBM */ > + low = lower_32_bits(addr); > + high = upper_32_bits(addr); > + > + writel(low, acp_base + ACP_SCRATCH_REG_0 + val); > + high |= BIT(31); > + writel(high, acp_base + ACP_SCRATCH_REG_0 + val + 4); > + val += 8; > + addr += PAGE_SIZE; > + } > + writel(0x1, acp_base + ACPAXI2AXI_ATU_CTRL); > +}