Discussion:
[flashrom] MSI Z68MA-G45 report and on-board SPI flashing using Bus Pirate
Paul Kocialkowski
2012-06-18 10:40:41 UTC
Permalink
I recently got myself a MSI Z68MA-G45 board. It's running with an Intel
Z68 chipset, which has some support in flashrom and coreboot.

First, I ran flashrom with the system on the board and it was able to
correctly read the chip (see attached log). I uploaded the read data
[1]. The UEFI interface proposed to save the UEFI image on usb storage
[2]: I was then able to compare it to the read data from flashrom. It
appears that the UEFI image are the last 0x600000 bytes of the BIOS ROM
image (from 0x200000 to 0x7FFFFF).

While searching for the BIOS chip on the board hardware, I saw a set of
pins called "JSPI1", right next to the BIOS SPI chip [3]. After some
research [4][5], I used this pin layout: [6].

The only SPI flasher I have is a Bus Pirate, that I used with flashrom
at different spispeeds, but it never worked (it was only returning
either 0xff or 0x00) (see attached logs). I used connectors from an USB
on-board connector (9 pins) but had to take them off the plastic as the
pins disposal didn't match the JSPI1 disposal (the pins are closer to
each other than on USB on-board connectors). Fearing that the connectors
would touch each other, I put adhesive tape around to isolate them [7].
As it still didn't work, I put some of the connectors of the bus pirate
(I have a probe cable) directly on the pins, but it was only possible
for 4 of them and used my hand-made cables for the rest [8]. Though, it
still didn't work.

Any lead on this would be welcome. According to
http://www.flashrom.org/ISP it can be because of cable length: are the
buspirate probe cables too long for this? [9]

[1] http://download.paulk.fr/coreboot/msi-z68ma-g45/bios.rom
[2] http://download.paulk.fr/coreboot/msi-z68ma-g45/E7676IMS.H10.rom
[3]
Loading Image...
[4]
http://soj.mesdiscussions.net/soj/Electronique/Autres/projet-adaptateur-hardware-sujet_5491_1.htm
[5] http://forum-en.msi.com/index.php?topic=139099.0
[6] Loading Image...
[7]
Loading Image...
[8]
Loading Image...
[9] Loading Image...

--
Paul Kocialkowski
Denis 'GNUtoo' Carikli
2012-06-18 12:35:46 UTC
Permalink
Post by Paul Kocialkowski
I recently got myself a MSI Z68MA-G45 board. It's running with an Intel
Z68 chipset, which has some support in flashrom and coreboot.
However the board itself is not in coreboot yet(I suppose you want to
add support for it):
ls src/mainboard/msi/ gives:
Kconfig ms6119 ms6147 ms6156 ms6178 ms7135 ms7260 ms9185 ms9282
ms9652_fam10
Post by Paul Kocialkowski
First, I ran flashrom with the system on the board and it was able to
correctly read the chip (see attached log). I uploaded the read data
[1]. The UEFI interface proposed to save the UEFI image on usb storage
[2]: I was then able to compare it to the read data from flashrom. It
appears that the UEFI image are the last 0x600000 bytes of the BIOS ROM
image (from 0x200000 to 0x7FFFFF).
Did you power off the mainboard? if not maybe that's why the buspirate
doesn't work.
Post by Paul Kocialkowski
While searching for the BIOS chip on the board hardware, I saw a set of
pins called "JSPI1", right next to the BIOS SPI chip [3].
So your BIOS chip can be accessed trough both SPI and FWH?
Post by Paul Kocialkowski
The only SPI flasher I have is a Bus Pirate,
do you also have an Arduino uno? or an openmoko debug board left(if not
I can give you one back without the openmoko ribbon cable this summer)?

Note that the openmoko debug board is very undocumented.

Also Note that there was some recent patches touching the buspirate.
Post by Paul Kocialkowski
it can be because of cable length: are the buspirate probe cables too
long for this? [9]
I'm not sure...but with the following setup:
Loading Image...
I had some trouble with reflashing the BIOS and flashrom retried once.

However it can also be the wiring, for instance is it correctly wired?
is the write protection on? (it's active-low so it should be high to
prevent write-protection...), is the chip select connected to the
buspirate?

you could also check the datasheet of your chip...

Denis.
Paul Kocialkowski
2012-06-20 16:11:04 UTC
Permalink
Finally, I managed to have it working.

To summarize what I did:
- I checked it all to match your advices
- updated bus pirate firmware to v6.1 (I couldn't find the 6.2 update
for the bus pirate 3.5 hardware)
- replaced some connectors of the probe cable so they stay in place
- got the latest flashrom svn sources
Post by Denis 'GNUtoo' Carikli
Also Note that there was some recent patches touching the buspirate.
- then I decided to apply these patches on top of the fresh flashrom
sources
- though, it still didn't work
- for some reason, I plugged the motherboard power supply connectors in,
just to give it a try (whereas I got them all off the board to make sure
it didn't interfere before)
- then it worked (see attached log).

Note that with the version of flashrom that with in the OS repos (it was
v0.9.2-r1028 from Trisquel GNU/Linux 4.0), it didn't work. Though that
is probably because it's outdated: a fresh v0.9.5.2-r1546, even without
the recent bus pirate patches applies, worked like a charm!

At 2Mhz, reading the whole 8MB chip took ~20 minutes.

I think next step is to try writing another firmware to the chip via
SPI, to see how it goes.

--
Paul Kocialkowski
Paul Kocialkowski
2012-06-21 11:20:25 UTC
Permalink
Post by Paul Kocialkowski
I think next step is to try writing another firmware to the chip via
SPI, to see how it goes.
I extracted one from the latest windows binary MSI provides to update
the BIOS and will do the flashing later today.

While reading the board user manual, I saw that MSI provides the pinout
for the JCOM1 on-board connector: I assumed that's a serial port, which
could help when attempting to port coreboot to the board.

Here is the pinout of both the JCOM1 connector and the DB9 connector I
used:
Loading Image...

After soldering it all [1], I put the connector on the board [2] and it
worked! I tested with a RS232 to USB adapter on one side and getty
listening on ttyS0 on the MSI Z68MA-G45 side: I was able to use the
shell from the USB adapter side!

I'm not particularly asking for help there, I just thought it would be a
good idea to publish all this, in case one wants to start a port to a
similar MSI board.

Though, there is something that could be serial-related: I can't find
any reference to the SuperIO! coreboot's superiotool didn't detect any.
Is it possible that the Z68 chipset is handling serial too?

[1]
Loading Image...
[2]
Loading Image...

--
Paul Kocialkowski
Paul Kocialkowski
2012-06-22 21:35:38 UTC
Permalink
Here is a log of in-system flashing (it worked "out of the box"), for
the MSI Z68MA-G45 board! I think it can be added to the list of
supported boards.

I'll test SPI flashing with bus pirate or arduino tomorrow.

--
Paul Kocialkowski
Stefan Tauner
2012-07-18 00:04:51 UTC
Permalink
On Fri, 22 Jun 2012 21:35:38 +0000
Post by Paul Kocialkowski
Here is a log of in-system flashing (it worked "out of the box"), for
the MSI Z68MA-G45 board! I think it can be added to the list of
supported boards.
I'll test SPI flashing with bus pirate or arduino tomorrow.
Hello Paul,

thanks for your report!
I have added your board to our list of supported hardware and will
commit that later together with other small changes.
--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
Loading...