From 7d84e6e8637c20e6ca2473391e8fdc6d044d1fff Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 21 Feb 2022 10:01:18 +0100 Subject: [PATCH] efinix_titanium_ti60_t225: Add SPI/Native SDCard support. Both modes working with https://github.com/enjoy-digital/litex/commit/8559b88ad889e16d400df6787c80d939461d0d1e. --- .../platforms/efinix_titanium_ti60_f225_dev_kit.py | 11 +++++++++-- .../targets/efinix_titanium_ti60_f225_dev_kit.py | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/litex_boards/platforms/efinix_titanium_ti60_f225_dev_kit.py b/litex_boards/platforms/efinix_titanium_ti60_f225_dev_kit.py index ccf9d89..14364c7 100644 --- a/litex_boards/platforms/efinix_titanium_ti60_f225_dev_kit.py +++ b/litex_boards/platforms/efinix_titanium_ti60_f225_dev_kit.py @@ -17,9 +17,16 @@ _io = [ ("clk74_25", 0, Pins("A11"), IOStandard("1.8_V_LVCMOS")), # SD-Card + ("spisdcard", 0, + Subsignal("clk", Pins("B12")), + Subsignal("mosi", Pins("C12"), Misc("WEAK_PULLUP")), + Subsignal("cs_n", Pins("A12"), Misc("WEAK_PULLUP")), + Subsignal("miso", Pins("B14"), Misc("WEAK_PULLUP")), + IOStandard("1.8_V_LVCMOS"), + ), ("sdcard", 0, - Subsignal("data", Pins("B14 A14 D12 A12")), - Subsignal("cmd", Pins("C12")), + Subsignal("data", Pins("B14 A14 D12 A12"), Misc("WEAK_PULLUP")), + Subsignal("cmd", Pins("C12"), Misc("WEAK_PULLUP")), Subsignal("clk", Pins("B12")), IOStandard("3.3_V_LVCMOS"), ), diff --git a/litex_boards/targets/efinix_titanium_ti60_f225_dev_kit.py b/litex_boards/targets/efinix_titanium_ti60_f225_dev_kit.py index da0bab2..c12f027 100755 --- a/litex_boards/targets/efinix_titanium_ti60_f225_dev_kit.py +++ b/litex_boards/targets/efinix_titanium_ti60_f225_dev_kit.py @@ -80,6 +80,9 @@ def main(): parser.add_argument("--sys-clk-freq", default=200e6, help="System clock frequency.") parser.add_argument("--with-spi-flash", action="store_true", help="Enable SPI Flash (MMAPed).") parser.add_argument("--with-hyperram", action="store_true", help="Enable HyperRAM.") + 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) args = parser.parse_args() @@ -89,6 +92,10 @@ def main(): with_spi_flash = args.with_spi_flash, with_hyperram = args.with_hyperram, **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(run=args.build)