All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY
@ 2019-05-03  2:27 Chen-Yu Tsai
  2019-05-03  2:27 ` [U-Boot] [PATCH v3 1/2] sunxi: Enable EMAC on the Cubietruck Plus Chen-Yu Tsai
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2019-05-03  2:27 UTC (permalink / raw)
  To: u-boot

From: Chen-Yu Tsai <wens@csie.org>

Hi everyone,

This series enables EMAC (Ethernet controller) on two A83T boards,
the Cubietruck Plus and Bananapi M3.

This series is now based on sunxi/next, which has patches that convert
sun8i-emac to use the common CLK and DM_RESET framework.

The two patches enable the sun8i-emac and Realtek PHY driver in their
respective defconfigs. The device trees already have the EMAC enabled.
For the Bananapi M3, the regulator providing the I/O voltages is raised
to 3.3V.

This was tested with the "dhcp" command followed by using the "ping"
command to ping an external IP, in this case 8.8.8.8.

Regards
ChenYu

Changes in v3:
  - Rebased on sunxi/master

Changes in v2:
  - Dropped clk/reset related changes in favor of DM CLK / RESET support
  - Raised DLDO3 for RGMII I/O on Bananapi M3 to 3.3V per design

Chen-Yu Tsai (2):
  sunxi: Enable EMAC on the Cubietruck Plus
  sunxi: Enable EMAC on the Bananapi M3

 configs/Cubietruck_plus_defconfig | 2 ++
 configs/Sinovoip_BPI_M3_defconfig | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.20.1

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

* [U-Boot] [PATCH v3 1/2] sunxi: Enable EMAC on the Cubietruck Plus
  2019-05-03  2:27 [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Chen-Yu Tsai
@ 2019-05-03  2:27 ` Chen-Yu Tsai
  2019-05-03  2:27 ` [U-Boot] [PATCH v3 2/2] sunxi: Enable EMAC on the Bananapi M3 Chen-Yu Tsai
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2019-05-03  2:27 UTC (permalink / raw)
  To: u-boot

From: Chen-Yu Tsai <wens@csie.org>

The Cubietruck Plus has an RTL8211E PHY connected to the EMAC using
RGMII. The PHY is powered by DLDO4 @ 3.3V, while the I/O pins are
powered by DLDO3 @ 2.5V.

This patch enables the EMAC and Realtek PHY drivers in the defconfig.
The device tree file already has the EMAC enabled.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---

Changes in v3: None
Changes in v2: None

 configs/Cubietruck_plus_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig
index 869bffcfca0c..044af12779c6 100644
--- a/configs/Cubietruck_plus_defconfig
+++ b/configs/Cubietruck_plus_defconfig
@@ -20,6 +20,8 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-cubietruck-plus"
+CONFIG_PHY_REALTEK=y
+CONFIG_SUN8I_EMAC=y
 CONFIG_AXP_DLDO3_VOLT=2500
 CONFIG_AXP_DLDO4_VOLT=3300
 CONFIG_AXP_FLDO1_VOLT=1200
-- 
2.20.1

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

* [U-Boot] [PATCH v3 2/2] sunxi: Enable EMAC on the Bananapi M3
  2019-05-03  2:27 [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Chen-Yu Tsai
  2019-05-03  2:27 ` [U-Boot] [PATCH v3 1/2] sunxi: Enable EMAC on the Cubietruck Plus Chen-Yu Tsai
@ 2019-05-03  2:27 ` Chen-Yu Tsai
  2019-05-03  9:49 ` [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Jagan Teki
  2019-05-03 12:20 ` Jagan Teki
  3 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2019-05-03  2:27 UTC (permalink / raw)
  To: u-boot

From: Chen-Yu Tsai <wens@csie.org>

The Bananapi M3 has an RTL8211E PHY connected to the EMAC using
RGMII. The PHY is powered by DCDC1 through SW @ 3.3V.

The board is designed to use 3.3V with RGMII, instead of the standard
reduced voltage of 2.5V we see everywhere. DLDO3, which provides the
I/O voltages, is raised to match.

This patch enables the EMAC and Realtek PHY drivers in the defconfig.
The device tree file already has the EMAC enabled.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>

---

Changes in v3:
  - Rebased on sunxi/master

Changes in v2:
  - Dropped clk/reset related changes in favor of DM CLK / RESET support
  - Raised DLDO3 for RGMII I/O on Bananapi M3 to 3.3V per design

 configs/Sinovoip_BPI_M3_defconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
index 79743a9c9a51..b9ab00cb8a29 100644
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -21,8 +21,10 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-bananapi-m3"
+CONFIG_PHY_REALTEK=y
+CONFIG_SUN8I_EMAC=y
 CONFIG_AXP_DCDC5_VOLT=1200
-CONFIG_AXP_DLDO3_VOLT=2500
+CONFIG_AXP_DLDO3_VOLT=3300
 CONFIG_AXP_SW_ON=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
-- 
2.20.1

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

* [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY
  2019-05-03  2:27 [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Chen-Yu Tsai
  2019-05-03  2:27 ` [U-Boot] [PATCH v3 1/2] sunxi: Enable EMAC on the Cubietruck Plus Chen-Yu Tsai
  2019-05-03  2:27 ` [U-Boot] [PATCH v3 2/2] sunxi: Enable EMAC on the Bananapi M3 Chen-Yu Tsai
@ 2019-05-03  9:49 ` Jagan Teki
  2019-05-03 10:01   ` Chen-Yu Tsai
  2019-05-03 12:20 ` Jagan Teki
  3 siblings, 1 reply; 8+ messages in thread
From: Jagan Teki @ 2019-05-03  9:49 UTC (permalink / raw)
  To: u-boot

On Fri, May 3, 2019 at 7:58 AM Chen-Yu Tsai <wens@kernel.org> wrote:
>
> From: Chen-Yu Tsai <wens@csie.org>
>
> Hi everyone,
>
> This series enables EMAC (Ethernet controller) on two A83T boards,
> the Cubietruck Plus and Bananapi M3.
>
> This series is now based on sunxi/next, which has patches that convert
> sun8i-emac to use the common CLK and DM_RESET framework.
>
> The two patches enable the sun8i-emac and Realtek PHY driver in their

So, the U-Boot operates realtek than what Linux does via
ethernet-phy-ieee802.3-c22 right? if someone add it in future it will
override realtek since we have a dts compatible enabled it dts files
already isn't it?

Jagan.

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

* [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY
  2019-05-03  9:49 ` [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Jagan Teki
@ 2019-05-03 10:01   ` Chen-Yu Tsai
  2019-05-03 12:15     ` Jagan Teki
  0 siblings, 1 reply; 8+ messages in thread
From: Chen-Yu Tsai @ 2019-05-03 10:01 UTC (permalink / raw)
  To: u-boot

On Fri, May 3, 2019 at 5:49 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, May 3, 2019 at 7:58 AM Chen-Yu Tsai <wens@kernel.org> wrote:
> >
> > From: Chen-Yu Tsai <wens@csie.org>
> >
> > Hi everyone,
> >
> > This series enables EMAC (Ethernet controller) on two A83T boards,
> > the Cubietruck Plus and Bananapi M3.
> >
> > This series is now based on sunxi/next, which has patches that convert
> > sun8i-emac to use the common CLK and DM_RESET framework.
> >
> > The two patches enable the sun8i-emac and Realtek PHY driver in their
>
> So, the U-Boot operates realtek than what Linux does via
> ethernet-phy-ieee802.3-c22 right? if someone add it in future it will
> override realtek since we have a dts compatible enabled it dts files
> already isn't it?

What? No. The PHY vendor and model are automatically detected by reading
the standard registers in the PHY. The compatible string is only used to
determine how to access the registers. c22 vs c45 define different ways
of accessing registers, as well as a larger address space for c45.

See https://www.totalphase.com/support/articles/200349206-MDIO-Background

By reading the vendor and model IDs, the system, be it Linux or U-boot,
can then go through the list of registered PHY drivers to find a match,
or fall back to some generic implementation.

It used to be you needed to enable the Realtek driver for gigabit links
to work properly, but that seems to have been fixed. Nevertheless, having
the specific driver enabled is better.

ChenYu

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

* [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY
  2019-05-03 10:01   ` Chen-Yu Tsai
@ 2019-05-03 12:15     ` Jagan Teki
  2019-05-03 12:28       ` Chen-Yu Tsai
  0 siblings, 1 reply; 8+ messages in thread
From: Jagan Teki @ 2019-05-03 12:15 UTC (permalink / raw)
  To: u-boot

On Fri, May 3, 2019 at 3:31 PM Chen-Yu Tsai <wens@kernel.org> wrote:
>
> On Fri, May 3, 2019 at 5:49 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > On Fri, May 3, 2019 at 7:58 AM Chen-Yu Tsai <wens@kernel.org> wrote:
> > >
> > > From: Chen-Yu Tsai <wens@csie.org>
> > >
> > > Hi everyone,
> > >
> > > This series enables EMAC (Ethernet controller) on two A83T boards,
> > > the Cubietruck Plus and Bananapi M3.
> > >
> > > This series is now based on sunxi/next, which has patches that convert
> > > sun8i-emac to use the common CLK and DM_RESET framework.
> > >
> > > The two patches enable the sun8i-emac and Realtek PHY driver in their
> >
> > So, the U-Boot operates realtek than what Linux does via
> > ethernet-phy-ieee802.3-c22 right? if someone add it in future it will
> > override realtek since we have a dts compatible enabled it dts files
> > already isn't it?
>
> What? No. The PHY vendor and model are automatically detected by reading
> the standard registers in the PHY. The compatible string is only used to
> determine how to access the registers. c22 vs c45 define different ways
> of accessing registers, as well as a larger address space for c45.
>
> See https://www.totalphase.com/support/articles/200349206-MDIO-Background
>
> By reading the vendor and model IDs, the system, be it Linux or U-boot,
> can then go through the list of registered PHY drivers to find a match,
> or fall back to some generic implementation.

Yes, I understand thanks.

>
> It used to be you needed to enable the Realtek driver for gigabit links
> to work properly, but that seems to have been fixed. Nevertheless, having
> the specific driver enabled is better.

Ah.. this is what exactly I tried before in Linux since it doesn't
enable default in sunxi_defconfig. on the other-hand the existing
generic compatible is also working for gigabit links as well.

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

* [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY
  2019-05-03  2:27 [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2019-05-03  9:49 ` [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Jagan Teki
@ 2019-05-03 12:20 ` Jagan Teki
  3 siblings, 0 replies; 8+ messages in thread
From: Jagan Teki @ 2019-05-03 12:20 UTC (permalink / raw)
  To: u-boot

On Fri, May 3, 2019 at 7:58 AM Chen-Yu Tsai <wens@kernel.org> wrote:
>
> From: Chen-Yu Tsai <wens@csie.org>
>
> Hi everyone,
>
> This series enables EMAC (Ethernet controller) on two A83T boards,
> the Cubietruck Plus and Bananapi M3.
>
> This series is now based on sunxi/next, which has patches that convert
> sun8i-emac to use the common CLK and DM_RESET framework.
>
> The two patches enable the sun8i-emac and Realtek PHY driver in their
> respective defconfigs. The device trees already have the EMAC enabled.
> For the Bananapi M3, the regulator providing the I/O voltages is raised
> to 3.3V.
>
> This was tested with the "dhcp" command followed by using the "ping"
> command to ping an external IP, in this case 8.8.8.8.
>
> Regards
> ChenYu
>
> Changes in v3:
>   - Rebased on sunxi/master
>
> Changes in v2:
>   - Dropped clk/reset related changes in favor of DM CLK / RESET support
>   - Raised DLDO3 for RGMII I/O on Bananapi M3 to 3.3V per design
>
> Chen-Yu Tsai (2):
>   sunxi: Enable EMAC on the Cubietruck Plus
>   sunxi: Enable EMAC on the Bananapi M3

Applied to u-boot-sunxi/master

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

* [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY
  2019-05-03 12:15     ` Jagan Teki
@ 2019-05-03 12:28       ` Chen-Yu Tsai
  0 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2019-05-03 12:28 UTC (permalink / raw)
  To: u-boot

On Fri, May 3, 2019 at 8:15 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Fri, May 3, 2019 at 3:31 PM Chen-Yu Tsai <wens@kernel.org> wrote:
> >
> > On Fri, May 3, 2019 at 5:49 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
> > >
> > > On Fri, May 3, 2019 at 7:58 AM Chen-Yu Tsai <wens@kernel.org> wrote:
> > > >
> > > > From: Chen-Yu Tsai <wens@csie.org>
> > > >
> > > > Hi everyone,
> > > >
> > > > This series enables EMAC (Ethernet controller) on two A83T boards,
> > > > the Cubietruck Plus and Bananapi M3.
> > > >
> > > > This series is now based on sunxi/next, which has patches that convert
> > > > sun8i-emac to use the common CLK and DM_RESET framework.
> > > >
> > > > The two patches enable the sun8i-emac and Realtek PHY driver in their
> > >
> > > So, the U-Boot operates realtek than what Linux does via
> > > ethernet-phy-ieee802.3-c22 right? if someone add it in future it will
> > > override realtek since we have a dts compatible enabled it dts files
> > > already isn't it?
> >
> > What? No. The PHY vendor and model are automatically detected by reading
> > the standard registers in the PHY. The compatible string is only used to
> > determine how to access the registers. c22 vs c45 define different ways
> > of accessing registers, as well as a larger address space for c45.
> >
> > See https://www.totalphase.com/support/articles/200349206-MDIO-Background
> >
> > By reading the vendor and model IDs, the system, be it Linux or U-boot,
> > can then go through the list of registered PHY drivers to find a match,
> > or fall back to some generic implementation.
>
> Yes, I understand thanks.
>
> >
> > It used to be you needed to enable the Realtek driver for gigabit links
> > to work properly, but that seems to have been fixed. Nevertheless, having
> > the specific driver enabled is better.
>
> Ah.. this is what exactly I tried before in Linux since it doesn't
> enable default in sunxi_defconfig. on the other-hand the existing
> generic compatible is also working for gigabit links as well.

Yeah. My memories of it not working are from way back, before the whole
DM conversion even started.

I think it's still better to have the specific driver enabled though,
as the PHY has some vendor specific features or status flags.

ChenYu

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

end of thread, other threads:[~2019-05-03 12:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-03  2:27 [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Chen-Yu Tsai
2019-05-03  2:27 ` [U-Boot] [PATCH v3 1/2] sunxi: Enable EMAC on the Cubietruck Plus Chen-Yu Tsai
2019-05-03  2:27 ` [U-Boot] [PATCH v3 2/2] sunxi: Enable EMAC on the Bananapi M3 Chen-Yu Tsai
2019-05-03  9:49 ` [U-Boot] [PATCH v3 0/2] sunxi: Enable EMAC on A83T boards using Realtek RTL8211E PHY Jagan Teki
2019-05-03 10:01   ` Chen-Yu Tsai
2019-05-03 12:15     ` Jagan Teki
2019-05-03 12:28       ` Chen-Yu Tsai
2019-05-03 12:20 ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.