Quantcast
Channel: Xilinx Wiki : Xilinx Wiki - all changes
Viewing all 11776 articles
Browse latest View live

MPSoC Secure Boot with Encryption

$
0
0
The purpose of this page is to describeDetails on secure booting QEMU in secure mode with encryption options enabled.
Encryption
Creating and executing encrypted images involves various steps:
Create a bif file. In bif file authentication mode(SHA3 or SHA2), Primary secret key, Secondary secret key, boot loaders and application
will be specified.
Run the bootgen tool to generate binary file.
Create the boot image file for the corresponding boot device.
To execute the boot image files:
Open 3 terminals and set the environment
provided in all 3.
Execute
the commands one in each terminal to run the application image, CSU ROM and the PMU ROM.
Creation of AES-Red key Encrypted SD image using eFuse as key source
1. Create a BIF file with the following contents
$ cat encrpt.bif
the_ROM_image:
[aeskeyfile] efuse_red_key_a530.nky
[keysrc_encryption] efuse_red_key}}
[fsbl_config] a5x_x64
[bootloader,encryption=aes] fsbl_a530.elf
[destination_cpu=a5x-0] A53_core0_hello_world.elf
2. Run the bootgen tool to generate the bin file and key file
$ bootgen -r -w -image encrpt.bif -o BOOT.BIN -p xc9r1234567abc
3. The key generated is as follows
$ cat efuse_red_key_a530.nky
Device xc9r1234567abc;
Key 0 70D15B80A2621F1DA308C416F26FE1E1161A857B8731AC5673E0D5322A292284;
IV 90D2BFC7EFF101DF467B61AB;
4. Copy this key to a temp file
$ echo "70D15B80A2621F1DA308C416F26FE1E1161A857B8731AC5673E0D5322A292284" >tmp_key
5. Burn the key into eFuse
$ qemu-efuse-creator -efusekey tmp_key
Xilinx Utility for qemu efuse file generation Rev 2.0
..Created qemuefusehash.bin
6. Create the SD Boot image and format the SD memory space
$ dd if=/dev/zero of=qemu_sd_efuse_redky_app_a530.img bs=128M count=1
1+0 records in
1+0 records out
134217728 bytes (134 MB) copied, 1.05148 s, 128 MB/s
$ mkfs.vfat -F 32 qemu_sd_efuse_redky_app_a530.img
mkfs.fat 3.0.26 (2014-03-07)
$ mcopy -i qemu_sd_efuse_redky_app_a530.img BOOT.BIN ::/
$ mkdir qemu-tmp
7. Open a new terminal and change directory to the path where the secure boot image is located. Run the CSU ROM code
$ qemu-system-microblazeel -M microblaze-fdt -hw-dtb zynqmp-csu.dtb -kernel csu_rom.elf -nographic -machine-path ./qemu-tmp
------------------------------------------------------------------------------------
Xilinx Restricted QEMU Feb 13 2015 16:19:45.
This QEMU binary and its source are restricted to Xilinx internal
use only. Do not delete this message in source. Contact the Xilinx
QEMU Maintainer (qemu-dev@xilinx.com) for details on publishing QEMU
contributions to customers.
------------------------------------------------------------------------------------
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) QEMU 2.2.50 monitor - type 'help' for more information
(qemu)
8. Open a new terminal and change directory to the path where the secure boot image is located. Run the PMU ROM code
$ qemu-system-microblazeel -M microblaze-fdt -hw-dtb zynqmp-pmu.dtb -kernel pmu_rom.elf -nographic -machine-path ./qemu-tmp
----
Xilinx Restricted QEMU Feb 13 2015 16:19:45.
This QEMU binary and its source are restricted to Xilinx internal
use only. Do not delete this message in source. Contact the Xilinx
QEMU Maintainer (qemu-dev@xilinx.com) for details on publishing QEMU
contributions to customers.
----
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@00000000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_pmu_ram@ffdc0000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_ipibuf@ff990000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@0xFF960000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x20000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x20000
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) QEMU 2.2.50 monitor - type 'help' for more information
(qemu)
9. Execute the SD Boot image on QEMU.
$ qemu-system-aarch64 -nographic -M arm-generic-fdt -hw-dtb zynqmp-qemu-arm.dtb -machine-path ./qemu-tmp -sd qemu_sd_efuse_redky_app_a530.img -boot mode=3 -pflash /dev/null -pflash /dev/null -pflash qemuefusehash.bin
----
Xilinx Restricted QEMU Feb 13 2015 16:19:45.
This QEMU binary and its source are restricted to Xilinx internal
use only. Do not delete this message in source. Contact the Xilinx
QEMU Maintainer (qemu-dev@xilinx.com) for details on publishing QEMU
contributions to customers.
----
WARNING: Image format was not specified for 'qemu_sd_efuse_redky_app_a530.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
WARNING: Image format was not specified for '/dev/null' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
WARNING: Image format was not specified for '/dev/null' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
WARNING: Image format was not specified for 'qemuefusehash.bin' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-aarch64: Failed to connect socket: No such file or directory
QEMU waiting for connection on: disconnected:unix:./qemu-tmp/qemu-rport-_csu@0,server
qemu-system-aarch64: Failed to connect socket: No such file or directory
QEMU waiting for connection on: disconnected:unix:./qemu-tmp/qemu-rport-_pmu@0,server
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@00000000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_pmu_ram@ffdc0000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_ipibuf@ff990000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@0xFF960000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x20000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x20000
Warning: Orphaned drive without device: id=pflash2,file=qemuefusehash.bin,if=pflash,bus=0,unit=2
DDR test pass
Xilinx First Stage Boot Loader
Release SW Beta1 Feb 11 2015-18:14:27
Platform: QEMU, RTL Version: 400
Cluster ID 0x80000000
Running on A53-0 Processor
Processor Initialization Done
In Stage 2
SD Boot Mode
SD: rc= 0
File name is BOOT.BIN
Multiboot Reg : 0x0
Image Header Table Offset 0x8C0
*Image Header Table Details*
Boot Gen Ver: 0x1020000
No of Partitions: 0x5
Partition Header Address: 0x260
Partition Present Device: 0x0
Initialization Success
In Stage 3, Partition No:1
UnEncrypted data Length: 0x6CE
Data word offset: 0x6CE
Total Data word length: 0x6CE
Destination Load Address: 0x0
Execution Address: 0x0
Data word offset: 0x7EF2
Partition Attributes: 0x100
Partition 1 Load Success
In Stage 3, Partition No:2
UnEncrypted data Length: 0x23A
Data word offset: 0x23A
Total Data word length: 0x23A
Destination Load Address: 0x1B40
Execution Address: 0x0
Data word offset: 0x85C0
Partition Attributes: 0x100
Partition 2 Load Success
In Stage 3, Partition No:3
UnEncrypted data Length: 0x1F02
Data word offset: 0x1F02
Total Data word length: 0x1F02
Destination Load Address: 0x2440
Execution Address: 0x0
Data word offset: 0x8800
Partition Attributes: 0x100
Partition 3 Load Success
In Stage 3, Partition No:4
UnEncrypted data Length: 0x9
Data word offset: 0x9
Total Data word length: 0x9
Destination Load Address: 0x1AB4
Execution Address: 0x0
Data word offset: 0xA710
Partition Attributes: 0x100
Partition 4 Load Success
All Partitions Loaded
In Stage 4
Running Cpu Handoff address: 0x0, Exec State: 0
Exit from FSBL
Hello World running on A53 core 0
Creation of AES - Red key Encrypted NAND image using BBRAM as key source
1. Create a BIF file with the following contents
$ cat encrpt.bif
the_ROM_image:
{
[aeskeyfile] bbram_red_key_a530.nky
[keysrc_encryption] bbram_red_key
[fsbl_config] a5x_x64
[bootloader,encryption=aes] fsbl_a530.elf
[destination_cpu=a5x-0] A53_core0_hello_world.elf
}
2. Run the bootgen tool to generate the bin file and key file
$ bootgen -r -w -image encrpt.bif -o BOOT.BIN -p xc9r1234567abc
3. The key generated is as follows
$ cat bbram_red_key_a530.nky
Device xc9r1234567abc;
Key 0 72F5EA8F6D30D4F7D84E0DFEC1C828D5BB2F787031D54F1207923332CFD8493E;
IV 0B8EA23BD01FE51F0CF0D26D;
4. Copy this key to a temp file
$ echo "72F5EA8F6D30D4F7D84E0DFEC1C828D5BB2F787031D54F1207923332CFD8493E" >tmp_key
5. Write the key in BBRAM
$ qemu-efuse-creator –bbramkey tmp_key
Xilinx Utility for qemu efuse file generation Rev 2.0
..Created qemubbram.bin
6. Create the NAND Boot image.
$ dd if=/dev/zero of=nand.bin bs=1G count=4
4+0 records in
4+0 records out
4294967296 bytes (4.3 GB) copied, 51.5284 s, 83.4 MB/s
$ dd if=BOOT.BIN of=nand.bin bs=1 seek=0 conv=notrunc
171108+0 records in
171108+0 records out
171108 bytes (171 kB) copied, 0.181082 s, 945 kB/s
$ qemu-nand-creator 16384 < nand.bin > qemu_nand.bin
$ mkdir qemu-tmp
7. Open a new terminal and change directory to the path where the secure boot image is located. Run the CSU ROM code.
$ qemu-system-microblazeel -M microblaze-fdt -hw-dtb zynqmp-csu.dtb -kernel csu_rom.elf -nographic -machine-path ./qemu-tmp
----
Xilinx Restricted QEMU Feb 13 2015 16:19:45.
This QEMU binary and its source are restricted to Xilinx internal
use only. Do not delete this message in source. Contact the Xilinx
QEMU Maintainer (qemu-dev@xilinx.com) for details on publishing QEMU
contributions to customers.
----
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
Warning: path not on HugeTLBFS: ././qemu-tmp
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) QEMU 2.2.50 monitor - type 'help' for more information
(qemu)
8. Open a new terminal and change directory to the path where the secure boot image is located. Run the PMU ROM code.
$ qemu-system-microblazeel -M microblaze-fdt -hw-dtb zynqmp-pmu.dtb -kernel pmu_rom.elf -nographic -machine-path ./qemu-tmp
----
Xilinx Restricted QEMU Feb 13 2015 16:19:45.
This QEMU binary and its source are restricted to Xilinx internal
use only. Do not delete this message in source. Contact the Xilinx
QEMU Maintainer (qemu-dev@xilinx.com) for details on publishing QEMU
contributions to customers.
----
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@00000000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_pmu_ram@ffdc0000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_ipibuf@ff990000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@0xFF960000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x20000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x20000
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) QEMU 2.2.50 monitor - type 'help' for more information
(qemu)
9. Execute the NAND Boot image on QEMU.
$ qemu-system-aarch64 -nographic -M arm-generic-fdt -hw-dtb zynqmp-qemu-arm.dtb -machine-path ./qemu-tmp -drive file=qemu_nand.bin,if=pflash,index=0 -drive file=qemubbram.bin,if=pflash,index=3 -boot mode=4
----
Xilinx Restricted QEMU Feb 13 2015 16:19:45.
This QEMU binary and its source are restricted to Xilinx internal
use only. Do not delete this message in source. Contact the Xilinx
QEMU Maintainer (qemu-dev@xilinx.com) for details on publishing QEMU
contributions to customers.
----
WARNING: Image format was not specified for 'qemu_nand.bin' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
WARNING: Image format was not specified for 'qemubbram.bin' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-aarch64: Failed to connect socket: No such file or directory
QEMU waiting for connection on: disconnected:unix:./qemu-tmp/qemu-rport-_csu@0,server
qemu-system-aarch64: Failed to connect socket: No such file or directory
QEMU waiting for connection on: disconnected:unix:./qemu-tmp/qemu-rport-_pmu@0,server
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@00000000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_pmu_ram@ffdc0000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_ipibuf@ff990000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory@0xFF960000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory0@0x20000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x00000
Warning: path not on HugeTLBFS: ./qemu-tmp/qemu-memory-_memory1@0x20000
Warning: Orphaned drive without device: id=pflash3,file=qemubbram.bin,if=pflash,bus=0,unit=3
DDR test pass
Xilinx First Stage Boot Loader
Release SW Beta1 Feb 11 2015-18:14:27
Platform: QEMU, RTL Version: 400
Cluster ID 0x80000000
Running on A53-0 Processor
Processor Initialization Done
In Stage 2
NAND Boot Mode
Manufacturer: MICRON MT29F32G08ABCDBJ4 ,
Device Model: MT29F32G08ABCDBJ4 ,
Jedec ID: 0x2C
Bytes Per Page: 0x4000
Spare Bytes Per Page: 0x4C0
Pages Per Block: 0x100
Blocks Per LUN: 0x418
Number of LUNs: 0x1
Number of bits per cell: 0x1
Number of ECC bits: 0x1
Block Size: 0x400000
Number of Target Blocks: 0x418
Number of Target Pages: 0x41800
Nand Init Success
Multiboot Reg : 0x0
Image Header Table Offset 0x8C0
*Image Header Table Details*
Boot Gen Ver: 0x1020000
No of Partitions: 0x5
Partition Header Address: 0x260
Partition Present Device: 0x0
Initialization Success
In Stage 3, Partition No:1
UnEncrypted data Length: 0x6CE
Data word offset: 0x6CE
Total Data word length: 0x6CE
Destination Load Address: 0x0
Execution Address: 0x0
Data word offset: 0x7EF2
Partition Attributes: 0x100
Partition 1 Load Succes
In Stage 3, Partition No:2
UnEncrypted data Length: 0x23A
Data word offset: 0x23A
Total Data word length: 0x23A
Destination Load Address: 0x1B40
Execution Address: 0x0
Data word offset: 0x85C0
Partition Attributes: 0x100
Partition 2 Load Success
In Stage 3, Partition No:3
UnEncrypted data Length: 0x1F02
Data word offset: 0x1F02
Total Data word length: 0x1F02
Destination Load Address: 0x2440
Execution Address: 0x0
Data word offset: 0x8800
Partition Attributes: 0x100
Partition 3 Load Success
In Stage 3, Partition No:4
UnEncrypted data Length: 0x9
Data word offset: 0x9
Total Data word length: 0x9
Destination Load Address: 0x1AB4
Execution Address: 0x0
Data word offset: 0xA710
Partition Attributes: 0x100
Partition 4 Load Success
All Partitions Loaded
In Stage 4
Running Cpu Handoff address: 0x0, Exec State: 0
Exit from FSBL
Hello World running on A53 core 0
future.
Related Links
MPSoC Secure Boot

