From 85ac988e86f9414fa645b0148dc66c3520a1eb84 Mon Sep 17 00:00:00 2001 From: Rodolfo Giometti Date: Mon, 15 Oct 2007 11:59:17 +0200 Subject: PXA USB OHCI: "usb stop" implementation. Some USB keys need to be switched off before loading the kernel otherwise they can remain in an undefined status which prevents them to be correctly recognized by the kernel. Signed-off-by: Rodolfo Giometti Signed-off-by: Markus Klotzbuecher diff --git a/cpu/pxa/usb.c b/cpu/pxa/usb.c index 72b7dfa..aa6f4b7 100644 --- a/cpu/pxa/usb.c +++ b/cpu/pxa/usb.c @@ -89,6 +89,22 @@ int usb_cpu_stop(void) int usb_cpu_init_fail(void) { + UHCHR |= UHCHR_FHR; + udelay(11); + UHCHR &= ~UHCHR_FHR; + + UHCCOMS |= 1; + udelay(10); + +#if defined(CONFIG_CPU_MONAHANS) + UHCHR |= UHCHR_SSEP0; +#endif +#if defined(CONFIG_PXA27X) + UHCHR |= UHCHR_SSEP2; +#endif + UHCHR |= UHCHR_SSEP1; + UHCHR |= UHCHR_SSE; + return 0; } -- cgit v0.10.2 From b5af773f8d92677e06f3295b45557c9d0a487c24 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Thu, 25 Oct 2007 17:51:27 +0800 Subject: Fix the issue of usb_kbd driver missing the scan code of key 'z'. The scan code of the key 'z' is 0x1d, which should be handled. The change has be tested on NOVATEK USB keyboard and ULI PCI OHCI controller. Signed-off-by: Zhang Wei Signed-off-by: Markus Klotzbuecher diff --git a/common/usb_kbd.c b/common/usb_kbd.c index aec558a..7bdfcc0 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -257,7 +257,7 @@ static int usb_kbd_translate(unsigned char scancode,unsigned char modifier,int p repeat_delay=REPEAT_DELAY; } keycode=0; - if((scancode>3) && (scancode<0x1d)) { /* alpha numeric values */ + if((scancode>3) && (scancode<=0x1d)) { /* alpha numeric values */ keycode=scancode-4 + 0x61; if(caps_lock) keycode&=~CAPITAL_MASK; /* switch to capital Letters */ -- cgit v0.10.2 From 245a362ad3c0c1b84fccc9fec7b623eb14f6e502 Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Wed, 24 Oct 2007 01:37:36 +0200 Subject: TQM5200: Call usb_cpu_init() during board init usb_cpu_init() configures GPS USB pins, clocks, etc. and is required for proper operation of kernel USB subsystem. This setup was previously done in the kernel by the fixup code which is being removed, thus low level init must be done by U-boot now. Signed-off-by: Marian Balakowicz Signed-off-by: Markus Klotzbuecher diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index d10cb59..da4e228 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -441,15 +441,21 @@ ulong post_word_load (void) } #endif /* CONFIG_POST || CONFIG_LOGBUFFER*/ -#ifdef CONFIG_PS2MULT #ifdef CONFIG_BOARD_EARLY_INIT_R int board_early_init_r (void) { +#ifdef CONFIG_PS2MULT ps2mult_early_init(); +#endif /* CONFIG_PS2MULT */ + +#if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT) + /* Low level USB init, required for proper kernel operation */ + usb_cpu_init(); +#endif + return (0); } #endif -#endif /* CONFIG_PS2MULT */ #ifdef CONFIG_FO300 int silent_boot (void) -- cgit v0.10.2 From 58694f9709c0c3e3178e349ae748d98cfb0c639a Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Thu, 3 Jan 2008 10:51:15 +0800 Subject: Add Ctrl combo key support to usb keyboard driver. Ctrl combo key support is added, which is very useful to input Ctrl-C for interrupt current job. Also add usb_event_poll() calling to usb_kbd_testc(), which can get key input when tstc() is called. Signed-off-by: Zhang Wei Signed-off-by: Markus Klotzbuecher diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 7bdfcc0..1703b23 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -84,6 +84,7 @@ int repeat_delay; static unsigned char num_lock = 0; static unsigned char caps_lock = 0; static unsigned char scroll_lock = 0; +static unsigned char ctrl = 0; static unsigned char leds __attribute__ ((aligned (0x4))); @@ -120,6 +121,9 @@ static void usb_kbd_put_queue(char data) /* test if a character is in the queue */ static int usb_kbd_testc(void) { +#ifdef CFG_USB_EVENT_POLL + usb_event_poll(); +#endif if(usb_in_pointer==usb_out_pointer) return(0); /* no data */ else @@ -274,6 +278,10 @@ static int usb_kbd_translate(unsigned char scancode,unsigned char modifier,int p else /* non shifted */ keycode=usb_kbd_numkey[scancode-0x1e]; } + + if (ctrl) + keycode = scancode - 0x3; + if(pressed==1) { if(scancode==NUM_LOCK) { num_lock=~num_lock; @@ -306,6 +314,17 @@ static int usb_kbd_irq(struct usb_device *dev) return 1; } res=0; + + switch (new[0]) { + case 0x0: /* No combo key pressed */ + ctrl = 0; + break; + case 0x01: /* Left Ctrl pressed */ + case 0x10: /* Right Ctrl pressed */ + ctrl = 1; + break; + } + for (i = 2; i < 8; i++) { if (old[i] > 3 && memscan(&new[2], old[i], 6) == &new[8]) { res|=usb_kbd_translate(old[i],new[0],0); -- cgit v0.10.2