coreboot-kgpe-d16/util
Luc Verhaegen 9ceae905f1 CMOS: Add set_option and rework get_option.
To ease some of my debugging pain on the unichrome, i decided i needed to
move FB size selection into cmos, so i could test a size and then reset it
to the default after loading this value so that the next reboot uses the
(working) default again. This meant implementing set_option in parallel to
get_option.

get_option was then found to have inversed argument ordering (like outb) and
passing char * and then depending on the cmos layout length, which made me
feel quite uncomfortable. Since we either have reserved space (which we
shouldn't do anything with in these two functions), an enum or a
hexadecimal value, unsigned int seemed like the way to go. So all users of
get_option now have their arguments inversed and switched from using ints
to unsigned ints now.

The way get_cmos_value was implemented forced us to not overlap byte and to
have multibyte values be byte aligned. This logic is now adapted to do a
full uint32_t read (when needed) at any offset and any length up to 32, and
the shifting all happens inside an uint32_t as well. set_cmos_value was
implemented similarly. Both routines have been extensively tested in a
quick separate little program as it is not easy to get this stuff right.

build_opt_tbl.c was altered to function correctly within these new
parameters. The enum value retrieval has been changed strol(..., NULL, 10)
to stroul(..., NULL, 0), so that we not only are able to use unsigned ints
now but so that we also interprete hex values correctly. The 32bit limit
gets imposed on all entries not marked reserved, an unused "user_data" field
that appeared in a lot of cmos.layouts has been changed to reserved as well.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Peter Stuge <peter@stuge.se>

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4332 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-06-03 10:47:19 +00:00
..
ADLO Changes Makefile generation so that recursive "make" calls read 2008-06-08 23:05:24 +00:00
abuild Various fixes to the tree to get coreboot-v2 to build on Solaris 2009-05-26 14:03:51 +00:00
analysis Rename almost all occurences of LinuxBIOS to coreboot. 2008-01-18 15:08:58 +00:00
buildrom Eliminate various issues brought up by scan-build. 2009-04-21 20:14:31 +00:00
cbfstool cbfstool reacts to a too large bootblock file by stopping 2009-06-01 20:02:21 +00:00
dump_mmcr small ts5300 update, fix endian problem in dummmcr. 2006-03-18 00:10:29 +00:00
ectool Add 'install' target for ectool (trivial). 2009-04-23 22:22:47 +00:00
flashrom Flashrom is now moved over to its own repository. 2009-04-26 18:17:40 +00:00
getpir Make the getpir output look less crappy and add a license 2009-05-22 18:17:06 +00:00
inteltool mini fix to reliably compile inteltool on darwin, and on Linux both on x86/x86_64. 2009-04-22 23:17:44 +00:00
k8resdump K8 resource dump utility from Rudolf Marek 2007-10-30 01:12:20 +00:00
lbtdump Fix a typo in lbtdump output (trivial). 2008-05-07 19:21:18 +00:00
mkelfImage Add support for high coreboot table to mkelfimage 2009-03-17 15:33:41 +00:00
mptable fix typo 2008-03-15 16:30:39 +00:00
msrtool Add a note that 'modprobe msr' might be required. 2009-04-10 21:05:56 +00:00
newconfig Move coreboot_ram and coreboot_apc to CBFS. This allows to 2009-05-27 14:19:31 +00:00
nrv2b don't ignore return values (trivial) 2009-04-22 12:14:39 +00:00
nvramtool This patch adds "high coreboot table support" to coreboot version 2. 2009-03-17 14:39:36 +00:00
optionlist More compact format for wiki output at 2009-06-02 23:49:00 +00:00
options CMOS: Add set_option and rework get_option. 2009-06-03 10:47:19 +00:00
resetcf epia-m support 2004-10-06 17:33:54 +00:00
romcc Various fixes to the tree to get coreboot-v2 to build on Solaris 2009-05-26 14:03:51 +00:00
superiotool Fix my last commit. I looked at the wrong dead laptop. 2009-05-07 00:21:02 +00:00
vgabios util/vgabios: build/warning fixes. 2009-05-27 11:39:16 +00:00