Is there any easy way to porting the
USB driver on PPC platform?
I mean something like
#if _BYTE_ORDER == _BIG_ENDIAN
Hi Julin,
Please could you be more explicit ?
Is the host controller a component of the PPC ?
Or it is external through a PCI bus, or other ?
Do you have an USB OHCI or UHCI controller ?
What kind of PPC CPU are you using ?
Patrick
If your PPC platform is based on a MPC5200 you may download the BSP for
the Lite5200 board from Windsurf (or ask support).
This BSP should contain the required changes to get the USB 1.1 stack
running.
Dear Patrick,
My platform is MPC8220i Alaska board,
and windriver do not have this board's BSP now.
But Motorola already support me the BSP for vxWorks O/S.
My CPU is MPC8220i(G2 core inside), and it has external PCI bus.
I plug in one PCI-USB card into the PCI slot,
and enable the OHCI controller,
so my firmware is working on USB 1.1 host.
I think there is no problem about hardware connection.
And the PCI interrupt work fine.
I can get the device descriptor from the USB device.
But the USB is defined to be little endian.
And I have check the following usb_device_descr data structure,
pUSB_DEVICE_DESCR->bcdUsb,
pUSB_DEVICE_DESCR->vendor,
pUSB_DEVICE_DESCR->product,
pUSB_DEVICE_DESCR->bcdDevice,
I found the UINT16 high/low byte data should be swap.
The UINT8 data all OK.
typedef struct usb_device_descr
{
UINT8 length; /* bLength */
UINT8 descriptorType; /* bDescriptorType */
UINT16 bcdUsb; /* bcdUSB - USB release in BCD */
UINT8 deviceClass; /* bDeviceClass */
UINT8 deviceSubClass; /* bDeviceSubClass */
UINT8 deviceProtocol; /* bDeviceProtocol */
UINT8 maxPacketSize0; /* bMaxPacketSize0 */
UINT16 vendor; /* idVendor */
UINT16 product; /* idProduct */
UINT16 bcdDevice; /* bcdDevice - dev release in BCD */
UINT8 manufacturerIndex; /* iManufacturer */
UINT8 productIndex; /* iProduct */
UINT8 serialNumberIndex; /* iSerialNumber */
UINT8 numConfigurations; /* bNumConfigurations */
} WRS_PACK_ALIGN(4) USB_DEVICE_DESCR, *pUSB_DEVICE_DESCR;
Currently I already know where is the problem.
But how can I solve this problem more easy?
Best Regards,
Julin
By changing the appropriate OHCI HCD driver (usbHcdOchciLib.c) and/or
the usbPciStub.c of the BSP you should be able to get the stack working.
Check also if there is not a double swapping with the BSP, the
sysPciInLong() / sysPciOutLong() (probably at sysALib.s) perform already
the swapping on the PCI bus (little Endian).
If you try to change the upper layer you will increase the complexity of
the integration.
Regards,
Patrick