我正在尝试使用更新的内核创造者 CI20 (v1),但是如果我尝试 Linux 内核版本 4.11.1,我在 u-boot 后无法获得任何输出。这将导致以下输出:
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
笔记本电脑的步骤:
$ 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
ci20 的步骤:
dhcp 0x88000000 192.168.0.14:uImage.4.11.1
bootm 0x88000000;
如果我现在使用 4.10.1 重复完全相同的步骤,一切都会按预期工作,并且我可以看到内核正常启动:
$ 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
以供参考:
$ grep CONFIG_CMDLINE ./arch/mips/configs/ci20_defconfig
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="earlycon console=ttyS4,115200 clk_ignore_unused"
我应该如何追踪 tty/uart 不显示任何内容的问题(不诉诸 git bisect 操作)?
答案1
由于我没有收到任何答案/建议,我最终决定在两个标签之间经历一次痛苦的git bisect
操作(〜13次迭代):v4.10.1(好)和v4.11.1(坏)。
这导致我:
% 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
网上盯着代码这里让我意识到问题出在我当前的 u-boot 设置中,其中指出:
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
我还没有测试过它,但看起来mem
env 变量总是被初始化为一个假值(我遵循指示),但这只是最近才开始成为一个问题。
下列可能指示复制/粘贴错误:
bootargs=console=ttyS4,115200 console=tty0 mem=256M@0x0
mem=768M@0x30000000 rootwait quiet rw root=/dev/mmcblk0p1
事实证明,这是引入的实际回归: