From 6677c1d0bdd9547152a8421cf2040c74c650c580 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 26 Jul 2022 10:27:19 +0200 Subject: [PATCH] sipeed_tang_primer_20k: Enable SDCard (SPI and SD modes). --- litex_boards/targets/sipeed_tang_primer_20k.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litex_boards/targets/sipeed_tang_primer_20k.py b/litex_boards/targets/sipeed_tang_primer_20k.py index cf23a9e..9c990e2 100755 --- a/litex_boards/targets/sipeed_tang_primer_20k.py +++ b/litex_boards/targets/sipeed_tang_primer_20k.py @@ -70,6 +70,9 @@ def main(): target_group.add_argument("--load", action="store_true", help="Load bitstream.") target_group.add_argument("--flash", action="store_true", help="Flash Bitstream.") target_group.add_argument("--sys-clk-freq", default=48e6, help="System clock frequency.") + sdopts = target_group.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() @@ -78,6 +81,10 @@ def main(): sys_clk_freq=int(float(args.sys_clk_freq)), **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)) if args.build: