Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread Kamil Konieczny


On 06.07.2017 15:43, kipade wrote:
> Might be? I have no puzzle of CMem。 OK, I will continue go search solutions 
> for that.
> And, if I got it, I will come back for sharing solutions here. 
> And, thank you, all

Are you writing kernel module ?

or you try to compile kernel with cmem module ?

What hardware are you using ?

How are you allocating shmem ?
Can you give few code lines for what you try ?

The more info you give, more help you receive.

Well, it may be faster to go directly to some kernel list or vendor list
with your questions.

>> On 06.07.2017 12:20, kipade wrote:
>>
>>> [...] (I have a look at> the kerrnel source, every omap_bo_object [...]
>>
>>> [...] I use arm 32bit cpu, with kernel 3.14
>>
>>> Here I want to allocate a block of shared memory from a given physical
>>> address, such as 0x9000, 6M. [...]
>>
>> it is well beyond newbie, you may find help on vendor forum,
>> i guess it is TI (Texas Instruments) Sitara SoC,
>> google search gives first hit:
>>
>> http://processors.wiki.ti.com/index.php/CMEM_Overview

-- 
Best regards,
Kamil Konieczny
Samsung R Institute Poland



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread Kamil Konieczny


On 06.07.2017 12:20, kipade wrote:

> [...] (I have a look at> the kerrnel source, every omap_bo_object [...]

> [...] I use arm 32bit cpu, with kernel 3.14

> Here I want to allocate a block of shared memory from a given physical
> address, such as 0x9000, 6M. [...]

it is well beyond newbie, you may find help on vendor forum,
i guess it is TI (Texas Instruments) Sitara SoC,
google search gives first hit:

http://processors.wiki.ti.com/index.php/CMEM_Overview

-- 
Best regards,
Kamil Konieczny
Samsung R Institute Poland


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread kipade
I reserved such memory as cma range, and Im sure it can be allocated via 
cma, such as dma_alloc_writecombine*. I want to hard code the physical 
address because I have to make sure such address can be access by 
another ipu cores of the soc platform. I think this can be reserved via 
a generic way: Just customize page allocation for a shm object. (I have 
a look at the kerrnel source, every omap_bo_object was bind a shm file, 
so, i only need allocate pages by my way will resolve all the further 
problem. otherwise, i would encounter many other unkown issues for me).*



On 06.07.2017 18:01, Kamil Konieczny wrote:


On 06.07.2017 11:43, kipade wrote:

In fact, I want to allocate a continous of pages from a given physical
address for a shm object in

shmem_file_setup, might i should write a customized shmem_file_setup2
for this?
I use arm 32bit cpu, with kernel 3.14

why do want this specific address 0x9000 ?

can it be 0x4000 ? or 0x5000 ? or 0x6888 ?

is this 0x9000 located in hardware registers ?

some memory regions are not accessible directly for allocation,
because they are used for communication with hardware SoC,
and so they are used by kernel drivers or directly by kernel

kernel driver may or may not expose that memory region for user space,
but this is driver work

maybe you should ask on platform forum,
you did not answer my question on what platform you are working


On 06.07.2017 05:08, kipade wrote:

Here I want to allocate a block of shared memory from a given physical
address, such as 0x9000, 6M. However, alloc_pages can't fit this
point. I had reserved enugh pages via cmem, there also have enough
continous pages for such allocation anywhere else. What should I do?


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread Kamil Konieczny


On 06.07.2017 11:43, kipade wrote:
> In fact, I want to allocate a continous of pages from a given physical 
> address for a shm object in
> 
> shmem_file_setup, might i should write a customized shmem_file_setup2 
> for this?

> I use arm 32bit cpu, with kernel 3.14

why do want this specific address 0x9000 ?

can it be 0x4000 ? or 0x5000 ? or 0x6888 ?

is this 0x9000 located in hardware registers ?

some memory regions are not accessible directly for allocation,
because they are used for communication with hardware SoC,
and so they are used by kernel drivers or directly by kernel

kernel driver may or may not expose that memory region for user space,
but this is driver work

maybe you should ask on platform forum,
you did not answer my question on what platform you are working

 On 06.07.2017 05:08, kipade wrote:
> Here I want to allocate a block of shared memory from a given physical
> address, such as 0x9000, 6M. However, alloc_pages can't fit this
> point. I had reserved enugh pages via cmem, there also have enough
> continous pages for such allocation anywhere else. What should I do?

-- 
Best regards,
Kamil Konieczny
Samsung R Institute Poland


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread kipade
In fact, I want to allocate a continous of pages from a given physical 
address for a shm object in

shmem_file_setup, might i should write a customized shmem_file_setup2 
for this?

在 2017年07月06日 17:30, Kamil Konieczny wrote:
>
> On 06.07.2017 11:04, kipade wrote:
>> I use arm 32bit cpu, with kernel 3.14
> banana-pi ? nano-pi ? orange-pi ? odroid ?
>
> Is it memory region for system registers ?
>
>>> On 06.07.2017 05:08, kipade wrote:
 Here I want to allocate a block of shared memory from a given physical
 address, such as 0x9000, 6M. However, alloc_pages can't fit this
 point. I had reserved enugh pages via cmem, there also have enough
 continous pages for such allocation anywhere else. What should I do?



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread kipade
cortex A15, omap5 platform


在 2017年07月06日 17:30, Kamil Konieczny wrote:
>
> On 06.07.2017 11:04, kipade wrote:
>> I use arm 32bit cpu, with kernel 3.14
> banana-pi ? nano-pi ? orange-pi ? odroid ?
>
> Is it memory region for system registers ?
>
>>> On 06.07.2017 05:08, kipade wrote:
 Here I want to allocate a block of shared memory from a given physical
 address, such as 0x9000, 6M. However, alloc_pages can't fit this
 point. I had reserved enugh pages via cmem, there also have enough
 continous pages for such allocation anywhere else. What should I do?



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread Kamil Konieczny


On 06.07.2017 11:04, kipade wrote:
> I use arm 32bit cpu, with kernel 3.14

banana-pi ? nano-pi ? orange-pi ? odroid ?

Is it memory region for system registers ?

>> On 06.07.2017 05:08, kipade wrote:
>>> Here I want to allocate a block of shared memory from a given physical
>>> address, such as 0x9000, 6M. However, alloc_pages can't fit this
>>> point. I had reserved enugh pages via cmem, there also have enough
>>> continous pages for such allocation anywhere else. What should I do?
-- 
Best regards,
Kamil Konieczny
Samsung R Institute Poland


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread kipade
I use arm 32bit cpu, with kernel 3.14

在 2017年07月06日 16:53, Kamil Konieczny wrote:
>
> On 06.07.2017 05:08, kipade wrote:
>> Here I want to allocate a block of shared memory from a given physical
>> address, such as 0x9000, 6M. However, alloc_pages can't fit this
>> point. I had reserved enugh pages via cmem, there also have enough
>> continous pages for such allocation anywhere else. What should I do?
> On what platform are you working ?
>
> I think this is platfrom depended.
>



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to alloc_pages from a given physical memory?

2017-07-06 Thread Kamil Konieczny


On 06.07.2017 05:08, kipade wrote:
> Here I want to allocate a block of shared memory from a given physical 
> address, such as 0x9000, 6M. However, alloc_pages can't fit this 
> point. I had reserved enugh pages via cmem, there also have enough 
> continous pages for such allocation anywhere else. What should I do?

On what platform are you working ?

I think this is platfrom depended.

-- 
Best regards,
Kamil Konieczny
Samsung R Institute Poland


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies