Author Topic: Resetting UHCI Ports  (Read 20046 times)

quafios

  • Member
  • ***
  • Posts: 2
Resetting UHCI Ports
« on: June 06, 2010, 06:05:20 pm »
Hello All!  :)
It is a small question about 'Resetting UHCI Root Ports'...
I am writing a UHCI driver, which shall reset ports after initialising the host controller
  • I send 0x0200 to the port.
  • Then, I send 0x0000 to the port // In order to clear RESET bit.
  • I send 0xE to the port then wait 500ms. // In order to Clear bit 1 & 3, and Set Bit 2 [Enable]..
  • When i read the port in this state, it gives 0x1A5 [Before writing 0xE, it gives 0x1A3]..
This is what I see on my real machine. on VMware and QEMU, it gives 0x85 [Which is normal]. a value of 0x1A5 should mean that there is a LINE STATUS error. When I try to send SET ADDRESS on VMWare or QEMU, it succeeds, but on my real machine it fails. don't know why it fails or why a LINE STATUS error happens. Please any help would be appreciated.
may be the steps that i do in order to reset the ports are wrong??
finally great thanks and Best Regards,
Mostafa.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Resetting UHCI Ports
« Reply #1 on: June 07, 2010, 02:43:04 pm »
I was going to suggest looking at a couple of UHCI source-code examples, but neither seems to be available anymore.

Maybe this will be useful:

http://f.osdev.org/viewtopic.php?f=1&t=21568&hilit=UHCI+Host+Controller+Error&sid=d583f5524aee3a8c8a40081faf53fa4f

Jan

quafios

  • Member
  • ***
  • Posts: 2
Re: Resetting UHCI Ports
« Reply #2 on: June 09, 2010, 03:46:58 pm »
Dear Mrs. Jan,
Thanks for the link. it was a typo in my pci_writew(); which i use to turn off Legacy Support.

Now my UHCI Driver works well with a low speed mouse, but problems happen when i put my Flash Memory. Although it is Hi-Speed, it appears to the UHCI in the second port as a full speed device. When i send a SET ADDRESS to it, it succeeds. but when i send GET_DESCRIPTOR, it fails with a bubble and a stall in the second TD [First One of the Data Stage].

Do you have any idea?? Should this flash memory behave correctly when it appears to a UHCI as a full-speed device??

On Microsoft Windows Device Management, I see that the root hub of that UHCI has 2 ports: a HID Device is a attached to the first [a USB Mouse], it says that the second port is free, it says also that a Mass Storage Device [My Flash Memory] is connected to a port in the root hub of EHCI.
Do i have to programme an EHCI Driver in order not to see hi-speed devices in UHCI?

Finally Great Thanks and Regards,
Mostafa.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Resetting UHCI Ports
« Reply #3 on: June 09, 2010, 09:34:54 pm »
Most high-speed-capable devices also support full speed. If the UHCI host can do Set Address, it's communicating at full speed.

Jan