* [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable
2015-12-16 13:50 [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable Gregory CLEMENT
@ 2015-12-16 14:04 ` Nicolas Ferre
2015-12-16 21:06 ` Joe Hershberger
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Nicolas Ferre @ 2015-12-16 14:04 UTC (permalink / raw)
To: u-boot
Le 16/12/2015 14:50, Gregory CLEMENT a ?crit :
> During the initialization of PHY the gigabit bit capable is set if the
> controller is a GEM. However, for sama5d2 and sama5d4, the GEM is
> configured to support only 10/100.
>
> Improperly setting the GBE capability leads to an unresponsive MAC
> controller. This patch fixes this behavior allowing using the gmac with
> these SoCs.
>
> Suggested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks,
> ---
> Hi,
>
> in this v3, I fixed the sama5d2 typo and the missing brace.
>
> I also took care of the cpu_is_* symbols which may not be defined
> depending of the choice of the SoC.
>
> Gregory
>
> drivers/net/macb.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index a5c1880..e801313 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -109,6 +109,23 @@ static int macb_is_gem(struct macb_device *macb)
> return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2;
> }
>
> +#ifndef cpu_is_sama5d2
> +#define cpu_is_sama5d2() 0
> +#endif
> +
> +#ifndef cpu_is_sama5d4
> +#define cpu_is_sama5d4() 0
> +#endif
> +
> +static int gem_is_gigabit_capable(struct macb_device *macb)
> +{
> + /*
> + * The GEM controllers embeded in SAMA5D2 and SAMA5D4 are
> + * configured to support only 10/100.
> + */
> + return macb_is_gem(macb) && !cpu_is_sama5d2() && !cpu_is_sama5d4();
> +}
> +
> static void macb_mdio_write(struct macb_device *macb, u8 reg, u16 value)
> {
> unsigned long netctl;
> @@ -480,8 +497,8 @@ static int macb_phy_init(struct macb_device *macb)
> return 0;
> }
>
> - /* First check for GMAC */
> - if (macb_is_gem(macb)) {
> + /* First check for GMAC and that it is GiB capable */
> + if (gem_is_gigabit_capable(macb)){
> lpa = macb_mdio_read(macb, MII_STAT1000);
>
> if (lpa & (LPA_1000FULL | LPA_1000HALF)) {
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable
2015-12-16 13:50 [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable Gregory CLEMENT
2015-12-16 14:04 ` Nicolas Ferre
@ 2015-12-16 21:06 ` Joe Hershberger
2016-01-24 21:53 ` Andreas Bießmann
2016-01-27 13:00 ` [U-Boot] [U-Boot, " Andreas Bießmann
3 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2015-12-16 21:06 UTC (permalink / raw)
To: u-boot
On Wed, Dec 16, 2015 at 7:50 AM, Gregory CLEMENT
<gregory.clement@free-electrons.com> wrote:
> During the initialization of PHY the gigabit bit capable is set if the
> controller is a GEM. However, for sama5d2 and sama5d4, the GEM is
> configured to support only 10/100.
>
> Improperly setting the GBE capability leads to an unresponsive MAC
> controller. This patch fixes this behavior allowing using the gmac with
> these SoCs.
>
> Suggested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
It's a shame we are forced to have this PID hack, but I guess this
will do until we discover some other sustainable way.
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable
2015-12-16 13:50 [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable Gregory CLEMENT
2015-12-16 14:04 ` Nicolas Ferre
2015-12-16 21:06 ` Joe Hershberger
@ 2016-01-24 21:53 ` Andreas Bießmann
2016-01-27 13:00 ` [U-Boot] [U-Boot, " Andreas Bießmann
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Bießmann @ 2016-01-24 21:53 UTC (permalink / raw)
To: u-boot
On 16.12.15 14:50, Gregory CLEMENT wrote:
> During the initialization of PHY the gigabit bit capable is set if the
> controller is a GEM. However, for sama5d2 and sama5d4, the GEM is
> configured to support only 10/100.
>
> Improperly setting the GBE capability leads to an unresponsive MAC
> controller. This patch fixes this behavior allowing using the gmac with
> these SoCs.
>
> Suggested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Reviewed-by: Andreas Bie?mann <andreas.devel@googlemail.com>
> ---
> Hi,
>
> in this v3, I fixed the sama5d2 typo and the missing brace.
>
> I also took care of the cpu_is_* symbols which may not be defined
> depending of the choice of the SoC.
>
> Gregory
>
> drivers/net/macb.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index a5c1880..e801313 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -109,6 +109,23 @@ static int macb_is_gem(struct macb_device *macb)
> return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2;
> }
>
> +#ifndef cpu_is_sama5d2
> +#define cpu_is_sama5d2() 0
> +#endif
> +
> +#ifndef cpu_is_sama5d4
> +#define cpu_is_sama5d4() 0
> +#endif
> +
> +static int gem_is_gigabit_capable(struct macb_device *macb)
> +{
> + /*
> + * The GEM controllers embeded in SAMA5D2 and SAMA5D4 are
> + * configured to support only 10/100.
> + */
> + return macb_is_gem(macb) && !cpu_is_sama5d2() && !cpu_is_sama5d4();
> +}
> +
> static void macb_mdio_write(struct macb_device *macb, u8 reg, u16 value)
> {
> unsigned long netctl;
> @@ -480,8 +497,8 @@ static int macb_phy_init(struct macb_device *macb)
> return 0;
> }
>
> - /* First check for GMAC */
> - if (macb_is_gem(macb)) {
> + /* First check for GMAC and that it is GiB capable */
> + if (gem_is_gigabit_capable(macb)){
> lpa = macb_mdio_read(macb, MII_STAT1000);
>
> if (lpa & (LPA_1000FULL | LPA_1000HALF)) {
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-Boot, v3] net: macb: Not all the GEM are gigabit capable
2015-12-16 13:50 [U-Boot] [PATCH v3] net: macb: Not all the GEM are gigabit capable Gregory CLEMENT
` (2 preceding siblings ...)
2016-01-24 21:53 ` Andreas Bießmann
@ 2016-01-27 13:00 ` Andreas Bießmann
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Bießmann @ 2016-01-27 13:00 UTC (permalink / raw)
To: u-boot
Dear Gregory CLEMENT,
Gregory CLEMENT <gregory.clement@free-electrons.com> writes:
>During the initialization of PHY the gigabit bit capable is set if the
>controller is a GEM. However, for sama5d2 and sama5d4, the GEM is
>configured to support only 10/100.
>
>Improperly setting the GBE capability leads to an unresponsive MAC
>controller. This patch fixes this behavior allowing using the gmac with
>these SoCs.
>
>Suggested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>Acked-by: Joe Hershberger <joe.hershberger@ni.com>
>Reviewed-by: Andreas Bie?mann <andreas.devel@googlemail.com>
>[fixed minor checkpatch warning]
>Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
>---
>Hi,
>
>in this v3, I fixed the sama5d2 typo and the missing brace.
>
>I also took care of the cpu_is_* symbols which may not be defined
>depending of the choice of the SoC.
>
>Gregory
>
>drivers/net/macb.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
applied to u-boot-atmel/master, thanks!
Best regards,
Andreas Bie?mann
^ permalink raw reply [flat|nested] 5+ messages in thread