public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [patch] u-boot patch for ez-x5
@ 2007-07-11  8:20 Mi-hyun.Yoo
  2007-07-11 17:08 ` [U-Boot-Users] Interrupts in at91rm9200 u-boot Leonid
  0 siblings, 1 reply; 6+ messages in thread
From: Mi-hyun.Yoo @ 2007-07-11  8:20 UTC (permalink / raw)
  To: u-boot

hi, all?

i porting u-boot 1.1.6 on ez-x5.
ez-x5(falinux.com)
any u-boot version will do.


help me~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Interrupts in at91rm9200 u-boot.
  2007-07-11  8:20 [U-Boot-Users] [patch] u-boot patch for ez-x5 Mi-hyun.Yoo
@ 2007-07-11 17:08 ` Leonid
  2007-07-11 17:21   ` Joey Oravec
  0 siblings, 1 reply; 6+ messages in thread
From: Leonid @ 2007-07-11 17:08 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Interrupts in at91rm9200 u-boot.
  2007-07-11 17:08 ` [U-Boot-Users] Interrupts in at91rm9200 u-boot Leonid
@ 2007-07-11 17:21   ` Joey Oravec
  2007-07-12  2:25     ` Leonid
  2007-07-12 15:09     ` Frank Mandarino
  0 siblings, 2 replies; 6+ messages in thread
From: Joey Oravec @ 2007-07-11 17:21 UTC (permalink / raw)
  To: u-boot

"Leonid" <Leonid@a-k-a.net> wrote in message 
news:406A31B117F2734987636D6CCC93EE3C01CAD749 at 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 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Interrupts in at91rm9200 u-boot.
  2007-07-11 17:21   ` Joey Oravec
@ 2007-07-12  2:25     ` Leonid
  2007-07-12 15:09     ` Frank Mandarino
  1 sibling, 0 replies; 6+ messages in thread
From: Leonid @ 2007-07-12  2:25 UTC (permalink / raw)
  To: u-boot

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 at lists.sourceforge.net] On Behalf Of Joey
Oravec
Sent: Wednesday, July 11, 2007 10:22 AM
To: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] Interrupts in at91rm9200 u-boot.

"Leonid" <Leonid@a-k-a.net> wrote in message
news:406A31B117F2734987636D6CCC93EE3C01CAD749 at 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 at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Interrupts in at91rm9200 u-boot.
  2007-07-11 17:21   ` Joey Oravec
  2007-07-12  2:25     ` Leonid
@ 2007-07-12 15:09     ` Frank Mandarino
  2007-07-12 15:36       ` Joey Oravec
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Mandarino @ 2007-07-12 15:09 UTC (permalink / raw)
  To: u-boot

Joey Oravec wrote:
> "Leonid" <Leonid@a-k-a.net> wrote in message 
> news:406A31B117F2734987636D6CCC93EE3C01CAD749 at 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(a)endrelia.com
Endrelia Technologies Inc.
Toronto, Ontario, Canada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Interrupts in at91rm9200 u-boot.
  2007-07-12 15:09     ` Frank Mandarino
@ 2007-07-12 15:36       ` Joey Oravec
  0 siblings, 0 replies; 6+ messages in thread
From: Joey Oravec @ 2007-07-12 15:36 UTC (permalink / raw)
  To: u-boot

"Frank Mandarino" <fmandarino@endrelia.com> wrote in message 
news:4696441F.5000704 at 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 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-12 15:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-11  8:20 [U-Boot-Users] [patch] u-boot patch for ez-x5 Mi-hyun.Yoo
2007-07-11 17:08 ` [U-Boot-Users] Interrupts in at91rm9200 u-boot Leonid
2007-07-11 17:21   ` Joey Oravec
2007-07-12  2:25     ` Leonid
2007-07-12 15:09     ` Frank Mandarino
2007-07-12 15:36       ` Joey Oravec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox