What is the Correct Reserved Memory for Amlogic A311D BLx

Which Khadas SBC do you use?


Which system do you use? Android, Ubuntu, OOWOW or others?

ArchLinux ARM (Upstream).

Which version of system do you use? Khadas official images, self built images, or others?

6.2.1-1-aarch64-ARCH #1 SMP PREEMPT_DYNAMIC Sat Feb 25 15:18:35 MST 2023 aarch64 GNU/Linux. (generic Arm64)

Please describe your issue below:

I would like to understand how the reserved values of BL3/ “secmon” is determined for meson-GL2 (VIM3 - A311D).

In the upstream I see this DTS definition:

		#address-cells = <2>;
		#size-cells = <2>;

		/* 3 MiB reserved for ARM Trusted Firmware (BL31) */
		secmon_reserved: secmon@5000000 {
			reg = <0x0 0x05000000 0x0 0x300000>; /* <----------------------- */

		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
		secmon_reserved_bl32: secmon@5300000 {
			reg = <0x0 0x05300000 0x0 0x2000000>;

		linux,cma {
			compatible = "shared-dma-pool";
			size = <0x0 0x10000000>;
			alignment = <0x0 0x400000>;


However in the ATF docs, it specifies 4GB for all BLx memories.

Post a console log of your issue below:

I keep getting this exception upon Linux attempting to reserve that memory range

78561 bytes read in 6 ms (12.5 MiB/s)
Retrieving file: /dtbs/amlogic/meson-g12b-a311d-khadas-vim3.dtb.overlay.env
Failed to load '/dtbs/amlogic/meson-g12b-a311d-khadas-vim3.dtb.overlay.env'
Retrieving file: /uEnv.txt
4561 bytes read in 1 ms (4.3 MiB/s)
Import user vars: /uEnv.txt 4561 bytes
append: root=UUID=d722fb7c-5b47-4557-a2b5-2cc56325bb79 rw quiet
   Uncompressing Kernel Image
Moving Image from 0x8080000 to 0x8200000, end=abd0000
## Flattened Device Tree blob at 08008000
   Booting using the fdt blob at 0x8008000
   Loading Ramdisk to 7b7d4000, end 7bf0a5e8 ... OK
   Loading Device Tree to 000000007b7bd000, end 000000007b7d32e0 ... OK

Starting kernel ...

[    0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'secmon@5000000': base 0x0000000005000000, size 3 MiB # <------------------------

This is the current expected behaviour from the upstream kernel.

When I compare the memory address of the official Fenix Ubuntu 22 and this ArchLinuxArm that I built see these difference in the upper reserved memories:

# From Ubuntu Server 22
khadas@Khadas:~$ sudo cat /proc/iomem
[sudo] password for khadas:
00000000-04ffffff : System RAM
05000000-072fffff : reserved
  05000000-052fffff : reserved
07300000-7f806fff : System RAM
  11010000-1211ffff : Kernel code
  12120000-123fffff : reserved
  12400000-126bffff : Kernel data
  43400000-7b3fffff : reserved
  7b46f000-7b483fff : reserved
  7b4eb000-7bf17fff : reserved
  7c000000-7e1fffff : reserved
  7e21c000-7e31cfff : reserved
  7e31d000-7e394fff : reserved
  7e397000-7e399fff : reserved
  7e39a000-7e3aafff : reserved
  7e3ab000-7f806fff : reserved
ff100000-ff11ffff : galcore register region

# From  ArchLinux ARM (generic ARM64 upstream)
[alarm@Khadas-VIM3 ~]$ su root
[root@Khadas-VIM3 alarm]# cat /proc/iomem 
00000000-052fffff : System RAM #<--------------- Causes occasional kernel panic because it overlaps with ATF memory.
  05000000-052fffff : reserved  
05300000-072fffff : reserved
07300000-7f806fff : System RAM
  08210000-09efffff : Kernel code
  09f00000-0a65ffff : reserved
  0a660000-0abcffff : Kernel data
  6b400000-7b3fffff : reserved
  7b7be000-7b7d1fff : reserved
  7b7d4000-7bf0afff : reserved
  7d000000-7f1fffff : reserved
  7f21a000-7f31afff : reserved
  7f31b000-7f398fff : reserved
  7f39b000-7f39cfff : reserved
  7f39d000-7f39dfff : reserved
  7f39e000-7f3aefff : reserved
  7f3af000-7f806fff : reserved
ff3f0000-ff3fffff : ff3f0000.ethernet ethernet@ff3f0000

I would like to be pointed in the right direction or docs to understand how these are being determined.


FYI @Spikerguy @numbqq :smile_cat: