[flashrom] RFC/RFD: GPIO multiplexing/direction policy

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Thu Jul 8 16:24:44 CEST 2010


Hello flashrom developers,

currently flashrom programs GPIO pins it needs for a board enable
generally for output and chooses the GPIO function if that pin is
multiplexed (as long as selecting output and multiplexing is implemented
for that type of GPIO). Another policy would be to *require* that the
GPIO pin is *already* set to output and GPIO and abort otherwise. I
consider the second approach much safer than the first one, but I
suspect there are boards where flashrom finds the pins in the wrong
state and reprogramming them is really needed.

Still I think that disallowing GPIOs that are not already set to output
would be a good idea (and have gpio=force as programmer option) to
protect against accidental board matches disabling core functionality.

The concrete background of this post is the Asus P2B-N board. It has
write enable on GPO18 (lower to enable write). Currently
intel_piix4_gpo_set rejects this GPO pin, because it is a "dual function
pin which is most likely in use already". In fact, it is multiplexed
with PCI_STP#, an output signal to stop the PCI bus clock. It would be
fatal on a board that really stops the PCI clock on lowering the pin to
set this pin to GPO and lower it. Just lowering it without touching the
multiplex bit would be safe, because it won't do anything if the
PCI_STP# functionality of that pin is in use - but this would be
inconsistent with what flashrom is doing now.

Any other oppinions on this topic?

Regards,
  Michael Karcher





More information about the flashrom mailing list