OpenWrt Forum Archive

Topic: Boot fails on Netgear WGT634U

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,
I built some images (latest kamikaze revision) for my WGT634U using kernel 2.6, but when flashed it to the device (by serial connection) it doesn't work - it seems to fall into an endless reboot-loop.
This it what I was able to see with a serial connection:

CFE version 1.0.34 for BCM95365R (32bit,SP,LE)
Build Date: Tue Feb 24 03:21:41 CST 2004 (root@jackylinux)
Copyright (C) 2000,2001,2002 Broadcom Corporation.

Add MAC client version(DNI).
Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller
CPU type 0x29007: 200MHz
Total memory: 0x2000000 bytes (32MB)

Total memory used by CFE:  0x81BB1280 - 0x82000000 (4517248)
Initialized Data:          0x81BB1280 - 0x81BB3E90 (11280)
BSS Area:                  0x81BB3E90 - 0x81BB45D0 (1856)
Local Heap:                0x81BB45D0 - 0x81FB45D0 (4194304)
Stack Area:                0x81FB45D0 - 0x81FB65D0 (8192)
Text (code) segment:       0x81FB65E0 - 0x81FFFFB0 (301520)
Boot area (physical):      0x01B70000 - 0x01BB0000
Relocation Factor:         I:E23B65E0 - D:01BB0280

configure vlans
*****************************************************************
*********************** VLAN Driver initial  ********************
*****************************************************************
Process LAN port(2-5) vlan Architecture...
SUCCESS: trying to create VLAN 0 for switch
SUCCESS: trying to add LAN port

Process WAN port(2-5) vlan Architecture...
SUCCESS: trying to create VLAN 0 for switch
SUCCESS: trying to add WAN port
SUCCESS: enable ports  success
configure vlans...done
Device eth0:  hwaddr 00-0F-B5-0D-AF-93, ipaddr 192.168.1.1, mask 255.255.255.0
        gateway not set, nameserver not set
Loader:elf Filesys:raw Dev:flash0.os File: Options:(null)
***************************
****  MAC Client V1.0  ****
***************************
et0macaddr value :flag =0 value=00-0f-b5-0d-af-93
et1macaddr value :flag =0 value=00-0f-b5-0d-af-94
MAC exist at least one
system ethernet mac exist and not default....
Skip mac client process.....
Loading: 0x80001000/3740 Entry at 0x80001000
Closing network.
et0: link down
Starting program at 0x80001000
**Exception 8: EPC=804000A4, Cause=0000000C, VAddr=00000D74
                RA=8000112C, PRID=00029007

        0  ($00) = 00000000     AT ($01) = 00000000
        v0 ($02) = B4874448     v1 ($03) = 80400000
        a0 ($04) = 81FB60F8     a1 ($05) = 00000000
        a2 ($06) = 80000010     a3 ($07) = 30524448
        t0 ($08) = 80400000     t1 ($09) = 81FB60F8
        t2 ($10) = 80400000     t3 ($11) = 00000000
        t4 ($12) = 00000000     t5 ($13) = 00000000
        t6 ($14) = 00000000     t7 ($15) = 00000000
        s0 ($16) = 3E992C82     s1 ($17) = 00000010
        s2 ($18) = 00001000     s3 ($19) = 00000010
        s4 ($20) = 00002000     s5 ($21) = 00000100
        s6 ($22) = 80000010     s7 ($23) = 80400000
        t8 ($24) = FFFFFFC8     t9 ($25) = 804005B8
        k0 ($26) = 81FF5630     k1 ($27) = 81FF579C
        gp ($28) = 81BB9280     sp ($29) = 81FB6158
        fp ($30) = FFFF7E4C     ra ($31) = 8000112C



CFE version 1.0.34 for BCM95365R (32bit,SP,LE)
Build Date: Tue Feb 24 03:21:41 CST 2004 (root@jackylinux)
Copyright (C) 2000,2001,2002 Broadcom Corporation.
...

I really don't know what I'm doing wrong - I tried it with default packages, all packages and individual settings when configuring with 'make menuconfig'.

Any hints, tips, ideas?

Thanks & regards,
moh

(Last edited by moh_de on 19 Jan 2008, 15:14)

Hmmm....

The same behaviour when I try to flash the 'official' Kamikaze 7.09 image. But AFAIR this worked for me some time ago.
Maybe I bricked my WGT?

Regards,
moh

Hi,

exactly the same behaviour here. The unit was running fine with Kamikaze 7.09 and i wanted to replace the busybox 'mount' with the util-linux 'mount', but somehow symlinked it vice-versa, so the busybox binary got overwritten :-(
I wanted to recover that by reflashing Kamikaze 7.09 (using serial + tftp) but it's the same result as yours (exception, registerdump, rebooting, ...)
I tried to load the firmware image into the RAM and execute it from there (using the CFE commands) but still no luck, I also used other offsets to load the firmware to RAM but no luck either. I guess that the RAM is defective.
Any other recommendations? Is it possible to erase the content of the Linux flash partition using CFE?

Regards,
Patrick

(Last edited by EvilDevil on 20 Jan 2008, 08:51)

Okay, here's my serial console output: (I freshly flashed Kamikaze 7.09):

CFE version 1.0.34 for BCM95365R (32bit,SP,LE)
Build Date: Tue Feb 24 03:21:41 CST 2004 (root@jackylinux)
Copyright (C) 2000,2001,2002 Broadcom Corporation.

Add MAC client version(DNI).
Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller
CPU type 0x29007: 200MHz
Total memory: 0x2000000 bytes (32MB)

Total memory used by CFE:  0x81BB1280 - 0x82000000 (4517248)
Initialized Data:          0x81BB1280 - 0x81BB3E90 (11280)
BSS Area:                  0x81BB3E90 - 0x81BB45D0 (1856)
Local Heap:                0x81BB45D0 - 0x81FB45D0 (4194304)
Stack Area:                0x81FB45D0 - 0x81FB65D0 (8192)
Text (code) segment:       0x81FB65E0 - 0x81FFFFB0 (301520)
Boot area (physical):      0x01B70000 - 0x01BB0000
Relocation Factor:         I:E23B65E0 - D:01BB0280

configure vlans
*****************************************************************
*********************** VLAN Driver initial  ********************
*****************************************************************
Process LAN port(2-5) vlan Architecture...
SUCCESS: trying to create VLAN 0 for switch
SUCCESS: trying to add LAN port

Process WAN port(2-5) vlan Architecture...
SUCCESS: trying to create VLAN 0 for switch
SUCCESS: trying to add WAN port
SUCCESS: enable ports  success
configure vlans...done
Device eth0:  hwaddr 00-0F-B5-0E-65-C7, ipaddr 192.168.2.250, mask 255.255.255.0
        gateway 192.168.2.1, nameserver 192.168.2.1
Loader:elf Filesys:raw Dev:flash0.os File: Options:(null)
***************************
****  MAC Client V1.0  ****
***************************
et0macaddr value :flag =0 value=00-0f-b5-0e-65-c7
et1macaddr value :flag =0 value=00-0f-b5-0e-65-c8
MAC exist at least one
system ethernet mac exist and not default....
Skip mac client process.....
Loading: 0x80001000/3740 Entry at 0x80001000
Closing network.
et0: link down
Starting program at 0x80001000
**Exception 32: EPC=80007F3C, Cause=00000020, VAddr=00000000
                RA=8000112C, PRID=00029007

        0  ($00) = 00000000     AT ($01) = 00000000
        v0 ($02) = 00000FAB     v1 ($03) = 000015DA
        a0 ($04) = 81FB6180     a1 ($05) = 80239480
        a2 ($06) = 802393F0     a3 ($07) = 80300000
        t0 ($08) = 80300000     t1 ($09) = 81FB60F8
        t2 ($10) = 80300000     t3 ($11) = 00000000
        t4 ($12) = 00000000     t5 ($13) = 00000000
        t6 ($14) = 00000000     t7 ($15) = 00000000
        s0 ($16) = 3E992C82     s1 ($17) = 00000010
        s2 ($18) = 00001000     s3 ($19) = 00000010
        s4 ($20) = 00002000     s5 ($21) = 00000100
        s6 ($22) = 81FCE640     s7 ($23) = 81BB7420
        t8 ($24) = FFFFFFC8     t9 ($25) = 803005B8
        k0 ($26) = 001DB85B     k1 ($27) = 81FC73D4
        gp ($28) = 81BB9280     sp ($29) = 81FB61B0
        fp ($30) = FFFF7E4C     ra ($31) = 8000112C



....

After reading through other posts and forums I started to believe that there's something wrong with CFE. Is it possible to reflash the CFE part of the Flashmemory using CFE? Could someone send me the CFE.bin or post a link to it?

TIA,

Regards,
Patrick

Hi,
I am afraid that the CFE boot loader has been damaged - but no clue how this could happen.
Unfortunately the only way to restore the CFE is flashing by JTAG - and the WGT634U AFAIK is not JTAG-capable. Is anyone able to confirm this?

mfg,
moh

Hi,

It could still be possible to flash the CFE from CFE

CFE> show devices
Device Name          Description
-------------------  ---------------------------------------------------------
uart0                NS16550 UART at 0x18000300
uart1                NS16550 UART at 0x18000400
flash0.boot          New CFI flash at 1C000000 offset 00000000 size 384KB
flash0.config        New CFI flash at 1C000000 offset 00060000 size 128KB
flash0.os            New CFI flash at 1C000000 offset 00080000 size 7672KB
flash0.nvram         New CFI flash at 1C000000 offset 007FE000 size 8KB
eth0                 BCM4710 Ethernet unit 0 (00-0F-B5-0E-65-C7)
*** command status = 0
CFE> flash -noheader tftp-host:CFE.bin flash0.boot

should do the trick(at least I hope so). Flashing still seems to work fine, so I would give it a try (if I had the matching CFE.bin)...
Is it possible to save the content of the Flashmemory to a TFTP-host using the CFE?
"save" looks like it can only dump the contents of the DRAM.

Regards,
Patrick

(Last edited by EvilDevil on 20 Jan 2008, 21:34)

Once again...

I reflashed CFE.bin from another unit and reflashed Kamikaze 7.09 but the problem still persists. sad
It's a hardware problem sad

Regards,
Patrick
PS: If you want the CFE.bin, just PM me.

Hmm.. it could still be a OpenWRT problem...
I followed the instructions on http://people.zoy.org/~walken/wgt634u/HOWTO.html and installed Debian on the WGT and it is booting *??*
At least as long it loads the kernel via TFTP from my server.
If I want to write the Kernel to /dev/mtd2 using

flashcp /vmlinuz /dev/mtd2

it tells me, that /dev/mtd2 is read-only:

wgt:~# flashcp -v /vmlinuz /dev/mtd2
Erasing blocks: 2/7 (28%)
While erasing blocks 0x00020000-0x00040000 on /dev/mtd2: Read-only file system

wgt:~# dd if=/dev/zero of=/dev/mtd2 bs=128k count=1
1+0 records in
1+0 records out
131072 bytes (131 kB) copied, 0.2156 seconds, 608 kB/s
wgt:~# dd if=/dev/zero of=/dev/mtd2 bs=128k count=2
dd: writing `/dev/mtd2': Read-only file system
2+0 records in
1+0 records out
131072 bytes (131 kB) copied, 0.146552 seconds, 894 kB/s

Could the Flash be worn out? I can write to the first 128kBytes, but fail to write to the next 128k block.
Well, after some more investigation, I did

flash_erase /dev/mtd2
flashcp -v /vmlinuz /dev/mtd2
reboot

and it's booting the kernel from internal Flash....
I'll stick with debian and live happily ever after... wink

Regards,
Patrick

Last message so far:

I don't know what exactly put the unit back to life, but I gave OpenWrt a last try and flashed it again (CFE and TFTP) and it's working now.

Regards,
Patrick

@EvilDevil: PM sent.

Thanks for the CFE, EvilDevil.

I tried to reflash it - and after reflashing Kamikaze no more exceptions occured. Booting still fails the WGT just stops.
After that I tried flashing a debian (like mentioned above) - but no luck. The kernel boots correctly (by TFTP), but the USB-rootfs doesn't seem to be recognized:

PCI: Fixing up device 0000:00:00.0
Time: MIPS clocksource has been installed.
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
io scheduler noop registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A
serial8250: ttyS1 at MMIO 0x0 (irq = 3) is a 16550A
b44.c:v1.01 (Jun 16, 2006)
eth0: Broadcom 10/100BaseT Ethernet 00:0f:b5:0d:af:93
flash init: 0x1c000000 0x02000000
Physically mapped flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Flash device: 0x800000 at 0x1fc00000
Creating 4 MTD partitions on "Physically mapped flash":
0x00000000-0x00060000 : "cfe"
0x00060000-0x00080000 : "config"
0x00080000-0x007e0000 : "os"
0x007e0000-0x00800000 : "nvram"
PCI: Enabling device 0000:00:02.2 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.2
ehci_hcd 0000:00:02.2: EHCI Host Controller
ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:02.2: irq 5, io mem 0x40000000
ehci_hcd 0000:00:02.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Waiting 1sec before mounting root device...
usb 1-1: new high speed USB device using ehci_hcd and address 2
VFS: Cannot open root device "sda1" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

So no login prompt. Hmpf.
I'll do further investigation tomorrow.

Regards,
moh

Hi,

what kind of USB-device did you use for the rootfs? How did you partition it? I used a 512M No-Name USB-Stick, 2 primary partitions (first ext2 rootfs, untared the http://people.zoy.org/~walken/wgt634u/etch-base.tar.bz2 to it and changed the configs in /etc as described in the howto, second 12 MB swapspace). I put the Stick directly to the WGT634U's USB-port (without a hub).

Hope this helps smile

Regards,
Patrick

Hi EvilDevil,
I also used a no-name 512Mb Stick. Partitioning was done by gparted, I created a 128Mb Swap partition at the end and used the remaining space for an ext2-partition. I followed the instructions mentioned above (extracting etch-base.tar.bz2, changing configs except fstab <- could this be the prob? etc.) and plugged it directly into the router.

I'll give it another try afterwards.

Thanks & regards,
moh

Ok,
let's summarize:

What I've done before plugging the stick into the router is this:

<created an ext2 partition 'sdb1' with gparted>
cd /mnt
mkdir etch
mount /dev/sdb1 etch
tar xvjpf /home/moh/Downloads/etch-base.tar.bz2
<changed some configuration files in /etc, only network settings>
cd
sync
touch /mnt/etch/var/log/wtmp
umount /mnt/etch
rmdir /mnt/etch
<created a swap partition 'sdb2' with gparted>

After switching the router on, it still fails to boot:

PCI: Enabling device 0000:00:02.2 (0000 -> 0002)
PCI: Fixing up device 0000:00:02.2
ehci_hcd 0000:00:02.2: EHCI Host Controller
ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:02.2: irq 5, io mem 0x40000000
ehci_hcd 0000:00:02.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Waiting 1sec before mounting root device...
usb 1-1: new high speed USB device using ehci_hcd and address 2
VFS: Cannot open root device "sda1" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

It seems that the USB-stick is beeing recognized. Maybe the 1sec wait-period is too *short* - or in other words, I've got a sedate stick? :-(

Regards,
moh

Hi moh,

the /etc/fstab can't be the problem as it gets read later in the boot-process. It looks like your USB-Stick is really too slow as the partition table is usually shown after full detection. You could try to change the kernel commandline using

setenv -p kernel_args "console=ttyS0,115200 root=/dev/sda1 usb_storage.delay_use=0 rootdelay=6"

This is the original commandline from http://people.zoy.org/~walken/wgt634u/k … g-2.6.22.2 :

CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/sda1 usb_storage.delay_use=0 rootdelay=1"

I'm not sure if the Debian kernel reads kernel_args, but you could give it a try wink

Anyway, if that does not work, I prepared a patched version of the debian kernel (gunzipped http://people.zoy.org/~walken/wgt634u/k … z-2.6.22.2 , edited the kernel using hexedit (replaced rootdelay=1 with rootdelay=9) and gzipped it again.
You can grab it at http://gauntlet.unixag-zw.fh-kl.de/~pasc0010/wgt/

Regards,
Patrick

PS:
I just discovered that Michel Lespinasse (the author of the Debian on WGT HowTo) faced a similar problem:
https://lists.one-eyed-alien.net/piperm … 02735.html

(Last edited by EvilDevil on 23 Jan 2008, 07:56)

Wow, thanks a lot, EvilDevil! Your patched kernel works like a charm:

...
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
Waiting 9sec before mounting root device...
usb 1-1: new high speed USB device using ehci_hcd and address 2
usb 1-1: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
scsi 0:0:0:0: Direct-Access              USB DRIVE        1.13 PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: [sda] 1014784 512-byte hardware sectors (520 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 1014784 512-byte hardware sectors (520 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI removable disk
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 96k freed
Algorithmics/MIPS FPU Emulator v1.5
INIT: version 2.86 booting
Starting the hotplug events dispatcher: udevdudevd[175]: main: the kernel does not support inotify, udevd can't monitor configuration file changes
.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...done.
Starting boot logger: bootlogd.
Set initial date: Tue Jan 22 19:26:19 UTC 2008.
Activating swap...Adding 128512k swap on /dev/sda2.  Priority:-1 extents:1 across:128512k
done.
Checking root file system...fsck 1.40-WIP (14-Nov-2006)
/dev/sda1: clean, 7645/94376 files, 113860/377496 blocks
done.
Setting the system clock..
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Cleaning up ifupdown....
Loading device-mapper support.
Checking file systems...fsck 1.40-WIP (14-Nov-2006)
done.
Setting kernel variables...done.
Mounting local filesystems...done.
Activating swapfile swap...done.
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCETHTOOL: your ethernet module is either unsupported or outdated: No such device
SIOCGETCPHYRD: No such device
Setting up networking....
Configuring network interfaces...SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.
done.
Running ntpdate to synchronize clock...done.
INIT: Entering runlevel: 2
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
* Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
Stopping boot logger: bootlogd.

Debian GNU/Linux 4.0 mymipsel ttyS0

mymipsel login:

Ok, I'll continue now. Let's see if we can reawake Kamikaze on this unit... ;-)

Thanks & Regards,
moh

Ok, next two problems:

a) eth0 doesn't come up
b) no idea where to find 'flashcp' (maybe it's located in 'mtd-tools'?)

So long,
moh

Hi,

AFAIR you have to manually bring up eth0

ifconfig -a

should show it anyway. So, just give it an ip adress in your range:

ifconfig eth0 192.168.x.yy

I'm not sure which port eth0 is mapped to,  but you can try to ping a local host on your network which is known to respond to ping and plug the cable in every port until ping is getting responses.
Check your DNS- and gateway settings, run apt-get update and apt-get install mtd-tools and you should be ready for flashcp smile

Regards,
Patrick

Hi,
and thanks again EvilDevil. I had to bring up 'eth1' instead of 'eth0', now I've got full network services.

After that I tried flashing the kernel, but everytime I get a 'readonly file system' error:

mymipsel:~# flashcp /vmlinuz /dev/mtd2
While erasing blocks from 0x00000000-0x000e0000 on /dev/mtd2: Read-only file system
mymipsel:~# flashcp -v /vmlinuz /dev/mtd2
Erasing blocks: 2/7 (28%)
While erasing blocks 0x00020000-0x00040000 on /dev/mtd2: Read-only file system
mymipsel:~# dd if=/dev/zero of=/dev/mtd2 bs=128k count=1
1+0 records in
1+0 records out
131072 bytes (131 kB) copied, 0.251147 seconds, 522 kB/s
mymipsel:~# dd if=/dev/zero of=/dev/mtd2 bs=128k count=2
dd: writing `/dev/mtd2': Read-only file system
2+0 records in
1+0 records out
131072 bytes (131 kB) copied, 0.146266 seconds, 896 kB/s
mymipsel:~# flash_erase /dev/mtd2
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0x0 done
mymipsel:~# flashcp -v /vmlinuz /dev/mtd2
Erasing blocks: 2/7 (28%)
While erasing blocks 0x00020000-0x00040000 on /dev/mtd2: Read-only file system
mymipsel:~#

I just followed your steps above, but no luck. 'mtd2' seems to be (partly) readonly. Any idea?

Thanks & regards,
moh

Hi,

mymipsel:~# flash_erase /dev/mtd2
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0x0 done

Strange thing is that it erases only 128kByte. I'm not sure if I had the same results.
Could you post the output of flash_info /dev/mtd*   ? Or mtd_debug info /dev/mtd*

Regards,
Patrick

Yep:

mymipsel:~# mtd_debug info /dev/mtd4
open(): No such file or directory
mymipsel:~# flash_info /dev/mtd0
Device /dev/mtd0 has 0 erase regions
mymipsel:~# flash_info /dev/mtd1
Device /dev/mtd1 has 0 erase regions
mymipsel:~# flash_info /dev/mtd2
Device /dev/mtd2 has 0 erase regions
mymipsel:~# flash_info /dev/mtd3
Device /dev/mtd3 has 0 erase regions

mymipsel:~# mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags = MTD_BIT_WRITEABLE
mtd.size = 393216 (384K)
mtd.erasesize = 131072 (128K)
mtd.writesize = 1
mtd.oobsize = 0
mtd.ecctype = (unknown ECC type - new MTD API maybe?)
regions = 0

mymipsel:~# mtd_debug info /dev/mtd1
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 131072 (128K)
mtd.erasesize = 131072 (128K)
mtd.writesize = 1
mtd.oobsize = 0
mtd.ecctype = (unknown ECC type - new MTD API maybe?)
regions = 0

mymipsel:~# mtd_debug info /dev/mtd2
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 7733248 (7M)
mtd.erasesize = 131072 (128K)
mtd.writesize = 1
mtd.oobsize = 0
mtd.ecctype = (unknown ECC type - new MTD API maybe?)
regions = 0

mymipsel:~# mtd_debug info /dev/mtd3
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 131072 (128K)
mtd.erasesize = 131072 (128K)
mtd.writesize = 1
mtd.oobsize = 0
mtd.ecctype = (unknown ECC type - new MTD API maybe?)
regions = 0

Regards,
moh

Hmm.. I just was looking and poking around in some man-pages and online-documentation:
http://www.linux-mtd.infradead.org
Some things that might be of use:
flash_unlock /dev/mtd2
flash_erase -j /dev/mtd2

Regards,
Patrick

:-(

mymipsel:~# flash_unlock /dev/mtd2
Physically mapped flash: block unlock error: (status timeout)
Could not unlock MTD device: /dev/mtd2

mymipsel:~# flash_erase -j /dev/mtd2
File open error

Regards,
moh

flash_eraseall -j /dev/mtd2 ?

testing...

<edit>

  Yeeehaaa!

mymipsel:~# flash_eraseall -j /dev/mtd2
Erasing 128 Kibyte @ 740000 -- 98 % complete. Cleanmarker written at 740000.
mymipsel:~# flash-vmlinuz -v
Erasing blocks: 7/7 (100%)
Writing data: 878k/878k (100%)
Verifying data: 878k/878k (100%)
mymipsel:~#

</edit>

(Last edited by moh_de on 24 Jan 2008, 22:07)

Congratulations, this looks *quite* good smile
Happy OpenWrt-ing wink

Regards,
Patrick

The discussion might have continued from here.