[flashrom] adding a board_flash_disable

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Mon Apr 18 01:38:57 CEST 2011


hello list!

brandon/kiddyshaq34 came up with an interesting question:
> <kiddyshaq34> "twice?"
just kidding :P
> <kiddyshaq34> I need to know how we are going to bring the ec out of
> flash mode after flashrom runs
> <kiddyshaq34> I know the system state notification and everything
> <kiddyshaq34> but how do we run those ec commands after flashrom
> runs(like probe, read and write)?

so in hope to spare twice the pain i searched through the code and came
up with the conclusion that we dont do such a thing as a
board_flash_disable. so even if we just probe for a chip on a board
with a board enable we dont leave the board in the same state as before.

there was a discussion 3,5yrs ago, where there was consensus that this
should be changed.
http://www.coreboot.org/pipermail/coreboot/2007-October/025495.html
but i guess there was just no need to implement it, since (quoting
idwer:) "usually, users reboot (within, wild guess, 24 hours) after
flashing".

i will put this to my "open tasks you might wanna try to tackle
sometime in the more or less distant future"-list, but maybe we can get
a small discussion going now.
i dont have any experience with board enables whatsoever. i know that
usually its just a toggle of a gpio pin that disables the write
protection pin etc, but sometimes there is more to do, especially when
an EC is involved.
we need to know how to undo what we do in board_enable. what could that
possibly be and what data would we need to preserve?

as a first step we could just add another function pointer to the
board_pciid_enable struct which gets called by a new generic
board_flash_disable function which gets called in internal_shutdown.
we would probably want to share/store the const struct
board_pciid_enable *board variable/constant obtained in
board_flash_enable to be able to use it in board_flash_disable.
we could then extend the board_pciid_enables table with function
pointers to "static board disables" (i.e. undo functions that work
without using runtime data (obtained/set by board_pciid_enable).
this could then be extended to what carldani planned in 2007.

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner




More information about the flashrom mailing list