diff --git a/litex_boards/platforms/litex_m2_baseboard.py b/litex_boards/platforms/litex_m2_baseboard.py index 5a3ec13..c2d627f 100644 --- a/litex_boards/platforms/litex_m2_baseboard.py +++ b/litex_boards/platforms/litex_m2_baseboard.py @@ -42,6 +42,25 @@ _io = [ Subsignal("tx_data", Pins("P1 P2 N1 N2")), 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 --------------------------------------------------------------------------------------- diff --git a/litex_boards/targets/litex_m2_baseboard.py b/litex_boards/targets/litex_m2_baseboard.py index 3c616fc..5c8d652 100755 --- a/litex_boards/targets/litex_m2_baseboard.py +++ b/litex_boards/targets/litex_m2_baseboard.py @@ -85,6 +85,9 @@ def main(): ethopts = parser.add_mutually_exclusive_group() ethopts.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet 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) soc_core_args(parser) trellis_args(parser) @@ -96,6 +99,10 @@ def main(): with_etherbone = args.with_etherbone, **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.build(**trellis_argdict(args), run=args.build)