Linux kernel for A20 cpu stuck at 'Starting kernel' - linux-kernel

Linux kernel version: 4.1.8
board:cubietruck with A20 CPU.
compiled platform: os x 10.5.5
I do as follows:
First I use sunxi_defconfig as the default configuration, but 'byte_swap.h' not found error occurred. Then I use a sun7i_defconfig which offered by cubieboard, and then make -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage,make -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi- dtbs.
Then I burn the Uboot and the spl to the SDCard and make to partitions: one for boot and one for root file system. I put the zImage, script.bin and the dtb file on the boot partition.
Then I create boot.cmd as below:
fatload mmc 0 0x46000000 zImage
fatload mmc 0 0x49000000 sun7i-a20-cubietruck.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
bootz 0x46000000 - 0x49000000
and then mkimage -C none -A arm -T script -d boot.cmd boot.scr.
so there's three files on the boot partition:
boot.scr
script.bin
sun7i-a20-cubietruck.dtb
zImage
the Uboot works fine.(At least I think), here is the output
U-Boot SPL 2014.04 (Sep 29 2015 - 21:36:09)
Board: Cubietruck
DRAM: 2048 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600
U-Boot 2014.04 (Sep 29 2015 - 21:36:09) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
Board: Cubietruck
I2C: ready
DRAM: 2 GiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: dwmac.1c50000
Hit any key to stop autoboot: 0
reading uEnv.txt
** Unable to read file uEnv.txt **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
reading boot.scr
281 bytes read in 16 ms (16.6 KiB/s)
Jumping to boot.scr
## Executing script at 44000000
reading zImage
3446280 bytes read in 192 ms (17.1 MiB/s)
reading sun7i-a20-cubietruck.dtb
26288 bytes read in 30 ms (855.5 KiB/s)
Kernel image # 0x46000000 [ 0x000000 - 0x349608 ]
## Flattened Device Tree blob at 49000000
Booting using the fdt blob at 0x49000000
Loading Device Tree to 4fff6000, end 4ffff6af ... OK
Starting kernel ...
Any one could help?

Related

u-boot booting. appear warning message. this must be solved?

I create a linux booting image using TI SDK (am335x) and booting Beaglebone black.
and u-boot boot message is..
U-Boot SPL 2019.01-gf95c3e0297-dirty (Oct 15 2019 - 08:45:45 +0900)
Trying to boot from MMC1
U-Boot 2019.01-gf95c3e0297-dirty (Oct 15 2019 - 08:45:45 +0900)
CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment
<ethaddr> not set. Validating first E-fuse MAC
Net: eth0: ethernet#4a100000
Warning: usb_ether MAC addresses don't match:
Address in ROM is de:ad:be:ef:00:01
Address in environment is f4:e1:1e:ce:d7:49
, eth1: usb_ether
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Unable to read file boot.scr **
** Unable to read file uEnv.txt **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
4080128 bytes read in 266 ms (14.6 MiB/s)
36717 bytes read in 3 ms (11.7 MiB/s)
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff4000, end 8fffff6c ... OK
Starting kernel ...
and i can't decide three warning message need to solved.
Loading Environment from FAT... *** Warning - bad CRC, using default environment ** Unable to read file boot.scr ** ** Unable to read file uEnv.txt **
u-boot and linux kernel work properly.
Do I need solve this warning ?.
Maybe your u-boot script didn't switch to the right partition of MMC before started reading uEnv.txt or so. This is okay if you are fine with booting behavior. These files contain things like do you want to enable HDMI, or console, etc. But the same could be done directly in u-boot env.

Beaglebone black uImage boot issues

I am trying to boot the beaglebone black using the uImage file that I created using the mkimage command. There is a emmc to sd image flasher package available online which has a uImage in it and also other required files (https://elinux.org/BeagleBone_Black_Extracting_eMMC_contents), I followed this website and created a flasher card of the uImage that I made using mkimage utility.
I am getting the following error during boot from SD card having that uImage:
U-Boot SPL 2016.01-00763-g3faf221 (Jan 29 2016 - 20:47:08)
Trying to boot from MMC
Card doesn't support part_switch
MMC partition switch failed
*** Warning - MMC partition switch failed, using default environment
reading u-boot.img
reading u-boot.img
U-Boot 2016.01-00763-g3faf221 (Jan 29 2016 - 20:47:08 +0000)
Watchdog enabled
I2C: ready
DRAM: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment
Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
=> set sdboot 1
=> boot
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
235 bytes read in 5 ms (45.9 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
reading uImage
5497536 bytes read in 302 ms (17.4 MiB/s)
reading /am335x-boneblack.dtb
25926 bytes read in 8 ms (3.1 MiB/s)
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux kernel
Created: 2015-09-07 21:47:16 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5497472 Bytes = 5.2 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 81ff0000
Booting using the fdt blob at 0x81ff0000
Loading Kernel Image ... OK
Loading Device Tree to 8fff6000, end 8ffff545 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.177572] omap2_mbox_probe: platform not supported
[ 0.333923] tps65217-bl tps65217-bl: no platform data provided
[ 0.397544] bone-capemgr bone_capemgr.9: slot #0: No cape found
[ 0.434652] bone-capemgr bone_capemgr.9: slot #1: No cape found
[ 0.471760] bone-capemgr bone_capemgr.9: slot #2: No cape found
[ 0.508869] bone-capemgr bone_capemgr.9: slot #3: No cape found
[ 0.528815] omap_hsmmc mmc.5: of_parse_phandle_with_args of 'reset' failed
[ 0.591166] pinctrl-single 44e10800.pinmux: pin 44e10854 already requested by 44e10800.pinmux; cannot claim for gpio-leds.8
[ 0.602845] pinctrl-single 44e10800.pinmux: pin-21 (gpio-leds.8) status -22
[ 0.610128] pinctrl-single 44e10800.pinmux: could not request pin 21 on device pinctrl-single
[ 0.686675] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 0.695344] [<c0010f5d>] (unwind_backtrace+0x1/0x98) from [<c04994c3>] (panic+0x5b/0x158)
[ 0.703882] [<c04994c3>] (panic+0x5b/0x158) from [<c07bc94b>] (mount_block_root+0xf7/0x178)
[ 0.712595] [<c07bc94b>] (mount_block_root+0xf7/0x178) from [<c07bcb09>] (mount_root+0x95/0xb0)
[ 0.721676] [<c07bcb09>] (mount_root+0x95/0xb0) from [<c07bcbef>] (prepare_namespace+0xcb/0x11c)
[ 0.730836] [<c07bcbef>] (prepare_namespace+0xcb/0x11c) from [<c0495aff>] (kernel_init+0x7/0x98)
[ 0.740007] [<c0495aff>] (kernel_init+0x7/0x98) from [<c000c7fd>] (ret_from_fork+0x11/0x34)
Any help will be useful.
The kernel cannot find the root partition. The kernel command line is set in U-Boot via the environment variable bootargs.

unable to login buildroot

i use buildroot and compile linux kenrenl and when i run QEMU,i cann't login to builroot, because i cann't see message "Welcome to buildroot" for login,
ata2.01: NODEV after polling detection
ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
ata1.01: NODEV after polling detection
ata1.00: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100
ata1.00: 11502 sectors, multi 16: LBA48
ata1.00: configured for MWDMA2
ata2.00: configured for MWDMA2
scsi 0:0:0:0: Direct-Access ATA QEMU HARDDISK 2.5+ PQ: 0
ANSI: 5
sd 0:0:0:0: [sda] 11502 512-byte logical blocks: (5.89 MB/5.62 MiB)
scsi 1:0:0:0: CD-ROM QEMU QEMU DVD-ROM 2.5+ PQ: 0
ANSI: 5
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sd 0:0:0:0: [sda] Attached SCSI disk
input: ImExPS/2 Generic Explorer Mouse as
/devices/platform/i8042/serio1/input/input3
EXT4-fs (sda): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sda): mounting ext2 file system using the ext4 subsystem
EXT4-fs (sda): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext2 filesystem) readonly on device 8:0.
devtmpfs: mounted
Freeing unused kernel memory: 832K (ffffffff8186e000 -
ffffffff8193e000)
Write protecting the kernel read-only data: 8192k
Freeing unused kernel memory: 1212K (ffff8800014d1000 -
ffff880001600000)
Freeing unused kernel memory: 536K (ffff88000177a000 -
ffff880001800000)
random: fast init done
EXT4-fs (sda): warning: mounting unchecked fs, running e2fsck is
recommended
EXT4-fs (sda): re-mounted. Opts:
block_validity,barrier,user_xattr,errors=remount-ro
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
### here, i was unable to see message command for login,
QEMU:
qemu-system-x86_64 -hda buildroot/buildroot 2017.02.2/output/images/rootfs.ext2 -m 2G -smp 2 -nographic -kernel buildroot/buildroot-2017.02.2/output/images/bzImage -append "console=ttyS0 root=/dev/sda debug earlyprintk=serial slub_debug=QUZ"
i don't understand why i am unable to see message "Welcome to buildroot" ??
Maybe you need to modify the bootloader parameter..set the console to ttyS?
or you can modify the rootfs.tar, in the rootfs, edit the etc/inittab
for instance,change ttymxc1 to ttymxc0:
# Put a getty on the serial port
ttymxc0::respawn:/sbin/getty -L ttymxc0 0 vt100 # GENERIC_SERIAL
If you use QEMU nographic option, please check following bullet points:
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" in buildroot config file
console=ttyS0 in kernel args when run QEMU
Take the sdcard.img file in buildtoot>> output>> images>>sdcard.img
Then make it bootable using balena etcher(when using ubuntu) or rufus(when using windows).
Then flash to memory card.
Then put that card in fpga board.
It will surely work for everyone.
If any doubt: contact parthumahesh1998#gmail.com

