RB1100 custom kernel

Hey everybody,

Wondering if anyone here might have some tips on building a Linux kernel that will boot on an RB1100-series board, bare-metal. I have a set of patches against 2.6.35 straight from MikroTik (includes support for all RouterBOARDs manufactured as of RouterOS 5.0; this is NOT the same as the MetaROUTER-only patches to 2.6.31 that MikroTik distributes publicly on the wiki). I have applied these patches and built a kernel using a PowerPC cross-compiler (gcc 4.1.2). The resulting kernel image boots up just fine inside of PowerPC MetaROUTER and runs great! However, when I try to Netboot the same kernel image (ELF-wrapped, either with or without an initrd attached), after RouterBOOT prints “jumping to kernel code”, it hangs. I get nothing further on the serial console.

Thinking it may just be a problem with console output, I have tried to append “console=ttyS0,115200” to the kernel boot parameters, but that didn’t fix it. I also tried “ttyS1”. Finally, I hooked a serial header to the second serial port block on the board to see if maybe the console output was accidentally being sent to that (again both with ttyS0 and ttyS1), and still nothing. I think that it really is hanging when trying to load the kernel. Unfortunately, I get no output to give me any clues as to what is going wrong, so I have no idea what to try next.

Anybody ever managed to get this to work?

Thanks,

– Nathan

I dont have answer to you question, but I’m curious… why would you want to replace RoS?

  1. It’s always nice to know that you have other options for hardware that you own. Maybe I’ll run into something that I want to do with a high-end RouterBOARD that RouterOS can’t/won’t do. I don’t have any specific reason right now, but down the road, who knows…

  2. Right now, I am actually more interested in netbooting a custom kernel with a custom userland so I can gain access to the raw filesystem on the NAND in order to experiment with MetaROUTER-related problems in the same manner that I was able to do with the MIPSBE platform.

  3. I am also interested in seeing if I can get the dual-core versions of the 1100 (the Hx2 and AHx2) to boot the uniprocessor kernel so that I can use MetaROUTER on those devices.

– Nathan

Just a quick update on this:

It appears to be kernel size related. I remember reading elsewhere or hearing a rumor about a possible kernel size limit problem with RouterBOOT when netbooting, and I can confirm that if the kernel is > 4MB in size, RouterBOOT chokes on it, but does not give you an error. I am running 3.07 and this is still an issue, not just on MIPS, but also on PPC. (I stripped the initrd image from my custom kernel, which brought it down under 4MB, and it netbooted fine. So I am going to have to work on giving my kernel + initrd image a diet, apparently.)

– Nathan

Final update: got this to work. It wasn’t (just?) the size of the kernel, though. I was led to believe that the size was the problem after I read this: [u]http://lists.freebsd.org/pipermail/freebsd-mips/2012-March/001891.html[/u] – taking the initramfs out of the kernel shrunk the size below 4MB and perhaps coincidentally made it work.

I found, though, that if I enabled CONFIG_BLK_DEV_INITRD in the kernel build configuration, even if I left the initramfs off of the kernel, it still wouldn’t boot. So I dug around in the patch set from MikroTik, and found a patch to arch/powerpc/kernel/prom.c that made a call to memblock_reserve() if that config option was enabled. I rolled the patch to that particular file (prom.c) back, rebuilt the kernel, and voila: it booted. I’m not sure what the point of that change is or why it is needed, but for me, it works without it.

– Nathan

Where did you get the patch set with rb1100 supoprt? I’m stuck with the kernel booting. I’ve tried to boot the openwrt with P1020 config(which should be fine) but with no luck (kernel hungs on “jumping to kernel code”)

Sorry, didn’t see this until now. Under the terms of the GPL, MikroTik will give you Linux kernel patches on written request; just send e-mail to their support department. The particular patches I was working from when I started this thread were the ones they sent me for kernel 2.6.35, which is the kernel version they used for RouterOS 5. The RB1100 support was included in these patches.

Kernel 3.3.5 is what RouterOS 6 is based off of, and they actually have a download for those patches available here: http://www.mikrotik.com/download/share/linux_3_3_5_patch.gz. These patches might not be completely up-to-date, but obviously should include RB1100 support. If patches for your RouterBoard hardware are not included, for the absolute most current version, you can ask MikroTik support.

– Nathan

Hi,

returning to the thread :slight_smile: So what was the issue with the serial console?
Cant figure the reason :confused:



RouterBOOT booter 3.10

RouterBoard 1100AHx2

CPU frequency: 1066 MHz
Memory size: 2048 MiB
NAND size: 128 MiB

Press any key within 2 seconds to enter setup..
trying dhcp protocol… OK
resolved mac address 00:1D:72:92:FF:C4
Gateway: 10.0.0.1
transfer started … transfer ok, time=0.27s
setting up elf image… OK
jumping to kernel code

