UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
734 Views
Registered: ‎07-31-2017

zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

In xilinx-vcu-trd-zcu106-v2019.1-final peta project, I enable:

CONFIG_packagegroup-petalinux-self-hosted=y

During kernel boot:
[ 18.210266] Kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer
[ 18.222170] CPU: 1 PID: 61 Comm: kworker/1:1 Not tainted 4.19.0-xilinx-v2019.1 #1
[ 18.229646] Hardware name: ZynqMP ZCU106 RevA (DT)
[ 18.234435] Workqueue: events deferred_probe_work_func
[ 18.239566] Call trace:
[ 18.242009] dump_backtrace+0x0/0x148
[ 18.245662] show_stack+0x14/0x20
[ 18.248970] dump_stack+0x90/0xb4
[ 18.252276] panic+0x120/0x268
[ 18.255324] map_single+0x0/0xa0
[ 18.258544] map_single+0x4c/0xa0
[ 18.261851] swiotlb_map_page+0x9c/0x158
[ 18.265767] __swiotlb_map_page+0x28/0x90
[ 18.269771] zynqmp_qspi_start_transfer+0x2b0/0x700
[ 18.274639] spi_transfer_one_message+0x128/0x478
[ 18.279335] __spi_pump_messages+0x35c/0x580
[ 18.283597] __spi_sync+0x234/0x298
[ 18.287077] spi_sync+0x2c/0x50
[ 18.290211] spi_mem_exec_op+0x2c4/0x418
[ 18.294126] m25p80_read+0x98/0x118
[ 18.297609] spi_nor_read_sfdp+0x58/0xc8
[ 18.301523] spi_nor_read_sfdp_dma_unsafe+0x50/0x90
[ 18.306394] spi_nor_init_params+0x218/0x6c0
[ 18.310655] spi_nor_scan+0xfc/0xe48
[ 18.314222] m25p_probe+0x194/0x1f0
[ 18.317704] spi_mem_probe+0x6c/0xa0
[ 18.321271] spi_drv_probe+0x7c/0xd8
[ 18.324839] really_probe+0x1c8/0x280
[ 18.328494] driver_probe_device+0x54/0xe8
[ 18.332583] __device_attach_driver+0xb8/0xe8
[ 18.336931] bus_for_each_drv+0x78/0xc8
[ 18.340760] __device_attach+0xd4/0x130
[ 18.344588] device_initial_probe+0x10/0x18
[ 18.348763] bus_probe_device+0x90/0x98
[ 18.352593] device_add+0x334/0x608
[ 18.356073] spi_add_device+0xac/0x168
[ 18.359815] of_register_spi_device+0x214/0x320
[ 18.364338] spi_register_controller+0x290/0x618
[ 18.368948] zynqmp_qspi_probe+0x3f4/0x530
[ 18.373036] platform_drv_probe+0x50/0xa0
[ 18.377037] really_probe+0x1c8/0x280
[ 18.380692] driver_probe_device+0x54/0xe8
[ 18.384781] __device_attach_driver+0xb8/0xe8
[ 18.389129] bus_for_each_drv+0x78/0xc8
[ 18.392958] __device_attach+0xd4/0x130
[ 18.396786] device_initial_probe+0x10/0x18
[ 18.400962] bus_probe_device+0x90/0x98
[ 18.404790] deferred_probe_work_func+0x6c/0xa0
[ 18.409313] process_one_work+0x1e4/0x340
[ 18.413314] worker_thread+0x248/0x488
[ 18.417058] kthread+0x124/0x128
[ 18.420277] ret_from_fork+0x10/0x18
[ 18.423846] SMP: stopping secondary CPUs
[ 18.427760] Kernel Offset: disabled
[ 18.431240] CPU features: 0x0,20802004
[ 18.434980] Memory Limit: none
[ 18.438023] ---[ end Kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer ]---

 

I disable CONFIG_packagegroup-petalinux-self-hosted, recompile then kernel boots ok.  Is there something else I need to configure to get CONFIG_packagegroup-petalinux-self-hosted to work?  Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
282 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

Below is the steps you need follow.

  1. Set the Image Packaging Configuration -> Root filesystem type -> SD card
  2. Modify the bootargs in common.dtsi as shown below. 
    / {
            chosen {
                    bootargs = "earlycon clk_ignore_unused consoleblank=0 cma=1700M uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait";
                    stdout-path = "serial0:115200n8";
            };
    };
    
    
    &uart1 {
        status = "disabled";
    };
  3. Run below commands. 
    $ petalinux-build -c device-tree -x cleansstate
    $ petalinux-build
  4. Verify the decompile system.dtb
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

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

View solution in original post

19 Replies
Moderator
Moderator
696 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

What is your bootmode? Are you using QSPI mode?

When you enable self-hosted package it increase size of rootfs.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
665 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

SD card

0 Kudos
Moderator
Moderator
648 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

Are you using INITRAMFS or SD EXT4 in petalinux?

Also if you can post complete boot log that will be great.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
627 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

We use initramfs:

CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS=y
CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub"
CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000

I attached file boot_hosted_y.txt which is the kernel boot when selfhosted is enabled.

0 Kudos
Moderator
Moderator
618 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

When you enable self-hosted packages due to increase in rootfs size it is not recommended to use INITRAMFS hence you need to change the Image Packaging Configuration to SD

#
# 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_SD=y
# CONFIG_SUBSYSTEM_ROOTFS_OTHER is not set
CONFIG_SUBSYSTEM_SDROOT_DEV="/dev/mmcblk0p2"
CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub"
CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000
# CONFIG_SUBSYSTEM_COPY_TO_TFTPBOOT is not set

Note: In upcoming 2019.2 release we have renamed this option from SD to EXT4 where you can use SD/SATA/eMMC.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Adventurer
Adventurer
565 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Thanks for the explanation.  It seems that I have to prep the sd card for SUBSYSTEM_ROOTFS_SD=y.

Are these instructions applicable to 2019.1?  If not, please let me know where to find updated instructions.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842385/How+to+format+SD+card+for+SD+boot

Thanks again

0 Kudos
Adventurer
Adventurer
558 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Sorry for double post, but I can't seem to edit a previous reply.

It seems https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842385/How+to+format+SD+card+for+SD+boot

only explains formatting but not what to do after.  My peta build finished and I have:

rootfs.ext3, rootfs.ext4

both 1.2 gb in size.  No wonder ramfs crashed...

I assume that I have to use ext4 and copy it to the 2nd partition, but the steps that I found are from older peta 2016/2017.  If you could point me to instructions closer to 2019.1, I appreciate it.

 

 

0 Kudos
Moderator
Moderator
549 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

Once you have FAT and EXT4 partition create follow below steps.

# Go to FAT partition
$ cd BOOT/

# Copy BOOT.BIN and image.ub in FAT partion $ cp <plnx-proj-root>/images/linux/BOOT.BIN . $ cp <plnx-proj-root>/images/linux/image.ub .

# Go to FAT partition $ cd ROOTFS/

# Copy rootfs.tar.gz in Ext4 partion using super user mode $ sudo cp <plnx-proj-root>/images/linux/rootfs.tar.gz . $ sudo tar -xf rootfs.tar.gz

# Exit from EXT4 partition $ cd

# Run Sync before you umount the SD card. $ sync

This is documented in 2019.1 UG1144 page 55, 64 and 65

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Adventurer
Adventurer
483 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

The kernel boot fails and reports error:

[ 7.180740] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 7.188234] Please append a correct "root=" boot option;

It seems 

CONFIG_SUBSYSTEM_SDROOT_DEV="/dev/mmcblk0p2"

isn't being specified in the "root=" boot option.  I tried 

petalinux-build -x distclean

but the kernel boot still fails.

It seems like there is a step missing or the project isn't updating properly after petalinux-config.

