cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
npetrellis
Visitor
Visitor
1,252 Views
Registered: ‎07-15-2020

Acceleration with Zedboard (Vitis+XRT+Petalinux)

Hello to everybody,

I work with Xilinx products the last 2 months and I try to make the Zedboard board capable of supporting acceleration with Petalinux OS support.

I mainly follow the instructions from [1]:

https://www.hackster.io/news/microzed-chronicles-microzed-zynq-7000-vitis-platform-creation-df25e1054fb6

but there are some points that are wrong (besides the naming errors: refer to different boards, processors)

I tried to combine the information above that is targeted fro Zynq7000 with information from the following sites: [2]

https://www.hackster.io/anujvaishnav20/building-custom-sdsoc-platform-with-petalinux-268bfd

and of course from the official Xilinx site [3]:

https://www.xilinx.com/html_docs/xilinx2019_2/vitis_doc/Chunk373975992.html#vzc1570652705957

knowing that the last two sites refer to different boards and zynq members.

One of the main incompatibilities with [1] is that in petalinux-config -c kernel menus I could not find a way to change CMA allocation to 256M as suggested. I do not know how necessary it is I skipped this step.

I have finished the creation of xsa, petalinux, platform project and created successfully an application for vector add. I tried either to boot from SD card creating a BOOT.BIN + image.ub or from JTAG loading remotely zynq_fsbl.elf, u-boot.elf and image.ub

In both cases

SD-card from U-Boot prompt:

Zynq> fatload mmc 0 0x1000000 image.ub
Zynq> bootm 0x1000000
 
and from JTAG following ug1165 pages 68-73 (XSCT commands dow, con, stop)
bootm 0x30000000
 
I get the same OS kernel panic. The last messages I get in the are the ones attached below.
My questions:
- Is there a reliable manual or tutorial describing the exact steps for Zeboard+Linux+XRT acceleration?
- Is there any idea what causes the OS image to crash? is it connected to the fact that I was not able to extend CMA to 256MB? I know that Zedboard has 512MB but I do not understand yet how can I handle this memory
 
Thank you
 
Last messages from bootm 0x30000000:

[ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
Out of memory and no killable processes...
Kernel panic - not syncing: System is deadlocked on memory
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-xilinx-v2020.1 #1
Hardware name: Xilinx Zynq Platform
[<c010e18c>] (unwind_backtrace) from [<c010a124>] (show_stack+0x10/0x14)
[<c010a124>] (show_stack) from [<c069c5a8>] (dump_stack+0xb4/0xd0)
[<c069c5a8>] (dump_stack) from [<c010c924>] (ipi_cpu_stop+0x3c/0x98)
[<c010c924>] (ipi_cpu_stop) from [<c010cfc0>] (handle_IPI+0x64/0x80)
[<c010cfc0>] (handle_IPI) from [<c033e65c>] (gic_handle_irq+0x84/0x90)
[<c033e65c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xc0a01f40 to 0xc0a01f88)
1f40: 00003824 deb4e534 00000000 c01162e0 00000001 c0a00000 c0a03c68 c0a03ca8
1f60: c0a35980 00000001 c092da40 00000000 fffffff8 c0a01f90 c0107838 c0107828
1f80: 60000013 ffffffff
[<c0101a8c>] (__irq_svc) from [<c0107828>] (arch_cpu_idle+0x1c/0x38)
[<c0107828>] (arch_cpu_idle) from [<c013fd5c>] (do_idle+0xd4/0xf8)
[<c013fd5c>] (do_idle) from [<c013fed4>] (cpu_startup_entry+0x18/0x1c)
[<c013fed4>] (cpu_startup_entry) from [<c0900cb8>] (start_kernel+0x3a0/0x440)
[<c0900cb8>] (start_kernel) from [<00000000>] (0x0)
---[ end Kernel panic - not syncing: System is deadlocked on memory ]---

 

 
Tags (1)
0 Kudos
14 Replies
bartokon
Explorer
Explorer
1,206 Views
Registered: ‎09-17-2018

You are using SD-Card boot method?

I think your problem is petalinux boot configuration.

You could use gparted and format your SD-Card like this:

Screenshot from 2020-07-16 15-07-31.png

Set all your boot options to sd-card except .dtb file. And rootfs location to second partition of sdcard.

Try to boot your clean system without changes first

 

 

0 Kudos
npetrellis
Visitor
Visitor
1,188 Views
Registered: ‎07-15-2020

Thank you bartokon for your comment.

I think there is no problem with the SD card since the partitions are OK (I used fdisk to make these partitions). However the same problem appears when I try to download the OS image through JTAG so I prefer after petalinux instructions to download through XSCT and operate a serial Screen terminal in parallel. I get exactly the same results if I try to boot through JTAG or through U-Boot from the SD Card.

I tried to follow you suggestion to try a "clean" compilation prior to any modifications. Thus I followed the instructions on making EMBEDDED and ACCELERATED Zynq platforms described in

https://www.xilinx.com/html_docs/xilinx2019_2/vitis_doc/Chunk373975992.html#wxe1570652701297

The Embedded works fine (I do not make Vitis platform and application,I just download the image after petalinux-build and sdk.sh. WHen I download this image through JTAG Linux boots and I get a prompt to login

However when I follow the Accelerated Apps flow I get again panic. The problem is that in this case the document above describes different board and processor than Zedboard that I target, so I try to combine information from the document above and the following one that describes Zedboard:

https://www.hackster.io/news/microzed-chronicles-microzed-zynq-7000-vitis-platform-creation-df25e1054fb6

This means that I do something wrong probably in the blocks I add and the configuration I do in Vivado or something is missing in the configuration of Petalinux. I do not proceed to the Vitis platform and application since initially I just want to check that Linux boots I do not want to run an application right now. I anyway have tested the full flow with platform and application defined but the problem is the same. Linux does not boot and I get the screenshot with the "panic" messages in the attached document.

I attach the log of my actions in both Embedded and Acceleration flow

Any help is very much welcome

0 Kudos
evatrostaz
Participant
Participant
1,174 Views
Registered: ‎07-13-2020

If you want extend CMA to 256 MiB go to

<proj_path>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

and paste this code

reserved-memory {
      #address-cells = <1>;
      #size-cells = <1>;
      ranges;
  
      reserved: buffer@0 {
         compatible = "shared-dma-pool";
         reusable;
         reg = <0x38000000 0x10000000>;
         linux,cma-default;
      };
   };

Make sure you have enabled CMA in your petalinux-config -c kernel

Tags (1)
0 Kudos
npetrellis
Visitor
Visitor
1,139 Views
Registered: ‎07-15-2020

Thank you @evatrostaz

A few days ago I had also tested a similar declaration of reserved memory in system-user.dtsi file:

reserved-memory {
      #address-cells = <2>;
      #size-cells = <2>;
      ranges;
 
      reserved: buffer@0 {
         compatible = "shared-dma-pool";
         reusable;
         reg = <0x0 0x70000000 0x0 0x10000000>;
         linux,cma-default;
      };
   };

As I see the addresses I had used was probably arbitrary from the site I found this example.

Your addresses (0x38000000) and the single address cell you declare seem to make more sense. However I still get the same panic messages. I attach the exact actions of my last try.

I will try to use a different serial console that has scroll bar so that I can record the previous error messages that may show us what's wrong

 

0 Kudos
npetrellis
Visitor
Visitor
1,135 Views
Registered: ‎07-15-2020

I used as a serial console minicom and grabbed all error messages. The errors seem to be related with paging in the CMA reserved area:

8<--- cut here ---

Unable to handle kernel paging request at virtual address e0358000

pgd = (ptrval)

[e0358000] *pgd=00000000

Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM

Modules linked in:

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-xilinx-v2020.1 #1

Hardware name: Xilinx Zynq Platform

PC is at cma_init_reserved_areas+0x98/0x178

LR is at 0xc0a453c4

pc : [<c09120b8>] lr : [<c0a453c4>] psr: 60000013

sp : df443ed0 ip : 00000001 fp : c0a45340

r10: c0a46214 r9 : c0a46214 r8 : 00000380

r7 : 00000024 r6 : 00000000 r5 : 00038000 r4 : 00000040

r3 : c0a06f04 r2 : 007e0000 r1 : dfb78000 r0 : 00000000

Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none

Control: 18c5387d Table: 0000404a DAC: 00000051

Process swapper/0 (pid: 1, stack limit = 0x(ptrval))

Stack: (0xdf443ed0 to 0xdf444000)

3ec0: 00000000 00000000 0000026e c0a35800

3ee0: ffffe000 c0a35800 ffffe000 c0912020 00000000 000000db c0a35800 c09004a4

3f00: c0936e18 c0102668 c0823941 c013505c 00000000 c0900400 c08c7858 000000db

3f20: 00000001 00000001 00000000 c08c8974 000000da c08c8974 c092d818 dfffee6e

3f40: 00000000 c0a03c48 c09004a4 00000002 c0a35800 c0a03c48 c092d83c 00000002

3f60: c0a35800 c092d820 c092d840 c0900f4c 00000001 00000001 00000000 c09004a4

3f80: 00000000 00000000 c06ad0a0 00000000 00000000 00000000 00000000 00000000

3fa0: 00000000 c06ad0a8 00000000 c01010e8 00000000 00000000 00000000 00000000

3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000

[<c09120b8>] (cma_init_reserved_areas) from [<c0102668>] (do_one_initcall+0x74/)

[<c0102668>] (do_one_initcall) from [<c0900f4c>] (kernel_init_freeable+0x1f4/0x)

[<c0900f4c>] (kernel_init_freeable) from [<c06ad0a8>] (kernel_init+0x8/0x10c)

[<c06ad0a8>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)

Exception stack(0xdf443fb0 to 0xdf443ff8)

3fa0: 00000000 00000000 00000000 00000000

3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

3fe0: 00000000 00000000 00000000 00000000 00000013 00000000

Code: e1a04524 e5932000 e0452002 e0020297 (e7912002)

---[ end trace 3faf1af885c09f31 ]---

Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

CPU1: stopping

CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 5.4.0-xilinx-v2020.1 1

Hardware name: Xilinx Zynq Platform

[<c010e18c>] (unwind_backtrace) from [<c010a124>] (show_stack+0x10/0x14)

[<c010a124>] (show_stack) from [<c0699188>] (dump_stack+0xb4/0xd0)

[<c0699188>] (dump_stack) from [<c010c924>] (ipi_cpu_stop+0x3c/0x98)

[<c010c924>] (ipi_cpu_stop) from [<c010cfc0>] (handle_IPI+0x64/0x80)

[<c010cfc0>] (handle_IPI) from [<c033e65c>] (gic_handle_irq+0x84/0x90)

[<c033e65c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8)

Exception stack(0xdf481f80 to 0xdf481fc8)

1f80: 00000110 dfb64534 00000000 c01162e0 00000002 df480000 c0a03c68 c0a03ca8

1fa0: 0000406a 413fc090 00000000 00000000 ffffffe8 df481fd0 c0107838 c0107828

1fc0: 60000013 ffffffff

[<c0101a8c>] (__irq_svc) from [<c0107828>] (arch_cpu_idle+0x1c/0x38)

[<c0107828>] (arch_cpu_idle) from [<c013fd5c>] (do_idle+0xd4/0xf8)

[<c013fd5c>] (do_idle) from [<c013fed4>] (cpu_startup_entry+0x18/0x1c)

[<c013fed4>] (cpu_startup_entry) from [<0010242c>] (0x10242c)

---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000-

0 Kudos
npetrellis
Visitor
Visitor
1,128 Views
Registered: ‎07-15-2020

The full messages I get before kernel panic, can be found at the end of the attached log file

0 Kudos
bartokon
Explorer
Explorer
1,123 Views
Registered: ‎09-17-2018

Could you show Petalinux-config and all boot steps?

For example where is Boot.bin, image, uboot etc.

0 Kudos
npetrellis
Visitor
Visitor
1,050 Views
Registered: ‎07-15-2020

Hi @bartokon 

I attach a file showing exactly which things I modified from the defaults in petalinux-config and how do I boot from JTAG. I do not generate a BOOT.BIN since I do not use SD card, I find the rest of the files in image/linux directory.

What I notices is that when I both defined MACHINE name Zedboard and changed boot arguments from being auto generated to:

earlycon clk_ignore_unused root=/dev/ram rw

 then there appears an error during petalinux-build

So I preffered not to define a MACHINE NAME and only change boot arguments as above.

When the time comes to bootm 0x30000000 from the serial console (its name is /dev/ttyACM0) the kernel stops at the point where the following messages appear (see the attached for details):

printk: console [tty0] enabled

printk: bootconsole [cdns0] disabled

I compared the messages from an image for Embedded (not accelerated) project and all the first messages are the same except the following:

Kernel command line: earlycon clk_ignore_unused root=/dev/ram rw (in the accelerrated)

Kernel command line: console=ttyPS0,115200 earlycon root=/dev/ram0 rw (in the embedded)

 

Is it possible that the manual boot arguments need to be extended as in the case of the embedded as above?

is it possible that the control is given to a different terminal (tty0) and the messages are sent there instead of the console I monitor (ttyACM0)??

 

 

0 Kudos
npetrellis
Visitor
Visitor
1,036 Views
Registered: ‎07-15-2020

As a follow up of the  situation explained in my previous post:

I extended the boot arguments in petalinux-config to:

earlycon clk_ignore_unused console=ttyACM0,115200 root=/dev/ram0 rw

I did add console=ttyACM0,115200 because I wanted to declare the exact serial port used for debugging and not some generic names that may not correspond to the port I expect.

Now the boot process goes a little further (it does not stop after "printk: bootconsole [cdns0] disabled")

and I get the following messages that I used to get in previous configurations and show that something is wrong with the memory mapping or paging (see the messages in bold below):

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 5.4.0-xilinx-v2020.1 (oe-user@oe-host) (gcc version 9.2.0 (GCC)) 0
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: xlnx,zynq-7000
earlycon: cdns0 at MMIO 0xe0001000 (options '115200n8')
printk: bootconsole [cdns0] enabled
Memory policy: Data cache writealloc
Reserved memory: created CMA memory pool at 0x38000000, size 256 MiB
OF: reserved mem: initialized node buffer@0, compatible id shared-dma-pool
percpu: Embedded 15 pages/cpu s30860 r8192 d22388 u61440
Built 1 zonelists, mobility grouping on. Total pages: 129920
Kernel command line: earlycon clk_ignore_unused console=ttyACM0,115200 root=/dew
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 386816K/524288K available (6144K kernel code, 214K rwdata, 1832K rodata)
rcu: Preemptible hierarchical RCU implementation.
rcu: RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to (ptrval)
slcr mapped to (ptrval)
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
random: get_random_bytes called from start_kernel+0x260/0x440 with crng_init=0
zynq_clock_init: clkc starts at (ptrval)
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af02s
Switching to timer-based delay loop, resolution 3ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (1333.33 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: 191s
futex hash table entries: 512 (order: 3, 32768 bytes, linear)
8<--- cut here ---
Unable to handle kernel paging request at virtual address e0358000
pgd = (ptrval)
[e0358000] *pgd=00000000
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-xilinx-v2020.1 #1
Hardware name: Xilinx Zynq Platform
PC is at cma_init_reserved_areas+0x98/0x178
LR is at 0xc0a45544
pc : [<c09120b8>] lr : [<c0a45544>] psr: 60000013
sp : df443ed0 ip : 00000001 fp : c0a454c0
r10: c0a46394 r9 : c0a46394 r8 : 00000380
r7 : 00000024 r6 : 00000000 r5 : 00038000 r4 : 00000040
r3 : c0a06f04 r2 : 007e0000 r1 : dfb78000 r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
Control: 18c5387d Table: 0000404a DAC: 00000051
Process swapper/0 (pid: 1, stack limit = 0x(ptrval))
Stack: (0xdf443ed0 to 0xdf444000)
3ec0: 00000000 00000000 0000026d c0a35980
3ee0: ffffe000 c0a35980 ffffe000 c0912020 00000000 000000db c0a35980 c09004a4
3f00: c0936e18 c0102668 c0824341 c013505c 00000000 c0900400 c08c8d58 000000db
3f20: 00000001 00000001 00000000 c08c9e74 000000da c08c9e74 c092d818 dfffee41
3f40: 00000000 c0a03c48 c09004a4 00000002 c0a35980 c0a03c48 c092d83c 00000002
3f60: c0a35980 c092d820 c092d840 c0900f4c 00000001 00000001 00000000 c09004a4
3f80: 00000000 00000000 c06b04c0 00000000 00000000 00000000 00000000 00000000
3fa0: 00000000 c06b04c8 00000000 c01010e8 00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[<c09120b8>] (cma_init_reserved_areas) from [<c0102668>] (do_one_initcall+0x74/)
[<c0102668>] (do_one_initcall) from [<c0900f4c>] (kernel_init_freeable+0x1f4/0x)
[<c0900f4c>] (kernel_init_freeable) from [<c06b04c8>] (kernel_init+0x8/0x10c)
[<c06b04c8>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xdf443fb0 to 0xdf443ff8)
3fa0: 00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Code: e1a04524 e5932000 e0452002 e0020297 (e7912002)
---[ end trace 0b4a4de9e38fde5a ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 5.4.0-xilinx-v2020.1 1
Hardware name: Xilinx Zynq Platform
[<c010e18c>] (unwind_backtrace) from [<c010a124>] (show_stack+0x10/0x14)
[<c010a124>] (show_stack) from [<c069c5a8>] (dump_stack+0xb4/0xd0)
[<c069c5a8>] (dump_stack) from [<c010c924>] (ipi_cpu_stop+0x3c/0x98)
[<c010c924>] (ipi_cpu_stop) from [<c010cfc0>] (handle_IPI+0x64/0x80)
[<c010cfc0>] (handle_IPI) from [<c033e65c>] (gic_handle_irq+0x84/0x90)
[<c033e65c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xdf481f80 to 0xdf481fc8)
1f80: 00000110 dfb65534 00000000 c01162e0 00000002 df480000 c0a03c68 c0a03ca8
1fa0: 0000406a 413fc090 00000000 00000000 ffffffe8 df481fd0 c0107838 c0107828
1fc0: 60000013 ffffffff
[<c0101a8c>] (__irq_svc) from [<c0107828>] (arch_cpu_idle+0x1c/0x38)
[<c0107828>] (arch_cpu_idle) from [<c013fd5c>] (do_idle+0xd4/0xf8)
[<c013fd5c>] (do_idle) from [<c013fed4>] (cpu_startup_entry+0x18/0x1c)
[<c013fed4>] (cpu_startup_entry) from [<0010242c>] (0x10242c)
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000-

 

0 Kudos
npetrellis
Visitor
Visitor
1,003 Views
Registered: ‎07-15-2020

Additional information:

I focus on two points from comparing the Kernel boot messages of the accelerated platform I want to develop and the embedded that I use as reference:

1) The paging error in the messages above is at address e0358000:

Error message: "Unable to handle kernel paging request at virtual address e0358000"

 

from the reference image I get the messages:

e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 24, base_baud = 3125000) is as

printk: console [ttyPS0] enabled

printk: console [ttyPS0] enabled

printk: bootconsole [cdns0] disabled

printk: bootconsole [cdns0] disabled

 

which means that address e0358000 may be related to serial port. I will try to use ttyPS0 instead of ttyACM0 just in case the serial port definition is wrong

 

2) The default allocation for CMA in the reference Embedded image.ub is:

cma: Reserved 16 MiB at 0x1f000000

..

DMA: preallocated 256 KiB pool for atomic coherent allocations

 

Following the suggestion of @evatrostaz I allocated a pool of 256MB at 38000000, see the message:

Reserved memory: created CMA memory pool at 0x38000000, size 256 MiB

 

Is this memory area available? Can anybody tell me how to figure out what are the available addresses for CMA? I guess one way to find out is in the Address tab in Vivado, or is there any other way to get the overall memory map?

0 Kudos
bartokon
Explorer
Explorer
996 Views
Registered: ‎09-17-2018

There could be two problems.
One rootfs is 80MB> and won't boot as initram.
Second u-boot can't read image.ub, so first try "petalinux-boot --jtag --kernel" and check where image.ub is located in petalinux-config.
0 Kudos
npetrellis
Visitor
Visitor
991 Views
Registered: ‎07-15-2020

Thank you very much @bartokon 

I will focus on the problems you mention

Here are the sizes of the files generated by petalinux-build:

 

npetrellis@npetrellis-OptiPlex-3070:~/workspace/zedboard_pkg/petalinux/images/linux$ ls -l
total 1646088
-rw-r--r-- 1 npetrellis npetrellis 2010 Jul 18 13:20 boot.scr
-rw-r--r-- 1 npetrellis npetrellis 129339876 Jul 19 10:19 image.ub
drwxr-xr-x 2 npetrellis npetrellis 4096 Jul 18 13:20 pxelinux.cfg
-rw-r--r-- 1 npetrellis npetrellis 461152256 Jul 19 10:18 rootfs.cpio
-rw-r--r-- 1 npetrellis npetrellis 125012438 Jul 19 10:18 rootfs.cpio.gz
-rw-r--r-- 1 npetrellis npetrellis 125012502 Jul 19 10:18 rootfs.cpio.gz.u-boot
-rw-r--r-- 1 npetrellis npetrellis 190054400 Jul 19 10:18 rootfs.jffs2
-rw-r--r-- 1 npetrellis npetrellis 36674 Jul 19 10:18 rootfs.manifest
-rw-r--r-- 1 npetrellis npetrellis 125586863 Jul 19 10:18 rootfs.tar.gz
-rwxr-xr-x 1 npetrellis npetrellis 502009888 Jul 18 19:15 sdk.sh
-rw-r--r-- 1 npetrellis npetrellis 4045676 Jul 18 11:55 system.bit
-rw-r--r-- 1 npetrellis npetrellis 19175 Jul 19 10:16 system.dtb
-rw-r--r-- 1 npetrellis npetrellis 735195 Jul 19 10:16 u-boot.bin
-rw-r--r-- 1 npetrellis npetrellis 801156 Jul 19 10:16 u-boot.elf
-rw-r--r-- 1 npetrellis npetrellis 4306224 Jul 19 10:19 uImage
-rw-r--r-- 1 npetrellis npetrellis 3169 Jul 19 01:58 vitis_pid2454.str
-rw-r--r-- 1 npetrellis npetrellis 2944 Jul 18 19:40 vitis_pid30282.str
-rw-r--r-- 1 npetrellis npetrellis 12569564 Jul 19 10:19 vmlinux
-rw-r--r-- 1 npetrellis npetrellis 1183 Jul 19 01:58 xrc.log
-rw-r--r-- 1 npetrellis npetrellis 4306160 Jul 19 10:19 zImage
-rw-r--r-- 1 npetrellis npetrellis 550096 Jul 18 13:24 zynq_fsbl.elf

0 Kudos
npetrellis
Visitor
Visitor
939 Views
Registered: ‎07-15-2020

Hi @bartokon 

First of all it was certainly wrong to reserve CMA memory of size 256M starting from 0x38000000 with size 0x10000000 because it exceeds 0x40000000 which is the limit for DRAM. I tried to move it to 0x30000000 but I also got there paging errors.

I removed the reserved memory allocation for CMA and left the default 16MiB. In this configuration I do not get paging errors anymore and the boot proceeds up to the point where it tries to unpack rootfs in initram. Indeed it seems that the rootfs is too big to be loaded in initram as you can see by the messages that follow this attempt.

The question is how can I load rootfs? is there another way to load it? I tried to boot from zImage which I guess that it is the pure kernel but it stopped saying the it cannot find the device tree, etc.

Log:

...

Trying to unpack rootfs image as initramfs...
swapper/0 invoked oom-killer: gfp_mask=0x100cc2(GFP_HIGHUSER), order=0, oom_sco0
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-xilinx-v2020.1 #1
Hardware name: Xilinx Zynq Platform
[<c010e18c>] (unwind_backtrace) from [<c010a124>] (show_stack+0x10/0x14)
[<c010a124>] (show_stack) from [<c069c5a8>] (dump_stack+0xb4/0xd0)
[<c069c5a8>] (dump_stack) from [<c01b07a8>] (dump_header+0x64/0x20c)
[<c01b07a8>] (dump_header) from [<c01b05d4>] (out_of_memory+0x214/0x304)
[<c01b05d4>] (out_of_memory) from [<c01e087c>] (__alloc_pages_nodemask+0x7b4/0x)
[<c01e087c>] (__alloc_pages_nodemask) from [<c01ad09c>] (pagecache_get_page+0xe)
[<c01ad09c>] (pagecache_get_page) from [<c01ad124>] (grab_cache_page_write_begi)
[<c01ad124>] (grab_cache_page_write_begin) from [<c021e76c>] (simple_write_begi)
[<c021e76c>] (simple_write_begin) from [<c01abf18>] (generic_perform_write+0xac)
[<c01abf18>] (generic_perform_write) from [<c01ae548>] (__generic_file_write_it)
[<c01ae548>] (__generic_file_write_iter) from [<c01ae5ac>] (generic_file_write_)
[<c01ae5ac>] (generic_file_write_iter) from [<c01fa1d0>] (__vfs_write+0xb0/0xe8)
[<c01fa1d0>] (__vfs_write) from [<c01fb520>] (vfs_write+0x98/0xbc)
[<c01fb520>] (vfs_write) from [<c01fb6c4>] (ksys_write+0x74/0xc4)
[<c01fb6c4>] (ksys_write) from [<c09029bc>] (xwrite+0x2c/0x64)
[<c09029bc>] (xwrite) from [<c0902a18>] (do_copy+0x24/0xac)
[<c0902a18>] (do_copy) from [<c090243c>] (write_buffer+0x24/0x3c)
[<c090243c>] (write_buffer) from [<c090248c>] (flush_buffer+0x38/0x98)
[<c090248c>] (flush_buffer) from [<c0928130>] (__gunzip+0x2b8/0x31c)
[<c0928130>] (__gunzip) from [<c09281bc>] (gunzip+0x28/0x30)
[<c09281bc>] (gunzip) from [<c090289c>] (unpack_to_rootfs+0x1cc/0x2c0)
[<c090289c>] (unpack_to_rootfs) from [<c090320c>] (populate_rootfs+0x50/0x12c)
[<c090320c>] (populate_rootfs) from [<c0102668>] (do_one_initcall+0x74/0x16c)
[<c0102668>] (do_one_initcall) from [<c0900f4c>] (kernel_init_freeable+0x1f4/0x)
[<c0900f4c>] (kernel_init_freeable) from [<c06b04c8>] (kernel_init+0x8/0x10c)
[<c06b04c8>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xd6c43fb0 to 0xd6c43ff8)
3fa0: 00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Mem-Info:
active_anon:0 inactive_anon:0 isolated_anon:0
active_file:0 inactive_file:0 isolated_file:0
unevictable:87065 dirty:0 writeback:0 unstable:0
slab_reclaimable:3071 slab_unreclaimable:446
mapped:0 shmem:0 pagetables:0 bounce:0
free:5836 free_pcp:59 free_cma:4032
Node 0 active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevo
Normal free:23344kB min:7904kB low:8512kB high:9120kB active_anon:0kB inactive_B
lowmem_reserve[]: 0 0 0
Normal: 6*4kB (UME) 3*8kB (UME) 2*16kB (M) 3*32kB (ME) 2*64kB (UM) 2*128kB (UE)B
87082 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap = 0kB
Total swap = 0kB
131072 pages RAM
0 pages HighMem/MovableOnly
34376 pages reserved
4096 pages cma reserved
Tasks state (memory values in pages):
[ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj ne
Out of memory and no killable processes...
Kernel panic - not syncing: System is deadlocked on memory
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.4.0-xilinx-v2020.1 #1
Hardware name: Xilinx Zynq Platform
[<c010e18c>] (unwind_backtrace) from [<c010a124>] (show_stack+0x10/0x14)
[<c010a124>] (show_stack) from [<c069c5a8>] (dump_stack+0xb4/0xd0)
[<c069c5a8>] (dump_stack) from [<c010c924>] (ipi_cpu_stop+0x3c/0x98)
[<c010c924>] (ipi_cpu_stop) from [<c010cfc0>] (handle_IPI+0x64/0x80)
[<c010cfc0>] (handle_IPI) from [<c033e65c>] (gic_handle_irq+0x84/0x90)
[<c033e65c>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xd6c81f80 to 0xd6c81fc8)
1f80: 000039f4 deb5d534 00000000 c01162e0 00000002 d6c80000 c0a03c68 c0a03ca8
1fa0: 0000406a 413fc090 00000000 00000000 fffffff8 d6c81fd0 c0107838 c0107828
1fc0: 60000013 ffffffff
[<c0101a8c>] (__irq_svc) from [<c0107828>] (arch_cpu_idle+0x1c/0x38)
[<c0107828>] (arch_cpu_idle) from [<c013fd5c>] (do_idle+0xd4/0xf8)
[<c013fd5c>] (do_idle) from [<c013fed4>] (cpu_startup_entry+0x18/0x1c)
[<c013fed4>] (cpu_startup_entry) from [<0010242c>] (0x10242c)
---[ end Kernel panic - not syncing: System is deadlocked on memory ]---

0 Kudos
bartokon
Explorer
Explorer
905 Views
Registered: ‎09-17-2018

Hello,

The question is how can I load rootfs?

You can try TFTP or SD-CARD/EMMC whatever suits you.

0 Kudos