Ok, looks like we need the CONFIG_FSL_HV_MANAGER enabled

Using RB1120 machine description
Memory CAM mapping: 1024/256/256 Mb, residual: 512Mb
Linux version 3.3.5 (kda@tinydev.kdaintranet) (gcc version 4.6.3 (GCC) ) #13 SMP Sat Oct 28 20:24:55 MSK 2017
Found legacy serial port 0 for /socP2020@e0000000/serial@4500
mem=e0004500, taddr=e0004500, irq=0, clk=533328000, speed=0
Found legacy serial port 1 for /soc8544@e0000000/serial@4600
mem=e0004600, taddr=e0004600, irq=0, clk=533328000, speed=0
CPU maps initialized for 1 thread per core
(thread shift is 0)
Found FSL PCI host bridge at 0x00000000e0009000. Firmware bus number: 0->255
PCI host bridge /pci1@e0009000 ranges:
MEM 0x00000000a0000000..0x00000000a1ffffff → 0x00000000a0000000
IO 0x00000000a2000000..0x00000000a3ffffff → 0x0000000000000000
/pci1@e0009000: PCICSRBAR @ 0xfff00000
Found FSL PCI host bridge at 0x00000000e0008000. Firmware bus number: 0->255
PCI host bridge /pci0@e0008000 ranges:
MEM 0x00000000a8000000..0x00000000a9ffffff → 0x00000000a8000000
IO 0x00000000aa000000..0x00000000abffffff → 0x0000000000000000
/pci0@e0008000: PCICSRBAR @ 0xfff00000
Top of RAM: 0x60000000, Total RAM: 0x60000000
Memory hole size: 0MB
Zone PFN ranges:
DMA 0x00000000 → 0x0000f000
Normal 0x0000f000 → 0x00060000
Movable zone start PFN for each node
Early memory PFN ranges
0: 0x00000000 → 0x00060000
On node 0 totalpages: 393216
free_area_init_node: node 0, pgdat 803964c0, node_mem_map 804cb000
DMA zone: 480 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 60960 pages, LIFO batch:15
Normal zone: 2592 pages used for memmap
Normal zone: 329184 pages, LIFO batch:31
MMU: Allocated 1088 bytes of context maps for 255 contexts
PERCPU: Embedded 13 pages/cpu @810d5000 s5792 r32768 d14688 u53248
pcpu-alloc: s5792 r32768 d14688 u53248 alloc=13*4096
pcpu-alloc: [0] 0 [0] 1
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 390144
Kernel command line: ubifs_support console=ttyS0,115200 parts=1 boot_part_size=8388608 board=mpc85xx ver=3.10 boot=1 mlc=5
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 262144 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 131072 (order: 7, 524288 bytes)
Memory: 1553868k/1572864k available (3592k kernel code, 18996k reserved, 120k data, 1144k bss, 152k init)
Kernel virtual memory layout:

  • 0xfffdf000..0xfffff000 : fixmap
  • 0xedffc000..0xf0000000 : early ioremap
  • 0xe1000000..0xedffc000 : vmalloc & ioremap
    SLUB: Genslabs=15, HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:512 nr_irqs:512 16
    mpic: Resetting
    mpic: Setting up MPIC " OpenPIC " version 1.2 at e0040000, max 2 CPUs
    mpic: ISU size: 4, shift: 2, mask: 3
    mpic: Initializing for 84 sources
    time_init: decrementer frequency = 66.666000 MHz
    time_init: processor frequency = 1066.656000 MHz
    clocksource: timebase mult[f0009d5] shift[24] registered
    clockevent: decrementer mult[111105e2] shift[32] cpu[0]
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 512
    mpic: requesting IPIs…
    Brought up 2 CPUs
    devtmpfs: initialized
    NET: Registered protocol family 16
    gpiochip_add: registered GPIOs 224 to 255 on device: /socP2020@e0000000/gpio-controller@f000
    PCI: Probing PCI hardware
    PCI host bridge to bus 0000:00
    pci_bus 0000:00: root bus resource [io 0xeefff000-0xefffefff]
    pci_bus 0000:00: root bus resource [mem 0xa0000000-0xa1ffffff]
    pci 0000:00:00.0: [1957:0070] type 1 class 0x000b20
    pci 0000:00:00.0: ignoring class b20 (doesn’t match header type 01)
    pci 0000:00:00.0: supports D1 D2
    pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
    pci 0000:01:00.0: [1969:1063] type 0 class 0x000200
    pci 0000:01:00.0: reg 10: [mem 0xa0000000-0xa003ffff 64bit]
    pci 0000:01:00.0: reg 18: [io 0xa0000000-0xa000007f]
    pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
    pci 0000:00:00.0: PCI bridge to [bus 01-ff]
    PCI host bridge to bus 0001:02
    pci_bus 0001:02: root bus resource [io 0xedffd000-0xeeffcfff]
    pci_bus 0001:02: root bus resource [mem 0xa8000000-0xa9ffffff]
    pci 0001:02:00.0: [1957:0070] type 1 class 0x000b20
    pci 0001:02:00.0: ignoring class b20 (doesn’t match header type 01)
    pci 0001:02:00.0: supports D1 D2
    pci 0001:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
    pci 0001:02:00.0: Primary bus is hard wired to 0
    pci 0001:03:00.0: [1969:1063] type 0 class 0x000200
    pci 0001:03:00.0: reg 10: [mem 0xa8000000-0xa803ffff 64bit]
    pci 0001:03:00.0: reg 18: [io 0xa8000000-0xa800007f]
    pci 0001:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
    pci 0001:02:00.0: PCI bridge to [bus 03-ff]
    PCI: Cannot allocate resource region 2 of device 0000:01:00.0, will remap
    PCI: Cannot allocate resource region 2 of device 0001:03:00.0, will remap
    PCI 0000:00 Cannot reserve Legacy IO [io 0xeefff000-0xeeffffff]
    PCI 0001:02 Cannot reserve Legacy IO [io 0xedffd000-0xedffdfff]
    PCI: max bus depth: 1 pci_try_num: 2
    pci 0000:01:00.0: BAR 2: assigned [io 0xeefff000-0xeefff07f]
    pci 0000:00:00.0: PCI bridge to [bus 01-01]
    pci 0000:00:00.0: bridge window [io 0xeefff000-0xefffefff]
    pci 0000:00:00.0: bridge window [mem 0xa0000000-0xa1ffffff]
    pci 0001:03:00.0: BAR 2: assigned [io 0xedffd000-0xedffd07f]
    pci 0001:02:00.0: PCI bridge to [bus 03-03]
    pci 0001:02:00.0: bridge window [io 0xedffd000-0xeeffcfff]
    pci 0001:02:00.0: bridge window [mem 0xa8000000-0xa9ffffff]
    pci 0000:00:00.0: enabling device (0106 → 0107)
    pci 0001:02:00.0: enabling device (0106 → 0107)
    pci_bus 0000:00: resource 4 [io 0xeefff000-0xefffefff]
    pci_bus 0000:00: resource 5 [mem 0xa0000000-0xa1ffffff]
    pci_bus 0000:01: resource 0 [io 0xeefff000-0xefffefff]
    pci_bus 0000:01: resource 1 [mem 0xa0000000-0xa1ffffff]
    pci_bus 0001:02: resource 4 [io 0xedffd000-0xeeffcfff]
    pci_bus 0001:02: resource 5 [mem 0xa8000000-0xa9ffffff]
    pci_bus 0001:03: resource 0 [io 0xedffd000-0xeeffcfff]
    pci_bus 0001:03: resource 1 [mem 0xa8000000-0xa9ffffff]
    bio: create slab at 0
    Switching to clocksource timebase
    NET: Registered protocol family 2
    IP route cache hash table entries: 65536 (order: 6, 262144 bytes)
    TCP established hash table entries: 262144 (order: 9, 2097152 bytes)
    TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
    TCP: Hash tables configured (established 262144 bind 65536)
    TCP reno registered
    UDP hash table entries: 1024 (order: 3, 32768 bytes)
    UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
    NET: Registered protocol family 1
    PCI: CLS 32 bytes, default 32
    pvr = 80211000
    rbppc led error: user_led property is missing
    squashfs: version 4.0 (2009/01/31) Phillip Lougher
    msgmni has been set to 3036
    io scheduler noop registered (default)
    Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
    serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 42) is a 16550A
    console [ttyS0] enabled
    serial8250 serial8250.0: unable to register port at index 1 (IO0 MEMe0004600 IRQ42): -28
    RB_FCM NAND
    NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
    Scanning device for bad blocks
    nand_setcfg: page_size 11, pages_in_nand 16
    Bad eraseblock 62 at 0x0000007c0000
    Bad eraseblock 651 at 0x000005160000
    0x000000000000-0x000000800000 : “RouterBoard NAND 1 Boot”
    0x000000800000-0x000008000000 : “RouterBoard NAND 1 Main”
    RB_PPC SPI
    booke_wdt: powerpc book-e watchdog driver loaded
    Registered led device: user-led
    Freescale hypervisor management driver
    fsl-hv: no hypervisor found
    TCP cubic registered
    NET: Registered protocol family 17
    VFS: Cannot open root device “(null)” or unknown-block(0,0)
    Please append a correct “root=” boot option; here are the available partitions:
    1f00 8192 mtdblock0 (driver?)
    1f01 122880 mtdblock1 (driver?)
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)