06-19-2017 11:54 AM
Hi,
I am new to PetaLinux and this level of detail for installing a Linux distribution. I am trying to install PetaLinux on a MicroZed 7010 in the QSPI flash memory. Using the initramfs file system, I am able to have PetaLinux boot from the QSPI, but it seems to be booting into RAM so any changes I make to the files are not persistent through a reboot. I have also tried a PetaLinux build using the JFFS2 file system, but that ended up being too large to fit onto the 16MB QSPI.
Is there a way to build PetaLinux with a file system that will write back to flash? Perhaps one with a mountable file system that isn't incorporated into the image.ub and a way to add a boot script that will automatically mount it?
The initramfs build of PetaLinux is based off the PetaLinux 2016.2 compressed BSP, z7010 found at http://zedboard.org/support/design/1519/10 and using the 2016.2 PetaLinux SDK tools. The /var/log/dmesg file goes as follows:
Booting Linux on physical CPU 0x0 Linux version 4.4.0-xilinx (mwaibel@se005040) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #4 SMP PREEMPT Fri Jun 16 09:49:14 MDT 2017 CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache Machine model: mz_7010_2016_2 bootconsole [earlycon0] enabled cma: Reserved 16 MiB at 0x3f000000 Memory policy: Data cache writealloc On node 0 totalpages: 262144 free_area_init_node: node 0, pgdat c0c4dcc0, node_mem_map ef7f7000 Normal zone: 1536 pages used for memmap Normal zone: 0 pages reserved Normal zone: 196608 pages, LIFO batch:31 HighMem zone: 65536 pages, LIFO batch:15 PERCPU: Embedded 12 pages/cpu @ef7d3000 s19264 r8192 d21696 u49152 pcpu-alloc: s19264 r8192 d21696 u49152 alloc=12*4096 pcpu-alloc: [0] 0 [0] 1 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260608 Kernel command line: console=ttyPS0,115200 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: 1010208K/1048576K available (4860K kernel code, 218K rwdata, 1784K rodata, 5704K init, 213K bss, 21984K reserved, 16384K cma-reserved, 245760K highmem) 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 - 0xc068552c (6646 kB) .init : 0xc0686000 - 0xc0c18000 (5704 kB) .data : 0xc0c18000 - 0xc0c4ea20 ( 219 kB) .bss : 0xc0c4ea20 - 0xc0c8407c ( 214 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_ns: 440795209040 ns 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: 19112604462750000 ns 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 zynq-pinctrl 700.pinctrl: zynq pinctrl initialized 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 <giometti@linux.it> 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. PCI: CLS 0 bytes, default 64 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 = 143, base_baud = 3125000) is a xuartps console [ttyPS0] enabled bootconsole [earlycon0] disabled xdevcfg f8007000.devcfg: ioremap 0xf8007000 to f0874000 [drm] Initialized drm 1.1.0 20060810 brd: module loaded loop: module loaded m25p80 spi0.0: found s25fl128s, expected n25q128a13 m25p80 spi0.0: s25fl128s (16384 Kbytes) 4 ofpart partitions found on MTD device spi0.0 Creating 4 MTD partitions on "spi0.0": 0x000000000000-0x000000620000 : "boot" 0x000000620000-0x000000640000 : "bootenv" 0x000000640000-0x000000fa0000 : "kernel" 0x000000fa0000-0x000001000000 : "spare" CAN device driver interface libphy: MACB_mii_bus: probed macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:1e:53) macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.eth 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 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: 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 NET: Registered protocol family 17 can: controller area network core (rev 20120528 abi 9) NET: Registered protocol family 29 can: raw protocol (rev 20120528) can: broadcast manager protocol (rev 20120528 t) can: netlink gateway (rev 20130117) max_hops=1 Registering SWP/SWPB emulation handler hctosys: unable to open rtc device (rtc0) ALSA device list: No soundcards found. Freeing unused kernel memory: 5704K (c0686000 - c0c18000) random: dd urandom read with 0 bits of entropy available
Thank you in advanced,
mwaibel
06-22-2017 10:28 AM
So after trying to minimize the file system size as much as possible, it looks like it won't fit on the QSPI. I've decided to have it boot from the QSPI, but look for the file system on an external SD card. I just put the BOOT.BIN and image.ub files in partitions on the QSPI as documented on page 19 here and create the file system on the SD card as documented on page 47 here.
Just make sure that the build is configured to find the file system on the correct partition of the SD card.
This is also convenient, since the entire file system can be removed and put into a different computer if you need to make any changes with tools that are not on the MicroZed.
- mwaibel
06-22-2017 10:28 AM
So after trying to minimize the file system size as much as possible, it looks like it won't fit on the QSPI. I've decided to have it boot from the QSPI, but look for the file system on an external SD card. I just put the BOOT.BIN and image.ub files in partitions on the QSPI as documented on page 19 here and create the file system on the SD card as documented on page 47 here.
Just make sure that the build is configured to find the file system on the correct partition of the SD card.
This is also convenient, since the entire file system can be removed and put into a different computer if you need to make any changes with tools that are not on the MicroZed.
- mwaibel