aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/rtl8367b.c
Commit message (Collapse)AuthorAgeFilesLines
* kernel: rtl8367b: fix external interface modesINAGAKI Hiroshi2020-06-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interface mode number of RGMII_33V is 7 on RTL8367, but it's 9 on RTL8367B. the external interface modes for RTL8367 are follows: - 0, Disabled - 1, RGMII - 2, MII_MAC - 3, MII_PHY - 4, TMII_MAC - 5, TMII_PHY - 6, GMII - 7, RGMII_33V the external interface modes for RTL8367B are follows: - 0, Disabled - 1, RGMII - 2, MII_MAC - 3, MII_PHY - 4, TMII_MAC - 5, TMII_PHY - 6, GMII - 7, RMII_MAC - 8, RMII_PHY - 9, RGMII_33V But the driver in U-Boot of RT-N56U GPL tar blocks using RGMII_33V (9) mode and it seems to be unsupported on RTL8367B, so drop it from switch-case in rtl8367b_extif_set_mode. ref (RTL8367): - TL-WR2453ND v1 ref (RTL8367B): - ASUS RT-N56U - TP-Link Archer C2 v1 Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* kernel: rtl8367b: use id as a bit offset for BYPASS_LINE_RATEINAGAKI Hiroshi2020-04-041-4/+2
| | | | | | | | | | | | | | | | | In RTL8367B (RTL8367RB/RTL8367R-VB), the driver in GPL tars of the devices with this switch directly uses the ID of external interface as a bit offset. We should use the same way. ref (RTL8367B): - ASUS RT-N56U - TP-Link Archer C2 v1 ref (RTL8367): - TP-Link TL-WR2543ND v1 Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* kernel: rtl8367b: fix DEBUG register address for extif2INAGAKI Hiroshi2020-04-041-1/+1
| | | | | | | | RTL8367B_CHIP_DEBUG1_REG (0x1304) is for external interface 1. For external interface 2, use RTL8367B_CHIP_DEBUG2_REG (0x13e2) instead. Fixes: 9801d61c4a ("kernel: rtl8367b: add configuration for extif2") Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* kernel: rtl8367b: add configuration for extif2Serge Vasilugin2020-03-211-5/+42
| | | | | | | | | | | | | | | | | | | | | | Both rtl8367b and rtl8367s have two extended interface rtl8367rb: 5 port + 2*RGMII/MII rtl8367s: 5 port + SGMII/HSGMI + RGMII/MII (?)rtl8367sb: 5 port + 2*RGMII/MII These interfaces correspond to EXT1 and EXT2 (ports 6 and 7 respectivly). This patch allow to configure EXT2 in dts-file: rtl8367rb { compatible = "realtek,rtl8367b"; cpu_port = <7>; realtek,extif2 = <1 0 1 1 1 1 1 1 2>; mii-bus = <&mdio0>; phy_id = <29>; }; Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru> [fix indent, replace magic value, alter commit message] Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* generic: rtl8367b: add definition of debug regChuanhong Guo2020-03-211-5/+30
| | | | | | | This commit adds definition of DEBUG0 and DEBUG1 registers and replace magic values with proper register modifying. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* generic: rtl8367b: make it possible to specify cpu_port via DTChristian Lamparter2018-11-261-2/+4
| | | | | | | | This patch adds the feature to parse the existing cpu_port DT property, which is used to specify which port is the cpu port of the switch. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* generic: rtl836x: support defered probe on mdio-busChristian Lamparter2018-11-261-2/+2
| | | | | | | | | | | | | | | | On the WNDAP620, the mdio and mdc lines are controlled by the EMAC ethernet device. This results in a hen-vs-egg problem. The rtl8367b driver is probed before the ethernet driver and the mdio-bus is not available yet, which caused the rtl8367b driver to fail. This patch changes the rtl8366_smi_probe_of() function to return -EPROBE_DEFER if the mdio-bus lookup failed and changes rtl8366_smi_probe()'s signature to return the error code back to the callee, so it can propagate back to the kernel. Which, will retry the switch probe at a later time. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* kernel: rtl8367b: drop redundant compatibleMathias Kresin2018-06-251-1/+0
| | | | | | | Remove the compatible without vendor prefix. It is formal wrong and not used in the tree. Signed-off-by: Mathias Kresin <dev@kresin.me>
* generic: provide get_port_stats() on rtl836x switchesThibaut VARENE2017-09-011-0/+11
| | | | | | | | | | This patch provides a generic switch_dev_ops 'get_port_stats()' callback by taping into the relevant port MIB counters. This callback is used by swconfig_leds led trigger to blink LEDs with port network traffic. Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
* kernel: rtl8367(b): fix build errorMathias Kresin2016-11-191-1/+1
| | | | | | | | | | Fix build on targets not using CONFIG_MODULE_STRIPPED. Neither RTL8367_DRIVER_DESC nor RTL8367B_DRIVER_DESC are defined anywhere. It worked for targets using CONFIG_MODULE_STRIPPED since our module stripper no-ops the various module info macros. Signed-off-by: Mathias Kresin <dev@kresin.me>
* generic: rtl8367: add compatible string with vendor prefixGabor Juhos2013-04-061-0/+1
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 36230
* generic: rtl8367b: fix rtl8367b_extif_init_ofGabor Juhos2013-04-061-7/+18
| | | | | | | | | | | | * disable external interface if its property is not present * show an error message if the extif property is not valid * use proper error values intead of -1 * fix memory leak * wrap long lines Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 36229
* add OF support to rtl8367b driverJohn Crispin2013-04-031-6/+50
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36159
* kernel: remove __devinit, __devexit and __devexit_p for kernel 3.8Hauke Mehrtens2013-01-271-4/+4
| | | | | | These attributes where removed with kernel 3.8 and are now causing compile errors. SVN-Revision: 35328
* generic: rtl836x: fix compiler warningsGabor Juhos2012-12-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CC drivers/net/phy/rtl8366rb.o In file included from drivers/net/phy/rtl8366s.c:16:0: include/linux/of_platform.h:106:13: warning: 'struct device' declared inside parameter list [enabled by default] include/linux/of_platform.h:106:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] drivers/net/phy/rtl8366s.c: In function 'rtl8366s_probe': drivers/net/phy/rtl8366s.c:1094:2: warning: label 'err_out' defined but not used [-Wunused-label] drivers/net/phy/rtl8366s.c:1055:32: warning: unused variable 'pdata'[-Wunused-variable] CC drivers/net/phy/rtl8366rb.o In file included from drivers/net/phy/rtl8366rb.c:17:0: include/linux/of_platform.h:106:13: warning: 'struct device' declared inside parameter list [enabled by default] include/linux/of_platform.h:106:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] drivers/net/phy/rtl8366rb.c: In function 'rtl8366rb_probe': drivers/net/phy/rtl8366rb.c:1214:2: warning: label 'err_out' defined but not used [-Wunused-label] drivers/net/phy/rtl8366rb.c:1175:32: warning: unused variable 'pdata'[-Wunused-variable] CC drivers/net/phy/rtl8367.o In file included from drivers/net/phy/rtl8367.c:15:0: include/linux/of_platform.h:106:13: warning: 'struct device' declared inside parameter list [enabled by default] include/linux/of_platform.h:106:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] drivers/net/phy/rtl8367.c: In function 'rtl8367_probe': drivers/net/phy/rtl8367.c:1712:2: warning: label 'err_out' defined but not used [-Wunused-label] drivers/net/phy/rtl8367.c:1677:32: warning: unused variable 'pdata' [-Wunused-variable] CC drivers/net/phy/rtl8367b.o In file included from drivers/net/phy/rtl8367b.c:15:0: include/linux/of_platform.h:106:13: warning: 'struct device' declared inside parameter list [enabled by default] include/linux/of_platform.h:106:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] drivers/net/phy/rtl8367b.c: In function 'rtl8367b_probe': drivers/net/phy/rtl8367b.c:1494:2: warning: label 'err_out' defined but not used [-Wunused-label] drivers/net/phy/rtl8367b.c:1459:32: warning: unused variable 'pdata' [-Wunused-variable] Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34731
* linux: generic: rtl836*: fix compilation with !CONFIG_OFJonas Gorski2012-12-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes the following errors caused by r34682: CC [M] drivers/net/phy/rtl8366_smi.o In file included from drivers/net/phy/rtl8366_smi.c:26:0: drivers/net/phy/rtl8366_smi.h:149:46: warning: 'struct platform_device' declared inside parameter list [enabled by default] drivers/net/phy/rtl8366_smi.h:149:46: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] drivers/net/phy/rtl8366_smi.c:1398:65: warning: 'struct platform_device' declared inside parameter list [enabled by default] drivers/net/phy/rtl8366_smi.c: In function 'rtl8366_smi_probe_plat': drivers/net/phy/rtl8366_smi.c:1400:44: error: dereferencing pointer to incomplete type drivers/net/phy/rtl8366_smi.c:1402:11: error: dereferencing pointer to incomplete type drivers/net/phy/rtl8366_smi.c:1403:16: error: dereferencing pointer to incomplete type drivers/net/phy/rtl8366_smi.c: At top level: drivers/net/phy/rtl8366_smi.c:1415:46: warning: 'struct platform_device' declared inside parameter list [enabled by default] drivers/net/phy/rtl8366_smi.c:1415:21: error: conflicting types for 'rtl8366_smi_probe' drivers/net/phy/rtl8366_smi.h:149:21: note: previous declaration of 'rtl8366_smi_probe' was here drivers/net/phy/rtl8366_smi.c: In function 'rtl8366_smi_probe': drivers/net/phy/rtl8366_smi.c:1420:31: error: dereferencing pointer to incomplete type drivers/net/phy/rtl8366_smi.c:1424:10: error: dereferencing pointer to incomplete type drivers/net/phy/rtl8366_smi.c:1425:3: warning: passing argument 1 of 'rtl8366_smi_probe_of' from incompatible pointer type [enabled by default] drivers/net/phy/rtl8366_smi.c:1392:19: note: expected 'struct device_node *' but argument is of type 'struct platform_device *' drivers/net/phy/rtl8366_smi.c:1427:3: warning: passing argument 1 of 'rtl8366_smi_probe_plat' from incompatible pointer type [enabled by default] drivers/net/phy/rtl8366_smi.c:1398:5: note: expected 'struct platform_device *' but argument is of type 'struct platform_device *' drivers/net/phy/rtl8366_smi.c: At top level: drivers/net/phy/rtl8366_smi.c:1438:1: error: conflicting types for 'rtl8366_smi_probe' drivers/net/phy/rtl8366_smi.h:149:21: note: previous declaration of 'rtl8366_smi_probe' was here make[7]: *** [drivers/net/phy/rtl8366_smi.o] Error 1 make[6]: *** [drivers/net/phy] Error 2 make[5]: *** [drivers/net] Error 2 make[4]: *** [drivers] Error 2 Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 34703
* make rtl8366 driver OF capableJohn Crispin2012-12-151-15/+13
| | | | SVN-Revision: 34682
* generic: add driver for the the RTL8367R{B,-VB} switchesGabor Juhos2012-10-181-0/+1546
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 33839