4

I am trying a newer kernel on my Creator CI20 (v1), but if I try a Linux kernel version 4.11.1 I cannot get any output after u-boot. This leads to the following output:

ci20# bootm 0x88000000;
## Booting kernel from Legacy Image at 88000000 ...
   Image Name:   Linux-4.11.1
   Image Type:   MIPS Linux Kernel Image (uncompressed)
   Data Size:    5043676 Bytes = 4.8 MiB
   Load Address: 80010000
   Entry Point:  8035d440
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting 

Steps from laptop:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
$ git checkout v4.11.1
$ make ARCH=mips ci20_defconfig
$ make ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- uImage
$ sudo cp arch/mips/boot/uImage.bin /tftpboot/uImage.4.11.1
$ sudo screen /dev/ttyUSB0 115200 

Steps from ci20:

dhcp 0x88000000 192.168.0.14:uImage.4.11.1
bootm 0x88000000;

If I repeat the exact same steps now using 4.10.1, everything works as expected and I can see the kernel booting nicely:

$ git checkout v4.10.1
$ make ARCH=mips ci20_defconfig
$ make ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- uImage
$ sudo cp arch/mips/boot/uImage.bin /tftpboot/uImage.4.10.1

For reference:

$ grep CONFIG_CMDLINE ./arch/mips/configs/ci20_defconfig
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlycon console=ttyS4,115200 clk_ignore_unused"

How should I go tracking down the issue with tty/uart not displaying anything (without resorting to a git bisect operation) ?

malat
  • 2,708
  • 4
  • 27
  • 47

1 Answers1

3

Since I did not receive any answers/suggestions I finally decided to go through a painful git bisect operation (~13 iterations) in between the two tags: v4.10.1 (good) & v4.11.1 (bad).

This lead me to:

% git bisect good
73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411 is the first bad commit
commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
Author: Marcin Nowakowski <[email protected]>
Date:   Wed Nov 23 14:43:49 2016 +0100

    MIPS: fix mem=X@Y commandline processing

    When a memory offset is specified through the commandline, add the
    memory in range PHYS_OFFSET:Y as reserved memory area.
    Otherwise the bootmem allocator is initialised with low page equal to
    min_low_pfn = PHYS_OFFSET, and in free_all_bootmem will process pages
    starting from min_low_pfn instead of PFN(Y).

    Signed-off-by: Marcin Nowakowski <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14613/
    Signed-off-by: Ralf Baechle <[email protected]>

:040000 040000 fe26fcf6d072cbaedac5a417f9f6424df16d331c b99681a22464164b88c6a3cf77b1b87957cd95d6 M  arch

Staring at the code online here made me realize that the issue was instead in my current u-boot setup, which states:

ci20# printenv 
baudrate=115200 
board_date=20140704 
board_mfr=NP 
bootargs=console=ttyS4,115200 console=tty0 mem=256M@0x0 
mem=768M@0x30000000 rootwait quiet rw root=/dev/mmcblk0p1 
bootcmd=run ethargs; ext4load mmc 0:1 0x88000000 /boot/uImage; bootm 0x88000000 
bootdelay=1 
ethact=dm9000 
ethaddr=d0:31:10:ff:7d:20 
ethargs=env set bootargs ${bootargs} dm9000.mac_addr=${ethaddr} 
loads_echo=1 
serial#=1255 
stderr=eserial0,eserial4 
stdin=eserial0,eserial4 
stdout=eserial0,eserial4 

Environment size: 488/32764 bytes 

I've not tested it yet, but it looks like the mem env variable has always been initialized to a bogus value (I followed the instructions), but this only started recently to being an issue.

The following may indicate a copy/paste error:

bootargs=console=ttyS4,115200 console=tty0 mem=256M@0x0 
mem=768M@0x30000000 rootwait quiet rw root=/dev/mmcblk0p1 

Turns out this was an actual regression introduced:

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
malat
  • 2,708
  • 4
  • 27
  • 47