soc/add_sdcard: Fix IRQ code, only add IRQs depending on mode
This commit is contained in:
parent
c64c6e4056
commit
e17a010866
|
@ -1563,14 +1563,18 @@ class LiteXSoC(SoC):
|
||||||
# Interrupts.
|
# Interrupts.
|
||||||
self.submodules.sdirq = EventManager()
|
self.submodules.sdirq = EventManager()
|
||||||
self.sdirq.card_detect = EventSourcePulse(description="SDCard has been ejected/inserted.")
|
self.sdirq.card_detect = EventSourcePulse(description="SDCard has been ejected/inserted.")
|
||||||
|
if "read" in mode:
|
||||||
self.sdirq.block2mem_dma = EventSourcePulse(description="Block2Mem DMA terminated.")
|
self.sdirq.block2mem_dma = EventSourcePulse(description="Block2Mem DMA terminated.")
|
||||||
|
if "write" in mode:
|
||||||
self.sdirq.mem2block_dma = EventSourcePulse(description="Mem2Block DMA terminated.")
|
self.sdirq.mem2block_dma = EventSourcePulse(description="Mem2Block DMA terminated.")
|
||||||
self.sdirq.cmd_done = EventSourceLevel(description="Command completed.")
|
self.sdirq.cmd_done = EventSourceLevel(description="Command completed.")
|
||||||
self.sdirq.finalize()
|
self.sdirq.finalize()
|
||||||
|
if "read" in mode:
|
||||||
|
self.comb += self.sdirq.block2mem_dma.trigger.eq(self.sdblock2mem.irq)
|
||||||
|
if "write" in mode:
|
||||||
|
self.comb += self.sdirq.mem2block_dma.trigger.eq(self.sdmem2block.irq)
|
||||||
self.comb += [
|
self.comb += [
|
||||||
self.sdirq.card_detect.trigger.eq(self.sdphy.card_detect_irq),
|
self.sdirq.card_detect.trigger.eq(self.sdphy.card_detect_irq),
|
||||||
self.sdirq.block2mem_dma.trigger.eq(self.sdblock2mem.irq),
|
|
||||||
self.sdirq.mem2block_dma.trigger.eq(self.sdmem2block.irq),
|
|
||||||
self.sdirq.cmd_done.trigger.eq(self.sdcore.cmd_event.fields.done)
|
self.sdirq.cmd_done.trigger.eq(self.sdcore.cmd_event.fields.done)
|
||||||
]
|
]
|
||||||
if self.irq.enabled:
|
if self.irq.enabled:
|
||||||
|
|
Loading…
Reference in New Issue