Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2011 21:48:54 +0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Stefan Bethke <stb@lassitu.de>
Cc:        freebsd-embedded@freebsd.org
Subject:   Re: tplink TL-WR1043ND access point is now ready (was Re: svn commit: r227926 - head/sys/mips/conf)
Message-ID:  <CAJ-VmomAEoFNaU-s9sxUP2o%2BUw2uAwJJGUPRYga%2Bz-3qPHyW8w@mail.gmail.com>
In-Reply-To: <10FF4425-2A77-4A91-A656-645188929E16@lassitu.de>
References:  <CAJ-Vmo=aLVTgA10UAg=KQMyybeLmBjF75qXdpmFAkqdU9GzJvA@mail.gmail.com> <20111130094212.GA76927@psconsult.nl> <10FF4425-2A77-4A91-A656-645188929E16@lassitu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
+1 on the serial console.

Yes, you can revert to the original firmware. Well, I haven't yet tftp
-uploaded- what's in the flash, but what I suggest you do is this:

* modify my tplink config file to have an mdroot of 6 meg (and change
the rootfs to be /dev/md0.uzip
* when building the firmware, build "buildkernel installkernel mfsroot
fsimage netboot" - that'll blit the uzip mfsroot into the kernel,
leaving you with TP-WN1043ND.netboot
* you can then netboot the kernel:

> tftpboot 0x80050000 kernel.TP-WN1043ND.netboot
> go 0x80050100

.. then use dd and netcat to take a complete flash backup, something like:

# dd if=/dev/flash/spi0 bs=64k | nc <ip> <port>

That should leave you with an 8 megabyte image.

Finally, the trick to restoring the original firmware is to trim out
the first 128k and the last 64k of the firmware image. You can likely
use dd to do that. I haven't the time to think of the way to do it,
but something like this.

* skip the first 128k - that's uboot
* skip the last 128k - that's the config partition (ignore) and the
last 64k there is the radio calibration data

$ dd if=backup-image.bin of=firmware.bin bs=64k skip=2 count=124

.. I think that's right. That should leave you with an image you can
reflash later on:

> erase 0xbf020000 +7c0000  # I _think_ this is right, check with the openwrt wiki!
> tftpboot 0x81000000 backup-image.bin
> cp.b 0x81000000 0xbf020000 +7c0000
> bootm 0xbf020000

I -think- that's right. I'd appreciate it if someone else would
double-check my figures. But I've done that in the past so I have a
complete copy of the flash contents, including the radio calibration
data, in case I somehow screw it up.

Good luck!


Adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmomAEoFNaU-s9sxUP2o%2BUw2uAwJJGUPRYga%2Bz-3qPHyW8w>