[BPI-R64] (dsa-) switch-driver

(Frank W.) #1


After getting 4.19 booting on r64 i’m searching driver for switch-chip (rtl8367s). Currently i see 1 eth,but cannot use any of the ports. Switch seems not powered on.

I googled around,found only drivers for kernel 3.x and other 8367x (not s). 4.19+ contains dsa driver for 8366 here,but i found no ref to 8367…maybe its compatible or not…

Mhm, documentation also lists 8367 (without “s”), but in realtek-smi.c there is only rtl8366s+rb. for testing i need to know at least gpio-binding.

Also found phy-driver (don’t know kernel-version) on lede-repo https://github.com/lede-project/source/blob/master/target/linux/generic/files/drivers/net/phy/rtl8367.c https://github.com/lede-project/source/blob/master/target/linux/generic/files/include/linux/rtl8367.h

i guess i need both…phy-driver uses rtl8366_smi

can anybody help me here?

For official 4.4 this seems to be the driver:

@jackzeng Am i right? Btw. Please remove cmd and o files from public repo :slight_smile:

Regards Frank

(Frank W.) #2

got ethernet working with Patches from https://github.com/objelf/linux/commits/linux-4.19.y-mediatek

currently mapping is wrong (wan+lan0-2 over eth0 and lan3 over eth1), only if anybody uses my r64 branch

i guess it’s defined here:

currently i do not full understand the code and do not know which port is wan and which is lan3 to swap these 2 ports. maybe i can change it by the parameter want_at_p0…this changes where PORT0 and PORT4 are mapped into vlan (vlan1 = EXT_PORT0, vlan2= EXT_PORT1)

seems to be triggered here:

this seems to look if in “rtkgsw”-node the property “mediatek,port_map” is set to “wllll” and call rtl8367s_vlan_config(1); else with 0 dts and dtsi have no such property…so i assume it’s called with 0 (second “rtl8367s_vlan_config(0);” in preprocessor-condition-else)…i will try to add this option

seems to fix the wan/lan3-swap :wink:

btw. can you give me an example how i can define vlans on this board? imho it should be possible with swconfig, but i need params (port-numbering). maybe i can bet this via “swconfig show”

swconfig should support rtl8367 (https://oldwiki.archive.openwrt.org/doc/techref/swconfig)

tried to install it, but there seem no package in debian, found sourcecode, but it is not compilable (missing linux/switch.h that does also not exist in kernel 4.4)