cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bfung_2
Adventurer
Adventurer
2,192 Views
Registered: ‎07-02-2020

kernel hang on sd card booting rootFS on /dev/mmcblk0p2

Jump to solution

I'm trying to perform a SD-card boot with a XC7Z020 using petalinux. The problem I'm encountering is that u-boot gets stuck waiting for the second partition (/dev/mmcblk0p2) where the rootFS is contained in as a ext4 partition.

Starting with a very simple design:

bfung_2_0-1602018609667.png

  • The SD-Card IO is configured as such (I've probed the CD and confirmed the signal gets pulled to ground when the card is inserted, and high when ejected :

bfung_2_1-1602018673416.png

  • I then export the .xsa into a petalinux project and configure petalinux with the following configuration:

 

 

 

#
# Automatically generated file; DO NOT EDIT.
# misc/config System Configuration
#
CONFIG_SUBSYSTEM_TYPE_LINUX=y
CONFIG_SYSTEM_ZYNQ=y

#
# Linux Components Selection
#
CONFIG_SUBSYSTEM_COMPONENT_DEVICE__TREE_NAME_DEVICE__TREE__GENERATOR=y
CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_AUTO_FSBL=y
CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_NAME_ZYNQ_FSBL=y
CONFIG_SUBSYSTEM_COMPONENT_BOOTLOADER_AUTO_PS_INIT=y
CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_U__BOOT__XLNX=y
# CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_REMOTE is not set
# CONFIG_SUBSYSTEM_COMPONENT_U__BOOT_NAME_EXT__LOCAL__SRC is not set
CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_LINUX__XLNX=y
# CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_REMOTE is not set
# CONFIG_SUBSYSTEM_COMPONENT_LINUX__KERNEL_NAME_EXT__LOCAL__SRC is not set

#
# Auto Config Settings
#
CONFIG_SUBSYSTEM_AUTOCONFIG_DEVICE__TREE=y
# CONFIG_SUBSYSTEM_DEVICE_TREE_MANUAL_INCLUDE is not set
CONFIG_SUBSYSTEM_DEVICE_TREE_INCLUDE_DIR="${STAGING_KERNEL_DIR}/include"
CONFIG_SUBSYSTEM_AUTOCONFIG_KERNEL=y
CONFIG_SUBSYSTEM_AUTOCONFIG_U__BOOT=y
CONFIG_SUBSYSTEM_HARDWARE_AUTO=y
CONFIG_SUBSYSTEM_PROCESSOR0_IP_NAME="ps7_cortexa9_0"
CONFIG_SUBSYSTEM_PROCESSOR_ps7_cortexa9_0_SELECT=y
CONFIG_SUBSYSTEM_ARCH_ARM=y

#
# Memory Settings
#
CONFIG_SUBSYSTEM_MEMORY_PS7_DDR_0_BANKLESS_SELECT=y
# CONFIG_SUBSYSTEM_MEMORY_SIMPLE_SELECT is not set
# CONFIG_SUBSYSTEM_MEMORY_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_MEMORY_PS7_DDR_0_BANKLESS_BASEADDR=0x0
CONFIG_SUBSYSTEM_MEMORY_PS7_DDR_0_BANKLESS_SIZE=0x40000000
CONFIG_SUBSYSTEM_MEMORY_PS7_DDR_0_BANKLESS_KERNEL_BASEADDR=0x0
CONFIG_SUBSYSTEM_MEMORY_PS7_DDR_0_BANKLESS_U__BOOT_TEXTBASE_OFFSET=0x400000
CONFIG_SUBSYSTEM_MEMORY_IP_NAME="PS7_DDR_0"

#
# Serial Settings
#
CONFIG_SUBSYSTEM_FSBL_SERIAL_PS7_UART_1_SELECT=y
# CONFIG_SUBSYSTEM_FSBL_SERIAL_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_SELECT=y
# CONFIG_SUBSYSTEM_SERIAL_MANUAL_SELECT is not set
# CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_600 is not set
# CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_9600 is not set
# CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_28800 is not set
CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_115200=y
# CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_230400 is not set
# CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_460800 is not set
# CONFIG_SUBSYSTEM_SERIAL_PS7_UART_1_BAUDRATE_921600 is not set
CONFIG_SUBSYSTEM_SERIAL_FSBL_IP_NAME="ps7_uart_1"
CONFIG_SUBSYSTEM_SERIAL_IP_NAME="ps7_uart_1"

#
# Ethernet Settings
#
CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_SELECT=y
# CONFIG_SUBSYSTEM_ETHERNET_MANUAL_SELECT is not set
# CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_MAC_AUTO is not set
CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_MAC="00:0a:35:00:B0:0B"
CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_USE_DHCP=y

#
# Flash Settings
#
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_SELECT=y
# CONFIG_SUBSYSTEM_FLASH_MANUAL_SELECT is not set
# CONFIG_SUBSYSTEM_FLASH__ADVANCED_AUTOCONFIG is not set

#
# partition 0
#
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART0_NAME="boot"
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART0_SIZE=0x500000

#
# partition 1
#
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART1_NAME="bootenv"
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART1_SIZE=0x20000

#
# partition 2
#
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART2_NAME="kernel"
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART2_SIZE=0xA80000

#
# partition 3
#
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART3_NAME="spare"
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART3_SIZE=0x0

#
# partition 4
#
CONFIG_SUBSYSTEM_FLASH_PS7_QSPI_0_BANKLESS_PART4_NAME=""
CONFIG_SUBSYSTEM_FLASH_IP_NAME="ps7_qspi_0"

#
# SD/SDIO Settings
#
CONFIG_SUBSYSTEM_PRIMARY_SD_PS7_SD_0_SELECT=y
# CONFIG_SUBSYSTEM_PRIMARY_SD_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_SD_PS7_SD_0_SELECT=y

#
# RTC Settings
#
CONFIG_SUBSYSTEM_RTC_MANUAL_SELECT=y
CONFIG_SUBSYSTEM_USB_PS7_USB_0_SELECT=y
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG=y

#
# boot image settings
#
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_FLASH_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_SD_SELECT=y
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_MEDIA_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOT_IMAGE_NAME="BOOT.BIN"

#
# u-boot env partition settings
#
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_FLASH_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_SD_SELECT=y
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_BOOTENV_MEDIA_MANUAL_SELECT is not set

#
# kernel image settings
#
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_FLASH_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_SD_SELECT=y
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_ETHERNET_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_MEDIA_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_KERNEL_IMAGE_NAME="image.ub"

#
# jffs2 rootfs image settings
#
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_MEDIA_FLASH_SELECT=y
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_MEDIA_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_PART_NAME="jffs2"
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_JFFS2_IMAGE_NAME="rootfs.jffs2"

#
# dtb image settings
#
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_BOOTIMAGE_SELECT=y
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_FLASH_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_SD_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_ETHERNET_SELECT is not set
# CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_MEDIA_MANUAL_SELECT is not set
CONFIG_SUBSYSTEM_IMAGES_ADVANCED_AUTOCONFIG_DTB_IMAGE_NAME="system.dtb"
CONFIG_SUBSYSTEM_ENDIAN_LITTLE=y

#
# DTG Settings
#
CONFIG_SUBSYSTEM_MACHINE_NAME="zc702"

#
# Kernel Bootargs
#
# CONFIG_SUBSYSTEM_BOOTARGS_AUTO is not set
CONFIG_SUBSYSTEM_USER_CMDLINE="console=ttyPS0,115200 root=/dev/mmcblk0p2 rootwait rw earlyprintk rootfstype=ext4"
CONFIG_SUBSYSTEM_DEVICETREE_FLAGS="-@"
# CONFIG_SUBSYSTEM_DTB_OVERLAY is not set
# CONFIG_SUBSYSTEM_REMOVE_PL_DTB is not set

#
# FSBL Configuration
#
CONFIG_SUBSYSTEM_FSBL_BSPCOMPILER_FLAGS=""
CONFIG_SUBSYSTEM_FSBL_COMPILER_EXTRA_FLAGS=""

#
# FPGA Manager
#
# CONFIG_SUBSYSTEM_FPGA_MANAGER is not set

#
# u-boot Configuration
#
CONFIG_SUBSYSTEM_UBOOT_CONFIG_PETALINUX=y
# CONFIG_SUBSYSTEM_UBOOT_CONFIG_OTHER is not set
CONFIG_SUBSYSTEM_UBOOT_CONFIG_TARGET="xilinx_zynq_virt_defconfig"
CONFIG_SUBSYSTEM_NETBOOT_OFFSET=0x10000000
CONFIG_SUBSYSTEM_U__BOOT_TFTPSERVER_IP="AUTO"

#
# Image Packaging Configuration
#
# CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set
# CONFIG_SUBSYSTEM_ROOTFS_INITRD is not set
# CONFIG_SUBSYSTEM_ROOTFS_JFFS2 is not set
# CONFIG_SUBSYSTEM_ROOTFS_NFS is not set
CONFIG_SUBSYSTEM_ROOTFS_EXT4=y
# CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set
CONFIG_SUBSYSTEM_SDROOT_DEV="/dev/mmcblk0p2"
CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub"
CONFIG_SUBSYSTEM_RFS_FORMATS="cpio cpio.gz cpio.gz.u-boot tar.gz jffs2"
CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000
# CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT is not set

#
# Firmware Version Configuration
#
CONFIG_SUBSYSTEM_HOSTNAME="m8_peta"
CONFIG_SUBSYSTEM_PRODUCT="m8_peta"
CONFIG_SUBSYSTEM_FW_VERSION="1.00"

#
# Yocto Settings
#
CONFIG_YOCTO_MACHINE_NAME="zynq-generic"

#
# TMPDIR Location
#
CONFIG_TMP_DIR_LOCATION="${PROOT}/build/tmp"

#
# WORKSPACE Location
#
CONFIG_WORKSPACE_LOCATION="${PROOT}/components/yocto/workspace"
CONFIG_BUILDTOOL_BITBAKE=y
# CONFIG_BUILDTOOL_DEVTOOL is not set

#
# Parallel thread execution
#
CONFIG_YOCTO_BB_NUMBER_THREADS=""
CONFIG_YOCTO_PARALLEL_MAKE=""

#
# Add pre-mirror url 
#
CONFIG_PRE_MIRROR_URL="http://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER%%.*}/downloads"

#
# Local sstate feeds settings
#
CONFIG_YOCTO_LOCAL_SSTATE_FEEDS_URL=""
CONFIG_YOCTO_NETWORK_SSTATE_FEEDS=y

#
# Network sstate feeds URL
#
CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="http://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER%%.*}/arm/sstate-cache"
# CONFIG_YOCTO_BB_NO_NETWORK is not set

#
# User Layers
#
CONFIG_USER_LAYER_0=""

 

 

 

 

After copying boot.scr, image.ub, and BOOT.bin into a FAT32 partition, and extracting the file system into the second ext4 partition, I then insert the SD card and power-on. Here's the output from U-boot, including the environment variables:

bfung_2_2-1602020404613.png

 

 

 

 

Zynq> printenv
arch=arm
baudrate=115200
board=zynq
board_name=zynq
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc0 jtag mmc0 mmc1 qspi usb0 usb1 pxe dhcp 
bootcmd=run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_jtag=source $scriptaddr; echo SCRIPT FAILED: continuing...;
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_qspi=sf probe 0 0 0 && sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && source ${scriptaddr}; echo SCRIPT FAILED: continuing...;
bootcmd_usb0=devnum=0; run usb_boot
bootcmd_usb1=devnum=1; run usb_boot
bootdelay=4
cpu=armv7
dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0
dfu_mmc_info=setenv dfu_alt_info ${kernel_image} fat 0 1\\;${devicetree_image} fat 0 1\\;${ramdisk_image} fat 0 1
dfu_ram=run dfu_ram_info && dfu 0 ram 0
dfu_ram_info=setenv dfu_alt_info ${kernel_image} ram 0x3000000 0x500000\\;${devicetree_image} ram 0x2A00000 0x20000\\;${ramdisk_image} ram 0x2000000 0x600000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
fdt_addr_r=0x1f00000
fdt_high=0x20000000
fdtcontroladdr=3f323b40
initrd_high=0x20000000
kernel_addr_r=0x2000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
modeboot=sdboot
pxefile_addr_r=0x2000000
ramdisk_addr_r=0x3100000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
script_offset_f=fc0000
script_size_f=0x40000
scriptaddr=0x3000000
serverip=10.1.50.53
soc=zynq
stderr=serial@e0001000
stdin=serial@e0001000
stdout=serial@e0001000
thor_mmc=run dfu_mmc_info && thordown 0 mmc 0
thor_ram=run dfu_ram_info && thordown 0 ram 0
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=xilinx

 

 

 

Continuing on with booting...

 

 

 

mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2010 bytes read in 12 ms (163.1 KiB/s)
## Executing script at 03000000
4353424 bytes read in 250 ms (16.6 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000e8
     Data Size:    4326064 Bytes = 4.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00200000
     Entry Point:  0x00200000
     Hash algo:    sha256
     Hash value:   fc8167c541aaf6fa4d915cec8fb1f9caf00950025754b51cb5c3ed812e49f832
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Verifying Hash Integrity ... OK
   Trying 'fdt@system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x104204a4
     Data Size:    25477 Bytes = 24.9 KiB
     Architecture: ARM
     Hash algo:    sha256
     Hash value:   8556b7f03fc9eca1f85412743a84b6847d878b230018d6ffa4f7a6707b8fcbbf
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x104204a4

ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 7, interface rgmii-id
mdio_register: non unique device name 'eth0'
   Loading Kernel Image
   Loading Device Tree to 1fff6000, end 1ffff384 ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 5.4.0-xilinx-v2020.1 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Tue Oct 6 05:09:41 UTC 2020
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: Zynq ZC702 Development Board
printk: bootconsole [earlycon0] enabled
Memory policy: Data cache writealloc
cma: Reserved 16 MiB at 0x3f000000
percpu: Embedded 15 pages/cpu s31948 r8192 d21300 u61440
Built 1 zonelists, mobility grouping on.  Total pages: 260416
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rootwait rw earlyprintk rootfstype=ext4
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 1010868K/1048576K available (6144K kernel code, 217K rwdata, 1840K rodata, 1024K init, 131K bss, 21324K reserved, 16384K cma-reserved, 245760K highmem)
rcu: Preemptible hierarchical RCU implementation.
rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
	Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to (ptrval)
slcr mapped to (ptrval)
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
random: get_random_bytes called from start_kernel+0x260/0x440 with crng_init=0
zynq_clock_init: clkc starts at (ptrval)
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x(ptrval)
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc: Linux media interface: v0.10
videodev: Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
FPGA manager framework
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
thermal_sys: Registered thermal governor 'step_wise'
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
workingset: timestamp_bits=14 max_order=18 bucket_order=4
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler mq-deadline registered
io scheduler kyber registered
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: 	DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
brd: module loaded
loop: module loaded
spi-nor spi0.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
mdio_bus e000b000.ethernet-ffffffff: MDIO device at address 7 is missing.
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: unable to init phy: -110
ci_hdrc: probe of ci_hdrc.0 failed with error -110
i2c /dev entries driver
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer with timeout 10s
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.mmc [e0100000.mmc] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at (ptrval), irq=39
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20190810) max_hops=1
Registering SWP/SWPB emulation handler
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 24, base_baud = 6249999) is a xuartps
printk: console [ttyPS0] enabled
printk: console [ttyPS0] enabled
printk: bootconsole [earlycon0] disabled
printk: bootconsole [earlycon0] disabled
of-fpga-region fpga-full: FPGA Region probed
input: gpio-keys as /devices/soc0/gpio-keys/input/input0
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...

 

 

 

Which at this point gets stuck indefinitely.

I've also attached the boot.scr.

I'm wondering about any leads that I can follow to debug this. Thanks.

0 Kudos
1 Solution

Accepted Solutions
sandeepg
Moderator
Moderator
1,646 Views
Registered: ‎04-24-2017

Hi @bfung_2 ,

I would suggest to set the DTG machine name to template and add your board dt nodes in system-user.dtsi.

Refer this post https://forums.xilinx.com/t5/Embedded-Linux/PetaLinux-hangs-at-login-prompt-on-zynq-7000/m-p/881499 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

View solution in original post

16 Replies
patocarr
Teacher
Teacher
2,154 Views
Registered: ‎01-28-2008

Hi @bfung_2 

  U-Boot is actually doing its job just fine; it's the kernel that's crashing while waiting for the mmc partition.

  You can use U-Boot "mmc" command to find out the SD card's partitions, even read them. It's possible it wasn't partitioned, formatted or the file system not copied properly. It'll be interesting to see the output of the mmc command, i.e. "mmc info", etc.

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

bfung_2
Adventurer
Adventurer
2,058 Views
Registered: ‎07-02-2020

Here's the output of various mmc commands:

bfung_2_1-1602189578122.png

bfung_2_2-1602189629798.png

 

0 Kudos
patocarr
Teacher
Teacher
2,052 Views
Registered: ‎01-28-2008

Hi @bfung_2 

  Looks like the hardware is fine then. I'd then check how the rootfs image made it into the SD partition 2. How did you copy it to the SD card?

 

Thanks,

-Pat

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

bfung_2
Adventurer
Adventurer
2,047 Views
Registered: ‎07-02-2020

- I follow the instructions here for formatting the 2 partitions: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842385/How+to+format+SD+card+for+SD+boot

- For copying the rootfs, I copy the rootfs.cpio generated from petalinux-build into /dev/sdc2, and then I unpack: sudo cpio -idm < rootfs.cpio

I can confirm the contents of the root file system unpack.

I then pop the SD card into the test unit and power-on.

Could it be that the device/partition is named something different than /dev/mmcblk0p2?

I can browse the ext4 partition in u-boot:

bfung_2_0-1602195485848.png

 

 

0 Kudos
bartokon
Explorer
Explorer
2,024 Views
Registered: ‎09-17-2018

You can use dd if=rootfs.ext4 of=/dev/sdb2

dd if=<rootfs.ext4 generated by petalinux> of=<second partition of sd-card>

or you can use Gparted to write rootfs.ext4 to /dev/sdb2

bartokon_0-1602196142568.png

or https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/ug1144-petalinux-tools-reference-guide.pdf follow page 172

bfung_2
Adventurer
Adventurer
2,002 Views
Registered: ‎07-02-2020

I've also attached the device tree file.

 

Here's the mmc portion:

mmc@e0100000 {
compatible = "arasan,sdhci-8.9a";
status = "okay";
clock-names = "clk_xin", "clk_ahb";
clocks = <0x00000001 0x00000003 0x00000003 0x00000018>;
interrupt-parent = <0x00000004>;
interrupts = <0x00000000 0x00000008 0x00000003>;
reg = <0xe0100000 0x00000123>;
u-boot,dm-pre-reloc;
pinctrl-names = "default";
pinctrl-0 = <0x00000010>;
xlnx,has-cd = <0x00000001>;
xlnx,has-power = <0x00000000>;
xlnx,has-wp = <0x00000001>;
phandle = <0x00000034>;
};

 

0 Kudos
patocarr
Teacher
Teacher
1,997 Views
Registered: ‎01-28-2008

Hi,

  To make sure which name Linux is seeing on the second SD partition, I would change temporarily to a RAM filesystem, re-build and boot all the way to Linux prompt. Then you can probe which device is actually the second partition.

  Also, there's no harm is testing the method shown in the How to format SD card article.

dd if=rootfs.ext4 of=/dev/sdc2

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

bfung_2
Adventurer
Adventurer
1,982 Views
Registered: ‎07-02-2020

OK. Tried the dd method and it doesn't change the result.

I switched to initrd boot for the rootFS, and subsequently listed the device nodes:

bfung_2_0-1602203630210.png

I can't seem to find any mmcblk0 nor any detected sd card devices?

 

0 Kudos
patocarr
Teacher
Teacher
1,977 Views
Registered: ‎01-28-2008

Interesting... what's the boot log says about sdhci?

Have you seen the SD controller article?

 

Thanks,

-Pat

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
bfung_2
Adventurer
Adventurer
1,683 Views
Registered: ‎07-02-2020

Picking up where I left off...

This is what the kernel boot log says about SDHCI:

sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.mmc [e0100000.mmc] using ADMA

Doesn't seem like anything out of the ordinary. From my earlier results with initrd booting, it seems that the /dev/mmcblk0p2 node isn't created and thus cannot be detected...I'm wondering how to resolve this as a probable way to move forward...

0 Kudos
watari
Professor
Professor
1,671 Views
Registered: ‎06-16-2013

Hi @bfung_2 

 

I just ask you.

 

Did you make sure whether write protection is disable or enable ?

I suspect it and Linux kernel requires rootfs as writable.

 

Best regards,

sandeepg
Moderator
Moderator
1,663 Views
Registered: ‎04-24-2017

Hi @bfung_2 ,

Are you using zc702 evaluation board or custom board?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
bfung_2
Adventurer
Adventurer
1,656 Views
Registered: ‎07-02-2020

@watari 

  • The SD card WP signal into the Zynq-7020 chip is grounded through a 1K resistor as described here. This should mean that the SD is in write enable mode. 
  • It would be interesting to interrogate the state of that pin, maybe in user-space or kernel space, to double-check that the level is indeed gounded (write enable) - not quite sure what the quickest way to do this is. 
0 Kudos
bfung_2
Adventurer
Adventurer
1,655 Views
Registered: ‎07-02-2020

@sandeepg 

The Zynq-7020 is on a custom-board.

I've only customized the DTG machine name to be zc702 in the petalinux-config menu as suggested in UG1144 and referenced the .xsa exported from Vivado (targeting the zynq7020 chip on my custom board, not the zcu702).

0 Kudos
sandeepg
Moderator
Moderator
1,647 Views
Registered: ‎04-24-2017

Hi @bfung_2 ,

I would suggest to set the DTG machine name to template and add your board dt nodes in system-user.dtsi.

Refer this post https://forums.xilinx.com/t5/Embedded-Linux/PetaLinux-hangs-at-login-prompt-on-zynq-7000/m-p/881499 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

View solution in original post

bfung_2
Adventurer
Adventurer
1,591 Views
Registered: ‎07-02-2020

Thanks @sandeepg 

Progress has been made. I'm able now to get a login prompt and write/read files from the root FS from the ext4 partition after changing the DTG machine name to template. I have no custom hardware at the moment so went with the default referenced DT.

I would advise that UG1144 would include a description to change the DTG machine name to template for custom boards - that would've helped me a lot!

0 Kudos