From adf4e4025656f2488dc4915eb0d7a83e170cf9a7 Mon Sep 17 00:00:00 2001 From: mvoelkel Date: Fri, 24 Feb 2017 20:11:30 +0100 Subject: [PATCH] Fixed updating of a preloaded GTL version --- apps/octonet/ddflash.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/apps/octonet/ddflash.c b/apps/octonet/ddflash.c index cee76a0..979b3cf 100644 --- a/apps/octonet/ddflash.c +++ b/apps/octonet/ddflash.c @@ -617,17 +617,20 @@ static int update_flash(struct ddflash *ddf) if ((res = update_image(ddf, "/boot/fpga.img", 0x10000, 0xa0000, 1, 0)) == 1) stat |= 1; } else { - if ((res = update_image(ddf, "/config/fpga.img", 0x10000, 0xa0000, 1, 1)) == 1) - stat |= 1; - if (res == -1) - if ((res = update_image(ddf, "/boot/fpga.img", 0x10000, 0xa0000, 1, 1)) == 1) - stat |= 1; - if (res == -1) - if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x10000, 0xa0000, 1, 1)) == 1) - stat |= 1; - if (res == -1) - if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x10000, 0xa0000, 1, 1)) == 1) + if (ddf->id.device == 0x0307) { + if (res == -1) + if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x10000, 0xa0000, 1, 1)) == 1) + stat |= 1; + if (res == -1) + if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x10000, 0xa0000, 1, 1)) == 1) + stat |= 1; + } else { + if ((res = update_image(ddf, "/config/fpga.img", 0x10000, 0xa0000, 1, 1)) == 1) stat |= 1; + if (res == -1) + if ((res = update_image(ddf, "/boot/fpga.img", 0x10000, 0xa0000, 1, 1)) == 1) + stat |= 1; + } } #if 1 if ( (stat&1) && (ddf->id.hw & 0xffffff) <= 0x010001) {