summaryrefslogtreecommitdiffstats
path: root/cbtable.c
Commit message (Collapse)AuthorAgeFilesLines
* cbtable.c: Do not unnecessarily duplicate stringsPaul Menzel2014-11-011-8/+4
| | | | | | | | | | | | The strdup calls were a leftover that slipped through the cleanup in r1577. Found-by: Valgrind 3.10.0 Corresponding to flashrom svn r1854. Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Clean up physmap, fix unaligned mapping problemsCarl-Daniel Hailfinger2014-03-051-3/+4
| | | | | | | | | | | | Convert all physmaps in dmi.c to use aligned readonly maps. Convert all physmaps in cbtable.c to use unaligned readonly maps. Make physunmap() a generic architecture-independent wrapper. Add physunmap_unaligned() to complement physmap*_unaligned(). Corresponding to flashrom svn r1765. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Remove exit call and mayfail parameter from physmap_common()Niklas Söderlund2013-09-141-2/+2
| | | | | | | | | | | | | | | The only call path where exit was reached was from physmap functions. Callers of physmap() et al. which were not prepared to handle ERROR_PTR return values have been adjusted. physmap_try_ro() has been renamed to physmap_ro() and physmap_common() slightly refactored due to the now removed *FAIL parameters. Corresponding to flashrom svn r1745. Signed-off-by: Niklas Söderlund <niso@kth.se> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Introduce msg_*warnStefan Tauner2013-01-041-3/+3
| | | | | | | | | | Also, unify all outputs of "Warning:" and "Error:" to use normal capitalization instead of mixing it with all capitals. Corresponding to flashrom svn r1643. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Idwer Vollering <vidwer@gmail.com>
* Some ISO C fixesCarl-Daniel Hailfinger2012-08-271-0/+1
| | | | | | | | | | | | | | | | | This patch just fixes a limited number of bits not conforming to c99 by using - __asm__ instead of just asm - {0} instead of {} for struct initialization - h_addr_list[0] instead of h_addr to access the host address in struct hostent - #include <strings.h> where needed (for ffs and strcasecmp) Based on a previous patch by Carl-Daniel. Corresponding to flashrom svn r1585. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Refactor the -p internal:mainboard handlingStefan Tauner2012-08-201-85/+46
| | | | | | | | | | | | | | | | This patch gets rid of some global variables and makes lots of bits along the code path that control the board enable execution more generic and clearer. From now on flashrom aborts on a few more occasions that should be safer for the user. For example it aborts if the enable function for the specified mainboard (enable) can not be found. Parts of the board_match_cbname refactoring were done by Carl-Daniel. Corresponding to flashrom svn r1577. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Move show_id to where it belongsStefan Tauner2012-08-111-0/+80
| | | | | | | | | And remove the unused force parameter. Corresponding to flashrom svn r1569. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Portability fixes and cleanupsCarl-Daniel Hailfinger2012-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move Mac OS X IOKit/DirectHW availability checks in the Makefile from compiler check to pciutils check. Print the compiler error messages for feature detection. Add DOS libpci in the Makefile includes only if a PCI-based programmer was requested. Restrict mmap usage in ich_descriptors_tool to Unix style systems. Build ich_descriptors_tool with the correct .exe extension on DOS/Windows. Build ich_descriptors_tool by default on x86. (Patch by Stefan Tauner) Print the Windows version instead of "unknown machine" on Windows. Don't #define our own __DARWIN__, use the standard OS X detection method. Update the README. Add more generated files to svn:ignore Corresponding to flashrom svn r1567. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Replace --mainboard with -p internal:mainboardCarl-Daniel Hailfinger2012-01-041-5/+14
| | | | | | | | | | | | | | | | | | | | NOTE: The --list-supported-wiki output changed to use -p internal:mainboard= instead of -m The --list-supported output changed the heading of the mainboard list from Vendor Board Status Required option to Vendor Board Status Required value for -p internal:mainboard= Fix lb_vendor_dev_from_string() not to write to the supplied string. Corresponding to flashrom svn r1483. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Coreboot table handling: make debug message msg_pdbgStefan Reinauer2011-04-011-1/+1
| | | | | | | Corresponding to flashrom svn r1284. Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Fix sparse warning: Using plain integer as NULL pointerPeter Huewe2011-01-241-1/+1
| | | | | | | | | | | This patch fixes the "using plain integer as NULL pointer" warnings generated by running sparse on the flashrom source. Corresponding to flashrom svn r1255. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Mathias Krause <mathias.krause@secunet.com> Acked-by: Stefan Reinauer <stepan@coreboot.org>
* Rename Direct I/O library to DirectHWCarl-Daniel Hailfinger2010-10-061-1/+1
| | | | | | | | | | | | | The Direct I/O library for Mac OS X is now called DirectHW to make sure people can find it via an internet search. DirectIO was a generic name for a concept and thus not a good distinguisher for a library. Corresponding to flashrom svn r1198. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <vidwer@gmail.com>
* Remove duplicate includes from the codeStefan Reinauer2010-10-061-1/+0
| | | | | | | Corresponding to flashrom svn r1196. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Implement libpayload support and improve life for DOS based flashrom, tooPatrick Georgi2010-09-251-2/+2
| | | | | | | | | | | | | | Corresponding to flashrom svn r1181. Change the physmap* behaviour to use (void*)-1 as error code instead of NULL. That way, 1:1 mapped memory can be supported properly because (void*)0 is not a magic pointer anymore. (void*)-1 on the other hand is a rather unlikely memory offset, so that should be safe. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Split off programmer.h from flash.hCarl-Daniel Hailfinger2010-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | | Programmer specific functions are of absolutely no interest to any file except those dealing with programmer specific actions (special SPI commands and the generic core). The new header structure is as follows (and yes, improvements are possible): flashchips.h flash chip IDs chipdrivers.h chip-specific read/write/... functions flash.h common header for all stuff that doesn't fit elsewhere hwaccess.h hardware access functions programmer.h programmer specific functions coreboot_tables.h header from coreboot, internal programmer only spi.h SPI command definitions Corresponding to flashrom svn r1112. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Remove unneeded #include statements completelyCarl-Daniel Hailfinger2010-05-301-0/+2
| | | | | | | | | | | | | | | Unistd.h was only used to get a definition of NULL in all files. Add our own NULL #define and remove unistd.h from flash.h stdio.h has no place in flash.h, it should be included only in files which really need it. Add #include statements in individual .c files where needed. Replace a few printf with msg_* to eliminate the need for stdio.h. Corresponding to flashrom svn r1021. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Convert various prints to use msg_p* and msg_g* respectivelySean Nelson2010-05-071-11/+11
| | | | | | | | | Convert programmer print messages to msg_p* convert general print messages to msg_g* a few fixes as suggested by Carl-Daniel. Corresponding to flashrom svn r997. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Create a physical memory mapping function which requests cached readonly memoryCarl-Daniel Hailfinger2010-02-021-3/+13
| | | | | | | | | | | | | | | | | | | | | | This should take care of picky Linux kernels which do not allow uncached mappings to cached areas. Handle mapping failure gracefully (no forced exit()) if the caller specifies it. Such cached areas which can handle mapping failure are DMI tables and coreboot tables. On failure we just ignore those tables. That is not perfect, but a lot better than aborting flashrom due to an error in nonessential functionality. This should fix flashrom on a sizable number of machines where it currently aborts early. Yes, I could have exploited a Linux kernel bug to "solve" this, but relying on such bugs is not exactly the best idea. Corresponding to flashrom svn r889. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Vincent Pelletier <plr.vincent@gmail.com>
* Enable -Wshadow, clean code for thatMichael Karcher2010-01-121-4/+4
| | | | | | | | | | | | | | This is not just for fun. We hit a real bug on BSD with the outl macros. The macro variable tmp collided with the tmp from outer scope. second revision, now also taking care of inb/inw/inl. While that shadowing did not introduce bugs (yet), of course it breaks the build on BSD when -Wshadow is enabled. Corresponding to flashrom svn r860. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Luc Verhaegen <libv@skynet.be>
* Internal (onboard) programming was the only feature which could not be disabledCarl-Daniel Hailfinger2009-12-131-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make various pieces of code conditional on support for internal programming. Code shared between PCI device programmers and onboard programming is now conditional as well. It is now possible to build only with dummy support: make CONFIG_INTERNAL=no CONFIG_NIC3COM=no CONFIG_SATASII=no CONFIG_DRKAISER=no CONFIG_SERPROG=no CONFIG_FT2232SPI=no This allows building for a specific use case only, and it also facilitates porting to a new architecture because it is possible to focus on highlevel code only. Note: Either internal or dummy programmer needs to be compiled in due to the current behaviour of always picking a default programmer if -p is not specified. Picking an arbitrary external programmer as default wouldn't make sense. Build and runtime tested in all 1024 possible build combinations. The only failures are by design as mentioned above. Corresponding to flashrom svn r797. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Sean Nelson <audiohacked@gmail.com>
* Remove unnecessary #include filesCarl-Daniel Hailfinger2009-08-091-3/+0
| | | | | | | | | | Serprog compilation is now controlled by a Makefile variable. Replace munmap with physunmap where appropriate. Corresponding to flashrom svn r671. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Boards with coreboot have a cbtable containing vendor and board nameCarl-Daniel Hailfinger2009-07-301-0/+2
| | | | | | | | | | | | Flashrom tries to match these with board enable entries in its database. If no such board enable entry exists because the board doesn't need one, flashrom complains. Silence that complaint. Corresponding to flashrom svn r668. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Slightly updated and Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Drop unused/duplicated #includes and some dead codeUwe Hermann2009-05-161-3/+0
| | | | | | | | | Build-tested on 32bit x86. Corresponding to flashrom svn r521. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix spelling error in commentDaniel McLellan2009-05-141-1/+1
| | | | | | | | | Author: raijin Corresponding to flashrom svn r506. Signed-off-by: Daniel McLellan <daniel.mclellan@gmail.com> Acked-by: Peter Stuge <peter@stuge.se>
* Some coding style and consistency fixesUwe Hermann2009-04-151-1/+1
| | | | | | | Corresponding to flashrom svn r429 and coreboot v2 svn r4117. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* This patch adds "high coreboot table support" to coreboot version 2Stefan Reinauer2009-03-171-8/+22
| | | | | | | | | | | | | | | | | | | Some bootloaders seem to overwrite memory starting at 0x600, thus destroying the coreboot table integrity, rendering the table useless. By moving the table to the high tables area (if it's activated), this problem is fixed. In order to move the table, a 40 bytes mini coreboot table with a single sub table is placed at 0x500/0x530 that points to the real coreboot table. This is comparable to the ACPI RSDT or the MP floating table. This patch also adds "table forward" support to flashrom and nvramtool. Corresponding to flashrom svn r421 and coreboot v2 svn r4012. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se>
* Darwin / Mac OS XStefan Reinauer2009-01-261-4/+13
| | | | | | | | | | | Through DirectIO from coresystems GmbH we now support Darwin/Mac OS X. DirectIO is available at http://www.coresystems.de/en/directio Corresponding to flashrom svn r399 and coreboot v2 svn r3905. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Abstract mmap() in physmap.c and only open /dev/mem on the first physmap() callStefan Reinauer2009-01-261-7/+1
| | | | | | | | Corresponding to flashrom svn r397 and coreboot v2 svn r3903. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Forgot some things in r3899Peter Stuge2009-01-261-3/+3
| | | | | | | Corresponding to flashrom svn r395 and coreboot v2 svn r3900. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Little readability improvement in cbtable.c:coreboot_init()Peter Stuge2009-01-261-15/+13
| | | | | | | Corresponding to flashrom svn r394 and coreboot v2 svn r3899. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Check all mmap() calls and print helpful Linux error messagePeter Stuge2009-01-231-0/+1
| | | | | | | Corresponding to flashrom svn r386 and coreboot v2 svn r3890. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Rename linuxbios_* files in utils repositoryStefan Reinauer2008-01-181-0/+218
Corresponding to flashrom svn r179 and coreboot v2 svn r3058. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
OpenPOWER on IntegriCloud