Porting guide ar71xx to ath79?

No sorry, i have no experience with RedBoot nor do i know anything about it.

What happens if you set bootargs = "console=ttyS0,115200"; in dts?
I think there shouldn be root=XXX if you have fixed-partitions and the other stuff shouldn´t also be needed.

root=xxx I just added it manually, the thing is about spi not showing up, spi is used for vitesse chip, maybe it needs adjustments in dts ?

What is this?

Could you post a link to the corresponding mach-file?
That one mach-pb42.c?

is the pb44 (I think is in the upstream kernel) but maybe this patch is more clear about it https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/patches-4.9/606-MIPS-ath79-pb44-fixes.patch

maybe I need to do something with pcf857x ?
https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt

the vitesse https://ethernet.microsemi.com/products/product/VSC7395

There is DSA driver for Vitesse 73XX series on the mailing list.
It has not yet been merged but its in v2 now

I tried the realtek dsa, but I think the kernel needs to be updated, and I failed doing that, it locks at random function.

for now, the flash is the problem, the ethernet later

the work is here https://github.com/lucize/openwrt/tree/ath79-pb44

From my point of view there is nothing wrong with your flash definition in comparison to the mach file...
What confuses me a little bit is the cs definition...

Try to add cs-gpios = <&gpio 0 0>; after cs-num = <1>;.
Probably this device / board does use a generic gpio instead of the hw cs pin.

To the switch:
If i grep through the linux source there are some dts files with compatible = "vitesse-7385"; defined, but there is no matching driver. Probably this isn´t needed, but it´s not clear to me how you could define the firmware for the switch.

the driver is in ar71xx target and the firmware is packed as a separate package, I'll try the cs-gpios, it's a bummer I don't understand how to run from memory

This will be for sure true, but the found dts files are from the mainline source code and this devices have all a powerpc arch... confusing...

Have you tried to load a image from a tftp server with something like this:

Redboot> load xxxx.img
Redboot> go

This info is from here
I think you need wireshark to get information which ip and port is used...

it just hangs, I use tft before I write the image to flash

RedBoot> load -r -v -b 0x80060000 u4ea-fusion70-kernel.bin
Using default protocol (TFTP)                  -------------------------------------------------------------------
Raw file loaded 0x80060000-0x80239840, assumed entry at 0x80060000
RedBoot> go

Probably your entry point isn´t correct...

The base address confuses me a litte bit... But as i said i have more than nothing experience with this bootloader...

yes, at first it would not boot at all if base address is not set manually (redboot will put it wrong), I had a lot of headache making the device boot openwrt
but the wireless signal is so good that made wort spending the time, and with only internal anennas

so, something is strange I tried the ar71xx pb44 target with patched kernel 4.14 (closed PR) and with normal 4.9 kernel, both of them would not detect the spi flash and I know that the only thing I edited to pb44 was to disable the usb and changed the root= command
so the problem must be between 4.4 and 4.9

Tho old patch of pb44 looks very similar to the one from 4.9.

You say lede 17.01 is working normally and all above not?

the last update made on device, I'll try the latest one with 4.4 and see how it goes

I'll try around this m25p80 commit

@lucize I think You're overcomplicating things. I checked the code in ar71xx target for building PB4X image and didn't see any specific adjustments for gziped images. Have in mind that RedBoot expects separate kernel and rootfs partitions, You should use combined-image command to create it. For example look at the definition:


Unfortunately current patch-set in ath79 doesn't have patch for scanning RedBoot partition layout and all partitions need to be statically defined in dts, and because of that kernel size needs to be specified and padded to this size. Also remove the root= argument from kernel command line.

thanks I'm fine manual writing the kernel and after that rootfs on the manual defined partitions, don't know anyone else with this board type, I would liked to make okli-loader work to save some space on kernel (although I don't need the space), but I don't know if is made for redboot or how is scanning the flash for the magic word. I enabled some debug to see what address will search but I made the step too small and eventually crashed in searching

the flash layout must look like this, if not, it will not boot, only the names matter, size can be adjusted

RedBoot           0xBF000000  0xBF000000  0x00040000  0x00000000
BootConfig        0xBF040000  0x80500000  0x00040000  0x00000000
BootConfigSave    0xBF080000  0x80500000  0x00040000  0x00000000
KernelA           0xBF0C0000  0x80060000  0x00200000  0x80060000
RootFsA           0xBF2C0000  0x80500000  0x004C0000  0x00000000
KernelB           0xBF780000  0x80060000  0x00180000  0x80070000
RootFsB           0xBF900000  0x80500000  0x00300000  0x00000000
rootfs_data       0xBFC00000  0x80500000  0x00340000  0x00000000
Test              0xBFF40000  0x80500000  0x00040000  0x00000000
FIS directory     0xBFF80000  0xBFF80000  0x0003F000  0x00000000
RedBoot config    0xBFFBF000  0xBFFBF000  0x00001000  0x00000000
Board data        0xBFFC0000  0xBFFC0000  0x00040000  0x00000000

between RootFsB and Test there can be any number of partitions. Redboot has lzma support, but this version is quite stripped, is costumized for u4ea devices

I don't know specifics, just started looking at it month ago, but as I see RedBoot boots kernel from partition with specified label which is looked up in FIS directory.