Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1497068 > unrolled thread
| Started by | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| First post | 2016-10-07 10:30 +0200 |
| Last post | 2016-10-07 17:10 +0200 |
| Articles | 19 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH v4 00/10] net-next: ethernet: add sun8i-emac driver Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:30 +0200
[PATCH v4 07/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange PI One Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
[PATCH v4 08/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2 Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
Re: [PATCH v4 08/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2 Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-12 11:10 +0200
Re: [PATCH v4 08/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2 Jean-Francois Moine <moinejf@free.fr> - 2016-10-12 11:10 +0200
[PATCH v4 06/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange PI PC Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
[PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-10 14:40 +0200
Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-10-10 14:40 +0200
Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig Jean-Francois Moine <moinejf@free.fr> - 2016-10-10 15:20 +0200
Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-11 11:50 +0200
Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig LABBE Corentin <clabbe.montjoie@gmail.com> - 2016-10-12 10:40 +0200
[PATCH v4 05/10] ARM: dts: sun8i-h3: add sun8i-emac ethernet driver Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
[PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
Re: [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-10 14:40 +0200
Re: [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module Jean-Francois Moine <moinejf@free.fr> - 2016-10-10 15:00 +0200
Re: [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-11 12:00 +0200
[PATCH v4 09/10] ARM: sunxi: Enable sun8i-emac driver on sunxi_defconfig Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-07 10:40 +0200
Re: [PATCH v4 01/10] ethernet: add sun8i-emac driver Joe Perches <joe@perches.com> - 2016-10-07 17:10 +0200
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:30 +0200 |
| Subject | [PATCH v4 00/10] net-next: ethernet: add sun8i-emac driver |
| Message-ID | <spyHv-604-3@gated-at.bofh.it> |
Hello
This patch series add the driver for sun8i-emac which handle the Ethernet MAC
present on Allwinner H3/A83T/A64 SoCs.
It supports 10/100/1000 Mbit/s speed with half/full duplex.
It can use an internal PHY (MII 10/100) or an external PHY
via RGMII/RMII.
This patch series enable the driver only for the H3 SoC since A83T and A64
doesn't have the necessary clocks present in mainline.
This patch series enable the driver only for OrangePiPC and OrangePIOne boards
since other board with H3 use external PHY which need optional regulators
that will be supported later.
The driver have been tested on the following boards:
- H3 Orange PI PC, Orange PI Plus, BananaPI-M2+
- A64 Pine64
- A83T BananaPI-M3
I would like to thanks Chen-Yu Tsai for his help on developing this driver.
Regards
Changes since v3
- sun8i-emac require a DT mdio node
- moved sun8i_emac_power() so that no clock/reset/regulator is used
until netdev/open is called
- Removed PM patch until proper tests are done
- DT use phy-handle instead of phy
- Moved DT aliases ethernet to subnodes
- Renamed PHY nodes to [int|ext]_[r|g]mii_phy
- Moved clock/reset for internal PHY to PHY node.
Changes since v2
- Added patch to support Orange PI One
- Added a patch to enable SUN8I_EMAC in sunxi_defconfig
- Added a patch to enable pm_runtime
- The Emac clock is now used standard syscon/regmap
- Added netdev_sent_queue/netdev_completed_queue
- Added lots of documentation on working (locks, memory barrier, etc...)
- Cleaned DT bindings documentation
- Added ethernet0 aliases as suggested by Hans de Goede
- Change prefix of all DEFINE to EMAC_
- The driver is now endian safe
- Reworked the internal PHY mechanism
- Removed dma_set_mask_and_coherent(32) since it is the default for of_platform_driver
Changes since v1
- Implement NAPI
- Sorted and reworded all define
- Reworked ethtools stats strings
- Removed all unneeded __packked and __aligned
- Added tuning of RX/TX ring size via ethtool
- Corrected use of sk/skb naming
- Added some wmb when needed
- Moved irq claim/free to emac_open/close
- Lots of code refactoring
Corentin Labbe (9):
ethernet: add sun8i-emac driver
MAINTAINERS: Add myself as maintainer of sun8i-emac
ARM: sun8i: dt: Add DT bindings documentation for Allwinner sun8i-emac
ARM: dts: sun8i-h3: Add dt node for the syscon control module
ARM: dts: sun8i-h3: add sun8i-emac ethernet driver
ARM: dts: sun8i: Enable sun8i-emac on the Orange PI PC
ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2
ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig
ARM: sunxi: Enable sun8i-emac driver on sunxi_defconfig
Hans de Goede (1):
ARM: dts: sun8i: Enable sun8i-emac on the Orange PI One
.../bindings/net/allwinner,sun8i-emac.txt | 70 +
MAINTAINERS | 6 +
arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 +
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 8 +
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 8 +
arch/arm/boot/dts/sun8i-h3.dtsi | 29 +
arch/arm/configs/multi_v7_defconfig | 1 +
arch/arm/configs/sunxi_defconfig | 1 +
drivers/net/ethernet/allwinner/Kconfig | 13 +
drivers/net/ethernet/allwinner/Makefile | 1 +
drivers/net/ethernet/allwinner/sun8i-emac.c | 2266 ++++++++++++++++++++
11 files changed, 2411 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/allwinner,sun8i-emac.txt
create mode 100644 drivers/net/ethernet/allwinner/sun8i-emac.c
--
2.7.3
[toc] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 07/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange PI One |
| Message-ID | <spyRb-65a-7@gated-at.bofh.it> |
| In reply to | #1497068 |
From: Hans de Goede <hdegoede@redhat.com>
The sun8i-emac hardware is present on the Orange PI One.
It uses the internal PHY.
This patch create the needed emac node.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
index 0adf932..25f2455 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
@@ -54,6 +54,7 @@
aliases {
serial0 = &uart0;
+ ethernet0 = &emac;
};
chosen {
@@ -94,6 +95,13 @@
status = "okay";
};
+&emac {
+ phy-handle = <&int_mii_phy>;
+ phy-mode = "mii";
+ allwinner,leds-active-low;
+ status = "okay";
+};
+
&mmc0 {
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
--
2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 08/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2 |
| Message-ID | <spyRb-65a-5@gated-at.bofh.it> |
| In reply to | #1497068 |
The sun8i-emac hardware is present on the Orange PI 2.
It uses the internal PHY.
This patch create the needed emac node.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
index f93f5d1..5608eb4 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
@@ -54,6 +54,7 @@
aliases {
serial0 = &uart0;
+ ethernet0 = &emac;
};
chosen {
@@ -184,3 +185,10 @@
usb1_vbus-supply = <®_usb1_vbus>;
status = "okay";
};
+
+&emac {
+ phy-handle = <&int_mii_phy>;
+ phy-mode = "mii";
+ allwinner,leds-active-low;
+ status = "okay";
+};
--
2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2016-10-12 11:10 +0200 |
| Subject | Re: [PATCH v4 08/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2 |
| Message-ID | <srnHY-2dx-7@gated-at.bofh.it> |
| In reply to | #1497072 |
[Multipart message — attachments visible in raw view] — view raw
On Wed, Oct 12, 2016 at 10:55:59AM +0200, Jean-Francois Moine wrote:
> On Fri, 7 Oct 2016 10:25:55 +0200
> Corentin Labbe <clabbe.montjoie@gmail.com> wrote:
>
> > The sun8i-emac hardware is present on the Orange PI 2.
> > It uses the internal PHY.
> >
> > This patch create the needed emac node.
> >
> > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> > ---
> > arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
> > index f93f5d1..5608eb4 100644
> > --- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
> > +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
> > @@ -54,6 +54,7 @@
> >
> > aliases {
> > serial0 = &uart0;
> > + ethernet0 = &emac;
>
> As there is no 'of_alias_get_id' in the driver, this alias is
> useless.
Not really, this is used by U-Boot to set the mac address.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | Jean-Francois Moine <moinejf@free.fr> |
|---|---|
| Date | 2016-10-12 11:10 +0200 |
| Subject | Re: [PATCH v4 08/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange Pi 2 |
| Message-ID | <srnHY-2dx-9@gated-at.bofh.it> |
| In reply to | #1497072 |
On Fri, 7 Oct 2016 10:25:55 +0200
Corentin Labbe <clabbe.montjoie@gmail.com> wrote:
> The sun8i-emac hardware is present on the Orange PI 2.
> It uses the internal PHY.
>
> This patch create the needed emac node.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
> arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
> index f93f5d1..5608eb4 100644
> --- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
> +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
> @@ -54,6 +54,7 @@
>
> aliases {
> serial0 = &uart0;
> + ethernet0 = &emac;
As there is no 'of_alias_get_id' in the driver, this alias is useless.
> };
>
> chosen {
> @@ -184,3 +185,10 @@
> usb1_vbus-supply = <®_usb1_vbus>;
> status = "okay";
> };
> +
> +&emac {
> + phy-handle = <&int_mii_phy>;
> + phy-mode = "mii";
> + allwinner,leds-active-low;
> + status = "okay";
> +};
> --
> 2.7.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 06/10] ARM: dts: sun8i: Enable sun8i-emac on the Orange PI PC |
| Message-ID | <spyRb-65a-11@gated-at.bofh.it> |
| In reply to | #1497068 |
The sun8i-emac hardware is present on the Orange PI PC.
It uses the internal PHY.
This patch create the needed emac node.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
index daf50b9a6..71717cc 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
@@ -54,6 +54,7 @@
aliases {
serial0 = &uart0;
+ ethernet0 = &emac;
};
chosen {
@@ -165,3 +166,10 @@
/* USB VBUS is always on */
status = "okay";
};
+
+&emac {
+ phy-handle = <&int_mii_phy>;
+ phy-mode = "mii";
+ allwinner,leds-active-low;
+ status = "okay";
+};
--
2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig |
| Message-ID | <spyRb-65a-19@gated-at.bofh.it> |
| In reply to | #1497068 |
Enable the sun8i-emac driver in the multi_v7 default configuration Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 5845910..f44d633 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -229,6 +229,7 @@ CONFIG_NETDEVICES=y CONFIG_VIRTIO_NET=y CONFIG_HIX5HD2_GMAC=y CONFIG_SUN4I_EMAC=y +CONFIG_SUN8I_EMAC=y CONFIG_MACB=y CONFIG_BCMGENET=m CONFIG_SYSTEMPORT=m -- 2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2016-10-10 14:40 +0200 |
| Subject | Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig |
| Message-ID | <sqI25-1gE-9@gated-at.bofh.it> |
| In reply to | #1497074 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Oct 07, 2016 at 10:25:57AM +0200, Corentin Labbe wrote: > Enable the sun8i-emac driver in the multi_v7 default configuration > > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> > --- > arch/arm/configs/multi_v7_defconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig > index 5845910..f44d633 100644 > --- a/arch/arm/configs/multi_v7_defconfig > +++ b/arch/arm/configs/multi_v7_defconfig > @@ -229,6 +229,7 @@ CONFIG_NETDEVICES=y > CONFIG_VIRTIO_NET=y > CONFIG_HIX5HD2_GMAC=y > CONFIG_SUN4I_EMAC=y > +CONFIG_SUN8I_EMAC=y Any reason to build it statically? Thanks, Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | LABBE Corentin <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-10 14:40 +0200 |
| Subject | Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig |
| Message-ID | <sqI26-1gE-25@gated-at.bofh.it> |
| In reply to | #1498267 |
On Mon, Oct 10, 2016 at 02:30:46PM +0200, Maxime Ripard wrote: > On Fri, Oct 07, 2016 at 10:25:57AM +0200, Corentin Labbe wrote: > > Enable the sun8i-emac driver in the multi_v7 default configuration > > > > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> > > --- > > arch/arm/configs/multi_v7_defconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig > > index 5845910..f44d633 100644 > > --- a/arch/arm/configs/multi_v7_defconfig > > +++ b/arch/arm/configs/multi_v7_defconfig > > @@ -229,6 +229,7 @@ CONFIG_NETDEVICES=y > > CONFIG_VIRTIO_NET=y > > CONFIG_HIX5HD2_GMAC=y > > CONFIG_SUN4I_EMAC=y > > +CONFIG_SUN8I_EMAC=y > > Any reason to build it statically? > No, just copied the same than CONFIG_SUN4I_EMAC that probably do not need it also. Regards Corentin Labbe
[toc] | [prev] | [next] | [standalone]
| From | Jean-Francois Moine <moinejf@free.fr> |
|---|---|
| Date | 2016-10-10 15:20 +0200 |
| Subject | Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig |
| Message-ID | <sqIEO-1J7-23@gated-at.bofh.it> |
| In reply to | #1498268 |
On Mon, 10 Oct 2016 14:35:11 +0200 LABBE Corentin <clabbe.montjoie@gmail.com> wrote: > On Mon, Oct 10, 2016 at 02:30:46PM +0200, Maxime Ripard wrote: > > On Fri, Oct 07, 2016 at 10:25:57AM +0200, Corentin Labbe wrote: > > > Enable the sun8i-emac driver in the multi_v7 default configuration > > > > > > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> > > > --- > > > arch/arm/configs/multi_v7_defconfig | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig > > > index 5845910..f44d633 100644 > > > --- a/arch/arm/configs/multi_v7_defconfig > > > +++ b/arch/arm/configs/multi_v7_defconfig > > > @@ -229,6 +229,7 @@ CONFIG_NETDEVICES=y > > > CONFIG_VIRTIO_NET=y > > > CONFIG_HIX5HD2_GMAC=y > > > CONFIG_SUN4I_EMAC=y > > > +CONFIG_SUN8I_EMAC=y > > > > Any reason to build it statically? > > > > No, just copied the same than CONFIG_SUN4I_EMAC that probably do not need it also. All arm configs are done the same way, and, some day, the generic ARM V7 kernel will not be loadable in 1Gb RAM... -- Ken ar c'hentañ | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/
[toc] | [prev] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2016-10-11 11:50 +0200 |
| Subject | Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig |
| Message-ID | <sr1R7-4Zl-1@gated-at.bofh.it> |
| In reply to | #1498302 |
[Multipart message — attachments visible in raw view] — view raw
On Mon, Oct 10, 2016 at 03:09:43PM +0200, Jean-Francois Moine wrote: > On Mon, 10 Oct 2016 14:35:11 +0200 > LABBE Corentin <clabbe.montjoie@gmail.com> wrote: > > > On Mon, Oct 10, 2016 at 02:30:46PM +0200, Maxime Ripard wrote: > > > On Fri, Oct 07, 2016 at 10:25:57AM +0200, Corentin Labbe wrote: > > > > Enable the sun8i-emac driver in the multi_v7 default configuration > > > > > > > > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> > > > > --- > > > > arch/arm/configs/multi_v7_defconfig | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig > > > > index 5845910..f44d633 100644 > > > > --- a/arch/arm/configs/multi_v7_defconfig > > > > +++ b/arch/arm/configs/multi_v7_defconfig > > > > @@ -229,6 +229,7 @@ CONFIG_NETDEVICES=y > > > > CONFIG_VIRTIO_NET=y > > > > CONFIG_HIX5HD2_GMAC=y > > > > CONFIG_SUN4I_EMAC=y > > > > +CONFIG_SUN8I_EMAC=y > > > > > > Any reason to build it statically? > > > > No, just copied the same than CONFIG_SUN4I_EMAC that probably do > > not need it also. > > All arm configs are done the same way, and, some day, the generic ARM > V7 kernel will not be loadable in 1Gb RAM... Yeah, if possible, I'd really like to avoid introducing statically built drivers to multi_v7. Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | LABBE Corentin <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-12 10:40 +0200 |
| Subject | Re: [PATCH v4 10/10] ARM: sunxi: Enable sun8i-emac driver on multi_v7_defconfig |
| Message-ID | <srneW-1Ok-7@gated-at.bofh.it> |
| In reply to | #1498691 |
On Tue, Oct 11, 2016 at 11:40:42AM +0200, Maxime Ripard wrote: > On Mon, Oct 10, 2016 at 03:09:43PM +0200, Jean-Francois Moine wrote: > > On Mon, 10 Oct 2016 14:35:11 +0200 > > LABBE Corentin <clabbe.montjoie@gmail.com> wrote: > > > > > On Mon, Oct 10, 2016 at 02:30:46PM +0200, Maxime Ripard wrote: > > > > On Fri, Oct 07, 2016 at 10:25:57AM +0200, Corentin Labbe wrote: > > > > > Enable the sun8i-emac driver in the multi_v7 default configuration > > > > > > > > > > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> > > > > > --- > > > > > arch/arm/configs/multi_v7_defconfig | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig > > > > > index 5845910..f44d633 100644 > > > > > --- a/arch/arm/configs/multi_v7_defconfig > > > > > +++ b/arch/arm/configs/multi_v7_defconfig > > > > > @@ -229,6 +229,7 @@ CONFIG_NETDEVICES=y > > > > > CONFIG_VIRTIO_NET=y > > > > > CONFIG_HIX5HD2_GMAC=y > > > > > CONFIG_SUN4I_EMAC=y > > > > > +CONFIG_SUN8I_EMAC=y > > > > > > > > Any reason to build it statically? > > > > > > No, just copied the same than CONFIG_SUN4I_EMAC that probably do > > > not need it also. > > > > All arm configs are done the same way, and, some day, the generic ARM > > V7 kernel will not be loadable in 1Gb RAM... > > Yeah, if possible, I'd really like to avoid introducing statically > built drivers to multi_v7. > I forgot to said it in my first answer, but yes I will change it. Regards
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 05/10] ARM: dts: sun8i-h3: add sun8i-emac ethernet driver |
| Message-ID | <spyRb-65a-9@gated-at.bofh.it> |
| In reply to | #1497068 |
The sun8i-emac is an ethernet MAC hardware that support 10/100/1000
speed.
This patch enable the sun8i-emac on the Allwinner H3 SoC Device-tree.
The SoC H3 have an internal PHY, so optionals syscon and ephy are set.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-h3.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index 1101d2f..d218154 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -446,6 +446,30 @@
status = "disabled";
};
+ emac: ethernet@1c30000 {
+ compatible = "allwinner,sun8i-h3-emac";
+ syscon = <&syscon>;
+ reg = <0x01c30000 0x104>;
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&ccu RST_BUS_EMAC>;
+ reset-names = "ahb";
+ clocks = <&ccu CLK_BUS_EMAC>;
+ clock-names = "ahb";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ mdio: mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ int_mii_phy: ethernet-phy@1 {
+ reg = <1>;
+ clocks = <&ccu CLK_BUS_EPHY>;
+ resets = <&ccu RST_BUS_EPHY>;
+ };
+ };
+ };
+
gic: interrupt-controller@01c81000 {
compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
reg = <0x01c81000 0x1000>,
--
2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module |
| Message-ID | <spyRb-65a-17@gated-at.bofh.it> |
| In reply to | #1497068 |
This patch add the dt node for the syscon register present on the
Allwinner H3.
Only two register are present in this syscon and the only one useful is
the one dedicated to EMAC clock.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-h3.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
index 8a95e36..1101d2f 100644
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -140,6 +140,11 @@
#size-cells = <1>;
ranges;
+ syscon: syscon@01c00000 {
+ compatible = "syscon";
+ reg = <0x01c00000 0x1000>;
+ };
+
dma: dma-controller@01c02000 {
compatible = "allwinner,sun8i-h3-dma";
reg = <0x01c02000 0x1000>;
--
2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2016-10-10 14:40 +0200 |
| Subject | Re: [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module |
| Message-ID | <sqI25-1gE-11@gated-at.bofh.it> |
| In reply to | #1497078 |
[Multipart message — attachments visible in raw view] — view raw
Hi,
On Fri, Oct 07, 2016 at 10:25:51AM +0200, Corentin Labbe wrote:
> This patch add the dt node for the syscon register present on the
> Allwinner H3.
>
> Only two register are present in this syscon and the only one useful is
> the one dedicated to EMAC clock.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
> arch/arm/boot/dts/sun8i-h3.dtsi | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
> index 8a95e36..1101d2f 100644
> --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> @@ -140,6 +140,11 @@
> #size-cells = <1>;
> ranges;
>
> + syscon: syscon@01c00000 {
> + compatible = "syscon";
It would be great to have a more specific compatible here in addition
to the syscon, like "allwinner,sun8i-h3-system-controller".
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | Jean-Francois Moine <moinejf@free.fr> |
|---|---|
| Date | 2016-10-10 15:00 +0200 |
| Subject | Re: [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module |
| Message-ID | <sqIlx-1ni-23@gated-at.bofh.it> |
| In reply to | #1498269 |
On Mon, 10 Oct 2016 14:31:51 +0200
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Fri, Oct 07, 2016 at 10:25:51AM +0200, Corentin Labbe wrote:
> > This patch add the dt node for the syscon register present on the
> > Allwinner H3.
> >
> > Only two register are present in this syscon and the only one useful is
> > the one dedicated to EMAC clock.
> >
> > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> > ---
> > arch/arm/boot/dts/sun8i-h3.dtsi | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
> > index 8a95e36..1101d2f 100644
> > --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> > +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> > @@ -140,6 +140,11 @@
> > #size-cells = <1>;
> > ranges;
> >
> > + syscon: syscon@01c00000 {
> > + compatible = "syscon";
>
> It would be great to have a more specific compatible here in addition
> to the syscon, like "allwinner,sun8i-h3-system-controller".
The System Control area is just like the PRCM area: it would be simpler
to define the specific registers in the associated drivers.
Here, instead of the syscon node, plus
+ emac: ethernet@1c30000 {
+ compatible = "allwinner,sun8i-h3-emac";
+ syscon = <&syscon>;
+ reg = <0x01c30000 0x104>;
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
...
there would be no 'syscon' node and
+ emac: ethernet@1c30000 {
+ compatible = "allwinner,sun8i-h3-emac";
+ syscon = <&syscon>;
+ reg = <0x01c30000 0x104>, /* EMAC */
+ <0x01c00030 4>; /* system control */
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
...
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
[toc] | [prev] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2016-10-11 12:00 +0200 |
| Subject | Re: [PATCH v4 04/10] ARM: dts: sun8i-h3: Add dt node for the syscon control module |
| Message-ID | <sr20N-52o-15@gated-at.bofh.it> |
| In reply to | #1498282 |
[Multipart message — attachments visible in raw view] — view raw
On Mon, Oct 10, 2016 at 02:50:21PM +0200, Jean-Francois Moine wrote:
> On Mon, 10 Oct 2016 14:31:51 +0200
> Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
>
> > Hi,
> >
> > On Fri, Oct 07, 2016 at 10:25:51AM +0200, Corentin Labbe wrote:
> > > This patch add the dt node for the syscon register present on the
> > > Allwinner H3.
> > >
> > > Only two register are present in this syscon and the only one useful is
> > > the one dedicated to EMAC clock.
> > >
> > > Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> > > ---
> > > arch/arm/boot/dts/sun8i-h3.dtsi | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > index 8a95e36..1101d2f 100644
> > > --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> > > +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> > > @@ -140,6 +140,11 @@
> > > #size-cells = <1>;
> > > ranges;
> > >
> > > + syscon: syscon@01c00000 {
> > > + compatible = "syscon";
> >
> > It would be great to have a more specific compatible here in addition
> > to the syscon, like "allwinner,sun8i-h3-system-controller".
>
> The System Control area is just like the PRCM area: it would be simpler
> to define the specific registers in the associated drivers.
Until you actually have to share those registers between different
devices, and then you're just screwed.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2016-10-07 10:40 +0200 |
| Subject | [PATCH v4 09/10] ARM: sunxi: Enable sun8i-emac driver on sunxi_defconfig |
| Message-ID | <spyRc-65a-37@gated-at.bofh.it> |
| In reply to | #1497068 |
Enable the sun8i-emac driver in the sunxi default configuration Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> --- arch/arm/configs/sunxi_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index 714da33..153707a 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig @@ -40,6 +40,7 @@ CONFIG_ATA=y CONFIG_AHCI_SUNXI=y CONFIG_NETDEVICES=y CONFIG_SUN4I_EMAC=y +CONFIG_SUN8I_EMAC=y # CONFIG_NET_VENDOR_ARC is not set # CONFIG_NET_CADENCE is not set # CONFIG_NET_VENDOR_BROADCOM is not set -- 2.7.3
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-10-07 17:10 +0200 |
| Subject | Re: [PATCH v4 01/10] ethernet: add sun8i-emac driver |
| Message-ID | <spEWB-2dt-9@gated-at.bofh.it> |
| In reply to | #1497068 |
On Fri, 2016-10-07 at 10:25 +0200, Corentin Labbe wrote:
> This patch add support for sun8i-emac ethernet MAC hardware.
> It could be found in Allwinner H3/A83T/A64 SoCs.
trivial notes:
> diff --git a/drivers/net/ethernet/allwinner/sun8i-emac.c b/drivers/net/ethernet/allwinner/sun8i-emac.c
[]
> +static const char const estats_str[][ETH_GSTRING_LEN] = {
one too many const
> +/* MAGIC value for knowing if a descriptor is available or not */
> +#define DCLEAN cpu_to_le32(BIT(16) | BIT(14) | BIT(12) | BIT(10) | BIT(9))
Aren't there #defines for these bits?
> +static void sun8i_emac_flow_ctrl(struct sun8i_emac_priv *priv, int duplex,
> + int fc)
> +{
> + u32 flow = 0;
> +
> + flow = readl(priv->base + EMAC_RX_CTL0);
> + if (fc & EMAC_FLOW_RX)
> + flow |= BIT(16);
> + else
> + flow &= ~BIT(16);
> + writel(flow, priv->base + EMAC_RX_CTL0);
> +
> + flow = readl(priv->base + EMAC_TX_FLOW_CTL);
> + if (fc & EMAC_FLOW_TX)
> + flow |= BIT(0);
> + else
> + flow &= ~BIT(0);
more magic bits that could be #defines
> +static int sun8i_emac_rx_from_ddesc(struct net_device *ndev, int i)
> +{
> []
> + /* the checksum or length of received frame's payload is wrong*/
> + if (dstatus & BIT(0)) {
[]
> + if (dstatus & BIT(1)) {
[]
> + if ((dstatus & BIT(3))) {
etc...
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web