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

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

Merge branch 'xgene'



Iyappan Subramanian says:

====================
Adding SGMII based 1GbE basic support to APM X-Gene SoC ethernet driver.

v2: Address comments from v1
* Split the patchset into two, the first one being preparatory patch
* Added link_state function pointer to the xgene_mac_ops structure
* Added xgene_indirect_ctl structure for indirect read/write arguments

v1:
* Initial version
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c15952dc 5e6a024b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@
	status = "ok";
};

&sgenet0 {
	status = "ok";
};

&xgenet {
	status = "ok";
};
+24 −0
Original line number Diff line number Diff line
@@ -176,6 +176,16 @@
				clock-output-names = "menetclk";
			};

			sge0clk: sge0clk@1f21c000 {
				compatible = "apm,xgene-device-clock";
				#clock-cells = <1>;
				clocks = <&socplldiv2 0>;
				reg = <0x0 0x1f21c000 0x0 0x1000>;
				reg-names = "csr-reg";
				csr-mask = <0x3>;
				clock-output-names = "sge0clk";
			};

			xge0clk: xge0clk@1f61c000 {
				compatible = "apm,xgene-device-clock";
				#clock-cells = <1>;
@@ -446,6 +456,20 @@
			};
		};

		sgenet0: ethernet@1f210000 {
			compatible = "apm,xgene-enet";
			status = "disabled";
			reg = <0x0 0x1f210000 0x0 0x10000>,
			      <0x0 0x1f200000 0x0 0X10000>,
			      <0x0 0x1B000000 0x0 0X20000>;
			reg-names = "enet_csr", "ring_csr", "ring_cmd";
			interrupts = <0x0 0xA0 0x4>;
			dma-coherent;
			clocks = <&sge0clk 0>;
			local-mac-address = [00 00 00 00 00 00];
			phy-connection-type = "sgmii";
		};

		xgenet: ethernet@1f610000 {
			compatible = "apm,xgene-enet";
			status = "disabled";
+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,6 @@
# Makefile for APM X-Gene Ethernet Driver.
#

xgene-enet-objs := xgene_enet_hw.o xgene_enet_xgmac.o \
xgene-enet-objs := xgene_enet_hw.o xgene_enet_sgmac.o xgene_enet_xgmac.o \
		   xgene_enet_main.o xgene_enet_ethtool.o
obj-$(CONFIG_NET_XGENE) += xgene-enet.o
+17 −8
Original line number Diff line number Diff line
@@ -64,15 +64,24 @@ static int xgene_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
			return -ENODEV;

		return phy_ethtool_gset(phydev, cmd);
	}

	} else if (pdata->phy_mode == PHY_INTERFACE_MODE_SGMII) {
		cmd->supported = SUPPORTED_1000baseT_Full |
				 SUPPORTED_Autoneg | SUPPORTED_MII;
		cmd->advertising = cmd->supported;
		ethtool_cmd_speed_set(cmd, SPEED_1000);
		cmd->duplex = DUPLEX_FULL;
		cmd->port = PORT_MII;
		cmd->transceiver = XCVR_INTERNAL;
		cmd->autoneg = AUTONEG_ENABLE;
	} else {
		cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE;
		cmd->advertising = cmd->supported;
		ethtool_cmd_speed_set(cmd, SPEED_10000);
		cmd->duplex = DUPLEX_FULL;
		cmd->port = PORT_FIBRE;
	cmd->transceiver = XCVR_EXTERNAL;
		cmd->transceiver = XCVR_INTERNAL;
		cmd->autoneg = AUTONEG_DISABLE;
	}

	return 0;
}
+0 −1
Original line number Diff line number Diff line
@@ -410,7 +410,6 @@ static void xgene_gmac_set_mac_addr(struct xgene_enet_pdata *pdata)
	addr0 = (dev_addr[3] << 24) | (dev_addr[2] << 16) |
		(dev_addr[1] << 8) | dev_addr[0];
	addr1 = (dev_addr[5] << 24) | (dev_addr[4] << 16);
	addr1 |= pdata->phy_addr & 0xFFFF;

	xgene_enet_wr_mcx_mac(pdata, STATION_ADDR0_ADDR, addr0);
	xgene_enet_wr_mcx_mac(pdata, STATION_ADDR1_ADDR, addr1);
Loading