How to specify Physical memory Offset for ARM platform that uses ARCH_MULTIPLATFORM=y?

2

Background:

I am working on upgrading kernel to version 4.9 on an ARMv7 based SoC. Earlier kernel used single platform build (ARCH_MULTIPLATFORM = n) and hence the PHYS_OFFSET was enabled to accept my system custom physical RAM start address. With new kernel, device tree enabled and ARCH_MULTIPLATFORM is turned on, no options in kernel configuration to set the phy_offset value.

The problem:

My platform's physical ram start address is 0x8000_0000. But the video subsystem uses the first 16MB for video frame buffer, so system RAM physical start address would be 0x8100_0000. I have specified device tree memory node as below:

memory {
         device_type = "memory";
         reg = <0x81000000 0X1e000000>;
     };

After system boots up, the kernel runs without any issues until video turned on. The moment video subsystem start using assigned memory region(0x80000000 to 81000000), the linux crashes.
Upon analysing the memory allocation, it was found that System RAM is using frame buffer area of RAM, despite the start address in device tree omitted it but the memory allocation does not change.

EVONLY_ENV$cat /proc/iomem
40415000-40415fff : serial
40416000-40416fff : serial
40430000-40430fff : serial
40431000-40431fff : serial
40432000-40432fff : serial
40500000-40500fff : /amba/eth0@40500000
40600000-40600fff : /amba/eth1@40600000
80000000-8effffff : System RAM
80008000-807fffff : Kernel code
80e00000-80e7860f : Kernel data

Also tried adding a reserved-memory node with the frame buffer area reserved with no-map directives:

 memory {
     device_type = "memory";
     reg = <0x80000000 0x20000000>;
 };

 reserved-memory {
     #address-cells = <1>;
     #size-cells = <1>;
     ranges;

     /*16 MB video RAM at the start*/
     vid_ram: vram@80000000 {
         reg = <0x80000000 0x1000000>;
         no-map;
     };

How do I completely omit the initial 16MB RAM space being used by Kernel for paging?
Is there any device tree options to do it? Or any command line options?

I am looking for following System RAM allocation scheme once the issue is addressed (output from my old kernel version without device tree and multiplatform support):

EVONLY_ENV$cat /proc/iomem
40100800-401008ff : pdriver
40415000-4041501f : serial
40416000-4041601f : serial
40430000-4043001f : serial
40431000-4043101f : serial
40432000-4043201f : serial
40c00000-40c001ff : sdhc0
40c01000-40c011ff : sdhc1
40c02000-40c021ff : emmc
70800000-77ffffff : PCI Memory Space
81000000-8fffffff : System RAM
81008000-81626be7 : Kernel code
81d9c000-81e5dff3 : Kernel data
linux
linux-kernel
memory-address
device-tree
asked on Stack Overflow Jan 6, 2019 by Harry_767 • edited Jan 7, 2019 by Harry_767

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0