All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [Patch] [bug #26237] multiple problems with usb devices
Date: Fri, 16 Apr 2010 18:39:31 +0200	[thread overview]
Message-ID: <4BC892C3.3090507@gmail.com> (raw)
In-Reply-To: <1270762038.2730.37.camel@homenes1>

[-- Attachment #1: Type: text/plain, Size: 2571 bytes --]

Aleš Nesrsta wrote:
> I will test the usb.diff soon and than I try to more study EHCI
> specification. On my PC is OHCI detected properly but I have very old
> machine Toshiba Satellite 2140CDS (i586 at 450MHz) with one OHCI only
> interface. I.e. it looks like problem appears only on combined OHCI-EHCI
> interfaces. I have also plan to debug GRUB2 USB support on other, newer
> machine with OHCI-EHCI interfaces.
> I will inform You there if I will discover something interesting...
>
>   
I discovered something. It looks like on Yeeloong the problem is caused
by the skipped step of initialising of timings and power management.
Quick and dirty fix:
=== modified file 'bus/usb/ohci.c'
--- bus/usb/ohci.c      2010-01-20 19:40:30 +0000
+++ bus/usb/ohci.c      2010-04-16 16:32:38 +0000
@@ -91,10 +93,15 @@
   GRUB_OHCI_REG_BULKCURR,
   GRUB_OHCI_REG_DONEHEAD,
   GRUB_OHCI_REG_FRAME_INTERVAL,
+  GRUB_OHCI_REG_PERIODIC_START = 16,
   GRUB_OHCI_REG_RHUBA = 18,
   GRUB_OHCI_REG_RHUBPORT = 21
 } grub_ohci_reg_t;
 
+#define GRUB_OHCI_RHUB_PORT_POWER_MASK 0x300
+#define GRUB_OHCI_RHUB_PORT_ALL_POWERED 0x200
+
+
 static grub_uint32_t
 grub_ohci_readreg32 (struct grub_ohci *o, grub_ohci_reg_t reg)
 {
@@ -166,6 +215,11 @@
   if ((revision & 0xFF) != 0x10)
     goto fail;
 
+  grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBA,
+                       (grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBA)
+                        & ~GRUB_OHCI_RHUB_PORT_POWER_MASK)
+                       | GRUB_OHCI_RHUB_PORT_ALL_POWERED);
+
   /* Backup the frame interval register.  */
   frame_interval = grub_ohci_readreg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL);
@@ -175,10 +229,14 @@
   grub_dprintf ("ohci", "OHCI reset\n");
 
   /* Restore the frame interval register.  */
+  /* FIXME: is this choice of timings sane?  */
+  frame_interval = (frame_interval & 0xffff) | 0x27780000;
   grub_ohci_writereg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL, frame_interval);
 
+  grub_ohci_writereg32 (o, GRUB_OHCI_REG_PERIODIC_START, 0x257f);
+
   /* Setup the HCCA.  */
-  grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca);
+  grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca);
   grub_dprintf ("ohci", "OHCI HCCA\n");
 
   /* Enable the OHCI.  */
 

> Best regards
> Ales
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

  reply	other threads:[~2010-04-16 16:47 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 22:23 [Patch] [bug #26237] multiple problems with usb devices Aleš Nesrsta
2010-04-02 20:46 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-07 19:49   ` Aleš Nesrsta
2010-04-07 20:39     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-08 21:27       ` Aleš Nesrsta
2010-04-16 16:39         ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-04-20 20:14           ` Aleš Nesrsta
2010-04-24 19:50             ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-28  8:20               ` Aleš Nesrsta
2010-05-09 13:50                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-21 23:46             ` Aleš Nesrsta
2010-05-22  1:20               ` Grégoire Sutre
2010-05-22  9:35               ` Colin Watson
2010-05-22 23:13               ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-23 10:27                 ` Aleš Nesrsta
2010-05-23 14:41                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-23 17:42                     ` Aleš Nesrsta
2010-05-23 18:40                       ` Thomas Schmitt
2010-05-23 17:51                     ` [Patch] [bug #26237] " Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-23 14:44                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-23 17:16                     ` Aleš Nesrsta
2010-05-23 19:35                       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-23 20:41                         ` seth.goldberg
2010-05-25 18:58                         ` Aleš Nesrsta
2010-05-30 16:51                           ` Aleš Nesrsta
2010-05-30 22:26                             ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-31  4:16                               ` Seth Goldberg
2010-05-31 12:23                               ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-31 21:54                                 ` Aleš Nesrsta
2010-06-01  0:18                                   ` [RFT] " Vladimir 'φ-coder/phcoder' Serbinenko
2010-06-01 21:14                                     ` Aleš Nesrsta
2010-06-02  0:27                                       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-06-02  3:02                                         ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-06-02 19:39                                           ` Aleš Nesrsta
2010-06-02 20:14                                             ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-06-03 11:47                                               ` Aleš Nesrsta
2010-06-12 17:05                                               ` [RFT] Re: [Patch] [bug #26237] multiple problems with usb devices - faster OHCI Aleš Nesrsta
2010-06-12 18:59                                                 ` Aleš Nesrsta
2010-06-13 17:47                                               ` [RFT] Re: [Patch] [bug #26237] multiple problems with usb devices Aleš Nesrsta
2010-06-21 20:24                                                 ` Aleš Nesrsta
2010-06-25 18:10                                                   ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC892C3.3090507@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.