OpenWrt Forum Archive

Topic: Mikrotik CRS125-24G-1S-2HnD-IN support

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I'd like to install openwrt on my Mikrotik router. It's a 24GbE ports with routing capacity + Wireless.

As far as I know it's not yet supported by openwrt and nobody seems to have already messed with it.

I compiled openwrt for Atheros AR7xxx/AR9xxx platforms and loaded it from TFTP. It's booting and basic stuff is working but network interfaces aren't working.

I asked mikrotik for the kernel patches, I'm waiting for an answer.

Can you give me hint where to start ?

Thanks A lot

Romain

[    0.000000] CPU revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 2
[    0.000000] Clocks: CPU:600.000MHz, DDR:350.000MHz, AHB:175.000MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x07ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat 80314b60, node_mem_map 81000000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line:  console=ttyS0,115200 parts=1 boot_part_size=4194304 gpio=233003 HZ=300000000 mem=128Mkmac=D4:CA:6D:F9:C2:43 board=crs125g ver=3.08 boot=1 mlc=5 rootfstype=yaffs noinitrd
[    0.000000] MIPS: no machine found for id 'crs125g', supported machines:
[    0.000000] id                       name
[    0.000000] Generic                  Generic AR71XX/AR724X/AR913X based board
[    0.000000] BXU2000n-2-A1            BHU BXU2000n-2 rev. A1
[    0.000000] DRAGINO2                 Dragino Dragino v2
[    0.000000] MYNET-N750               WD My Net N750
[    0.000000] MYNET-REXT               WD My Net Wi-Fi Range Extender
[    0.000000] 493G                     MikroTik RouterBOARD 493G
[    0.000000] 493                      MikroTik RouterBOARD 493/AH
[    0.000000] 450G                     MikroTik RouterBOARD 450G
[    0.000000] 450                      MikroTik RouterBOARD 450
[    0.000000] 435G                     MikroTik RouterBOARD 435G
[    0.000000] 411                      MikroTik RouterBOARD 411/A/AH
[    0.000000] 751g                     MikroTik RouterBOARD 751G
[    0.000000] 751                      MikroTik RouterBOARD 751
[    0.000000] 750Gr3                   MikroTik RouterBOARD 750GL
[    0.000000] 750i                     MikroTik RouterBOARD 750
[    0.000000] 711Gr100                 (null)
[    0.000000] 951G                     MikroTik RouterBOARD 951G-2HnD
[    0.000000] 2011G                    (null)
[    0.000000] 2011US                   (null)
[    0.000000] 2011L                    (null)
[    0.000000] TL-WA901ND-v3            TP-LINK TL-WA901ND v3
[    0.000000] TL-WA850RE               TP-LINK TL-WA850RE
[    0.000000] TL-WA801ND-v2            TP-LINK TL-WA801ND v2
[    0.000000] TL-WA750RE               TP-LINK TL-WA750RE
[    0.000000] TL-WR1043ND-v2           TP-LINK TL-WR1043ND v2
[    0.000000] WLR8100                  Sitecom WLR-8100
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.070000] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 512
[    0.080000] NET: Registered protocol family 16
[    0.090000] MIPS: machine is Generic AR71XX/AR724X/AR913X based board
[    0.100000] bio: create slab <bio-0> at 0
[    0.110000] Switching to clocksource MIPS
[    0.120000] NET: Registered protocol family 2
[    0.120000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.120000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.130000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.130000] TCP: reno registered
[    0.140000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.140000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.150000] NET: Registered protocol family 1
[    0.150000] PCI: CLS 0 bytes, default 32
[    5.700000] yaffs: yaffs built Jan 28 2014 20:28:24 Installing.
[    5.700000] msgmni has been set to 238
[    5.740000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    5.750000] console [ttyS0] enabled, bootconsole disabled
[    5.770000] TCP: cubic registered
[    5.770000] NET: Registered protocol family 17
[    5.780000] Bridge firewalling registered
[    5.780000] 8021q: 802.1Q VLAN Support v1.8
[    5.810000] Freeing unused kernel memory: 4344K (80332000 - 80770000)
[    5.890000] usbcore: registered new interface driver usbfs
[    5.890000] usbcore: registered new interface driver hub
[    5.910000] usbcore: registered new device driver usb
[    5.930000] SCSI subsystem initialized
[    9.800000] NET: Registered protocol family 10
[    9.820000] aoe: AoE v81 initialised.
[    9.820000] nbd: registered device at major 43
[    9.940000] nf_conntrack version 0.5.0 (1975 buckets, 7900 max)
[    9.960000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.020000] hidraw: raw HID events driver (C) Jiri Kosina
[   10.040000] Loading modules backported from Linux version master-2013-11-05-0-gafa3093
[   10.040000] Backport generated by backports.git backports-20130802-0-gdb67a3
[   10.120000] usbcore: registered new interface driver usbserial_generic
[   10.120000] usbserial: USB Serial support registered for generic
[   10.160000] xt_time: kernel timezone is -0000
[   10.190000] cfg80211: Calling CRDA to update world regulatory domain
[   10.190000] cfg80211: World regulatory domain updated:
[   10.200000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   10.210000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.220000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.220000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.230000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[   10.240000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
[   10.250000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
[   10.330000] PPP generic driver version 2.4.2
[   10.350000] NET: Registered protocol family 24
[   10.390000] usbcore: registered new interface driver option
[   10.390000] usbserial: USB Serial support registered for GSM modem (1-port)
root@OpenWrt:/# cat /proc/cpuinfo
system type             : Atheros AR9344 rev 2
machine                 : Generic AR71XX/AR724X/AR913X based board
processor               : 0
cpu model               : MIPS 74Kc V4.12
BogoMIPS                : 299.82
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x0000, 0x0078, 0x0868]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp dsp2
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                    61.7M     40.0K     61.7M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:/# free
             total         used         free       shared      buffers
Mem:        126436        24912       101524            0            0
-/+ buffers:              24912       101524
Swap:            0            0            0
root@OpenWrt:/# ifconfig -a
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:447 errors:0 dropped:0 overruns:0 frame:0
          TX packets:447 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:30246 (29.5 KiB)  TX bytes:30246 (29.5 KiB)

According to Mikrotik specs, the RB951G-2HnD (that is supported by openwrt) has nearly the same SoC as mine:

RB951G-2HnD = Atheros AR9344-DC3A
CRS125-24G-1S-RM = Atheros AR9344-DC3A-R

I'll try this image this week-end and keep you updated (I'm not at home right now...).

One things that bothers me is that the bootloader seems to give an unknown board model to the kernel:

[    0.000000] Kernel command line:  console=ttyS0,115200 parts=1 boot_part_size=4194304 gpio=233003 HZ=300000000 mem=128Mkmac=D4:CA:6D:F9:C2:43 board=crs125g ver=3.08 boot=1 mlc=5 rootfstype=yaffs noinitrd
[    0.000000] MIPS: no machine found for id 'crs125g', supported machines:

Someone can explain where I should add my device and make it point to the same config as the RB951G one ?

Thanks for your help.

Romain

I went a little bit further, I copied the RB951G-2HnD config file mach-rb95x.c to a new file mach-crs125g.c, added an entry into the Makefile and Kconfig files.

Now when I boot the device the board is detected as

0.090000] MIPS: machine is MikroTik CloudRouter CRS125-24G-1S

but still the interfaces aren't detected, I think that I need a specific config file.
Here's my dmesg output

[    0.000000] Linux version 3.10.26 (root@laptop) (gcc version 4.6.4 (OpenWrt/
Linaro GCC 4.6-2013.05 r39318) ) #16 Sun Feb 2 21:23:20 CET 2014
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 2
[    0.000000] Clocks: CPU:600.000MHz, DDR:350.000MHz, AHB:175.000MHz, Ref:25.0
00MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x07ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat 80314b60, node_mem_map 810000
00
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32
 bytes
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pa
ges: 32512
[    0.000000] Kernel command line:  console=ttyS0,115200 parts=1 boot_part_siz
e=4194304 gpio=233003 HZ=300000000 mem=128M kmac=D4:CA:6D:F9:C2:43 board=crs125
g ver=3.08 boot=1 mlc=5 console=ttyS0,115200 rootfstype=yaffs noinitrd
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 122092k/131072k available (2266k kernel code, 8980k rese
rved, 621k data, 4340k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.070000] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 512
[    0.080000] NET: Registered protocol family 16
[    0.090000] MIPS: machine is MikroTik CloudRouter CRS125-24G-1S
[    0.090000] rb: could not find a valid RouterBOOT hard config
[    0.100000] bio: create slab <bio-0> at 0
[    0.110000] Switching to clocksource MIPS
[    0.120000] NET: Registered protocol family 2
[    0.120000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.120000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.130000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.130000] TCP: reno registered
[    0.140000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.140000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.150000] NET: Registered protocol family 1
[    0.150000] PCI: CLS 0 bytes, default 32
[    5.720000] yaffs: yaffs built Jan 28 2014 20:28:24 Installing.
[    5.720000] msgmni has been set to 238
[    5.720000] io scheduler noop registered
[    5.720000] io scheduler deadline registered (default)
[    5.730000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    5.760000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    5.760000] console [ttyS0] enabled, bootconsole disabled
[    5.780000] TCP: cubic registered
[    5.790000] NET: Registered protocol family 17
[    5.790000] Bridge firewalling registered
[    5.800000] 8021q: 802.1Q VLAN Support v1.8
[    5.830000] Freeing unused kernel memory: 4340K (80333000 - 80770000)
[    5.920000] usbcore: registered new interface driver usbfs
[    5.920000] usbcore: registered new interface driver hub
[    5.940000] usbcore: registered new device driver usb
[    5.960000] SCSI subsystem initialized
[    9.820000] NET: Registered protocol family 10
[    9.830000] aoe: AoE v81 initialised.
[    9.840000] nbd: registered device at major 43
[    9.940000] nf_conntrack version 0.5.0 (1975 buckets, 7900 max)
[    9.960000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.000000] hidraw: raw HID events driver (C) Jiri Kosina
[   10.030000] Loading modules backported from Linux version master-2013-11-05-
0-gafa3093
[   10.030000] Backport generated by backports.git backports-20130802-0-gdb67a3
f
[   10.050000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.110000] usbcore: registered new interface driver usbserial
[   10.110000] usbcore: registered new interface driver usbserial_generic
[   10.130000] usbserial: USB Serial support registered for generic
[   10.170000] xt_time: kernel timezone is -0000
[   10.220000] cfg80211: Calling CRDA to update world regulatory domain
[   10.220000] cfg80211: World regulatory domain updated:
[   10.170000] xt_time: kernel timezone is -0000
[   10.220000] cfg80211: Calling CRDA to update world regulatory domain
[   10.220000] cfg80211: World regulatory domain updated:
[   10.230000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_ga
in, max_eirp)
[   10.240000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2
000 mBm)
[   10.250000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2
000 mBm)
[   10.250000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2
000 mBm)
[   10.260000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2
000 mBm)
[   10.270000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2
000 mBm)
[   10.280000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0
 mBm)
[   10.350000] PPP generic driver version 2.4.2
[   10.380000] NET: Registered protocol family 24
[   10.420000] usbcore: registered new interface driver option
[   10.440000] usbserial: USB Serial support registered for GSM modem (1-port)

I obtained a set of patches from mikrotik. It's for an older kernel (3.3.5) but anyway there is some interesting info for my device like GPIO and ethernet port map, ...

http://www.filedropper.com/linux-335patch

I'll see what I can do with it. BTW if someone can give me some hints they are welcome... smile

Romain

Hi Xens,

Can send me the patches too? smile
My email is c4mcr@hotmail.com

Regards

c4mcr wrote:

Hi Xens,

Can send me the patches too? smile

Regards


Also interested in those patches, could you send-me them?

gspoletto@gmail.com

Regards

Hi Xens and all,

I am very interested in doing some work with this device? Would you be able to send me the patches you obtained? My email is charlie@atechmedia.com

Was anybody able to progress to the point of having the network devices available?

Thanks!

After a day of playing with this device, I have had a degree of success. By using the mach-rb95x config, I can get 2 NICs visible. One connects to a switch internal to the CPU, and this seems to work correctly, the second should connct to the external switch. Unfortunately, I am completely unable to program the NIC to talk to this external switch with MII, GMII, RGMII.

I have scanned the MDIO registers on both interfaces, and get the following results. The second interface makes sense, but the first (which I believe should connect to the QC8513 switch) seems like nonsense. Here are the registers, can anyone who understands the atheros drivers better explain what I might be doing wrong here?

