* [U-Boot] [PATCH] ARM: meson-gx: Reset GXL/GXM to external PHY when not using internal PHY
@ 2019-05-28 11:13 ` Neil Armstrong
0 siblings, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2019-05-28 11:13 UTC (permalink / raw)
To: u-boot
When using External PHY, reset the mux to use the external PHY in case U-Boot
was chainloaded from a misconfigured bootloader.
Fixes: 33e3378091 ("ARM: meson: rework soc arch file to prepare for new SoC")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
arch/arm/mach-meson/board-gx.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c
index e41552db52..2b0614b79b 100644
--- a/arch/arm/mach-meson/board-gx.c
+++ b/arch/arm/mach-meson/board-gx.c
@@ -112,6 +112,11 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
GX_ETH_REG_0_TX_RATIO(4) |
GX_ETH_REG_0_PHY_CLK_EN |
GX_ETH_REG_0_CLK_EN);
+
+ /* Reset to external PHY */
+ if(!IS_ENABLED(CONFIG_MESON_GXBB))
+ writel(0x2009087f, GX_ETH_REG_3);
+
break;
case PHY_INTERFACE_MODE_RMII:
@@ -119,11 +124,13 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
out_le32(GX_ETH_REG_0, GX_ETH_REG_0_INVERT_RMII_CLK |
GX_ETH_REG_0_CLK_EN);
- /* Use GXL RMII Internal PHY */
- if (IS_ENABLED(CONFIG_MESON_GXL) &&
- (flags & MESON_USE_INTERNAL_RMII_PHY)) {
- writel(0x10110181, GX_ETH_REG_2);
- writel(0xe40908ff, GX_ETH_REG_3);
+ /* Use GXL RMII Internal PHY (also on GXM) */
+ if (!IS_ENABLED(CONFIG_MESON_GXBB)) {
+ if ((flags & MESON_USE_INTERNAL_RMII_PHY)) {
+ writel(0x10110181, GX_ETH_REG_2);
+ writel(0xe40908ff, GX_ETH_REG_3);
+ } else
+ writel(0x2009087f, GX_ETH_REG_3);
}
break;
--
2.21.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: meson-gx: Reset GXL/GXM to external PHY when not using internal PHY
@ 2019-05-28 11:13 ` Neil Armstrong
0 siblings, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2019-05-28 11:13 UTC (permalink / raw)
To: u-boot; +Cc: Neil Armstrong, u-boot-amlogic
When using External PHY, reset the mux to use the external PHY in case U-Boot
was chainloaded from a misconfigured bootloader.
Fixes: 33e3378091 ("ARM: meson: rework soc arch file to prepare for new SoC")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
arch/arm/mach-meson/board-gx.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c
index e41552db52..2b0614b79b 100644
--- a/arch/arm/mach-meson/board-gx.c
+++ b/arch/arm/mach-meson/board-gx.c
@@ -112,6 +112,11 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
GX_ETH_REG_0_TX_RATIO(4) |
GX_ETH_REG_0_PHY_CLK_EN |
GX_ETH_REG_0_CLK_EN);
+
+ /* Reset to external PHY */
+ if(!IS_ENABLED(CONFIG_MESON_GXBB))
+ writel(0x2009087f, GX_ETH_REG_3);
+
break;
case PHY_INTERFACE_MODE_RMII:
@@ -119,11 +124,13 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
out_le32(GX_ETH_REG_0, GX_ETH_REG_0_INVERT_RMII_CLK |
GX_ETH_REG_0_CLK_EN);
- /* Use GXL RMII Internal PHY */
- if (IS_ENABLED(CONFIG_MESON_GXL) &&
- (flags & MESON_USE_INTERNAL_RMII_PHY)) {
- writel(0x10110181, GX_ETH_REG_2);
- writel(0xe40908ff, GX_ETH_REG_3);
+ /* Use GXL RMII Internal PHY (also on GXM) */
+ if (!IS_ENABLED(CONFIG_MESON_GXBB)) {
+ if ((flags & MESON_USE_INTERNAL_RMII_PHY)) {
+ writel(0x10110181, GX_ETH_REG_2);
+ writel(0xe40908ff, GX_ETH_REG_3);
+ } else
+ writel(0x2009087f, GX_ETH_REG_3);
}
break;
--
2.21.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] ARM: meson-gx: Reset GXL/GXM to external PHY when not using internal PHY
2019-05-28 11:13 ` Neil Armstrong
@ 2019-05-31 8:19 ` Neil Armstrong
-1 siblings, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2019-05-31 8:19 UTC (permalink / raw)
To: u-boot
On 28/05/2019 13:13, Neil Armstrong wrote:
> When using External PHY, reset the mux to use the external PHY in case U-Boot
> was chainloaded from a misconfigured bootloader.
>
> Fixes: 33e3378091 ("ARM: meson: rework soc arch file to prepare for new SoC")
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
> arch/arm/mach-meson/board-gx.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c
> index e41552db52..2b0614b79b 100644
> --- a/arch/arm/mach-meson/board-gx.c
> +++ b/arch/arm/mach-meson/board-gx.c
> @@ -112,6 +112,11 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
> GX_ETH_REG_0_TX_RATIO(4) |
> GX_ETH_REG_0_PHY_CLK_EN |
> GX_ETH_REG_0_CLK_EN);
> +
> + /* Reset to external PHY */
> + if(!IS_ENABLED(CONFIG_MESON_GXBB))
> + writel(0x2009087f, GX_ETH_REG_3);
> +
> break;
>
> case PHY_INTERFACE_MODE_RMII:
> @@ -119,11 +124,13 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
> out_le32(GX_ETH_REG_0, GX_ETH_REG_0_INVERT_RMII_CLK |
> GX_ETH_REG_0_CLK_EN);
>
> - /* Use GXL RMII Internal PHY */
> - if (IS_ENABLED(CONFIG_MESON_GXL) &&
> - (flags & MESON_USE_INTERNAL_RMII_PHY)) {
> - writel(0x10110181, GX_ETH_REG_2);
> - writel(0xe40908ff, GX_ETH_REG_3);
> + /* Use GXL RMII Internal PHY (also on GXM) */
> + if (!IS_ENABLED(CONFIG_MESON_GXBB)) {
> + if ((flags & MESON_USE_INTERNAL_RMII_PHY)) {
> + writel(0x10110181, GX_ETH_REG_2);
> + writel(0xe40908ff, GX_ETH_REG_3);
> + } else
> + writel(0x2009087f, GX_ETH_REG_3);
> }
>
> break;
>
Applied to u-boot-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ARM: meson-gx: Reset GXL/GXM to external PHY when not using internal PHY
@ 2019-05-31 8:19 ` Neil Armstrong
0 siblings, 0 replies; 4+ messages in thread
From: Neil Armstrong @ 2019-05-31 8:19 UTC (permalink / raw)
To: u-boot; +Cc: u-boot-amlogic
On 28/05/2019 13:13, Neil Armstrong wrote:
> When using External PHY, reset the mux to use the external PHY in case U-Boot
> was chainloaded from a misconfigured bootloader.
>
> Fixes: 33e3378091 ("ARM: meson: rework soc arch file to prepare for new SoC")
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
> arch/arm/mach-meson/board-gx.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c
> index e41552db52..2b0614b79b 100644
> --- a/arch/arm/mach-meson/board-gx.c
> +++ b/arch/arm/mach-meson/board-gx.c
> @@ -112,6 +112,11 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
> GX_ETH_REG_0_TX_RATIO(4) |
> GX_ETH_REG_0_PHY_CLK_EN |
> GX_ETH_REG_0_CLK_EN);
> +
> + /* Reset to external PHY */
> + if(!IS_ENABLED(CONFIG_MESON_GXBB))
> + writel(0x2009087f, GX_ETH_REG_3);
> +
> break;
>
> case PHY_INTERFACE_MODE_RMII:
> @@ -119,11 +124,13 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags)
> out_le32(GX_ETH_REG_0, GX_ETH_REG_0_INVERT_RMII_CLK |
> GX_ETH_REG_0_CLK_EN);
>
> - /* Use GXL RMII Internal PHY */
> - if (IS_ENABLED(CONFIG_MESON_GXL) &&
> - (flags & MESON_USE_INTERNAL_RMII_PHY)) {
> - writel(0x10110181, GX_ETH_REG_2);
> - writel(0xe40908ff, GX_ETH_REG_3);
> + /* Use GXL RMII Internal PHY (also on GXM) */
> + if (!IS_ENABLED(CONFIG_MESON_GXBB)) {
> + if ((flags & MESON_USE_INTERNAL_RMII_PHY)) {
> + writel(0x10110181, GX_ETH_REG_2);
> + writel(0xe40908ff, GX_ETH_REG_3);
> + } else
> + writel(0x2009087f, GX_ETH_REG_3);
> }
>
> break;
>
Applied to u-boot-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-05-31 8:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 11:13 [U-Boot] [PATCH] ARM: meson-gx: Reset GXL/GXM to external PHY when not using internal PHY Neil Armstrong
2019-05-28 11:13 ` Neil Armstrong
2019-05-31 8:19 ` [U-Boot] " Neil Armstrong
2019-05-31 8:19 ` Neil Armstrong
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.