litex_m2_baseboard: Add SDCard support.
This commit is contained in:
parent
0854a5d234
commit
32a9256f3b
|
@ -42,6 +42,25 @@ _io = [
|
||||||
Subsignal("tx_data", Pins("P1 P2 N1 N2")),
|
Subsignal("tx_data", Pins("P1 P2 N1 N2")),
|
||||||
IOStandard("LVCMOS25")
|
IOStandard("LVCMOS25")
|
||||||
),
|
),
|
||||||
|
|
||||||
|
# SDCard
|
||||||
|
("spisdcard", 0,
|
||||||
|
Subsignal("clk", Pins("P19")),
|
||||||
|
Subsignal("cs_n", Pins("U19"), Misc("PULLMODE=UP")),
|
||||||
|
Subsignal("mosi", Pins("T20"), Misc("PULLMODE=UP")),
|
||||||
|
Subsignal("miso", Pins("N20"), Misc("PULLMODE=UP")),
|
||||||
|
Misc("SLEWRATE=FAST"),
|
||||||
|
IOStandard("LVCMOS33"),
|
||||||
|
),
|
||||||
|
|
||||||
|
("sdcard", 0,
|
||||||
|
Subsignal("clk", Pins("P19")),
|
||||||
|
Subsignal("cd", Pins("T18"), Misc("PULLMODE=UP")),
|
||||||
|
Subsignal("cmd", Pins("T20"), Misc("PULLMODE=UP")),
|
||||||
|
Subsignal("data", Pins("N20 N19 U20 U19"), Misc("PULLMODE=UP")),
|
||||||
|
Misc("SLEWRATE=FAST"),
|
||||||
|
IOStandard("LVCMOS33"),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Connectors ---------------------------------------------------------------------------------------
|
# Connectors ---------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -85,6 +85,9 @@ def main():
|
||||||
ethopts = parser.add_mutually_exclusive_group()
|
ethopts = parser.add_mutually_exclusive_group()
|
||||||
ethopts.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet support")
|
ethopts.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet support")
|
||||||
ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support")
|
ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support")
|
||||||
|
sdopts = parser.add_mutually_exclusive_group()
|
||||||
|
sdopts.add_argument("--with-spi-sdcard", action="store_true", help="Enable SPI-mode SDCard support")
|
||||||
|
sdopts.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support")
|
||||||
builder_args(parser)
|
builder_args(parser)
|
||||||
soc_core_args(parser)
|
soc_core_args(parser)
|
||||||
trellis_args(parser)
|
trellis_args(parser)
|
||||||
|
@ -96,6 +99,10 @@ def main():
|
||||||
with_etherbone = args.with_etherbone,
|
with_etherbone = args.with_etherbone,
|
||||||
**soc_core_argdict(args)
|
**soc_core_argdict(args)
|
||||||
)
|
)
|
||||||
|
if args.with_spi_sdcard:
|
||||||
|
soc.add_spi_sdcard()
|
||||||
|
if args.with_sdcard:
|
||||||
|
soc.add_sdcard()
|
||||||
builder = Builder(soc, **builder_argdict(args))
|
builder = Builder(soc, **builder_argdict(args))
|
||||||
builder.build(**trellis_argdict(args), run=args.build)
|
builder.build(**trellis_argdict(args), run=args.build)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue