Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎05-20-2016

Devicetree's bootargs ignored

Hi all and thank you very much in advance for reading this and trying to help.


I'm trying to run the libmatrix example from SDSoC 2016.1 also covered in chapter 10 "Exporting a Library fro GCC" in SDSoC Environment User Guide v2016.1. The general idea is to generate a complete boot image including FPGA bitstream and a library with the "HW functions" that can be called from a C code and compiled with the usual GNU gcc toolchain. 


The first part worked like a charm and I got the sd_card content that I copied to the first partition of my SDcard. But for the second part, what I'd like to do is to mount at boot time the second partition (with Linaro 12.11 and gcc installed) and then generate the exectuable within Linaro. To that end I edited the devicetree.dtb and changed the bootargs variable to look like:


bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0";


However, when booting, it seems that root=/dev/ram is still enforced as you can see in the following dump of the booting proces. As you can see, /dev/mmcblk0p2 ends up beeing mounted in /run/media/mmcblk0p2. I also tried adding to the sdcard the uEnv.txt file, with the following content:

bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait earlyprintk

but to no avail. If you have any advise or idea of what I should do to fix this, I would be realy grateful.


U-Boot 2014.07-00004-g19e1bb2 (Nov 19 2014 - 09:26:01)

Board:  Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   zynq_sdhci: 0
SF: Detected N25Q128A with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   Gem.e000b000
Hit any key to stop autoboot:  0
Device: zynq_sdhci
Manufacturer ID: 3
OEM: 5344
Name: SU08G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
reading uEnv.txt
127 bytes read in 7 ms (17.6 KiB/s)
Loaded environment from uEnv.txt
Importing environment from SD ...
Copying Linux from SD to RAM...
reading uImage
3613824 bytes read in 351 ms (9.8 MiB/s)
reading devicetree.dtb
10873 bytes read in 22 ms (482.4 KiB/s)
reading uramdisk.image.gz
8699839 bytes read in 813 ms (10.2 MiB/s)
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-4.4.0-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3613760 Bytes = 3.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
   Image Name:
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    8699775 Bytes = 8.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f7b4000, end 1fffff7f ... OK
   Loading Device Tree to 1f7ae000, end 1f7b3a78 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.4.0-xilinx (yogeshc@xsjengdev3) (gcc version 4.9.2 20140904 (prerelease) (c6
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Zynq ZC702 Development Board
bootconsole [earlycon0] enabled
cma: Reserved 256 MiB at 0x30000000
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @ef7d2000 s19264 r8192 d21696 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260608
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait earlyprintk
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 761372K/1048576K available (4856K kernel code, 219K rwdata, 1776K rodata, 244K init)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc068247c   (6634 kB)
      .init : 0xc0683000 - 0xc06c0000   ( 244 kB)
      .data : 0xc06c0000 - 0xc06f6ca0   ( 220 kB)
       .bss : 0xc06f6ca0 - 0xc0737b7c   ( 260 kB)
Preemptible hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 32.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
slcr mapped to f0802000
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
zynq_clock_init: clkc starts at f0802100
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_s
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at f080a000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x82c0 - 0x8318
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 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: 191126044627500s
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
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 @ 0xf0880000
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
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 <>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
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.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 8496K (df7b4000 - e0000000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
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
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 144, base_baud = 3125000) is a xuartps
console [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f086c000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi0.0: Controller not in SPI_TX_QUAD mode, just use extended SPI mode
m25p80 spi0.0: n25q128a11 (16384 Kbytes)
5 ofpart partitions found on MTD device spi0.0
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
0x000000100000-0x000000600000 : "qspi-linux"
0x000000600000-0x000000620000 : "qspi-device-tree"
0x000000620000-0x000000c00000 : "qspi-rootfs"
0x000000c00000-0x000001000000 : "qspi-bitstream"
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 146 (00:0a:35:00:)
macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1116R] (mii_bus:phy_addr=e000b)
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
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 142
i2c i2c-0: Added multiplexed i2c bus 1
i2c i2c-0: Added multiplexed i2c bus 2
at24 3-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
i2c i2c-0: Added multiplexed i2c bus 3
i2c i2c-0: Added multiplexed i2c bus 4
rtc-pcf8563 5-0051: chip found, driver version 0.4.4
rtc-pcf8563 5-0051: rtc core: registered rtc-pcf8563 as rtc0
i2c i2c-0: Added multiplexed i2c bus 5
i2c i2c-0: Added multiplexed i2c bus 6
i2c i2c-0: Added multiplexed i2c bus 7
i2c i2c-0: Added multiplexed i2c bus 8
pca954x 0-0074: registered 8 multiplexed busses for I2C switch pca9548
ucd9200 8-0034: Device ID UCD9248-80||091112
ucd9200 8-0034: 4 rails configured
ucd9200 8-0035: Device ID UCD9248-80||091112
ucd9200 8-0035: 4 rails configured
ucd9200 8-0036: Device ID UCD9248-80||091112
ucd9200 8-0036: 2 rails configured
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
sdhci-arasan e0100000.sdhci: No vmmc regulator found
sdhci-arasan e0100000.sdhci: No vqmmc regulator found
mmc0: Invalid maximum block size, assuming 512 bytes
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
xlnk xlnk: Major 245
xlnk xlnk: xlnk driver loaded
xlnk xlnk: xlnk_pdev is not null
si570 1-005d: registered, current frequency 148500000 Hz
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
mmc0: new high speed SDHC card at address e624
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
mmcblk0: mmc0:e624 SU08G 7.40 GiB
 mmcblk0: p1 p2
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
input: gpio-keys as /devices/soc0/gpio-keys/input/input0
rtc-pcf8563 5-0051: setting system clock to 2016-05-20 10:17:47 UTC (1463739467)
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 244K (c0683000 - c06c0000)
INIT: version 2.88 booting
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run.
EXT4-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
bootlogd: cannot allocate pseudo tty: No such file or directory
Creating /dev/flash/* device nodes
random: dd urandom read with 34 bits of entropy available
Starting internet superserver: inetd.
INIT: Entering runlevel: 5
Configuring network interfaces... udhcpc (v1.23.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
Starting Dropbear SSH server: Generating key, this may take a while...
Public key portion is:
Fingerprint: md5 99:c0:13:a2:be:86:a0:d1:15:20:de:b4:00:da:1e:ac
Starting tcf-agent: OK

sh-4.3# cd /mnt
sh-4.3# ls
BOOT.BIN            devicetree.dtb      uImage
_sds                devicetree.dts      uramdisk.image.gz
sh-4.3# more devicetree.dts

/ {
        #address-cells = <0x1>;
        #size-cells = <0x1>;
        compatible = "xlnx,zynq-zc702", "xlnx,zynq-7000";
        model = "Zynq ZC702 Development Board";

        chosen {
                bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0";
                linux,stdout-path = "/amba/serial@e0001000";
                stdout-path = "/amba/serial@e0001000";

        aliases {
                ethernet0 = "/amba/ethernet@e000b000";
                i2c0 = "/amba/i2c@e0004000";
                serial0 = "/amba/serial@e0001000";
                spi0 = "/amba/spi@e000d000";

        memory {
                device_type = "memory";
                reg = <0x0 0x40000000>;

        cpus {
                #address-cells = <0x1>;
                #size-cells = <0x0>;

                cpu@0 {
                        compatible = "arm,cortex-a9";
                        device_type = "cpu";
                        reg = <0x0>;
                        clocks = <0x1 0x3>;
                        clock-latency = <0x3e8>;
                        cpu0-supply = <0x2>;
                        operating-points = <0xa2c2b 0xf4240 0x51616 0xf4240>;

                cpu@1 {
                        compatible = "arm,cortex-a9";
                        device_type = "cpu";
                        reg = <0x1>;
                        clocks = <0x1 0x3>;

        pmu {

sh-4.3# pwd
sh-4.3# ls *release*
sh-4.3# more lsb-release



0 Kudos
2 Replies
Registered: ‎11-22-2015


Did you modify your ramdisk to mount the SD card as /root?   I haven't done this but I'm guessing you have to mount the SD and there is a command to switch /root.   Sorry, I can't provide any details.



0 Kudos
Registered: ‎05-20-2016

Thanks jeffdaq! It is a bit baffling that initramfs should be modified to do the switch_root. Then, what's the point of the bootargs in the devicetree.dtb or even in uEnv.txt?


I found a workaround that consist in stopping the u-boot and remove the ramdisk parameter of the bootm command:



Hit any key to stop autoboot:  0
zynq-uboot> fatload mmc 0 0x3000000 uImage
reading uImage
3613824 bytes read in 344 ms (10 MiB/s)
zynq-uboot> fatload mmc 0 0x2A00000 devicetree.dtb
reading devicetree.dtb
10873 bytes read in 15 ms (707 KiB/s)
zynq-uboot> bootm 0x3000000 - 0x2A00000


But I'm not totally happy with this botch. 



Here ( it is sketched how to modify the initramfs to do the switch_root, but still, I wonder why the initramfs used by SDSoC is not able to do the right thing and honor the bootargs.


Thanks once again.

0 Kudos