I've attached the boot log.

0 Kudos
Moderator
Moderator
478 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

 

From your boot logs I don't see the root= option is parsed in your boot args.

 

[    0.000000] Kernel command line: earlycon clk_ignore_unused consoleblank=0 cma=1700M uio_pdrv_genirq.of_id=generic-uio

 

Can you share your project-spec/configs/config file? 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Adventurer
Adventurer
455 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Here's my config file. 

Some google searches have a solution of disabling SD card write protect.  I tried adding to system-user.dtsi:

&sdhci0 {
status = "okay";
disable-wp;
};

But uboot reports 

Hit any key to stop autoboot: 0
Card did not respond to voltage select!
Card did not respond to voltage select!
ZynqMP>

 

0 Kudos
Moderator
Moderator
444 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

If you are using Class10 SD card then it should work out of box.

xilinx-zcu106-2019.1 $ cat project-spec/configs/config | grep "/dev"
CONFIG_SUBSYSTEM_SDROOT_DEV="/dev/mmcblk0p2"
CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait"
xilinx-zcu106-2019.1 $

Still I don't see your config file.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Adventurer
Adventurer
416 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

So sorry, I tried a reply yesterday but didn't see this error:

The attachment's config content type (text/plain) does not match its file extension and has been removed

So the post attempt rejected config and then I just click Post again.

 I renamed it with .txt attached it with this post, so hopefully it works. At the end of config, I see:

CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait"

To check where the SD card is mounted, I copied the prebuilt bin from rdf0428-zcu106-vcu-trd-2019-1_v2\images\vcu_hdmitx and check the dev for mmc:

root@zcu106_vcu_trd:/dev# ls mmc*
mmcblk0 mmcblk0p1 mmcblk0p2 mmcblk0p3

The SD card that I used was the one shipped with the zcu106: sandisk ultra sdhcI class 10. I do have 3 partitions tho.  Will the 3rd partition cause trouble?

 

 

0 Kudos
Moderator
Moderator
405 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

I'm not sure what does the 3rd partition contains. Do you still have the EXT4 mount issues?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Adventurer
Adventurer
399 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

The 3rd partition is empty.  I made the 3rd partition to test saving our database there. 

Unfortunately, I still have EXT4 mount issues.  I removed the SD card write protect disable in my device tree since it causes an error in uboot.

0 Kudos
Moderator
Moderator
393 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

Can you run below commands and verify <plnx-proj-root>/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi file is getting updated with right bootargs?

$ petalinux-config
$ petalinux-build -c device-tree -x cleansstate $ petalinux-build
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Adventurer
Adventurer
326 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

system-conf.dtsi's bootargs are either ignored or overrided.  system-conf.dtsi has:

chosen {
bootargs = "earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait";
stdout-path = "serial0:115200n8";
};

but components/plnx_workspace/device-tree/device-tree/system-top.dts has:

chosen {
bootargs = "earlycon clk_ignore_unused";
stdout-path = "serial0:115200n8";
};

I decompile images/linux/system.dtb to get a dts:

dtc -I dtb -O dts -o system.dts system.dtb

system.dtb has:

chosen {
bootargs = "earlycon clk_ignore_unused";
stdout-path = "serial0:115200n8";
};

I found that common.dtsi in project-spec/meta-user/recipes-bsp/device-tree/files has:

chosen {
bootargs = "earlycon clk_ignore_unused consoleblank=0 cma=1700M uio_pdrv_genirq.of_id=generic-uio";
stdout-path = "serial0:115200n8";
};

I delete common.dtsi and clean with -x cleansstate

After peta build, I check images/linux/system.dtb, but it still has:

bootargs = "earlycon clk_ignore_unused";

Something is still overriding/ignoring system-conf.dtsi's bootargs.  If you have any suggestions on how to fix this, please let me know.  Thanks in advance!  I've attached system-conf.dtsi and decompiled images/linux/system.dtb

 

 

 

 

