2010-08-20 06:16:33     uClinux_trunk doesn't work on BF526-0.2 EZBRD

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-08-20 06:16:33     uClinux_trunk doesn't work on BF526-0.2 EZBRD

Morten Kvistgaard (DENMARK)

Message: 92622   

 

Hello there,

 

 

 

I get an error on my 2 "BF526 revision 2 ezbrd" when booting up a standard, default uClinux from the trunk.

 

The error is:

 

-------------------------------------------------------------------------------------------------------------------

 

bfin_demux_mac_status_irq : arch/blackfin/mach-common/ints-priority.c : LINE 533 :

 

IRQ ?: MAC ERROR INTERRUPT ASSERTED BUT NO SOURCE FOUND

 

-------------------------------------------------------------------------------------------------------------------

 

It keeps spamming it over and over. (Doesn't finish the boot process.) Here's the strange thing: The trunk versions works perfectly fine on my revision 1 boards!!??

 

I've tested a few trunk versions:

 

9367 works!

 

9599 doesn't work

 

9782 doesn't work

 

I've tested both the 2009r1.1-2 toolchain and the trunk-toolchain. Same difference.

 

 

 

Can anyone explain what the error is about? Or even better does anyone know how to fix it?

QuoteReplyEditDelete

 

 

2010-08-20 06:46:10     uClinux_trunk doesn't work on BF526-0.2 EZBRD

Michael Hennerich (GERMANY)

Message: 92624    Just to confirm - you have two boards booting the same kernel on one it works on the other is doesn't?

 

In order to debug this - I would enable some more debug output:

 

Something like this:

 

Index: arch/blackfin/mach-common/ints-priority.c

===================================================================

--- arch/blackfin/mach-common/ints-priority.c (revision 9082)

+++ arch/blackfin/mach-common/ints-priority.c (working copy)

@@ -522,15 +522,16 @@

bfin_handle_irq(irq);

} else {

bfin_mac_status_ack_irq(irq);

- pr_debug("IRQ %d:"

+ printk("IRQ %d:"

" MASKED MAC ERROR INTERRUPT ASSERTED\n",

irq);

}

} else

printk(KERN_ERR

"%s : %s : LINE %d :\nIRQ ?: MAC ERROR"

- " INTERRUPT ASSERTED BUT NO SOURCE FOUND\n",

- __func__, __FILE__, __LINE__);

+ " INTERRUPT ASSERTED BUT NO SOURCE FOUND (status 0x%X)\n",

+ __func__, __FILE__, __LINE__, status);

+

}

#endif

 

Please post the result.

QuoteReplyEditDelete

 

 

2010-08-20 07:14:40     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Morten Kvistgaard (DENMARK)

Message: 92625   

 

Yes, two boards booting the same kernel. A BF526 rev. 1 and a BF526 rev. 2. It works on rev. 1 it doesn't work on rev. 2. We actually didn't knew that we had 2 different BF revisions before this. (It's the only difference we can find.) I've confirmed the error on several (all) BF526 rev. 2 boards.

 

I've also tried compiling for the exact processor revision. Doesn't make a difference.

 

 

 

The modified debug output now says:

 

----------------------------------------------------------------------------------------------------------------------

 

bfin_demux_mac_status_irq : arch/blackfin/mach-common/ints-priority.c : LINE 533 :

 

IRQ ?: MAC ERROR INTERRUPT ASSERTED BUT NO SOURCE FOUND (status 0x80)

----------------------------------------------------------------------------------------------------------------------

QuoteReplyEditDelete

 

 

2010-08-20 07:31:26     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Michael Hennerich (GERMANY)

Message: 92626    Getting closer:

 

Station management transfer done interrupt status (STMDONE)

This bit is set when a station management transfer on

MDC/MDIO has completed, provided the STAIE interrupt enable

control bit is set in the EMAC_STAADD register.

 

We don't set the STAIE interrupt enable bit.

Can you try this one, and post the output?

 

Index: arch/blackfin/mach-common/ints-priority.c

===================================================================

--- arch/blackfin/mach-common/ints-priority.c (revision 9082)

+++ arch/blackfin/mach-common/ints-priority.c (working copy)

@@ -522,15 +522,20 @@

bfin_handle_irq(irq);

} else {

bfin_mac_status_ack_irq(irq);

- pr_debug("IRQ %d:"

+ printk("IRQ %d:"

" MASKED MAC ERROR INTERRUPT ASSERTED\n",

irq);

}

} else

printk(KERN_ERR

"%s : %s : LINE %d :\nIRQ ?: MAC ERROR"

- " INTERRUPT ASSERTED BUT NO SOURCE FOUND\n",

- __func__, __FILE__, __LINE__);

+ " INTERRUPT ASSERTED BUT NO SOURCE FOUND (status 0x%X)\n",

+ __func__, __FILE__, __LINE__, status);

+

+ printk("EMAC_STAADD %x\n", bfin_read_EMAC_STAADD());

+ /* Some bits are W1C to ACK */

+ bfin_write_EMAC_SYSTAT(status);

+

}

#endif

QuoteReplyEditDelete

 

 

2010-08-20 08:03:11     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Michael Hennerich (GERMANY)

Message: 92627    Looking at this in more detail - was wondering why the handler didn't ack.

I found that the loop range is wrong.

 

But this doesn't explain why the interrupt fired in the first place.

 

Index: arch/blackfin/mach-common/ints-priority.c

===================================================================

--- arch/blackfin/mach-common/ints-priority.c (revision 9082)

+++ arch/blackfin/mach-common/ints-priority.c (working copy)

@@ -511,7 +511,7 @@

int i, irq = 0;

u32 status = bfin_read_EMAC_SYSTAT();

 

- for (i = 0; i < (IRQ_MAC_STMDONE - IRQ_MAC_PHYINT); i++)

+ for (i = 0; i <= (IRQ_MAC_STMDONE - IRQ_MAC_PHYINT); i++)

if (status & (1L << i)) {

irq = IRQ_MAC_PHYINT + i;

break;

@@ -529,8 +529,9 @@

} else

printk(KERN_ERR

"%s : %s : LINE %d :\nIRQ ?: MAC ERROR"

- " INTERRUPT ASSERTED BUT NO SOURCE FOUND\n",

- __func__, __FILE__, __LINE__);

+ " INTERRUPT ASSERTED BUT NO SOURCE FOUND"

+ "(EMAC_SYSTAT=0x%X)\n",

+ __func__, __FILE__, __LINE__, status);

}

#endif

QuoteReplyEditDelete

 

 

2010-08-20 08:21:52     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Morten Kvistgaard (DENMARK)

Message: 92630   

 

With the last piece of code (bfin_write_EMAC_SYSTAT), I'm now able to boot

 

 

 

The debug output now says the following:

 

----------------------------------------------------------------------------------------------------------------------

 

bfin_demux_mac_status_irq : arch/blackfin/mach-common/ints-priority.c : LINE 533 :

 

IRQ ?: MAC ERROR INTERRUPT ASSERTED BUT NO SOURCE FOUND (status 0x80)

 

EMAC_STAADD 948

 

----------------------------------------------------------------------------------------------------------------------

 

 

 

I've attached my whole boot sequence output.

 

BF526-0.2-boot.txt

QuoteReplyEditDelete

 

 

2010-08-20 08:30:07     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Michael Hennerich (GERMANY)

Message: 92632    Could it be that you use different u-boot versions on the two boards?

What u-boot versions are you using?

And did you made any modifications to them?

 

It looks like the STMDONE (Station Management

Transfer Done Interrupt) is asserted while booting into the kernel.

 

-Michael

QuoteReplyEditDelete

 

 

2010-08-20 08:31:55     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Morten Kvistgaard (DENMARK)

Message: 92633   

 

PS. Don't mind our memmap arguments in the boot sequence. They don't affect the error. (I've now removed them anyway though.)

QuoteReplyEditDelete

 

 

2010-08-20 08:44:21     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Morten Kvistgaard (DENMARK)

Message: 92635   

 

Now that you mention U-boot, yes I've upgraded the ones on our rev. 1 boards.

 

The rev. 1 are using

 

"U-Boot 2008.10 (ADI-2009R1.1-rc1) (Dec  4 2009 - 03:19:31)"

 

And the rev. 2 are using factory default, which is

 

"U-Boot 1.1.6-svn1417 (ADI-2009R1-pre) (Oct 17 2008 - 18:29:19)"

 

 

 

... I'll just try to upgrade the rev. 2 U-boot

QuoteReplyEditDelete

 

 

2010-08-20 08:49:46     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Michael Hennerich (GERMANY)

Message: 92636    > And the rev. 2 are using factory default, which is STAIE for some unknown reason ...

>

> "U-Boot 1.1.6-svn1417 (ADI-2009R1-pre) (Oct 17 2008 - 18:29:19)"

 

Here we go - bfin_mac driver in U-Boot 1.1.6 was setting

 

static void WrPHYReg(u16 PHYAddr, u16 RegAddr, u16 Data)

{

PollMdcDone();

 

*pEMAC_STADAT = Data;

 

*pEMAC_STAADD = SET_PHYAD(PHYAddr) | SET_REGAD(RegAddr) |

STAOP | STAIE | STABUSY;

}

 

Please update u-boot.

 

-Michael

QuoteReplyEditDelete

 

 

2010-08-20 09:02:43     Re: uClinux_trunk doesn't work on BF526-0.2 EZBRD

Morten Kvistgaard (DENMARK)

Message: 92637   

 

After upgrading the U-boot everything seems to work, with the trunk uClinux. (That's rather impressive insight you got, btw.)

 

Thank you.

Attachments

Outcomes