Teridian Phy Support tr78q21x3
Hello,
I?m using a at91sam9260 Microcontroller.
I added a Teridian Phy Driver (tr78q21x3) to the Uboot version 1.3.0 It works. (even in linux when I use the linux generic macb driver)
If I try to use the latest u-boot-version (1.3.3) with the macb driver - ethernet doesn?t work (in u-boot and linux).
I don?t know how to add my phy driver to the latest u-boot version !
Is anybody out there who would be able to insert the phy driver in the latest u-boot version (tree) - I would offer my driver for anybody...
Please reply
Thank you
Hello,
Quoted 6 lines · Manuel Sahm
I added a Teridian Phy Driver (tr78q21x3) to the Uboot version 1.3.0 It works. (even in linux when I use the linux generic macb driver)
If I try to use the latest u-boot-version (1.3.3) with the macb driver - ethernet doesn?t work (in u-boot and linux).
I don?t know how to add my phy driver to the latest u-boot version !
Maybe it is not a phy driver problem? Teridian phy 78q21x3 supports only MII mode. Reverse the following patch locally and check if ethernet works again:
Best regards,
Anatolij
Hello,
In the U-Boot 1.3.3 there is already this patch included....
But I see another problem:
I uses the AT91SAM9260 microcontroller so I defined in the header:
#define CONFIG_AT91SAM9260 1
Instead of the Davicom Phy (RMII), which is used in the DevBoard AT91SAM9260EK I want to use the Teridian Phy(MII), so I write in the header:
#undef CONFIG_RMII
Now have a look at the patch:
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+ defined(CONFIG_AT91SAM9263)
+ macb_writel(macb, USRIO, MACB_BIT(CLKEN));
#elsemacb_writel(macb, USRIO, MACB_BIT(MII));
#endif
I don?t go to the line : macb_writel(macb, USRIO, MACB_BIT(MII)); ,because of CONFIG_AT91SAM9260
BUT I have to go there or not ?
Thank you very much
Best regards
Manuel
Quoted 13 lines · Anatolij Gustschin
Hello,
Quoted 7 lines · Manuel Sahm
I added a Teridian Phy Driver (tr78q21x3) to the Uboot version 1.3.0 It works. (even in linux when I use the linux generic macb driver)
If I try to use the latest u-boot-version (1.3.3) with the macb driver - ethernet doesn?t work (in u-boot and linux).
I don?t know how to add my phy driver to the latest u-boot version !
Quoted 10 lines
Maybe it is not a phy driver problem? Teridian phy 78q21x3 supports only MII mode. Reverse the following patch locally and check if ethernet works again:
Best regards,
Anatolij
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080611/3ea0b495/attachment.htm
Hello,
Quoted 1 line · Manuel Sahm
In the U-Boot 1.3.3 there is already this patch included....
yes, of course this is already included. I meant you have to _reverse_ this patch (or in other words un-apply it, "patch -p1 -R"), as it was not included in U-Boot 1.3.0 and as you sad, with U-Boot 1.3.0 ethernet did work. Un-applying this patch and test without it could quickly show if MII mode configuration was your problem.
Quoted 22 lines
But I see another problem:
I uses the AT91SAM9260 microcontroller so I defined in the header:
#define
CONFIG_AT91SAM92601Instead of the Davicom Phy (RMII), which is used in the DevBoard AT91SAM9260EK I want to use the Teridian Phy(MII), so I write in the header:
#undef
CONFIG_RMIINow have a look at the patch:
+#if
defined(CONFIG_AT91CAP9)||defined(CONFIG_AT91SAM9260)|| \
+defined(CONFIG_AT91SAM9263)
+macb_writel(macb, USRIO, MACB_BIT(CLKEN));
#elsemacb_writel(macb, USRIO, MACB_BIT(MII));
#endif
Quoted 4 lines
I don?t go to the line :
macb_writel(macb, USRIO, MACB_BIT(MII)); ,because ofCONFIG_AT91SAM9260BUT I have to go there or not ?
Probably. If you un-apply the patch, you end up in something like this:
#ifdef CONFIG_RMII macb_writel(macb, USRIO, 0); #else macb_writel(macb, USRIO, MACB_BIT(MII));
#endif
and this is the macb.c code in U-Boot-1.3.0 (drivers/macb.c:419).
Best regards,
Anatolij
Signature · 3 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
Hello,
I found out, why the Generic MACB MII driver for the AT91SAM9260 doesn?t work.
The problem is inside the file
/board/atmel/at91sam9260ek/at91sam9260ek.c
at91_set_B_periph(AT91_PIN_PA23, 0); //ETX2at91_set_B_periph(AT91_PIN_PA24, 0); //ETX3
These lines are multiplexed with the TWI Interface of the AT91SAM9260 and on the development board (AT91SAM9260EK) there is an EEPROM connected. Instead of lines PA23 and PA24 you have to use
at91_set_B_periph(AT91_PIN_PA10, 0); //ETX2at91_set_B_periph(AT91_PIN_PA11, 0); //ETX3
which have the same abilites.
Then it works perfect !!!!!
Is it possible to change this in the official U-Boot tree ?
Hopefully someone from denx.de could do that and I hope for a positive reply - Thank you
Quoted 58 lines · Anatolij Gustschin
Hello,
Quoted 2 lines · Manuel Sahm
In the U-Boot 1.3.3 there is already this patch included....
yes, of course this is already included. I meant you have to _reverse_ this patch (or in other words un-apply it, "patch -p1 -R"), as it was not included in U-Boot 1.3.0 and as you sad, with U-Boot 1.3.0 ethernet did work. Un-applying this patch and test without it could quickly show if MII mode configuration was your problem.
Quoted 22 lines
But I see another problem:
I uses the AT91SAM9260 microcontroller so I defined in the header:
#define
CONFIG_AT91SAM92601Instead of the Davicom Phy (RMII), which is used in the DevBoard AT91SAM9260EK I want to use the Teridian Phy(MII), so I write in the header:
#undef
CONFIG_RMIINow have a look at the patch:
+#if
defined(CONFIG_AT91CAP9)||defined(CONFIG_AT91SAM9260)|| \
+defined(CONFIG_AT91SAM9263)
+macb_writel(macb, USRIO, MACB_BIT(CLKEN));
#elsemacb_writel(macb, USRIO, MACB_BIT(MII));
#endifQuoted 5 lines
I don?t go to the line :
macb_writel(macb, USRIO, MACB_BIT(MII)); ,because ofCONFIG_AT91SAM9260BUT I have to go there or not ?
Probably. If you un-apply the patch, you end up in something like this:
#ifdef CONFIG_RMII macb_writel(macb, USRIO, 0); #else macb_writel(macb, USRIO, MACB_BIT(MII));#endif
and this is the
macb.ccode in U-Boot-1.3.0 (drivers/macb.c:419).Best regards,
Anatolij
Quoted 3 lines · In message <[email protected]> you wrote:
I found out, why the Generic MACB MII driver for the AT91SAM9260 doesn?t work.
...
Quoted 6 lines
Instead of lines PA23 and PA24 you have to use
at91_set_B_periph(AT91_PIN_PA10, 0); //ETX2at91_set_B_periph(AT91_PIN_PA11, 0); //ETX3which have the same abilites.
can you please submit a proper patch?
See http://www.denx.de/wiki/UBoot/Patches for instructions.
Quoted 2 lines
Hopefully someone from denx.de could do that and I hope for a positive reply - Thank you
This will behandled by the AT91 custodian - but please submit a proper patch...
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de He'd been wrong, there _was_ a light at the end of the tunnel, and it was a flamethrower. - Terry Pratchett, _Mort_
PATCH 1/1 at91: Fix to enable using Teridian MII phy (78Q21x3) with at91sam9260
In reply to Manuel SahmOn the at91sam9260ep development board there is an EEPROM connected to the TWI interface (PA23, PA24 Peripheral A multiplexing), so we cannot use these pins as ETX2, ETX3. This patch configures PA10, PA11 pins for ETX2, ETX3 instead of PA23, PA24 pins.
---
Hi Manuel,
Wolfgang Denk asked you in another email for a proper patch to fix this issue so that this could be reviewed on the list and applied by AT91 custodian. Now I created this patch and a patch description, but I'm not familiar with at91sam9260 and also do not have an at91sam9260ep board and cannot test it.
Could you please test this patch and probably fix the patch description. I composed this description from info in your mails, but I'm not sure if it is really correct. Also add your "Signed-off-by" line.
board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
board/atmel/at91sam9260ek/at91sam9260ek.c +9 -0
@@ -188,8 +188,17 @@ static void at91sam9260ek_macb_hw_init(void)at91_set_B_periph (AT91_PIN_PA25 ,0 );/* ERX2 */ at91_set_B_periph (AT91_PIN_PA26 ,0 );/* ERX3 */ at91_set_B_periph (AT91_PIN_PA27 ,0 );/* ERXCK */ +#if defined(CONFIG_AT91SAM9260EK ) +/* +* use PA10, PA11 for ETX2, ETX3. +* PA23 and PA24 are for TWI EEPROM +*/ +at91_set_B_periph (AT91_PIN_PA10 ,0 );/* ETX2 */ +at91_set_B_periph (AT91_PIN_PA11 ,0 );/* ETX3 */ +#else at91_set_B_periph (AT91_PIN_PA23 ,0 );/* ETX2 */ at91_set_B_periph (AT91_PIN_PA24 ,0 );/* ETX3 */ +#endif at91_set_B_periph (AT91_PIN_PA22 ,0 );/* ETXER */ #endif
Signature · 6 lines
Best regards, Anatolij DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
PATCH 1/1 at91: Fix to enable using Teridian MII phy (78Q21x3) with at91sam9260
In reply to a message not in the archiveQuoted 11 lines · Manuel Sahm
if I apply the patch with:
patch -p1 < patchat91.diff
some messages occur, is this correct ?
(Stripping trailing CRs from patch.)
patching fileboard/atmel/at91sam9260ek/at91sam9260ek.cpatch unexpectedly ends in middle of line
Hunk #1 succeeded at 183 with fuzz 2 (offset -5 lines).
it is very likely that these messages occur because the patch was incorrectly saved from the email body. This patch applies cleanly against top of our u-boot git tree.
Quoted 6 lines
The description is correct - PA23 and PA24 are connected to the TWI EEPROM an the DevBoard at91sam9260ek.
The patch works well.
Here the signed-off line:Signed-off-by Manuel Sahm <[email protected]>
Thanks, I will repost the patch again.
Quoted 4 lines
Another problem is, that the same error is in the official kernel tree in the file
at91sam9260ek_devices.c?!
Although the error is still in the kernel, a modification of the uboot fileat91sam9260ek.cis enough to get ethernet working ?
if the kernel resets Peripheral B pin configuration, then ethernet will stop working, I think. This should be fixed in the kernel code, too.
Best regards,
Anatolij
PATCH v2 1/1 at91: Fix to enable using Teridian MII phy (78Q21x3) with at91sam9260
In reply to Anatolij GustschinOn the at91sam9260ep development board there is an EEPROM connected to the TWI interface (PA23, PA24 Peripheral A multiplexing), so we cannot use these pins as ETX2, ETX3. This patch configures PA10, PA11 pins for ETX2, ETX3 instead of PA23, PA24 pins.
--- board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
board/atmel/at91sam9260ek/at91sam9260ek.c +9 -0
@@ -188,8 +188,17 @@ static void at91sam9260ek_macb_hw_init(void)at91_set_B_periph (AT91_PIN_PA25 ,0 );/* ERX2 */ at91_set_B_periph (AT91_PIN_PA26 ,0 );/* ERX3 */ at91_set_B_periph (AT91_PIN_PA27 ,0 );/* ERXCK */ +#if defined(CONFIG_AT91SAM9260EK ) +/* +* use PA10, PA11 for ETX2, ETX3. +* PA23 and PA24 are for TWI EEPROM +*/ +at91_set_B_periph (AT91_PIN_PA10 ,0 );/* ETX2 */ +at91_set_B_periph (AT91_PIN_PA11 ,0 );/* ETX3 */ +#else at91_set_B_periph (AT91_PIN_PA23 ,0 );/* ETX2 */ at91_set_B_periph (AT91_PIN_PA24 ,0 );/* ETX3 */ +#endif at91_set_B_periph (AT91_PIN_PA22 ,0 );/* ETXER */ #endif
Signature · 1 line
1.5.3.3
PATCH v2 1/1 at91: Fix to enable using Teridian MII phy (78Q21x3) with at91sam9260
Quoted 17 lines · Anatolij Gustschin
On the at91sam9260ep development board there is an EEPROM connected to the TWI interface (PA23, PA24 Peripheral A multiplexing), so we cannot use these pins as ETX2, ETX3. This patch configures PA10, PA11 pins for ETX2, ETX3 instead of PA23, PA24 pins.
Signed-off-by Anatolij Gustschin <[email protected]>Signed-off-by Manuel Sahm <[email protected]>--- board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)board/atmel/at91sam9260ek/at91sam9260ek.c +0
-0
board/atmel/at91sam9260ek/at91sam9260ek.c static void at91sam9260ek_macb_hw_init(void) · line 192
Quoted 5 lines
board/atmel/at91sam9260ek/at91sam9260ek.c +1
-0@@ -188,8 +188,17 @@ static void at91sam9260ek_macb_hw_init(void)at91_set_B_periph (AT91_PIN_PA25 ,0 );/* ERX2 */ at91_set_B_periph (AT91_PIN_PA26 ,0 );/* ERX3 */ at91_set_B_periph (AT91_PIN_PA27 ,0 );/* ERXCK */ +#if defined(CONFIG_AT91SAM9260EK )
There's a weakness in your software architecture if there are two compile paths in 'at91sam9260ek.c': one that has CONFIG_AT91SAM9260EK and one that doesn't. Maybe time for a new board variant or some file re-naming?
regards,
Ben
PATCH 1/1 at91: Fix to enable using Teridian MII phy (78Q21x3) with at91sam9260
In reply to Anatolij GustschinHello,
thanks a lot.
Could you please take care that this will be fixed in the kernel code, too ?
Best regards
Manuel Sahm
Quoted 38 lines · Anatolij Gustschin
Quoted 4 lines · Manuel Sahm
if I apply the patch with:
patch -p1 < patchat91.diff
Quoted 8 lines
some messages occur, is this correct ?
(Stripping trailing CRs from patch.)
patching fileboard/atmel/at91sam9260ek/at91sam9260ek.cpatch unexpectedly ends in middle of line
Hunk #1 succeeded at 183 with fuzz 2 (offset -5 lines).it is very likely that these messages occur because the patch was incorrectly saved from the email body. This patch applies cleanly against top of our u-boot git tree.
Quoted 7 lines
The description is correct - PA23 and PA24 are connected to the TWI EEPROM an the DevBoard at91sam9260ek.
The patch works well.
Here the signed-off line:Signed-off-by Manuel Sahm <[email protected]>Thanks, I will repost the patch again.
Quoted 5 lines
Another problem is, that the same error is in the official kernel tree in the file
at91sam9260ek_devices.c?!
Although the error is still in the kernel, a modification of the uboot fileat91sam9260ek.cis enough to get ethernet working ?
Quoted 8 lines
if the kernel resets Peripheral B pin configuration, then ethernet will stop working, I think. This should be fixed in the kernel code, too.
Best regards,
Anatolij
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080710/cf222fee/attachment.htm
Wolfgang Denk
AppliedPATCH v2 1/1 at91: Fix to enable using Teridian MII phy (78Q21x3) with at91sam9260
In reply to Anatolij GustschinQuoted 11 lines · In message <[email protected]> you wrote:
On the at91sam9260ep development board there is an EEPROM connected to the TWI interface (PA23, PA24 Peripheral A multiplexing), so we cannot use these pins as ETX2, ETX3. This patch configures PA10, PA11 pins for ETX2, ETX3 instead of PA23, PA24 pins.
Signed-off-by Anatolij Gustschin <[email protected]>Signed-off-by Manuel Sahm <[email protected]>--- board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Oh dear, I think you'll find reality's on the blink again." - Marvin The Paranoid Android