1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

check for old golden version

This commit is contained in:
mvoelkel 2017-02-24 15:01:11 +01:00
parent 9eb5458eeb
commit 285d7aed49

View File

@ -510,6 +510,11 @@ static int check_fw(struct ddflash *ddf, char *fn, uint32_t *fw_off)
goto out; goto out;
} }
} else if (!strcasecmp(key, "Version")) { } else if (!strcasecmp(key, "Version")) {
if (strchr(val,'.')) {
int major = 0, minor = 0;
sscanf(val,"%d.%d",&major,&minor);
version = (major << 16) + minor;
} else
sscanf(val, "%x", &version); sscanf(val, "%x", &version);
} else if (!strcasecmp(key, "Length")) { } else if (!strcasecmp(key, "Length")) {
sscanf(val, "%u", &length); sscanf(val, "%u", &length);
@ -620,14 +625,14 @@ static int update_flash(struct ddflash *ddf)
stat |= 1; stat |= 1;
} }
#if 1 #if 1
if ((ddf->id.hw & 0xffffff) == 0x010001) { if ( (stat&1) && (ddf->id.hw & 0xffffff) <= 0x010001) {
if (fexists("/config/gtl.enabled")) { if (ddf->id.device == 0x0307) {
if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x160000, 0x80000, 1, 0)) == 1) if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x160000, 0x80000, 1, 0)) == 1)
stat |= 1; stat |= 1;
if (res == -1) if (res == -1)
if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x160000, 0x80000, 1, 0)) == 1) if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x160000, 0x80000, 1, 0)) == 1)
stat |= 1; stat |= 1;
} else if (fexists("/config/gtl.disabled")) { } else {
if ((res = update_image(ddf, "/config/fpga.img", 0x160000, 0x80000, 1, 0)) == 1) if ((res = update_image(ddf, "/config/fpga.img", 0x160000, 0x80000, 1, 0)) == 1)
stat |= 1; stat |= 1;
if (res == -1) if (res == -1)