1
0
forked from dan/liminix
Commit Graph

8 Commits

Author SHA1 Message Date
Arnout Engelen
bc588804fd
Correctly load DTB
Now boots further, but then cannot open the rootfs, likely because
we're not replacing the DTB with the one updated for TFTP yet

```
pci 0000:00:00.0: [0e8d:0801] type 01 class 0x060400
pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
pci 0000:00:00.0: supports D1
pci 0000:00:00.0: PME# supported from D0 D1 D3hot
pci 0000:00:01.0: [0e8d:0801] type 01 class 0x060400
pci 0000:00:01.0: reg 0x10: [mem 0x00000000-0x7fffffff]
pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x0000ffff]
pci 0000:00:01.0: supports D1
pci 0000:00:01.0: PME# supported from D0 D1 D3hot
pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
pci 0000:01:00.0: [14c3:7916] type 00 class 0x000280
pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
pci 0000:01:00.0: supports D1 D2
pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link
 at 0000:00:00.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
pci 0000:00:00.0: PCI bridge to [bus 01-ff]
pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff]
pci 0000:00:00.0:   bridge window [mem 0x00000000-0x000fffff pref]
pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
pci 0000:02:00.0: [14c3:7915] type 00 class 0x000280
pci 0000:02:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
pci 0000:02:00.0: reg 0x18: [mem 0x00000000-0x00003fff 64bit pref]
pci 0000:02:00.0: reg 0x20: [mem 0x00000000-0x00000fff 64bit pref]
pci 0000:02:00.0: supports D1 D2
pci 0000:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:02:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link
 at 0000:00:01.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
pci 0000:00:01.0: PCI bridge to [bus 02-ff]
pci 0000:00:01.0:   bridge window [io  0x0000-0x0fff]
pci 0000:00:01.0:   bridge window [mem 0x00000000-0x000fffff]
pci 0000:00:01.0:   bridge window [mem 0x00000000-0x000fffff pref]
pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x602fffff pref]
pci 0000:00:01.0: BAR 8: assigned [mem 0x60300000-0x603fffff]
pci 0000:00:01.0: BAR 9: assigned [mem 0x60400000-0x605fffff pref]
pci 0000:00:00.0: BAR 1: assigned [mem 0x60600000-0x6060ffff]
pci 0000:00:01.0: BAR 1: assigned [mem 0x60610000-0x6061ffff]
pci 0000:00:00.0: BAR 7: assigned [io  0x0000-0x0fff]
pci 0000:00:01.0: BAR 7: assigned [io  0x1000-0x1fff]
pci 0000:01:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit pref]
pci 0000:01:00.0: BAR 2: assigned [mem 0x60200000-0x60203fff 64bit pref]
pci 0000:01:00.0: BAR 4: assigned [mem 0x60204000-0x60204fff 64bit pref]
pci 0000:00:00.0: PCI bridge to [bus 01]
pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
pci 0000:00:00.0:   bridge window [mem 0x60100000-0x602fffff pref]
pci 0000:02:00.0: BAR 0: assigned [mem 0x60400000-0x604fffff 64bit pref]
pci 0000:02:00.0: BAR 2: assigned [mem 0x60500000-0x60503fff 64bit pref]
pci 0000:02:00.0: BAR 4: assigned [mem 0x60504000-0x60504fff 64bit pref]
pci 0000:00:01.0: PCI bridge to [bus 02]
pci 0000:00:01.0:   bridge window [io  0x1000-0x1fff]
pci 0000:00:01.0:   bridge window [mem 0x60300000-0x603fffff]
pci 0000:00:01.0:   bridge window [mem 0x60400000-0x605fffff pref]
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 19, base_baud = 3125000) is a 16550A
spi-mt7621 1e000b00.spi: sys_freq: 220000000
spi-nor spi0.0: en25qh128 (16384 Kbytes)
5 fixed-partitions partitions found on MTD device spi0.0
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
OF: Bad cell count for /palmbus@1e000000/spi@b00/flash@0/partitions
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000fa0000 : "firmware"
2 uimage-fw partitions found on MTD device firmware
Creating 2 MTD partitions on "firmware":
0x000000000000-0x000000400000 : "kernel"
0x000000400000-0x000000f60000 : "rootfs"
mtd: setting mtd3 (rootfs) as root device
0x000000fa0000-0x000000fb0000 : "config"
0x000000fb0000-0x000000ff0000 : "tplink"
0x000000ff0000-0x000001000000 : "radio"
mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21
mtk_soc_eth 1e100000.ethernet wan: mediatek frame engine at 0xbe100000, irq 21
i2c_dev: i2c /dev entries driver
NET: Registered PF_INET6 protocol family
Segment Routing with IPv6
In-situ OAM (IOAM) with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered PF_PACKET protocol family
8021q: 802.1Q VLAN Support v1.8
Loading compiled-in X.509 certificates
Loaded X.509 cert 'Build time autogenerated kernel key: 1305e7c8df691fbef7a37c303deca27
c3e469edb'
Problem parsing in-kernel X.509 certificate list
mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module
mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode
mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx
mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7530
 PHY] (irq=23)
mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530
 PHY] (irq=24)
mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530
 PHY] (irq=25)
mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530
 PHY] (irq=26)
DSA: tree 0 setup
Warning: unable to open an initial console.
ubi0:liminix: Can't open blockdev
VFS: Cannot open root device "ubi0:liminix" or unknown-block(31,3): error -2
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0
 (driver?)
1f01           15744 mtdblock1
 (driver?)
1f02            4096 mtdblock2
 (driver?)
1f03           11648 mtdblock3
 (driver?)
1f04              64 mtdblock4
 (driver?)
1f05             256 mtdblock5
 (driver?)
1f06              64 mtdblock6
 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)
Rebooting in 10 seconds..

```
2024-01-27 15:59:46 +01:00
Arnout Engelen
50ca07fdbe
get kernel config from openwrt
Now the kernel starts:

