cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
laursand
Contributor
Contributor
4,044 Views
Registered: ‎08-09-2013

Zynq Linux custom dynamically loaded driver problem accessing EMIO registers

Jump to solution

hi,

I am writing a driver to use the EMIO between the PS and PL to communicate some data rapidly between the PS and a little PL module (somewhat a bit time critical - so using EMIO to avoid the AXI overhead). The driver also controls an AXI GPIO module.
 
The driver is a dynamically loaded driver (.ko) file.
The driver compiles fine and I can load it after linux is booted.
The AXI GPIO base is at 0x41200000.
The EMIO base (Zynq CPU registers) starts at 0xE000A000.
 
To access these resources (entered as memory resource in the DTS), I use (in the driver) the ioremap function. It does return a valid virtual memory adress for both 0x41200000 and 0xE000A000.
 
When I write to 0x41200000 remapped - it works fine (probed in Vivado).
When I write to any register between 0xE000A000 and 0xE000B000 - nothing happens (writing values - and reading always returns 0x00000000).
 
It's almost like this part of the memory above 0xE000000 is protected by the CPU even though Linux grants access to this region in physical memory.
 
I tried ioread32/iowrite32. Tried __raw_readl/__raw_writel. Tried iomap_nocache as well - no luck.
 
Could it be that the Zynq protects these internal registers above 0xE000000? I am loading my driver dynamically, so after all initializations are complete. Next thing I will try is to build the driver into the kernel so it gets loaded before Linux boot is complete - but it's not as convenient for testing.
 
Any input welcome!
thanks
 

 

0 Kudos
1 Solution

Accepted Solutions
sorenb
Xilinx Employee
Xilinx Employee
5,086 Views
Registered: ‎03-13-2012

Do you enable the clocks to the GPIO module?

View solution in original post

3 Replies
sorenb
Xilinx Employee
Xilinx Employee
5,087 Views
Registered: ‎03-13-2012

Do you enable the clocks to the GPIO module?

View solution in original post

laursand
Contributor
Contributor
4,028 Views
Registered: ‎08-09-2013

hi Soren,

That was quick - thanks so much for the reply!

No, I guess I'm new to driver writing and the Zynq part - I had not enabled the Clocks to the GPIO module.

Now that the clocks are enabled the registers respond as expected to read/write operations.

Thanks a lot! the effective support is much appreciated,

 

 

0 Kudos
xilinxlpc
Visitor
Visitor
1,398 Views
Registered: ‎03-01-2016

Hi,

 

My problem as same as you.

Can you help me how to enable the gpio module clock?

 

I write a new gpio driver in linux.

 

Regards,

 

Camille

0 Kudos