AT91SAM9263ek booting Linux with Device Tree failed

I have problem booting Linux 3.16.1. I have compiled sources from http://www.kernel.org with at91sam9263_defconfig.
I have added Flattened Device Tree support in Boot options.
Followin tips suggested in this (https://www.slideshare.net/softpapa/device-tree-support-on-arm-linux-8930303) presentation to turn on Support device tree in /proc but i don't have that option in menuconfig.
I have U-Boot bootloader version 2014.10rc2 which supports device tree.
I have generated dtb from script shipped with kernel:
make at91sam9263ek.dtb
And now i'm getting this error:
Welcome to minicom 2.5
OPTIONS: I18n
Compiled on Feb 9 2011, 14:45:00.
Port /dev/ttyS0
Press CTRL-A Z for help on special keys
RomBOOT
>
U-Boot 2014.10-rc2-00200-g9170818-dirty (Sep 23 2014 - 15:16:39)
CPU: AT91SAM9263
Crystal frequency: 16.368 MHz
CPU clock : 199.919 MHz
Master clock : 99.960 MHz
DRAM: 64 MiB
WARNING: Caches not enabled
NAND: 256 MiB
MMC: mci: 0
In: serial
Out: serial
Err: serial
Net: macb0
Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.
Hit any key to stop autoboot: 0
U-Boot> tftp uImage
macb0: Starting autonegotiation...
macb0: Autonegotiation complete
macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)
Using macb0 device
TFTP from server 192.168.1.247; our IP address is 192.168.1.240
Filename 'uImage'.
Load address: 0x22000000
Loading: #################################################################
#################################################################
#################################################################
##############
1.2 MiB/s
done
Bytes transferred = 3068016 (2ed070 hex)
U-Boot> tftp 20000000 dt
macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)
Using macb0 device
TFTP from server 192.168.1.247; our IP address is 192.168.1.240
Filename 'dt'.
Load address: 0x20000000
Loading: #
340.8 KiB/s
done
Bytes transferred = 13279 (33df hex)
U-Boot> bootm 22000000 - 20000000
## Booting kernel from Legacy Image at 22000000 ...
Image Name: Linux-3.16.1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3067952 Bytes = 2.9 MiB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 20000000
Booting using the fdt blob at 0x20000000
Loading Kernel Image ... OK
Loading Device Tree to 23ea3000, end 23ea93de ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Error: unrecognized/unsupported device tree compatible list:
[ 'atmel,at91sam9263ek' 'atmel,at91sam9263' 'atmel,at91sam9' ]
Available machine support:
ID (hex) NAME
000004b2 Atmel AT91SAM9263-EK
Please check your kernel config and/or bootloader.
Solution:
Add this line to .config:
CONFIG_MACH_AT91SAM9_DT=y
The correct configuration for this board when using device tree is at91_dt_defconfig.
However, I am quite surprised to see someone trying to use such an old kernel. This board is fully supported upstream. Why don't you use v5.3? If this doesn't work, please report any bug, we will be happy to help correct them.

How to set up the Machine Type (arch_id) for Linux Kernel Arm Cross-Compile

I would like to know how to set the correct MACH_TYPE or arch_id for the kernel. I searched and found at least 2 references where the kernel would hang at "Starting Kernel ... ". These came with the same answer. Correctly set your Machine Type. But then neither mentions how to do so. Anyone know how to do this?
Pretty good explanation for the hang. and Another good description.
Both of these are close to what I am experiencing when I try to boot my kernel. It gets stuck on "Starting Kernel..." and won't continue. I have built the kernel several times from .configs that were supposed to be exactly for my model.
Timesys (LinuxLink) provides a .config that is supposed to match the kernel that they provide with their free build service. But that doesn't work either. If I use their pre-built kernel it boots up no problem. So I know it is not my u-boot or how I have configured my SD-card. The problem must come from the kernel build.
I run my make like: make ARCH=arm CROSS_COMPILE=${PATH_TO_TOOLCHAIN}/bin/armv7l-timesys-linux-gnueabi- uImage and make my image as follows: sudo mkimage -A arm -O linux -T kernel -C none -a 0x70800000 -e 0x70800000 -n "Linux-2.6.35-ts-armv7l" -d arch/arm/boot/uImage ../../uImage
I am working with a Freescale i.MX53 Eval Board. When I try to run the kernel:
U-Boot 2009.08-dirty (Aug 02 2013 - 19:57:03)
CPU: Freescale i.MX53 family 2.1V at 800 MHz
mx53 pll1: 800MHz
mx53 pll2: 400MHz
mx53 pll3: 432MHz
mx53 pll4: 455MHz
ipg clock : 66666666Hz
ipg per clock : 33333333Hz
uart clock : 66666666Hz
cspi clock : 108000000Hz
ahb clock : 133333333Hz
axi_a clock : 400000000Hz
axi_b clock : 200000000Hz
emi_slow clock: 133333333Hz
ddr clock : 400000000Hz
esdhc1 clock : 80000000Hz
esdhc2 clock : 80000000Hz
esdhc3 clock : 80000000Hz
esdhc4 clock : 80000000Hz
nfc clock : 26666666Hz
Board: MX53-LOCO 1.0 Rev. B
Boot Reason: [POR]
Boot Device: SD
I2C: ready
DRAM: 1 GB
MMC: FSL_ESDHC: 0,FSL_ESDHC: 1
In: serial
Out: serial
Err: serial
Serial reinitilized!
Net: got MAC address from IIM: 00:04:9f:01:f7:ce
FEC0 [PRIME]
Hit any key to stop autoboot: 0
mmc0 is current device
MMC read: dev # 0, block # 2048, count 8192 ... 8192 blocks read: OK
## Booting kernel from Legacy Image at 70800000 ...
Image Name: Linux-2.6.35-ts-armv7l
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2999932 Bytes = 2.9 MB
Load Address: 70800000
Entry Point: 70800000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
u-boot env:
bootdelay=3
baudrate=115200
netdev=eth0
ethprime=FEC0
uboot=u-boot.bin
kernel=uImage
nfsroot=/opt/eldk/arm
bootargs_base=setenv bootargs console=ttymxc0,115200
bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
bootcmd_net=run bootargs_base bootargs_nfs; tftpboot ${loadaddr} ${kernel}; bootm
bootcmd=run bootcmd_mmc
ethact=FEC0
lcd=video=mxcdi0fb:RGB24,SEIKO-WVGA di0_primary
bootargs_mmc=setenv bootargs ${bootargs} gpu_nommu ${lcd} ip=dhcp root=/dev/mmcblk0p1 rootwait rw
bootargs=console=ttymxc0,115200 gpu_nommu video=mxcdi0fb:RGB24,SEIKO-WVGA di0_primary ip=dhcp root=/dev/mmcblk0p1 rootwait rw
bootcmd_mmc=run bootargs_base bootargs_mmc; mmc dev 0; mmc read ${loadaddr} 0x800 0x2000; bootm
loadaddr=0x70800000
stdin=serial
stdout=serial
stderr=serial
The issue is that a double u-boot header has been applied to the image. As per unixsmurf.

Resources