```
Starting kernel ...

Linux version 5.15.137 (nixbld@liminix.builder) (mips-unknown-linux-musl-gcc (GCC) 13.2.0, GNU ld (GNU Binutils) 2.40) #1 SMP Fri Jan 26 14:47:51 UTC 2024
SoC Type: MediaTek MT7621 ver:1 eco:4
printk: bootconsole [early0] enabled
CPU0 revision is: 0001992f (MIPS 1004Kc)
VPE topology {2,2} total 4
Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
Zone ranges:
  Normal   [mem 0x0000000000000000-0x0000000007ffffff]
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x0000000007ffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
OF: fdt: No valid device tree found, continuing without
percpu: Embedded 11 pages/cpu s14544 r8192 d22320 u45056
Built 1 zonelists, mobility grouping on.  Total pages: 32512
Kernel command line:
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
Writing ErrCtl register=0003003d
Readback ErrCtl register=0003003d
mem auto-init: stack:all(zero), heap alloc:off, heap free:off
Memory: 119864K/131072K available (6564K kernel code, 622K rwdata, 1244K rodata, 1220K init, 217K bss, 11208K reserved, 0K cma-reserved)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
rcu: Hierarchical RCU implementation.
rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
NR_IRQS: 256
Kernel panic - not syncing: Failed to find mediatek,mt7621-sysc node
---[ end Kernel panic - not syncing: Failed to find mediatek,mt7621-sysc node ]---
```

I'm guessing the important bits are:

```
OF: fdt: No valid device tree found, continuing without
Kernel panic - not syncing: Failed to find mediatek,mt7621-sysc node
---[ end Kernel panic - not syncing: Failed to find mediatek,mt7621-sysc node ]---
```

... due to me booting with 'bootm <image>' instead of 'bootm <image> - <dtm>'
because it seems my version of u-boot doesn't support '-' for the ramdisk.
2024-01-27 15:59:44 +01:00
c40eef25d6 qemu: use phram instead of block2mtd 2023-11-05 19:13:51 +00:00
a135cb1217 introduce lim, the liminix library
so far we have lim.parseInt, which parses an integer from a string
with optional base-selecting-prefix (e.g. 0755, 0x12ab)
2023-11-05 15:13:06 +00:00
863045b86b added hardware.ram.startAddress config
it's not 0 on arm32, so this will be useful for qemu
2023-11-05 15:11:58 +00:00
76f03ecf0f move OF and USE_OF to arch modules 2023-09-30 21:52:13 +01:00
f1c04c7979 extract mips kernel options to module 2023-09-20 17:50:21 +01:00
f75995e895 introduce modules/arch/{mipsel,mipseb}.nix
for settings that are common to all mipse[lb] but would not be shared
with e.g. aarch64 or x86
2023-09-20 17:30:05 +01:00