[U-Boot-Users] [patch] u-boot patch for ez-x5

hi, all?
i porting u-boot 1.1.6 on ez-x5. ez-x5(falinux.com) any u-boot version will do.
help me~

Hi:
I'm trying to implement simple USB device in u-boot for at91rm9200 and as a first step I want to see that I can work with interrupts there. I added temporary device initialization code to usb_lowlevel_init():
............................. AT91PS_AIC pAic = AT91C_BASE_AIC;
*AT91C_PMC_SCER = AT91C_PMC_UDP;/* 48MHz clock enabled for UDP */ *AT91C_PMC_PCER = (1 << AT91C_ID_UDP); /* Peripheral Clock Enable Register */
pAic->AIC_IDCR = 1 << AT91C_ID_UDP; pAic->AIC_SVR[AT91C_ID_UDP] = (unsigned int) &dfu_udp_irq; pAic->AIC_SMR[AT91C_ID_UDP] = AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE | 1; pAic->AIC_ICCR = 1 << AT91C_ID_UDP;
AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_UDP); ..............................................
BTW, I suspect that AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE is not correct one actually in this case.
Interrupt handler just prints something, clears the interrupt and leaves:
static void dfu_udp_irq(void) { AT91PS_UDP pUDP = AT91C_BASE_UDP; AT91_REG isr = pUDP->UDP_ISR; AT91PS_AIC pAic = AT91C_BASE_AIC; static unsigned int counter=0;
printf ("dfu_udp_irq:%u isr = 0x%X (AT91C_ID_UDP=%u) counter %u\n", __LINE__, isr, AT91C_ID_UDP, counter++);
/* clear all interrupts */ pUDP->UDP_ICR = isr;
pAic->AIC_ICCR = AT91C_ID_UDP; }
I issue "usb start" command and then connect my device port to external USB host (I also can do the same, connecting it to card's own host port). I get the interrupt, but system is dead after that - looks like interrupt never gets freed:
U-Boot$ dfu_udp_irq:1554 isr = 0x300 (AT91C_ID_UDP=11) counter 0
Now, interrupt's bits that are set are RXSUSP (USB Suspend Interrupt Status) and RXRSM (USB Resume Interrupt Status). I think my code clears them, but may be I shall do something else provided that USB device is in suspended mode now? Looks like the interrupt doesn't get released after all...
Thanks,
Leonid.

"Leonid" Leonid@a-k-a.net wrote in message news:406A31B117F2734987636D6CCC93EE3C01CAD749@ehost011-3.exch011.intermedia.net...
I'm trying to implement simple USB device in u-boot for at91rm9200 and as a first step I want to see that I can work with interrupts there. I added temporary device initialization code to usb_lowlevel_init():
I used the USB Device port as a console for my at91sam9261, acting as a usbser.sys compatible usb-to-serial port. It was a lot easier to use a polling interface because there was some Atmel sample code available.
During early startup, I add the usb driver with device_register(). Each function polls the status register, which works out fine since uboot calls tstc constantly to look for a new character or putc to display something. Finally I added a check for the device sense (power) to skip the initialization completely if we know it's not connected to anything.
-joey

Thank you for your reply, may I get hold on your code please?
Thanks,
Leonid.
-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users-bounces@lists.sourceforge.net] On Behalf Of Joey Oravec Sent: Wednesday, July 11, 2007 10:22 AM To: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] Interrupts in at91rm9200 u-boot.
"Leonid" Leonid@a-k-a.net wrote in message news:406A31B117F2734987636D6CCC93EE3C01CAD749@ehost011-3.exch011.interme dia.net...
I'm trying to implement simple USB device in u-boot for at91rm9200 and
as a first step I want to see that I can work with interrupts there. I
added temporary device initialization code to usb_lowlevel_init():
I used the USB Device port as a console for my at91sam9261, acting as a usbser.sys compatible usb-to-serial port. It was a lot easier to use a polling interface because there was some Atmel sample code available.
During early startup, I add the usb driver with device_register(). Each function polls the status register, which works out fine since uboot calls tstc constantly to look for a new character or putc to display something. Finally I added a check for the device sense (power) to skip the initialization completely if we know it's not connected to anything.
-joey
------------------------------------------------------------------------ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

Joey Oravec wrote:
"Leonid" Leonid@a-k-a.net wrote in message news:406A31B117F2734987636D6CCC93EE3C01CAD749@ehost011-3.exch011.intermedia.net...
I'm trying to implement simple USB device in u-boot for at91rm9200 and as a first step I want to see that I can work with interrupts there. I added temporary device initialization code to usb_lowlevel_init():
I used the USB Device port as a console for my at91sam9261, acting as a usbser.sys compatible usb-to-serial port. It was a lot easier to use a polling interface because there was some Atmel sample code available.
During early startup, I add the usb driver with device_register(). Each function polls the status register, which works out fine since uboot calls tstc constantly to look for a new character or putc to display something. Finally I added a check for the device sense (power) to skip the initialization completely if we know it's not connected to anything.
-joey
Hi Joey,
If possible, I would also be interested in obtaining your U-Boot USB device code.
I tried creating a usbdcore_at91.c file to fit into the existing U-Boot usbdcore driver for the TI OMAP1510 a few months ago and didn't get very far, mainly due to the way the AT91 UDP supports various transactions in hardware.
Thanks, ../fam

"Frank Mandarino" fmandarino@endrelia.com wrote in message news:4696441F.5000704@endrelia.com...
If possible, I would also be interested in obtaining your U-Boot USB device code.
I tried creating a usbdcore_at91.c file to fit into the existing U-Boot usbdcore driver for the TI OMAP1510 a few months ago and didn't get very far, mainly due to the way the AT91 UDP supports various transactions in hardware.
Hey frank, I finally got my alsa sound driver working with your help. :)
No problem, I was surprised to see a ton of requests in my inbox this morning. I need to clean this up first because all my vendor ids, product ids, and descriptors are hardcoded and I don't want those showing up in other people's products! I'll be in touch.
-joey
participants (4)
-
Frank Mandarino
-
Joey Oravec
-
Leonid
-
Mi-hyun.Yoo