Netgear D7800 only 215.8MB RAM instead of 512MB

I installed openwrt 19.7.4 on a Netgear D7800 using this image:
https://downloads.openwrt.org/releases/19.07.4/targets/ipq806x/generic/openwrt-19.07.4-ipq806x-generic-netgear_d7800-squashfs-factory.img

According to the hardware page of this router

The router should have 512MB of RAM but on /proc/meminfo they are only 215.38MB
MemTotal: 220552 kB
MemFree: 32760 kB
MemAvailable: 104640 kB

In the hardware page, there is also the kernel log, which matches mine, and it says:
[ 0.000000] Memory: 219528K/229376K available (4978K kernel code, 160K rwdata, 756K rodata, 1024K init, 235K bss, 9848K reserved, 0K cma-reserved, 0K highmem)

Any idea what is going on? Thanks

If you look at the device page there is a OpenWrt bootlog at the end of the document containing the following:

Memory: 219528K/229376K available (4910K kernel code, 161K rwdata, 756K rodata, 1024K init, 234K bss, 9848K reserved, 0K cma-reserved, 0K highmem)

So this looks normal to me.

As this device has a modem integrated I can imagine, that OpenWrt cannot allocate all the RAM because it is shared with the (A)DSL chip/SoC.

Someone had wrongly changed the RAM from 256MB -> 512MB.
I have changed the dataentry now back to 256MB.

2 Likes

Hmm ... I've thought the same first. But datasheet is telling:

Memory: 128MB flash and 512MB RAM

Maybe there are two versions now? What I can see on closer look this is (in product sheet) X4S. While bootlog is showing X4 only. ... But maybe the product sheet is wrong.

EDIT:
I think the datasheet is wrong. XS4 is R7800 and it has 512MB RAM. They have just done copy and paste and changed just the "R" into "D" and forgot about specifications.

On the label mine is D78000 but it also says X4S. I can take a picture of the label and post it somewhere if that helps.
Also happy to try some kernel or if you think I could load the R7800 image and see what happens. Not really using the ADSL modem anyway, which I think it is the only difference between the two.

I would only load R7800 firmware over serial into RAM to see if it works and showing full RAM. Do not try to force install! In best case it would fail and doing nothing in worst case partition layout would get destroyed (if different; this is likely the case) and important calibration data will get lost.

What you could do is installing the latest snapshot (for D7800 ofc) and see if things are changing.

The bootlog which is in wiki page makes me still thinking that there are either different versions/revisions around (including wrong datasheets linked by Netgear) or it is "normal" for this device (as the modem needs ram also; the amount of RAM available makes me thinking this).

That would fail badly, despite the name, both devices are considerably different (ipq8064 vs ipq8065 to start with, not underestimating the impact of the xDSL SOC).

1 Like

True, the board is not common with R7800 (as I thought first). Its base is the same as R7500 (which has 256MB RAM). So @gigi81 forget about to try to load it into RAM it would not work anyway.

I think the datasheet is right, at least some if not all production units of the D7800 have 512MB RAM. I've been running an adapted version of hnyman's R7800 build on mine for over half a year which uses 512MB. So far it's been running without any issues which surely wouldn't be the case if half its memory didn't really exist.

The amount of memory shown in the bootlog doesn't prove anything because the firmware can't access more RAM than it was compiled for. Since only 256MB are specified in target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts that is what you get.

1 Like

So basically the solution is "just" to make your own build modifying DTS file for D7800?

The FCC photos of D7800 / PY315100302 show 2x Nanya NT5CC64M16FP-DI; 2x 1Gb = 256MB

1 Like

Strange. Mine has the same FCC PY, but since it's working flawlessly with a 512MB build I don't think it has only 256MB.

Here's what the kernel log shows:

[    0.000000] Linux version 4.14.172 (karsten@SVS1311S9EB) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10992-36373c5)) #0 SMP Thu Apr 2 09:54:04 2020
[    0.000000] CPU: ARMv7 Processor [512f04d0] revision 0 (ARMv7), cr=10c5787d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] OF: fdt: Machine model: Netgear Nighthawk X4 D7800
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 122880
[    0.000000] free_area_init_node: node 0, pgdat c0b25540, node_mem_map ddc39000
[    0.000000]   Normal zone: 960 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 122880 pages, LIFO batch:31
[    0.000000] random: get_random_bytes called from start_kernel+0x88/0x408 with crng_init=0
[    0.000000] percpu: Embedded 15 pages/cpu s29324 r8192 d23924 u61440
[    0.000000] pcpu-alloc: s29324 r8192 d23924 u61440 alloc=15*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 121920
[    0.000000] Kernel command line: rootfstype=squashfs noinitrd
[    0.000000] Bootloader command line (ignored): console=ttyHSL1,115200n8
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 478420K/491520K available (4843K kernel code, 151K rwdata, 1268K rodata, 1024K init, 228K bss, 13100K reserved, 0K cma-reserved, 0K highmem)

There was a thread like this long time ago.
I have a D7800 BETA Device which has only 256 MB RAM.
After Release and some support in OpenWrt someone changed the dts to 512 MB Ram. This was an issue for my beta device as it didn‘t worked with the build. But ok mine is a beta and released version is 512MB. So ok for me.
After some kernel upgrades in the OpenWrt target i think, someone restored the mainline kernel dts i think and there is still 256MB defined.
...
still can‘t find the old thread ...

found it:

1 Like

What RAM chips are used in the 512MB version?
Some pictures of the PCB would be nice.

1 Like

Well, to get to the bottom of this I decided to have a look at my unit's innards ...

2x Nanya NT5CC128M16IP-DI so it's definitely 512MB.

2 Likes

To the devs: is it somehow possible to read the amount of ram from uboot or so?

Thanks for this helpfull picture!

Now the question is: Can the user somehow distinguish these versions from the outside (different Model naming, different serial-number, different $something_else)?

  • D7800 BETA 256MB RAM (2x Nanya NT5CC64M16FP-DI)

    U-Boot 2012.07-21984-gd7d026f [local,local] (Apr 15 2015 - 10:49:55)
    U-boot 2012.07 dni1 V0.9 for DNI HW ID: 29764958
    
  • D7800 regular production 512MB (2x Nanya NT5CC128M16IP-DI)

    U-Boot 2012.07 [local,local] (Jul 01 2015 - 13:18:15)
    U-boot 2012.07 dni1 V1.1 for DNI HW ID: 29764958
    

You can distinguish this while running the stock firmware and navigating to /debug.htm, that's how I confirmed my device actually had 512MB of RAM, I then applied an edit to the DTS (copied the R7800 memory definition) as part of a source build which seems to be working well.

Not knowing how they have been determined it is only speculation on my part but I noticed in target/linux/ipq806x/image/Makefile (19.07 branch checkout) that the NETGEAR_HW_ID values listed against each of the R7500, R7500v2 & R7800 appear to have encoded the amount of RAM that matches the respective DTS files, while the D7800 value has "512" rather than the "256" that might be expected if it had only 256MB of RAM the same as the R7500:

define Device/netgear_d7800
	NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
	                                ^^^

define Device/netgear_r7500
	NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
	                                ^^^

define Device/netgear_r7500v2
	NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
	                                ^^^

define Device/netgear_r7800
	NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
	                                ^^^

The value "128" to the left of the speculated RAM size matches the 128MB of flash defined in all 4 DTSes.

By no means conclusive of course but it seems to suggest that 512MB of RAM might be normal.

2 Likes