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: 
Scholar beandigital
Scholar
155 Views
Registered: ‎04-27-2010

How to map multiple multiple address space in a Linux driver

Jump to solution

I have an IP that has three registers spaces

reg = <0x43c00000 0x10000 0x43c10000 0x10000 0x43e00000 0x200000>;

I want to be able to access them in a Linux driver. I have been looking at the example driver that is created when I run petalinux-create. But that seems to just have one register space. Are there any example of using multiple spaces? Thanks

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar rfs613
Scholar
119 Views
Registered: ‎05-28-2013

Re: How to map multiple multiple address space in a Linux driver

Jump to solution

@beandigital wrote:
Looking at the description of platform_get_resource, it seems that the third parameter is used to select the region. So I guess I just need to set that to the space I want to map. Can someone confirm this?

Yes this is correct. There are several hundred drivers in the kernel that uses 2 or more ranges.

 

Here is an example that maps 5 ranges: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/platform/x86/intel_punit_ipc.c?h=v4.19.81#n227

2 Replies
Scholar beandigital
Scholar
153 Views
Registered: ‎04-27-2010

Re: How to map multiple multiple address space in a Linux driver

Jump to solution
Looking at the description of platform_get_resource, it seems that the third parameter is used to select the region. So I guess I just need to set that to the space I want to map. Can someone confirm this?
0 Kudos
Highlighted
Scholar rfs613
Scholar
120 Views
Registered: ‎05-28-2013

Re: How to map multiple multiple address space in a Linux driver

Jump to solution

@beandigital wrote:
Looking at the description of platform_get_resource, it seems that the third parameter is used to select the region. So I guess I just need to set that to the space I want to map. Can someone confirm this?

Yes this is correct. There are several hundred drivers in the kernel that uses 2 or more ranges.

 

Here is an example that maps 5 ranges: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/platform/x86/intel_punit_ipc.c?h=v4.19.81#n227