aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-08-11 14:51:19 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-11 14:51:19 -0400
commit217e606bf69c0c9f2ef25def38e9f2a8969578f5 (patch)
treeeb1973422d780d9295bddd2da617812cd1c73456
parentf00439e2e34e97130981c8b68310b8b77b86645a (diff)
parente6ad767305eb6ea80ce06c1eaa1b0977e8361998 (diff)
Merge branch 'apm_xgene'
Iyappan Subramanian says: ==================== net: Add APM X-Gene SoC Ethernet driver support Adding APM X-Gene SoC Ethernet driver. v10: Address comments from v9 review * Documentation: aligned descriptions * simplified struct platform_driver initialization * fixed xgene_enet_mdio_config error path * fixed xgene_enet_init_hw error path * removed statistics spin_lock as it is not required * changed raw_desc fields to type __le64 * defined helper macros for set/get raw_descriptor fields v9: Address comments from v8 review * changed to direct read/write, byteswap into raw descriptor * fixed xgene_enet_create_desc_ring() error handling * removed references to IS_ERR_OR_NULL * disabled half duplex on phy_devce supported/advertising * simplified xgene_enet_adjust_link() function * fixed sparse tool compilation warnings v8: Address comments from v7 review * changed angle bracket to double quotes in header file include. v7: Address comments from v6 review * fixed skb memory leak when dma_map_single fails in xmit. v6: Address comments from v5 review * added basic ethtool support * added ndo_get_stats64 call back * deleted priting Rx error messages * renamed set_bits to xgene_set_bits to fix kbuild error (make ARCH=powerpc) v5: Address comments from v4 review * Documentation: Added phy-handle, reg-names and changed mdio part * dtb: Added reg-names supplemental property * changed platform_get_resource to platform_get_resource_byname * added separate tx/rx set_desc/get_desc functions to do raw_write/raw_read * removed set_desc/get_desc table lookup logic * added error handling logic based on per packet descriptor bits * added software managed Rx packet and error counters * added busy wait for register read/writes * changed mdio_bus->id to avoid conflict * fixed mdio_bus leak in case of mdio_config error * changed phy reg hard coded value to MII_BMSR * changed phy addr hard coded value to phy_device->addr * added paranthesis around macro arguments * converted helper macros to inline functions * changed use of goto's only to common work such as cleanup v4: Address comments from v3 review * MAINTAINERS: changed status to supported * Kconfig: made default to no * changed to bool data type wherever applicable * cleaned up single bit set and masking code * removed statistics counters masking * removed unnecessary OOM message printing * fixed dma_map_single and dma_unmap_single size parameter * changed set bits macro body using new set_bits function v3: Address comments from v2 review * cleaned up set_desc and get_desc functions * added dtb mdio node and phy-handle subnode * renamed dtb phy-mode to phy-connection-type * added of_phy_connect call to connec to PHY * added empty line after last local variable declaration * removed type casting when not required * removed inline keyword from source files * removed CONFIG_CPU_BIG_ENDIAN ifdef v2 * Completely redesigned ethernet driver * Added support to work with big endian kernel * Renamed dtb phyid entry to phy_addr * Changed dtb local-mac-address entry to byte string format * Renamed dtb eth8clk entry to menetclk v1 * Initial version ==================== Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Ravi Patel <rapatel@apm.com> Signed-off-by: Keyur Chudgar <kchudgar@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/devicetree/bindings/net/apm-xgene-enet.txt66
-rw-r--r--MAINTAINERS8
-rw-r--r--arch/arm64/boot/dts/apm-mustang.dts4
-rw-r--r--arch/arm64/boot/dts/apm-storm.dtsi30
-rw-r--r--drivers/net/ethernet/Kconfig1
-rw-r--r--drivers/net/ethernet/Makefile1
-rw-r--r--drivers/net/ethernet/apm/Kconfig1
-rw-r--r--drivers/net/ethernet/apm/Makefile5
-rw-r--r--drivers/net/ethernet/apm/xgene/Kconfig9
-rw-r--r--drivers/net/ethernet/apm/xgene/Makefile6
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c125
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_hw.c728
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_hw.h337
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_main.c951
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_main.h135
15 files changed, 2404 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/net/apm-xgene-enet.txt b/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
new file mode 100644
index 000000000000..ebcad25efd0a
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/apm-xgene-enet.txt
@@ -0,0 +1,66 @@
1APM X-Gene SoC Ethernet nodes
2
3Ethernet nodes are defined to describe on-chip ethernet interfaces in
4APM X-Gene SoC.
5
6Required properties:
7- compatible: Should be "apm,xgene-enet"
8- reg: Address and length of the register set for the device. It contains the
9 information of registers in the same order as described by reg-names
10- reg-names: Should contain the register set names
11 - "enet_csr": Ethernet control and status register address space
12 - "ring_csr": Descriptor ring control and status register address space
13 - "ring_cmd": Descriptor ring command register address space
14- interrupts: Ethernet main interrupt
15- clocks: Reference to the clock entry.
16- local-mac-address: MAC address assigned to this device
17- phy-connection-type: Interface type between ethernet device and PHY device
18- phy-handle: Reference to a PHY node connected to this device
19
20- mdio: Device tree subnode with the following required properties:
21 - compatible: Must be "apm,xgene-mdio".
22 - #address-cells: Must be <1>.
23 - #size-cells: Must be <0>.
24
25 For the phy on the mdio bus, there must be a node with the following fields:
26 - compatible: PHY identifier. Please refer ./phy.txt for the format.
27 - reg: The ID number for the phy.
28
29Optional properties:
30- status: Should be "ok" or "disabled" for enabled/disabled. Default is "ok".
31
32Example:
33 menetclk: menetclk {
34 compatible = "apm,xgene-device-clock";
35 clock-output-names = "menetclk";
36 status = "ok";
37 };
38
39 menet: ethernet@17020000 {
40 compatible = "apm,xgene-enet";
41 status = "disabled";
42 reg = <0x0 0x17020000 0x0 0xd100>,
43 <0x0 0X17030000 0x0 0X400>,
44 <0x0 0X10000000 0x0 0X200>;
45 reg-names = "enet_csr", "ring_csr", "ring_cmd";
46 interrupts = <0x0 0x3c 0x4>;
47 clocks = <&menetclk 0>;
48 local-mac-address = [00 01 73 00 00 01];
49 phy-connection-type = "rgmii";
50 phy-handle = <&menetphy>;
51 mdio {
52 compatible = "apm,xgene-mdio";
53 #address-cells = <1>;
54 #size-cells = <0>;
55 menetphy: menetphy@3 {
56 compatible = "ethernet-phy-id001c.c915";
57 reg = <0x3>;
58 };
59
60 };
61 };
62
63/* Board-specific peripheral configurations */
64&menet {
65 status = "ok";
66};
diff --git a/MAINTAINERS b/MAINTAINERS
index 05e545096100..e8ac35270823 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -719,6 +719,14 @@ S: Maintained
719F: drivers/net/appletalk/ 719F: drivers/net/appletalk/
720F: net/appletalk/ 720F: net/appletalk/
721 721
722APPLIED MICRO (APM) X-GENE SOC ETHERNET DRIVER
723M: Iyappan Subramanian <isubramanian@apm.com>
724M: Keyur Chudgar <kchudgar@apm.com>
725M: Ravi Patel <rapatel@apm.com>
726S: Supported
727F: drivers/net/ethernet/apm/xgene/
728F: Documentation/devicetree/bindings/net/apm-xgene-enet.txt
729
722APTINA CAMERA SENSOR PLL 730APTINA CAMERA SENSOR PLL
723M: Laurent Pinchart <Laurent.pinchart@ideasonboard.com> 731M: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
724L: linux-media@vger.kernel.org 732L: linux-media@vger.kernel.org
diff --git a/arch/arm64/boot/dts/apm-mustang.dts b/arch/arm64/boot/dts/apm-mustang.dts
index 6541962f5d70..b2f56229aa5e 100644
--- a/arch/arm64/boot/dts/apm-mustang.dts
+++ b/arch/arm64/boot/dts/apm-mustang.dts
@@ -28,3 +28,7 @@
28&serial0 { 28&serial0 {
29 status = "ok"; 29 status = "ok";
30}; 30};
31
32&menet {
33 status = "ok";
34};
diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi
index 40aa96ce13c4..c0aceef7f5b3 100644
--- a/arch/arm64/boot/dts/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm-storm.dtsi
@@ -167,14 +167,13 @@
167 clock-output-names = "ethclk"; 167 clock-output-names = "ethclk";
168 }; 168 };
169 169
170 eth8clk: eth8clk { 170 menetclk: menetclk {
171 compatible = "apm,xgene-device-clock"; 171 compatible = "apm,xgene-device-clock";
172 #clock-cells = <1>; 172 #clock-cells = <1>;
173 clocks = <&ethclk 0>; 173 clocks = <&ethclk 0>;
174 clock-names = "eth8clk";
175 reg = <0x0 0x1702C000 0x0 0x1000>; 174 reg = <0x0 0x1702C000 0x0 0x1000>;
176 reg-names = "csr-reg"; 175 reg-names = "csr-reg";
177 clock-output-names = "eth8clk"; 176 clock-output-names = "menetclk";
178 }; 177 };
179 178
180 sataphy1clk: sataphy1clk@1f21c000 { 179 sataphy1clk: sataphy1clk@1f21c000 {
@@ -397,5 +396,30 @@
397 #clock-cells = <1>; 396 #clock-cells = <1>;
398 clocks = <&rtcclk 0>; 397 clocks = <&rtcclk 0>;
399 }; 398 };
399
400 menet: ethernet@17020000 {
401 compatible = "apm,xgene-enet";
402 status = "disabled";
403 reg = <0x0 0x17020000 0x0 0xd100>,
404 <0x0 0X17030000 0x0 0X400>,
405 <0x0 0X10000000 0x0 0X200>;
406 reg-names = "enet_csr", "ring_csr", "ring_cmd";
407 interrupts = <0x0 0x3c 0x4>;
408 dma-coherent;
409 clocks = <&menetclk 0>;
410 local-mac-address = [00 01 73 00 00 01];
411 phy-connection-type = "rgmii";
412 phy-handle = <&menetphy>;
413 mdio {
414 compatible = "apm,xgene-mdio";
415 #address-cells = <1>;
416 #size-cells = <0>;
417 menetphy: menetphy@3 {
418 compatible = "ethernet-phy-id001c.c915";
419 reg = <0x3>;