dmaengine: qcom: bam_dma: Avoid writing unavailable register
Avoid writing unavailable register in BAM-Lite mode. BAM_DESC_CNT_TRSHLD register is unavailable in BAM-Lite mode. Its only available in BAM-NDP mode. So only write this register for clients who is using BAM-NDP. Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com> Link: https://lore.kernel.org/r/20241220094203.3510335-1-quic_mdalam@quicinc.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
308213731f
commit
57a7138d06
1 changed files with 16 additions and 8 deletions
|
@ -59,6 +59,9 @@ struct bam_desc_hw {
|
|||
#define DESC_FLAG_NWD BIT(12)
|
||||
#define DESC_FLAG_CMD BIT(11)
|
||||
|
||||
#define BAM_NDP_REVISION_START 0x20
|
||||
#define BAM_NDP_REVISION_END 0x27
|
||||
|
||||
struct bam_async_desc {
|
||||
struct virt_dma_desc vd;
|
||||
|
||||
|
@ -398,6 +401,7 @@ struct bam_device {
|
|||
|
||||
/* dma start transaction tasklet */
|
||||
struct tasklet_struct task;
|
||||
u32 bam_revision;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -441,8 +445,10 @@ static void bam_reset(struct bam_device *bdev)
|
|||
writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL));
|
||||
|
||||
/* set descriptor threshold, start with 4 bytes */
|
||||
writel_relaxed(DEFAULT_CNT_THRSHLD,
|
||||
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
|
||||
if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
|
||||
BAM_NDP_REVISION_END))
|
||||
writel_relaxed(DEFAULT_CNT_THRSHLD,
|
||||
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
|
||||
|
||||
/* Enable default set of h/w workarounds, ie all except BAM_FULL_PIPE */
|
||||
writel_relaxed(BAM_CNFG_BITS_DEFAULT, bam_addr(bdev, 0, BAM_CNFG_BITS));
|
||||
|
@ -1000,9 +1006,10 @@ static void bam_apply_new_config(struct bam_chan *bchan,
|
|||
maxburst = bchan->slave.src_maxburst;
|
||||
else
|
||||
maxburst = bchan->slave.dst_maxburst;
|
||||
|
||||
writel_relaxed(maxburst,
|
||||
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
|
||||
if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
|
||||
BAM_NDP_REVISION_END))
|
||||
writel_relaxed(maxburst,
|
||||
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
|
||||
}
|
||||
|
||||
bchan->reconfigure = 0;
|
||||
|
@ -1192,10 +1199,11 @@ static int bam_init(struct bam_device *bdev)
|
|||
u32 val;
|
||||
|
||||
/* read revision and configuration information */
|
||||
if (!bdev->num_ees) {
|
||||
val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
|
||||
val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
|
||||
if (!bdev->num_ees)
|
||||
bdev->num_ees = (val >> NUM_EES_SHIFT) & NUM_EES_MASK;
|
||||
}
|
||||
|
||||
bdev->bam_revision = val & REVISION_MASK;
|
||||
|
||||
/* check that configured EE is within range */
|
||||
if (bdev->ee >= bdev->num_ees)
|
||||
|
|
Loading…
Add table
Reference in a new issue