UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor nerdomat
Visitor
11,507 Views
Registered: ‎08-13-2014

I/O resource on cpu1

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

(https://forums.xilinx.com/t5/OpenAMP/port-microzed-for-openAMP/td-p/662778)

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?

0 Kudos
8 Replies
Xilinx Employee
Xilinx Employee
11,502 Views
Registered: ‎09-10-2008

Re: I/O resource on cpu1

Hi,

 

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.

 

http://www.wiki.xilinx.com/Device+Tree+Tips#Clocks

 

Thanks

John

0 Kudos
Visitor nerdomat
Visitor
11,496 Views
Registered: ‎08-13-2014

Re: I/O resource on cpu1

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:

gpio0: gpio@e000a000 {
      compatible = "xlnx,zynq-gpio-1.0";
      #gpio-cells = <2>;
      /*clocks = <&clkc 42>;*/
      gpio-controller;
      interrupt-parent = <&intc>;
      interrupts = <0 20 4>;
      reg = <0xe000a000 0x1000>;
    };

 

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.

0 Kudos
Xilinx Employee
Xilinx Employee
11,494 Views
Registered: ‎09-10-2008

Re: I/O resource on cpu1

That same wiki page shows how to disable a node in the device tree.

You can disable that node in the system-top.dts and then create a new node with the same stuff and your change (I think) and that way Petalinux won't overwrite it.

Did you really have to comment out the clock also?

I'm assuming you are either using the device (GPIO) in Linux or the other CPU but not sharing it as that may cause some new challenges.

Thanks
John
0 Kudos
Visitor nerdomat
Visitor
11,467 Views
Registered: ‎08-13-2014

Re: I/O resource on cpu1

 

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:

 

&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?

0 Kudos
Xilinx Employee
Xilinx Employee
11,208 Views
Registered: ‎09-10-2008

Re: I/O resource on cpu1

Sorry for the delay, yes I'm sure with enough work you could share resources. But I could imagine debug of that solution could be more challenging.

Thanks
John
0 Kudos
Visitor xzyj.k
Visitor
7,360 Views
Registered: ‎10-26-2016

Re: I/O resource on cpu1

Hi John,

 

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 ?

0 Kudos
Visitor xzyj.k
Visitor
7,358 Views
Registered: ‎10-26-2016

Re: I/O resource on cpu1

Sorry, there was a typo in last post.
The CAN bus works fine both in SMP mode and also in baremetal mode, however when I use OpenAMP to load the baremetal application from linux, the CAN bus failed to work.
0 Kudos
Visitor prasanna_mn
Visitor
6,114 Views
Registered: ‎11-10-2016

Re: I/O resource on cpu1

Hi,

 

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.

 

Thanks

Prasanna

0 Kudos