From 5fd3e8dbcd509567990e15a5ef143ec838671576 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 28 Jul 2020 17:45:49 +0200 Subject: [PATCH] ecpix5: add SDCard. Validated with Linux-on-LiteX-VexRiscv. --- litex_boards/platforms/ecpix5.py | 11 +++++++++++ litex_boards/targets/ecpix5.py | 3 +++ 2 files changed, 14 insertions(+) diff --git a/litex_boards/platforms/ecpix5.py b/litex_boards/platforms/ecpix5.py index b59e362..408e40d 100644 --- a/litex_boards/platforms/ecpix5.py +++ b/litex_boards/platforms/ecpix5.py @@ -85,6 +85,17 @@ _io = [ Subsignal("tx_data", Pins("D8 C8 B8 A8")), IOStandard("LVCMOS33") ), + + # sdcard + ("sdcard", 0, + Subsignal("data", Pins("N26 N25 N23 N21"), Misc("PULLMODE=UP")), + Subsignal("cmd", Pins("M24"), Misc("PULLMODE=UP")), + Subsignal("clk", Pins("P24")), + Subsignal("cmd_dir", Pins("M23")), + Subsignal("dat0_dir", Pins("N24")), + Subsignal("dat13_dir", Pins("P26")), + IOStandard("LVCMOS33"), + ), ] _connectors = [] diff --git a/litex_boards/targets/ecpix5.py b/litex_boards/targets/ecpix5.py index 6149c6e..3a12614 100755 --- a/litex_boards/targets/ecpix5.py +++ b/litex_boards/targets/ecpix5.py @@ -123,6 +123,7 @@ def main(): parser = argparse.ArgumentParser(description="LiteX SoC on ECPIX-5") parser.add_argument("--build", action="store_true", help="Build bitstream") parser.add_argument("--load", action="store_true", help="Load bitstream") + parser.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support") builder_args(parser) soc_core_args(parser) trellis_args(parser) @@ -130,6 +131,8 @@ def main(): args = parser.parse_args() soc = BaseSoC(with_ethernet=args.with_ethernet, **soc_core_argdict(args)) + if args.with_sdcard: + soc.add_sdcard() builder = Builder(soc, **builder_argdict(args)) builder.build(**trellis_argdict(args), run=args.build)