Commit ffb3016b authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'stmmac-add-some-fixes-for-stm32'

Christophe Roullier says:

====================
stmmac: add some fixes for stm32

For common stmmac:
	- Add support to set CSR Clock range selection in DT
For stm32mpu:
	- Glue codes to support magic packet
	- Glue codes to support all PHY config :
		PHY_MODE (MII,GMII, RMII, RGMII) and in normal,
		PHY wo crystal (25Mhz),
		PHY wo crystal (50Mhz), No 125Mhz from PHY config
For stm32mcu:
	- Add Ethernet support for stm32h7

Changes in V3:
	- Reverse for syscfg management because it is manage by these patches
	  https://lkml.org/lkml/2018/12/12/133
	  https://lkml.org/lkml/2018/12/12/134
	  https://lkml.org/lkml/2018/12/12/131
	  https://lkml.org/lkml/2018/12/12/132


====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f1a16705 5473f1be
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@ Required properties:
- clock-names: Should be "stmmaceth" for the host clock.
	       Should be "mac-clk-tx" for the MAC TX clock.
	       Should be "mac-clk-rx" for the MAC RX clock.
	       For MPU family need to add also "ethstp" for power mode clock and,
	                                       "syscfg-clk" for SYSCFG clock.
	       For MPU family need to add also "ethstp" for power mode clock
- interrupt-names: Should contain a list of interrupt names corresponding to
           the interrupts in the interrupts property, if available.
		   Should be "macirq" for the main MAC IRQ
@@ -24,9 +23,9 @@ Required properties:
	       encompases the glue register, and the offset of the control register.

Optional properties:
- clock-names:     For MPU family "mac-clk-ck" for PHY without quartz
- st,int-phyclk (boolean) :  valid only where PHY do not have quartz and need to be clock
	           by RCC
- clock-names:     For MPU family "eth-ck" for PHY without quartz
- st,eth-clk-sel (boolean) : set this property in RGMII PHY when you want to select RCC clock instead of ETH_CLK125.
- st,eth-ref-clk-sel (boolean) :  set this property in RMII mode when you have PHY without crystal 50MHz and want to select RCC clock instead of ETH_REF_CLK.

Example:

+15 −0
Original line number Diff line number Diff line
@@ -173,6 +173,21 @@
				};
			};

			ethernet_rmii: rmii@0 {
				pins {
					pinmux = <STM32_PINMUX('G', 11, AF11)>,
						 <STM32_PINMUX('G', 13, AF11)>,
						 <STM32_PINMUX('G', 12, AF11)>,
						 <STM32_PINMUX('C', 4, AF11)>,
						 <STM32_PINMUX('C', 5, AF11)>,
						 <STM32_PINMUX('A', 7, AF11)>,
						 <STM32_PINMUX('C', 1, AF11)>,
						 <STM32_PINMUX('A', 2, AF11)>,
						 <STM32_PINMUX('A', 1, AF11)>;
					slew-rate = <2>;
				};
			};

			usart1_pins: usart1@0 {
				pins1 {
					pinmux = <STM32_PINMUX('B', 14, AF4)>; /* USART1_TX */
+13 −0
Original line number Diff line number Diff line
@@ -511,6 +511,19 @@
				status = "disabled";
			};
		};

		mac: ethernet@40028000 {
			compatible = "st,stm32-dwmac", "snps,dwmac-4.10a";
			reg = <0x40028000 0x8000>;
			reg-names = "stmmaceth";
			interrupts = <61>;
			interrupt-names = "macirq";
			clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx";
			clocks = <&rcc ETH1MAC_CK>, <&rcc ETH1TX_CK>, <&rcc ETH1RX_CK>;
			st,syscon = <&syscfg 0x4>;
			snps,pbl = <8>;
			status = "disabled";
		};
	};
};

+17 −0
Original line number Diff line number Diff line
@@ -66,6 +66,23 @@
	clock-frequency = <25000000>;
};

&mac {
	status = "disabled";
	pinctrl-0	= <&ethernet_rmii>;
	pinctrl-names	= "default";
	phy-mode	= "rmii";
	phy-handle	= <&phy0>;

	mdio0 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "snps,dwmac-mdio";
		phy0: ethernet-phy@0 {
			reg = <0>;
		};
	};
};

&usart2 {
	pinctrl-0 = <&usart2_pins>;
	pinctrl-names = "default";
+17 −0
Original line number Diff line number Diff line
@@ -104,6 +104,23 @@
	status = "okay";
};

&mac {
	status = "disabled";
	pinctrl-0	= <&ethernet_rmii>;
	pinctrl-names	= "default";
	phy-mode	= "rmii";
	phy-handle	= <&phy0>;

	mdio0 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "snps,dwmac-mdio";
		phy0: ethernet-phy@0 {
			reg = <0>;
		};
	};
};

&usart1 {
	pinctrl-0 = <&usart1_pins>;
	pinctrl-names = "default";
Loading