Re: [flashrom] Flashrom innerworkings

2018-03-06 Thread Nico Huber
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
differently.

`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
`internal.c`.

Hope that helps,
Nico

___
flashrom mailing list
flashrom@flashrom.org
https://mail.coreboot.org/mailman/listinfo/flashrom


Re: [flashrom] Flashrom innerworkings

2018-03-06 Thread Nico Huber
Hello Matthew,

On 06.03.2018 18:33, Matthew Leon wrote:
> Hello,
> 
> I am interested in figuring out how flashrom writes to the flash, and where
> I can find resources to write my own version of flashrom.

flashrom supports a lot of different programmers and types of flash
chips. You have to be much more specific with your question, otherwise
the answer is simply: the source code explains everything in detail.

Nico

___
flashrom mailing list
flashrom@flashrom.org
https://mail.coreboot.org/mailman/listinfo/flashrom


[flashrom] Flashrom innerworkings

2018-03-06 Thread Matthew Leon
Hello,

I am interested in figuring out how flashrom writes to the flash, and where
I can find resources to write my own version of flashrom.

Sincerely,
Matthew
___
flashrom mailing list
flashrom@flashrom.org
https://mail.coreboot.org/mailman/listinfo/flashrom