Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open AMP and TTC issue on bare-metal app #3

Open
gpresazzi opened this issue Jun 15, 2017 · 8 comments
Open

Open AMP and TTC issue on bare-metal app #3

gpresazzi opened this issue Jun 15, 2017 · 8 comments

Comments

@gpresazzi
Copy link

Hi all,

I'm working with openAMP and zynq.

I'm having issue using peripheral from remote proc (CPI 1) bare metal applciation. In particular seems that TTC0, TTC1 and TTC2 initialization fail.
I'am able to use them successfully when I program Core 1 from JTAG. If I load the firmware using openAMP (zynq_remoteproc module) the bare metal app fail to initialize the TTC0 and TTC1 and TTC2.

The error is XST_DEVICE_IS_STARTED. Does it mean that I'm not able to use TTC0/1/2 from bare metal ?

Do you have any advice ?
Best Regards,

Giulio Presazzi

@wjliang
Copy link
Collaborator

wjliang commented Jun 15, 2017

when you load the application from jtag, the other core is not running Linux?

It can be related to this issue, TTC timers are by default in the Linux device tree, and by default they are not enabled, the status in the Linux device tree is "disabled", and the Linux common clock framework will disable the unused clocks, you can add "clk_ignore_unused" to the kernel command line

@gpresazzi
Copy link
Author

When I load application from jtag linux is not running.

In the dts the ttc are configured as follow:

ttc0: timer@f8001000 {
            interrupt-parent = <&intc>;
            interrupts = <0 10 4>, <0 11 4>, <0 12 4>;
            compatible = "cdns,ttc";
            clocks = <&clkc 6>;
            reg = <0xF8001000 0x1000>;
        };
 
        ttc1: timer@f8002000 {
            interrupt-parent = <&intc>;
            interrupts = <0 37 4>, <0 38 4>, <0 39 4>;
            compatible = "cdns,ttc";
            clocks = <&clkc 6>;
            reg = <0xF8002000 0x1000>;
        };

I've also add clk_ignore_unused to bootargs, but nothing change.

From bare metal application I've tried to use TTC3/TTC4/TTC5 but as soon as the firmware start, the board hangs.

Any other advice ?

Thanks and regards
Giulio

@gpresazzi
Copy link
Author

I'd like to add some information :
I fixed the issue related to timer 3,4,5. It was my mistake but, I have the same problme: no timer callback fired in firmware application.

When I use the flag USE_AMP=1 in the bare metal application, it doesn't work in case the application is loaded using jtag (no linux running).

If linux running do I need to initialize something to enable timer trigger ?

Thanks and regards
Giulio

@wjliang
Copy link
Collaborator

wjliang commented Jun 17, 2017

i think you can checked if you are able to get the interrupt, just when using USE_AMP=1, the baremetal will not initialize the gic. It assumes the other already did. in jtag mode, you will need to load the Core0 first with linux so that Linux will initialize the gic, then you can load core1.

@gpresazzi
Copy link
Author

I'm not able to get any interrupts ( not only the timer interrupt).
Need I a different initialization of the GIC in case the baremetal application running with USE_AMP=1 flag ?

@wjliang
Copy link
Collaborator

wjliang commented Jun 20, 2017

if you want the core running OpenAMP works first, you will need to initialize the GIC, however, when Linux boots it will always initialize GIC, and thus, you will not be able to receive interrupt in this case. But if Linux boots first, you should not need to initialize the GIC at all.

If you don't use OpenAMP application, are you able to receive interrupt when loading from Linux? We haven't seen this issue before. In order to load this arbitrary application from Linux, you can update the zynq_remoteproc driver to allow empty rsc table application, please refer the implementation of zynqmp_r5_remoteproc driver: https://github.com/Xilinx/linux-xlnx/blob/master/drivers/remoteproc/zynqmp_r5_remoteproc.c#L533

@jimlloyd
Copy link

jimlloyd commented Sep 9, 2018

We are also experiencing this problem now. Is there more documentation for USE_AMP=1? Via Google searches I have found some links, but I find them to be incomplete explanations.

We are building an application for the ZCU102. We're running Linux on the 4-core APU, and a bare metal application on RPU core 0. We will also run another bare metal application on the RPU core 1, but for now, we can ignore that core.

We have been able to build and run the RPU application using OpenAmp remote proc messaging between the APU and RPU. We'd like to also use TTC timer interrupts in that application. We can build and run the TTC test applications, but when we try to combine OpenAmp and TTC timers in one bare metal application we also see the XST_DEVICE_IS_STARTED error.

What is the correct way to resolve this problem?

@wjliang
Copy link
Collaborator

wjliang commented Sep 11, 2018

We are also experiencing this problem now. Is there more documentation for USE_AMP=1? Via Google searches I have found some links, but I find them to be incomplete explanations.

This is for Zynq, when two A9 cores run in AMP mode, the one which is on later needs to define USE_AMP=1 to skip some initialization as they share the same GIC and L2 cache.

We are building an application for the ZCU102. We're running Linux on the 4-core APU, and a bare metal application on RPU core 0. We will also run another bare metal application on the RPU core 1, but for now, we can ignore that core.

We have been able to build and run the RPU application using OpenAmp remote proc messaging between the APU and RPU. We'd like to also use TTC timer interrupts in that application. We can build and run the TTC test applications, but when we try to combine OpenAmp and TTC timers in one bare metal application we also see the XST_DEVICE_IS_STARTED error.

It looks like the TTC has been started by other users. Are you sharing the TTC with APU or another RPU?
it is better not to share devices. Otherwise, your application will need to detect if the device is being used by other cores. It looks like this XST_DEVICE_IS_STARTED error is from the device driver itself.

What is the correct way to resolve this problem?

check if TTC is shared by other cores, or if your application have started the TTC timer. E.g. if you are using FreeRTOS on RPU, FreeRTOS itself uses TTC timer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants