Can't access the shell from initramfs

Hello, I'm trying to boot an initramfs image to my router (Linksys EA6100) that I've added supported to. Problem is, after the last line in the log

U-Boot v0.0.5 (Dec 10 2013 - 09:17:02)

Board: Ralink APSoC DRAM:  128 MB
relocate_code Pointer at: 87fb4000
enable ephy clock...done. rf reg 29 = 5
SSC disabled.
!!! nand page size = 2048, addr len=4
============================================ 
Ralink UBoot Version: 4.2.S.1
-------------------------------------------- 
ASIC 7620_MP (Port5<->None)
DRAM_CONF_FROM: Auto-detection 
DRAM_TYPE: DDR2 
DRAM component: 1024 Mbits
DRAM bus: 16 bit
Total memory: 128 MBytes
Flash component: NAND Flash
Date:Dec 10 2013  Time:09:17:02
============================================ 
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768 

 ##### The CPU freq = 580 MHZ #### 
 estimate memory size =128 Mbytes

Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   9: Load Boot Loader code then write to Flash via TFTP. 
 4  3  2 
You choosed 1

 0 

   
1: System Load Linux to SDRAM via TFTP. 
 Please Input new ones /or Ctrl-C to discard
	Input device IP (192.168.0.1) ==:192.168.0.1
	Input server IP (192.168.0.99) ==:192.168.0.99
	Input Linux Kernel filename (openwrt-ramips-mt7620-linksys_ea6100-initramfs-kernel.bin) ==:openwrt-ramips-mt7620-linksys_ea6100-initramfs-kernel.bin

 netboot_common, argc= 3 
load addr= 0x80a00000
boot file= openwrt-ramips-mt7620-linksys_ea6100-initramfs-kernel.bin

 NetTxPacket = 0x87FE4D80 

 KSEG1ADDR(NetTxPacket) = 0xA7FE4D80 

 NetLoop,call eth_halt ! 

 NetLoop,call eth_init ! 
Trying Eth0 (10/100-M)

 Waitting for RX_DMA_BUSY status Start... done


 ETH_STATE_ACTIVE!! 
TFTP from server 192.168.0.99; our IP address is 192.168.0.1
Filename 'openwrt-ramips-mt7620-linksys_ea6100-initramfs-kernel.bin'.

 TIMEOUT_COUNT=10,Load address: 0x80a00000
Loading: *Got ARP REPLY, set server/gtwy eth addr (80:fa:5b:4d:b1:30)
Got it
#################################################################
	 #################################################################
	 ###############Got ARP REQUEST, return our IP
##################################################
	 #################################################################
	 #################################################################
	 ###########################Got ARP REQUEST, return our IP
##############################Got ARP REQUEST, return our IP
checksum bad
checksum bad
########
	 ###checksum bad
##############################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #############################
done
Bytes transferred = 4803685 (494c65 hex)
NetBootFileXferSize= 00494c65
Automatic boot of image at addr 0x80A00000 ...
## Booting image at 80a00000 ...
   Image Name:   MIPS OpenWrt Linux-5.4.124
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4803621 Bytes =  4.6 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 128

Starting kernel ...


