Support for Mikrotik RB3011UiAS-RM?

Yeah, I know that GPIO33 Is supposed to start the LDO but it makes no difference if I export it HIGH or LOW.
QCA driver internaly switches the GPIO HIGH.

QCA driver has a lot of differences but main issue is that upstream driver does not respect max frequency binding and does not have property to list available frequencies as IPQ4019 uses 192 and 384 MHz instead of 200 or 400 MHz that driver is trying to force.

But both drivers cause a lot of IRQ warnings.

Awesome job on latest aux-loader code

@adron I saw your commit.
Is it possible to use gzipped kernel instead as a lighter alternative?

No. gzip is also unpacked for a long time. Is availability of fit image support critical for you?

No, I dont think that FIT is critical at all for these devices.
Its simply used as U-boot supports it so its the easiest way of getting them to boot.
But since Mikrotik does not use U-boot its not important and legacy image is fine.

I solved a problem. The performance drop was caused by the CPU D-Cache turned off. Now unpacking takes 2 seconds (1.5 seconds faster than with the uImage).

Awesome.
I have been going at SD card slot but its not budging.
With LDO and modified QCA MMC driver SD card will work if card is present during boot but due to IRQ issues it wont be detected if reinserted

Just tested LZMA FIT image and it boots really fast.
Awesome job.

I will push rebased version of my tree soon.

Thanks. It seems that it turned out to achieve stability with the caches turned on.

@adron I see that you updated the loader to enable OpenWrt integration
Any hints on using it?

Hello. I am still working on integration. When I'm done, I'll let you know.

Awesome, thanks.

I will describe some of the oddities that I encountered for the ubifs of the Kernel section.
The parameters of the section itself (as shown by ubi_reader) are more than standard.
But there are some oddities in working with this section.

  1. If you create ubi with these commands:
ubidetach -p /dev/mtd0
nc 172.20.1.77 1111 > /tmp/i.ubi
ubiformat /dev/mtd0 -y -f /tmp/i.ubi

where /tmp/i.ubi is a previously prepared, ubinized image, then the RouterBOOT loads the kernel perfectly!

  1. If after paragraph 1 you make the following commands:
mount -t ubifs ubi0:Kernel /mnt -o compr=none
cd /mnt/
root@OpenWrt:/mnt# ls
kernel
root@OpenWrt:/mnt# cp ./kernel /tmp
root@OpenWrt:/mnt# rm ./kernel 
root@OpenWrt:/mnt# cp /tmp/kernel ./
umount /mnt
sync
reboot

Then when RouterBOOT is started we receive a messages:
loading kernel ... OK
setting up elf image ... not an elf header
kernel loading failed
trying bootp protocol .... ok
But the kernel is still in place! But in the structure of the UBI something has changed and it is something that does not like the RouterBOOT.

  1. If we create UBI with the following commands:
ubidetach -p /dev/mtd0
ubiformat /dev/mtd0 -y
ubiattach -m 0
ubimkvol /dev/ubi0 -N Kernel -s 15000000
nc 172.20.1.77 1111 > /tmp/i.ubifs
ubiupdatevol /dev/ubi0_0 /tmp/i.ubifs

And then having made a dump /dev/ubi0_0 we will analyze it by means of ubi_reader, then it will show that all ubi parameters are EXACTLY the same as for
i.ubi from paragraph 1, BUT! RouterBOOT reports the following:
loading kernel ... kernel not found or data is corrupted
trying bootp protocol .... ok

  1. If we create UBI with the following commands:
ubidetach -p /dev/mtd0
nc 172.20.1.77 1111 > /tmp/i.ubi
ubiformat /dev/mtd0 -y -f /tmp/i.ubi
ubiattach -m 0
nc 172.20.1.77 1111 > /tmp/i.ubifs
ubiupdatevol /dev/ubi0_0 /tmp/i.ubifs

Routerbut reports the following:
loading kernel ... kernel not found or data is corrupted

Oh. As it turned out, we only need to fix a small bug in nand.sh and the sysupgrade process becomes possible.

Awesome news.
In the end this might be a really good home router

First working wersion is done. Please test: aux-loader-openwrt

Awesome, will build and test.

It works.
Awesome

Fine. Thank you for everything. Then from Monday I turn to work on RB3011. First, I adapt the bootloader for it and then everything else.

Unfortunately, my experience with IPQ806X is limited and even worse I had access to RB3011 until a month or so.
Good thing is that for RB3011 most stuff should be in the Mikrotik GPL patch as they started with practice of hardcoding it into DTB after RB3011 was released.
Also, almost everything is upstream and there are plenty of supported board as a example.
But I sense that MT messed with networking again.

I will clean up my RB450Gx4 branch so its tidy and in a upstreamable way so when you make a PR for the aux-loader everything is ready.
Also got Wireless Wire Dish kit cooming soon so it will be interesting as its 60GHz device and they are using AR8035 on single GMAC like MR33 does.

Thanks. I tested your last branch. Everything work as expected.
Are you planning to do support for the rbcfg? To do this, you need to describe the mtd partitions on a SPI NOR flash drive like this:

mtd0: 0000c000 00010000 "routerboot"
mtd1: 00001000 00010000 "hard_config"
mtd2: 00001000 00010000 "bios"
mtd3: 00001000 00001000 "soft_config"
mtd4: 00040000 00020000 "booter"
mtd5: 003c0000 00020000 "kernel"
mtd6: 07c00000 00020000 "ubi"