summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2008-10-16 19:20:51 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2008-10-16 19:20:51 +0000
commit4727c0744615d7b49c843197433937721ce9acd1 (patch)
tree72d31d16bb06950a574b11759d61e620c3be9f46 /payloads/libpayload/libc
parentb1b071fe17dd472192de201e463ce3d5811a2957 (diff)
- reduced memory requirements a lot (from >100kb/controller to
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
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/console.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/console.c b/payloads/libpayload/libc/console.c
index d5ad0e4605..ff6fc13e8e 100644
--- a/payloads/libpayload/libc/console.c
+++ b/payloads/libpayload/libc/console.c
@@ -29,6 +29,7 @@
#include <config.h>
#include <libpayload.h>
+#include <usb/usb.h>
void console_init(void)
{
@@ -77,6 +78,11 @@ int puts(const char *s)
int havekey(void)
{
+#ifdef CONFIG_USB_HID
+ usb_poll();
+ if (usbhid_havechar())
+ return 1;
+#endif
#ifdef CONFIG_SERIAL_CONSOLE
if (serial_havechar())
return 1;
@@ -95,6 +101,11 @@ int havekey(void)
int getchar(void)
{
while (1) {
+#ifdef CONFIG_USB_HID
+ usb_poll();
+ if (usbhid_havechar())
+ return usbhid_getchar();
+#endif
#ifdef CONFIG_SERIAL_CONSOLE
if (serial_havechar())
return serial_getchar();