cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bhuelsen
Visitor
Visitor
3,273 Views
Registered: ‎06-22-2017

Ultrazed-EG: boot failure using rootfs on sd card (petalinux 2016.2)


Hi everyone,

currently I am approaching to boot up a petalinux with dedicated rootfs on a SD card.
I configured the petalinux project with:

Image Packaging Configuration ---> Root filesystem type = SD card


but something goes wrong at the point of mounting the root fs



The only way to bring up the system is to configure the petalinux project with:

Image Packaging Configuration ---> Root filesystem type = initramfs

   

The console output of both boot up scenarios are attached to this post.

As hardware setup I am using the Ultrazed-EG starter kit.
To avoid additional error sources I have used the Compressed PetaLinux BSP for Avnet Zynq system platforms as basis to create a petalinux project, without any changes. --> http://zedboard.org/support/design/17596/131
I have also considered this error:
https://forums.xilinx.com/t5/Embedded-Linux/Error-when-rootfs-is-placed-on-SD-card/td-p/684101
because it seemed to be similar to my problem, but the described configuration does not work for me.

I have also tested different SD cards (SDCH 8 GB speed class 2, SDHC 32 GB speed class 10) and tested different configurations of the file system on the SD card (ext3/ ext4).

The attached console output was done with the following configuration of the SD card:

first partition: ~ 400 MB FAT 32
    boot.bin
    image.ub
second partition: ~ 31 GB ext4
    rootfs.cpio

I deployed the rootfs.cpio on the SD card by:

sudo pax -rvf rootfs.cpio



If you have any idea to bring up the system with a rootfs on the SD card, or if you are using the same HW setup and facing a similar problem please let me know.

Best regards,

Benjamin

0 Kudos
3 Replies
pedro_uno
Advisor
Advisor
979 Views
Registered: ‎02-12-2013

Hello Ben,

I am having the same problem getting Petalinux (2019.1) to boot with the rootfs on the SD card.  I have spent about a week fighting this problem but boot still hangs waiting for mmcblk1p2, the sd card ext4 partition that contains the root filesystem.

I have found quite a lot of references saying that the problem relates to software write protection being enabled in petalinux but I can write a file to the partition in u-boot using "ext4write mmc 1:2 0 /junk 100".

I have never had this problem on Zed, Microzed, ZCU104 or any other board.

Have you succeeded on the Ultrazed-EG?

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos
bhoevding
Contributor
Contributor
950 Views
Registered: ‎05-02-2019

Hello @

I have had the same problem and usually this is due to the write protections, as you already stated.

Please make sure your device tree contains the following entry:

editor <petalinux-proj>/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

....
/* SD1 with level shifter */
&sdhci1 {
	status = "okay";
	max-frequency = <50000000>;
	no-1-8-v;	/* for 1.0 silicon */
        disable-wp;
};
...

so that the contents of the sd card can be utilzied for the boot process.

Hope that helps.

0 Kudos
pedro_uno
Advisor
Advisor
926 Views
Registered: ‎02-12-2013

Yes, thank you. That is the system-user.dtsi device tree entry I used for the sd card.  I got there by unzipping an older .bsp file from Avnet for the Ultrazed-EG.  I just used the system-user.dtsi from that, adding just the "disable-wp" statement.  I then created a new 2019.1 bsp for the board using these instructions.   I also attach full system-user.dtsi. 

Several people have tested this procedure.

 

Avnet has not released an official BSP for this board but it is easy to create.

petalinux-create --force --type project --template zynqMP --name bspproj

Now we have to modify the system-user.dtsi device tree file. This tells the linux kernel some things about the Ethernet interface and the SD card. There is a modified version committed to this repository so just copy it over.

cp ./system-user.dtsi ./bspproj/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

Now configure the bsp project.

cd bspproj/
petalinux-config --get-hw-description=../../../implement/results/

This will bring up a configuration menu. Make the following changes. These changes will automatically be incorporated into the Petalinux build based on the BSP.

* Under "Image Packaging Configuration" ->
    "Root filesystem type" ->
        Select "SD Card"
    "Device Node of SD Device" ->
        Change to mmcblk1p2

* Under "Subsystem AUTO Hardware Settings" ->
    "Advanced bootable images storage Settings" ->
        "u-boot env partition settings" ->
            "image storage media" ->
                Select "primary sd"
    "SD/SDIO Settings"  -> 
        "Primary SD/SDIO" ->
            Select "psu_sd_1"

* Save and exit the configuration menu. Wait for configuration to complete.

cd ..
petalinux-package --bsp -p bspproj/ --output uzed.bsp

********************************

Here is the system-user.dtsi referenced in the procedure.

/include/ "system-conf.dtsi"
/ {
};

&gem3 {
	status = "okay";
	local-mac-address = [00 0a 35 00 02 90];
	phy-mode = "rgmii-id";
	phy-handle = <&phy0>;
	phy0: phy@9 {
		reg = <0x9>;
		ti,rx-internal-delay = <0x5>;
		ti,tx-internal-delay = <0x5>;
		ti,fifo-depth = <0x1>;
	};
};

&i2c1 {
	status = "okay";
	clock-frequency = <400000>;

	i2cswitch@70 { /* U7 on UZ3EG SOM */
		compatible = "nxp,pca9542";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x70>;
		i2c@0 { /* i2c mw 70 0 1 */
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;
			/* IIC_EEPROM */
			eeprom@51 { /* U5 on UZ3EG IOCC and U7 on the UZ7EV EVCC*/
				compatible = "at,24c08";
				reg = <0x51>;
			};
		};
	};
};

&qspi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	is-dual = <1>; /* Set for dual-parallel QSPI config */
	num-cs = <2>;
	xlnx,fb-clk = <0x1>;
	flash0: flash@0 {
        /* The Flash described below doesn't match our board ("micron,n25qu256a"), but is needed */
        /* so the Flash MTD partitions are correctly identified in /proc/mtd */
		compatible = "micron,m25p80"; /* 32MB */
		#address-cells = <1>;
		#size-cells = <1>;
		reg = <0x0>;
		spi-tx-bus-width = <1>;
		spi-rx-bus-width = <4>; /* FIXME also DUAL configuration possible */
		spi-max-frequency = <108000000>; /* Set to 108000000 Based on DC1 spec */
	};
};

/* SD0 eMMC, 8-bit wide data bus */
&sdhci0 {
	status = "okay";
	bus-width = <8>;
	max-frequency = <50000000>;
};

/* SD1 with level shifter */
&sdhci1 {
	status = "okay";
	max-frequency = <50000000>;
	no-1-8-v;	/* for 1.0 silicon */
    disable-wp;
};

/* ULPI SMSC USB3320 */
&usb0 {
	status = "okay";
};

&dwc3_0 {
	status = "okay";
	dr_mode = "host";
	phy-names = "usb3-phy";
};

----------------------------------------
DSP in hardware and software
-----------------------------------------
0 Kudos