Skip to contentSkip to conversation

quit unclear code in cpu/arm920t/at91rm9200/ether.c Line:220

U-Boot-Users Udo Jakobza 4 participants 5 messages Apr 27, 2006 – May 2, 2006

lore
Share & tools
lore
#0 lore raw

Hello,

inside of arm_init() in the part:

/* MII management start from here */

if (!(p_mac->EMAC_SR & AT91C_EMAC_LINK)) {
		if (!(ret = PhyOps.Init (p_mac))) {
			printf ("MAC: error during MII initialization\n");
			return 0;
		} 
	}

the software checks the status of a LINK-Bit. I thing the EMAC_SR register is wrong, because the EMAC_ISR has this valid LINK bit (AT91C_EMAC_LINK on bit 9).

Did anybody find this problem?
If not, so I will check it with our hardware and then I will prepare a patch.

Thanks and Regards

Udo
Forschungs- und Transferzentrum Leipzig e. V.
an der HTWK Leipzig
Udo Jakobza
W?chterstr. 13
04107 Leipzig
Tel: +49(0)341 3076 1136
Fax: +49(0)341 3076 1220

#1 lore raw

Udo Jakobza ha scritto:

Quoted 4 lines

Hello,

inside of arm_init() in the part:

Quoted 8 lines

/* MII management start from here */

if (!(p_mac->EMAC_SR & AT91C_EMAC_LINK)) {
		if (!(ret = PhyOps.Init (p_mac))) {
			printf ("MAC: error during MII initialization\n");
			return 0;
		}
	}

the software checks the status of a LINK-Bit. I thing the EMAC_SR

register is wrong, because the EMAC_ISR has this valid LINK bit

Quoted 4 lines

(AT91C_EMAC_LINK on bit 9).

Did anybody find this problem?
If not, so I will check it with our hardware and then I will prepare

a patch.

Quoted 1 line

You are right.
I am facing to this annoying error message too
"MAC: error during MII initialization"
when forcing the MAC adress into u-boot if I do not u-boot networking.

A patch will be greatly appreciated ;-) Thank you

Signature · 4 lines
Marco Cavallini
Koan s.a.s. - Bergamo - ITALIA
Embedded and Real-Time Software Engineering
www.koansoftware.com    |    www.klinux.org
#2 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

I am facing to this annoying error message too
"MAC: error during MII initialization"
when forcing the MAC adress into u-boot if I do not u-boot networking.

Don't do it, then.

There is no need to set the MAC addres when NOT using the network in U-Boot. See the FAQ.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If all you have is a hammer, everything looks like a nail.
#3 lore raw
In reply to Udo Jakobza
Quoted 11 lines · Udo Jakobza

Hello,

inside of arm_init() in the part:

/* MII management start from here */

if (!(p_mac->EMAC_SR & AT91C_EMAC_LINK)) {
		if (!(ret = PhyOps.Init (p_mac))) {
			printf ("MAC: error during MII initialization\n");
			return 0;
		}
	}
Quoted 5 lines

the software checks the status of a LINK-Bit. I thing the EMAC_SR register is wrong, because the EMAC_ISR has this valid LINK bit (AT91C_EMAC_LINK on bit 9).

Did anybody find this problem?
If not, so I will check it with our hardware and then I will prepare a patch.

Yes, that code is wrong. The line:

if (!(p_mac->EMAC_SR & AT91C_EMAC_LINK)) {

makes no sense and always returns true. IMHO we should remove it completely and always run the PhyOps.Init function. Checking on the EMAC_ISR register is also wrong since it indicates link changes and is AFAIK phy dependent and needs to have interrupts enabled.

On most at91rm9200 based systems I have worked on, I do not have link yet when PhyOps.Init is called. So I have added a small loop in my phy code waiting for link before returning (max 5 seconds).

Regards
Lars Munch

#4 lore raw
Quoted 9 lines · In message <[email protected]> you wrote:

makes no sense and always returns true. IMHO we should remove it completely and always run the PhyOps.Init function. Checking on the EMAC_ISR register is also wrong since it indicates link changes and is AFAIK phy dependent and needs to have interrupts enabled.

On most at91rm9200 based systems I have worked on, I do not have link yet when PhyOps.Init is called. So I have added a small loop in my phy code waiting for link before returning (max 5 seconds).

Maybe you can submit a patch?

Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the realm of scientific observation, luck is granted only to those
who are prepared.                                     - Louis Pasteur