summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers
AgeCommit message (Collapse)Author
2011-12-13libpayload: add set_option() functionPatrick Georgi
It allows to change CMOS values from payloads Change-Id: I4872fc27476923adafe13504126235b92b30de85 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/445 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-11-10libpayload: Fix handling of CAPS LOCK key on PS/2 keyboardsPatrick Georgi
The PS/2 keyboard driver set and reset the caps LED to show the keyboard status. Unfortunately, that configuration happens over the same path used to transmit keypresses. In face of certain error conditions, the keyboard stopped working. This change makes keyboard handling more robust. Change-Id: I0489a9983ea7dab00357220e09398dd1a8538839 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/430 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-11-04libpayload: Implement usb_exitPatrick Georgi
So far it was empty and never published. It now exists and shuts down all controllers (esp. EHCI which resets the port routers). Change-Id: I81e355e8a05778d6397675417b085a094a6f48ee Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/397 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-11-04libpayload: Tell EHCI to re-enable USB1 controllersPatrick Georgi
EHCI can take over all ports (and then reroute devices to companion controllers if needs be). We do that, and then never reset it. Consequence: Systems with only USB1 HC drivers (OHCI/UHCI) never see any devices. Change-Id: If1d91e9142a6618289b0b3f6b56587ec857158e3 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/396 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
2011-11-04libpayload: Drop usb_fatal()Patrick Georgi
We have fatal(), which is just as good. Coccinelle script: @@ expression E; @@ -usb_fatal(E) +fatal(E) Change-Id: Iabecbcc7d068cc0f82687bf51d89c2626642cd86 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/395 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins)
2011-11-03libpayload: Reduce verbosity in USB stackMathias Krause
The USB stack is pretty noisy. Reduce the output to a sane level. Change-Id: I250949e5cf74a8c6d43822b2e7487143b2ae1c65 Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Reviewed-on: http://review.coreboot.org/393 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-11-01libpayload: Fix OHCI some morePatrick Georgi
OHCI works when USB_DEBUG is disabled, but not, when disabled. This is because the controller requires some more time after a schedule has finished. Also improve compliance with the OHCI spec. Change-Id: I4685cc485ff9c52b489fbaa352ab889671cff876 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/365 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-10-27Fix libpayload speaker driverStefan Reinauer
The frequency for the PC speaker has to be specified as 1193180 / frequency according to http://wiki.osdev.org/PC_Speaker Change-Id: Iaca9d45807e080efe834611e719b350680b5fb90 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/337 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2011-10-22Fix CMOS checksum calculation in libpayload.Stefan Reinauer
Change-Id: I64ea53fa098fbcfc76e0ebd5f049a2ee3d0a1024 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/314 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
2011-10-21libpayload: fix bulk transfers on OHCI controllersPatrick Georgi
Time for the brown paper bag: OHCI controllers are not happy when told to send data, but with obviously wrong addresses. It helps to write the addresses into the data structures. Change-Id: Ic0967dc8939e64af119cfb89400a045a2c077171 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/306 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2011-09-14libpayload: Add get_option_from()Patrick Georgi
This function allows reading the nvram configuration table from locations other than the cbtable. Change-Id: I56c9973a9ea45ad7bf0185b70d11c9ce5d0e0e1b Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/213 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
2011-08-16libpayload: EHCI registers are volatilePatrick Georgi
Some gcc versions seem to honor volatile at different places in a struct declaration. Change-Id: I0df2a3fb2eff4cee8cc1b8ac15d9cd9b86178752 Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/155 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
2011-07-17port_enable and port_reset must change atomically.Steven A. Falco
I have observed two separate EHCI host bridges that do not tolerate using C bit-fields to directly manipulate the portsc_t register. The reason for this is that the EHCI spec says that port_enable must go to 0 at the time that port_reset goes to 1. Naturally this cannot be done using direct bit-field manipulation. Instead, we use a temporary variable, change the bit-fields there, then atomically write the new value back to the hardware. Signed-off-by: Steven A. Falco <sfalco@coincident.com> Change-Id: If138faee43e0293efa203b86f7893fdf1e811269 Reviewed-on: http://review.coreboot.org/101 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2011-07-14Print a warning when an unknow USB controller type is detected.Steven A. Falco
The Intel E6XX Atom processor reports an unknown USB controller type (in addition to the standard EHCI and OHCI ones). Add a default case to print a warning when an unknown controller type is detected. Change-Id: I885d0ccec4c46fd212cceac599290e9bf85edbbb Signed-off-by: Steven A. Falco <sfalco@coincident.com> Reviewed-on: http://review.coreboot.org/100 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2011-07-14EHCI driver missing bus_address assignment.Steven A. Falco
Other USB drivers set the bus_address field. EHCI should do this too. Signed-off-by: Steven A. Falco <sfalco@coincident.com> Change-Id: Ic4274c6744951ef7fa0cb135caf8b9f177d8bcaf Reviewed-on: http://review.coreboot.org/99 Tested-by: build bot (Jenkins) Reviewed-by: Peter Stuge <peter@stuge.se>
2011-06-30Reduce warnings/errors in libpayload when using picky compiler optionsPatrick Georgi
The new build system uses quite a few more -W flags for the compiler by default than the old one. And that's for the better. Change-Id: Ia8e3d28fb35c56760c2bd0983046c7067e8c5dd6 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/72 Tested-by: build bot (Jenkins) Reviewed-by: Uwe Hermann <uwe@hermann-uwe.de>
2011-06-30Use coreboot build system for libpayload, too.Patrick Georgi
This change makes building coreboot related projects more unified. Change-Id: I0f1181e2fffde1e03675523f7dc9eef3119052c3 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/71 Tested-by: build bot (Jenkins) Reviewed-by: Uwe Hermann <uwe@hermann-uwe.de>
2011-04-16Allow libpayload to use an OXPCIe 952 card on systems without ↵Stefan Reinauer
onboard serial port Signed-off-by: Stefan Reinauer <reinauer@google.com> Acked-by: Marc Jones <marcj303@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6508 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2011-04-14coding style cosmetics.Stefan Reinauer
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6492 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-09-25Add an EHCI driver to libpayload's USB stack.Patrick Georgi
Interrupt transfer support is missing (ie. no keyboard), bulk and control transfers work (ie. mass storage). Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5845 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-09-03The AMD CS5536's USB controllers are located at device 0F, functions 4Jens Rottmann
and 5. They're not found if only function 0 is checked. So if a device exists at all, try all its functions. usb_controller_initialize() will silently skip all device classes != 0C03. (changed to continue to use 32bit accesses -pg) Signed-off-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5774 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-08-18libpayload: fix garbage on screen with Geode-LX VGAJens Rottmann
Clear initial garbage in VGA memory and fix scroll_up, which scrolled 1 scanline instead of 1 text line by mistake. Signed-off-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5722 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-08-17libpayload: Add function to fix CMOS checksum.Stefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5711 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-08-13Add support for OHCI controllers and prelimiary support for xHCI (USB3) ↵Patrick Georgi
controllers. Improve scanning for USB controllers. Limitations: - OHCI doesn't support interrupt transfers yet (ie. no keyboards) - xHCI just does initialization and device attach/detach so far Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5691 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-06-11Follow up to the USB refactoring patch: Missed setting pid values correctly.Patrick Georgi
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5631 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-06-07Avoid using the name "pid_t", which is used on unixoid systems.Patrick Georgi
Move controller specific data structures into private headers, to avoid conflicts between controller drivers. Factor out the USB PID ids, which are only exposed on UHCI. It's of not much use on the other controllers. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5616 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-04-27Since some people disapprove of white space cleanups mixed in regular commitsStefan Reinauer
while others dislike them being extra commits, let's clean them up once and for all for the existing code. If it's ugly, let it only be ugly once :-) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5507 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-25USB updates from our internal treeStefan Reinauer
- support MMC2 devices - make usb stack more solid - drop some unused functions - fix lowspeed/speed naming - add support for "quirks" - improve usbhid driver Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Joseph Smith <joe@settoplinux.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5299 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-25Add coreboot framebuffer support to libpayloadStefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5295 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2010-03-25make keyboard reset driver generic (not pc keyboard driver dependent)Stefan Reinauer
so it can be used by usb, too Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5291 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-07-31Catch various cases in libpayload where malloc() or memalign() return NULLStefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4474 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-07-31* drop duplicate prototype for lib_get_sysinfo()Stefan Reinauer
* fix delay handling in tiny curses keyboard driver * fix off by one error in video driver Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4473 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-07-18Fix off-by-one bug in libpayload UHCI driverStefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4437 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-04-30Some driver fixes for libpayload:Stefan Reinauer
- fix minor bug in serial driver. - latest USB stack fixes - fix dead store in options.c Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4239 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-11-24[PATCH] libpayload: rename config.h to libpayload-config.hJordan Crouse
Rename the generated config file to libpayload-config.h to differenciate it from other config.h files. Move the default location of the file to $(src)/include so that LIBPAYLOAD_PREFIX= users can access the file without staging it. Signed-off-by: Jordan Crouse <jordan@cosmicpenguin.net> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3768 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-21[PATCH] fix video console initJordan Crouse
Move console_add_output-driver() inside the for() loop Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3681 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-21This patch removes most of the #ifdefs in libc/console.c, andPatrick Georgi
replaces it with two queues (input, output) where drivers (serial, keyboard, video, usb) can attach. The only things left with #ifdefs are initialization (at some point the drivers must get a chance to register) Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3679 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-20[PATCH] libpayload: Bail if the keyboard controller isn't thereJordan Crouse
If the system in question does not have a superIO, then a read of 0x64 will return 0xFF and we will loop forever. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3675 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-20[PATCH] libpayload: Fix the PCI search functionJordan Crouse
Remove a possiblity for evil recusion and fix the function and slot definition in the PCI search loop Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3674 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-20[PATCH] libpayload: Add pci_set_bus_master() functionJordan Crouse
Allow the payload to enable a PCI device as a bus master. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3672 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-16- reduced memory requirements a lot (from >100kb/controller toPatrick Georgi
560bytes/controller) - no need for the client of libpayload to implement usbdisk_{create,remove}, just because USB was compiled in. - usb hub support compiles, and works for some trivial cases (no device detach, trivial power management) - usb keyboard support works in qemu, though there are reports that it doesn't work on real hardware yet. - usb keyboard is integrated in both libc-getchar() and curses, if CONFIG_USB_HID is enabled Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3662 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-10-08libpayload: Rename Geode video driver to Geode LX video driver.Peter Stuge
This is simply wrong, the "Geode" video driver is only good for LX and one of our users got bit by this just now. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3642 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-26Use a block cursor on VGA console :-)Stefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3607 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-26fix option handling in libpayloadStefan Reinauer
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3606 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-26* add keyboard layout support to libpayloadStefan Reinauer
* add a reset handler mechanism (CTRL-ALT-DEL) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3605 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-26* factor out serial hardware initStefan Reinauer
* add reverse color support for serial * add cursor enable/disable support for serial * fix tinycurses compilation if serial is disabled * add functions to query whether serial or vga console is enabled in tinycurses * initialize uninitialized COLOR_PAIRS variable * implement has_colors(), wredrawln() functions in curses Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3604 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-18fix regression in libpayload introduced by merge of the keyboard drivers.Stefan Reinauer
(add back function keys; trivial) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3581 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-17- unify keycodes for non-ASCII keys by using curses' codes and labelsPatrick Georgi
- fix ctrl-[a-z] - get rid of curses' ps/2 driver. uses generic one instead - #ifdef's around ps/2 keyboard handling and serial handling - add alt-key handling (necessary for german keymap) - flush keyboard controller buffer on init Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3580 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-11makes cursorx and cursory signed, as therePatrick Georgi
are several "if (cursorx < 0)" tests. I also added another one, to make backspace wrap backwards into the previous line, if necessary. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3576 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-09-11Fix the USB code to find the headers after they were moved.Jordan Crouse
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3575 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1