Adding OpenWrt support for Xirrus XR-2400 Target

Successfully bootet OpenWRT!!

Patches to target/linux/octeon/image/Makefile:

define Build/xapimg
	cp $@ $@-rootfs.bin
	mkimage -A mips -O Linux -T multi -C none -n '$(VERSION_DIST) Linux-$(LINUX_VERSION)' -e 0 -a 0 -d $(KDIR)/vmlinux-initramfs.elf:$<:$@-rootfs.bin $@
endef

define Device/xirrus_xr2400
  IMAGES := factory.bin
  IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 128k | xapimg
  DEVICE_TITLE := Xirrus XR2400
endef
TARGET_DEVICES += xirrus_xr2400

Bootlog:

Xirrus Boot Loader 7.1.0-7066 (Apr 06 2016 - 16:34:06)

Board       | Xirrus CN5220-CP CPU Board
Clocks      | CPU :  500 MHz   DDR : 800 MHz
I2C Bus     | 384 KHz, sampling at 19 MHz
Reset       | Power on
Watchdog    | Enabled (5 secs)
System DDR  |   1 GB, DDR2 Unbuffered non-ECC
FLASH       |   8 MB, CRC: OK
RTC         | Fri 2016-May-06  0:02:37 GMT
DTT         | Ambient: 14C, Junction: 37C
Compass     | 298 degrees
CPU BIST    | Pass
PCIe        | link up, 2 lanes, gen1 speed, first bus= 0, last bus= 5
Radios      |  - - - -
Network     | eth0
USB         | 2 Storage Devices found
Certs       | Not programmed
Environment | Initialized

In:    ser_xc
Out:   ser_xc
Err:   ser_xc

Press space bar to exit to bootloader:  0

[USB 0 ] File    : X*.bin
[USB 0 ] Address : 0x20000000
[USB 0 ] Loading : ############################################### done
[USB 0 ] Complete: 15.8 sec, 17.4 MB/sec
[USB 0 ] Bytes   : 288821616 (11371170 hex)
[Boot  ] Address : 0x20000000
[Image ] Name    : OpenWrt Linux-4.14.193
[Image ] Created : 2020-08-24  17:56:10 UTC
[Image ] Type    : MIPS Linux Multi-File Image (uncompressed)
[Image ] Size    : 288821552 Bytes =  275.4 MB
[Image ] Contents: File 0: 13123728 Bytes =   12.5 MB
[Image ] Contents: File 1:  7131280 Bytes =    6.8 MB
[Image ] Contents: File 2: 268566528 Bytes =  256.1 MB
[Boot  ] Image   : Verifying image ....... OK
[Boot  ] Loading : Multi-File Image .... OK
[Boot  ] Watchdog: Setting to 40 secs .... OK
[Boot  ] Execute : Transferring control to OS

[    0.000000] Linux version 4.14.193 (root@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11192-8b0278a17e)) #0 SMP Mon Aug 24 17:56:10 2020
[    0.000000] CVMSEG size: 2 cache lines (256 bytes)
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 000d0708 (Cavium Octeon+)
[    0.000000] Checking for the multiply/shift bug... no.
[    0.000000] Checking for the daddiu bug... no.
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 0000000001000000 @ 0000000002f00000 (usable)
[    0.000000]  memory: 000000000b400000 @ 0000000004800000 (usable)
[    0.000000]  memory: 0000000010000000 @ 0000000020000000 (usable)
[    0.000000]  memory: 0000000001dd6e60 @ 0000000001100000 (usable)
[    2.494652] Initramfs unpacking failed: junk in compressed archive
[    2.527132] of-flash 1f400000.nor: Can't get bank width from device tree
[    2.566521] Failed to register MTD device for flash
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level

[    6.021885] BUG: Bad page state in process udevtrigger  pfn:2fcdb
[    6.027992] page:8000000003dfffe8 count:0 mapcount:-1578180946 mapping:          (null) index:0x0
[    6.036866] flags: 0x200000000000()
[    6.040367] raw: 0000200000000000 0000000000000000 0000000000000000 a1eedead00000000
[    6.048114] raw: 8000000003e00008 8000000003e00008 0000000000000000
[    6.054381] page dumped because: nonzero mapcount
Please press Enter to activate this console.



BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07-SNAPSHOT, r11192-8b0278a17e
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# 

Watchdog is still shutting down the OS after a few seconds.
Working on that...