12-03-2015 04:13 AM
I built an AMP project using openAMP with linux on cpu0 and baremetal application on cpu1 for MicroZed board. The elf code
Following the steps of openamp_ref.pdf and additionally using the changes of the following thread
I got a working example of the math mulitiplication demo (tested both, baremetal and freertos) using SDK of Vivado 2015.4, which is a good starting point for further custom developments. I did the following:
- create Hardware Platform Specification (choose the corresponding system_wrapper.hdf of my hdl project)
- create Board Support Package for cpu1 (made sure that Overview->xilopenamp is checked, and '-DUSE_AMP=1' is appended in drivers->ps7_cortexa9_1)
- create Application Project (choose OpenAMP matrix multiplication demo)
- in the Application Project change memory region values of lscript.ld to my needs
- put the elf file to my linux file system
This works well, for both freertos and baremetal. However when I build a custom application project (also using cpu1) for lighting up the led on the microzed using the xgpiops.h, nothing happens (no led light). I am using no interrupts or anything, just the I/O resource. As far as I know, I/O resources are shared for both cpus on zynq.
Is that right? The led program works on cpu0 (without -DUSE_AMP=1 flag). Did I miss anything? Does linux do anything to the I/O resources?
12-03-2015 05:58 AM
Yes Linux does alter the clocks for any devices not being used by the kernel and you should see discussions of this in other threads.
And I documented a workaround on the wiki. I've not tested it on a later kernel.
12-03-2015 10:04 AM
Thank you John.
Adding clk_ignore_unused to the boot arguments and comment the clock line in gpios device tree entry solvend my problem. This is what the device tree entry looks now:
For future changes I will have to remember that this change will be overwritten whenever petalinux-config is being called. Hm, I just hope this will not interfere with any other device-tree entry, relying on gpio0.
12-03-2015 10:14 AM
12-04-2015 02:57 AM
I double checked it. Only if I do both, disable the gpio0 node in the device-tree and add "clk_ignore_unused" to my bootargs I am able to interface the led by cpu1. Checking my device-tree I found that gpio0 trouly is being used by the usb-reset of usb0:
dr_mode = "host";
phy_type = "ulpi";
status = "okay";
usb-reset = <&gpio0 7 0>;
Hm, is there a way to share resources by cpu0 and cpu1 in general? Perhaps by semaphores?
12-10-2015 06:50 AM
10-26-2016 10:14 PM
I recently met kind of the same problem described in this thread. I'm using OpenAMP (CPU0 for petaliunx, CPU1 for baremetal CAN bus application).
The CAN bus works fine both in AMP mode and also in baremetal mode, however when I use OpenAMP to load the baremetal application from linux, the CAN bus failed to work.
Any suggestions ?
10-26-2016 10:16 PM
02-07-2017 04:14 AM
I am using zynq7000 in Amp mode, Petalinux(cpu0) and freertos(cpu1), I am able to boot both the cpu's successfully.
I am trying to control gpio from cpu1. I am not able to write it. I tried the steps you provided. But I am not sure am doing it in right way. Please can uyou explain how to make "clk_ignore_unused" in bootargs.