Skip to content

Commit 8819667

Browse files
committed
drivers: imx: Select DONE bit from software
With multi-fifo we need to enable done bit from software as we have multiple fifos. For this we make use of sw_done_sel configurations bits and write proper bits into SDMA_DONE0 register. For more information see `SDMA DONE0 Configuration (SDMAARMx_DONE0_CONFIG)` SDMA register from i.MX8 reference manual. Signed-off-by: Daniel Baluta <[email protected]>
1 parent 4c7b69b commit 8819667

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/drivers/imx/sdma.c

+9
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,22 @@ static struct dma_chan_data *sdma_channel_get(struct dma *dma,
441441

442442
static void sdma_enable_event(struct dma_chan_data *channel, int eventnum)
443443
{
444+
struct sdma_chan *pdata = dma_chan_get_data(channel);
445+
444446
tr_dbg(&sdma_tr, "sdma_enable_event(%d, %d)", channel->index, eventnum);
445447

446448
if (eventnum < 0 || eventnum > SDMA_HWEVENTS_COUNT)
447449
return; /* No change if request is invalid */
448450

449451
dma_reg_update_bits(channel->dma, SDMA_CHNENBL(eventnum),
450452
BIT(channel->index), BIT(channel->index));
453+
454+
if (pdata->sw_done_sel & BIT(31)) {
455+
unsigned int done0;
456+
457+
done0 = SDMA_DONE0_CONFIG_DONE_SEL | ~SDMA_DONE0_CONFIG_DONE_DIS;
458+
dma_reg_update_bits(channel->dma, SDMA_DONE0_CONFIG, 0xFF, done0);
459+
}
451460
}
452461

453462
static void sdma_disable_event(struct dma_chan_data *channel, int eventnum)

src/include/sof/drivers/sdma.h

+3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
#define SDMA_DONE0_CONFIG 0x1000
9090
#define SDMA_DONE1_CONFIG 0x1004
9191

92+
#define SDMA_DONE0_CONFIG_DONE_SEL BIT(7)
93+
#define SDMA_DONE0_CONFIG_DONE_DIS BIT(6)
94+
9295
#define SDMA_WATERMARK_LEVEL_N_FIFOS(x) SET_BITS(15, 12, x)
9396
#define SDMA_WATERMARK_LEVEL_OFF_FIFOS(x) SET_BITS(19, 16, x)
9497
#define SDMA_WATERMARK_LEVEL_WORDS_PER_FIFO(x) SET_BITS(31, 28, x)

0 commit comments

Comments
 (0)