Skip to content

Commit

Permalink
net: stmmac:sti: Add STi SOC glue driver.
Browse files Browse the repository at this point in the history
STi series SOCs have a glue layer on top of the synopsis gmac IP, this
glue layer needs to be configured before the gmac driver starts using
the IP.

This patch adds a support to this glue layer which is configured via
stmmac setup, init, exit callbacks.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Srinivas Kandagatla authored and David S. Miller committed Feb 13, 2014
1 parent c7966b5 commit d15891c
Show file tree
Hide file tree
Showing 6 changed files with 408 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Documentation/devicetree/bindings/net/sti-dwmac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
STMicroelectronics SoC DWMAC glue layer controller

The device node has following properties.

Required properties:
- compatible : Can be "st,stih415-dwmac", "st,stih416-dwmac" or
"st,stid127-dwmac".
- reg : Offset of the glue configuration register map in system
configuration regmap pointed by st,syscon property and size.

- reg-names : Should be "sti-ethconf".

- st,syscon : Should be phandle to system configuration node which
encompases this glue registers.

- st,tx-retime-src: On STi Parts for Giga bit speeds, 125Mhz clocks can be
wired up in from different sources. One via TXCLK pin and other via CLK_125
pin. This wiring is totally board dependent. However the retiming glue
logic should be configured accordingly. Possible values for this property

"txclk" - if 125Mhz clock is wired up via txclk line.
"clk_125" - if 125Mhz clock is wired up via clk_125 line.

This property is only valid for Giga bit setup( GMII, RGMII), and it is
un-used for non-giga bit (MII and RMII) setups. Also note that internal
clockgen can not generate stable 125Mhz clock.

- st,ext-phyclk: This boolean property indicates who is generating the clock
for tx and rx. This property is only valid for RMII case where the clock can
be generated from the MAC or PHY.

- clock-names: should be "sti-ethclk".
- clocks: Should point to ethernet clockgen which can generate phyclk.


Example:

ethernet0: dwmac@fe810000 {
device_type = "network";
compatible = "st,stih416-dwmac", "snps,dwmac", "snps,dwmac-3.710";
reg = <0xfe810000 0x8000>, <0x8bc 0x4>;
reg-names = "stmmaceth", "sti-ethconf";
interrupts = <0 133 0>, <0 134 0>, <0 135 0>;
interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
phy-mode = "mii";

st,syscon = <&syscfg_rear>;

snps,pbl = <32>;
snps,mixed-burst;

resets = <&softreset STIH416_ETH0_SOFTRESET>;
reset-names = "stmmaceth";
pinctrl-0 = <&pinctrl_mii0>;
pinctrl-names = "default";
clocks = <&CLK_S_GMAC0_PHY>;
clock-names = "stmmaceth";
};
11 changes: 11 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ config DWMAC_SUNXI
stmmac device driver. This driver is used for A20/A31
GMAC ethernet controller.

config DWMAC_STI
bool "STi GMAC support"
depends on STMMAC_PLATFORM && ARCH_STI
default y
---help---
Support for ethernet controller on STi SOCs.

This selects STi SoC glue layer support for the stmmac
device driver. This driver is used on for the STi series
SOCs GMAC ethernet controller.

config STMMAC_PCI
bool "STMMAC PCI bus support"
depends on STMMAC_ETH && PCI
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ obj-$(CONFIG_STMMAC_ETH) += stmmac.o
stmmac-$(CONFIG_STMMAC_PLATFORM) += stmmac_platform.o
stmmac-$(CONFIG_STMMAC_PCI) += stmmac_pci.o
stmmac-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o
stmmac-$(CONFIG_DWMAC_STI) += dwmac-sti.o
stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \
chain_mode.o dwmac_lib.o dwmac1000_core.o dwmac1000_dma.o \
dwmac100_core.o dwmac100_dma.o enh_desc.o norm_desc.o \
Expand Down
Loading

0 comments on commit d15891c

Please sign in to comment.