0 Kudos
Moderator
Moderator
283 Views
Registered: ‎04-24-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

Hi @kallensf ,

Below is the steps you need follow.

  1. Set the Image Packaging Configuration -> Root filesystem type -> SD card
  2. Modify the bootargs in common.dtsi as shown below. 
    / {
            chosen {
                    bootargs = "earlycon clk_ignore_unused consoleblank=0 cma=1700M uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait";
                    stdout-path = "serial0:115200n8";
            };
    };
    
    
    &uart1 {
        status = "disabled";
    };
  3. Run below commands. 
    $ petalinux-build -c device-tree -x cleansstate
    $ petalinux-build
  4. Verify the decompile system.dtb
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

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

View solution in original post

Adventurer
Adventurer
268 Views
Registered: ‎07-31-2017

Re: zcu106 trd 2019.1: self-hosted package enabled causes kernel crash

Jump to solution

I did as you suggested but the bootargs were still not modified, so I started a new project with the hdmitx hdf from rdf0428-zcu106-vcu-trd-2019-1_v2/pl/prebuilt. I follow all the steps that you told me and it booted successfully. To make sure that it really is using sd card partition 2 as the rootfs, I copied a text file _sdcard_rootfs_ to partition 2. After boot, I check and see that _sdcard_rootfs_ is there.

root@zcu106_vcu_trd:~# cd /
root@zcu106_vcu_trd:/# ls
_sdcard_rootfs_ boot etc lib mnt rootfs.tar.gz sbin tmp var
bin dev home media proc run sys usr

I marked your last reply as the solution but I'll summarize all your suggestions below.  Thanks for all the help!  Cheers!



It seems if the project was built with Initramfs before, it doesn't convert to SD card properly. I suggest starting a new project from scratch instead of reusing a project that had Initramfs.

SD card as Root FS on ZCU106 eval board, vcu bsp.

1) Start a new project and config for SD card as per 2019.1 UG1144 page 55, 64 and 65
project-spec/configs/config will have:
CONFIG_SUBSYSTEM_ROOTFS_SD=y
CONFIG_SUBSYSTEM_SDROOT_DEV="/dev/mmcblk0p2"
CONFIG_SUBSYSTEM_UIMAGE_NAME="image.ub"
CONFIG_SUBSYSTEM_DTB_PADDING_SIZE=0x1000

2) Modify the bootargs in common.dtsi to match CONFIG_SUBSYSTEM_SDROOT_DEV string with bootargs variable root= string

/ {
chosen {
bootargs = "earlycon clk_ignore_unused consoleblank=0 cma=1700M uio_pdrv_genirq.of_id=generic-uio root=/dev/mmcblk0p2 rw rootwait";
stdout-path = "serial0:115200n8";
};
};

3) Build
$ petalinux-build -c device-tree -x cleansstate
$ petalinux-build

4) While building, prepare a SD card with at least 2 partitions. Partition 1 must be FAT. Partition 2 must be EXT4. Any format tool is fine. Here is an example with fdisk:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842385/How+to+format+SD+card+for+SD+boot

5) After peta build is done, copy files:
# Go to FAT partition
$ cd BOOT/

# Copy BOOT.BIN and image.ub in FAT partion
$ cp <plnx-proj-root>/images/linux/BOOT.BIN .
$ cp <plnx-proj-root>/images/linux/image.ub .

# Go to FAT partition
$ cd ROOTFS/

# Copy rootfs.tar.gz in Ext4 partion using super user mode
$ sudo cp <plnx-proj-root>/images/linux/rootfs.tar.gz .
$ sudo tar -xf rootfs.tar.gz

# Exit from EXT4 partition
$ cd

# Run Sync before you umount the SD card.
$ sync

Note that if Partition 2 is FAT, tar will report errors and symlinks will fail. Partition 2 must be EXT4.

6) Insert SD card and power up zcu106 board

 

 

0 Kudos