Skip to content

Commit

Permalink
targets/orangecrab: add spi-sdcard and workaround for ValentyUSB.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Jun 11, 2020
1 parent c94cbae commit 64372d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion litex_boards/targets/orangecrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# License: BSD

import os
import sys
import argparse

from migen import *
Expand Down Expand Up @@ -91,7 +92,12 @@ def __init__(self, revision="0.2", device="25F", sdram_device="MT41K64M16",
platform = orangecrab.Platform(revision=revision, device=device ,toolchain=toolchain)

# Serial -----------------------------------------------------------------------------------
platform.add_extension(orangecrab.feather_serial)
if kwargs["uart_name"] == "usb_acm":
# FIXME: do proper install of ValentyUSB.
os.system("git clone https://github.com/gregdavill/valentyusb -b hw_cdc_eptri")
sys.path.append("valentyusb")
else:
platform.add_extension(orangecrab.feather_serial)

# SoCCore ----------------------------------------------------------------------------------
SoCCore.__init__(self, platform, clk_freq=sys_clk_freq, **kwargs)
Expand Down Expand Up @@ -145,6 +151,7 @@ def main():
parser.add_argument("--revision", default="0.2", help="Board Revision {0.1, 0.2} (default=0.2)")
parser.add_argument("--device", default="25F", help="ECP5 device (default=25F)")
parser.add_argument("--sdram-device", default="MT41K64M16", help="ECP5 device (default=MT41K64M16)")
parser.add_argument("--with-spi-sdcard", action="store_true", help="Enable SPI-mode SDCard support")
args = parser.parse_args()

soc = BaseSoC(
Expand All @@ -154,6 +161,8 @@ def main():
sdram_device = args.sdram_device,
sys_clk_freq = int(float(args.sys_clk_freq)),
**soc_sdram_argdict(args))
if args.with_spi_sdcard:
soc.add_spi_sdcard()
builder = Builder(soc, **builder_argdict(args))
builder_kargs = trellis_argdict(args) if args.toolchain == "trellis" else {}
builder.build(**builder_kargs, run=args.build)
Expand Down

0 comments on commit 64372d7

Please sign in to comment.