2009-06-03 02:38:25 Use SL811HS as Host USB on AMS3
Patrick Hotz (GERMANY)
Message: 75047
Hi Guys,
my new project is using the SL811HC as USB-Host to access first a USB-Stick and later a ZigBee-Receiver.
I have connected the SL811HS like this:
Blackfin BF537 > SL811HS
D0 - D8 > D0- D8
A2 > A0
AWE > WR
ARE > RD
AMS3 > CS
PF9 > INTRQ
In Kernel config this:
> Support for Host Side USB
> SL811HC HCD Support
> (9) Set GPIO IRQ pin for Interrupt
> Dummy Delay (No Dummy Delay)
> USB Mass Storage Support
> everything in the list for testing
Compiling is OK but if i start uClinux i get a "Data access misaligned address violation"
I think the problem is the AMS3 because in the sample scematics from STAMP USB Add-On Card v0.3 the CS is connected through a MC74VHC139M with AMS3, A17 and A18.
My system uses AMS0 and AMS1 for Flash, AMS2 for Display and AMS3 for this USB-Chip.
Does anybody know what i can do to get the USB-Host running?
Regards,
Patrick
TranslateQuoteReplyEditDelete
2009-06-03 03:55:30 Use SL811HS as Host USB on AMS3
Michael Hennerich (GERMANY)
Message: 75052 First of all '(9) Set GPIO IRQ pin for Interrupt' is wrong.
How did you initialize your platform resource for the SL811?
Do you have something like this?
#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
static struct resource sl811_hcd_resources[] = {
{
.start = 0x20300000,
.end = 0x20340000,
.flags = IORESOURCE_MEM,
}, {
.start = 0x20300004,
.end = 0x20300004,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_PF9,
.end = IRQ_PF9,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
},
};
#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
void sl811_port_power(struct device *dev, int is_on)
{
gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
}
#endif
static struct sl811_platform_data sl811_priv = {
.potpg = 10,
.power = 250, /* == 500mA */
#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
.port_power = &sl811_port_power,
#endif
};
static struct platform_device sl811_hcd_device = {
.name = "sl811-hcd",
.id = 0,
.dev = {
.platform_data = &sl811_priv,
},
.num_resources = ARRAY_SIZE(sl811_hcd_resources),
.resource = sl811_hcd_resources,
};
#endif
-Michael
QuoteReplyEditDelete
2009-06-03 04:31:25 Re: Use SL811HS as Host USB on AMS3
Patrick Hotz (GERMANY)
Message: 75078
Hi,
why is gpio 9 wrong? I am shure that PF9 is GPIO 9....
or is there someting special?
In my board config file there are this structs...
Patrick
TranslateQuoteReplyEditDelete
2009-06-03 04:49:48 Re: Use SL811HS as Host USB on AMS3
Michael Hennerich (GERMANY)
Message: 75079 This config option asks fro an IRQ Number and not a GPIO Number.
Take a look here:
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:interrupts#gpi
o_interrupt_processing
Assuming you use a BF537:
GPIO_PF9 = 9
IRQ_PF9 = 59
9 != 59
-Michael
QuoteReplyEditDelete
2009-06-03 05:32:14 Re: Use SL811HS as Host USB on AMS3
Patrick Hotz (GERMANY)
Message: 75083
OK, my mistake.
Now my uClinux is booting and shows this:
sl811: driver sl811-hcd, 19 May 2005
sl811-hcd sl811-hcd.0: SL811HS v1.5
sl811-hcd sl811-hcd.0: new USB bus registered, assigned bus number 1
sl811-hcd sl811-hcd.0: irq 59, io mem 0x20340000
usb usb1: Product: SL811HS v1.5
usb usb1: Manufacturer: Linux 2.6.22.18-ADI-2008R1-svn sl811-hcd
usb usb1: SerialNumber: sl811-hcd.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
But later i have this problem:
dma_alloc_init: dma_page @ 0x00356000 - 256 pages at 0x01f00000
This is the last message i get before the uCLinux is frozen
Could it be a irq problem? If i press return the new line is printed after some seconds....
The INTRQ is directly connected to PF9 with a pull up of 47k to 3,3V
Patrick
TranslateQuoteReplyEditDelete
2009-06-03 06:06:29 Re: Use SL811HS as Host USB on AMS3
Michael Hennerich (GERMANY)
Message: 75119 >The INTRQ is directly connected to PF9 with a pull up of 47k to 3,3V
Can you try a Pull-Down to Ground instead?
The SL811 IRQ is Active High by default
-Michael
QuoteReplyEditDelete
2009-06-03 07:29:56 Re: Use SL811HS as Host USB on AMS3
Patrick Hotz (GERMANY)
Message: 75122
Hi,
i have tried a pull-down with 47k but the same problem.
Evertytime i boot the uClinux the messages show that a sl811hc with 1 port is detected....
but it hangs after dma_alloc_init.....
Do you have any idea what i can try?
TranslateQuoteReplyEditDelete
2009-06-03 07:32:33 Re: Use SL811HS as Host USB on AMS3
Michael Hennerich (GERMANY)
Message: 75123 Does your kernel boot without the SL811 driver enabled?
-Michael
QuoteReplyEditDelete
2009-06-03 08:11:41 Re: Use SL811HS as Host USB on AMS3
Patrick Hotz (GERMANY)
Message: 75125
Yes, without the SL811 driver the system is booting ok.
I have tested with all options enabled only without the SL811
TranslateQuoteReplyEditDelete
2009-06-03 08:15:41 Re: Use SL811HS as Host USB on AMS3
Michael Hennerich (GERMANY)
Message: 75126 Then it's likely the IRQ that is bugging you.
Can you measure the PF9 pin level with a scope or so?
Is it constantly asserted?
-Michael
QuoteReplyEditDelete
2009-06-03 08:29:17 Re: Use SL811HS as Host USB on AMS3
Patrick Hotz (GERMANY)
Message: 75127
Hi Mike,
I have just tried the same with uCLinux2009pre and this version is working.
The problem is that we have to use 2008R1 because we use the special voip-software from your colleagues from india....
The IRQ is always about 0,1V at booting....
But now i know that it is a software problem in the dist2008R1 or in someting that the voip-software needs from kernel.
I will contact your colleagues, maybe they know the problem.
Thank you for the help, maybe i will come back to this thread if they dont know a answer.
Patrick