public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Ethernet not found on Arria 5.
Date: Mon, 21 Mar 2016 12:18:18 +0100	[thread overview]
Message-ID: <56EFD87A.90208@denx.de> (raw)
In-Reply-To: <BFEE4BD273371E48B6EB70F96CEC5B54040E5FDC@DEMUMBX007.nsn-intra.net>

On 03/21/2016 09:16 AM, Bakhvalov, Denis (Nokia - PL/Wroclaw) wrote:
> Hi,

Hi!

> I solved the Ethernet problem on our board.
> 
> The problem was in the register below:
> 
> Link: http://wl.altera.com/literature/hb/arria-v/hps.html#topic/sfo1410067853518.html
> Registers used by the EMACs. All fields are reset by a cold or warm reset.
> Module Instance	Base Address	Register Address
> sysmgr	0xFFD08000	0xFFD08060

Thanks for looking into it, try if the attached patch works for you.
Make sure you have correct phy-mode = "gmii"; DT node specified for
the GMAC you use, Arria V SoCDK surely uses phy-mode = "rgmii";

> I found that difference while comparing the dumps between OK and NOK cases.
> 
> In new U-Boot (2016) the values of 
> ctrl :: physel_0
> ctrl :: physel_1
> were always set to 
> 0x1	Select RGMII PHY interface
> 
> I changed this value to 
> 0x0	Select GMII/MII PHY interface

[...]

> But still I have this sort of question:
> Why those two registers are always assigned to RGMII PHY interface (and default value is 0x2 	Select RMII PHY interface)?
> In current code there is no way to change this value.

Most likely because noone ever had a board with PHY connected over
anything else but RGMII, so this went unnoticed.

> I changed it like this:
> 
> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
> old mode 100644
> new mode 100755
> index 9b43b92..295ed5a
> --- a/arch/arm/mach-socfpga/misc.c
> +++ b/arch/arm/mach-socfpga/misc.c
> @@ -23,6 +23,8 @@
> 
> @@ -97,14 +99,19 @@ static void dwmac_deassert_reset(const unsigned int of_reset_id)
>                      SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << physhift);
> 
>         /* configure to PHY interface select choosed */
> +#ifdef CONFIG_WORKAROUND
> +       setbits_le32(&sysmgr_regs->emacgrp_ctrl,
> +                    SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII << physhift);
> +#else
>         setbits_le32(&sysmgr_regs->emacgrp_ctrl,
>                     SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII << physhift);
> +#endif
> 
>         /* Release the EMAC controller from reset */
>         socfpga_per_reset(reset, 0);
>  }
> 
> Please evaluate my correction.
> Maybe we can assign ctrl :: physel_0 and ctrl :: physel_1 based on some switch in config?

We should parse the OF node phy-mode, which describes which mode your
PHY uses. If your DT is written correctly, then with the attached patch,
any PHY mode should work.

> Best regards,
> Denis Bakhvalov
> 


-- 
Best regards,
Marek Vasut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-arm-socfpga-Handle-phy-mode-OF-property-for-GMACs.patch
Type: text/x-patch
Size: 2868 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160321/930e3d3f/attachment.bin>

  reply	other threads:[~2016-03-21 11:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04  9:20 [U-Boot] Ethernet not found on Arria 5 Bakhvalov, Denis
2016-03-04 12:30 ` Marek Vasut
2016-03-04 12:53   ` Bakhvalov, Denis
2016-03-05 12:36     ` Marek Vasut
2016-03-08  9:58       ` Bakhvalov, Denis
2016-03-09  9:22       ` Bakhvalov, Denis
2016-03-09 13:47         ` Marek Vasut
2016-03-09 14:00           ` Bakhvalov, Denis
2016-03-09 21:40             ` Dinh Nguyen
2016-03-10  0:25               ` Marek Vasut
2016-03-10  8:58                 ` Bakhvalov, Denis
2016-03-10 12:43                   ` Marek Vasut
2016-03-10 17:19                     ` Bakhvalov, Denis
2016-03-21  8:16                     ` Bakhvalov, Denis
2016-03-21 11:18                       ` Marek Vasut [this message]
2016-03-21 12:34                         ` Bakhvalov, Denis
2016-03-21 12:39                           ` Marek Vasut
2016-03-10 14:16                 ` Dinh Nguyen
2016-03-21  8:30       ` Bakhvalov, Denis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56EFD87A.90208@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox