Nand flash driver for bcm47xx wnr3500lv2

I think I have one of these somewhere. I know mine has a USB port. I'm not certain what version I have.

Looks like dd-wrt is still active with this device:

http://svn.dd-wrt.com/changeset/33170

I don’t want to shoot down this project, but what will you do after you managed to port the NAND driver? I mean, you are still left with a marginal supported WiFi chipset.

Now if you could make WiFi work, that would be more than impressive.

Again, the learning experience from porting and patching the driver in itself could be a “goal”; then using the device with limited WiFi, but with other packages running (dedicated VPN, sort of NAS or torrent client to name something)

I don't understand why the work from dd-wrt can't be leveraged. Is there some proprietary code? What's the problem? I thought dd-wrt works fine on this router. But maybe I am misremembering.

Yes, DD-WRT is using proprietary code for the Broadcom SoC. They have some “wrapper” to use the binary blob and they have some non-disclosure agreement with Broadcom. The problem with that approach seems to be that it limits the kernel version to a v3.x. They have security updates on DDWRT, I saw that they are working on backporting the WPA2 patches.

As for the NAND driver, I don’t see why that wouldn’t be possible to port to LEDE (don’t have one, can’t help with that).

Oh, sounds ugly. I also have a vague memory of some recent exploits for broadcom but can't recall if it was this chip or not. It does start to sound like a bad idea.

If you can live with the Wifi limitations (depends what you want to do with your device), then fixing the Nand (maybe usb) drivers makes sense. Maybe even not for you, but other users might “repurpose” their Broadcom device. Suggestions in my previous reply.

I guess bcm caters to "law enforcement" and leaves backdoors in there. Afterall when you're in law everyone's a suspect.

So I may still dig mine out and see which one I have and if it's doable. Maybe it could be useful as a NAS.

Concerning wifi driver I hope(d) that it would be supported by b43 driver.

Are you sure about that? Because they seem to use the bcrm sdk which is not included in openwrt/lede kernel and which seems to be free software, and which I tried to port to openwrt kernel (unsuccessfully for now). Also the nand driver itself is very clearly free as it is provided by the file "linux-3.10/drivers/mtd/bcm947xx/nand/brcmnand_47xx.c" from the dd-wrt kernel, and there is a free software copyright notice.

My problem for now is that no pci bus seems to be detected in the first place, so the driver which is pci based can't run.

Also note that tomato also runs well on wnr3500lv2 with kernel 2.6.x (usb,nand, wifi) I'm not sure if they also have an agreement.

For those who whish to build a custom .bin image flashable from dd-wrt:

I see arch/mips/pci/pci-bcm47xx.c so it seems that you need to check your pci config in your kernel .config.

Does the bcm sdk contain proprietary code/blobs?

Ok I will see that.

I don't think there is proprietary blob in the sdk, it is available in the folder brcm in the root folder kernel tree.

In my kernel tree pci-bcm47xx.c seems to be compiled since I have a pci-bcm47xx.o. But I still don't have any pci bus when calling pci_find_bus(0, 0) (it returns NULL).

Pierre, I have noticed lately that you're working on this. I had the best of intentions to do some looking around at Netgear's "stock" firmware some months back and instead got busy with other things. Now I won't be able to do anything until after Christmas. But since you've already taken a stab at DD-WRT (and it doesn't surprise me that it was a no-go), why not take a look at the Netgear source codes yourself? They are GPLed since Netgear ported someone else's Linux code base as a starting point. I think the worst thing that might happen is you'll find that the NAND driver was included as an ABI. But you might also find a chunk of source code that you can easily adapt. https://www.downloads.netgear.com/files/GPL/WNR3500Lv2-V1.2.0.44_40.0.84_src.tar.gz.zip

P.S.: If you get a build that seems to work, I will make time to do some testing for you.

@drfranco

Thanks but most honestly I don't know what to do with this code....
I don't see any nand driver in it.

Isn’t the router using the same SoC as the Linksys E4200v1? Should be using the same NAND driver right?

I think that NAND driver is in bcm47186\src\linux\linux-2.6\drivers\mtd\47xxnand

Off course using fresh 2.6.22 kernel

Yes the file brcmand_47xx.c in the folder bcm47186\src\linux\linux-2.6\drivers\mtd\47xxnand seems to be more or less the same as the one in dd-wrt.

The thing is it won't work any better than the other if I don't have a PCI bus detected....

@pparent76 Hmm. Surprising. That must mean that the Netgear code is inheriting a flash ROM access environment from the CFE. Sorry I wasted your time.

@pparent76 Pierre, I looked over my scribbles from earlier this year and there's one thread in an OpenWRT forum about some patch work that was being done by a couple of the developers. I bring it to your attention here because it hasn't been mentioned so far in recent posts here. Best I can tell, Tathagatha Das had a patch that made the WNR3500Lv2 work, but it looks like it might have broken other devices so it may not have been accepted.

Here's the thread on the topic and here's a specific post detailing some patch work to the bus controller code.