[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: USB on X86 platform boot



Strange behaviour, you can use the USB without USB support in the bios
nor the kernel, the only thing you need is a PS/2 keyboard connected.

This makes one wonder whether it is the hw or the linux kernel that
needs to be fooled to believe that you have a PS/2 kbd. when you really
are using a USB kbd.
Interesting question, but I wont pursue it further. You have to find
someone knowledgable in the PS/2 input hardware and linux keyboard
low level routines for that.

BTW, the send_data routine mentioned is only used by:

  void pckbd_leds(unsigned char leds)                                                                                                                         
  {                                                                                                                                                           
	  if (kbd_exists && (!send_data(KBD_CMD_SET_LEDS) || !send_data(leds))) {                                                                             
		  send_data(KBD_CMD_ENABLE);      /* re-enable kbd if any errors */                                                                           
		  kbd_exists = 0;                                                                                                                             
	  }                                                                                                                                                   
  }                                                                                                                                                           

in the same file. I have not found a reference to it anywhare else in
the kernel source:

$ find . -name \*.c -or -name \*.h | sort | xargs grep send_data | less

Regards,
/Karl

-----------------------------------------------------------------------
Karl Hammar                    Aspö Data           karl@kalle.csb.ki.se
Lilla Aspö 2340             +46  173 140 57                    Networks
S-742 94 Östhammar         +46  10 270 26 67                  Computers
Sweden                                                       Consulting
-----------------------------------------------------------------------


From: Erich Mueller <em@gonzales.swb.de>
Subject: Re: USB on X86 platform boot
Date: Fri, 1 Jun 2001 22:43:34 +0200 (CEST)

> 
> On 1 Jun 2001, Adam Di Carlo wrote:
> 
> > Erich Mueller <em@gonzales.swb.de> writes:
> > 
> > > sorry for having lost the thread again now, I changed machines several
> > > times between home and workplace and also subscribed fom another address. 
> > > The temporary fix or workaround based on the hint from this list, I think
> > > it was Karl Hammar <karl@kalle.csb.ki.se> forwarded to me by Adam. The
> > > (borrowed) PS2 keyboard in place in addition to the USB keyboard of the
> > > machine did help to get past the critical point. Now the machine is
> > > loading its guts over the network and will soon be singing and dancing. 
> > > (The original problem is still not fixed, maybe a later kernel does. 
> > > Should this workaround be advertized in the faqs or docs somewhere?) 
> > 
> > I shall add a todo item that we need to try to fix this.
> > 
> > Please clarify some matters for me so I can get it right.
> > 
> > The problem is that you cannot use the USB keyboard during the install
> > process, no matter the BIOS settings, you had to use a PS/2 keyboard,
> > right?
> 
> The USB keyboard worked according to BIOS settings or not (USB CHIP and
> KEYBOARD/MOUSE on/off work as advertised) The problem that I was
> confronted with was that after the kernel boot messages displayed that
> keyboard timout message no keyboard attached the USB keyboard was ignored
> regardless of bios settings. After attaching the PS/2 keyboard (togather
> with the (enabled in BIOS) USB keyboard I used the USB keyboard all the
> way for all input with no problems at all. The lack of PS/2 keyboard only
> surfaced when trying to hit the enter key at the first requested input
> after the booting of the kernel noticed that no AT style keyboard present.
> 
> I hope this clarifies the problem I did not do one single keystroke on
> the PS/2 keyboard all the inputs are taken from the USB keyboard. BIOS
> settings, SYSLINUX and all the bootstrap interaction worked with no hickup
> when the PS/2 keyboard is plugged in(but unused for input). I would
> dare to speculate that the code in the kernel that branched off to spit
> out the message about keyboard timout also detaches all the
> subsequent communication process with the input devices (regardless of the
> perfectly supported ad sevicable USB keyboard available)
> 
> The message stems form /usr/src/linux/drivers/char/pc_keyb.c
> 
> -------------------------------------snip----------------------------------
> static int send_data(unsigned char data)
> {
>         int retries = 3;
> 
>         do {
>                 unsigned long timeout = KBD_TIMEOUT;
> 
>                 acknowledge = 0; /* Set by interrupt routine on receipt of
> ACK. */
>                 resend = 0;
>                 reply_expected = 1;
>                 kbd_write_output_w(data);
>                 for (;;) {
>                         if (acknowledge)
>                                 return 1;
>                         if (resend)
>                                 break;
>                         mdelay(1);
>                         if (!--timeout) {
> #ifdef KBD_REPORT_TIMEOUTS
>                                 printk(KERN_WARNING "keyboard: Timeout - AT keyboard not present?\n");
> #endif
>                                 return 0;
>                         }
>                 }
>         } while (retries-- > 0);
> #ifdef KBD_REPORT_TIMEOUTS
>         printk(KERN_WARNING "keyboard: Too many NACKs -- noisy kbd
> cable?\n");
> #endif
>         return 0;
> }
>  
> -------------------------------------snap-------------------------------
> 
> Hope this helps,
> Erich
> 
> 
> If you need more testing let me know specificaly what to check or observe.
> The hardware is available for all (nondestructive) tests in supprot of
> ironing out this behaviour. It would be a pitty if perfectly suitable
> hardware be excluded due to some silly turn in the kernel code.



Reply to: