* [PATCH v2] ARM: dts: sun8i: h3: Enable EMAC with external PHY on NanoPi M1 Plus
@ 2017-08-02 2:50 Luis Araneda
2017-08-02 2:55 ` Chen-Yu Tsai
0 siblings, 1 reply; 3+ messages in thread
From: Luis Araneda @ 2017-08-02 2:50 UTC (permalink / raw)
To: linux-arm-kernel
The Nanopi M1 Plus uses an external Realtek RTL8211E PHY in RGMII mode,
enabled by a GPIO-based regulator.
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
---
Changes v1 -> v2:
- Removed unnecessary property
- Corrected part address to match reg value
arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts | 30 +++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
index 8ddd1b2cc..1273a5e45 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
@@ -45,6 +45,20 @@
/ {
model = "FriendlyArm NanoPi M1 Plus";
compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
+
+ aliases {
+ ethernet0 = &emac;
+ };
+
+ reg_gmac_3v3: gmac-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "gmac-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ startup-delay-us = <100000>;
+ enable-active-high;
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+ };
};
&ehci1 {
@@ -55,6 +69,22 @@
status = "okay";
};
+&emac {
+ pinctrl-names = "default";
+ pinctrl-0 = <&emac_rgmii_pins>;
+ phy-supply = <®_gmac_3v3>;
+ phy-handle = <&ext_rgmii_phy>;
+ phy-mode = "rgmii";
+ status = "okay";
+};
+
+&mdio {
+ ext_rgmii_phy: ethernet-phy at 0 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <0>;
+ };
+};
+
&ohci1 {
status = "okay";
};
--
2.13.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] ARM: dts: sun8i: h3: Enable EMAC with external PHY on NanoPi M1 Plus
2017-08-02 2:50 [PATCH v2] ARM: dts: sun8i: h3: Enable EMAC with external PHY on NanoPi M1 Plus Luis Araneda
@ 2017-08-02 2:55 ` Chen-Yu Tsai
2017-08-02 14:31 ` Luis Araneda
0 siblings, 1 reply; 3+ messages in thread
From: Chen-Yu Tsai @ 2017-08-02 2:55 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Aug 2, 2017 at 10:50 AM, Luis Araneda <luaraneda@gmail.com> wrote:
> The Nanopi M1 Plus uses an external Realtek RTL8211E PHY in RGMII mode,
> enabled by a GPIO-based regulator.
>
> Signed-off-by: Luis Araneda <luaraneda@gmail.com>
>
> ---
> Changes v1 -> v2:
> - Removed unnecessary property
> - Corrected part address to match reg value
>
> arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts | 30 +++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
> index 8ddd1b2cc..1273a5e45 100644
> --- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
> +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
> @@ -45,6 +45,20 @@
> / {
> model = "FriendlyArm NanoPi M1 Plus";
> compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
> +
> + aliases {
> + ethernet0 = &emac;
> + };
> +
> + reg_gmac_3v3: gmac-3v3 {
> + compatible = "regulator-fixed";
> + regulator-name = "gmac-3v3";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + startup-delay-us = <100000>;
> + enable-active-high;
> + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
> + };
> };
>
> &ehci1 {
> @@ -55,6 +69,22 @@
> status = "okay";
> };
>
> +&emac {
> + pinctrl-names = "default";
> + pinctrl-0 = <&emac_rgmii_pins>;
> + phy-supply = <®_gmac_3v3>;
> + phy-handle = <&ext_rgmii_phy>;
> + phy-mode = "rgmii";
> + status = "okay";
> +};
> +
> +&mdio {
> + ext_rgmii_phy: ethernet-phy at 0 {
> + compatible = "ethernet-phy-ieee802.3-c22";
> + reg = <0>;
Please use the actual address as designed on the board.
It seems to be 7. 0 for the RTL8211E is a broadcast address.
ChenYu
> + };
> +};
> +
> &ohci1 {
> status = "okay";
> };
> --
> 2.13.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] ARM: dts: sun8i: h3: Enable EMAC with external PHY on NanoPi M1 Plus
2017-08-02 2:55 ` Chen-Yu Tsai
@ 2017-08-02 14:31 ` Luis Araneda
0 siblings, 0 replies; 3+ messages in thread
From: Luis Araneda @ 2017-08-02 14:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
You're right again.
I tested the board with the address set to 7 and it worked.
Also, I tested other addresses to be sure (that they don't work).
I'll send a v3 in a couple of hours if no more comments are received.
Cheers,
Luis Araneda.
On Tue, Aug 1, 2017 at 10:55 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> On Wed, Aug 2, 2017 at 10:50 AM, Luis Araneda <luaraneda@gmail.com> wrote:
>> The Nanopi M1 Plus uses an external Realtek RTL8211E PHY in RGMII mode,
>> enabled by a GPIO-based regulator.
>>
>> Signed-off-by: Luis Araneda <luaraneda@gmail.com>
>>
>> ---
>> Changes v1 -> v2:
>> - Removed unnecessary property
>> - Corrected part address to match reg value
>>
>> arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts | 30 +++++++++++++++++++++++++++
>> 1 file changed, 30 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
>> index 8ddd1b2cc..1273a5e45 100644
>> --- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
>> +++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
>> @@ -45,6 +45,20 @@
>> / {
>> model = "FriendlyArm NanoPi M1 Plus";
>> compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
>> +
>> + aliases {
>> + ethernet0 = &emac;
>> + };
>> +
>> + reg_gmac_3v3: gmac-3v3 {
>> + compatible = "regulator-fixed";
>> + regulator-name = "gmac-3v3";
>> + regulator-min-microvolt = <3300000>;
>> + regulator-max-microvolt = <3300000>;
>> + startup-delay-us = <100000>;
>> + enable-active-high;
>> + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
>> + };
>> };
>>
>> &ehci1 {
>> @@ -55,6 +69,22 @@
>> status = "okay";
>> };
>>
>> +&emac {
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&emac_rgmii_pins>;
>> + phy-supply = <®_gmac_3v3>;
>> + phy-handle = <&ext_rgmii_phy>;
>> + phy-mode = "rgmii";
>> + status = "okay";
>> +};
>> +
>> +&mdio {
>> + ext_rgmii_phy: ethernet-phy at 0 {
>> + compatible = "ethernet-phy-ieee802.3-c22";
>> + reg = <0>;
>
> Please use the actual address as designed on the board.
> It seems to be 7. 0 for the RTL8211E is a broadcast address.
>
> ChenYu
>
>> + };
>> +};
>> +
>> &ohci1 {
>> status = "okay";
>> };
>> --
>> 2.13.3
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-02 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 2:50 [PATCH v2] ARM: dts: sun8i: h3: Enable EMAC with external PHY on NanoPi M1 Plus Luis Araneda
2017-08-02 2:55 ` Chen-Yu Tsai
2017-08-02 14:31 ` Luis Araneda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox