Help expanding the flash memory of a DIR-601A1

I have a router without USB support and a 4/32 flash/RAM. I'd like to give it a flash upgrade so it's usable as a low-end Ethernet or Wi-Fi router for when I'm transferring data between PCs or trying to get a connection someplace I don't have a cable or signal. I'm hoping I can continue to use its 32M RAM for this use case as I'm not confident swapping that chip.

I have the soldering skills to swap the flash chip and I have a TIAO TUMPA Lite board that's supposed to work with Flashrom. I also bought a socket for the type of flash chip that's used, so I can plug the new/old one into the programmer.

It's the software I'm having difficulties with. I'm having problems understanding the details of what I'll need to do to lay out the new flash chip's contents and I'm also going to need to do something to the build system so it supports larger squashfs and also move the ART.

I'm looking for help with the following:

Issue 1: There's some sort of overlap in my MTD backups. In particular, the "firmware" partition has the same size in bytes as the entire flash but notably does not include uboot, ART, etc according to binwalk. How do I figure out the physical partition layout for when I copy these to the chip, and which MTD file parts will I use?

Issue 2: I've never used Flashrom and don't know how to use it to create or write the image. I imagine I could probably read out the original chip and mirror it to the new one, but what would happen? I'd be more comfortable if I could reassemble the image from the files I've saved too (and I know I'll need the ART in particular since that'd be in the wrong place).
How can I manipulate the chip image and what tools do I need/how do I use them to write the new chip?

Issue 3: This router no longer has support in new OpenWRT. How do I copy the build config from, say, older OpenWRT to newer and modify the flash chip size to the new value in the build config?

Issue 4:
Am I going to need to modify the uboot, reprogram some sort of driver with the new ART location, fix the MAC address (it also has its own partition, so any questions about the ART also apply here), any other sort of in-firmware fix to get this device and its hardware working fully?
(If possible, I would prefer to update the uboot, since the original has a web failsafe that doesn't work on any modern browser, so I may as well swap it for something that is either smaller or functional. How can I build/get one for my specific device, and is that going to affect the other items here?)

Here's the MTD:

dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "nvram"
mtd2: 003a0000 00010000 "firmware"
mtd3: 0011573f 00010000 "kernel"
mtd4: 0028a8c1 00010000 "rootfs"
mtd5: 00070000 00010000 "rootfs_data"
mtd6: 00010000 00010000 "mac"
mtd7: 00010000 00010000 "art"

And the MTD file sizes of its current firmware:

-rwxrwxrwx 1 ...................  196608 Aug 17 23:07 OpenWrt.mtd0.bin
-rwxrwxrwx 1 ...................   65536 Aug 17 23:07 OpenWrt.mtd1.bin
-rwxrwxrwx 1 ................... 3801088 Aug 17 23:07 OpenWrt.mtd2.bin
-rwxrwxrwx 1 ................... 1136128 Aug 17 23:07 OpenWrt.mtd3.bin
-rwxrwxrwx 1 ................... 2664448 Aug 17 23:07 OpenWrt.mtd4.bin
-rwxrwxrwx 1 ...................  458752 Aug 17 23:06 OpenWrt.mtd5.bin
-rwxrwxrwx 1 ...................   65536 Aug 17 23:06 OpenWrt.mtd6.bin
-rwxrwxrwx 1 ...................   65536 Aug 17 23:06 OpenWrt.mtd7.bin

The current running image was created by myself using the full image compiler (not the precompiled tool), so I should be able to modify any files necessary once I know what they are/what the relevant parts are.

I'm not sure why you want to upgrade this device... it seems that the money (and time/effort) would be much better leveraged to get a new device.

The DIR-601A1 has only 100Mbps ports, so it'll be much slower to do local transfers than even a relatively old and low end gigabit router.

But more importantly, support for this device appears to have been dropped after 17.01, which is very old, EOL, and completely unsupported. Therefore, unless you'd put in a ton of extra effort, you won't be able to run a more recent version of OpenWrt which means you will be vulnerable to many significant security vulnerabilities. And with just 32MB of RAM, you'd be hard pressed to run later versions, anyway.

Why not buy a basic travel router from TP-Link or gl-inet, or a normal size router, even used... you can probably get something quite reasonable for ~$25-$50 USD.

1 Like

One of the things I've been trying to understand here is the level of difficulty involved. Apparently that would be 'high' then.

Still, I'm seeing $60+ dollar costs for modern hardware that has the recommended amount of storage these days, and I do really like the design and form factor of this unit, and I already have 90% of the hardware needed for the swap. Are we talking a difficulty closer to "nearly impossible" or the (assumed) "have to compile firmware"? It's not supported, yes, but couldn't I just copy the device definition from v17 to the modern builder and have it use whatever the modern packages are?

No, you would have to port it over to ath79 first, as there is no ar71xx target anymore (and they are very different; even if there still were an ar71xx target, you'd still have to forward port quite a lot of code). It really doesn't make sense for a device with 32 MB RAM (big hurdle for even upgrading/ flashing in the first place, as the whole image needs to fit into RAM - the part that remains free while running…) - and even less for a device with 100BASE-T ethernet.

Oh. Well, that's a shame. What happened that the entire target was removed??

It was replaced by ath79, covering the same devices (at least the ones people cared about to port over, the majority, but not all).

Is there a popular device you'd suggest to replace this one? It's hard to cross-reference a store page with the OpenWRT support list, so if there's a similar 4-port switch with indicators and Wi-Fi that's well supported I'd love suggestions.

In the interest of making this conversation somewhat helpful to anyone else searching for flash memory expansion, though - or just so I know what to do with a flash backup - I am really stumped by how to read the MTD layout. Why does it seem to have partitions that duplicate others or whatever? How do I restore that if a flash chip dies or I make a mistake? I've tried searching both the wiki and the forum but I still don't understand that part because direct flash interfacing seems rare and usually done by people who don't bother to explain these smaller details.

(Also, is it an issue that the filesizes aren't always the same as the partitions? Like, here, the MTD says the kernel is 0011573f in size, but converting the actual backup size comes out to 00115600. Is that missing data? What if the kernel were to be larger than the partition? Does that resize based on the builder computing some "nearest" size - though that's an unusual size difference - or is that a hard limit?)

Obviously whatever new device I use would have different numbers, but I'm still trying to understand what exactly is going on here, and my travel router (sadly without enough ports) has the same MTD partition overlap between firmware (16M but somehow without the uboot, etc) and the others.

Availability and pricing varies widely between countries/ continents - and you may even find great stuff on the used markets.

But it's not worth the cost of the flash chip or your time.

You should be able to find used stuff fairly inexpensively... even if it is old-ish, you should be able to find something that has reasonably modern amounts of ram and storage.