First interface (what is going on here?

[    2.620000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.630000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.640000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.650000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.660000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.660000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.670000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.680000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.690000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.700000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.700000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.710000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.720000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.730000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.740000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.740000] bus: ag71xx-mdio.0 0:dead 1:dead 2:0 3:0 4:dead 5:dead 6:0
[    2.750000] bus: ag71xx-mdio.0 0:2000 1:2000 2:10 3:10 4:1 5:1 6:5000
[    2.760000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.770000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.770000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.780000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.790000] bus: ag71xx-mdio.0 0:40 1:40 2:7 3:7 4:30 5:30 6:7
[    2.800000] bus: ag71xx-mdio.0 0:40 1:40 2:7 3:7 4:30 5:30 6:7
[    2.800000] bus: ag71xx-mdio.0 0:40 1:40 2:7 3:7 4:30 5:30 6:7
[    2.810000] bus: ag71xx-mdio.0 0:2000 1:2000 2:10 3:10 4:1 5:1 6:5000
[    2.820000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.830000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.830000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.840000] bus: ag71xx-mdio.0 0:43 1:43 2:7 3:7 4:30 5:30 6:7
[    2.850000] bus: ag71xx-mdio.0 0:40 1:40 2:7 3:7 4:30 5:30 6:7
[    2.850000] bus: ag71xx-mdio.0 0:40 1:40 2:7 3:7 4:30 5:30 6:7
[    2.860000] bus: ag71xx-mdio.0 0:40 1:40 2:7 3:7 4:30 5:30 6:7

Second interface (seems to point to a working 5-port switch)

[    2.900000] bus: ag71xx-mdio.1 0:3100 1:7949 2:4d 3:d042 4:1de1 5:0 6:0
[    2.910000] bus: ag71xx-mdio.1 0:3100 1:7949 2:4d 3:d042 4:1de1 5:0 6:0
[    2.920000] bus: ag71xx-mdio.1 0:3100 1:7949 2:4d 3:d042 4:1de1 5:0 6:0
[    2.920000] bus: ag71xx-mdio.1 0:3100 1:7949 2:4d 3:d042 4:1de1 5:0 6:0
[    2.930000] bus: ag71xx-mdio.1 0:3100 1:7949 2:4d 3:d042 4:1de1 5:0 6:0
[    2.940000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.950000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.950000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.960000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.970000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.980000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.990000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    2.990000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.000000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.010000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.020000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.020000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.030000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.040000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.050000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.050000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.060000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.070000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.080000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.080000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.090000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.100000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.110000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.110000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.120000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.130000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff
[    3.140000] bus: ag71xx-mdio.1 0:ffff 1:ffff 2:ffff 3:ffff 4:ffff 5:ffff 6:ffff

So, after several more hours of testing and reading, I've got some positive results, and some roadblocks.

  • The CPU/SoC is an Atheros AR9344 rev 2. This is well supported and basic things work great. The system is stable serial console work easily.

  • The SoC has 2 Ethernet ports. Eth0 is connected to the main switch, eth1 is connected to an internal switch (probably unused).

  • The main switch is a Qualcomm Atheros QCA8513 - no data is available on this device whatsoever.

  • The QCA8513 does not respond to basic MDIO identification requests, meaning the kernel (PHY layer) does not recognise it.

  • By forcing the kernel to identity the switch as an Atheros 83xx switch, basic communication occurs. The switch is correctly identified. The device seems to support the same basic protocol as other Atheros switches, however it is not similar enough to any supported switch to make it fully work out of the box.

  • Packets sent from eth0 reach the outside world (at least through switch port 1)

  • Packets from the outside world do not reach eth0

Unfortunately, I don't know any way I can continue without access to information about the QCA8513 configuration registers. These could potentially be obtained from the Mikrotik image, however I have not been able to extract and examine this.

The Mikrotik GPL sources are useless on the subject, as the NIC is actually fully supported by Linux, what is missing is the tool to configure the switch. I assume this is contained in a proprietary driver of userland tool.

(Last edited by catphish on 4 Nov 2014, 21:53)

im also interested in the patches but your link is dead.

could you email them to me? at ko_tash@hotmail.com

i may have some ideas but also seeing what you have done might give me some ideas and hints to help.

suncatalyst, I have emailed you the patches. They're not much use though afaict.

Update on progress:

SoC: AR9344 - Working
Flash: Not looked at this
Ethernet: Working, eth0 connects to main switch, TX only, possibly due to unconfigured switch, eth1 goes to built-in switch, probably not connected to anything.
Switch: Awaiting data sheet
Touchscreen: Not looked at this

If anyone else has this device, I'd appreciate any assistance, particularly on the flash side of this, and would be happy to provide my initial patch to make the Ethernet work, particularly if anyone can work out why it's unidirectional at present.

The following features are now working in my build:

* CPU
* Serial
* Basic Ethernet communication including initialization of default switch config
* LEDs
* NAND

The following does not work

* LCD display - Datasheets are available, I haven't written a driver
* Installation - I don't know the flash layout and don't want to write to it
* Speaker - This should be trivial but no driver exists for GPIO speakers
* Wireless is untested (my unit does not have wireless)

I've documented some of the hardare here: http://wiki.openwrt.org/toh/mikrotik/crs125g
My basic code is here (this excludes switch config, but networking works): http://pastie.org/9872467

I'm currently working through full swtch configuration (VLANs, port countrs, etc). I'd appreaciate any help that can be provided with the flash layout, LCD or speaker.

Unfortunately, I cannot easily share my switch code due to NDA, but hope to do so when it's complete.

(Last edited by catphish on 1 Feb 2015, 19:49)

When it is estimated the the switch work is finished, and of course allowed to be distributed.  Comparative to a Zyxel switch (GS-1910) which is almost half price, his feature are very limited.  Unfortunately QCA8513L datasheet is not available, so it is an unknown if the missing features are because the chipset hardware does not support them, or because the ROUTEROS does not implement them yet. 
I intend to buy this switch, but routeros implementation dissapoint me. If there will be no way to install openwrt on it ( and of course to be able to use the switch chipset at his full capacity) in near future, I'll probablyu buy zyxel GS1910-24 + WDR3600 for less money.

spon901 - what features are you looking for specifically? My driver is quite basic so far, but if you tell me what you need, I'll do what I can to add it smile

Thak you for your support.  I don't need something special now.  I intend to buy a 24GB switch and now I am in the phase of searching.  I don't want to spend more than 200 USD on it, but I want to have minimal things, like ACL, trunking and of course VLAN's .  RouterOS in CRS125 seem to be very mionimal(relating to the switch part) , and yet it does not support even ACL, STP, trunking  which are in my opinion very basic things( maybe ACL not, but others for sure) .  All of them are currently supported through bridging mode, which mean through CPU, instead of chipset, according to what I read on mikrotik forum, which drastically limit the speed. What is the point to create a trunk of 3 x1GB connection if , because of CPU, the maximal speed will be under 200 Mb? In my opinion this switch has very good hardware inside, but the software is definitely unfinished. Unfortunately , beacuse I don;t have access to the datashet I have no idea what is the limitation from the hardware point of view. Atheros said that this chip has advanced LS/L3 features, but what are those advanced features I have no idea.  I'm not in a hurry to buy a switch right now.  I can wait until beginning of summer, but until then I need to take a decision. Maybe until then I can find the datasheet.  Then I'll chose between CRS on which I'll put openwrt, or I'll take Zyxel1910-24, which has a very rich set of features , and also a TPLINK WDR3600 plus openwrt which has same processor as CRS125 ( at a little bit lower frequency) .  Openwrt is a must, because i Want to put on it  a minidlna server and transmission torrent client, things that cannot be done through ROUTEROS.
Comparative to Zyxel, do you think the chipset inside CRS is better or worse ? (I'm referring stricly from the point of view of features, not fiability)

Thanks for your input. This is exactly the type of functionality that I was interested in when I bought this device smile

Unfortunately I can't go into specifics about the exact functionality of the hardware (as I have the datasheet under NDA), but it supports plenty of advanced functionality that I very much hope we can support on OpenWrt.

i never got the patches. but ill checkout your work and see.

i need to get thru my Dads tax mess (he has alzheimers) and then ill be able to devote
some time to working on this.

can you forward me what ya got catphish and we can work together on this?

Hi Catphish,

How did you get the datasheet under NDA?  Did you pay something. It was difficult to obtain it? I intend also to have it just in order to do some development for myself. ( so I'll not make money out of it).

Thank you

The discussion might have continued from here.