Skip to content

Commit dc71d56

Browse files
authored
ecpix5: use builtin FT2232 for programming.
1 parent 8d93fe2 commit dc71d56

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

amaranth_boards/ecpix5.py

+4-28
Original file line numberDiff line numberDiff line change
@@ -121,35 +121,11 @@ class _ECPIX5Platform(LatticeECP5Platform):
121121
Connector("pmod", 7, "D14 B14 E14 B16 - - C14 A14 A15 A16 - -"),
122122
]
123123

124-
@property
125-
def file_templates(self):
126-
return {
127-
**super().file_templates,
128-
"{{name}}-openocd.cfg": r"""
129-
interface ftdi
130-
ftdi_vid_pid 0x0403 0x6010
131-
ftdi_channel 0
132-
ftdi_layout_init 0xfff8 0xfffb
133-
reset_config none
134-
adapter_khz 25000
135-
136-
{% if "85F" in platform.device -%}
137-
jtag newtap ecp5 tap -irlen 8 -expected-id 0x81113043 ; # LF5UM5G-85F
138-
{% else -%}
139-
jtag newtap ecp5 tap -irlen 8 -expected-id 0x81112043 ; # LF5UM5G-45F
140-
{% endif %}
141-
"""
142-
}
143-
144124
def toolchain_program(self, products, name):
145-
openocd = os.environ.get("OPENOCD", "openocd")
146-
with products.extract("{}-openocd.cfg".format(name), "{}.svf".format(name)) \
147-
as (config_filename, vector_filename):
148-
subprocess.check_call([openocd,
149-
"-f", config_filename,
150-
"-c", "transport select jtag; init; svf -quiet {}; exit".format(vector_filename)
151-
])
152-
125+
import os, subprocess
126+
tool = os.environ.get("OPENFPGALOADER", "openFPGALoader")
127+
with products.extract("{}.bit".format(name)) as bitstream_filename:
128+
subprocess.check_call([tool, '-c', 'ft2232', '-m', bitstream_filename])
153129

154130
class ECPIX545Platform(_ECPIX5Platform):
155131
device = "LFE5UM5G-45F"

0 commit comments

Comments
 (0)