Skip to content

[E900V22E] Hardmod 4GB memory but only 3GB recognized in Armbian (B860AV2.1-A2) #3587

Description

@sawyou

硬件背景

  • 盒子原型号:上海移动 B860AV2.1-A2(2GB RAM + 8GB ROM)
  • 盒子硬件配置
项目 参数详情
基本信息
盒子原型号 上海移动 B860AV2.1-A2
当前刷机型号 E900V22E(安卓系统)
兼容测试 E900V22D(官方 4GB 版)安卓系统亦可正常启动
核心硬件
SoC Amlogic S905L3B(GXL 平台)
架构 ARMv8-A(64-bit),Cortex-A53 × 4
内存 2GB(两颗长鑫 CXDQ3BFAM,各 1GB),硬改 4GB(四颗 SK Hynix H5N5G6NAFB,各 1GB)
eMMC 16GB(原机8GB,已刷 E900V22E 安卓)
接口与外设
USB 2 × USB 2.0(其中一个用于 U 盘启动)
TF卡槽 支持(未使用)
以太网 100Mbps(RMII,内部 PHY)
U盘 32GB (用于 Armbian 启动)
系统与引导
U‑Boot 版本 安卓旧版 U‑Boot(提示符 gxl_p211_v1#)
当前系统 Armbian(ophub/amlogic-s9xxx-armbian)
启动方式 U 盘启动(通过 s905_autoscript)
内核版本 6.18.37-ophub
  • 当前刷机情况
  • 刷入 E900V22E 安卓系统(2GB 内存)正常工作。
  • 刷入 E900V22D 安卓系统(第三方 4GB RAM + 16GB ROM)也能正常兼容运行,说明系统对 2GB 内存有良好支持。
  • 硬件改造:原装 2GB(两颗长鑫 CXDQ3BFAM),硬改后为 4GB(四颗 SK Hynix H5N5G6NAFB 1GB 颗粒)
  • 当前系统:Armbian_26.08.0_amlogic_s905l3b-e900v22e_resolute_6.18.37_server_2026.07.01(ophub/amlogic-s9xxx-armbian 项目),从 U 盘启动。

串口内存识别日志 1(使用的E900V22D安卓uboot)

  • GXLX2:BL1:3cfee7:42a5ae;FEAT:ADFD318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
    TE: 80130

BL2 Built : 20:07:04, Jul 21 2022.
gxl gef5893c-dirty - qiquan.xu@droid08

Board ID = 3, adc=224
set vcck to 1070 mv
set vddee to 1070 mv
CPU clk: 1200MHz

DDR4 chl: Rank0+1 @ 912MHz
bist_test rank: 0 27 10 3e 33 1f 48 23 0d 3a 36 22 4a 26 10 3c 34 20 48 27 10 3f 34 20 48 589 rank: 1 22 11 33 2d 1c 3f 1f 10 2f 34 23 45 25 16 35 2f 20 3f 22 11 34 30 1f 42 589 - PASS

Rank0: 2048MB(auto)-2T-18

Rank1: 2048MB(auto)-2T-18
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x013c0000, size: 0x00007600
Load bl301 from eMMC, src: 0x00018200, des: 0x01380000, size: 0x00002600
Load bl31 from eMMC, src: 0x0001c200, des: 0x10100000, size: 0x00019600
Load bl33 from eMMC, src: 0x00038200, des: 0x01000000, size: 0x00049600
NOTICE: BL3-1: v1.0(debug):27617c8a4
NOTICE: BL3-1: Built : 18:02:23, Aug 18 2021
NOTICE: BL31: GXL normal boot!
NOTICE: BL31: BL33 decompress pass
[Image: gxl_v1.1.3103-923400455-dirty 2020-12-28 18:42:52 xingyu.chen@droid12-sz]
efuse init ops = c5
efuse init hdcp = c, cf9=7
x2_hp_e = 0
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: 0 0 3 c c 0 90 b3 90 a0 0 c5 not ES chip
[0.635072 Inits done]
INFO: BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR: Error initializing runtime service opteed_fast
INFO: BL3-1: Preparing for EL3 exit to normal world
INFO: BL3-1: Next image address = 0x1000000
INFO: BL3-1: Next image spsr = 0x3c9
bt: 36512492 us

串口内存识别日志 2(使用的s905L3通用刷机包安卓uboot)

GXLX2:BL1:3cfee7:42a5ae;FEAT:ADFD318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 79475

BL2 Built : 17:21:16, Mar 19 2021.
gxl g767b31d - longyong.chen@droid02-sz

Board ID = 3, adc=225
set vcck to 1120 mv
set vddee to 1000 mv
ddr4-4 board
CPU clk: 1200MHz
DDR4
DDR4 chl: Rank0+1 @ 912MHz
bist_test rank: 0 23 0f 38 2c 15 43 1e 0b 32 2d 18 43 20 0e 33 2e 18 44 23 0e 38 2b 15 42 652 rank: 1 1e 10 2d 27 13 3b 1c 0f 2a 2d 19 41 1f 13 2c 2a 16 3e 1e 10 2d 28 14 3d 652 - PASS

Rank0: 2048MB(auto)-2T-18

Rank1: 2048MB(auto)-2T-18
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x013c0000, size: 0x00007600
Load bl301 from eMMC, src: 0x00018200, des: 0x01380000, size: 0x00002600
Load bl31 from eMMC, src: 0x0001c200, des: 0x10100000, size: 0x00019600
Load bl33 from eMMC, src: 0x00038200, des: 0x01000000, size: 0x0004dc00
NOTICE: BL3-1: v1.0(debug):27617c8a4
NOTICE: BL3-1: Built : 18:02:23, Aug 18 2021
NOTICE: BL31: GXL normal boot!
NOTICE: BL31: BL33 decompress pass
[Image: gxl_v1.1.3103-923400455-dirty 2020-12-28 18:42:52 xingyu.chen@droid12-sz]
efuse init ops = c5
efuse init hdcp = c, cf9=7
x2_hp_e = 0
bl30: check_permit, count is 1
bl30: check_permit: ok!
chipid: 0 0 3 c c 0 90 b3 90 a0 0 c5 not ES chip
[0.619358 Inits done]
INFO: BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR: Error initializing runtime service opteed_fast
INFO: BL3-1: Preparing for EL3 exit to normal world
INFO: BL3-1: Next image address = 0x1000000
INFO: BL3-1: Next image spsr = 0x3c9

console:/ $ free -h
total used free shared buffers
Mem: 2.9G 1.1G 1.7G 868K 10M

问题现象

硬改 4GB 后,在 Armbian 下 free -h 只显示 2.8GiB(约 3GB),无法使用全部 4GB,安卓的uboot一样限制3GB.BL2 启动日志正确识别两通道各 2GB(Rank0: 2048MB(auto)Rank1: 2048MB(auto)),因此硬件检测正常,问题似乎出在软件层面(U-Boot 或内核)。

已尝试的解决方案(均未成功)

  1. 修改设备树 (DTB)
    • 参考安卓 4GB DTB 中的 linux,usable-memory,将 memory@0reg 改为两段:
    • reg = <0x0 0x100000 0x0 0xbff00000>,
      <0x0 0xe0000000 0x0 0x1fc00000>;
  • 也尝试过 reg = <0x0 0x0 0x1 0x0> 配合 reserved-memory 空洞(3GB~3.5GB 标记为 no-map)。
  • 但 U-Boot 在 booti 阶段始终将 /memory 节点覆盖为单段 <0x0 0x0 0x0 0xc0000000>(3GB)。
  1. 设置 U-Boot 环境变量
  • 尝试 setenv fdt_fixup_memory 0setenv fdt_high 0xffffffffsetenv initrd_high 0xffffffff
  • saveenv 失败(_find_partition_by_name()-189: do not find match in table env),无法永久保存,且即使临时设置,booti 仍然覆盖内存节点。
  1. 使用内核参数 mem=
  • 添加 mem=3584M 后,内核日志显示 Memory limited to 3584MB,但实际可用仍为 3GB(因为 U-Boot 传递的 reg 仍为 0~3GB,mem= 只能缩小范围,不能扩大)。
  1. 编译自定义 U-Boot 并尝试链式加载
  • 基于 Armbian 构建系统(tag:v2022.07)修改 arch/arm/mach-meson/board-common.c 中的 dram_init(),强制 gd->ram_size = 0x100000000
  • 生成 u-boot.bin 并重命名为 u-boot.ext 放入 U 盘 /boot,通过 s905_autoscript 加载(fatload usb 0 0x1000000 u-boot.ext; go 0x1000000)。
  • 加载后出现同步异常,自动重启(日志见附件)。

相关日志片段

  • BL2 内存检测(正确识别 4GB):
    Rank0: 2048MB(auto)-2T-18
    Rank1: 2048MB(auto)-2T-18

  • 内核内存信息(仅看到 3GB):
    Memory: 2698204K/3145728K available
    Early memory node ranges:
    [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000000ffffff]
    [ 0.000000] node 0: [mem 0x0000000001000000-0x0000000004ffffff]
    [ 0.000000] node 0: [mem 0x0000000005000000-0x00000000072fffff]
    [ 0.000000] node 0: [mem 0x0000000007300000-0x000000000fffffff]
    [ 0.000000] node 0: [mem 0x0000000010000000-0x00000000101fffff]
    [ 0.000000] node 0: [mem 0x0000000010200000-0x00000000bfffffff]

  • 自定义 U-Boot 加载崩溃
    reading u-boot.ext
    885248 bytes read

Starting application at 0x01000000 ...
"Synchronous Abort" handler, esr 0x02000000
...
Resetting CPU ...

求助目标

  1. 是否有针对 S905L3B 平台且支持 4GB 内存的预编译 U-Boot 可供使用(或已知能正常工作的 u-boot.ext 文件)?
  2. 如何正确编译一个可兼容当前启动环境(通过 u-boot.ext 加载)的 U-Boot?
  3. 是否有其他方式可以绕过 U-Boot 对内存大小的硬编码限制(例如通过内核补丁或启动参数)?

附件(可选)

  • 完整的 U-Boot 启动日志
  • 修改后的 DTB 内容
  • s905_autoscript 脚本内容

感谢开发者的关注和帮助!

Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions