OPENWRT_DIR variable is your OpenWRT dir path.
KERNEL_IMAGE variable is determines which uImage to use
Then, do sh ./Build.sh
If everything goes well, then an ./loader file is formed.
Next, with the help of an bootp/tftp, upload this file to a RouterBOOT.
I will post WIP as it goes here.
Current DTS and config should not work at all as it is simply do have something to boot.
But Toshiba BENAND ECC support is backported, LDO driver for SD card and SDHCI driver are included.
transfer started ................................... transfer ok, time=5.71s
setting up elf image... OK
jumping to kernel code
TEXT_BASE = 0x81820000
Kernel header:
ih_magic = 27051956. magic OK
ih_size = 4607392
ih_name = 'ARM OpenWrt Linux-4.19.19'
Copy kernel...Done
Starting kernel at 0x80208000
I am now trying to figure out how the hell did Mikrotik manage to connect NAND and SPI NOR.
In decompiled DTB pulled from SPI-NOR they claim to use GPIO54, GPIO55, GPIO56 and GPIO57 for SPI but those pins are used for NAND in every board I found, using MR33 pins for NAND it gets detected.
Also, for whatever reason changing UART GPIO pins makes no effect and UART always works.
Perhaps because a UART does not use gpio on program level. Work with them is based on a registers mapped in memory. To write to it, for example, you only need a dm_base address(0x78af00 for UART1, 0x78b000 for UART2).
Did you manage to run a network? My kernel falls due to the fact that the mdio for switch is not detected(priv->mii_bus == NULL on ar40xx_probe).
libphy: ipq40xx_mdio: probed
[ 0.838531] mdio_bus 90000.mdio: MDIO device at address 0 is missing.
[ 0.841479] mdio_bus 90000.mdio: MDIO device at address 1 is missing.
[ 0.847849] mdio_bus 90000.mdio: MDIO device at address 2 is missing.
[ 0.854240] mdio_bus 90000.mdio: MDIO device at address 3 is missing.
[ 0.860681] mdio_bus 90000.mdio: MDIO device at address 4 is missing.
Well, even if they are not used on a program level but as far as I know there are no dedicated UART pads on the IC but rather there is a pinctrl group of GPIOs that you can use for UART output/input but I assume that they are all used for UART unless pinctrl is set for another group.
No, mine fails too and will actually crash the kernel during probing.
DTS that I posted misses the node to gmac1 as that 1 is only used by Mikrotik but even that does not help as probing does not find MDIOs at all.
MDIO is usually initialized by U-boot as far as I know, so I will compile in /dev/mem and busybox devmem to look if anything is set at all in MDIO registers.
Also, I gotta take a look at Mikrotiks IPQ40xx series drivers in the GPL, I wouldnt be surprised if they modified the QCA driver to initialize MDIO
They could, but I doubt that they do as DTS would need to have those modifications and it does not look anything different than other semi reference board designs, especially since IPQ4019 has a ton of GPIO pins and they are really not using much at all.
That MR33 is a weird one since it has AR8035 PHY connected and uses it for pretty much everything.
But stock DTS has to define those as well and it does not so I doubt that they are bitbanging but rather that MDIOs are not initialized at all and its most likely hidden inside a 13MB Mikrotik GPL that contains code for all targets.
Its just that finding stuff in it is terrible
Yes, they are doing something weird.
Take a look at what RouterOS supout indicates.
4294967295 is reset value for a lot of MMIO stuff they have.
But I cant find anything specific that looks interesting