From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Gross Subject: Re: [PATCH 1/3] dmaengine: qcom_bam_dma: Generalize BAM register offset calculations Date: Sun, 21 Sep 2014 23:48:42 -0500 Message-ID: <20140922044842.GC4148@qualcomm.com> References: <1411037575-13153-1-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.11.231]:59289 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758AbaIVEso (ORCPT ); Mon, 22 Sep 2014 00:48:44 -0400 Content-Disposition: inline In-Reply-To: <1411037575-13153-1-git-send-email-architt@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Archit Taneja Cc: galak@codeaurora.org, linux-arm-msm@vger.kernel.org On Thu, Sep 18, 2014 at 04:22:53PM +0530, Archit Taneja wrote: > The BAM DMA IP comes in different versions. The register offset layout varies > among these versions. The layouts depend on which generation/family of SoCs they > belong to. > > The current SoCs(like 8084, 8074) have a layout where the Top level registers > come in the beginning of the address range, followed by pipe and event > registers. The BAM revision numbers fall above 1.4.0. > > The older SoCs (like 8064, 8960) have a layout where the pipe registers come > first, and the top level come later. These have BAM revision numbers lesser than > 1.4.0. > > It isn't suitable to have macros provide the register offsets with the layouts > changed. Future BAM revisions may have different register layouts too. The > register addresses are now calculated by referring a table which contains a base > offset and multipliers for pipe/evnt/ee registers. > > We have a common function bam_addr() which computes addresses for all the > registers. When computing address of top level/ee registers, we pass 0 to the > pipe argument in addr() since they don't have any multiple instances. > > Some of the unused register definitions are removed. We can add new registers as > we need them. > > Signed-off-by: Archit Taneja Very very clean. I like it! I'll add my tested-bys when I get a chance to try it out. Reviewed-by: Andy Gross -- sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation