summaryrefslogtreecommitdiff
path: root/nicnatsemi.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-11-06 23:51:09 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-11-06 23:51:09 +0000
commitfce28bc9711ab90bafc92cf612c66e6941461a0e (patch)
tree8524bb99c9ff890da6311769656a6480abb0a1d5 /nicnatsemi.c
parentb02e6c02f8727fa9b03f7fda09aa8eb466fb1bb2 (diff)
downloadflashrom-fce28bc9711ab90bafc92cf612c66e6941461a0e.tar.gz
ichspi: use a variable to distinguish ich generations instead of spi_programmer->type
The type member is enough most of the time to derive the wanted information, but - not always (e.g. ich_set_bbar), - only available after registration, which we want to delay till the end of init, and - we really want to distinguish between chipset version-grained attributes which are not reflected by the registered programmer. Hence this patch introduces a new static variable which is set up early by the init functions and allows us to get rid of all "switch (spi_programmer->type)" in ichspi.c. We reuse the enum introduced for descriptor mode for the type of the new variable. Previously magic numbers were passed by chipset_enable wrappers. Now they use the enumeration items too. To get this working the enum definition had to be moved to programmer.h. Another noteworthy detail: previously we have checked for a valid programmer/ich generation all over the place. I have removed those checks and added one single check in the init method. Calling any function of a programmer without executing the init method first, is undefined behavior. Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1460 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'nicnatsemi.c')
0 files changed, 0 insertions, 0 deletions