mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-27 12:18:26 +08:00
frontend: make coremgmt flash zynq-compatible
This commit is contained in:
parent
2b73d5a4c6
commit
5c21649d10
@ -208,6 +208,7 @@ class CommMgmt:
|
|||||||
for filename in bin_paths:
|
for filename in bin_paths:
|
||||||
with open(filename, "rb") as fi:
|
with open(filename, "rb") as fi:
|
||||||
bin_ = fi.read()
|
bin_ = fi.read()
|
||||||
|
if (len(bin_paths) > 1):
|
||||||
image_buf.write(struct.pack(self.endian + "I", len(bin_)))
|
image_buf.write(struct.pack(self.endian + "I", len(bin_)))
|
||||||
image_buf.write(bin_)
|
image_buf.write(bin_)
|
||||||
|
|
||||||
|
@ -94,6 +94,9 @@ def get_argparser():
|
|||||||
t_flash = tools.add_parser("flash",
|
t_flash = tools.add_parser("flash",
|
||||||
help="flash the running system")
|
help="flash the running system")
|
||||||
|
|
||||||
|
p_zynq = t_flash.add_argument("-z", "--zynq", default=False,
|
||||||
|
help="target zynq device", action="store_true")
|
||||||
|
|
||||||
p_directory = t_flash.add_argument("directory", metavar="DIRECTORY", type=str,
|
p_directory = t_flash.add_argument("directory", metavar="DIRECTORY", type=str,
|
||||||
help="directory that contains the binaries")
|
help="directory that contains the binaries")
|
||||||
|
|
||||||
@ -160,6 +163,10 @@ def main():
|
|||||||
mgmt.config_erase()
|
mgmt.config_erase()
|
||||||
|
|
||||||
if args.tool == "flash":
|
if args.tool == "flash":
|
||||||
|
if args.zynq:
|
||||||
|
boot = os.path.join(args.directory, "boot.bin")
|
||||||
|
bins = [ boot ]
|
||||||
|
else:
|
||||||
def artifact_path(this_binary_dir, *path_filename):
|
def artifact_path(this_binary_dir, *path_filename):
|
||||||
if args.srcbuild:
|
if args.srcbuild:
|
||||||
# source tree - use path elements to locate file
|
# source tree - use path elements to locate file
|
||||||
@ -194,6 +201,7 @@ def main():
|
|||||||
firmware = firmwares[0]
|
firmware = firmwares[0]
|
||||||
|
|
||||||
bins = [ gateware, bootloader, firmware ]
|
bins = [ gateware, bootloader, firmware ]
|
||||||
|
|
||||||
mgmt.flash(bins)
|
mgmt.flash(bins)
|
||||||
|
|
||||||
if args.tool == "reboot":
|
if args.tool == "reboot":
|
||||||
|
Loading…
Reference in New Issue
Block a user