[U-Boot-Users] 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,
Manuel Sahm wrote:
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:
http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blobdiff_plain;f=driver...
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)); #else macb_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
Anatolij Gustschin schrieb:
Hello,
Manuel Sahm wrote:
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:
http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blobdiff_plain;f=driver...
Best regards, Anatolij

Hello,
Manuel Sahm wrote:
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.
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));
#else macb_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 ?
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

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); //ETX2 at91_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); //ETX2 at91_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
Anatolij Gustschin schrieb:
Hello,
Manuel Sahm wrote:
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.
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));
#else macb_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 ?
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

In message 4858BB99.8020703@feig.de you wrote:
I found out, why the Generic MACB MII driver for the AT91SAM9260 doesn´t work.
...
Instead of lines PA23 and PA24 you have to use
at91_set_B_periph(AT91_PIN_PA10, 0); //ETX2 at91_set_B_periph(AT91_PIN_PA11, 0); //ETX3
which have the same abilites.
can you please submit a proper patch?
See http://www.denx.de/wiki/UBoot/Patches for instructions.
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

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 agust@denx.de ---
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(-)
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c index 836a0c4..06d8512 100644 --- a/board/atmel/at91sam9260ek/at91sam9260ek.c +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c @@ -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

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 agust@denx.de Signed-off-by: Manuel Sahm Manuel.Sahm@feig.de --- board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c index 836a0c4..06d8512 100644 --- a/board/atmel/at91sam9260ek/at91sam9260ek.c +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c @@ -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

Anatolij Gustschin 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 agust@denx.de Signed-off-by: Manuel Sahm Manuel.Sahm@feig.de
board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c index 836a0c4..06d8512 100644 --- a/board/atmel/at91sam9260ek/at91sam9260ek.c +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c @@ -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

In message 4875467E.1080900@denx.de 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 agust@denx.de Signed-off-by: Manuel Sahm Manuel.Sahm@feig.de
board/atmel/at91sam9260ek/at91sam9260ek.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (4)
-
Anatolij Gustschin
-
Ben Warren
-
Manuel Sahm
-
Wolfgang Denk