Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Merge branch 'xgene-fix-mod-crash-and-1g-hotplug'



Iyappan Subramanian says:

====================
drivers: net: xgene: Fix module crash and 1G hot-plug

This patchset addresses the following issues,

1. Fixes the kernel crash when the driver loaded as an kernel module
	- by fixing hardware cleanups and rearrange kernel API calls

2. Hot-plug issue on the SGMII 1G interface
	- by adding a driver for MDIO management

Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
Tested-by: default avatarFushen Chen <fchen@apm.com>
Tested-by: default avatarToan Le <toanle@apm.com>
---
v7: Address review comments from v6
	- fixed kbuild warnings
	- unmapped DMA memory on xgene_enet_delete_bufpool()
	- delete descriptor rings and buffer pools on cle_init() failure
	- fixed error deconstruction path on probe

v6: Address review comments from v5
	- changed to use devm_ioremap_resource
	- changed to return PTR_ERR(clk) on failure
	- cleaned up and removed indirections
	- exported mdio read/write and phy_register functions
	- changed mii_bus is to indicate interface instance
	- changed to call the exported mdio read/write and phy_register functions

v5: Address review comments from v4
	- Fixed clock reset sequence by adding delay
	- Fixed clock count by adding clk_unprepare_disable() in port shutdown

v4: Address review comments from v3
	- Reorganized into smaller patches
	- Added wrapper functions for sgmii_control_reset and sgmii_tbi_control_reset
	- Removed clk_get warning info
	- mdio: Changed the order of 'if' statements and removed the 'else' statement
	- mdio: Removed the mdio_read(write) indirection wrapper functions
	- ethtool: Fixed SGMII 1G get_settings and set_settings
	- Documentation: dtb: Added MDIO node information
	- MAINTAINERS: Added MDIO driver and documentation path

v3: Address review comments from v2
	- Add comment about hardware clock reset sequence on xgene_mdio_reset

v2: Address review comments from v1
	- Fixed patch 1 compilation error
	- Fixed mdio@1f610000 xge0clk reference
	- Squashed dtb patches
	- Added PORT_OFFSET macro

v1:
	- Initial version
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c43212bb 2efccc60
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
APM X-Gene SoC MDIO node

MDIO node is defined to describe on-chip MDIO controller.

Required properties:
	- compatible: Must be "apm,xgene-mdio-rgmii" or "apm,xgene-mdio-xfi"
	- #address-cells: Must be <1>.
	- #size-cells: Must be <0>.
	- reg: Address and length of the register set
	- clocks: Reference to the clock entry

For the phys on the mdio bus, there must be a node with the following fields:
	- compatible: PHY identifier.  Please refer ./phy.txt for the format.
	- reg: The ID number for the phy.

Example:

	mdio: mdio@17020000 {
		compatible = "apm,xgene-mdio-rgmii";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x0 0x17020000 0x0 0xd100>;
		clocks = <&menetclk 0>;
	};

	/* Board-specific peripheral configurations */
	&mdio {
		menetphy: phy@3 {
			reg = <0x3>;
		};
		sgenet0phy: phy@4 {
			reg = <0x4>;
		};
		sgenet1phy: phy@5 {
			reg = <0x5>;
		};
	};
+2 −0
Original line number Diff line number Diff line
@@ -839,7 +839,9 @@ M: Iyappan Subramanian <isubramanian@apm.com>
M:	Keyur Chudgar <kchudgar@apm.com>
S:	Supported
F:	drivers/net/ethernet/apm/xgene/
F:	drivers/net/phy/mdio-xgene.c
F:	Documentation/devicetree/bindings/net/apm-xgene-enet.txt
F:	Documentation/devicetree/bindings/net/apm-xgene-mdio.txt

APTINA CAMERA SENSOR PLL
M:	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
+6 −0
Original line number Diff line number Diff line
@@ -83,3 +83,9 @@
		status = "ok";
	};
};

&mdio {
	sgenet0phy: phy@0 {
		reg = <0x0>;
	};
};
+12 −0
Original line number Diff line number Diff line
@@ -79,3 +79,15 @@
&mmc0 {
	status = "ok";
};

&mdio {
	menet0phy: phy@3 {
		reg = <0x3>;
	};
	sgenet0phy: phy@4 {
		reg = <0x4>;
	};
	sgenet1phy: phy@5 {
		reg = <0x5>;
	};
};
+10 −1
Original line number Diff line number Diff line
@@ -625,10 +625,18 @@
			apm,irq-start = <8>;
		};

		mdio: mdio@1f610000 {
			compatible = "apm,xgene-mdio-xfi";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x0 0x1f610000 0x0 0xd100>;
			clocks = <&xge0clk 0>;
		};

		sgenet0: ethernet@1f610000 {
			compatible = "apm,xgene2-sgenet";
			status = "disabled";
			reg = <0x0 0x1f610000 0x0 0x10000>,
			reg = <0x0 0x1f610000 0x0 0xd100>,
			      <0x0 0x1f600000 0x0 0Xd100>,
			      <0x0 0x20000000 0x0 0X20000>;
			interrupts = <0 96 4>,
@@ -637,6 +645,7 @@
			clocks = <&xge0clk 0>;
			local-mac-address = [00 01 73 00 00 01];
			phy-connection-type = "sgmii";
			phy-handle = <&sgenet0phy>;
		};

		xgenet1: ethernet@1f620000 {
Loading