sama5d3xek: add GEM Gigabig support
cover sama5d3xek: add GEM Gigabig support
Hi,
This add the missing Gigabit support on sama5d3xek
This depend on
phy/micrel: KSZ9021 diasable Asym Pause support and the pull for GEM support
The following changes since commit 639cf1e0940506e152c2543bde7690fb3e57ca2a:
phy/micrel: KSZ9021 diasable Asym Pause support (2013-02-08 17:20:08 +0800)
are available in the git repository at:
git://git.jcrosoft.org/barebox.git delivery/sama5d3xek
for you to fetch changes up to 38b362a2dc6f878340c9298dd5484e5e55c8f453:
sama5de3k: add gmacb support (2013-02-08 17:20:44 +0800)
----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (1):
sama5de3k: add gmacb support
arch/arm/boards/sama5d3xek/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 sama5de3k: add gmacb support
--- arch/arm/boards/sama5d3xek/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
arch/arm/boards/sama5d3xek/init.c +31 -0
@@ -110,6 +110,11 @@ static void ek_add_device_nand(void) {}#endif #if defined(CONFIG_DRIVER_NET_MACB ) +static struct at91_ether_platform_data gmac_pdata = { + .phy_interface =PHY_INTERFACE_MODE_RGMII , + .phy_addr =7 , +}; +static struct at91_ether_platform_data macb_pdata = { .phy_interface =PHY_INTERFACE_MODE_RMII , .phy_addr = 0,
@@ -138,6 +143,28 @@ static int ek_register_mac_address_43(int id)return w1_local_mac_address_register (id,"tml" ,"w1-43-0" ); } +static int ksz9021rn_phy_fixup (struct phy_device *phy) +{ +int value; + +#define GMII_RCCPSR 260 +#define GMII_RRDPSR 261 +#define GMII_ERCR 11 +#define GMII_ERDWR 12 + +/* Set delay values */ + value =GMII_RCCPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0xF2F4 ; +phy_write (phy,GMII_ERDWR , value); + value =GMII_RRDPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0x2222 ; +phy_write (phy,GMII_ERDWR , value); + +return 0 ; +} +static void ek_add_device_eth (void ) {if (w1_local_mac_address_register (0 ,"tml" ,"w1-2d-0" ))
@@ -147,6 +174,10 @@ static void ek_add_device_eth(void)if (ek_register_mac_address_23 (1 ))ek_register_mac_address_43 (1 ); +phy_register_fixup_for_uid (PHY_ID_KSZ9021 ,MICREL_PHY_ID_MASK , + ksz9021rn_phy_fixup); + +at91_add_device_eth (0 , &gmac_pdata); at91_add_device_eth(1, &macb_pdata); }#else
Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [For master PATCH 1/1] sama5de3k: add gmacb support
On 02/08/2013 10:28 AM, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 1 line
Cc Nicolas Ferre <[email protected]>
Quoted 62 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/sama5d3xek/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)arch/arm/boards/sama5d3xek/init.c +31
-0@@ -110,6 +110,11 @@ static void ek_add_device_nand(void) {}#endif #if defined(CONFIG_DRIVER_NET_MACB ) +static struct at91_ether_platform_data gmac_pdata = { + .phy_interface =PHY_INTERFACE_MODE_RGMII , + .phy_addr =7 , +}; +static struct at91_ether_platform_data macb_pdata = { .phy_interface =PHY_INTERFACE_MODE_RMII , .phy_addr = 0,@@ -138,6 +143,28 @@ static int ek_register_mac_address_43(int id)return w1_local_mac_address_register (id,"tml" ,"w1-43-0" ); } +static int ksz9021rn_phy_fixup (struct phy_device *phy) +{ +int value; + +#define GMII_RCCPSR 260 +#define GMII_RRDPSR 261 +#define GMII_ERCR 11 +#define GMII_ERDWR 12 + +/* Set delay values */ + value =GMII_RCCPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0xF2F4 ; +phy_write (phy,GMII_ERDWR , value); + value =GMII_RRDPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0x2222 ; +phy_write (phy,GMII_ERDWR , value); + +return 0 ; +} +static void ek_add_device_eth (void ) {if (w1_local_mac_address_register (0 ,"tml" ,"w1-2d-0" ))@@ -147,6 +174,10 @@ static void ek_add_device_eth(void)if (ek_register_mac_address_23 (1 ))ek_register_mac_address_43 (1 ); +phy_register_fixup_for_uid (PHY_ID_KSZ9021 ,MICREL_PHY_ID_MASK , + ksz9021rn_phy_fixup); + +at91_add_device_eth (0 , &gmac_pdata); at91_add_device_eth(1, &macb_pdata); }#else
Signature · 6 lines
Nicolas Ferre _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedRe: [For master PATCH 1/1] sama5de3k: add gmacb support
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Cc Nicolas Ferre <[email protected]>Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/sama5d3xek/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
Applied, thanks.
Quoted 10 lines
arch/arm/boards/sama5d3xek/init.c +10
-0+static int ksz9021rn_phy_fixup (struct phy_device *phy) +{ +int value; + +#define GMII_RCCPSR 260 +#define GMII_RRDPSR 261 +#define GMII_ERCR 11 +#define GMII_ERDWR 12 + +/* Set delay values */
arch/arm/boards/sama5d3xek/init.c static int ek_register_mac_address_43(int id) · line 165
Quoted 10 lines
arch/arm/boards/sama5d3xek/init.c +10
-0+ value =GMII_RCCPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0xF2F4 ; +phy_write (phy,GMII_ERDWR , value); + value =GMII_RRDPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0x2222 ; +phy_write (phy,GMII_ERDWR , value); + +return 0 ;
This delay line setup really needs some generic code. We have this on i.MX6 aswell. Currently this means that each board needs to know the phy it has, not a really good situation.
Sascha
Quoted 25 lines
arch/arm/boards/sama5d3xek/init.c +6
-0+} +static void ek_add_device_eth (void ) {if (w1_local_mac_address_register (0 ,"tml" ,"w1-2d-0" ))@@ -147,6 +174,10 @@ static void ek_add_device_eth(void)if (ek_register_mac_address_23 (1 ))ek_register_mac_address_43 (1 ); +phy_register_fixup_for_uid (PHY_ID_KSZ9021 ,MICREL_PHY_ID_MASK , + ksz9021rn_phy_fixup); + +at91_add_device_eth (0 , &gmac_pdata); at91_add_device_eth(1, &macb_pdata); }#else Signature · 7 lines
1.7.10.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [For master PATCH 1/1] sama5de3k: add gmacb support
Quoted 26 lines · Sascha Hauer
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Cc Nicolas Ferre <[email protected]>Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/sama5d3xek/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)Applied, thanks.
Quoted 16 lines
arch/arm/boards/sama5d3xek/init.c +16
-0+static int ksz9021rn_phy_fixup (struct phy_device *phy) +{ +int value; + +#define GMII_RCCPSR 260 +#define GMII_RRDPSR 261 +#define GMII_ERCR 11 +#define GMII_ERDWR 12 + +/* Set delay values */ + value =GMII_RCCPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0xF2F4 ; +phy_write (phy,GMII_ERDWR , value); + value =GMII_RRDPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value);
Quoted 8 lines
arch/arm/boards/sama5d3xek/init.c static int ek_register_mac_address_43(int id) · line 165
Quoted 4 lines
arch/arm/boards/sama5d3xek/init.c +4
-0+ value =0x2222 ; +phy_write (phy,GMII_ERDWR , value); + +return 0 ;This delay line setup really needs some generic code. We have this on i.MX6 aswell. Currently this means that each board needs to know the phy it has, not a really good situation.
the pb that it's hardware specific (PCB layout) so I do not see how we can fix this
Best Regards,
J.
Quoted 23 lines
Sascha
Quoted 20 lines
arch/arm/boards/sama5d3xek/init.c +6
-0+} +static void ek_add_device_eth (void ) {if (w1_local_mac_address_register (0 ,"tml" ,"w1-2d-0" ))@@ -147,6 +174,10 @@ static void ek_add_device_eth(void)if (ek_register_mac_address_23 (1 ))ek_register_mac_address_43 (1 ); +phy_register_fixup_for_uid (PHY_ID_KSZ9021 ,MICREL_PHY_ID_MASK , + ksz9021rn_phy_fixup); + +at91_add_device_eth (0 , &gmac_pdata); at91_add_device_eth(1, &macb_pdata); }#else Signature · 1 line
1.7.10.4
Quoted 11 lines
Quoted 5 lines
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/bareboxSignature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [For master PATCH 1/1] sama5de3k: add gmacb support
Quoted 35 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 26 lines · Sascha Hauer
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Cc Nicolas Ferre <[email protected]>Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- arch/arm/boards/sama5d3xek/init.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)Applied, thanks.
Quoted 16 lines
arch/arm/boards/sama5d3xek/init.c +16
-0+static int ksz9021rn_phy_fixup (struct phy_device *phy) +{ +int value; + +#define GMII_RCCPSR 260 +#define GMII_RRDPSR 261 +#define GMII_ERCR 11 +#define GMII_ERDWR 12 + +/* Set delay values */ + value =GMII_RCCPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value); + value =0xF2F4 ; +phy_write (phy,GMII_ERDWR , value); + value =GMII_RRDPSR |0x8000 ; +phy_write (phy,GMII_ERCR , value);Quoted 8 lines
arch/arm/boards/sama5d3xek/init.c static int ek_register_mac_address_43(int id) · line 165
Quoted 4 lines
arch/arm/boards/sama5d3xek/init.c +4
-0+ value =0x2222 ; +phy_write (phy,GMII_ERDWR , value); + +return 0 ;This delay line setup really needs some generic code. We have this on i.MX6 aswell. Currently this means that each board needs to know the phy it has, not a really good situation.
Quoted 2 lines
the pb that it's hardware specific (PCB layout) so I do not see how we can fix this
The delay setup is PCB specific, but the register offsets/bits are phy specific.
I think we need a callback in the phy drivers to configure the delay lines, with values provided by the boards. I do not know the exact background of this issue, but I see more and more often that boards bang arbitrary values in the phy registers, and mostly this seems to be the configuration of these delay lines.
Currently we have the same problem in the kernel, so it should be fixed there aswell.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox