CMA on arm from zero address
Hi,
I would like to setup CMA space at the beginning of ram because
I want to use remoteproc to run code on the second cpu which has to use addresses 0x0 - 32MB.
I have changed textofs in arch/arm/Makefile but there is not possible to setup all values which I would like to use. What is the reason for this limitation?
Marek: Have you tried to prototype this configuration with cma?
Thanks,
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Quoted 8 lines · Michal Simek
Hi,
I would like to setup CMA space at the beginning of ram because I want to use remoteproc to run code on the second cpu which has to use addresses
0x0- 32MB.I have changed textofs in
arch/arm/Makefilebut there is not possible to setup all values which I would like to use.
What a broken setup. Placing the kernel outside of the 16MB window effectively prevents you from using modules. Why do people come up with stupid things like this. Please stop. Put such things at the end of RAM instead and save the rest of the ARM community from this madness.
Hi Russell,
Quoted 7 lines · Russell King - ARM Linux
Quoted 6 lines · Michal Simek
Hi,
I would like to setup CMA space at the beginning of ram because I want to use remoteproc to run code on the second cpu which has to use addresses
0x0- 32MB.
Quoted 8 lines
Quoted 2 lines
I have changed textofs in
arch/arm/Makefilebut there is not possible to setup all values which I would like to use.What a broken setup. Placing the kernel outside of the 16MB window effectively prevents you from using modules. Why do people come up with stupid things like this. Please stop. Put such things at the end of RAM instead and save the rest of the ARM community from this madness.
First of all I have found how to do it (by CONFIG_PHYS_OFFSET) so the problem is in QEMU. Currently experimenting how to convince CMA to allocate that memory for my purpose.
That idea doesn't come from me!
The reason is that we want to run Linux on the first ARM core and the second cpu will run any other RTOS. Linux remaps vectors to 0xffff0000 and the second core has to use them at 0x0 address.
RTOS runs in real mode that's why I need to use ram at 0x0 address.
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Quoted 2 lines · Michal Simek
First of all I have found how to do it (by
CONFIG_PHYS_OFFSET) so the problem is in QEMU.
So you're basically not telling the kernel about the first 32MB of memory.
Quoted 2 lines
Currently experimenting how to convince CMA to allocate that memory for my purpose.
Which means it won't be part of the kernels normal memory map, and so won't be in the page pool. So CMA won't be able to help.
Instead, just ignore the first 32MB of RAM, and map it like any other peripheral to gain access to it. You might need to use ioremap_wc() to avoid treating the memory as a 'device type' in ARMv6+.
Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Michal Simek
First of all I have found how to do it (by
CONFIG_PHYS_OFFSET) so the problem is in QEMU.So you're basically not telling the kernel about the first 32MB of memory.
It is not a problem.
Quoted 10 lines
Quoted 3 lines
Currently experimenting how to convince CMA to allocate that memory for my purpose.
Which means it won't be part of the kernels normal memory map, and so won't be in the page pool. So CMA won't be able to help.
Instead, just ignore the first 32MB of RAM, and map it like any other peripheral to gain access to it. You might need to use
ioremap_wc()to avoid treating the memory as a 'device type' in ARMv6+.
I switched from cma to dma_declare_coherent_memory which does exactly what I wanted to do.
Thanks,
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Hello,
Quoted 11 lines · Michal Simek
Quoted 10 lines · Russell King - ARM Linux
Quoted 8 lines · Michal Simek
Hi,
I would like to setup CMA space at the beginning of ram because I want to use remoteproc to run code on the second cpu which has to use addresses
0x0- 32MB.I have changed textofs in
arch/arm/Makefilebut there is not possible to setup all values which I would like to use.
Quoted 8 lines
Quoted 5 lines
What a broken setup. Placing the kernel outside of the 16MB window effectively prevents you from using modules. Why do people come up with stupid things like this. Please stop. Put such things at the end of RAM instead and save the rest of the ARM community from this madness.
First of all I have found how to do it (by
CONFIG_PHYS_OFFSET) so the problem is in QEMU. Currently experimenting how to convince CMA to allocate that memory for my purpose.
I'm not sure if CMA is the right allocation api for this purpose. You should better use memblock allocator to grab specific address ranges for your custom setup. Alternatively you can compile Linux kernel to start physical memory at 16MiB and access the 0-16MiB range with ioremap for example.
(snipped)
Best regards
Signature · 2 lines
Marek Szyprowski Samsung Poland R&D Center