mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/1] sama5d3xek: add GEM Gigabig support
@ 2013-02-08  9:25 Jean-Christophe PLAGNIOL-VILLARD
  2013-02-08  9:28 ` [For master PATCH 1/1] sama5de3k: add gmacb support Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-08  9:25 UTC (permalink / raw)
  To: barebox; +Cc: Nicolas Ferre

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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [For master PATCH 1/1] sama5de3k: add gmacb support
  2013-02-08  9:25 [PATCH 0/1] sama5d3xek: add GEM Gigabig support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-08  9:28 ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-08 10:24   ` Nicolas Ferre
  2013-02-11  8:30   ` Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-08  9:28 UTC (permalink / raw)
  To: barebox; +Cc: Nicolas Ferre

Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/sama5d3xek/init.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boards/sama5d3xek/init.c b/arch/arm/boards/sama5d3xek/init.c
index 110a83f..d17e4c2 100644
--- a/arch/arm/boards/sama5d3xek/init.c
+++ b/arch/arm/boards/sama5d3xek/init.c
@@ -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
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [For master PATCH 1/1] sama5de3k: add gmacb support
  2013-02-08  9:28 ` [For master PATCH 1/1] sama5de3k: add gmacb support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-08 10:24   ` Nicolas Ferre
  2013-02-11  8:30   ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Ferre @ 2013-02-08 10:24 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On 02/08/2013 10:28 AM, Jean-Christophe PLAGNIOL-VILLARD :
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/sama5d3xek/init.c |   31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/arch/arm/boards/sama5d3xek/init.c b/arch/arm/boards/sama5d3xek/init.c
> index 110a83f..d17e4c2 100644
> --- a/arch/arm/boards/sama5d3xek/init.c
> +++ b/arch/arm/boards/sama5d3xek/init.c
> @@ -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
> 


-- 
Nicolas Ferre

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [For master PATCH 1/1] sama5de3k: add gmacb support
  2013-02-08  9:28 ` [For master PATCH 1/1] sama5de3k: add gmacb support Jean-Christophe PLAGNIOL-VILLARD
  2013-02-08 10:24   ` Nicolas Ferre
@ 2013-02-11  8:30   ` Sascha Hauer
  2013-02-11 11:35     ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2013-02-11  8:30 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Nicolas Ferre

On Fri, Feb 08, 2013 at 10:28:44AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/sama5d3xek/init.c |   31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 

Applied, thanks.

> +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;

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

> +}
> +
>  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
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [For master PATCH 1/1] sama5de3k: add gmacb support
  2013-02-11  8:30   ` Sascha Hauer
@ 2013-02-11 11:35     ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-11 12:14       ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-11 11:35 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Nicolas Ferre

On 09:30 Mon 11 Feb     , Sascha Hauer wrote:
> On Fri, Feb 08, 2013 at 10:28:44AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  arch/arm/boards/sama5d3xek/init.c |   31 +++++++++++++++++++++++++++++++
> >  1 file changed, 31 insertions(+)
> > 
> 
> Applied, thanks.
> 
> > +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;
> 
> 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.
> 
> Sascha
> 
> > +}
> > +
> >  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
> > -- 
> > 1.7.10.4
> > 
> > 
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> > 
> 
> -- 
> 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [For master PATCH 1/1] sama5de3k: add gmacb support
  2013-02-11 11:35     ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-11 12:14       ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2013-02-11 12:14 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Nicolas Ferre

On Mon, Feb 11, 2013 at 12:35:19PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 09:30 Mon 11 Feb     , Sascha Hauer wrote:
> > On Fri, Feb 08, 2013 at 10:28:44AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > ---
> > >  arch/arm/boards/sama5d3xek/init.c |   31 +++++++++++++++++++++++++++++++
> > >  1 file changed, 31 insertions(+)
> > > 
> > 
> > Applied, thanks.
> > 
> > > +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;
> > 
> > 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

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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-11 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08  9:25 [PATCH 0/1] sama5d3xek: add GEM Gigabig support Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:28 ` [For master PATCH 1/1] sama5de3k: add gmacb support Jean-Christophe PLAGNIOL-VILLARD
2013-02-08 10:24   ` Nicolas Ferre
2013-02-11  8:30   ` Sascha Hauer
2013-02-11 11:35     ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-11 12:14       ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox