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!

Pheripherial enable on remote processor

Reply
Highlighted
Participant
Posts: 18
Registered: ‎10-18-2017

Pheripherial enable on remote processor

Hi,

We are currently working on system where there are two OSes on ZCU102 platform:

- FreeRTOS on R5

- Petalinux on A53. 

We successfully tested OpenAMP echo test application and based on that create some communication shame between processors. 

On FreeRTOS we would like to use SPI0 (with the usage of EMIO on FPGA). We succeeded in using SPI0 in standalone FreeRTOS application. However when we try to run the same application from Petalinux as ug1186 described the SPI do not work.  SPI registers are continuously read as zeros.  

 

In one of version of ug1186 I found fallowing statements:

 

With ZynqMP, PetaLinux default BSP does not define specific subsystems, as isolation configuration is disabled. All devices are shown in the device tree (DTS) and Linux owns everything.

By default, power management (PM) is enabled in the Linux kernel configuration, and thus Linux can suspend its devices.

When RPU is used and needs to access some device, you must do one of the following:

• Use isolation configuration in Vivado to setup subsystems. Note: This doesn't cover programmable logic (PL) devices; for those used by RPU you still need to disable them manually in the DTS.

• Manually disable devices owned by the RPU in the DTS.

 

I tried both options and non of them works. (Probably I'm making some mistakes in both cases). 

 

After that I manually tried to init SPI (with devmem command on Petalinux). The SPI started to work after clearing bit nr 3 from RST_LPD_IOU2 register (Absolute Address: 0xFF5E0238 -CRL_APB). Now I'm trying to apply that into Linux or into hardware definition but I do not know how to do that. Any help? 

 

Moderator
Posts: 89
Registered: ‎05-10-2017

Re: Pheripherial enable on remote processor

Can you provide a snippet of the device-tree after disabling spi0?

Are there any other peripherals being used by the RPU also present in the dts? All of these must be disabled in the dts if being used by the RPU

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Participant
Posts: 18
Registered: ‎10-18-2017

Re: Pheripherial enable on remote processor

[ Edited ]

Thanks for answer.

Here is the way I disabled the SPI0:

&spi0 {
    status = "disabled";
};

Another thing is that in the system-top.dts there is an alais: 

aliases {
    ethernet0 = &gem3;
    serial0 = &uart0;
    spi0 = &qspi;
};

 

I'm worried that after this real SPI0 is "covered" by QSPI and I disable only QSPI instead of wanted interface, do I?

 

We also use SPI0 through EMIO because ZCU102 do not have dedicated MIO to connect SPI0 (everything is occupied).  Maybe this is another problem. Do I need disable/define something else in dts to use EMIO?

 

And I need to add something to previous post. When I said that "SPI started to work" I mean that the selftest PASSED. The RTOS was able to read config register default value and it was 0x00200000 as expected. Whats more RTOS is able to read/write to SPI registers because I see the changes in this registers. Unfortunately on the PINs I do not see physical signal yet. I'm currently working on that. 

Participant
Posts: 18
Registered: ‎10-18-2017

Re: Pheripherial enable on remote processor

Update:

I manage to run SPI0. The communication works through EMIO. However I need to do few things so that it will work as I expected:

1. Enable SPI0 manually from Linux with command:

devmem 0xFF5E0238 32 0x00010B0

This command clears reset flag on RST_LPD_IOU2 register

2. Set assumed RPLL CLK divisions from Linux with command:

devmem 0xFF5E007C 32 0x01031900

This set up SPI0_REF_CTRL register so that SPI will have frequency clock 10MHz.

 

I think both of this should be set up in Vivado project and I think it was done properly. Based on that petalinux configuration was prepared with commands:

$petalinux-config --get-hw-description={path-to-hdf}

$petalinux-config -c kernel

$petalinux-config -c rootfs

$petalinux-build

I will repeat that process to be sure of that. However for now it seems that petalinux does not take this set up into account. The question is why? 

 

Participant
Posts: 18
Registered: ‎10-18-2017

Re: Pheripherial enable on remote processor

The solution of the problem is in:
https://forums.xilinx.com/t5/OpenAMP/SPI-enable-for-remoteproc/td-p/863762

 

This topic is a repetition of above one. Sorry for confusion but first one was initially marked as spam so I started a this one. After that the original one was restored.