integration/soc/add_sdcard: integrate interrupts.

This commit is contained in:
Florent Kermarrec 2020-12-01 13:25:05 +01:00
parent 2e7203d930
commit 8eecbd7b57
1 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,7 @@ from litex.soc.cores.spi_flash import SpiFlash
from litex.soc.cores.spi import SPIMaster from litex.soc.cores.spi import SPIMaster
from litex.soc.interconnect.csr import * from litex.soc.interconnect.csr import *
from litex.soc.interconnect.csr_eventmanager import *
from litex.soc.interconnect import csr_bus from litex.soc.interconnect import csr_bus
from litex.soc.interconnect import stream from litex.soc.interconnect import stream
from litex.soc.interconnect import wishbone from litex.soc.interconnect import wishbone
@ -1460,6 +1461,19 @@ class LiteXSoC(SoC):
dma_bus.add_master("sdmem2block", master=bus) dma_bus.add_master("sdmem2block", master=bus)
self.csr.add("sdmem2block", use_loc_if_exists=True) self.csr.add("sdmem2block", use_loc_if_exists=True)
# Interrupts
self.submodules.sdirq = EventManager()
self.sdirq.card_detect = EventSourcePulse(description="SDCard has been ejected/inserted.")
self.sdirq.block2mem_dma = EventSourcePulse(description="Block2Mem DMA terminated.")
self.sdirq.mem2block_dma = EventSourcePulse(description="Mem2Block DMA terminated.")
self.sdirq.finalize()
self.csr.add("sdirq")
self.comb += [
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),
]
# Add SATA ------------------------------------------------------------------------------------- # Add SATA -------------------------------------------------------------------------------------
def add_sata(self, name="sata", phy=None, mode="read+write"): def add_sata(self, name="sata", phy=None, mode="read+write"):
# Imports # Imports