aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net/phy/b53
Commit message (Collapse)AuthorAgeFilesLines
* b53: support setting port linkRafał Miłecki2016-02-031-0/+31
| | | | | | | | | When dealing with Broadcom hardware we can simply use swconfig's generic helper, we just need to do some validation of requested state. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48623 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: provide PHY access to swconfigRafał Miłecki2016-02-033-0/+48
| | | | | | | | | Thanks to this change swconfig can access port PHYs e.g. when setting port link state with a generic helper. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48622 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: update header register difinitionsJonas Gorski2016-01-181-1/+2
| | | | | | | | | BCM531x5 has two pontential cpu ports, and header mode can be enabled independently on both. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48302 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: fix build with brcm47xxHauke Mehrtens2015-07-031-0/+5
| | | | | | | | | | The position of the nvram header file on brcm47xx changed with kernel version 4.1. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46170 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: Allow using all 8 ports on BCM53011Rafał Miłecki2015-06-211-1/+1
| | | | | | | | | | | On two tested devices: Netgear R6250 (BCM53011 rev 2) and Luxul XWC-1000 (BCM53011 rev 3) it was possible to use port 7 and eth1 (instead of port 5 and eth0). It seems BCM53011 just like BCM53012 has 8 ports and usually 3 of them are connected to the SoC. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46104 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: fix memory out of bounds access on 64 bit targetsJonas Gorski2015-06-101-2/+2
| | | | | | | | | | | | | On device reset the sizes for the vlan and port tables were wrongly calculated based on the pointer size instead of the struct size. This causes buffer overruns on 64 bit targets, resulting in panics. Fix this by dereferencing the pointers. Reported-by: Fedor Konstantinov <blmink@mink.su> Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45938 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: widen stp state mask to 3 bits (instead of 2)Jonas Gorski2015-06-101-1/+1
| | | | | | | | | | | | | | | At least on my b53 chip, the mask is 3 bits wide, and because of this some STP states are not set properly and discarded when read. Maybe for some other chips it makes sense to have just 2 bits width, but I don't have other versions around to test/validate. If that's the case then maybe we could add another STP state mask. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45937 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: Allow using all ports on BCM53012Rafał Miłecki2015-05-121-1/+1
| | | | | | | | | | | | | This chipset has at least 8 usable ports, e.g. Netgear R8000 has ports 5, 7 and 8 connected to Ethernet interfaces: vlan1ports=0 1 2 3 5 7 8* vlan2ports=4 8u Port 6 seems to be always disabled. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45676 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: improve overriding CPU port state on BCM5301XRafał Miłecki2015-04-122-2/+30
| | | | | | | | | | | | | | | | | On BCM5301X there are two different cases to handle: CPU port 8 vs. any other one. Support for CPU port 8 was already partially implemented but it lacked setting some extra bit for 2G speed. It also will need to be extended to implement "SMP dual core 3 GMAC setup". That's the reason for handling it in separated code block. This patch also adds overriding CPU port state for port other than 8. It requires using recently defined GMII_PORT registers. It was tested for regressions on BCM53011 revs 2 & 3. It was also confirmed to fix switch on some internal Broadcom board. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45402 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: clean up code to match kernel style betterJonas Gorski2015-04-106-20/+23
| | | | | | | | | | | | | * properly enclose macro arguments in paranthesis on use * remove trailing white space * convert C99 // comments * add missing blank lines after declaration * remove braces from single statement blocks * split lines > 80 chars (except for one) Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45356 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: define registers available and needed on BCM5301XJonas Gorski2015-04-101-0/+33
| | | | | | | | They are also present on some BCM63xx switches. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45355 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: reverse duplex bit meaning for IMP state override registerJonas Gorski2015-03-181-1/+1
| | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44875 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: global config is part of the management page, not the control pageJonas Gorski2015-03-151-2/+2
| | | | | | | | | | It will now actually enable the mib counters instead of enabling rx/tx for the first switch port. Reported-by: Daniel Gonzalez <dgcbueu@gmail.com> Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44788 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: fix mmap register read/writes > 32 bitJonas Gorski2015-02-271-34/+36
| | | | | | | | | | | | | | | | | | | | | | | For bcm63xx integrated switches, broadcom changed the data endianess to match the system endianess. But this only applies to within one word, which causes 48/64 bit values to be still split into their "litte endian" groups. E.g. 48 bit values (with 5 being the most significant byte) aligned 0x00 ..01 or 0123 0x04 2345 45.. will become 0x00 ..10 resp. 3210 0x04 5432 54.. Likewise for 64 bit values. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44568 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: hardcode reset GPIO for Linksys WRT300N 1.1Hauke Mehrtens2014-07-061-0/+1
| | | | | | | | | | | | | According to the thread https://forum.openwrt.org/viewtopic.php?id=48281 b53 uses GPIO 7: [ 4.470000] b53_common: [DBG] b53_switch_reset_gpio using 7 and causes device to self-reboot. GPIO 8 was found in CFE boot log: "Reset switch via GPIO 8 ..." Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41526 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: Make b53_switch_init staticJonas Gorski2014-02-221-1/+1
| | | | | | | | Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Patchwork: http://patchwork.openwrt.org/patch/4869/ Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39683 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: Add BCM53128 switch supportJonas Gorski2014-02-223-2/+18
| | | | | | | | Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Patchwork: http://patchwork.openwrt.org/patch/4867/ Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39682 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: use drvdata to store driver dataHauke Mehrtens2014-01-203-10/+6
| | | | | | | | | we should not abuse the platform_data pointer. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39354 3c298f89-4303-0410-b956-a3cf2f4a3e73
* b53: make b53_switch_reset_gpio() staticHauke Mehrtens2014-01-201-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39353 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: fix untagged shift for BCM5365Hauke Mehrtens2013-11-132-4/+8
| | | | | | | | | | | | The BCM5365 needs a shift of 7 bits and not 6 bits like the BCM5325 for the untagged ports. Thank you Russell for reporting this and testing the patch. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38793 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: add initial support for switches in BCM5301XHauke Mehrtens2013-11-102-3/+87
| | | | | | | | | This is also known as BCM470{7,8,9}. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38712 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: add switch name into printk when it fails.Hauke Mehrtens2013-10-061-1/+1
| | | | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38307 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: add Register Access Bridge Registers (SRAB) interfaceHauke Mehrtens2013-09-253-0/+388
| | | | | | | | | The SRAB interface is used on BCM4707 and BCM5301X SoCs. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38198 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: detect revision of BCM5325Hauke Mehrtens2013-09-152-1/+9
| | | | | | | | | | The revision is stored in a different register than it is in other Broadcom switches. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37995 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: fix vlan write for BCM5325 revison 3+Hauke Mehrtens2013-09-151-2/+7
| | | | | | | | | | These switches are integrated in some recent BCM53XX and BCM47XX SoCs like the BCM53572. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37994 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: use hard coded switch reset gpio on some boards.Hauke Mehrtens2013-09-141-2/+10
| | | | | | | | | | | | | The Linksys wrt310n v1 does not have a robo_reset config variable in nvram, but GPIO Pin 8 is the pin needed for resetting the external switch, Linksys hard coded it into their source code. Thank you Devastator for testing. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37988 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: add soft reset for BCM539x switchesHauke Mehrtens2013-09-142-0/+12
| | | | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37987 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: support phy ids for BCM5365Jonas Gorski2013-09-052-2/+28
| | | | | | | | | | | | BCM5365 (and probably other older variants) use a different phy id, so the phy driver never attached for them. Fix this by adding the appropriate phy id to the fixup and the phy driver. Reported-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37906 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: allow access the MIB counters on BCM5365Hauke Mehrtens2013-09-041-1/+1
| | | | | | | | | | | b53_no_ops has no elements and b53_port_ops has one element, this makes the code access some random memory when trying to access the mib counter functions. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37895 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: use devm_gpio_request_one() to request gpioHauke Mehrtens2013-08-011-3/+4
| | | | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37648 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: add support for GPIO resetHauke Mehrtens2013-08-012-0/+43
| | | | | | | | | This is needed for some switches used on bcm47xx SoCs like the one on the Asus RT-N66U. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37645 3c298f89-4303-0410-b956-a3cf2f4a3e73
* brcm47xx: use b53 phy driver for the switch in kernel 3.10Hauke Mehrtens2013-07-141-0/+5
| | | | | | | | | | | This makes it possible to use swconfig to controll the switch. This was tested with devices using b43 and bgmac. This was not tested on devices using tg3. This does not support the adm switch used in some very old devices. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37304 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: use correct oops for bcm5365 switchHauke Mehrtens2013-05-091-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36589 3c298f89-4303-0410-b956-a3cf2f4a3e73
* generic: b53: clear SM_SW_FWD_MODE unconditionally when enabling VLANJonas Gorski2013-02-211-4/+2
| | | | | | | | | | Setting this bit stops BCM53125 (bgmac actually) from receiving any packets. This bit is cleared conditionally in b53_switch_reset and it seems the same is done in bcmrobo.c which never sets that bit again. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35723 3c298f89-4303-0410-b956-a3cf2f4a3e73
* generic: b53: remove empty spacesJonas Gorski2013-02-211-2/+2
| | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35722 3c298f89-4303-0410-b956-a3cf2f4a3e73
* generic: b53: fix reverted error check in probeJonas Gorski2013-02-101-1/+1
| | | | | | | | | | | | b53_switch_detect returns value returned by b53_read8, which is 0 for success. So fail (and return error) only if b53_switch_detect returned something else than 0. This fixes supported and advertising being zeros for MDIO access. Cc: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35534 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: b53: the b53 spi driver depends on spiHauke Mehrtens2013-01-271-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35340 3c298f89-4303-0410-b956-a3cf2f4a3e73
* kernel: remove __devinit, __devexit and __devexit_p for kernel 3.8Hauke Mehrtens2013-01-271-3/+3
| | | | | | | These attributes where removed with kernel 3.8 and are now causing compile errors. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35328 3c298f89-4303-0410-b956-a3cf2f4a3e73
* generic: add b53 swconfig switch driverJonas Gorski2013-01-239-0/+2943
Add swconfig switch driver for Broadcom BCM53XX switch chips. Supports switches connected through MDIO, SPI or memory mapped registers, and supports BCM5325, BCM539x, BCM531x5 and the BCM63XX internal switch chips. Tested are BCM5325 trough MDIO, BCM53115 through SPI, and BCM6328. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35305 3c298f89-4303-0410-b956-a3cf2f4a3e73