Skip to content

Commit

Permalink
drivers: dma: dma_nxp_edma: support MUX register in MP space
Browse files Browse the repository at this point in the history
Some EDMA versions may have the channel MUX register in the MP
region. To support this scenario, use the `EDMA_HAS_MP_MUX_FLAG`
flag to figure out which channel MUX register to use (TCD or MP).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
  • Loading branch information
LaurentiuM1234 authored and nashif committed Sep 19, 2024
1 parent 93c2b29 commit 7eb0747
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/dma/dma_nxp_edma.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ static inline int edma_chan_cyclic_produce(struct edma_channel *chan,
static inline void edma_dump_channel_registers(struct edma_data *data,
uint32_t chan_id)
{
uint32_t mux_reg;

LOG_DBG("dumping channel data for channel %d", chan_id);

LOG_DBG("CH_CSR: 0x%x",
Expand All @@ -431,8 +433,13 @@ static inline void edma_dump_channel_registers(struct edma_data *data,
EDMA_ChannelRegRead(data->hal_cfg, chan_id, EDMA_TCD_CH_PRI));

if (EDMA_HAS_MUX(data->hal_cfg)) {
LOG_DBG("CH_MUX: 0x%x",
EDMA_ChannelRegRead(data->hal_cfg, chan_id, EDMA_TCD_CH_MUX));
if (data->hal_cfg->flags & EDMA_HAS_MP_MUX_FLAG) {
mux_reg = EDMA_MP_CH_MUX;
} else {
mux_reg = EDMA_TCD_CH_MUX;
}

LOG_DBG("CH_MUX: 0x%x", EDMA_ChannelRegRead(data->hal_cfg, chan_id, mux_reg));
}

LOG_DBG("TCD_SADDR: 0x%x",
Expand Down

0 comments on commit 7eb0747

Please sign in to comment.