efinix_titanium_ti60_t225: Add SPI/Native SDCard support.

Both modes working with 8559b88ad8.
This commit is contained in:
Florent Kermarrec 2022-02-21 10:01:18 +01:00
parent df36cdbcc9
commit 7d84e6e863
2 changed files with 16 additions and 2 deletions

View File

@ -17,9 +17,16 @@ _io = [
("clk74_25", 0, Pins("A11"), IOStandard("1.8_V_LVCMOS")), ("clk74_25", 0, Pins("A11"), IOStandard("1.8_V_LVCMOS")),
# SD-Card # 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, ("sdcard", 0,
Subsignal("data", Pins("B14 A14 D12 A12")), Subsignal("data", Pins("B14 A14 D12 A12"), Misc("WEAK_PULLUP")),
Subsignal("cmd", Pins("C12")), Subsignal("cmd", Pins("C12"), Misc("WEAK_PULLUP")),
Subsignal("clk", Pins("B12")), Subsignal("clk", Pins("B12")),
IOStandard("3.3_V_LVCMOS"), IOStandard("3.3_V_LVCMOS"),
), ),

View File

@ -80,6 +80,9 @@ def main():
parser.add_argument("--sys-clk-freq", default=200e6, help="System clock frequency.") 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-spi-flash", action="store_true", help="Enable SPI Flash (MMAPed).")
parser.add_argument("--with-hyperram", action="store_true", help="Enable HyperRAM.") 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) builder_args(parser)
soc_core_args(parser) soc_core_args(parser)
args = parser.parse_args() args = parser.parse_args()
@ -89,6 +92,10 @@ def main():
with_spi_flash = args.with_spi_flash, with_spi_flash = args.with_spi_flash,
with_hyperram = args.with_hyperram, with_hyperram = args.with_hyperram,
**soc_core_argdict(args)) **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 = Builder(soc, **builder_argdict(args))
builder.build(run=args.build) builder.build(run=args.build)