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: 
Visitor mprocca
Visitor
8,171 Views
Registered: ‎03-11-2015

XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

I've setup a XC7Z020 with Linux on core 0 and a bare metal application on core 1.

 

The bare metal application on core 1 is using SPI within the PS. I've not done anything in Linux on core 0 to use the SPI periperhal.

 

The SPI registers will all be forced to zero if I allow Linux to come up on core 0. However, if I stop core 0 within U-boot and connect to core 1 with the SDK debugger, the SPI registers are not forced to zero and SPI will work properly. The only way I found to get SPI to work with Linux running was to add SPI to the DTB for Linux and delay its initialization on bare metal.

I recently added I2C to bare metal on core 1 and am having similar problems but a similar workaround to the SPI problem is not working.

 

I suspect the root cause is the same for both these problems - any ideas?

 

Mike

0 Kudos
1 Solution

Accepted Solutions
Visitor mprocca
Visitor
14,017 Views
Registered: ‎03-11-2015

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

John,

 

adding clk_ignore_unused to bootargs and removing SPI & I2C from the DTB solved the problem.

 

Linux comes up on core 0  and does not interfere with SPI & I2C used by the bare metal application on core 1.

 

Thank you!

 

Mike

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
8,166 Views
Registered: ‎09-10-2008

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

Hi Mike,

 

Sounds like it's likely a clocking issue, Linux turns on the clocks for the peripherals when it uses them.  It likely disables the clocks if the peripheral is not being used also. I may be wrong here, but just thinking about it.

 

It sounds like this is sort of an issue with AMP related systems.  Soren may have some suggestions on how to work around this. I don't know that code real well.

 

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/clk/zynq/clkc.c

 

Thanks,

John

0 Kudos
Xilinx Employee
Xilinx Employee
8,152 Views
Registered: ‎03-13-2012

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

I think John's right. Sounds very much like the clocks get disabled. I guess the straight forward options are:

 - patch Zynq's CCF driver to keep the clocks you need enabled

 - enable the clocks in your bare metal app (this would need to happen _after_ Linux passed the clock disable phase (late during boot up))

 - I think John found some kernel parameter that can be passed to the kernel to avoid the clock disable step

0 Kudos
Xilinx Employee
Xilinx Employee
8,140 Views
Registered: ‎09-10-2008

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

I forgot that I found that command line parameter.  You can add  "clk_ignore_unused"  to the kernel command line and it will not disable unused clocks based on some other testing I did. I don't know if it's a good long term solution.

 

Thanks

John

0 Kudos
Visitor mprocca
Visitor
14,018 Views
Registered: ‎03-11-2015

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

John,

 

adding clk_ignore_unused to bootargs and removing SPI & I2C from the DTB solved the problem.

 

Linux comes up on core 0  and does not interfere with SPI & I2C used by the bare metal application on core 1.

 

Thank you!

 

Mike

0 Kudos
Highlighted
Observer ajcurtis84
Observer
4,415 Views
Registered: ‎04-04-2016

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

Hello,

 

I am having problems accessing the LED GPIO on the ZC702 board. Should adding "clk_ignore_unused" fix that problem?

 

TIA

0 Kudos
Observer ajcurtis84
Observer
4,396 Views
Registered: ‎04-04-2016

Re: XC7Z020: Suspect Linux on core 0 interferring with SPI controlled by bare metal on core 1

Jump to solution

Here is the answer:

 

Adding "clk_ignore_unused" to the Linux bootargs does not fix access to the LED GPIO. The following had to be added to the device tree to fix it:

 

&amba {
   gpio-leds {
      compatible="gpio-leds";
      led-user10 {
         label="led-user10";
         gpios=<&gpio0 10 0>;
         default-state = "off";
      };
   };
};

 

I assume this is still a clock related issue since FreeRTOS configured the GPIO pin. 

 

Tags (2)
0 Kudos