TL-WR1043: switch

Adrian Chadd adrian at freebsd.org
Mon Dec 12 10:28:31 UTC 2011


(bah, being in the wrong timezone sucks.)

On 11 December 2011 12:54, Stefan Bethke <stb at lassitu.de> wrote:
> Am 11.12.2011 um 21:28 schrieb Adrian Chadd:
>
>> Hm, so - how does this expose the CPU facing port(s), if any?
>>
>> ray@ is trying to figure out how to expose the arge0/arge1 interface
>> (as he's got at least one board where the switch PHY hangs off of
>> arge1, not arge0) so things are probed/attached "right".
>>
>> That discussion may be worth having here. :)
>
> The RTL8366 family of switches has a GMII interface to hook up an ethernet controller.  MDC/MDIO are not connected to the ethernet controller, instead register access is through this I2C-like interface, which on the TL-WR1043ND is through two GPIOs.

Right. So all the PHY access/glue has to come out of this i2c style bus.

> The RTL8306SD (which is used for example in the Linksys WRT160NL) has two MII ports. One is always used to connect a CPU, while the second one can be configured to either communicate with the switch or with one specific PHY.

> I believe the WRT160NL uses the latter mode, using the first ethernet port of the CPU to talk to the switch ("LAN"), and the second one to the PHY ("WAN"). It exposes both the five PHYs via MDC/MDIO, as well as switch configuration.  Unfortunately, the configuration registers are spread out over all the PHYs, so you can't cleanly isolate the PHYs from the switch portion.  Since the switch has only one set of MDC/MDIO, both ethernet controllers share the same minibus (and both driver instances need to work on just the one instance).  For arge1, using the appropriate phymask should be sufficient.

Right. This I think is one of those places where it gets ugly.

> We already have PHY support for the similar RTL8305 in the tree (sys/dev/mii/rlswitch.c), which does configure the switch.  I haven't looked at how it handles the multiple exposed PHYs.
>
> BTW, would it make sense to put all this info up on a wiki page somewhere?  I'm optimistic that we can flesh the code out in the next couple of weeks, but it would be sad to bury all the additional information just in the mailing list archives.

I'm happy for you to do this. Create a wiki.freebsd.org account and
tell me what your username is; I'll then throw your account into the
right group to let you modify things.

>> Whats RTL8366RB_SGCR_EN_VLAN_4KTB do?
>
> The switch also supports a mode where theres a configuration per VID, so it can support all possible VIDs (1-4094).  I cna add the code, but I don't think it really adds that many real-world functionality.

Well, as a network engineer of sorts, I'd like to be able to glue
these devices into the full VLAN space. I have a habit at home of
using VLANs in ranges, so I tend to use VLANs right up to 4000. :)

How difficult does it look? Does it change how the VLANs are actually
configured?


Adrian


More information about the freebsd-embedded mailing list