Power LED Force ON
[    0.000000] Linux version 5.4.124 (m@DESKTOP-SBTVRBM) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16958-2f08adae62)) #0 Wed Jun 16 14:23:59 2021
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Linksys EA6100
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS1,57600n8 root=/dev/mtdblock6 ro rootfstype=ubifs init=/sbin/init rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=0007c6b8
[    0.000000] Readback ErrCtl register=0007c6b8
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 119600K/131072K available (4743K kernel code, 202K rwdata, 1048K rodata, 3916K init, 205K bss, 11472K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] random: get_random_bytes called from start_kernel+0x358/0x54c with crng_init=0
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000011] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015488] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087728] pid_max: default: 32768 minimum: 301
[    0.097110] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.111518] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.133849] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.153338] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.166924] pinctrl core: initialized pinctrl subsystem
[    0.177833] NET: Registered protocol family 16
[    0.671486] PCI host bridge /pcie@10140000 ranges:
[    0.680885]  MEM 0x0000000020000000..0x000000002fffffff
[    0.691255]   IO 0x0000000010160000..0x000000001016ffff
[    0.723544] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.734602] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.747173] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.758185] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.771312] PCI host bridge to bus 0000:00
[    0.779312] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.793035] pci_bus 0000:00: root bus resource [io  0x10160000-0x1016ffff]
[    0.806660] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.820159] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.835949] pci 0000:00:00.0: [1814:0801] type 01 class 0x060400
[    0.847888] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.860324] pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
[    0.872862] pci 0000:00:00.0: supports D1
[    0.880720] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.894345] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.910384] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[    0.922287] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    0.935749] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.949141] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.963193] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.976251] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.989402] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    1.002523] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    1.016368] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    1.029870] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    1.044234] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    1.057742] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    1.072297] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    1.086639] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.096489] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    1.110002] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    1.124479] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    1.149057] clocksource: Switched to clocksource systick
[    1.160970] NET: Registered protocol family 2
[    1.169773] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    1.184770] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.201337] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.216514] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.230520] TCP: Hash tables configured (established 1024 bind 1024)
[    1.243302] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.256213] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.270347] NET: Registered protocol family 1
[    1.278921] PCI: CLS 0 bytes, default 32
[    2.939064] random: fast init done
[    6.496166] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    6.510278] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    6.531712] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.543223] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    6.579470] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    6.593220] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    6.614070] !!! nand page size = 2048, addr len=4
[    6.627150] mtk_nand_probe: alloc 13c0, at (ptrval) , btt((ptrval), 100), ranfc_mtd:(ptrval)
[    6.643939] 10 fixed-partitions partitions found on MTD device ra_nfc
[    6.656616] Creating 10 MTD partitions on "ra_nfc":
[    6.666319] 0x000000000000-0x000000080000 : "Bootloader"
[    6.678040] 0x000000080000-0x0000000c0000 : "Config"
[    6.688937] 0x0000000c0000-0x000000100000 : "Factory"
[    6.700009] 0x000000100000-0x000000140000 : "s_env"
[    6.710654] 0x000000140000-0x000000180000 : "devinfo"
[    6.721707] 0x000000180000-0x000002980000 : "kernel"
[    6.732467] nand_block_checkbad: offs:660000 tag: BAD 
[    6.750210] 0x000000380000-0x000002980000 : "rootfs"
[    6.760013] nand_block_checkbad: offs:660000 tag: BAD 
[    6.771194] mtd: device 6 (rootfs) set to be root filesystem
[    6.782660] mtdsplit: no squashfs found in "rootfs"
[    6.792249] 0x000002980000-0x000005180000 : "alt_kernel"
[    6.805124] nand_block_checkbad: offs:35a0000 tag: BAD 
[    6.815851] nand_block_checkbad: offs:3820000 tag: BAD 
[    6.831943] 0x000002b80000-0x000005180000 : "alt_rootfs"
[    6.842459] nand_block_checkbad: offs:35a0000 tag: BAD 
[    6.852753] nand_block_checkbad: offs:3820000 tag: BAD 
[    6.864243] 0x000005180000-0x000008000000 : "syscfg"
[    6.885010] libphy: Fixed MDIO Bus: probed
[    6.909061] gsw: setting port4 to ephy mode
[    6.917340] mtk_soc_eth 10100000.ethernet: generated random MAC address 7a:bf:7f:4b:b1:7c
[    6.933735] libphy: mdio: probed
[    6.967820] mtk_soc_eth 10100000.ethernet: connected port 5 to PHY at mdio-bus:05 [uid=0000ffff, driver=Generic PHY]
[    6.988916] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    7.001294] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    7.018138] rt2880_wdt 10000120.watchdog: Initialized
[    7.029591] NET: Registered protocol family 10
[    7.042617] Segment Routing with IPv6
[    7.049958] NET: Registered protocol family 17
[    7.058712] 8021q: 802.1Q VLAN Support v1.8
[    7.068423] Warning: unable to open an initial console.
[    7.101093] Freeing unused kernel memory: 3916K
[    7.109967] This architecture does not have kernel memory protection.
[    7.122755] Run /init as init process
[    7.560072] init: Console is alive
[    7.566936] init: - watchdog -
[    7.600754] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.627128] usbcore: registered new interface driver usbfs
[    7.638054] usbcore: registered new interface driver hub
[    7.648598] usbcore: registered new device driver usb
[    7.664733] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.679593] ehci-fsl: Freescale EHCI Host controller driver
[    7.692188] ehci-platform: EHCI generic platform driver
[    7.707253] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    7.721187] ohci-platform: OHCI generic platform driver
[    7.734085] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.752839] init: - preinit -
[    8.008820] random: jshn: uninitialized urandom read (4 bytes read)
[    8.111389] random: jshn: uninitialized urandom read (4 bytes read)
[    8.309118] random: jshn: uninitialized urandom read (4 bytes read)
[    9.547325] mtk_soc_eth 10100000.ethernet eth0: port 0 link up (100Mbps/Full duplex)
[   10.762756] procd: - early -
[   10.769357] procd: - watchdog -
[   11.020244] procd: - watchdog -
[   11.026630] procd: failed to set stdio: No such device
[   11.037015] procd: - ubus -
[   11.052213] urandom_read: 4 callbacks suppressed
[   11.052223] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.081625] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.094726] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.110785] procd: - init -
[   11.792442] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.849114] Loading modules backported from Linux version v5.10.42-0-g65859eca4dff
[   11.864122] Backport generated by backports.git v5.10.42-1-0-gbee5c545
[   11.952063] xt_time: kernel timezone is -0000
[   12.110891] mt76x2e 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[   12.123399] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[   12.221390] urngd: jent-rng init failed, err: 2
[   12.423339] mt76x2e 0000:01:00.0: ROM patch build: 20141115060606a
[   12.440388] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[   12.451202] mt76x2e 0000:01:00.0: Build: 1
[   12.459290] mt76x2e 0000:01:00.0: Build Time: 201507311614____
[   12.480054] mt76x2e 0000:01:00.0: Firmware running!
[   12.546528] PPP generic driver version 2.4.2
[   12.571175] NET: Registered protocol family 24
[   12.660657] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "Factory"
[   12.674939] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[   12.690329] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[   12.780322] kmodloader: done loading kernel modules from /etc/modules.d/*
[   21.141948] random: crng init done
[   40.373488] 8021q: adding VLAN 0 to HW filter on device eth0
[   40.385285] mtk_soc_eth 10100000.ethernet eth0: port 5 link up (100Mbps/Full duplex)
[   40.431268] br-lan: port 1(eth0.1) entered blocking state
[   40.441948] br-lan: port 1(eth0.1) entered disabled state
[   40.453181] device eth0.1 entered promiscuous mode
[   40.462618] device eth0 entered promiscuous mode
[   40.545584] br-lan: port 1(eth0.1) entered blocking state
[   40.556239] br-lan: port 1(eth0.1) entered forwarding state
[   41.422454] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

I can't access the shell. Pressing Enter or any other button doesn't do anything either. I'm accessing the router over Serial (57,600 baud 8N1) using minicom. I remember there was an old build I used about a year or 2 ago and I didn't have any problems getting the shell to appear.

I should also note that I'm using a fork of OpenWRT that adds support for the Xiaomi Mi Wifi R3 only because that repository has the patch included for NAND support on the MT7620 which is still mysteriously missing from the current mainline branch.

Kernel command line set /dev/ttyS1 as console:

[    0.000000] Kernel command line: console=ttyS1,57600n8 root=/dev/mtdblock6 ro rootfstype=ubifs init=/sbin/init rootfstype=squashfs,jffs2

but in your configuration only /dev/ttyS0 is available:

[    6.579470] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    6.593220] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103

So you need to change command line OR enable uart in device config (if you really connected not to default uartlite but to uart port).

2 Likes

Oh shoot. I can't believe I didn't see that. So, do I have to enable it in the

make menuconfig

and if so, where would it be? Or is this an entry in the DTS/MT7620 makefile that I have to add?

You have likely set the command line in the device DTS when you have added the device. Try changing TTY there.

I set ttyS1 since that's what the default bootargs were set as for the stock firmware. Changing the bootargs in the DTS to

  chosen {
    bootargs = "console=ttyS0,57600n8 root=/dev/mtdblock6 ro init=/sbin/init";
  };

actually works haha. Dunno if there's a way I can get ttyS1 up, but for the time being, this works. Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.