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 divcesar
Visitor
4,750 Views
Registered: ‎07-11-2017

Not able to to access AXi Registers

Jump to solution

I'm having a hard time trying to access AXI registers from inside Petalinux 2017.1 running on the Ultrascale+ board.

 

When I open the HDF on the XSDK I see the following info for the register map:

 

Cell: top_level_0
Base addr: 0xA0000000
High addr: 0xA000ffff
Slave I/f: s_00_axi
Mem/Reg: Register
Segment: -
TrustZone: -
AccessType: -

 

However, when I boot Linux and use devmem2 to read/write any register Linux crashes! Moreover, when I execute "cat /proc/iomem" I don't see an entry for the registers - am I supposed to see one there, right?

 

00000000-7fffffff : System RAM
00080000-00d4ffff : Kernel code
00e30000-00fa4fff : Kernel data
fd0c0000-fd0c1fff : /amba/ahci@fd0c0000
fd3d0000-fd3d0fff : siou
fd400000-fd43ffff : serdes
fd4a0000-fd4a0fff : /amba/dp@fd4a0000
fd4aa000-fd4aafff : blend
fd4ab000-fd4abfff : av_buf
fd4ac000-fd4acfff : aud
fd4d0000-fd4d0fff : /amba/watchdog@fd4d0000
fd500000-fd500fff : /amba/dma@fd500000
fd510000-fd510fff : /amba/dma@fd510000
fd520000-fd520fff : /amba/dma@fd520000
fd530000-fd530fff : /amba/dma@fd530000
fd540000-fd540fff : /amba/dma@fd540000
fd550000-fd550fff : /amba/dma@fd550000
fd560000-fd560fff : /amba/dma@fd560000
fd570000-fd570fff : /amba/dma@fd570000
fd6e9000-fd6edfff : /amba/cci@fd6e0000/pmu@9000
fe200000-fe207fff : /amba/usb0/dwc3@fe200000
fe200000-fe207fff : /amba/usb0/dwc3@fe200000
fe20c100-fe23ffff : /amba/usb0/dwc3@fe200000
ff000000-ff000fff : xuartps
ff010000-ff010fff : xuartps
ff020000-ff020fff : /amba/i2c@ff020000
ff030000-ff030fff : /amba/i2c@ff030000
ff070000-ff070fff : /amba/can@ff070000
ff0a0000-ff0a0fff : /amba/gpio@ff0a0000
ff0e0000-ff0e0fff : /amba/ethernet@ff0e0000
ff0f0000-ff0f0fff : /amba/spi@ff0f0000
ff170000-ff170fff : /amba/sdhci@ff170000
ff5e0000-ff5e0fff : lpd
ff960000-ff960fff : /amba/memory-controller@ff960000
ff9d0000-ff9d00ff : /amba/usb0
ffa50000-ffa507ff : ams-base
ffa60000-ffa600ff : /amba/rtc@ffa60000
ffa80000-ffa80fff : /amba/dma@ffa80000
ffa90000-ffa90fff : /amba/dma@ffa90000
ffaa0000-ffaa0fff : /amba/dma@ffaa0000
ffab0000-ffab0fff : /amba/dma@ffab0000
ffac0000-ffac0fff : /amba/dma@ffac0000
ffad0000-ffad0fff : /amba/dma@ffad0000
ffae0000-ffae0fff : /amba/dma@ffae0000
ffaf0000-ffaf0fff : /amba/dma@ffaf0000
800000000-87fffffff : System RAM

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
7,881 Views
Registered: ‎10-06-2016

Re: Not able to to access AXi Registers

Jump to solution

Hi @divcesar

 

Just to complete @hpoetzl reply, you should use "clk_ignore_unused" property in your bootargs if no drivers are associated with the IP, as Linux tends to disable the clocks for non used IPs.

 

Regards

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
11 Replies
Voyager
Voyager
4,725 Views
Registered: ‎06-24-2013

Re: Not able to to access AXi Registers

Jump to solution

Hey @divcesar,

 

However, when I boot Linux and use devmem2 to read/write any register Linux crashes!

Did you load the bitstream which creates those registers?

What exactly do you mean by "Linux crashes"?

 

when I execute "cat /proc/iomem" I don't see an entry for the registers

am I supposed to see one there, right?

Only when your device tree explicitely declares this range, otherwise it will not be listed.

 

Thanks,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Moderator
Moderator
7,882 Views
Registered: ‎10-06-2016

Re: Not able to to access AXi Registers

Jump to solution

Hi @divcesar

 

Just to complete @hpoetzl reply, you should use "clk_ignore_unused" property in your bootargs if no drivers are associated with the IP, as Linux tends to disable the clocks for non used IPs.

 

Regards

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
Explorer
Explorer
4,677 Views
Registered: ‎06-19-2015

Re: Not able to to access AXi Registers

Jump to solution

Hi,

 

I think you have to do Physical to Virtual address mapping then you try to access the AXI registers using virtual address.

0 Kudos
Voyager
Voyager
4,674 Views
Registered: ‎06-24-2013

Re: Not able to to access AXi Registers

Jump to solution

@madhu.mami60,

 

I think you have to do Physical to Virtual address mapping ...

devmem2 does this by mapping /dev/mem, hence the name.

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Visitor divcesar
Visitor
4,663 Views
Registered: ‎07-11-2017

Re: Not able to to access AXi Registers

Jump to solution

Hi, thanks a lot for your answer!

 

By crashing I mean that Linux freeze (the program doesn't even finish executing) and the only way to access Linux again is by rebooting the board.

 

Is this Base addr: 0xA0000000 a valid address for a device or should I put it within a specific range? Another question, should I look for creating a specific BSP for my project and use it to compile Petalinux or should I stick with the one provided by Xilinx?

 

If the addresses shown in /proc/iomem are physical address (and I do believe they are), why the addresses on the last line are so huge?

0 Kudos
Visitor divcesar
Visitor
4,661 Views
Registered: ‎07-11-2017

Re: Not able to to access AXi Registers

Jump to solution
That is a good point and I am looking to try that. But I wonder if Linux would "hang up"/freeze if that was the case.
0 Kudos
Visitor divcesar
Visitor
4,660 Views
Registered: ‎07-11-2017

Re: Not able to to access AXi Registers

Jump to solution
Yes, I had loaded the bistream.
0 Kudos
Voyager
Voyager
4,653 Views
Registered: ‎06-24-2013

Re: Not able to to access AXi Registers

Jump to solution

Hey @madhu.mami60,

 

By crashing I mean that Linux freeze ...

This is usually a good indication that you access a PS AXI master port which is not connected to a PL AXI slave.

But on the Ultrascale it might also be related to a trustzone problem (at least recent forum postings suggest this).

 

Is this Base addr: 0xA0000000 a valid address for a device or should I put it within a specific range?

This really depends on what address was configured for the PL AXI slave.

On the Zynq you have two regions for the master ports M_AXI_GP0 and M_AXI_GP1.

M_AXI_GP0 is from 0x40000000 to 0x7FFFFFFF and M_AXI_GP1 is from 0x80000000 to 0xBFFFFFFF.

Accessing a master port where no slave is connected will result in the described freeze.

 

Hope this clarifies,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Visitor divcesar
Visitor
4,625 Views
Registered: ‎07-11-2017

Re: Not able to to access AXi Registers

Jump to solution

That was it! By adding "clk_ignore_unused" to bootargs now I am able to at least to access the registers without crashing Linux.

0 Kudos
Visitor divcesar
Visitor
2,654 Views
Registered: ‎07-11-2017

Re: Not able to to access AXi Registers

Jump to solution

Hi @hpoetzl,

 

should I add to Petalinux 2017.2 configuration an entry for describing the custom IP or will it be able to extract that from the HDF file I used for creating the Peta project?

 

How can I be sure that the physical address I am mapping points to my custom IP? That seems to be the main point of my problems right now ..

0 Kudos
Observer senkoo
Observer
980 Views
Registered: ‎08-28-2018

Re: Not able to to access AXi Registers

Jump to solution

Hello @ibaie,

 

Where should you do this?

 

Greetings,

 

0 Kudos