View Single Post
Old 10-01-2019, 02:25 PM   #22
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 20
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by smindux View Post
I have been trying the same for a few weeks and figured that u-boot is dead-end.
The last example you provided booted though (Thanks)
Code:
% qemu-system-arm --version
QEMU emulator version 4.0.0
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

% qemu-system-arm -M sabrelite -bios "files/u-boot.imx" -kernel "zImage" -dtb "zero-gravitas.dtb" -serial mon:stdio -display none -append "console=ttymxc0 loglevel=8 bootmem-debug"
               

'[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.1.28-zero-gravitas-01866-ge0b823726ea4-dirty (sandsmark@neruval) (gcc version 5.3.0 (GCC) ) #82 Thu Apr 27 14:27:47 CEST 2017
[    0.000000] CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine model: reMarkable Prototype 1
I managed to compile and boot the linux kernel from lab126 without u-boot.
Code:
% qemu-system-arm -M sabrelite -kernel "zImage" -dtb "imx6sll-rex.dtb"  -serial mon:stdio -display none -append "console=ttymxc0 loglevel=8 bootmem-debug"  
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.1.15-lab126 (root@drama) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP PREEMPT Tue Oct 1 17:03:51 EEST 2019
[    0.000000] CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine model: Lab126 i.MX6SLL Board
Here are my steps if you are willing to reproduce (Host is CentOS, Cross Compilation TC is what the host provided)
Code:
# wget https://kindledownloads.s3.amazonaws.com/Kindle_src_5.12.1_3552180044.tar.gz
tar xvf Kindle_src_5.12.1_3552180044.tar.gz 
# cd gplrelease/
# tar xzvf linux-4.1.15.tar.gz 
# export ARCH=arm
# export CROSS_COMPILE=arm-linux-gnu-
# make imx_rex_defconfig
# make -j2 all
# cp ./arch/arm/boot/zImage /root/drama/
# cp ./arch/arm/boot/dts/imx6sll-rex.dtb /root/drama/
Good luck, Man.
Thanks for the reply! It's a great breakthrough!

I'm going to reproduce your steps. You seem to have used the rex board instead of wario, which I'm currently using. Perhaps that might explain something?

As for U-Boot being a dead end, why have you come to that conclusion? In your example, didn't U-Boot boot at all? As far as I know, if there is a problem in the file you supplied with -bios, then the boot sequence should have stopped, instead of continuing. It doesn't really "skip" U-Boot just like that.

Have you tried compiling mainline U-Boot (instead of Lab126 U-Boot) to see whether it boots under your setup of (host, QEMU version, cross-compiler toolchain)? Under my setup, the only i.MX board that boots in U-Boot is the imx25-pdk, and that happened with both mainline and Lab126 U-Boot.

Edit: Have some karma! :-)

Edit 2: If we bring up the Kindle OS without relying on U-Boot, then it would be good, but I feel that the presence of U-Boot is very important, because of the implementation of idme variables, which is necessary to boot without modifying the userland to skip the missing variables, and to provide a more complete emulation package overall.

Edit 3 - Breaking news: I have booted the prebuilt kernel from the StackExchange thread above! The magic is in the kernel commandline.
This explains why U-Boot didn't work ... it's because using -append with the magical option that fixes the kernel requires passing -kernel as well ...

Edit 4: The magical option is console=ttymxc0!

Last edited by WaseemAlkurdi; 10-01-2019 at 05:53 PM.
WaseemAlkurdi is offline   Reply With Quote