OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Oct 22, 2018 8:28 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Thu Aug 02, 2018 4:13 pm 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
Ben, may i send all code to you to help me? If yes, please reply to email: ivningman@gmail.com.
With best regards,
Aleksandr


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Thu Aug 02, 2018 7:50 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
MrLolthe1st wrote:
Ben, may i send all code to you to help me? If yes, please reply to email: ivningman [at] gmail [dot] com.
With best regards,
Aleksandr

Yes. I have sent you an email at that address. For future reference, it is wise to not display your full address. For example, next time use ivningman [at] gmail [dot] com

I haven't done a whole lot with your image you posted yet, but will have a chance soon.

Ben


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Thu Aug 02, 2018 8:49 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
I had a few minutes tonight so I ran it through my initial tests and this is what I found:
Code:
1) You are not resetting the controller to begin with.
    The controller is probably in the Run State due to the BIOS
    You are writing to registers that should not be written to while in the run state.
2) You are setting the Interrupt Threshold to 16-micro frames, should be 8-micro frames.
3) When you write a reset bit to the EHCI port register, you don't write a zero to the Port Enable bit.
    (See the description for Bit 8 in the ECHI specs (Table 2-16))
    You should also clear the Connect Status Change bit before you try to do a reset
4) The last read you do from the connected port is 0x00001005
    CCS = 1
    PED = 1
    PP = 1
    Then nothing happens.  Most likely you are now placing TD's on the stack.

If the controller is in the run state and you write to the ASYNC address register, the controller may already have internally cached the previous address and ignores the new write. The controller must be in the HALTED state to change the ASYNC and PERIODIC addresses.

Since you do not check to see if the Halted bit is set before you set the Run Bit, setting the Run Bit will yield undefined results if the Halted bit is not set. Since the BIOS most likely had the EHCI running, the Halted bit was probably clear when you set the Run Bit. i.e.: Undefined results.

Always reset the controller, then set it to the Halted state before you assume anything else about it. Then start writing to the other registers.

Ben
- http://www.fysnet.net/the_universal_serial_bus.htm


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Sun Aug 05, 2018 4:00 pm 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
Hi, Benjamin.
I'm saw the VBox debug, all is ok:
VBoxDbg> info ehci
USBCMD: 80031
EHCI_CMD_RUN
EHCI_CMD_PERIODIC_SCHED_ENABLE
EHCI_CMD_ASYNC_SCHED_ENABLE
EHCI_CMD_FRAME_LIST_SIZE 0
EHCI_CMD_ASYNC_SCHED_PARK_MODE_COUNT 0
EHCI_CMD_INTERRUPT_THRESHOLD 8
USBSTS: c008
EHCI_STATUS_ASYNC_SCHED
EHCI_STATUS_PERIOD_SCHED
EHCI_STATUS_FRAME_LIST_ROLLOVER
USBINTR: 0
FRINDEX: 1178
CTRLDSSEGMENT: 0
PERIODICLISTBASE: 884000
ASYNCLISTADDR: 890000
But when some time until run i've saw that:
USBCMD: 80031
EHCI_CMD_RUN
EHCI_CMD_PERIODIC_SCHED_ENABLE
EHCI_CMD_ASYNC_SCHED_ENABLE
EHCI_CMD_FRAME_LIST_SIZE 0
EHCI_CMD_ASYNC_SCHED_PARK_MODE_COUNT 0
EHCI_CMD_INTERRUPT_THRESHOLD 8
USBSTS: e008
EHCI_STATUS_ASYNC_SCHED
EHCI_STATUS_PERIOD_SCHED
EHCI_STATUS_RECLAMATION
EHCI_STATUS_FRAME_LIST_ROLLOVER
USBINTR: 0
FRINDEX: 4a5800
CTRLDSSEGMENT: 0
PERIODICLISTBASE: 884000
ASYNCLISTADDR: 890000
Frame Index over 1024*8.
Memory at 0x890000
%0000000000890000: 02 01 89 00 00 80 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890010: 01 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890020: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890040: 00 00 00 00 00 00 00 00-48 01 89 00 48 01 89 00 ........H...H...
%0000000000890050: 00 00 00 00 01 00 00 00-00 00 00 00 00 00 00 00 ................
(QHLP) - 00890102(QH bit is set)
(EndpCh) - 00008000(H bit is set)
(EndpCap) - 00000000
(CurLink) - 00000000
(NextLink) - 00000001(Terminate bit is set)
(AltLink) - 00000000
(Token) - 00000000
(Buffers) - 00000000
Next - my fields
Next QH(at 0x00890100):
%0000000000890100: 02 00 89 00 00 60 08 50-00 00 00 40 00 00 00 00 .....`.P...@....
%0000000000890110: 00 80 89 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890120: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890130: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000890140: 00 00 00 00 b3 f9 00 00-48 00 89 00 48 00 89 00 ........H...H...
%0000000000890150: 00 80 89 00 01 00 00 00-00 00 00 00 00 00 00 00 ................
(QHLP) - 00890002(QH bit is set)
(EndpCh) - 50086000
(EndpCap) - 40000000
(CurLink) - 00000000
(NextLink) - 00898000
(AltLink) - 00000000
(Token) - 00000000
(Buffers) - 00000000
ExtBuf[4] = 0000f9b3
NextLink - 00898000:
%0000000000898000: 80 80 89 00 01 00 00 00-80 0e 08 00 c7 f9 00 00 ................
%0000000000898010: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000898020: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000898030: 00 00 00 00 80 80 89 00-01 00 00 00 00 00 00 00 ................
%0000000000898040: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000898050: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
Link - 00898080
altLink - 00000001
token - 00080e80
Buf - f9c7
Next TD:
%0000000000898080: 00 81 89 00 01 00 00 00-80 0d 08 80 7d fc 00 00 ............}...
%0000000000898090: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%00000000008980a0: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%00000000008980b0: 00 00 00 00 00 81 89 00-01 00 00 00 00 00 00 00 ................
%00000000008980c0: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%00000000008980d0: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
Link - 898100
altLink - 1
token - 80080d80
Buf - FC7D
Next TD:
%0000000000898100: 01 00 00 00 01 00 00 00-80 0c 00 80 00 00 00 00 ................
%0000000000898110: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000898120: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000898130: 00 00 00 00 00 00 00 00-01 00 00 00 00 00 00 00 ................
%0000000000898140: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
%0000000000898150: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
Link - 1(terminate)
altLink - 1
Token 80000c80
Buf - 0
What is it, what trouble it may be?
With best regards,
Aleksandr


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Sun Aug 05, 2018 6:33 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
Hi,

Supposedly, VBox probably starts out with a controller in the state as if it was just reset, unlike real hardware. So, and as with other emulators, your code should still work even though you haven't reset the controller. However, without resetting the controller and making sure the Run bit is clear *and* the HcHalted bit is set, there is no need to proceed any further. The assumption that the emulator will start the controller in a known state is just that, an assumption.

Bochs calls the Controller Reset code at initialization time as if you reset the controller yourself. With the code you sent me, and the binary image, Bochs still didn't receive TD requests. This means you still have something wrong with your TD set up.

However, and I can't express this enough, if you haven't got the controller in a known state, a state that your driver knows, there is no need to try to fix the TD setup. Controller reset is a must. There is no idea or standard that says the BIOS must leave it in a certain state.

To move on to your question, I don't know nor have I ever used the Log part of VBox, but the following:
Code:
VBoxDbg> info ehci
USBCMD: 80031
EHCI_CMD_RUN
EHCI_CMD_PERIODIC_SCHED_ENABLE
EHCI_CMD_ASYNC_SCHED_ENABLE

This tells me that the controller is in the run state, with the two schedules enabled, right off the bat. You must not initialize the controller when it is in the Run state.

Also, something else jumps out:
Code:
USBINTR: 0
FRINDEX: 4a5800
CTRLDSSEGMENT: 0

How can the Frame Index register be at that point? The highest value it can have is 0x1FFF, not counting the SOFV write-through.
Code:
  1024 * 8 (0x400 * 0x008) = 8192 - 1  (0x2000 - 1)

Last frame is 1023, with last micro-frame as 7:
Code:
  (1023 * 8) + 7 = 8192 - 1

i.e.: There cannot be more than 14 bits used, bits 13:0 only.

There is a definite error in VBox to even display that value, as well as probably an error letting it get to that value. However, since my code and most likely most all other code works just fine in VBox, there must be something within your code writing to this register, and as stated before, the specifications specifically state that writing to this register in the Run State will produce undefined results...

Ben
- http://www.fysnet.net/the_universal_serial_bus.htm


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Sun Aug 05, 2018 6:59 pm 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
I'm resetting controller with that code:
Code:
   uint cmd = ROR(usbCmdO);
   WOR(usbCmdO, 2 | cmd & ~(CMD_ASE | CMD_PSE));
   kprintf("!%x!", ROR(usbCmdO));
   while (ROR(usbCmdO) & 2);
   while ((ROR(usbCmdO) & STS_HCHALTED));
   cmd = ROR(usbCmdO);
   WOR(usbCmdO, 2 | cmd & ~(1));

after that i'm setting up registers and other, i'm write before, about memory, nextlink in qh is point to TD.


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Sun Aug 05, 2018 8:03 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
Hi,

Code:
   uint cmd = ROR(usbCmdO);
   WOR(usbCmdO, 2 | cmd & ~(CMD_ASE | CMD_PSE));
   kprintf("!%x!", ROR(usbCmdO));
   while (ROR(usbCmdO) & 2);
   while ((ROR(usbCmdO) & STS_HCHALTED));
The STS_HCHALTED bit is in the Status Register, not the Command Register. Besides, if you actually were reading the Status Register, your code would not get past this point...

Also, if the HcHalted bit is indeed set, there is no need to clear the Run bit below.
Code:
   cmd = ROR(usbCmdO);
   WOR(usbCmdO, 2 | cmd & ~(1));

With the above code, you reset the controller again...

I am guessing you are copy/pasting code here and forget to make the modifications after the paste.

It is very wise and very recommended that you comment your code for many reasons, two that I can recommend:
1) So that if you ever come back to this code in a few years, and/or someone else reads it, they have an idea what you are doing.
and, especially for a beginners point of view:
2) So that you "verbally" write out what you are going to do, then code the code.

For example:
Code:
        // Read the Command register
        uint cmd = ROR(usbCmdO);
        // Write it back, setting bit 2 (the Reset bit)
        //  and making sure the two schedule Enable bits are clear.
        WOR(usbCmdO, 2 | cmd & ~(CMD_ASE | CMD_PSE));
        // A small delay here would be good.  You don't want to read
        //  the register before it has a chance to actually set the bit
        ROR(usbCmndO);
        // Now wait for the controller to clear the reset bit.
        // Note: A timeout would be a good idea too in case the bit
        //  never becomes clear.  (Bad controller: Bad address: etc.) (See note 1 below)
        while (ROR(usbCmdO) & 2);
        // Again, a small delay here would be good to allow the
        //  reset to actually become complete.
        ROR(usbCmndO);
        // wait for the halted bit to become set
        // again, see note 1 below)
        while (!(ROR(usbStatO) & STS_HCHALTED));

Please look over your code and make sure it is actually doing what you expect it to do.

- Ben


Note 1:
A good implementation of a driver/kernel/etc. will have a "WaitForBit" implementation. For example, if the controller takes a considerable amount of time to reset, say 50ms, the kernel can let something else proceed while it is waiting for this bit.

Also, something such as:
Code:
   while (ROR(usbCmdO) & 2);
will never advance if the bit never becomes clear, and you will never know about it. Whereas a "WaitForBit" implementation can have a default timeout value, say 5000ms, and throw a kernel panic if the bit never becomes clear (or set).


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Mon Aug 06, 2018 4:26 pm 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
So, OK. EHCI successfully works at real hardware! But, don't working at VBox. Next trouble is:
My OS detects HUB with 8 ports, with characteristics 0x0 and power time 0, current = 0. But, i'm trying to reset any port i'm recieving status 0.
Code below.
Code:
// ------------------------------------------------------------------------------------------------
// Port Status

#define PORT_CONNECTION                 (1 << 0)    // Current Connect Status
#define PORT_ENABLE                     (1 << 1)    // Port Enabled
#define PORT_SUSPEND                    (1 << 2)    // Suspend
#define PORT_OVER_CURRENT               (1 << 3)    // Over-current
#define PORT_RESET                      (1 << 4)    // Port Reset
#define PORT_POWER                      (1 << 8)    // Port Power
#define PORT_SPEED_MASK                 (3 << 9)    // Port Speed
#define PORT_SPEED_SHIFT                9
#define PORT_TEST                       (1 << 11)   // Port Test Control
#define PORT_INDICATOR                  (1 << 12)   // Port Indicator Control
#define PORT_CONNECTION_CHANGE          (1 << 16)   // Connect Status Change
#define PORT_ENABLE_CHANGE              (1 << 17)   // Port Enable Change
#define PORT_OVER_CURRENT_CHANGE        (1 << 19)   // Over-current Change

// ------------------------------------------------------------------------------------------------
typedef struct UsbHub
{
    UsbDevice *dev;
    UsbHubDesc desc;
} UsbHub;

// ------------------------------------------------------------------------------------------------
static uint UsbHubResetPort(UsbHub *hub, uint port)
{
    UsbDevice *dev = hub->dev;

    // Reset the port
    if (!UsbDevRequest(dev,
        RT_HOST_TO_DEV | RT_CLASS | RT_OTHER,
        REQ_SET_FEATURE, F_PORT_RESET, port + 1,
        0, 0))
    {
        return 0;
    }
   PitWait(1000);
    // Wait 100ms for port to enable (TODO - remove after dynamic port detection)
    u32 status = 0;
    for (uint i = 0; i < 10; ++i)
    {
        // Delay
        PitWait(1000);

        // Get current status
        if (!UsbDevRequest(dev,
            RT_DEV_TO_HOST | RT_CLASS | RT_OTHER,
            REQ_GET_STATUS, 0, port + 1,
            sizeof(status), &status))
        {
            return 0;
        }
      kprintf("!%x!",status);
        // Check if device is attached to port
        if (~status & PORT_CONNECTION)
        {
            break;
        }

        /*
        // Acknowledge change in status
        if (status & (PORT_ENABLE_CHANGE | PORT_CONNECTION_CHANGE))
        {
            port_clr(reg, PORT_ENABLE_CHANGE | PORT_CONNECTION_CHANGE);
            continue;
        }*/

        // Check if device is enabled
        if (status & PORT_ENABLE)
        {
            break;
        }
    }

    return status;
}

// ------------------------------------------------------------------------------------------------
static void UsbHubProbe(UsbHub *hub)
{
    UsbDevice *dev = hub->dev;
    uint portCount = hub->desc.portCount;

    // Enable power if needed
    if ((hub->desc.chars & HUB_POWER_MASK) == HUB_POWER_INDIVIDUAL)
    {
      printTextToWindow(1, mywin, "Switching on the power!!\n");
        for (uint port = 0; port < portCount; ++port)
        {
            if (!UsbDevRequest(dev,
                RT_HOST_TO_DEV | RT_CLASS | RT_OTHER,
                REQ_SET_FEATURE, F_PORT_POWER, port + 1,
                0, 0))
            {
                return;
            }

        }

        PitWait(hub->desc.portPowerTime * 10);
    }
   printTextToWindow(2, mywin, "       Hub port count: %x\n",(int)portCount);
    // Reset ports
    for (uint port = 0; port < portCount; ++port)
    {
        uint status = UsbHubResetPort(hub, port);

        if (status & PORT_ENABLE)
        {
            uint speed = (status & PORT_SPEED_MASK) >> PORT_SPEED_SHIFT;
         printTextToWindow(2, mywin, "       Port #%x enabled!\n", port);
            UsbDevice *dev = UsbDevCreate();
            if (dev)
            {
                dev->parent = hub->dev;
                dev->hc = hub->dev->hc;
                dev->port = port;
                dev->speed = speed;
                dev->maxPacketSize = 8;

                dev->hcControl = hub->dev->hcControl;
                dev->hcIntr = hub->dev->hcIntr;

                if (!UsbDevInit(dev))
                {
                    // TODO - cleanup
                }
            }
        }
    }
}

// ------------------------------------------------------------------------------------------------
static void UsbHubPoll(UsbDevice *dev)
{
}

// ------------------------------------------------------------------------------------------------
void _usbhubinit(UsbDevice *dev)
{
    if (dev->intfDesc->intfClass == USB_CLASS_HUB)
    {
        printTextToWindow(2, mywin, "     Initializing Hub\n");

        // Get Hub Descriptor
        UsbHubDesc desc;

        if (!UsbDevRequest(dev,
            RT_DEV_TO_HOST | RT_CLASS | RT_DEV,
            REQ_GET_DESC, (USB_DESC_HUB << 8) | 0, 0,
            sizeof(UsbHubDesc), &desc))
        {
            return 0;
        }

        UsbPrintHubDesc(&desc);

        UsbHub *hub = malloc(sizeof(UsbHub));
        hub->dev = dev;
        hub->desc = desc;

        dev->drv = hub;
        dev->drvPoll = UsbHubPoll;

        UsbHubProbe(hub);
        return 1;
    }

    return 0;
}

What it may be?
With best regards,
Aleksandr


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Mon Aug 06, 2018 6:16 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
MrLolthe1st wrote:
So, OK. EHCI successfully works at real hardware! But, don't working at VBox. Next trouble is:
My OS detects HUB with 8 ports, with characteristics 0x0 and power time 0, current = 0. But, i'm trying to reset any port i'm recieving status 0.
Code below.

What it may be?
With best regards,
Aleksandr

Glad to hear that real hardware is now working. The Reset was the key, most likely.

As far as not detecting a device on the port:
What speed is the device? If it is a Full- or Low-speed device, the EHCI won't do anything with it. Your EHCI port reset code must detect which speed it is. The simplest way is to see if the port was enabled after a reset. If not, a Full- or Low-speed device is attached and you must hand it off to the companion controller. If the port is enabled, you have a high-speed device (or a super-speed device using only the high-speed wires).

There is also the chance that the EHCI has a Rate-Matching Hub attached. The EHCI will report only two or three external ports. One for the RMH (Rate Matching Hub), one for the debug port, and one for the...I forget. I would have to look at my notes. Anyway, does your EHCI report eight external ports? If so, it probably is not a RMH.

Also, you must power the port before you can read from it. Is bit 4 of the HCSParams register set? If so, you need to set the Port Power bit in the Port Register before you can read it to detect a connection. You must also wait for the power to be good before you read from it. Usually 20ms is sufficient.

Ben


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Tue Aug 07, 2018 1:17 am 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
So, it's high speed device, but after port reset(on HubProbe) status returns as 0.


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Tue Aug 07, 2018 1:22 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
Are you talking about an actual external hub? i.e.: you got TD's to work and now are trying to send a reset hub port request to the external hub?

I was under the impression that you didn't have TD's working at all yet?

If you are trying to reset a *Root* Hub port, it is much different than resetting and *external* Hub port.

The code you posted last kind of indicates that you are trying to reset an *external* hub port.

What port are your trying to reset? A Root Hub port or an external hub port?

Ben


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Thu Aug 09, 2018 1:31 am 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
Hub, that connected to EHCI port, likely root hub, but i'm don't know.


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Thu Aug 09, 2018 5:57 am 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
MrLolthe1st wrote:
Hub, that connected to EHCI port, likely root hub, but i'm don't know.

I understand that there is a language difference and English may not be your primary language. So let me try to explain this a little better and then please let me know which type of Hub you are trying to reset.

The EHCI Controller can have 0 to 15 ports, each available to have an external device attached. These ports, up to 15, are considered to be on the Root Hub.

An external Hub, a device that is attached to a Root Hub, is considered a device.

Are you trying to reset a Root Hub port or a port on the external hub?

If you are trying to reset a port on an external hub, then this assumes that you have already successfully reset a port on the Root Hub and have successfully set up TD's ready for data transfer.

If you are trying to reset a port on the Root Hub, TD's are not used. A Root Hub has a hardware register for each available port, that this read and written to just like other registers on the EHCI controller.

Therefore, which type of Hub are you trying to reset a port on?

Ben


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Sun Aug 12, 2018 6:37 am 
Offline
Member
Member

Joined: Sat Sep 24, 2016 12:06 am
Posts: 70
Hub, which is connected to one of ports EHCI.


Top
 Profile  
 
 Post subject: Re: EHCI didn't works at real PC and VirtualBox!
PostPosted: Sun Aug 12, 2018 8:32 am 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 465
Location: USA
MrLolthe1st wrote:
Hub, which is connected to one of ports EHCI.

Okay, then this assumes that you have now have Queues and Transfer Descriptors working properly. Yes?

You must send Control transfers to the external hub to reset and enable a port, etc.

You then either use an interrupt transfer or poll the hub with a Control transfer every so often, specified in the hub's descriptor, to get the status.

If you are receiving a packet of zero's, I would first check that you are actually receiving a packet. Did the hardware indicate the size of the packet returned?

If you have working Queues and TDs, have you plugged in a regular device to the Root Hub, say a mouse or keyboard, and does it work?

It is much easier to make sure your EHCI driver is functional using a keyboard or mouse via the Root Hub, than it is this same device through an external hub.

- Ben


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], JAAman, narke, zaval and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group