From 4eb0026a69fc3baff45fa359735152655e584a80 Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Mon, 4 Jan 2021 13:10:13 -0500 Subject: [PATCH 1/2] genesys2: add "rst" and "cd" signals to (spi-)sdcard records Signed-off-by: Gabriel Somlo --- litex_boards/platforms/genesys2.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/litex_boards/platforms/genesys2.py b/litex_boards/platforms/genesys2.py index a2eeb17..d1b127b 100644 --- a/litex_boards/platforms/genesys2.py +++ b/litex_boards/platforms/genesys2.py @@ -68,17 +68,20 @@ _io = [ # SDCard ("spisdcard", 0, + Subsignal("rst", Pins("AE24")), Subsignal("clk", Pins("R28")), - Subsignal("cs_n", Pins("T30")), - Subsignal("mosi", Pins("R29"), Misc("PULLUP")), - Subsignal("miso", Pins("R26"), Misc("PULLUP")), + Subsignal("cs_n", Pins("T30"), Misc("PULLUP True")), + Subsignal("mosi", Pins("R29"), Misc("PULLUP True")), + Subsignal("miso", Pins("R26"), Misc("PULLUP True")), Misc("SLEW=FAST"), IOStandard("LVCMOS33") ), ("sdcard", 0, - Subsignal("clk", Pins("R28")), - Subsignal("cmd", Pins("R29"), Misc("PULLUP True")), + Subsignal("rst", Pins("AE24"), Misc("PULLUP True")), Subsignal("data", Pins("R26 R30 P29 T30"), Misc("PULLUP True")), + Subsignal("cmd", Pins("R29"), Misc("PULLUP True")), + Subsignal("clk", Pins("R28")), + Subsignal("cd", Pins("P28")), Misc("SLEW=FAST"), IOStandard("LVCMOS33") ), From 2589d9f7042253376e3ec739d3925356e9cf2ebe Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Mon, 4 Jan 2021 13:57:21 -0500 Subject: [PATCH 2/2] genesys2: add (spi-)sdcard build options Signed-off-by: Gabriel Somlo --- litex_boards/targets/genesys2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litex_boards/targets/genesys2.py b/litex_boards/targets/genesys2.py index c600d14..228e250 100755 --- a/litex_boards/targets/genesys2.py +++ b/litex_boards/targets/genesys2.py @@ -102,6 +102,8 @@ def main(): parser.add_argument("--sys-clk-freq", default=100e6, help="System clock frequency (default: 100MHz)") parser.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet support") parser.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support") + parser.add_argument("--with-spi-sdcard", action="store_true", help="Enable SPI-mode SDCard support") + parser.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support") builder_args(parser) soc_sdram_args(parser) args = parser.parse_args() @@ -113,6 +115,11 @@ def main(): with_etherbone = args.with_etherbone, **soc_sdram_argdict(args) ) + assert not (args.with_spi_sdcard and args.with_sdcard) + if args.with_spi_sdcard: + soc.add_spi_sdcard() + if args.with_sdcard: + soc.add_sdcard() builder = Builder(soc, **builder_argdict(args)) builder.build(run=args.build)