cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
9,412 Views
Registered: ‎03-13-2013

Need bigger ramdisk (32MB) on ZC702

Jump to solution

Greetings,

 

I was able to bring up Linux with an 8MB rootfs (ramdisk). But after sticking several binaries into it, the size grew beyond 8MB. So I created a 32MB ramdisk, compressed it and used mkimage to generate uramdisk.image.gz. U-boot reads the uramdisk.image.gz file from the SD card correctly but Linux kernel fails to mount it. Where is the 8MB size for rootfs hardwired? In other words, what do I need to change for 32MB (or 64MB in future) ramdisk?

 

I am using latest Linux and U-boot from Xilinx Git repos.

 

Boot logs follow:

 

U-Boot 2012.10-dirty (Mar 03 2013 - 19:24:41)

DRAM:  1 GiB
WARNING: Caches not enabled
MMC:   SDHCI: 0
SF: Detected N25Q128A with page size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   zynq_gem
Hit any key to stop autoboot:  3  2  1  0 
Copying Linux from SD to RAM...
Device: SDHCI
Manufacturer ID: 3
OEM: 5344
Name: SD02G 
Tran Speed: 25000000
Rd Block Len: 512
SD version 1.10
High Capacity: No
Capacity: 1.9 GiB
Bus Width: 4-bit
reading uImage

2881832 bytes read
reading devicetree.dtb

5204 bytes read
reading uramdisk.image.gz

9353340 bytes read
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-3.6.0-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2881768 Bytes = 2.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02000000 ...
   Image Name:   
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9353276 Bytes = 8.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x02a00000
   Loading Kernel Image ... OK
OK
   Loading Ramdisk to 1f714000, end 1ffff83c ... OK
   Loading Device Tree to 1f70f000, end 1f713453 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0

Linux version 3.6.0-xilinx (somnath@sm-xckt) (gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-79) ) #1 SMP PREEMPT Sun Mar 3 02:46:34 PST 2013
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZC702
bootconsole [earlycon0] enabled
cma: CMA: reserved 16 MiB at 2e800000
Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 7 pages/cpu @c0d88000 s7488 r8192 d12992 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: console=ttyPS0,115200 root=/dev/ram rw ip=:::::eth0:dhcp 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: 1024MB = 1024MB total
Memory: 1008268k/1008268k available, 40308k reserved, 270336K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc04e5ccc   (4984 kB)
      .init : 0xc04e6000 - 0xc050cd40   ( 156 kB)
      .data : 0xc050e000 - 0xc0554800   ( 282 kB)
       .bss : 0xc0554824 - 0xc057ea30   ( 169 kB)
Preemptible hierarchical RCU implementation.
	Dump stacks of tasks blocking RCU-preempt GP.
	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
