summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
AgeCommit message (Collapse)Author
2013-04-08stmmac: code tidy-upGiuseppe CAVALLARO
This patch tidies up the code. I have run Linden (and verified with checkpatch) many part of the driver trying to reorganize some sections respecting the codying-style rules in the points where it was not done. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-02-10stmmac: mdio register has to fail if the phy is not foundGiuseppe CAVALLARO
With this patch the stmmac fails in case of the phy device is not found; w/o this fix the mdio can be register twice when do down/up the iface and this is not correct. Reported-by: Stas <stsp@list.ru> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-31net:stmmac: Remove bus_id from mdio platform data.Srinivas Kandagatla
This patch removes bus_id from mdio platform data, The reason to remove bus_id is, stmmac mdio bus_id is always same as stmmac bus-id, so there is no point in passing this in different variable. Also stmmac ethernet driver connects to phy with bus_id passed its platform data. So, having single bus-id is much simpler. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-31net:stmmac: Add check if mdiobus is registered in stmmac_mdio_unregisterSrinivas Kandagatla
This patch adds a basic check in stmmac_mdio_unregister to see if mdio bus registeration for this driver was actually sucessfull or not. Use case here is, if BSP considers using mdio-gpio bus along with stmmac driver by passing mdio_bus_data as NULL in platform data. Call to stmmac_mdio_register with mdio_bus_data as NULL returns 0, which is a considered sucessfull call form stmmac. Then again when we unload the driver we just call stmmac_mdio_unregister, this is were the actual problem is stmmac-mdio code dont really know at this instance of calling that stmmac_mdio_register was actually successful. So Adding a check in stmmac_mdio_unregister is always safe. Without this patch stmmac driver calls stmmac_mdio_register from stmmac_release which Segfaults as mii bus was never registered at the first point. Originally the this bug was found when unloading an stmmac driver instance which uses mdio-gpio for smi access. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04stmmac: MDC clock dynamically based on the csr clock inputGiuseppe CAVALLARO
If a specific clk_csr value is passed from the platform this means that the CSR Clock Range selection cannot be changed at run-time and it is fixed (as reported in the driver documentation). Viceversa the driver will try to set the MDC clock dynamically according to the actual clock input. Signed-off-by: Deepak Sikri <deepak.sikri@st.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reviewed-by: Francesco Virlinzi <francesco.virlinzi@st.com> Reviewed-by: David Laight <david.laight@aculab.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04stmmac: extend CSR Clock Range programmingGiuseppe CAVALLARO
The CSR Clock Range has been reworked and new macros has been added in the platform header to allow the CSR Clock Range selection in the GMII Address Register. The previous work didn't add the other fields that can be used to achieve MDC clock of frequency higher than the IEEE 802.3 specified frequency limit of 2.5 MHz and program a clock divider of lower value. On such platforms, these are used indeed so this patch adds them. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04stmmac: Replace infinite loops by timeouts in mdio r/wDeepak SIKRI
This patch removes the infinite waits from the mdio read and write interfaces. These infinite waits have been replaced by the timeout handling. In case if a time out occurs, an error is returned. Signed-off-by: Deepak Sikri <deepak.sikri@st.com> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-24stmmac: fix phy naming inconsistencyAlessandro Rubini
After commit "db8857b stmmac: use an unique MDIO bus name" my device stopped being probed because two different names were being used in different places. This fixes the inconsistency. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Florian Fainelli <florian@openwrt.org> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-10stmmac: use an unique MDIO bus name.Florian Fainelli
Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-21stmmac: add the experimental PCI supportGiuseppe CAVALLARO
This patch adds the PCI support (as EXPERIMENTAL) this has been also tested on XLINX XC2V3000 FF1152AMT0221 D1215994A VIRTEX FPGA board. To support the PCI bus the main part has been reworked and both the platform and the PCI specific parts have been moved into different files. Signed-off-by: Rayagond Kokatanur <rayagond@vayavyalabs.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-11stmmac: Move the STMicroelectronics driverJeff Kirsher
Move the STMicroelectronics driver into driver/net/ethernet/stmicro/ and make the necessary Kconfig and Makefile changes. CC: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>