Joined: 21 Nov 2010 Posts: 278 Location: North America
Posted: Wed Jul 25, 2012 15:08 Post subject: Re: Asus RT-AC66U Uses 64KB NVRAM
barryware wrote:
nice.. you should start a new thread.. this is a diff router.
nand flash.. I am under the impression that is a problem for dd-wrt.. (WNDR4500)
The reason for posting it in this thread was in response to questions others had about this router's nvram size. I will start another thread when I'm ready to request DD-WRT firmware for it. (LOL)
I have 5 Buffalo WZR-D1800H routers (802.11ac) running DD-WRT that also use the same Samsung nand flash memory and so far haven't had any problems.
Then I went looking for RTCONFIG_NVRAM_64K and found:
in file asuswrt\release\src\router\config_base
# RTCONFIG_NVRAM_64K is not set
and CONFIG_NVRAM_64K in file asuswrt\release\src-rt\linux\linux-2.6\config_base
# CONFIG_NVRAM_64K is not set
In looking at the CFE code, it seems that CFE blindly allocates the last block of Flash for NVRAM. The block sizes are defined in hardware as the unit size that the flash is erased in, except for an erase entire flash command. So while the linker may allocate 128K for NVRAM, the CFE only does 1 block. Not sure how the router software gets around this.
Posted: Thu Jul 26, 2012 1:45 Post subject: Re: Asus RT-AC66U Uses 64KB NVRAM
Magnetron1.1 wrote:
barryware wrote:
nice.. you should start a new thread.. this is a diff router.
nand flash.. I am under the impression that is a problem for dd-wrt.. (WNDR4500)
The reason for posting it in this thread was in response to questions others had about this router's nvram size. I will start another thread when I'm ready to request DD-WRT firmware for it. (LOL)
I have 5 Buffalo WZR-D1800H routers (802.11ac) running DD-WRT that also use the same Samsung nand flash memory and so far haven't had any problems.
- Magnetron1.1
So am I correct in stating that the router has a CFE that allows for 128 MB of NVRAM?
128KB not 128MB, but that assumes the software supports buffering 4 sectors of flash instead of 1. Since a complete sector must be erased each time data is changed and if there is a checksum in the last sector, that sector must also be read, erased, modified, and rewritten.
128KB not 128MB, but that assumes the software supports buffering 4 sectors of flash instead of 1. Since a complete sector must be erased each time data is changed and if there is a checksum in the last sector, that sector must also be read, erased, modified, and rewritten.
Flash sectors forms sector groups (blocks) and that is what we usually work with, the flash driver takes care of the translation of a memory address into a flash block and knows how to handle individual sectors within the block.
With a block size of 64KB it is possible for the flash driver to address up to 16MB in parallel flashes but there are a few 8MB chips that have a block size of 128KB without actually needing to have them that big.
Serial flash chips do all have a block size of 64KB.
The nvram routines do not know anything about this, they are made for a certain size of nvram which may be an efficient size which uses all of the flash block or may be inefficient and waste a bit of the block.
64KB of nvram as seen in the latest Netgear and Cisco routers is in most cases efficient use of a flash block, it uses only one flash block and it uses all of it.
For routers with a flash block size of 128KB, well you don't need more than 64KB nvram so the wasted 64KB would be unused (ie wasted) anyway.
Having some kind of standard is always advantageous instead of making "specials". _________________ Kernel panic: Aiee, killing interrupt handler!
Joined: 21 Nov 2010 Posts: 278 Location: North America
Posted: Thu Jul 26, 2012 9:11 Post subject: Re: Asus RT-AC66U Uses 64KB NVRAM
GH0 wrote:
So am I correct in stating that the router has a CFE that allows for 128 MB of NVRAM?
I suppose the CFE could implement 128KB of NVRAM but in this particular case it's still just 64KB. The flash0.nvram and flash1.nvram devices actually point to the same offset and size into the same flash memory.
UPDATE: I might disagree with my last statement because the CFE never defined or found a flash1 making all the flash1.xx devices meaningless. Maybe I can devise some sort of experiment ..... Either way NVRAM is still limited to 64KB.
UPDATE2: The flash1.xx devices are real and appear to be duplicates.