NR_IRQS:512
Zynq clock init
xlnx,ps7-ttc-1.00.a #0 at 0xf0000000, irq=43
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
Setting up static identity map for 0x38bbc0 - 0x38bbf4
L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72360000, Cache size: 524288 B
Map SLCR registers
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
devtmpfs: initialized
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
xgpiops e000a000.gpio: gpio at 0xe000a000 mapped to 0xf0008000
registering platform device 'pl330' id 0
registering platform device 'arm-pmu' id 0
registering platform device 'zynq-dvfs' id 0
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
MIO pin 47 not assigned(00001220)
xslcr xslcr.0: at 0xF8000000 mapped to 0xF8000000
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource xttcpss_timer1
NET: Registered protocol family 2
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 7, 524288 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP: reno registered
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...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 9132K
pl330 dev 0 probe success
bounce pool size: 64 pages
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 1491
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
xuartps e0001000.uart: failed to get alias id, errno -19
e000ÿconsole [ttyPS0] enabled, bootconsole disabled
console [ttyPS0] enabled, bootconsole disabled
xdevcfg f8007000.devcfg: ioremap f8007000 to f005c000 with size 100
brd: module loaded
loop: module loaded
xqspips e000d000.spi: master is unqueued, this is deprecated
m25p80 spi1.0: found n25q128, expected n25q128
m25p80 spi1.0: n25q128 (16384 Kbytes)
5 ofpart partitions found on MTD device spi1.0
Creating 5 MTD partitions on "spi1.0":
0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
0x000000100000-0x000000600000 : "qspi-linux"
0x000000600000-0x000000620000 : "qspi-device-tree"
0x000000620000-0x000000c00000 : "qspi-rootfs"
0x000000c00000-0x000001000000 : "qspi-bitstream"
xqspips e000d000.spi: at 0xE000D000 mapped to 0xF005E000, irq=51
e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
libphy: XEMACPS mii bus: probed
xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 54
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ULPI transceiver vendor/product ID 0x0424/0x0007
Found SMSC USB3320 ULPI transceiver.
ULPI integrity check: passed.
xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller
xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1
xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000
xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
xi2cps e0004000.i2c: 100 kHz mmio e0004000 irq 57
i2c i2c-0: Added multiplexed i2c bus 1
si570 1-005d: registered si570 with default frequency 156250000 Hz
si570 1-005d: set initial output frequency 148500000 Hz
i2c i2c-0: Added multiplexed i2c bus 2
i2c i2c-0: Added multiplexed i2c bus 3
at24 3-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
i2c i2c-0: Added multiplexed i2c bus 4
i2c i2c-0: Added multiplexed i2c bus 5
rtc-pcf8563 5-0051: chip found, driver version 0.4.3
rtc-pcf8563 5-0051: low voltage detected, date/time is not reliable.
rtc-pcf8563 5-0051: retrieved date/time is not valid.
rtc-pcf8563 5-0051: rtc core: registered rtc-pcf8563 as rtc0
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
mpcore_wdt: MPcore Watchdog Timer: 0.1. mpcore_noboot=0 mpcore_margin=60 sec (nowayout= 0)
xwdtps f8005000.swdt: Xilinx Watchdog Timer at 0xf0066000 with timeout 10s
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: Invalid maximum block size, assuming 512 bytes
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
Registering SWP/SWPB emulation handler
rtc-pcf8563 5-0051: low voltage detected, date/time is not reliable.
rtc-pcf8563 5-0051: retrieved date/time is not valid.
rtc-pcf8563 5-0051: hctosys: invalid date/time
mmc0: new SD card at address e624
mmcblk0: mmc0:e624 SD02G 1.89 GiB 
 mmcblk0: p1
Sending DHCP requests .xemacps e000b000.eth: Set clk to 124999998 Hz
xemacps e000b000.eth: link up (1000/FULL)
., OK
IP-Config: Got DHCP answer from 0.0.0.0, my address is 192.168.1.101
IP-Config: Complete:
     device=eth0, addr=192.168.1.101, mask=255.255.255.0, gw=192.168.1.1
     host=192.168.1.101, domain=, nis-domain=(none)
     bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=
RAMDISK: gzip image found at block 0
RAMDISK: incomplete write (2293 != 32768)
write error
VFS: Mounted root (ext2 filesystem) on device 1:0.
devtmpfs: mounted
Freeing init memory: 152K
EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=4097, block=16387
EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=6145, block=24708
EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=4097, block=16387
EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=4097, block=16387
Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
CPU0: stopping
[<c0013fdc>] (unwind_backtrace+0x0/0x11c) from [<c0012e14>] (ipi_cpu_stop+0x3c/0x68)
[<c0012e14>] (ipi_cpu_stop+0x3c/0x68) from [<c0013194>] (handle_IPI+0x68/0xb4)
[<c0013194>] (handle_IPI+0x68/0xb4) from [<c00084a0>] (gic_handle_irq+0x54/0x5c)
[<c00084a0>] (gic_handle_irq+0x54/0x5c) from [<c000dc80>] (__irq_svc+0x40/0x70)
Exception stack(0xc050ff70 to 0xc050ffb8)
ff60:                                     c050e000 c000ebac c050ffc0 00000000
ff80: c0526d40 00000000 ffffffff c0504f24 c0d85dc0 413fc090 00000000 00000000
ffa0: 00000000 c050ffb8 c000ebcc c000ebd0 60000013 ffffffff
[<c000dc80>] (__irq_svc+0x40/0x70) from [<c000ebd0>] (default_idle+0x24/0x2c)
[<c000ebd0>] (default_idle+0x24/0x2c) from [<c000edd0>] (cpu_idle+0xa0/0xfc)
[<c000edd0>] (cpu_idle+0xa0/0xfc) from [<c04e6788>] (start_kernel+0x2a0/0x2f0)

 Thanks.

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
12,231 Views
Registered: ‎03-13-2013

Re: Need bigger ramdisk (32MB) on ZC702

Jump to solution

This needed an additional kernel boot parameter "ramdisk_size=32768" in the DTS file and a rebuild of devicetree.dtb.

 

Kernel boot logs below.

 

 

RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
devtmpfs: mounted
Freeing init memory: 152K
Starting rcS...
++ Mounting filesystem
++ Setting up mdev
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting dropbear (ssh) daemon
rcS Complete
/ #

 

View solution in original post

Tags (1)
4 Replies
Highlighted
Visitor
Visitor
12,232 Views
Registered: ‎03-13-2013

Re: Need bigger ramdisk (32MB) on ZC702

Jump to solution

This needed an additional kernel boot parameter "ramdisk_size=32768" in the DTS file and a rebuild of devicetree.dtb.

 

Kernel boot logs below.

 

 

RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
devtmpfs: mounted
Freeing init memory: 152K
Starting rcS...
++ Mounting filesystem
++ Setting up mdev
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting dropbear (ssh) daemon
rcS Complete
/ #

 

View solution in original post

Tags (1)
Highlighted
Visitor
Visitor
9,388 Views
Registered: ‎03-13-2013

Re: Need bigger ramdisk (32MB) on ZC702

Jump to solution

At some point the ramdisk compressed size will exceed 10MB. Then we shall hit the U-boot defaults. It will manifest in an error message about unable to flatten device tree blob or an invalid device tree blob. Resolution:

 

1. Edit u-boot-xlnx/include/configs/zynq_common.h.

2. Search for sdboot string which must be changed to:

	"sdboot=echo Copying Linux from SD to RAM...;" \
		"mmcinfo;" \
		"fatload mmc 0 0x3A00000 ${kernel_image};" \
		"fatload mmc 0 0x3900000 ${devicetree_image};" \
		"fatload mmc 0 0x2000000 ${ramdisk_image};" \
		"bootm 0x3A00000 0x2000000 0x3900000\0" \

 In the original code it was loading ramdisk at 0x2000000 and DTB at 0x2A00000. So there was only a 10MB gap. Once the ramdisk compressed file exceeded 10MB it overwrote the DTB copied before. I have moved them sufficiently apart but they may have to be moved again if your compressed ramdisk is more than 25MB.

 

3. Follow the steps to rebuild Xilinx U-boot . You will have to rebuild BOOT.bin from the resulting u-boot.

 

 

0 Kudos
Highlighted
Visitor
Visitor
8,911 Views
Registered: ‎07-29-2013

Re: Need bigger ramdisk (32MB) on ZC702

Jump to solution

Hello I have the following problem:

 

RAMDISK: gzip image found at block 0
RAMDISK: incomplete write (32406 != 32768)
write error
VFS: Mounted root (ext2 filesystem) on device 1:0.
devtmpfs: mounted
Freeing init memory: 164K
attempt to access beyond end of device
ram0: rw=0, want=117376, limit=117000
attempt to access beyond end of device
ram0: rw=0, want=117360, limit=117000
attempt to access beyond end of device
ram0: rw=0, want=117360, limit=117000
Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

 

My ramdisk_size is not a problem (0x8500000) and also BLK_DEV_RAM_SIZE is bigged then the image size.

Can you guys point me to the right direction.

 

 

Thank you,

Alexandru

0 Kudos
Highlighted
Participant
Participant
3,921 Views
Registered: ‎11-09-2015

Re: Need bigger ramdisk (32MB) on ZC702

Jump to solution

I am experiencing the same problem...

 

RAMDISK: incomplete write (32168 != 32768)

 

How did you resolve this issue?

0 Kudos