MPSoC XEN Hypervisor

$
0
0
...
dtc -I dtb -O dts -o xen.dts xen.dtb
dtc -I dts -O dtb -o xen.dtb xen.dts
For more details on running the Xen Hypervisor, please refer http://dornerworks.com/services/xilinxxen
Related Links
Petalinux Tools Reference Guide

MPSoC XEN Hypervisor

$
0
0
...
Related Links
Petalinux Tools Reference Guide
http://dornerworks.com/services/xilinxxen

MPSoC Power Management

$
0
0
...
Follow one of 10a or 10b to run the example application on the A53 or R5 core.
10a. Load and run the test app on A53 using xsdb:
targets$targets -set -filter
...
"Cortex-A53 #0"}
dow

$dow
<path_to_standalone_selfsuspend_app_a53_elf
mask_write

Downloading Program -- /home/pmu_bsp_xilpm_selfsuspend_example_1.elf
section, .text: 0x00000000 - 0x0000447b
section, .init: 0x00004480 - 0x000044b3
section, .fini: 0x000044c0 - 0x000044f3
section, .note.gnu.build-id: 0x000044f4 - 0x00004517
section, .rodata: 0x00004518 - 0x00004b1f
section, .rodata1: 0x00004b20 - 0x00004b3f
section, .data: 0x00004b40 - 0x00006107
section, .data1: 0x00006108 - 0x0000613f
section, .eh_frame: 0x00006140 - 0x00006143
section, .mmu_tbl0: 0x00007000 - 0x0000700f
section, .mmu_tbl1: 0x00008000 - 0x00009fff
section, .mmu_tbl2: 0x0000a000 - 0x0000dfff
section, .init_array: 0x0000e000 - 0x0000e007
section, .fini_array: 0x0000e008 - 0x0000e047
section, .sdata: 0x0000e048 - 0x0000e07f
section, .bss: 0x0000e080 - 0x0000e0ff
section, .heap: 0x0000e100 - 0x000100ff
section, .stack: 0x00010100 - 0x000130ff
100% 0MB 1.3MB/s 00:00
Setting PC to Program Start Address 0x00000000
Successfully downloaded /home/pmu_bsp_xilpm_selfsuspend_example_1.elf
$mask_write
0xfd1a0104 0x3d01 0
con

$con
Info: Cortex-A53 #0 (target 3) Running
Info: Cortex-A53 #1 (target 4) Running
Info: Cortex-A53 #2 (target 5) Running
Info: Cortex-A53 #3 (target 6) Running
Info: Cortex-R5 #0 (target 8) Running
Info: Cortex-R5 #1 (target 9) Running

10b.Load and run the test app on R5 using xsdb:
targets$targets -set -filter
...
"Cortex-R5 #0"}
dow

$dow
<path_to_standalone_selfsuspend_app_a53_elf>
mask_write 0xff5e023c [expr ~2] 0
con

MPSoC Power Management

$
0
0
...
section, .heap: 0x0000e100 - 0x000100ff
section, .stack: 0x00010100 - 0x000130ff
...
1.3MB/s 00:00
Setting PC to Program Start Address 0x00000000
Successfully downloaded /home/pmu_bsp_xilpm_selfsuspend_example_1.elf
$mask_write 0xfd1a0104 0x3d01 0
$con
...
3) Running
Info: Cortex-A53 #1 (target 4) Running
Info: Cortex-A53 #2 (target 5) Running
...
Instructions to load and run petalinux on ARM_QEMU using xsdb:
1. Execute the following to load U-Boot, ATF (bl31.elf), Linux (Image) and device tree (system.dtb):
targets$targets -set -filter
...
"Cortex-A53 #0"}
dow

$dow
<path_to_U-BOOT_ELF>
Downloading Program -- /home/u-boot.elf
section, .data: 0x08000000 - 0x08080b37
100% 0MB 8.7MB/s 00:00
Setting PC to Program Start Address 0x08000000
Successfully downloaded /home/u-boot.elf

dow <path_to_ATF_ELF>
Downloading Program -- /home/bl31.elf
section, ro: 0xfffe4000 - 0xfffe9fff
section, .data: 0xfffea000 - 0xfffea017
section, stacks: 0xfffea040 - 0xfffeb03f
section, .bss: 0xfffeb040 - 0xfffec237
section, xlat_table: 0xfffed000 - 0xffff2fff
section, coherent_ram: 0xffff3000 - 0xffff3fff
100% 0MB 13.0MB/s 00:00
Setting PC to Program Start Address 0xfffe4000
Successfully downloaded /home/bl31.elf

mask_write 0xfd1a0104 0x3d01 0 # release APU reset
con
Info: Cortex-A53 #0 (target 3) Running
Info: Cortex-A53 #1 (target 4) Running
Info: Cortex-A53 #2 (target 5) Running
Info: Cortex-A53 #3 (target 6) Running
Info: Cortex-R5 #0 (target 8) Running
Info: Cortex-R5 #1 (target 9) Running

After executing these, you should see a ATF banner message on ARM_QEMU and u-boot process. Let the timeout
expire and U-Boot will load Image and device tree via tftp and boot Linux.
...
$cat /sys/devices/system/cpu/online
Related Links
{{{{{{{{{{Software Development Flow}}}}}}}}}}

MPSoC Power Management

$
0
0
...
con
11. You should now see the Test App output STDOUT.
APU: Main
APU: INITIAL BOOT
APU: OK, configured timer
APU: Waiting for ticks...
APU: Timer0 interrupt handler, tick_count = 1
APU: Timer0 interrupt handler, tick_count = 2
APU: Timer0 interrupt handler, tick_count = 3
APU: Saved context (tick_count = 3)
APU: XPm_SelfSuspend(2, -1, 0, 0)
Received IPI Mask:0x00000001
PMUFW: PmSelfSuspend: (NODE_APU_0, -1, 0)
PMUFW: PmProcTrActiveToSuspend: ACTIVE->SUSPENDING NODE_APU_0
APU: XPm_SetRequirement(11, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_0, 2, 0, REQAUPEUS:T _XAPCmK__SNeOt)R
equirement(12, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_1, 2, 0, REQUEST_ACK_NO)
APU: XPm_SetRequirement(13, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_2, 2, 0, REQUEST_AAPCUK:_ NXOP)m
_SetRequirement(14, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_3, 2, 0, REQUEST_ACK_NO)
APU: Going to WFI...
PMUFW: PmProcTrSuspendToSleep: SUSPENDING->SLEEP NODE_APU_0
PMUFW: PmRequirementUpdateScheduled: NODE_APU_0
PMUFW: PmSlaveChangeState: NODE_OCM_BANK_0 2->1
PMUFW: PmSlaveChangeState: NODE_OCM_BANK_1 2->1
PMUFW: PmSlaveChangeState: NODE_OCM_BANK_2 2->1
PMUFW: PmOpportunisticSuspend: Opportunistic suspend attempt for NODE_APU
PMUFW: PmPwrDnHandler: NODE_APU
PMUFW: PmOpportunisticSuspend: Opportunistic suspend attempt for NODE_FPD
PMUFW: PmHasAwakeChild: NODE_L2
PMUFW: PmWakeUpDisableAll: for NODE_APU_0
PMUFW: PmRequirementUpdateScheduled: NODE_APU_0
PMUFW: PmSlaveChangeState: NODE_OCM_BANK_0 1->2
PMUFW: PmSlaveChangeState: NODE_OCM_BANK_1 1->2
PMUFW: PmSlaveChangeState: NODE_OCM_BANK_2 1->2
PMUFW: PmProcTrSleepToActive: SLEEP->ACTIVE NODE_APU_0
PMUFW: PmPwrUpHandler: NODE_APU
APU: Main
APU: RESUMED
.
.
.
.
APU: Restored context (tick_count = 263)
APU: Timer0 interrupt handler, tick_count = 264
APU: Waiting for ticks...
APU: Timer0 interrupt handler, tick_count = 265
APU: Timer0 interrupt handler, tick_count = 266
APU: Timer0 interrupt handler, tick_count = 267
APU: Saved context (tick_count = 267)
APU: XPm_SelfSuspend(2, -1, 0, 0)
Received IPI Mask:0x00000001
PMUFW: PmSelfSuspend: (NODE_APU_0, -1, 0)
PMUFW: PmProcTrActiveToSuspend: ACTIVE->SUSPENDING NODE_APU_0
APU: XPm_SetRequirement(11, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_0, 2, 0, REQUEST_ACK_NO)
APU: XPm_SetRequirement(12, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_1, 2, 0, REQUEST_ACK_NO)
APU: XPm_SetRequirement(13, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_2, 2, 0, REQUEST_ACK_NO)
APU: XPm_SetRequirement(14, 2, 0, 1)
Received IPI Mask:0x00000001
PMUFW: PmSetRequirement: (NODE_OCM_BANK_3, 2, 0, REQUEST_ACKA_PNUO:)

CPU hotplug:
Follow Steps 1 to 9 from above instructions for loading the PMU Firmware on PMU_QEMU.
...
$targets -set -filter {name =~ "Cortex-A53 #0"}
$dow <path_to_U-BOOT_ELF>
...
-- /home/u-boot.elf
section, .data: 0x08000000 - 0x08080b37
...
8.7MB/s 00:00
Setting PC to Program Start Address 0x08000000
Successfully downloaded /home/u-boot.elf
...
section, xlat_table: 0xfffed000 - 0xffff2fff
section, coherent_ram: 0xffff3000 - 0xffff3fff
...
13.0MB/s 00:00
Setting PC to Program Start Address 0xfffe4000
Successfully downloaded /home/bl31.elf
mask_write 0xfd1a0104 0x3d01 0 # release APU reset
con
...
3) Running
Info: Cortex-A53 #1 (target 4) Running
Info: Cortex-A53 #2 (target 5) Running
...
Info: Cortex-R5 #1 (target 9) Running
After executing these, you should see a ATF banner message on ARM_QEMU and u-boot process. Let the timeout
...
and boot Linux.Linux as shown below.
NOTICE: ATF running on QEMU/RTL4.0
NOTICE: BL3-1: Secure code at 0xfffc0000
NOTICE: BL3-1: Non secure code at 0x8000000
NOTICE: BL3-1: v1.1(release):
NOTICE: BL3-1: Built : 13:22:44, Aug 20 2015
U-Boot 2015.07 (Aug 20 2015 - 13:25:29 +0530) Xilinx ZynqMP, Build: jenkins-Petalinux_2015.3_build_new-Petalinux_Build_reference_Design_bsp_2015.3_64bit-39
I2C: ready
DRAM: 1 GiB
Enabling Caches...
EL Level: EL2
NAND: 4096 MiB
MMC: zynq_sdhci: 0
Using default environment
In: serial
Out: serial
Err: serial
SCSI: SATA link 0 timeout.
AHCI 0001.0000 32 slots 2 ports 1.5 Gbps 0x3 impl SATA mode
flags: ncq only
scanning bus for devices...
Found 0 device(s).
Net: Gem.ff0b0000
Hit any key to stop autoboot: 0
Using Gem.ff0b0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'Image'.
Load address: 0x80000
Loading: #################################################################
####################
2.1 MiB/s
done
Bytes transferred = 24061440 (16f2600 hex)
Gem.ff0b0000:7 is connected to Gem.ff0b0000. Reconnecting to Gem.ff0b0000
Using Gem.ff0b0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'system.dtb'.
Load address: 0x7000000
Loading: ####
32.2 KiB/s
done
Bytes transferred = 20027 (4e3b hex)
## Flattened Device Tree blob at 07000000
Booting using the fdt blob at 0x7000000
reserving fdt memory region: addr=3f000000 size=1000000
Loading Device Tree to 000000000fff8000, end 000000000ffffe3a ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.0.0 (xbrbbot@xhdl3853) (gcc version 4.8.2 20131014 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) ) #2 SMP Thu Aug 20 13:28:31 IST 2015
[ 0.000000] CPU: AArch64 Processor [410fd032] revision 2
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] alternatives: enabling workaround for ARM errata 826319, 827319, 824069
[ 0.000000] alternatives: enabling workaround for ARM erratum 845719
[ 0.000000] Early serial console at MMIO 0xff000000 (options '115200n8')
[ 0.000000] bootconsole [uart0] enabled
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: Using PSCI v0.1 Function IDs from DT
[ 0.000000] PERCPU: Embedded 15 pages/cpu @ffffffc03efa4000 s24448 r8192 d28800 u61440
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 258560
[ 0.000000] Kernel command line: console=ttyPS0,115200 earlycon=cdns,mmio,0xff000000,115200n8
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] software IO TLB [mem 0x39e00000-0x3de00000] (64MB) mapped at [ffffffc039e00000-ffffffc03ddfffff]
[ 0.000000] Memory: 925952K/1048576K available (6516K kernel code, 521K rwdata, 2492K rodata, 13944K init, 484K bss, 122624K reserved, 0K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vmalloc : 0xffffff8000000000 - 0xffffffbdffff0000 ( 247 GB)
[ 0.000000] vmemmap : 0xffffffbe00000000 - 0xffffffbfc0000000 ( 7 GB maximum)
[ 0.000000] 0xffffffbe00000000 - 0xffffffbe00e00000 ( 14 MB actual)
[ 0.000000] fixed : 0xffffffbffabfe000 - 0xffffffbffac00000 ( 8 KB)
[ 0.000000] PCI I/O : 0xffffffbffae00000 - 0xffffffbffbe00000 ( 16 MB)
[ 0.000000] modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB)
[ 0.000000] memory : 0xffffffc000000000 - 0xffffffc040000000 ( 1024 MB)
[ 0.000000] .init : 0xffffffc00094f000 - 0xffffffc0016ed000 ( 13944 KB)
[ 0.000000] .text : 0xffffffc000080000 - 0xffffffc00094e0c4 ( 9017 KB)
[ 0.000000] .data : 0xffffffc0016f0000 - 0xffffffc001772600 ( 522 KB)
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] Architected cp15 timer(s) running at 50.00MHz (phys).
[ 0.000314] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 2748779069440ns
[ 0.620014] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=500000)
[ 0.679623] pid_max: default: 32768 minimum: 301
[ 1.206299] Security Framework initialized
[ 1.341221] AppArmor: AppArmor initialized
[ 1.389545] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 1.390495] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 3.789850] hw perfevents: no hardware support available
[ 3.790580] EFI services will not be available.
[ 10.512631] CPU1: failed to come online
Received IPI Mask:0x00000001
PMUFW: PmRequestWakeup: (NODE_APU_1, REQUEST_ACK_NO)
PMUFW: PmProcTrSleepToActive: SLEEP->ACTIVE NODE_APU_1
Received IPI Mask:0x00000001
PMUFW: PmRequestWakeup: (NODE_APU_2, REQUEST_ACK_NO)
PMUFW: PmProcTrSleepToActive: SLEEP->ACTIVE NODE_APU_2
[ 16.050961] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
[ 16.053398] Unable to handle kernel paging request at virtual address ffffffffffffffd0
[ 16.053453] pgd = ffffffc0017ee000
[ 16.053563] [ffffffffffffffd0] *pgd=0000000000000000, *pud=0000000000000000
[ 16.053623] Internal error: Oops: 97820005 [#2] SMP
[ 16.053658] Modules linked in:
[ 16.053790] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D 4.0.0 #2
[ 16.053809] Hardware name: ZynqMP EP108 (DT)
[ 16.053839] task: ffffffc039926cc0 ti: ffffffc039928000 task.ti: ffffffc039928000
[ 16.111910] swapper/2[0]: undefined instruction: pc=ffffffc03992bb70
[ 16.112010] Code: 00887070 ffffffc0 3992bcb0 ffffffc0 (ffffffd0)
[ 16.112381] swapper/2[0]: undefined instruction: pc=ffffffc001701878
[ 16.112428] Code: 00000000 00000000 00000000 00000000 (01701878)
[ 17.108584] CPU2: failed to come online
Received IPI Mask:0x00000001
PMUFW: PmRequestWakeup: (NODE_APU_3, REQUEST_ACK_NO)
PMUFW: PmProcTrSleepToActive: SLEEP->ACTIVE NODE_APU_3
[ 17.755877] CPU3: Booted secondary processor
[ 17.756990] Detected VIPT I-cache on CPU3
[ 18.738945] CPU3: failed to come online
[ 18.743938] Brought up 1 CPUs
[ 18.744277] SMP: Total of 1 processors activated.
[ 18.798529] alternatives: patching kernel code
[ 19.521503] devtmpfs: initialized
[ 21.007121] DMI not present or invalid.
[ 21.615927] xor: measuring software checksum speed
[ 21.716482] 8regs : 1106.800 MB/sec
[ 21.818155] 8regs_prefetch: 1073.600 MB/sec
[ 21.919814] 32regs : 1020.400 MB/sec
[ 22.021615] 32regs_prefetch: 902.000 MB/sec
[ 22.022137] xor: using function: 8regs (1106.800 MB/sec)
[ 22.216142] NET: Registered protocol family 16
[ 22.471694] cpuidle: using governor ladder
[ 22.472302] cpuidle: using governor menu
[ 22.473089] vdso: 2 pages (1 code @ ffffffc0016f5000, 1 data @ ffffffc0016f4000)
[ 22.474195] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 22.477467] DMA: preallocated 256 KiB pool for atomic allocations
[ 24.824334] raid6: int64x1 438 MB/s
[ 24.997341] raid6: int64x2 172 MB/s
[ 25.170003] raid6: int64x4 790 MB/s
[ 25.343787] raid6: int64x8 346 MB/s
[ 25.686015] raid6: neonx1 120 MB/s
[ 25.859937] raid6: neonx2 151 MB/s
[ 26.033488] raid6: neonx4 155 MB/s
[ 26.206273] raid6: neonx8 105 MB/s
[ 26.206688] raid6: using algorithm int64x4 (790 MB/s)
[ 26.207231] raid6: using intx1 recovery algorithm
[ 26.211865] SCSI subsystem initialized
[ 26.269548] libata version 3.00 loaded.
[ 26.391634] usbcore: registered new interface driver usbfs
[ 26.393819] usbcore: registered new interface driver hub
[ 26.394807] usbcore: registered new device driver usb
[ 26.433911] NetLabel: Initializing
[ 26.434553] NetLabel: domain hash size = 128
[ 26.434943] NetLabel: protocols = UNLABELED CIPSOv4
[ 26.437219] NetLabel: unlabeled traffic allowed by default
[ 26.446868] Switched to clocksource arch_sys_counter
[ 27.054434] AppArmor: AppArmor Filesystem Enabled
[ 27.159903] NET: Registered protocol family 2
[ 27.385424] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 27.386545] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
[ 27.387774] TCP: Hash tables configured (established 8192 bind 8192)
[ 27.447826] TCP: reno registered
[ 27.448488] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 27.449603] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 27.626109] NET: Registered protocol family 1
[ 27.820610] RPC: Registered named UNIX socket transport module.
[ 27.821226] RPC: Registered udp transport module.
[ 27.821665] RPC: Registered tcp transport module.
[ 27.822088] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 49.469860] kvm [1]: Using HYP init bounce page @39098000
[ 50.072852] kvm [1]: interrupt-controller@f9040000 IRQ5
[ 51.163537] kvm [1]: timer IRQ3
[ 51.164079] kvm [1]: Hyp mode initialized successfully
[ 52.420560] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 52.462744] audit: initializing netlink subsys (disabled)
[ 52.573266] audit: type=2000 audit(32.590:1): initialized
[ 52.792874] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[ 52.882059] VFS: Disk quotas dquot_6.5.2
[ 52.953724] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 53.327310] NFS: Registering the id_resolver key type
[ 53.329116] Key type id_resolver registered
[ 53.329540] Key type id_legacy registered
[ 53.391085] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 53.718350] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[ 53.767404] io scheduler noop registered
[ 53.767858] io scheduler deadline registered
[ 53.768625] io scheduler cfq registered (default)
[ 54.492145] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[ 54.551784] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[ 54.740110] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[ 54.910164] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[ 55.141847] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[ 55.206339] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[ 55.414598] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[ 55.461215] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[ 55.462099] xenfs: not registering filesystem on non-xen platform
[ 64.227708] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 203, base_baud = 1562500) is a xuartps
[ 64.230783] console [ttyPS0] enabled
[ 64.230783] console [ttyPS0] enabled
[ 64.231590] bootconsole [uart0] disabled
[ 64.231590] bootconsole [uart0] disabled
[ 65.453030] brd: module loaded
[ 65.557028] loop: module loaded
[ 66.211249] ahci-ceva fd0c0000.ahci: AHCI 0001.0000 32 slots 2 ports 1.5 Gbps 0x3 impl platform mode
[ 66.212501] ahci-ceva fd0c0000.ahci: flags: ncq only
[ 66.625314] scsi host0: ahci-ceva
[ 66.630323] scsi host1: ahci-ceva
[ 66.632362] ata1: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x100 irq 196
[ 66.633114] ata2: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x180 irq 196
[ 66.635828] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 67.193455] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x44
[ 67.194088] nand: Micron MT29F32G08ABCDBJ4
[ 67.194501] nand: 4096 MiB, SLC, erase size: 4096 KiB, page size: 16384, OOB size: 1216
[ 67.650842] Bad block table not found for chip 0
[ 67.663414] Bad block table not found for chip 0
[ 67.664025] Scanning device for bad blocks
[ 113.853494] Bad block table written to 0x0000ffc00000, version 0x01
[ 114.080312] Bad block table written to 0x0000ff800000, version 0x01
[ 115.219174] 5 ofpart partitions found on MTD device arasan_nfc
[ 115.219488] Creating 5 MTD partitions on "arasan_nfc":
[ 115.250993] 0x000000000000-0x000000400000 : "nand-fsbl-uboot"
[ 117.329739] ata2: SATA link down (SStatus 0 SControl 300)
[ 117.477603] ata1: SATA link down (SStatus 0 SControl 300)
[ 119.949421] 0x000000400000-0x000001800000 : "nand-linux"
[ 120.230621] 0x000001800000-0x000001c00000 : "nand-device-tree"
[ 120.427208] 0x000001c00000-0x000003000000 : "nand-rootfs"
[ 120.580845] 0x000003000000-0x000003400000 : "nand-bitstream"
[ 134.944898] m25p80 spi32766.0: found sst25wf080, expected m25p80
[ 134.946359] m25p80 spi32766.0: sst25wf080 (1024 Kbytes)
[ 135.067396] 1 ofpart partitions found on MTD device spi32766.0
[ 135.067940] Creating 1 MTD partitions on "spi32766.0":
[ 135.068527] 0x000000000000-0x000000100000 : "spi0_flash0"
[ 137.892311] m25p80 spi32765.0: found sst25wf080, expected m25p80
[ 137.893095] m25p80 spi32765.0: sst25wf080 (1024 Kbytes)
[ 137.893628] 1 ofpart partitions found on MTD device spi32765.0
[ 137.894140] Creating 1 MTD partitions on "spi32765.0":
[ 137.894632] 0x000000000000-0x000000100000 : "spi1_flash0"
[ 139.310793] m25p80: probe of spi32764.0 failed with error -2
[ 139.518156] libphy: Fixed MDIO Bus: probed
[ 139.582308] CAN device driver interface
[ 140.985296] libphy: MACB_mii_bus: probed
[ 142.072700] macb ff0b0000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xff0b0000 irq 193 (00:0a:35:00:02:01)
[ 142.073672] macb ff0b0000.ethernet eth0: attached PHY driver [Marvell 88E1111] (mii_bus:phy_addr=ff0b0000.etherne:00, irq=-1)
[ 142.223359] dwc3 fe200000.usb: this is not a DesignWare USB3 DRD Core
[ 142.224011] dwc3 fe200000.usb: failed to initialize core
[ 142.225233] dwc3 fe300000.usb: this is not a DesignWare USB3 DRD Core
[ 142.225818] dwc3 fe300000.usb: failed to initialize core
[ 142.295414] usbcore: registered new interface driver uas
[ 142.296368] usbcore: registered new interface driver usb-storage
[ 142.897864] mousedev: PS/2 mouse device common for all mice
[ 142.965240] at24 0-0054: 8192 byte 24c64 EEPROM, writable, 1 bytes/write
[ 142.966193] cdns-i2c ff020000.i2c: 400 kHz mmio ff020000 irq 15
[ 142.968262] at24 1-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write
[ 142.969480] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 16
[ 142.974992] device-mapper: ioctl: 4.30.0-ioctl (2014-12-22) initialised: dm-devel@redhat.com
[ 142.976019] Driver 'mmcblk' needs updating - please use bus_type methods
[ 142.976877] sdhci: Secure Digital Host Controller Interface driver
[ 142.977424] sdhci: Copyright(c) Pierre Ossman
[ 142.977855] sdhci-pltfm: SDHCI platform and OF driver helper
[ 143.243384] sdhci-arasan ff160000.sdhci: No vmmc regulator found
[ 143.243761] sdhci-arasan ff160000.sdhci: No vqmmc regulator found
[ 143.339339] mmc0: SDHCI controller on ff160000.sdhci [ff160000.sdhci] using ADMA
[ 143.469164] sdhci-arasan ff170000.sdhci: No vmmc regulator found
[ 143.469743] sdhci-arasan ff170000.sdhci: No vqmmc regulator found
[ 143.519154] mmc1: SDHCI controller on ff170000.sdhci [ff170000.sdhci] using ADMA
[ 143.521487] usbcore: registered new interface driver usbhid
[ 143.522007] usbhid: USB HID core driver
[ 143.660102] TCP: cubic registered
[ 143.660504] Initializing XFRM netlink socket
[ 143.729472] NET: Registered protocol family 10
[ 143.955054] sit: IPv6 over IPv4 tunneling driver
[ 143.960463] NET: Registered protocol family 17
[ 143.961266] NET: Registered protocol family 15
[ 143.961749] can: controller area network core (rev 20120528 abi 9)
[ 143.962820] NET: Registered protocol family 29
[ 143.963491] can: raw protocol (rev 20120528)
[ 143.964025] can: broadcast manager protocol (rev 20120528 t)
[ 143.964645] can: netlink gateway (rev 20130117) max_hops=1
[ 144.010911] Key type dns_resolver registered
[ 145.480170] Btrfs loaded
[ 145.482397] AppArmor: AppArmor sha1 policy hashing enabled
[ 157.206142] Freeing unused kernel memory: 13944K (ffffffc00094f000 - ffffffc0016ed000)
[ 157.270586] Freeing alternatives memory: 8K (ffffffc0016ed000 - ffffffc0016ef000)
INIT: version 2.88 booting
Starting Bootlog daemon: bootlogd.
Creating /dev/flash/* device nodes
[ 194.607432] random: dd urandom read with 57 bits of entropy available
starting Busybox inet Daemon: inetd... done.
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
Removing any system startup links for run-postinsts ...
/etc/rcS.d/S99run-postinsts
INIT: Entering runlevel: 5
Configuring network interfaces... [ 203.942218] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc (v1.22.1) started
[ 205.115356] macb ff0b0000.ethernet eth0: link up (100/Full)
[ 205.123087] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sending discover...
Sending discover...
Sending select for 10.0.2.15...
Lease of 10.0.2.15 obtained, lease time 86400
/etc/udhcpc.d/50default: Adding DNS 10.0.2.3
done.
Stopping Bootlog daemon: bootlogd.
Running dynamic getty on ttyPS0/115200
Built with PetaLinux v2015.3 (Yocto 1.8) Xilinx-ZynqMP-QEMU-2015_3 /dev/ttyPS0
Xilinx-ZynqMP-QEMU-2015_3 login: root
Password:
login[1328]: root login on 'ttyPS0'
root@Xilinx-ZynqMP-QEMU-2015_3:~#

2. Execute the following to power off a core (example: CPU 1):
$echo 0 > /sys/devices/system/cpu/cpu1/online

MPSoC OpenAMP

$
0
0
...
Remoteproc
The remoteproc must be specified in the kernel DTB, an example of which is shown above. A basic explanation of the device tree is given below. See the Linux kernel device tree documentation for more details on the DTS entry.
|| Compatible
The node’s compatible string. This must match the one in the Linux driver.
Reg
Specifies the location and size of the relevant registers.
Reg-names
Specifies names for the registers previously mentioned.
Core_conf
This specifies if it is in split mode or lockstep mode.
Method
Specifies the method of accessing the IPI. This can either be done from the kernel, the hypervisor or ATF SMC calls.
Bootmem
Identifies the memory location that the image is being booted from.
Firmware
The firmware that is loaded onto the R5.
Ipi_dest_mask
The destination mask for the IPI.
Interrupt-parent
Specifies what the devices interrupt parent is. In this case it is the Generic Interrupt Controller (GIC).
Interrupts
Identifies the interrupt line that is being used.

Build the Applications and Linux
One the PetaLinux project is setup follow the procedure bellow:

MPSoC OpenAMP

$
0
0

OpenAMP (Open
Xilinx Open Asymmetric Multi Processing)Processing (OpenAMP) is a framework that providesproviding the software components needed to enable the development of
...
(AMP) systems. Xilinx OpenAMP framework provides:
1.Fully

• Fully
functional remoteproc
...
a Linux master/Bare Metalmaster/bare metal remote configuration
2.Proxy

• Proxy
infrastructure and supplied demos that showcase the ability of a proxy on a master processor to handle
...
close, read, and write calls from bare metal basedmetal-based remote contexts.contexts
The purpose of this page is to describe the procedure involved in building and running the firmware for OpenAMP.
Software Requirements
To use OpenAMP first ensure that theThe requirements for PetaLinux 2015.2_ZUB22015.3 SW Early Access and XSDK ZUB2 are2015.3 must be met.
Prerequisites
User should have the basic understanding of Linux, PetaLinux, XSDK and how to boot a Xilinx board using JTAG boot.
Overview
In AMP systems it
Process Overview
It
is common
...
master processor in an AMP system to bring
...
Inter Process Communication
Communication
(IPC). This
...
processor to offloadoff-load work to
...
other processors.
The
The general OpenAMP flow is that theas follows:
1. The
Linux master
...
processor and the shared memory is created. Next the
2. The
master boots
...
remote processor.
3.
The remote processor then calls remoteproc_resource_init()
...
virtIO/RMPsg channels and announces them tofor the master.
The

4. The
master then receives these announcementschannels and invokes
...
was created. Then the
5. The
master responds
...
and application. After this acknowledgement the
6. The
remote invokes
...
that was registered. Theregistered.The RPMsg channel
...
the remote processor theprocessor:
1. The
master application sends an application specificapplication-specific shutdown message
...
remote application.
2.
The remote application then cleans up it’sits resources and
...
the master. Then the
3. The
remote calls
...
remote side.
4.
The master then shuts down
...
remoteproc on its’its side. See
See
the specific
Components
The two key components that are provided by the OpenAMP framework include:
...
Bare metal remote: components/apps/echo_test/data/r5_image_echo_test
Matrix Multiplication
AThe matrix multiplication application provides a more complex test application that generates
...
are then sendsent to the
...
to multiply the
the
matrices. The
...
the result.
Linux master/Bare metal remote
The Linux master boots the bare metal firmware using remoteproc. The Linux master then transmits two randomly generated matrices using RPMsg. The bare metal firmware multiplies the two matrices and transmits the result back to the master using RPMsg.
For more information on the matrix multiplication application see the relevant source code:
Linux Master (kernel space): components/modules/rpmsg_mat_mul_kern_app/
Linux Master (user space): components/apps/mat_mul_demo/
The remote matrix multiply firmware is located at:
Bare metal remote: components/apps/mat_mul_demo/data/r5_image_matrix_multiply

Proxy Application
This application creates a proxy between the Linux master and the remote core. This allows the remote firmware to use console and execute file I/O on the master.
...
File -> New -> Application Projects
a.Specify the OS Platform as ‘standalone’
b.Specifyb. Specify the hardware platform as(hardware file for the hardware platformMPSoC created above Or you can create a new one now usingin the above stepsprevious procedure).
c.Select the processor as ‘psu_cortexr5_0’
d.Select Create New BSP or Use Existing (If you alreadyto use the BSP created one in the section above)previous procedure or select Create New BSP to create a new BSB.
Note: If
If
you select
...
xilopenamp library willis automatically be included, but
...
to be set. See above for instructions on completing this.set as described in step 4 of the previous procedure.
e.Click Next, not FinishNext to select a Available Templatean available template (do not click Finish).
2. Select one of the three application templates available for OpenAMP remote bare metal from the Available Templates:
OpenAMP echo-test
OpenAMP matrix multiplication Demo
OpenAMP RPC Demo
3.Select3.Click Finish
Include the Cortex-R5 Firmware in the PetaLinux Project
Once the user has finished developingAfter you have developed and buildingbuilt the remote firmware, the firmware they needneeds to include itbe included in the PetaLinux project.
1.Ensure

1. Ensure that
you are
...
root directory:
cd

$cd
<master_root>
2.Create

2. Create
a PetaLinux app
a.This will create an app
application inside the components/apps/<app_name> directory
petalinux-create –t
directory:
$petalinux-create -t
apps –-template--template install –n-n<app_name> --enable
INFO: Create apps: app_name
INFO: New apps successfully created in /Xilinx-ZynqMP-QEMU-2015.3/components/apps/app_name
INFO: Enabling created component...
INFO: It has been enabled to linux/rootfs
3.Copy

3. Copy
the firmware
...
XSDK into the components/apps/<app_name>/data directory.
4.Modify
this directory:
$components/apps/<app_name>/data
4. Modify
the Makefile
...
the RootFS. An example is included below:for example:
install:
$(TARGETINST) -d -p 755 data/<myfirmware> /lib/firmware/<myfirmware>
5.Rebuild5. Rebuild the PetaLinux project using the steps below
Note:
project.
TIP:
If you
...
the demo applicationsapplications, you can
...
firmware to: components/apps/<app_name>/data/components/apps/<app_name>/data/.
OpenAMP XSDK Key Source Files
Platform Info (platform_info.c)
...
Status of execution
platform_get_processor_for_fw
UnusedNot used
Resource Table (rsc_table.c/.h)
The resource table contains entries that specify the memory and virtIO device resources. This contains information on the firmware ELF start address and size. The virtIO device contains device features, vring addresses, size and alignment information. The resource table entries are specified in rsc_table.c and the remote_resource_table structure is specified in rsc_table.h.
...
Platform (platform.c/.h)
These files contain the platform specific implementation of the Inter Process Communication (IPC) hardware layer interface. It contains platform specific operations, for controlling the IPI, CPUs and interrupts.
SettingSet up PetaLinux
...

PetaLinux requires a littlethe following preparation before use:
1.Create

1. Create
the PetaLinux master project
a.Create it
in a
...
any spaces. This directory will be known as <master_root>
petalinux-create
In this guide it is named <master_root>:
$petalinux-create
-t project -s <PATH_TO_PETALINUX_ZYNQMP_PROJECT_BSP>
2.Navigate into

2. Navigate to
the <master_root> directory
cd
directory:
$cd
<master_root>
3.Configure

3. Configure
the kernel
...
work with OpenAMP
a.Start
OpenAMP:
a. Start
the PetaLinux kernel config tool
petalinux-config –c
tool:
$petalinux-config -c
kernel
b.Enable

b. Enable
loadable module supportsupport:
Kernel Configuration --->
[*] Enable loadable module support --->
c.Enablec. Enable user space firmware loading supportsupport:
Kernel Configuration --->
Device Drivers --->
...
<*> Userspace firmware loading support
[ ] Include in-kernel firmware blobs in kernel binary
...
the kernel
binary
d.Enable
binary
d. Enable
the ZynqMP
...
remoteproc driver supportsupport:
Kernel Configuration --->
Device Drivers --->
Remoteproc drivers --->
<M> ZynqMP_r5 remoteproc support
4.Enable4. Enable all of
...
modules and appsapplications in the RootFS
Note:
RootFS:
IMPORTANT:
These options
...
reference BSP. TheseThe applications in this procedure are example apps that the userexamples you can hack on.
a.Open
use.
a. Open
the RootFS configuration menu using:
petalinux-config
menu:
$ petalinux-config
-c rootfs
b.Ensure

b. Ensure
the OpenAMP apps are enabledenabled:
Apps --->
[*] echo_test --->
[*] mat_mul_demo --->
[*] proxy_app --->
c.Ensurec. Ensure the OpenAMP modules are enabledenabled:
Modules --->
[*] rpmsg_proxy_dev_driver --->
[*] rpmsg_user_dev_driver --->
Device Tree Changes
A
Settings
• The PetaLinux BSP includes a A
Device Tree
...
for OpenAMP is included in the PetaLinux BSPlocated at:
pre‑built/linux/images/openamp.dtb
This

pre-built/linux/images/openamp.dtb
• This
is built
subsystems/linux/configs/device-tree/openamp.dts
This• This file is
/include/ "openamp-overlay.dtsi"
This• This includes the
subsystems/linux/configs/device-tree/openamp-overlay.dtsi
The overlay contains the following nodes, which OpenAMP requires in the device tree:
...
#size-cells = <1>;
ranges;
rproc_0_reserved: rproc@3ed000000 {
no-map;
reg = <0x0 0x3ed00000 0x1000000>;
};

};
amba {
test_r50: zynqmp_r5_rproc@0zynqmp_r5_rproc0@0 {
compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
...
= <0x0 0x3ed00000 0x800000>, <0x0 0xff3000000xff340000 0x100>, <0x0 0xff9a0000
0xff9a0000
0x400>, <0x0
...

reg-names ="vring0","ipi", "rpu_base",
core_conf = "split0";
method = "direct";
bootmem = "ocm";
firmware = "r5_image_echo_test";
ipi_dest_mask = <0x100>;

interrupt-parent = <&gic>;
...
= <0 3529 4>;
} ;

} ;
};
Reserved Memory
The OpenAMP framework requires shared memory that is reserved in
Build the DTB. The shared memory is used by RPMsg to pass the messages between the processors. The amount of memory is determined by the number of communication buffers multiplied by the buffer size. These are user configurable, but in this case there are 256 buffers with a size of 512 bytes each. This value has been testedApplications and knownLinux Project
Proceed as follows
to work, users are cautioned that other values have not been tested and might have issues.
Remoteproc
The remoteproc must be specified in
build the kernel DTB, an example of which is shown above. A basic explanation of the device tree is given below. See the Linux kernel device tree documentation for more details on the DTS entry.
Build the Applications
applications and Linux
One the PetaLinux project is setup follow the procedure bellow:
1.Ensure
project:
1. Ensure that
you are
...
root directory:
cd

$cd
<master_root>
2.Build PetaLinux using the following command:
petalinux-build
INFO: Checking component...
INFO: Generating make files and build linux
INFO: Generating make files for the subcomponents of linux
INFO: Building linux
[INFO ] pre-build linux/rootfs/rpmsg_echo_test_kern_app
[INFO ] pre-build linux/rootfs/rpmsg_mat_mul_kern_app
[INFO ] pre-build linux/rootfs/rpmsg_proxy_dev_driver
[INFO ] pre-build linux/rootfs/rpmsg_user_dev_driver
[INFO ] pre-build linux/rootfs/hello_lib
[INFO ] pre-build linux/rootfs/hello_lib1
[INFO ] pre-build linux/rootfs/echo_test
[INFO ] pre-build linux/rootfs/fwupgrade
[INFO ] pre-build linux/rootfs/getty-baud
[INFO ] pre-build linux/rootfs/gpio-demo
[INFO ] pre-build linux/rootfs/hello
[INFO ] pre-build linux/rootfs/mat_mul_demo
[INFO ] pre-build linux/rootfs/openamp_echo
[INFO ] pre-build linux/rootfs/peekpoke
[INFO ] pre-build linux/rootfs/proxy_app
[INFO ] pre-build linux/rootfs/xen
[INFO ] build linux/kernel
[INFO ] update linux/u-boot source
[INFO ] generate linux/u-boot configuration files
[INFO ] build linux/u-boot
[INFO ] build zynqmp_fsbl
[INFO ] update linux/arm-trusted-firmware source
[INFO ] build linux/arm-trusted-firmware
[INFO ] build kernel in-tree modules
[INFO ] modules linux/kernel
[INFO ] build linux/rootfs/rpmsg_echo_test_kern_app
[INFO ] modules linux/kernel
[INFO ] build linux/rootfs/rpmsg_mat_mul_kern_app
[INFO ] modules linux/kernel
[INFO ] build linux/rootfs/rpmsg_proxy_dev_driver
[INFO ] modules linux/kernel
[INFO ] build linux/rootfs/rpmsg_user_dev_driver
[INFO ] modules linux/kernel
[INFO ] build linux/rootfs/hello_lib
[INFO ] build linux/rootfs/hello_lib1
[INFO ] build linux/rootfs/echo_test
[INFO ] build linux/rootfs/fwupgrade
[INFO ] build linux/rootfs/getty-baud
[INFO ] build linux/rootfs/gpio-demo
[INFO ] build linux/rootfs/hello
[INFO ] build linux/rootfs/mat_mul_demo
[INFO ] build linux/rootfs/openamp_echo
[INFO ] build linux/rootfs/peekpoke
[INFO ] build linux/rootfs/proxy_app
[INFO ] build linux/rootfs/xen
[INFO ] post-build linux/rootfs/rpmsg_echo_test_kern_app
[INFO ] post-build linux/rootfs/rpmsg_mat_mul_kern_app
[INFO ] post-build linux/rootfs/rpmsg_proxy_dev_driver
[INFO ] post-build linux/rootfs/rpmsg_user_dev_driver
[INFO ] post-build linux/rootfs/hello_lib
[INFO ] post-build linux/rootfs/hello_lib1
[INFO ] post-build linux/rootfs/echo_test
[INFO ] post-build linux/rootfs/fwupgrade
[INFO ] post-build linux/rootfs/getty-baud
[INFO ] post-build linux/rootfs/gpio-demo
[INFO ] post-build linux/rootfs/hello
[INFO ] post-build linux/rootfs/mat_mul_demo
[INFO ] post-build linux/rootfs/openamp_echo
[INFO ] post-build linux/rootfs/peekpoke
[INFO ] post-build linux/rootfs/proxy_app
[INFO ] post-build linux/rootfs/xen
[INFO ] pre-install linux/rootfs/rpmsg_echo_test_kern_app
[INFO ] pre-install linux/rootfs/rpmsg_mat_mul_kern_app
[INFO ] pre-install linux/rootfs/rpmsg_proxy_dev_driver
[INFO ] pre-install linux/rootfs/rpmsg_user_dev_driver
[INFO ] pre-install linux/rootfs/hello_lib
[INFO ] pre-install linux/rootfs/hello_lib1
[INFO ] pre-install linux/rootfs/echo_test
[INFO ] pre-install linux/rootfs/fwupgrade
[INFO ] pre-install linux/rootfs/getty-baud
[INFO ] pre-install linux/rootfs/gpio-demo
[INFO ] pre-install linux/rootfs/hello
[INFO ] pre-install linux/rootfs/mat_mul_demo
[INFO ] pre-install linux/rootfs/openamp_echo
[INFO ] pre-install linux/rootfs/peekpoke
[INFO ] pre-install linux/rootfs/proxy_app
[INFO ] pre-install linux/rootfs/xen
[INFO ] install system.dtb
[INFO ] install linux/kernel
[INFO ] update linux/u-boot source
[INFO ] generate linux/u-boot configuration files
[INFO ] build linux/u-boot
[INFO ] install linux/u-boot
[INFO ] install linux/arm-trusted-firmware
[INFO ] install sys_init
[INFO ] install kernel in-tree modules
[INFO ] modules_install linux/kernel
[INFO ] install linux/rootfs/rpmsg_echo_test_kern_app
[INFO ] modules_install linux/kernel
[INFO ] install linux/rootfs/rpmsg_mat_mul_kern_app
[INFO ] modules_install linux/kernel
[INFO ] install linux/rootfs/rpmsg_proxy_dev_driver
[INFO ] modules_install linux/kernel
[INFO ] install linux/rootfs/rpmsg_user_dev_driver
[INFO ] modules_install linux/kernel
[INFO ] install linux/rootfs/hello_lib
[INFO ] install linux/rootfs/hello_lib1
[INFO ] install linux/rootfs/echo_test
[INFO ] install linux/rootfs/fwupgrade
[INFO ] install linux/rootfs/getty-baud
[INFO ] install linux/rootfs/gpio-demo
[INFO ] install linux/rootfs/hello
[INFO ] install linux/rootfs/mat_mul_demo
[INFO ] install linux/rootfs/openamp_echo
[INFO ] install linux/rootfs/peekpoke
[INFO ] install linux/rootfs/proxy_app
[INFO ] install linux/rootfs/xen
[INFO ] post-install linux/rootfs/rpmsg_echo_test_kern_app
[INFO ] post-install linux/rootfs/rpmsg_mat_mul_kern_app
[INFO ] post-install linux/rootfs/rpmsg_proxy_dev_driver
[INFO ] post-install linux/rootfs/rpmsg_user_dev_driver
[INFO ] post-install linux/rootfs/hello_lib
[INFO ] post-install linux/rootfs/hello_lib1
[INFO ] post-install linux/rootfs/echo_test
[INFO ] post-install linux/rootfs/fwupgrade
[INFO ] post-install linux/rootfs/getty-baud
[INFO ] post-install linux/rootfs/gpio-demo
[INFO ] post-install linux/rootfs/hello
[INFO ] post-install linux/rootfs/mat_mul_demo
[INFO ] post-install linux/rootfs/openamp_echo
[INFO ] post-install linux/rootfs/peekpoke
[INFO ] post-install linux/rootfs/proxy_app
[INFO ] post-install linux/rootfs/xen
[INFO ] package rootfs.cpio to /Xilinx-ZynqMP-QEMU-2015.3/images/linux
[INFO ] Update and install vmlinux image
[INFO ] vmlinux linux/kernel
[INFO ] install linux/kernel
[INFO ] package Image
[INFO ] Image linux/kernel
[INFO ] install linux/kernel
[INFO ] Package HDF bitstream
Note:

2. Build PetaLinux:
$petalinux-build
TIP:
If you
...
see the verboserespective textual output.
If
If the build is successfulsuccessful, the images will be located in the image/linux folderfolder:
<master_root>/images/linux
BootingBoot the PetaLinux Project
You can boot the PetaLinux Project from
QEMU
Similar to running
or hardware.
Boot on QEMU
After a successful build,
the PetaLinux project on hardware, once it has been built it can be
...
on QEMU.
1.Navigate

1. Navigate
to the PetaLinux directory
cd
directory:
$cd
<master_root>
2.Run

2. Run
PetaLinux boot
petalinux-boot –-qemu –-kernel
Sending discover...
Sending select for 10.0.2.15...
Lease of 10.0.2.15 obtained, lease time 86400
/etc/udhcpc.d/50default: Adding DNS 10.0.2.3
done.
Stopping Bootlog daemon: bootlogd.
[ 27.276696] hrtimer: interrupt took 31292320 ns
Warning unable to detect baudrate, use 115200!
Use default dev ttyPS0
Running dynamic getty
boot:
$petalinux-boot --qemu --kernel
Boot
on ttyPS0/115200
Built with PetaLinux v2015.3 (Yocto 1.8) Xilinx-ZynqMP-QEMU-2015_3 /dev/ttyPS0
Xilinx-ZynqMP-QEMU-2015_3 login: root
Password:
login[1336]: root login on 'ttyPS0'
root@Xilinx-ZynqMP-QEMU-2015_3:~#
Booting the
Hardware
Once

After a successful build,
the PetaLinux project has been built, it can be ranrun on the hardware. Follow the instructions belowthese procedures to boot OpenAMP on an EP108
Setup
a board.
Set Up
the board
1.Connect
Board
1. Connect
the board
...
your computer, ensuringand ensure that it
...
powered on.
2.Program

2. Program
the relevant bit streamsbitstreams to the
...
RTL v5.2
a.This
This must be
...
separately from PetaLinux
3.If
PetaLinux.
3. If
the board
...
remote system.
4.Connect

4. Open a console terminal and connect it
to the USART of the EP108board’s UART.
Download the Images
...
the PetaLinux directory
cd
directory:
$cd
<master_root>
2.Run

2. Run the
PetaLinux boot
a.Targeting
boot:
° Using
a remote system:
petalinux-boot

$petalinux-boot
--jtag --kernel --hw_server-url <remote_system>
a.Targeting

° Using
a local system:
petalinux-boot

$petalinux-boot
--jtag --kernel
Note:

TIP:
If you
...
see the verbosetextual output.
Running

Run
the Example Apps
Once
Applications
After
the system
...
up and running the user can loginrunning, log in with the
...
and password ‘root’. Once logged onroot. After logging in, the following
...
are available:
Running

Run
the Echo Test
1.Load

1. Load
the Echo
...
firmware and driver
a.This
driver. This loads the
...
and RPMsg modulesmodules:
modprobe zynqmp_r5_remoteproc firmware=r5_image_echo_test
modeprobe rpmsg_user_dev_driver
2.Run2. Run the test:
echo_test
Xilinx-ZynqMP-QEMU-2015_3 login: root
Password:
login[1336]: root login on 'ttyPS0'
root@Xilinx-ZynqMP-QEMU-2015_3:~# modprobe zynqmp_r5_remoteproc firmware=r5_imag
e_echo_test
root@Xilinx-ZynqMP-QEMU-2015_3:~# modprobe rpmsg_user_dev_driver
root@Xilinx-ZynqMP-QEMU-2015_3:~# echo_test
Echo test start
3.The
3. The test will start,starts, follow the
...
complete the test
4.Once
test.
4. After
you have completed the testtest, unload the appapplication:
modeprobe –r rpmsg_user_dev_driver
modprobe –r zynqmp_r5_remoteproc
Note: OnceIMPORTANT: After you have exited the app,application, you will need tomust unload and
...
the test.
Running

Run
the Matrix Multiplication Test
1.Load

1. Load
the Matrix Multiply application
a.This
application. This loads the
...
modules and applicationapplications”
modprobe zynqmp_r5_remoteproc firmware=r5_image_matrix_multiply
modeprobe rpmsg_user_dev_driver
2.Run2. Run the test:
mat_mul_demo
root@Xilinx-ZynqMP-QEMU-2015_3:~# modprobe zynqmp_r5_remoteproc firmware=r5_image_matrix_multiply
root@Xilinx-ZynqMP-QEMU-2015_3:~# modprobe rpmsg_user_dev_driver
root@Xilinx-ZynqMP-QEMU-2015_3:~# mat_mul_demo
Matrix multiplication demo start
Open rpmsg dev!
Query internal info ..
rpmsg kernel fifo size = 0
rpmsg kernel fifo free space = 0
Creating ui_thread and compute_thread ...
****************************************
Please enter command and press enter key
****************************************
1 - Generates random 6x6 matrices and transmits them to remote core over rpmsg ..
2 - Quit this application ..
CMD>1
Compute thread unblocked ..
The compute thread is now blocking ona read() from rpmsg device
Generating random matrices now ...
Master : Linux : Input matrix 0
5 2 8 2 5 6
6 6 3 5 4 8
0 3 7 7 9 2
8 7 6 2 0 2
1 7 0 5 9 8
9 7 2 9 9 8
Master : Linux : Input matrix 1
8 5 4 3 3 8
4 5 4 1 2 3
4 0 2 0 4 2
4 5 1 6 3 3
5 4 0 7 6 1
7 4 9 2 7 4
Writing generated matrices to rpmsg rpmsg device, 296 bytes written ..
3.The
3. The test will start,starts, follow the
...
complete the test
4.Once
test.
4. After
you have completed the testtest, unload the appapp:
modeprobe –r rpmsg_user_dev_driver
modprobe –r zynqmp_r5_remoteproc
Note: OnceIMPORTANT: After you have exited the app,application, you will need tomust unload and
...
the test.
Running

Run
the Proxy Application
1.Load

1. Load
and run
...
in one step
a.The
step. The proxy application
...
the required modulesmodules:
proxy_app
2.When2. When the application
...
you to “Enter name”Enter name enter a string
3.When
string.
3. When
the application
...
you to “Enter age”Enter age enter an integer
4.When
integer.
4. When
the application
...
you to “EnterEnter value for pi”p enter a floating point number
5.The
number.
5. The
application will then promptprompts you to re-run the test
6.Once
test.
6. After
you exit the application it will automatically unload the module
remoteproc Development
The remoteproc APIs that are provided by the OpenAMP framework allows software applications on the master to manage the remote processor and it’s relevant software. Below is a brief overview of the remoteproc APIs and workflow.
API Functions
Listed below are the key functions for the remoteproc OpenAMP framework. This information is based on the documentation available in the remoteproc.h header file.
remoteproc_resource_init
Initializes resources for remoteproc remote configuration. Only remoteproc remote applications are allowed to call this function.
Usage
int remoteproc_resource_init( struct rsc_table_info *rsc_info,
rpmsg_chnl_cb_t channel_created,
rpmsg_chnl_cb_t channel_destroyed;
rpmsg_rx_cb_t default_cb,
struct remote_proc** rproc_handle);
Arguments
rsc_info - pointer to resource table info control
block
channel_created - callback function for channel creation
channel_destroyed - callback function for channel deletion
default_cb - default callback for channel I/O
rproc_handle - pointer to new remoteproc instance
Returns
Status of execution
Extra Information
This is called once the remote application is running on the remote processor to create the virtio/RPMsg devices which are used for IPC. This API causes remoteproc to use the RPMsg name service to announce the RPMsg channels served by the remote application.
remoteproc_resource_deinit
Uninitialized resources for remoteproc remote configuration.
Usage
int remoteproc_resource_deinit(struct remote_proc *rproc);
Arguments
Rproc - pointer to remoteproc instance
Returns
Status of execution
remoteproc_shutdown
This function shutdowns the remote execution context.
Usage
int remoteproc_shutdown(struct remote_proc *rproc);
Arguments
rproc - pointer to remoteproc instance to shutdown
Returns
Status of function execution
unloads automatically.
RPMsg Development
The RPMsg APIs that are provided by the OpenAMP framework allow bare metal or RTOS applications to perform Inter Process Communication (IPC) in an AMP configuration. Regardless of whether it is running on a master or remote processor.

Measure KCU105 Power

$
0
0
Important! Tag the page
Important! All External Links should open in a new tab/window; all Internal Links to Xilinx wiki pages, should open in the same tab/window.
Files associated with the KCU105 Power Monitoring Video are hosted here.
Section 1
Sub-Heading 1
Sub-Heading 2
Insert Code: Use Widget-> Insert Code
Insert your code here.
Related Links
Title 1 & Link 1
Title 1 & Link 1

collect_volt_current.tcl

Measure KCU105 Power

$
0
0
Important! Tag the page
Important! All External Links should open in a new tab/window; all Internal Links to Xilinx wiki pages, should open in the same tab/window.
...
hosted here.
Section 1
Sub-Heading 1
Sub-Heading 2

TCL Scripts
Please find the tcl files mentioned in the video here:
{collect_volt_current.tcl}
Wizard Files

Insert Code: Use Widget-> Insert Code
Insert your code here.
Related Links
Title 1 & Link 1
Title 1 & Link 1
System Monitor User Guide - UG580
Driving the Xilinx Analog-to-Digital Converter XAPP795

Measure KCU105 Power

$
0
0
Important! Tag the page
Important! All External Links should open in a new tab/window; all Internal Links to Xilinx wiki pages, should open in the same tab/window.

Files associated with the KCU105 Power Monitoring Video are hosted here.
TCL Scripts
...
{collect_volt_current.tcl}
Wizard Files
Insert Code: Use Widget-> Insert Code
Insert your code here.
The System Management Wizard file used in the design shown in the video.
Related Links
System Monitor User Guide - UG580

MPSoC Power Management Unit Firmware Development

$
0
0
The purpose of this page is to describe how to build and run PMU Firmware on QEMU.
SOFTWARE TOOLS AND SYSTEM REQUIREMENTS
Xilinx Vivado 2015.2_ZUB2
Xilinx Petalinux 2015.2_ZUB2
Build PMUFW
1) Create a HW design in Vivado and export it to SDK
2) Open Xilinx SDK
3) Create a new workspace
4) Select *File->New->Application Project*
5) Select *psu_microblaze_0* from Processors List
6) Click *Next*
7) Select *ZynqMP PMU Firmware* App and click *Finish*
Now you should have a PMUFW_ELF generated.
Creating a SelfSuspend App for A53/R5
1. Open SDK and create a BSP for A53/R5 (File->New->Board Support Package)
2. From the BSP settings dialogue, select xilpm library
3. Click Finish and let the library build complete
4. Now Open the mss file and scroll down to library section
5. Select "Import Examples" link beside xilpm
6. Select xilpm_selfsuspend_example from the list and click OK to Import
7. You should have an test App elf built under the Debug section.
Running on QEMU:
PMU Firmware can be executed in a QEMU MultiArch environment with two separate QEMU Instances (machines).
Instructions:
1. Source settings.sh from the Petalinux installation
2. Create a Petalinux ZynqMP QEMU Project
3. Check for the DTBs/ROM:
ARM_DTB: pre-built/linux/images/zynqmp-qemu-arm.dtb
PMU_DTB: pre-built/linux/images/zynqmp-qemu-pmu.dtb
PMU_ROM_ELF: pre-built/linux/images/pmu_rom_sha3.elf
These DTBs/ELFs will be used in the rest of this readme.
4. Create a qemu-tmp directory; This is used by the QEMU machines
5. Open two terminals, One for ARM_QEMU machine and the other for PMU_QEMU Machine
6. On PMU_QEMU, execute the following command to start PMU machine:
qemu-system-microblazeel -M microblaze-fdt -hw-dtb <path_to_PMU_DTB> -kernel <path_to_PMU_ROM_ELF> -nographic -machine-path qemu-tmp
7. On ARM_QEMU , execute the following command to start ARM machine:
qemu-system-aarch64 -M arm-generic-fdt -hw-dtb <path_to_ARM_DTB> -gdb tcp::6667 -nographic -machine-path qemu-tmp -tftp <path_to_PETALINUX_IMAGES>
8. Load PMU Firmware on PMU_QEMU:
device_add loader,file=<path_to_pmufw_elf>,cpu=0
After executing this command, you should see a PMU-FW banner message on STDOUT:
PMU Firmware rc1-00006-gdc6ab46 Apr 8 2015 13:34:48
EM (MOD-0): Initialized.
PMU-PM: Power Management Init
9. Start xsdb and connect to ZynqMP:
gdbremote connect localhost:6667
Follow one of 10a or 10b to run the example application on the A53 or R5 core.
10a. Load and run test app on A53 using xsdb:
targets -set -filter {name =~ "Cortex-A53 #0"} # APU 0
dow <path_to_standalone_selfsuspend_app_a53_elf>
mask_write 0xfd1a0104 0x3d01 0 # release APU reset
con
10b. Load and run test app on R5 using xsdb:
targets -set -filter {name =~ "Cortex-R5 #0"} # RPU 0
dow <path_to_standalone_selfsuspend_app_a53_elf>
mask_write 0xff5e023c [expr ~2] 0 # release RPU reset
con
11. You should now see the Test App output on STDOUT

MPSoC OpenAMP

$
0
0
...
6. After you exit the application the module unloads automatically.
RPMsg Development
...
RPMsg APIs that are provided by
...
an AMP configuration. Regardless of whether it isconfiguration, running on either a master
API Functions
Listed below are theThe key functions for the RPMsgremoteproc OpenAMP framework.framework are described in this section. This information
...
in the rpmsg.hremoteproc.h header file.
rpmsg_sendto
SendSends a message acrosscontaining data and payload length to the remote processor, specify dst
This function sends @data
destination address of length @len to the remote @dst address.The message will be sentprocessor respective to the remote processor which the @rpdevrpdev channel belongs to, using @rpdev'sthe rpdev's source address. In caseIf there are
are
no TXTx buffers available, the function will blockremains blocked until one
...
or a timeouttime-out of 15
...
the latter happens, -ERESTARTSYSoccurs, ERESTARTSYS is returned.
Can
Presently, this API can only be
...
from process context (for now).context.
Usage
static inline int rpmsg_sendto( struct rpmsg_channel *rpdev,
...
Returns 0 on success and an appropriate error value on failure.
rpmsg_send
SendSends a message acrosscontaining data and payload length to the remote processor
This function sends @data
destination address of length @len on the @rpdev channel. The message will be sent to the remote processor whichrespective to the @rpdevrpdev channel belongs to, using @rpdev'sthe rpdev's source and destination addresses. In caseaddress. If there are no TXTx buffers available, the function will blockremains blocked until one
...
or a timeouttime-out of 15
...
the latter happens, -ERESTARTSYSoccurs, ERESTARTSYS is returned.
Can
Presently, this API can only be
...
from process context (for now).context.
Usage
static inline int rpmsg_send(struct rpmsg_channel *rpdev, void *data, int len)
...
Returns 0 on success and an appropriate error value on failure.
rpmsg_send_offchannel
SendSends a message using explicit src/dst addresses
This function sends @data of
containing data and payload length @len to the destination address of the remote @dst address, and uses @srcprocessor respective to the rpdev channel using src as the source address. The message will be sent to the remote processor which the @rpdev channel belongs to. In caseIf there are
are
no TXTx buffers available, the function will blockremains blocked until one
...
or a timeouttime-out of 15
...
the latter happens, -ERESTARTSYSoccurs, ERESTARTSYS is returned.
Can
Presently, this API can only be
...
from process context (for now).context.
Usage
static inline int rpmsg_send_offchannel( struct rpmsg_channel *rpdev,
...
Returns 0 on success and an appropriate error value on failure.
rpmsg_trysend
SendSends a message acrosscontaining data and payload length to the remote processor
This function sends @data
destination address of length @len on the @rpdev channel. The message will be sent to the remote processor whichrespective to the @rpdevrpdev channel belongs to, using @rpdev'sthe rpdev's source and destination addresses. In case
addresses. If
there are no TXTx buffers available, the function will immediately return -ENOMEMreturns ENOMEM without waiting
...
becomes available.
Can
Presently, this API can only be called from process context (for now).
process context.

Usage
static inline int rpmsg_trysend(struct rpmsg_channel *rpdev, void *data, int len)
...
Returns 0 on success and an appropriate error value on failure.
rpmsg_trysendto
SendSends a message acrosscontaining data and payload length to the remote processor, specify dst
This function sends @data
destination address of length @len to the remote @dst address. The message will be sentprocessor respective to the remote processor which the @rpdevrpdev channel belongs to, using @rpdev'sthe rpdev's source address. In case thereaddresses. If
there
are no TXTx buffers available, the function will immediately return -ENOMEMreturns ENOMEM without waiting
...
becomes available.
Can
Presently, this API can only be
...
from process context (for now).
context.

Usage
static inline int rpmsg_trysendto( struct rpmsg_channel *rpdev,
...
Returns 0 on success and an appropriate error value on failure.
rpmsg_trysend_offchannel
SendSends a message using explicit src/dst addresses
This function sends @data of
containing data and payload length @len to the destination address of the remote @dst address, and uses @srcprocessor respective to the rpdev channel using src as the source address. The message will be sent to the remote processor which the @rpdev channel belongs to. In caseIf there are
are
no TXTx buffers available, the function will immediately return -ENOMEMreturns ENOMEM without waiting
...
becomes available.
Can
Presently, this API can only be
...
from process context (for now).context.
Usage
static inline int rpmsg_trysend_offchannel( struct rpmsg_channel *rpdev, unsigned long src,
...
Returns 0 on success and an appropriate error value on failure.
rpmsg_init
Thus function allocatesAllocates and initializes
...
resources for a given device id (cpu id).Theid). The successful return
...
this function leaves fully enabledenables the IPC link.
Usage
int rpmsg_init( int dev_id, struct remote_device **rdev,
...
Status of function execution
rpmsg_deinit
Thus function releasesReleases the rpmsg
...
resources for a given remote
Usage
void rpmsg_deinit(struct remote_device *rdev);

MPSoC Open Source Development

$
0
0
List of Software components to be built in OSL method:
1. FSBL
2. Uboot
3. Linux kernel
4. Device tree
5. RootFS
6. Boot Image
7. List of Boot images
=============
1. FSBL
=============
The FSBL (First Stage Boot Loader) is created based on the hardware platform.
We have hardware definitions (SDK_Export) exported from Vivado.
The SDK_Export contain a *.hdf file.
Lets assume, Vivado provided test.hdf
Perform below steps in the Linux development PC
o Create folder: /home/user/fsbl
o Copy test.hdf into this folder
o Unzip the file (unzip test.hdf), to extract the BIT file, that is used to create boot image.
o Start SDK tool, select workspace as /home/user/fsbl
o Import hardware design (File -> New -> Project… -> Hardware Platform Specification -> Next -> Browse)
o Select the path for HDF (/home/user/fsbl/test.hdf)
o Select test.hdf -> OK -> Finish
o Create BSP and FSBL (File -> New -> Application Project)
o Type project name (ex: test_fsbl), leave all options as defaults, press Next
o Select ”Zynq FSBL”, click Finish
o This completes FSBL creation. The fsbl image is at:
/home/user/fsbl/test_fsbl/Debug/test_fsbl.elf)
=============
2. U-Boot
=============
The U-boot is built with default source tree, without any change.
Perform following steps to rebuild uboot image
o git clone git://github.com/Xilinx/u-boot-xlnx.git
o cd u-boot-xlnx
o git checkout –b <your branch name> <required branch tag>
example: git checkout –b my_uboot_branch xilinx-v2014.2
o make zynq_zc70x_config
o make
o mv u-boot u-boot.elf
=============
3. Linux kernel
=============
The Linux Kernel is built with default source tree, with some changes.
The changes are provided in the form of patch.
Perform following steps to rebuild kernel image
Clone the latest source from git server
o git clone git://github.com/Xilinx/linux-xlnx.git
o cd linux-xlnx
o git checkout –b <your branch name> <required branch tag>
example: git checkout –b my_kernel_branch xilinx-v2014.2
Apply specific changes, get the patch from provider to linux-xlnx
example: test.patch
o git apply --stat test.patch
o git apply --check test.patch
o git am test.patch
Build the images
o make ARCH=arm <your>_defconfig
use any of the predefined kernel configurations from the folder arch/arm/configs
alternately, create your own configuration, using the below command:
make ARCH=arm menuconfig
o make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage modules
This step builds the following image
arch/arm/boot/uImage
=============
4. Devicetree
=============
The device tree blob is used by the Kernel Image during the boot time.
The device trees are modified for each of the designs, to load and configure the hardware IPs appropriately.
Example: test.dts is provided by vendor.
Build the DTB by following the command below (at the Linux root folder):
o ./scripts/dtc/dtc -I dts -O dtb -f test.dts -o devicetree.dtb
=============
5. RootFS
=============
We always use default rootfs file (ramdisk.image.gz)
Rootfs can be in 2 flavors: INITRD and INITRAMFS.
Below are the steps on how to modify the content.
INITRD:
To modify an initial ramdisk:
1. Extract the initrd image from the gzip archive.
gunzip ramdisk.image.gz
2. Mount the initrd image.
chmod u+rwx ramdisk.image
mkdir tmp_mnt/
sudo mount -o loop ramdisk.image tmp_mnt/
cd tmp_mnt/
3. Make changes in the mounted filesystem.
4. Unmount the initrd image and compress the image.
sudo umount tmp_mnt/
gzip ramdisk.image
To create an initrd from scratch, tools such as Buildroot or Yocto may be used to populate
the filesystem (with BusyBox, tools, etc.).
Alternatively, an empty initrd may be created and then populated with the desired filesystem
contents as specified above. To create an empty (8MB) initrd:
dd if=/dev/zero of=ramdisk.image bs=1024 count=8192
mke2fs -F ramdisk.image -L "ramdisk" -b 1024 -m 0
tune2fs ramdisk.image -i 0
chmod a+rwx ramdisk.image
INITRAMFS:
To modify an initramfs:
1. Extract the contents of the cpio.gz archive.
mkdir tmp_mnt/
gunzip -c initramfs.cpio.gz | sudo sh -c 'cd tmp_mnt/ && cpio -i'
cd tmp_mnt/
2. Make changes to the filesystem.
3. Repack the filesystem into a cpio.gz archive.
sh -c 'cd tmp_mnt/ && sudo find . | sudo cpio -H newc -o' | gzip -9 > new_initramfs.cpio.gz
To create an initramfs from scratch, tools such as Buildroot or Yocto may be used to populate
the filesystem (with BusyBox, tools, etc.).
Alternatively, initramfs image may be created by populating a directory with the desired filesystem
contents and packing these contents into a cpio.gz archive as mentioned above.
Create final Rootfs image:
Wrapping the image with a U-Boot header
For Zynq AP SoC only, the ramdisk.image.gz needs to be wrapped with a U-Boot header in order
for U-Boot to boot with it:
mkimage -A arm -T ramdisk -C gzip -d ramdisk.image.gz uramdisk.image.gz
=============
6. Boot Image
=============
In the SDK GUI, boot image can be built by the following steps.
o Click on Xilinx Tools and select Create Zynq Boot Image option.
o In the window which opens, ensure that the following is added in order
o FSBL elf (test_fsbl.elf, built in above steps).
o Design bit file (extracted from the test.hdf, in above steps).
o u-boot elf (u-boot.elf, built in above steps).
o Provide output folder name and click on Create Image.
This creates the boot image (bin file) for the design
=============
7. List of Boot images
=============
Here are list of boot images needed to copy on SD or QSPI.
1. BOOT.bin (contains FSBL, BITSTREAM, UBOOT images)
2. uImage
3. devicetree.dtb
4. uramdisk.image.gz

Xilinx recommends Software Developers to use the Petalinux tools for their Linux Software development. Please refer Petalinux Tools Documentation

ARTY Power Demo

$
0
0
Important! Tag the page with: trd
Important! Include a link to this page from: http://www.wiki.xilinx.com/Targeted+Reference+Designs
All External Links should open in a new tab/window; all Internal Links to Xilinx wiki pages, should open in the same tab/window.
ARTY Power Demo
<Insert introduction text here>
Section 1
Sub-Heading 1
Sub-Heading 2
Insert Code: Use Widget-> Insert Code
Insert your code here.
Related Links
Title 1 & Link 1
Title 1 & Link 1

ARTY Power Demo

$
0
0
Important! Tag the page with: trd
Important! Include a link to this page from: http://www.wiki.xilinx.com/Targeted+Reference+Designs
All External Links should open
Work in a new tab/window; all Internal Links to Xilinx wiki pages, should open in the same tab/window.Progress.- Not Released yet
ARTY Power Demo
<Insert introduction text here>

Zynq-7000 AP SoC - Performance - Ethernet Packet Inspection - Linux - Redirecting Packets to PL and Cache Tech Tip

$
0
0
...
‍Linux Kernel Image
Clone the latest Zynq Linux kernel git repository from the Xilinx git server
...
git clone -b xilinx-v14.6 git://github.com/xilinx/linux-xlnx.git
$ cd linux-xlnx
To demonstrate the Ethernet packet bifurcation, use the driver with the patch file present in the Zynq7000AP_SoC_Ethernet_Packet_Inspection_Linux_design/packet_bifurcation/sw directory.

Zynq-7000 AP SoC - Performance - Ethernet Packet Inspection - Linux - Redirecting Packets to PL and Cache Tech Tip

$
0
0
...
Files Provided
Zynq7000AP_SoC_Ethernet_Packet_Inspection_Linux_design.zip
...
the files
Step by Step Instructions
Setting up the ZC706 Board and running the precompiled images.
...
This section explains how to download the sources, configure, patch, and build the Linux kernel image and the device tree blob. For additional information, refer to the Xilinx Zynq Linux wiki.
‍Linux Kernel Image
Clone the latestxilinx-v14.6 tagged Zynq Linux
$ git clone -b xilinx-v14.6 git://github.com/xilinx/linux-xlnx.git
$ cd linux-xlnx

boot.bin

Viewing all 11776 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>