Skip to content

Commit

Permalink
mt76: mt7921: introduce MT_WFDMA_DUMMY_CR definition
Browse files Browse the repository at this point in the history
Introduce MT_WFDMA_DUMMY_CR definition and remove magic numbers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Apr 7, 2021
1 parent 04122c8 commit 5e764ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mt7921/dma.c
Expand Up @@ -323,7 +323,7 @@ int mt7921_dma_init(struct mt7921_dev *dev)
mt76_set(dev, MT_WFDMA0_GLO_CFG,
MT_WFDMA0_GLO_CFG_TX_DMA_EN | MT_WFDMA0_GLO_CFG_RX_DMA_EN);

mt76_set(dev, 0x54000120, BIT(1));
mt76_set(dev, MT_WFDMA_DUMMY_CR, MT_WFDMA_NEED_REINIT);

/* enable interrupts for TX/RX rings */
mt7921_irq_enable(dev, MT_INT_RX_DONE_ALL | MT_INT_TX_DONE_ALL |
Expand Down
2 changes: 1 addition & 1 deletion mt7921/mac.c
Expand Up @@ -1272,7 +1272,7 @@ mt7921_dma_reset(struct mt7921_dev *dev)
mt76_set(dev, MT_WFDMA0_GLO_CFG,
MT_WFDMA0_GLO_CFG_TX_DMA_EN | MT_WFDMA0_GLO_CFG_RX_DMA_EN);

mt76_set(dev, 0x54000120, BIT(1));
mt76_set(dev, MT_WFDMA_DUMMY_CR, MT_WFDMA_NEED_REINIT);

/* enable interrupts for TX/RX rings */
mt7921_irq_enable(dev,
Expand Down
6 changes: 6 additions & 0 deletions mt7921/regs.h
Expand Up @@ -385,6 +385,12 @@
#define MT_TOP_MISC MT_TOP(0xf0)
#define MT_TOP_MISC_FW_STATE GENMASK(2, 0)

#define MT_MCU_WPDMA0_BASE 0x54000000
#define MT_MCU_WPDMA0(ofs) (MT_MCU_WPDMA0_BASE + (ofs))

#define MT_WFDMA_DUMMY_CR MT_MCU_WPDMA0(0x120)
#define MT_WFDMA_NEED_REINIT BIT(1)

#define MT_HW_BOUND 0x70010020
#define MT_HW_CHIPID 0x70010200
#define MT_HW_REV 0x70010204
Expand Down

0 comments on commit 5e764ec

Please sign in to comment.