Nico Huber merged this change.

View Change

Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved Nico Huber: Looks good to me, approved
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>
---
M dediprog.c
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/dediprog.c b/dediprog.c
index 1a469a7..58f1d43 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -51,6 +51,7 @@
enum dediprog_devtype {
DEV_UNKNOWN = 0,
DEV_SF100 = 100,
+ DEV_SF200 = 200,
DEV_SF600 = 600,
};

@@ -152,7 +153,7 @@
};

const struct dev_entry devs_dediprog[] = {
- {0x0483, 0xDADA, OK, "Dediprog", "SF100/SF600"},
+ {0x0483, 0xDADA, OK, "Dediprog", "SF100/SF200/SF600"},

{0},
};
@@ -181,6 +182,7 @@
/* 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 @@
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 @@
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

To view, visit change 28272. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I025d1533e249f6a75b6d9015a18a6abf350456b6
Gerrit-Change-Number: 28272
Gerrit-PatchSet: 4
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus@gmail.com>