Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600473 > unrolled thread
| Started by | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| First post | 2017-03-14 15:30 +0100 |
| Last post | 2017-03-14 15:30 +0100 |
| Articles | 5 on this page of 25 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH v2 00/20] net-next: stmmac: add dwmac-sun8i ethernet driver Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 03/20] ARM: sun8i: dt: Add DT bindings documentation for Allwinner dwmac-sun8i Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
Re: [PATCH v2 03/20] ARM: sun8i: dt: Add DT bindings documentation for Allwinner dwmac-sun8i Rob Herring <robh@kernel.org> - 2017-03-20 23:30 +0100
[PATCH v2 18/20] ARM: dts: sun50i-a64: enable dwmac-sun8i on the BananaPi M64 Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 06/20] ARM: dts: sunxi-h3-h5: Add dt node for the syscon control module Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 13/20] ARM: dts: sun8i: orangepi-pc-plus: Set EMAC activity LEDs to active high Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 16/20] ARM: dts: sun50i-a64: enable dwmac-sun8i on pine64 Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
Re: [PATCH v2 16/20] ARM: dts: sun50i-a64: enable dwmac-sun8i on pine64 Florian Fainelli <f.fainelli@gmail.com> - 2017-03-14 19:30 +0100
[PATCH v2 14/20] ARM64: dts: sun50i-a64: Add dt node for the syscon control module Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
Re: [PATCH v2 14/20] ARM64: dts: sun50i-a64: Add dt node for the syscon control module Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-03-15 12:10 +0100
[PATCH v2 17/20] ARM: dts: sun50i-a64: enable dwmac-sun8i on pine64 plus Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 01/20] net-next: stmmac: export stmmac_set_mac_addr/stmmac_get_mac_addr Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 04/20] ARM: sun8i: dt: Add DT bindings documentation for Allwinner syscon Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
Re: [PATCH v2 04/20] ARM: sun8i: dt: Add DT bindings documentation for Allwinner syscon Rob Herring <robh@kernel.org> - 2017-03-21 02:10 +0100
[PATCH v2 19/20] ARM: sunxi: Enable dwmac-sun8i driver on sunxi_defconfig Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 20/20] ARM: sunxi: Enable dwmac-sun8i driver on multi_v7_defconfig Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 09/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange PI PC Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 12/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange Pi plus Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 08/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Banana Pi M2+ Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 05/20] net-next: stmmac: Add dwmac-sun8i Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 11/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange PI One Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 10/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange Pi 2 Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 15/20] ARM64: dts: sun50i-a64: add dwmac-sun8i Ethernet driver Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 07/20] ARM: dts: sunxi-h3-h5: add dwmac-sun8i ethernet driver Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
[PATCH v2 02/20] net-next: stmmac: add optional setup function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-14 15:30 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2017-03-14 15:30 +0100 |
| Subject | [PATCH v2 11/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange PI One |
| Message-ID | <tkVCz-1ny-45@gated-at.bofh.it> |
| In reply to | #1600473 |
The dwmac-sun8i hardware is present on the Orange PI One.
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-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 ea8fd13..1f98ddc 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
@@ -53,6 +53,7 @@
aliases {
serial0 = &uart0;
+ ethernet0 = &emac;
};
chosen {
@@ -93,6 +94,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.10.2
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2017-03-14 15:30 +0100 |
| Subject | [PATCH v2 10/20] ARM: dts: sun8i: Enable dwmac-sun8i on the Orange Pi 2 |
| Message-ID | <tkVCz-1ny-51@gated-at.bofh.it> |
| In reply to | #1600473 |
The dwmac-sun8i 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 5b6d145..3f54b12 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
@@ -55,6 +55,7 @@
serial0 = &uart0;
/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
ethernet1 = &rtl8189;
+ ethernet0 = &emac;
};
chosen {
@@ -203,3 +204,10 @@
usb1_vbus-supply = <®_usb1_vbus>;
status = "okay";
};
+
+&emac {
+ phy-handle = <&int_mii_phy>;
+ phy-mode = "mii";
+ allwinner,leds-active-low;
+ status = "okay";
+};
--
2.10.2
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2017-03-14 15:30 +0100 |
| Subject | [PATCH v2 15/20] ARM64: dts: sun50i-a64: add dwmac-sun8i Ethernet driver |
| Message-ID | <tkVCz-1ny-43@gated-at.bofh.it> |
| In reply to | #1600473 |
The dwmac-sun8i is an Ethernet MAC that supports 10/100/1000 Mbit
connections. It is very similar to the device found in the Allwinner
H3, but lacks the internal 100 Mbit PHY and its associated control
bits.
This adds the necessary bits to the Allwinner A64 SoC .dtsi, but keeps
it disabled at this level.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 37 +++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 3b09af2..57d69e5 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -277,6 +277,23 @@
bias-pull-up;
};
+ rmii_pins: rmii_pins {
+ pins = "PD10", "PD11", "PD13", "PD14",
+ "PD17", "PD18", "PD19", "PD20",
+ "PD22", "PD23";
+ function = "emac";
+ drive-strength = <40>;
+ };
+
+ rgmii_pins: rgmii_pins {
+ pins = "PD8", "PD9", "PD10", "PD11",
+ "PD12", "PD13", "PD15",
+ "PD16", "PD17", "PD18", "PD19",
+ "PD20", "PD21", "PD22", "PD23";
+ function = "emac";
+ drive-strength = <40>;
+ };
+
uart0_pins_a: uart0@0 {
pins = "PB8", "PB9";
function = "uart0";
@@ -381,6 +398,26 @@
#size-cells = <0>;
};
+ emac: ethernet@1c30000 {
+ compatible = "allwinner,sun50i-a64-emac";
+ syscon = <&syscon>;
+ reg = <0x01c30000 0x100>;
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ resets = <&ccu RST_BUS_EMAC>;
+ reset-names = "stmmaceth";
+ clocks = <&ccu CLK_BUS_EMAC>;
+ clock-names = "stmmaceth";
+ status = "disabled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ mdio: mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
gic: interrupt-controller@1c81000 {
compatible = "arm,gic-400";
reg = <0x01c81000 0x1000>,
--
2.10.2
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2017-03-14 15:30 +0100 |
| Subject | [PATCH v2 07/20] ARM: dts: sunxi-h3-h5: add dwmac-sun8i ethernet driver |
| Message-ID | <tkVCz-1ny-47@gated-at.bofh.it> |
| In reply to | #1600473 |
The dwmac-sun8i is an ethernet MAC hardware that support 10/100/1000
speed.
This patch enable the dwmac-sun8i on Allwinner H3/H5 SoC Device-tree.
SoC H3/H5 have an internal PHY, so optionals syscon and ephy are set.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index 07e4f36..c35af5e 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -272,6 +272,14 @@
interrupt-controller;
#interrupt-cells = <3>;
+ emac_rgmii_pins: emac0@0 {
+ pins = "PD0", "PD1", "PD2", "PD3", "PD4",
+ "PD5", "PD7", "PD8", "PD9", "PD10",
+ "PD12", "PD13", "PD15", "PD16", "PD17";
+ function = "emac";
+ drive-strength = <40>;
+ };
+
i2c0_pins: i2c0 {
pins = "PA11", "PA12";
function = "i2c0";
@@ -368,6 +376,31 @@
clocks = <&osc24M>;
};
+ emac: ethernet@1c30000 {
+ compatible = "allwinner,sun8i-h3-emac";
+ syscon = <&syscon>;
+ reg = <0x01c30000 0x104>;
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ resets = <&ccu RST_BUS_EMAC>;
+ reset-names = "stmmaceth";
+ clocks = <&ccu CLK_BUS_EMAC>;
+ clock-names = "stmmaceth";
+ #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>;
+ };
+ };
+ };
+
spi0: spi@01c68000 {
compatible = "allwinner,sun8i-h3-spi";
reg = <0x01c68000 0x1000>;
--
2.10.2
[toc] | [prev] | [next] | [standalone]
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2017-03-14 15:30 +0100 |
| Subject | [PATCH v2 02/20] net-next: stmmac: add optional setup function |
| Message-ID | <tkVCz-1ny-49@gated-at.bofh.it> |
| In reply to | #1600473 |
Instead of ading more ifthen logic for adding a new mac_device_info
setup function, it is easier to add a function pointer to the function
needed.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++-
include/linux/stmmac.h | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4498a38..856ac57 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3101,7 +3101,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
struct mac_device_info *mac;
/* Identify the MAC HW device */
- if (priv->plat->has_gmac) {
+ if (priv->plat->setup) {
+ mac = priv->plat->setup(priv);
+ } else if (priv->plat->has_gmac) {
priv->dev->priv_flags |= IFF_UNICAST_FLT;
mac = dwmac1000_setup(priv->ioaddr,
priv->plat->multicast_filter_bins,
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index fc273e9..8f09f18 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -109,6 +109,8 @@ struct stmmac_axi {
bool axi_rb;
};
+struct stmmac_priv;
+
struct plat_stmmacenet_data {
int bus_id;
int phy_addr;
@@ -136,6 +138,7 @@ struct plat_stmmacenet_data {
void (*fix_mac_speed)(void *priv, unsigned int speed);
int (*init)(struct platform_device *pdev, void *priv);
void (*exit)(struct platform_device *pdev, void *priv);
+ struct mac_device_info *(*setup)(struct stmmac_priv *priv);
void *bsp_priv;
struct clk *stmmac_clk;
struct clk *pclk;
--
2.10.2
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web