mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
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>
This commit is contained in:
parent
7ecfe48b19
commit
cabe3206ab
19
dediprog.c
19
dediprog.c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user