SXTSQ 5ac Support

Wondering if anyone has tried adding support for the Mikrotik SXTSQ 5ac, there is some people working on the wAP 60g which looks like it is also ipq40XX based. I didn't want to pollute that thread so I might try to get things working and update here.

Branch is here, still working on getting initramfs booting.

1 Like

Ok, you have it booting up how ? Without opening?

I haven't opened it up yet, I've been trying to get it to work with netboot via tftp. It would probably be easier opening it up and getting console access though. I'm still not sure if there are any steps post build that need to be done to prepare the initramfs and need to read the other thread more thoroughly.

1 Like

Ok, understood. Share to console out if you can

Sure thing, I haven't had much time to work on this recently but hopefully will have some more time soon to keep digging.

I've made a little more progress, but since I'm not opening it up it will take a little longer, let me share my setup in case anyone else wants to test.

For the dhcp server and booting I've been using the following script to run dhcpd and tftpd:

#!/bin/bash
sudo truncate -s 0 leases* || echo "no leases file"
sudo dhcpd -cf dhcpd.conf -lf $(pwd)/leases -pf $(pwd)/pid -tf $(pwd)/traces
sudo in.tftpd -L -vvvvv -s $(pwd)

I then tail the leases file in another terminal/panel.

The dhcpd.conf file is as follows:

authoritative;

option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.13 192.168.1.99;
  default-lease-time 600;
  max-lease-time 7200;

}

host tik{
  fixed-address 192.168.1.1;
  hardware ethernet <REPLACE WITH MAC OF SXTSQ>;
  #filename "/zImage-initramfs";
  #filename "/vmlinux-initramfs.elf";
  filename "/vmlinux.elf";
}

The host that the sxtsq is connected to via ethernet should have a static IP less than the range and not 192.168.1.1 (I use 192.168.1.12). The filename file should be present in the same directory as the dhcpd.conf.

What I'm stuck on is which file from the build should be used to netboot. In the build output dir I see the following files:

$ find . -maxdepth 1 -perm -111 -type f
./zImage
./Image-initramfs
./vmlinux-initramfs.elf
./vmlinux-initramfs
./vmlinux-initramfs.debug
./mikrotik_sxtsq-5ac-fit-uImage.itb
./vmlinux
./Image
./vmlinux.debug
./vmlinux.elf
./zImage-initramfs

I've tried several of them, but haven't had much success, if anyone has a little more experience with the Mikrotik bootloader that would be helpful.

1 Like

Here are the wiki notes

https://openwrt.org/toh/mikrotik/common

You typically boot the

initramfs-kernel.bin

And add these config as wiki details to build the initramfs-kernel

echo CONFIG_TARGET_ROOTFS_INITRAMFS=y >> .config
echo CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE=y >> .config
# make defconfig creates the rest of the config file. 
make defconfig
# -j parallel compilation may cause problems, but usually it does not.
# choose the number according to the number of your CPU cores
make -j 6

this commit

does not build ? fails at

make[3] -C target/linux install

arm-openwrt-linux-muslgnueabi-cpp -nostdinc -x assembler-with-cpp -I/media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.36/arch/arm/boot/dts -I/media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.36/arch/arm/boot/dts/include -I/media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.36/include/ -undef -D__DTS__  -o /media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/image-qcom-ipq4019-sxtsq-5ac.dtb.tmp /media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.36/arch/arm/boot/dts/qcom-ipq4019-sxtsq-5ac.dts
arm-openwrt-linux-muslgnueabi-cpp: error: /media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.36/arch/arm/boot/dts/qcom-ipq4019-sxtsq-5ac.dts: No such file or directory
arm-openwrt-linux-muslgnueabi-cpp: warning: '-x assembler-with-cpp' after last input file has no effect
arm-openwrt-linux-muslgnueabi-cpp: fatal error: no input files
compilation terminated.
make[5]: *** [Makefile:712: /media/raid/storage/fresh-git/mikrotik/2/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/image-qcom-ipq4019-sxtsq-5ac.dtb] Error 1
make[5]: Leaving directory '/media/raid/storage/fresh-git/mikrotik/2/openwrt/target/linux/ipq40xx/image'
make[4]: *** [Makefile:23: install] Error 2
make[4]: Leaving directory '/media/raid/storage/fresh-git/mikrotik/2/openwrt/target/linux/ipq40xx'
make[3]: *** [Makefile:13: install] Error 2
make[3]: Leaving directory '/media/raid/storage/fresh-git/mikrotik/2/openwrt/target/linux'
time: target/linux/install#62.84#15.37#74.50
make[2]: *** [target/Makefile:25: target/linux/install] Error 2
make[2]: Leaving directory '/media/raid/storage/fresh-git/mikrotik/2/openwrt'
make[1]: *** [target/Makefile:19: /media/raid/storage/fresh-git/mikrotik/2/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.target_install] Error 2
make[1]: Leaving directory '/media/raid/storage/fresh-git/mikrotik/2/openwrt'
make: *** [/media/raid/storage/fresh-git/mikrotik/2/openwrt/include/toplevel.mk:220: world] Error 2

Can you build with make V=s? This config is what I have been using to build. It may need this patch:

diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile
index 8c861f2f03..4dd1636b51 100644
--- a/target/linux/ipq40xx/Makefile
+++ b/target/linux/ipq40xx/Makefile
@@ -8,8 +8,8 @@ CPU_TYPE:=cortex-a7
 CPU_SUBTYPE:=neon-vfpv4
 SUBTARGETS:=generic
 
-KERNEL_PATCHVER:=5.4
-KERNEL_TESTING_PATCHVER:=5.4
+KERNEL_PATCHVER:=4.19
+KERNEL_TESTING_PATCHVER:=4.19
 
 KERNELNAME:=zImage Image dtbs
 
diff --git a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-sxtsq-5ac.dts b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-sxtsq-5ac.dts
index 6ec5d33039..b8f1feeff9 100644
--- a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-sxtsq-5ac.dts
+++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-sxtsq-5ac.dts
@@ -34,13 +34,6 @@
                stdout-path = "serial0:115200n8";
        };
 
-       aliases {
-               led-boot = &user;
-               led-failsafe = &user;
-               led-running = &user;
-               led-upgrade = &user;
-       };
-
        soc {
                rng@22000 {
                        status = "okay";

I've pushed that patch to the branch, so if you pull it again it should build.

ok, i have built with changes to config as im building to include LibreMesh also

So I will try boot bit later

openwrt-ipq40xx-generic-mikrotik_sxtsq-5ac-initramfs-fit-uImage.elf

Where must I put this kernel config ?

The config should go in the base directory of openwrt:

~/git/openwrt$ ls -l .config
-rw-r--r--. 1 daniel daniel 224556 May  4 15:30 .config

Then you can run make menuconfig to add any packages or other settings.

No, the link above you gave is for a kernel config

https://github.com/hodgesds/kernel-configs/blob/master/linux-ipq40xx-4.19.config

Oh yeah, sorry about that!

It does not look like it bootup normally

i sends the file openwrt.elf

I will build again without LibreMesh and see

root@useri3:/tftpboot# dnsmasq -i enx00133b56066d --dhcp-range=192.168.88.64,192.168.88.128 \
> --dhcp-boot=openwrt.elf \
> --enable-tftp --tftp-root=/tftpboot/ -d -u nobody -p0 -K \
> --log-dhcp --bootp-dynamic \
> --dhcp-host=cc:2d:e0:47:b3:56:d3,192.168.88.96
dnsmasq: started, version 2.80 DNS disabled
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
dnsmasq-dhcp: DHCP, IP range 192.168.88.100 -- 192.168.88.119, lease time 2m
dnsmasq-dhcp: DHCP, IP range 192.168.88.64 -- 192.168.88.128, lease time 1h
dnsmasq-tftp: TFTP root is /tftpboot/ 
dnsmasq-dhcp: 1626727910 available DHCP range: 192.168.88.64 -- 192.168.88.128
dnsmasq-dhcp: 1626727910 available DHCP range: 192.168.88.100 -- 192.168.88.119
dnsmasq-dhcp: 1626727910 vendor class: ARM__boot
dnsmasq-dhcp: 1626727910 DHCPDISCOVER(enx00133b56066d) cc:2d:e0:47:b3:56 
dnsmasq-dhcp: 1626727910 tags: known, enx00133b56066d
dnsmasq-dhcp: 1626727910 DHCPOFFER(enx00133b56066d) 192.168.88.101 cc:2d:e0:47:b3:56 
dnsmasq-dhcp: 1626727910 requested options: 1:netmask, 3:router
dnsmasq-dhcp: 1626727910 bootfile name: /tftpboot/openwrt.elf
dnsmasq-dhcp: 1626727910 server name: boothost
dnsmasq-dhcp: 1626727910 next server: 192.168.88.2
dnsmasq-dhcp: 1626727910 sent size:  1 option: 53 message-type  2
dnsmasq-dhcp: 1626727910 sent size:  4 option: 54 server-identifier  192.168.88.2
dnsmasq-dhcp: 1626727910 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 1626727910 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 1626727910 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 1626727910 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 1626727910 sent size:  4 option: 28 broadcast  192.168.88.255
dnsmasq-dhcp: 1626727910 sent size:  4 option:  3 router  192.168.88.2
dnsmasq-dhcp: 3899488303 available DHCP range: 192.168.88.64 -- 192.168.88.128
dnsmasq-dhcp: 3899488303 available DHCP range: 192.168.88.100 -- 192.168.88.119
dnsmasq-dhcp: 3899488303 vendor class: ARM__boot
dnsmasq-dhcp: 3899488303 DHCPREQUEST(enx00133b56066d) 192.168.88.101 cc:2d:e0:47:b3:56 
dnsmasq-dhcp: 3899488303 tags: known, enx00133b56066d
dnsmasq-dhcp: 3899488303 DHCPACK(enx00133b56066d) 192.168.88.101 cc:2d:e0:47:b3:56 
dnsmasq-dhcp: 3899488303 requested options: 1:netmask, 3:router
dnsmasq-dhcp: 3899488303 bootfile name: /tftpboot/openwrt.elf
dnsmasq-dhcp: 3899488303 server name: boothost
dnsmasq-dhcp: 3899488303 next server: 192.168.88.2
dnsmasq-dhcp: 3899488303 sent size:  1 option: 53 message-type  5
dnsmasq-dhcp: 3899488303 sent size:  4 option: 54 server-identifier  192.168.88.2
dnsmasq-dhcp: 3899488303 sent size:  4 option: 51 lease-time  1h
dnsmasq-dhcp: 3899488303 sent size:  4 option: 58 T1  30m
dnsmasq-dhcp: 3899488303 sent size:  4 option: 59 T2  52m30s
dnsmasq-dhcp: 3899488303 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 3899488303 sent size:  4 option: 28 broadcast  192.168.88.255
dnsmasq-dhcp: 3899488303 sent size:  4 option:  3 router  192.168.88.2
dnsmasq-tftp: sent /tftpboot/openwrt.elf to 192.168.88.101
dnsmasq-dhcp: 3899488303 available DHCP range: 192.168.88.64 -- 192.168.88.128
dnsmasq-dhcp: 3899488303 available DHCP range: 192.168.88.100 -- 192.168.88.119
dnsmasq-dhcp: 3899488303 vendor class: ARM__boot


If it is able to boot properly I think it will come up as 192.168.1.1 are you able to ping it on that address

no, not able to ping on 192.168.1.1

What version are you able to downgrade to your Mikrotik RouterOS ?

I was able to downgrade to 6.41.3 and get a root busybox shell