Adds a function to enable the flash interface on w83697xx superio's.
Still needs to be hooked up to the superio detection framework though.
Signed-off-by: David Borg <borg.db(a)gmail.com>
Hello,
I tried out flashrom on a ASUS OPLX-M motherboard, and it didn't find a flash
device. I found some info by googling (that I cannot verify) that the OPLX-M
would be an OEM (or something) version of the ASUS MEL-M; I suppose this
particular board originally came with a Fujitsu/Siemens PC.
http://support.asus.com/download/download.aspx?modelname=MEL-M&SLanguage=en…
Hi Mike,
On 23.02.2010 05:45, Spangler, Mike T wrote:
> I can probe with a continuity tester, but would need to know specific
> pin locations to try. Do you have any generic info on doing this?
Yes (well, I'd have to write up something), but the solution mentioned
by Michael is way easier, so I'll wait until Michael has diagnosed the
GPIO settings from the flashrom run on factory BIOS.
Regards,
Carl-Daniel
--
"I do consider assignment statements and pointer variables to be among
computer science's most valuable treasures."
-- Donald E. Knuth
On Thu, Sep 08, 2011 at 12:56:23AM +0200, Stefan Tauner wrote:
> +0x14 Set SPI clock frequency 16-bit requested frequency ACK + 16-bit set frequency / NAK
^
"Set SPI clock frequency (in Hz)"
> + 0x14 (S_SPI_SCK):
Please rename to S_SPI_FREQ (also all other places with 'SCK'). SCK is
often used to name a clock pin, this is unnecessarily confusing here.
> + Set the SPI clock frequency.
^
in Hz
> + f_spi = extract_programmer_param("sck");
sck -> freq
> + if (f_spi && strlen(f_spi)) {
> + uint8_t buf[2];
> + uint16_t tmp = atoi(f_spi);
Hm, maybe use strtol() later and check for errors, atoi() is not so
good for that.
> + if (sp_check_commandavail(S_CMD_S_SPI_SCK) == 0)
> + msg_pdbg(MSGHEADER "Setting SPI clock rate is "
> + "not supported!\n");
> + else if (sp_docommand(S_CMD_S_SPI_SCK, 2, buf, 2, buf)
> + == 0) {
> + tmp = buf[0] | (buf[1]<<8);
^^
Missing spaces.
> + msg_pdbg(MSGHEADER "Requested to set SPI clock "
> + "frequency to %s kHz. It was actually "
> + "set to %d kHz\n", f_spi, tmp);
kHz -> Hz
I would highly recommend to use Hz as the unit for setting the frequency
(in the API). The frontend (flashrom) can easily allow freq=1000,
or freq=1khz, or freq=1mhz etc. for user friendlyness, but the API
should maintain max. flexibility IMHO.
Uwe.
--
http://hermann-uwe.de | http://sigrok.orghttp://randomprojects.org | http://unmaintained-free-software.org
Hello all,
The specific board this is for is the Supermicro H8DGT. Attached is
only the specification, which is not guaranteed to be correct. Use with
care.
Also, after using this, you may want to turn off and unplug the computer
for a few minutes to restore the correct operational state.
The AMD SB700/710/750 Register Reference Guide (#43009) was used as a
reference.
Thanks,
Josh
Secret knowledge is cool, but public knowledge is better.
Implement all Dediprog commands found in USB traces, even if their
purpose is not yet known.
Annotate unknown commands with info about the call sequence they are
embedded in and the firmware version of the log.
Add a new shutdown command for firmware 5.x.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Index: flashrom-dediprog_unknown_commands/dediprog.c
===================================================================
--- flashrom-dediprog_unknown_commands/dediprog.c (Revision 1232)
+++ flashrom-dediprog_unknown_commands/dediprog.c (Arbeitskopie)
@@ -27,6 +27,7 @@
#define DEFAULT_TIMEOUT 3000
static usb_dev_handle *dediprog_handle;
+static int dediprog_firmwareversion;
#if 0
/* Might be useful for other pieces of code as well. */
@@ -228,6 +229,7 @@
fw[1], fw[2]);
return 1;
}
+ dediprog_firmwareversion = fw[0];
return 0;
}
@@ -253,6 +255,32 @@
return 0;
}
+#if 0
+/* Something.
+ * Present in eng_detect_blink.log with firmware 3.1.8
+ * Always preceded by Command Receive Device String
+ */
+static int dediprog_command_b(void)
+{
+ int ret;
+ char buf[0x3];
+
+ memset(buf, 0, sizeof(buf));
+ ret = usb_control_msg(dediprog_handle, 0xc3, 0x7, 0x0, 0xef00, buf, 0x3, DEFAULT_TIMEOUT);
+ if (ret < 0) {
+ msg_perr("Command B failed (%s)!\n", usb_strerror());
+ return 1;
+ }
+ if ((ret != 0x3) || (buf[0] != 0xff) || (buf[1] != 0xff) ||
+ (buf[2] != 0xff)) {
+ msg_perr("Unexpected response to Command B!\n");
+ return 1;
+ }
+
+ return 0;
+}
+#endif
+
/* Command C is only sent after dediprog_check_devicestring, but not after every
* invocation of dediprog_check_devicestring. It is only sent after the first
* dediprog_command_a(); dediprog_check_devicestring() sequence in each session.
@@ -264,7 +292,7 @@
ret = usb_control_msg(dediprog_handle, 0x42, 0x4, 0x0, 0x0, NULL, 0x0, DEFAULT_TIMEOUT);
if (ret != 0x0) {
- msg_perr("Unexpected response to Command C!\n");
+ msg_perr("Command C failed (%s)!\n", usb_strerror());
return 1;
}
return 0;
@@ -274,6 +302,7 @@
/* Very strange. Seems to be a programmer keepalive or somesuch.
* Wait unsuccessfully for timeout ms to read one byte.
* Is usually called after setting voltage to 0.
+ * Present in all logs with Firmware 2.1.1 and 3.1.8
*/
static int dediprog_command_f(int timeout)
{
@@ -282,14 +311,90 @@
memset(buf, 0, sizeof(buf));
ret = usb_control_msg(dediprog_handle, 0xc2, 0x11, 0xff, 0xff, buf, 0x1, timeout);
+ /* This check is most probably wrong. Command F always causes a timeout
+ * in the logs, so we should check for timeout instead of checking for
+ * success.
+ */
+ if (ret != 0x1) {
+ msg_perr("Command F failed (%s)!\n", usb_strerror());
+ return 1;
+ }
+ return 0;
+}
+
+/* Start/stop blinking?
+ * Present in eng_detect_blink.log with firmware 3.1.8
+ * Preceded by Command J
+ */
+static int dediprog_command_g(void)
+{
+ int ret;
+
+ ret = usb_control_msg(dediprog_handle, 0x42, 0x07, 0x09, 0x03, NULL, 0x0, DEFAULT_TIMEOUT);
if (ret != 0x0) {
- msg_perr("Unexpected response to Command F!\n");
+ msg_perr("Command G failed (%s)!\n", usb_strerror());
return 1;
}
return 0;
}
+
+/* Something.
+ * Present in all logs with firmware 5.1.5
+ * Always preceded by Command Receive Device String
+ * Always followed by Command Set SPI Voltage nonzero
+ */
+static int dediprog_command_h(void)
+{
+ int ret;
+
+ ret = usb_control_msg(dediprog_handle, 0x42, 0x07, 0x09, 0x05, NULL, 0x0, DEFAULT_TIMEOUT);
+ if (ret != 0x0) {
+ msg_perr("Command H failed (%s)!\n", usb_strerror());
+ return 1;
+ }
+ return 0;
+}
#endif
+/* Shutdown for firmware 5.x?
+ * Present in all logs with firmware 5.1.5
+ * Often preceded by a SPI operation (Command Read SPI Bulk or Receive SPI)
+ * Always followed by Command Set SPI Voltage 0x0000
+ */
+static int dediprog_command_i(void)
+{
+ int ret;
+
+ ret = usb_control_msg(dediprog_handle, 0x42, 0x07, 0x09, 0x06, NULL, 0x0, DEFAULT_TIMEOUT);
+ if (ret != 0x0) {
+ msg_perr("Command I failed (%s)!\n", usb_strerror());
+ return 1;
+ }
+ return 0;
+}
+
+#if 0
+/* Start/stop blinking?
+ * Present in all logs with firmware 5.1.5
+ * Always preceded by Command Receive Device String on 5.1.5
+ * Always followed by Command Set SPI Voltage nonzero on 5.1.5
+ * Present in eng_detect_blink.log with firmware 3.1.8
+ * Preceded by Command B in eng_detect_blink.log
+ * Followed by Command G in eng_detect_blink.log
+ */
+static int dediprog_command_j(void)
+{
+ int ret;
+
+ ret = usb_control_msg(dediprog_handle, 0x42, 0x07, 0x09, 0x07, NULL, 0x0, DEFAULT_TIMEOUT);
+ if (ret != 0x0) {
+ msg_perr("Command J failed (%s)!\n", usb_strerror());
+ return 1;
+ }
+ return 0;
+}
+#endif
+
static int parse_voltage(char *voltage)
{
char *tmp = NULL;
@@ -445,9 +550,11 @@
/* URB 136 is just URB 9. */
/* URB 137 is just URB 11. */
- /* Command I is probably Start Bulk Read. Data is u16 blockcount, u16 blocksize. */
- /* Command J is probably Start Bulk Write. Data is u16 blockcount, u16 blocksize. */
- /* Bulk transfer sizes for Command I/J are always 512 bytes, rest is filled with 0xff. */
+ /* Command Start Bulk Read. Data is u16 blockcount, u16 blocksize. */
+ /* Command Start Bulk Write. Data is u16 blockcount, u16 blocksize. */
+ /* Bulk transfer sizes for Command Start Bulk Read/Write are always
+ * 512 bytes, rest is filled with 0xff.
+ */
return 0;
}
@@ -457,6 +564,10 @@
{
msg_pspew("%s\n", __func__);
+ /* Shutdown on firmware 5.x */
+ if (dediprog_firmwareversion == 5)
+ if (dediprog_command_i())
+ return 1;
/* URB 28. Command Set SPI Voltage to 0. */
if (dediprog_set_spi_voltage(0x0))
return 1;
--
http://www.hailfinger.org/
I've been extremely busy with preparing for the US Air Force, which I
leave for Basic on November 2nd.
But...
Fintek SPI Flashrom Driver:
* based off of it87spi.c
* untested
* should be good for F71882 and F71889
Signed-off-by: Sean Nelson <audiohacked(a)gmail.com>