[flashrom] Flashrom innerworkings

Nico Huber nico.h at gmx.de
Tue Mar 6 23:43:38 CET 2018

On 06.03.2018 23:20, Matthew Leon wrote:
> Hey Nico,
> I am talking about the internal programmer for a piix4 chipset. For the
> read, I have gotten to spi_chip_read that returns
> flash->mst->spi.read(flash,buf,start,len) and I am trying to figure out
> where mst gets set, or how flashrom gathers the information to set it. For
> the write, I have gotten to spi_send_multicommand, after digging through
> spi_nbyte_program. Could you clue me in with a sample piix4 chipset?

AFAICS (from following the code in chipset_enable.c), PIIX4 doesn't
support SPI at all. Only parallel flash chips. And these work much

`flash->mst` gets set in probe_flash(). It's just the programmer you
select on the command line. For the `internal` programmer this is hard
to follow, though. In chipset_enable(), it's decided what that master
`mst` actually can do for a given chipset, mostly based on the PCI id
list in `chipset_enables`.

> Does
> flashrom read and write to hardware registers? Thank-you so much!

Yes, it does. In case of internal SPI controllers, it pokes registers
of that controller. In case of internal parallel flash chips, it seems
to directly access memory mapped registers of the flash chip. For the
latter have a look at jedec.c and the functions at the end of

Hope that helps,

More information about the flashrom mailing list