summaryrefslogtreecommitdiff
path: root/drivers/net/davinci_emac.c
Commit message (Collapse)AuthorAgeLines
* net: davince: add missing includeJeroen Hofstee2014-10-25-0/+1
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-15/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* da850/omap-l138: davinci_emac: Suppress auto negotiation if neededBastian Ruppert2012-10-01-1/+2
| | | | | | | | | | | | | | negotiation is enabled in RMII mode. Some boards based on da850 need to suppress this procedure. CC: Rajashekhara, Sudhakar <sudhakar.raj@ti.com> CC: Lad, Prabhakar <prabhakar.lad@ti.com> CC: Hadli, Manjunath <manjunath.hadli@ti.com> CC: sbabic@denx.de Acked-by: Stefano Babic <sbabic@denx.de> CC: Tom Rini <trini@ti.com> Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de> Acked-by: Prabhakar Lad <prabhakar.lad@ti.com>
* da850/omap-l138: Enable auto negotiation in RMII modeRajashekhara, Sudhakar2012-07-07-0/+8
| | | | | | | | | | | | On DA850/OMAP-L138 it was observed that in RMII mode, auto negotiation was not performed. This patch enables auto negotiation in RMII mode. Without this patch, EMAC initialization takes more time and sometimes tftp fails in RMII mode. Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Hadli, Manjunath <manjunath.hadli@ti.com>
* davinci: Fix Ethernet driver interface warningJoe Hershberger2012-05-22-1/+1
| | | | | | | | | | | Fixes: davinci_emac.c: In function 'davinci_emac_initialize': davinci_emac.c:796:12: warning: assignment from incompatible pointer type [enabled by default] Tested on da850_am18xxevm Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com>
* ARM: davici_emac: Fix condition for number of phy detectsPrabhakar Lad2011-12-06-1/+1
| | | | | | | | | | | Fix the condition for number of phys in davinci_eth_phy_detect() function. CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT indicates number of phys. From this commit id dc02badab480563b0bf9d3908046ea9d6b22ae63 davinci emac initilazed one less than the number of phy count. Signed-off-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Acked-by: Heiko Schocher <hs@denx.de>
* davinci_emac: hardcode 100Mbps for AM35xx and RMIIIlya Yanok2011-12-06-1/+2
| | | | | | | For some reason code setting the speed based on the PHY feedback causes troubles on AM3517 so hardcode 100Mbps for now. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* davinci_emac: fix for running with dcache enabledIlya Yanok2011-12-06-2/+39
| | | | | | | | | | | | DaVinci EMAC is present on TI AM35xx SoCs (ARMv7) which run with D-Cache enabled by default. So we have to take care and flush/invalidate the cache before/after the DMA operations. Please note that the receive buffer alignment to 32 byte boundary comes from the old driver version I don't know if it is really needed or alignment to cache line size is enough. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* davinci_emac: conditionally compile specific PHY supportIlya Yanok2011-12-06-0/+8
| | | | Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* davinci_emac: use internal addresses in buffer descriptorsIlya Yanok2011-12-06-9/+30
| | | | | | | | On AM35xx CPPI RAM had different addresses when accessed from the CPU and from the EMAC. We need to account this to deal with the buffer descriptors correctly. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* davinci_emac: move arch-independent defines to separate headerIlya Yanok2011-12-06-0/+1
| | | | | | | | | | | DaVinci EMAC is found not only on DaVinci SoCs but on some OMAP3 SoCs also. This patch moves common defines from arch-davinci/emac_defs.h to drivers/net/davinci_emac.h DaVinci specific PHY drivers hacked to include the new header. We might want to switch to phylib in future. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
* arm, davinci_emac: fix driver bug if more then 3 PHYs are detectedHeiko Schocher2011-11-15-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | since commits: davinci: emac: add support for more than 1 PHYs 062fe7d332c28ede25626f448681e43d76bb312e davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM fb1d6332b5430b90a8fa8ebab709f33a60e9f816 I get following warning on the enbw_cmc board: Err: serial Net: 5 ETH PHY detected miiphy_register: non unique device name 'KSZ8873 @ 0x01' DaVinci-EMAC Hit any key to stop autoboot: 0 Also I see some debug printfs: => run load + emac_close + emac_ch_teardown - emac_ch_teardown + emac_ch_teardown - emac_ch_teardown - emac_close + emac_open - emac_open Using DaVinci-EMAC device reason is 062fe7d332c28ede25626f448681e43d76bb312e new define MAX_PHY. This is set to 3! I get on this board 5 active phys, so this leads in wrong memory writes ... so I changed: - define CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT to set the MAX_PHY value, add a description in README for the new CONFIG_SYS option. - print an error message if more then MAX_PHYs are detected. - fill the active_phy_addr array in a for loop with 0xff - changed printf() in debug_emac() Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Sandeep Paulraj <s-paulraj@ti.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Wolfgang Denk <wd@denx.de> Cc: Manjunath Hadli <manjunath.hadli@ti.com> Cc: Prabhakar Lad <prabhakar.csengg@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Tom Rini <tom.rini@gmail.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* net, davinci_emac: make clock divider in MDIO control register configurableHeiko Schocher2011-11-03-2/+7
| | | | | | | | | | Define CONFIG_SYS_EMAC_TI_CLKDIV for setting the clkdiv value in the MDIO control register. Signed-off-by: Heiko Schocher <hs@denx.de> cc: Sandeep Paulraj <s-paulraj@ti.com> cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* davinci_emac: compilation fix, phy is array nowIlya Yanok2011-11-03-1/+1
| | | | | | | Fix compilation issues introduced by recent multiply PHY patch. Signed-off-by: Ilya Yanok <yanok@emcraft.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUMManjunath Hadli2011-10-27-7/+7
| | | | | | | | | remove macro CONFIG_EMAC_MDIO_PHY_NUM and depending macro EMAC_MDIO_PHY_NUM as they are no longer needed with the support for more than 1 PHYs in davinci emac driver. Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* davinci: emac: add support for more than 1 PHYsManjunath Hadli2011-10-27-65/+100
| | | | | | | | | | add support for more than 1 PHYs. Many of the davinci platforms have more than 1 PHYs on thier board. This patch extends support in davinci emac driver for upto 3 PHYs. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* davinci: emac: add new features to autonegotiate for EMACManjunath Hadli2011-10-27-2/+28
| | | | | | | | | | add more features like DUPLEX, 100MB link speed etc to auto negotiate in EMAC driver. EMAC controller autonegotiates for these features with PHYs which are on the board. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* net, davinci_emac: let the EMAC detect the PHYsHeiko Schocher2011-09-30-0/+3
| | | | | | | | | | | Once the MDIO state machine has been initialized and enabled, it starts polling all 32 PHY addresses on the MDIO bus, looking for an active PHY. Add a 5 ms delay, so all PHYs are for sure detected. This problem was detected on the cmc board with a KSZ8864 switch. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* net, davinci_emac: make less verbose - turn printf() into debug()Heiko Schocher2011-09-30-1/+1
| | | | | | | | | | | | | | | | | | | | The PHY driver was too verbose and corrupted the boot message display like this: ... Net: Ethernet PHY: KSZ8873 @ 0x02 DaVinci-EMAC ... Turn printf() into debug() so we get the expected output again: ... Net: DaVinci-EMAC ... Signed-off-by: Heiko Schocher <hs@denx.de> cc: Paulraj Sandeep <s-paulraj@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* net, davinci_emac: add KSZ8864 switchHeiko Schocher2011-09-30-0/+7
| | | | | | | | Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Paulraj Sandeep <s-paulraj@ti.com> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* da850: fix the channel number for EMAC teardown initNagabhushana Netagunte2011-09-04-2/+2
| | | | | | | | | | TX and RX channel numbers programmed as '1' during EMAC teardown initialization is wrong. This patch fixes the same by setting channel number to '0' which is used by U-boot. Signed-off-by: Sugumar Natarajan <sugumar@ti.com> Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* ea20: fix undefined PHY_* errorsBen Gardiner2011-04-11-3/+3
| | | | | | | | | | | This patch fixes ea20 after 8ef583a0351590a91394499eb5ca2ab8a703d959 where the u-boot custom PHY_ macros were replaced with those of linux/mii.h MII_ definitions except in the RMII support for davinci_emac. Probably also due to the merge path of changes in 2010.12. Signed-off-by: Ben Gardiner<bengardiner@nanometrics.ca> CC: Mike Frysinger <vapier@gentoo.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* DaVinci DM6467: Added ET1011C (LSI) PHY supportSandeep Paulraj2011-02-02-0/+7
| | | | | | | | | | Added arch/arm/cpu/arm926ejs/davinci/et1011c.c for handling ET1011C gigabit phy. which overrides get_link_speed function from default implementation. This enables output of 125 MHz reference clock on SYS_CLK pin. Signed-off-by: Prakash PM <prakash.pm@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* DaVinci EMAC: Add name to Ethernet deviceSandeep Paulraj2011-02-02-0/+1
| | | | | | | | | | | | Adds "DaVinci-EMAC" as the name of the device so that it gets printed as "Using DaVinci-EMAC device" during network access (dhcp, tftp) instead of empty name in "Using" statement.This name also gets reflected in 'ethact' env variable. Signed-off-by: Hemant Pedanekar <hemantp@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* DaVinci EMAC: Fix davinci_eth_gigabit_enableSandeep Paulraj2011-02-02-3/+4
| | | | | | | | | | | Enabling the gigabit was overwriting the previous configuration by setting up only GIGAFORCE and GIG bits of MAC control register. Modified to retain previous configuration while gigabit enabling. Signed-off-by: Prakash PM <prakash.pm@ti.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* miiphy: convert to linux/mii.hMike Frysinger2011-01-09-8/+8
| | | | | | | | The include/miiphy.h header duplicates a lot of things from linux/mii.h. So punt all the things that overlap to keep the API simple and to make merging between U-Boot and Linux simpler. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* da850: Add RMII support for EMACSudhakar Rajashekhara2010-11-30-1/+40
| | | | | | | | | | | | | | | | | | | | | | | This patch is a port of the work by Sudhakar Rajeshekhara in commit ab3effbcad8851cc65dc5241a01c064d2030a3b2 of git://arago-project.org/git/people/sandeep/u-boot-davinci.git. The da850 UI board has on it an RMII PHY which can be used if the MDC line to the MII PHY on the baseboard is disabled and the RMII PHY is enabled by configuring the values of some GPIO pins on the IO expander of the UI board. This patch implements disabling that line via GPIO2[6], configuring the UI board's IO expander and setting only the pinmux settings that are needed for RMII operation. Tested on da850evm by adding a define for CONFIG_DRIVER_TI_EMAC_USE_RMII. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> CC: Sandeep Paulraj <s-paulraj@ti.com> CC: Ben Warren <biggerbadderben@gmail.com> CC: Mike Frysinger <vapier@gentoo.org> CC: Sughosh Ganu <urwithsughosh@gmail.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
* davinci_emac: davinci_eth_set_mac_addr to ->write_hwaddrBen Gardiner2010-10-11-41/+39
| | | | | | | | | | | | | | | | | | | | | | This patch proposes to migrate the davinci_emac driver to using the eth_device->write_hwaddr function pointer as suggested by Ben Warren. All the davinci boards had the behaviour, prior to this patch, of sync'ing the environment variable enetaddr with the MAC address read from non-volatile storage on boot -- when the two locations disagreed, the environment variable value took precendence. This patch keeps the same behaviour but lets eth_initialize take care of it. This patch refactors davinci_emac setup in the boards so that the MAC address is read from non-volatile storage into the environment variable and then the environment variable value is use in eth_intialize. The only exception is the direct call to davinci_eth_set_mac_addr made by the da830evm board init which was changed into an assignment of the enetaddr field. Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Tested-by: Nick Thompson <nick.thompson@ge.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* miiphy: constify device nameMike Frysinger2010-08-09-2/+2
| | | | | | | The driver name does not need to be writable, so constify it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* TI: DaVinci: Updating EMAC driver for DM365, DM646x and DA8XXNick Thompson2010-01-31-95/+171
| | | | | | | | | The EMAC IP on DM365, DM646x and DA830 is slightly different from that on DM644x. This change updates the DaVinci EMAC driver so that EMAC becomes operational on SOCs with EMAC v2. Signed-off-by: Nick Thompson <nick.thompson@ge.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Switched davinci_emac Ethernet driver to use newer APIBen Warren2009-06-15-46/+24
| | | | | | | | Added CONFIG_NET_MULTI to all Davinci boards Removed all calls to Davinci network driver from board code Added cpu_eth_init() to cpu/arm926ejs/cpu.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Initial cleanup of Davinci Ethernet driverBen Warren2009-06-15-77/+69
| | | | | | | Removed pointless #ifdefs Moved functions around in file in preparation for switch to newer API Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Moved Davinci Ethernet driver to drivers/netBen Warren2009-06-15-0/+655
This driver has been renamed davinci_emac.c Signed-off-by: Ben Warren <biggerbadderben@gmail.com>