diff options
author | Jay Thompson <thompson.jay.thomas@gmail.com> | 2018-08-17 14:30:04 -0500 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2018-09-11 12:34:00 +0000 |
commit | cabe3206abd8d0cf51d80c55fa1e6464faf46008 (patch) | |
tree | e3ff87dad26c2d8be11e4559506941c3ec93b083 | |
parent | 7ecfe48b19c3e97341a3f2b0d85e7367ab92f2b6 (diff) | |
download | flashrom-cabe3206abd8d0cf51d80c55fa1e6464faf46008.tar.gz flashrom-cabe3206abd8d0cf51d80c55fa1e6464faf46008.tar.bz2 flashrom-cabe3206abd8d0cf51d80c55fa1e6464faf46008.zip |
Add initial support for Dediprog SF200.
Change-Id: I025d1533e249f6a75b6d9015a18a6abf350456b6
Signed-off-by: Jay Thompson <thompson.jay.thomas@gmail.com>
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/28272
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r-- | dediprog.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -51,6 +51,7 @@ static int dediprog_out_endpoint; enum dediprog_devtype { DEV_UNKNOWN = 0, DEV_SF100 = 100, + DEV_SF200 = 200, DEV_SF600 = 600, }; @@ -152,7 +153,7 @@ enum protocol { }; const struct dev_entry devs_dediprog[] = { - {0x0483, 0xDADA, OK, "Dediprog", "SF100/SF600"}, + {0x0483, 0xDADA, OK, "Dediprog", "SF100/SF200/SF600"}, {0}, }; @@ -181,6 +182,7 @@ static enum protocol protocol(void) /* Firmware version < 5.0.0 is handled explicitly in some cases. */ switch (dediprog_devicetype) { case DEV_SF100: + case DEV_SF200: if (dediprog_firmwareversion < FIRMWARE_VERSION(5, 5, 0)) return PROTOCOL_V1; else @@ -756,10 +758,12 @@ static int dediprog_check_devicestring(void) msg_pdbg("Found a %s\n", buf); if (memcmp(buf, "SF100", 0x5) == 0) dediprog_devicetype = DEV_SF100; + else if (memcmp(buf, "SF200", 0x5) == 0) + dediprog_devicetype = DEV_SF200; else if (memcmp(buf, "SF600", 0x5) == 0) dediprog_devicetype = DEV_SF600; else { - msg_perr("Device not a SF100 or SF600!\n"); + msg_perr("Device not a SF100, SF200, or SF600!\n"); return 1; } @@ -1091,12 +1095,17 @@ int dediprog_init(void) return 1; } - /* SF100 only has 1 endpoint for in/out, SF600 uses two separate endpoints instead. */ + /* SF100/SF200 uses one in/out endpoint, SF600 uses separate in/out endpoints */ dediprog_in_endpoint = 2; - if (dediprog_devicetype == DEV_SF100) + switch (dediprog_devicetype) { + case DEV_SF100: + case DEV_SF200: dediprog_out_endpoint = 2; - else + break; + default: dediprog_out_endpoint = 1; + break; + } /* Set all possible LEDs as soon as possible to indicate activity. * Because knowing the firmware version is required to set the LEDs correctly we need to this after |