D-Link DIR-632

Supported Versions

This is a work in progress, check the forum page https://forum.openwrt.org/viewtopic.php?pid=198927 "D-LINK DIR-632, wireless router with 8 ports switch!" for updates.

An 'alpha' image built from trunk is now available, you may try this AT YOU OWN RISK! It may brick your device, so only try this if you have an understanding of how to recover again.

https://github.com/andymc73/openwrt-dir632/raw/master/openwrt-ar71xx-generic-dir-632-a1-squashfs-factory.bin

Build Instructions

See interim instructions at DIR-321-A1 build instructions

Hardware Highlights

HW Rev CPU Ram Flash Network Gigabit USB Serial JTag
A1 Atheros AR7241/AR7242@400MHz (MIPS32 24Kc) 32MB 8MB 9 x FastEthernet No Yes Yes Yes

Enviroment

bootargs= console=ttyS0,115200 root=31:03 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(nvram),1984k(linux),5568k(rootfs),64k(MAC),192k(LP),64k(ART) mem=32M

bootcmd=bootm 0x9f050000

bootdelay=1

baudrate=115200

ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee

ipaddr=192.168.0.1

serverip=192.168.0.2

stdin=serial

stdout=serial

stderr=serial

ethact=eth0

Environment size: 369/65532 bytes

Serial Port

Name
1 +3.3V
2 Write from PC
3 Read to PC
4 GND

Hardware

Info

Instruction set: MIPS
Vendor: Qualcomm Atheros
Bootloader: U-Boot
System-On-Chip: AR7242-AH1A
CPU @Frq
Flash size: 8192 KiB
Flash Chip: 25L6445 M2I-10G 3H417200 256B page 4kb sector 32/64k block NOR flash with 4k OTP bits and BP0-BP3 write protect
RAM size: 32 MiB
RAM Chip: PSC A3S56D40ETP 256Mbit DDR
Wireless No1: SoC-integrated: AR7242-AH1A w/ 3x3 MIMO for 2.4GHz 802.11b/g/n?
Wireless No2: separate Chip: AR9287 w/ 3x3 MIMO for 5GHz 802.11a/n?
Switch: RealTek RTL8309G 8Port FastEthernet Switch w/ vlan support, MP1482DS B5827929 MPSB29 (switching power supply)
Modem: n/a
USB: Yes 1 x 2.0 / 3.0
Serial: Yes
JTAG: Yes

MTD

Original firmware version:

Creating 9 MTD partitions on "ar7240-nor0":

Address size MTD part.
0x00000000-0x00040000 256k "u-boot"
0x00040000-0x00050000 64k "nvram"
0x00050000-0x00240000 1984k "linux"
0x00240000-0x007b0000 5568k "rootfs"
0x007b0000-0x007c0000 64k "MAC"
0x007c0000-0x007f0000 192k "LP"
0x007f0000-0x00800000 64k "ART"
0x00050000-0x007b0000 "Linux"
0x00000000-0x00800000 "ALL"

# cat /proc/mtd

dev: size erasesize name
mtd0: 00040000 00010000 "u-boot"
mtd1: 00010000 00010000 "nvram"
mtd2: 001f0000 00010000 "linux"
mtd3: 00570000 00010000 "rootfs"
mtd4: 00010000 00010000 "MAC"
mtd5: 00030000 00010000 "LP"
mtd6: 00010000 00010000 "ART"
mtd7: 00760000 00010000 "Linux"
mtd8: 00800000 00010000 "ALL"

DD-wrt version:

Address MTD part.
0x0 - 0x50000 RedBoot
0x50000 - 0x7e0000 linux
0x156000 - 0x720000 rootfs
0x720000 - 0x7e0000 dd-wrt
0x7e0000 - 0x7f0000 nvram
0x7f0000 - 0x800000 board_config
0x0 - 0x800000 full_flash
0x0 - 0x50000 full_boot

cat /proc/mtd

MTD part. Size EraseSize Name
mtd0 0x50000 0x10000 RedBoot
mtd1 0x790000 0x10000 linux
mtd2 0x5ca000 0x10000 rootfs
mtd3 0xc0000 0x10000 dd-wrt
mtd4 0x10000 0x10000 nvram
mtd5 0x10000 0x10000 board_config
mtd6 0x800000 0x10000 full_flash
mtd7 0x50000 0x10000 full_boot

Stock firmware bootlog

U-Boot 1.1.4 (Sep 21 2010 - 12:20:01) AP101 (ar7242 - Virian) U-boot DRAM: sri ar7240_ddr_initial_config(133): virian ddr1 init #### TAP VALUE 1 = 0x2, 2 = 0x2 [0xffffffff: 0xffffffff] 32 MB Top of RAM usable for U-Boot at: 82000000 Reserving 235k for U-Boot at: 81fc4000 Reserving 192k for malloc() at: 81f94000 Reserving 44 Bytes for Board Info at: 81f93fd4 Reserving 36 Bytes for Global Data at: 81f93fb0 Reserving 128k for boot params() at: 81f73fb0 Stack Pointer at: 81f73f98 Now running in RAM - U-Boot at: 81fc4000 id read 0x100000ff sector count = 128 Flash: 8 MB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: ag7240_enet_initialize... Fetching MAC Address from 0x81fecb90 Fetching MAC Address from 0x81fecb90 : cfg1 0xf cfg2 0x7114 eth0: b8:a3:86:4e:7c:f2 eth0 up : cfg1 0xf cfg2 0x7114 eth1: b8:a3:86:4e:7c:f2 ATHRS26: resetting s26 ATHRS26: s26 reset done eth1 up eth0, eth1 Hit any key to stop autoboot: 1  0 ## Booting image at 9f050000 ... Image Name: Linux Kernel Image Created: 2011-04-19 12:18:21 UTC Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 1047598 Bytes = 1023 kB Load Address: 80002000 Entry Point: 802e8000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK No initrd ## Transferring control to Linux (at address 802e8000) ... ## Giving linux memsize in bytes, 33554432 Starting kernel ... Booting AR7240(Python)... Linux version 2.6.15--LSDK-7.3.0.260 (root@localhost.localdomain) (gcc version 3.4.4) #1 Tue Apr 19 20:12:10 CST 2011 flash_size passed from bootloader = 8 arg 1: console=ttyS0,115200 arg 2: root=31:03 arg 3: rootfstype=squashfs arg 4: init=/sbin/init arg 5: mtdparts=ar7240-nor0:256k(u-boot),64k(nvram),1984k(linux),5568k(rootfs),64k(MAC),192k(LP),64k(ART) arg 6: mem=32M CPU revision is: 00019374 Determined physical RAM map: memory: 02000000 @ 00000000 (usable) User-defined physical RAM map: memory: 02000000 @ 00000000 (usable) Built 1 zonelists Kernel command line: console=ttyS0,115200 root=31:03 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(nvram),1984k(linux),5568k(rootfs),64k(MAC),192k(LP),64k(ART) mem=32M Primary instruction cache 64kB, physically tagged, 4-way, linesize 32 bytes. Primary data cache 32kB, 4-way, linesize 32 bytes. Synthesized TLB refill handler (20 instructions). Synthesized TLB load handler fastpath (32 instructions). Synthesized TLB store handler fastpath (32 instructions). Synthesized TLB modify handler fastpath (31 instructions). Cache parity protection disabled PID hash table entries: 256 (order: 8, 4096 bytes) Using 200.000 MHz high precision timer. Console: colour dummy device 80x25 Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 28896k/32768k available (2442k kernel code, 3856k reserved, 521k data, 144k init, 0k highmem) Mount-cache hash table entries: 512 Checking for 'wait' instruction... available. NET: Registered protocol family 16 PCI init:ar7240_pcibios_init SCSI subsystem initialized Returning IRQ 48 TC classifier action (bugs to netdev@vger.kernel.org cc hadi@cyberus.ca) AR7240 GPIOC major 0 squashfs: version 3.1 (2006/08/19) Phillip Lougher Initializing Cryptographic API io scheduler noop registered io scheduler deadline registered HDLC line discipline: version $Revision: 1.1.1.1 $, maxframe=4096 N_HDLC line discipline registered. Software Watchdog Timer: 0.07 initialized. soft_noboot=0 soft_margin=60 sec (nowayout= 0) Serial: 8250/16550 driver $Revision: 1.1.1.1 $ 1 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A RAMDISK driver initialized: 1 RAM disks of 8192K size 1024 blocksize PPP generic driver version 2.4.2 PPP Deflate Compression module registered PPP BSD Compression module registered PPP MPPE Compression module registered NET: Registered protocol family 24 PPTP driver version 0.7.12 7 cmdlinepart partitions found on MTD device ar7240-nor0 Creating 7 MTD partitions on "ar7240-nor0": 0x00000000-0x00040000 : "u-boot" 0x00040000-0x00050000 : "nvram" 0x00050000-0x00240000 : "linux" 0x00240000-0x007b0000 : "rootfs" 0x007b0000-0x007c0000 : "MAC" 0x007c0000-0x007f0000 : "LP" 0x007f0000-0x00800000 : "ART" GACT probability on Mirror/redirect action on Simple TC action Loaded netem: version 1.1 u32 classifier Perfomance counters on input device check on Actions configured Netfilter messages via NETLINK v0.30. NET: Registered protocol family 2 IP route cache hash table entries: 512 (order: -1, 2048 bytes) TCP established hash table entries: 2048 (order: 1, 8192 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) TCP reno registered ip_conntrack version 2.4 (256 buckets, 2048 max) - 232 bytes per conntrack ip_ct_h323: init success ip_conntrack_rtsp v0.6.21 loading ip_nat_rtsp v0.6.21 loading ip_conntrack_pptp version 3.1 loaded ip_nat_pptp version 3.0 loaded ip_tables: (C) 2000-2002 Netfilter core team ipt_time loading ipt_recent v0.3.1: Stephen Frost . http://snowman.net/projects/ipt_recent/ ClusterIP Version 0.8 loaded successfully TCP bic registered NET: Registered protocol family 1 NET: Registered protocol family 10 IPv6 over IPv4 tunneling driver NET: Registered protocol family 17 arch/mips/ar7240/gpio.c (ar7240_simple_config_init) JUMPSTART_GPIO: 12 ar7240wdt_init: Registering WDT failed -16 VFS: Mounted root (squashfs filesystem) readonly. Freeing unused kernel memory: 144k freed init started: BusyBox v1.01 (2011.04.19-12:15+0000) multi-call binary Algorithmics/MIPS FPU Emulator v1.5 Please press Enter to activate this console. !! NVRAM UPGRADE !! CONFIG_NVRAM_SIZE=1024 nvram_default_init: default nvram count=969 configuration_version_control: configuration_version=1.01 in NVRAM configuration_version_control: configuration_version=1.01 in FIRMWARE AG7240: Length per segment 1536 AG7240: Max segments per packet 1 AG7240: Max tx descriptor count 80 AG7240: Max rx descriptor count 252 AG7240: fifo cfg 3 01f00140 AG7240CHH: Mac address for unit 0 AG7240CHH: 00:18:e7:e0:10:fc AG7240CHH: Mac address for unit 1 AG7240CHH: ff:ff:ff:ff:ff:ff cat /var/etc/nvram.default | grep check_fw_url > /var/tmp/check_fw_urlin get_default_mac!!! nvram_default_init: default nvram count=969 ag7240_ring_alloc Allocated 1280 at 0x81170000 ag7240_ring_alloc Allocated 4032 at 0x81ca2000 ATHRS26: resetting s26 ATHRS26: s26 reset done Setting PHY... ADDRCONF(NETDEV_UP): eth1: link is not ready eth1: Cannot assign requested address ag7240_ring_alloc Allocated 1280 at 0x81d6f800 ag7240_ring_alloc Allocated 4032 at 0x81d70000 rtl8309g_reg_init () Setting PHY... rtl8309g_phy_setup !! Not enabling interrupts in AR7242 yet... ADDRCONF(NETDEV_UP): eth0: link is not ready eth0: Cannot assign requested address rtl8309_ioctl: vlan_value:81c93ca8, vlan_port:8, cmd: 8946 device eth0 entered promiscuous mode TFTP main standard_tftp_server launched on port 69. Tue Apr 19 20:15:00 UTC 2011 Entry gpio_ioctl init_module !! init_LP umount: /tmp/LP: No such file or directory rm: cannot remove `/var/www/lingualMTD.js': No such file or directory lan mac = 00:01:23:45:67:89============= insmod_usb_core_mod ============= usbcore: registered new driver usbfs usbcore: registered new driver hub ============= insmod_usb_host_mod ============= Port Status c000004 ar7240-ehci ar7240-ehci.0: ATH EHCI ar7240-ehci ar7240-ehci.0: new USB bus registered, assigned bus number 1 ar7240-ehci ar7240-ehci.0: irq 3, io mem 0x1b000000 hcc_params addr 0xbb000108 val 0x6 hcs_params addr 0xbb000104 val 0x10011 ar7240-ehci ar7240-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (ar7240_ohci)block sizes: ed 64 td 64 rc is BUSY now! wps_pin==00000000 and wps_default_pin==00000000 eth1: Cannot assign requested address DHCP client start. eth0: Cannot assign requested address dhcpd_enabled:::::: domain empty DHCP server start. device_lan_ip=192.168.0.1 , device_lan_subnet_mask=255.255.255.0 ======================= === insmod_wlan_mod === ======================= ath_hal: module license 'Proprietary' taints kernel. ath_hal: 0.9.17.1 (AR5416, DEBUG, REGOPS_FUNC, WRITE_EEPROM, 11D) wlan: 0.8.4.2 (Atheros/multi-bss) ath_rate_atheros: Copyright (c) 2001-2005 Atheros Communications, Inc, All Rights Reserved ath_dev: Copyright (c) 2001-2007 Atheros Communications, Inc, All Rights Reserved ath_pci: 0.9.4.5 (Atheros/multi-bss) wifi0: Atheros 9287: mem=0x10000000, irq=48 hw_base=0xb0000000 wlan: mac acl policy registered wlan_me: Version 0.1 Copyright (c) 2008 Atheros Communications, Inc. All Rights Reserved insmod: cannot insert `/lib/modules/2.6.15/net//wlan_scan_ap.ko': Success (17): Success cat: /var/etc/resolv_ipv6.conf: No such file or directory Sending discover... ath0 device br0 already exists; can't create bridge with the same name device eth0 left promiscuous mode br0: port 1(eth0) entering disabled state device ath0 entered promiscuous mode rtl8309_ioctl: vlan_value:81a73ca8, vlan_port:8, cmd: 8946 device eth0 entered promiscuous mode Sending discover... br0: port 1(ath0) entering learning state br0: topology change detected, propagating br0: port 1(ath0) entering forwarding state /************** debug wlan setting ****************/ /* WlanMode: Set to default mode (AP) /* 80211Mode: 11NGHT20 /* ChannelWidth: 20 /* Essid: dlink /* Channel: 6 /* WEP: close /* WPA: close (non security) /* WPS: Non-Sec-Enable /* WPS AP-DEFAULT-PIN: 82372545 /* WPS AP-PIN: 82372545 /**************************************************/ ######################## ### turn wps-led off ### ######################## wantimer: dhcpc_release (WAN_VCT_DISCONNECT) Reading topology file /tmp/tmp/topology.conf ... Reading bss configuration file /tmp/tmp/secath0.conf ... Line 1: unsupported pairwise cipher suite 'NONE' 1 errors found in configuration file '/tmp/tmp/secath0.conf' IGNORING config file errors as directed. br0: port 1(ath0) entering disabled state Defaulted uuid based on mac addr b8:a3:86:4e:7c:f2 Could not connect to kernel driver. Using interface ath0 with hwaddr b8:a3:86:4e:7c:f2 and ssid 'dlink' Country ie is DE br0: port 1(ath0) entering learning state br0: topology change detected, propagating br0: port 1(ath0) entering forwarding state upnp_wps_device_init called l2_packet_receive - recvfrom: Network is down Sending discover... DHCPC Received SIGUSR2=>DHCPC Release Performing a DHCPC release Entering released state br0: File exists ########## udhcpd was killed by unknown reason ########## domain empty DHCP server start. device_lan_ip=192.168.0.1 , device_lan_subnet_mask=255.255.255.0 max_leases value (254) not sane, setting to 100 instead Unable to open /var/misc/udhcpd.leases for reading ============= insmod_usb_share_port_mod ============= NetUSB: NetUSB 0.9243, 2009, 0002060F NetUSB: SoftwareBus start 40 : 02 NetUSB: PAGE_SIZE 4096 NetUSB: AUTH SIG usbcore: registered new driver USB General Driver NetUSB: sleep to wait br0 to wake up NetUSB: use dev Name br0 NetUSB: sleep to wait br0 end. NetUSB: UDP_BROAD 9303 tcpPort:625868800 NetUSB: use dev Name br0 NetUSB: tcpConnector() started... wan_ipaddr == NULL, enable mac_filter/ upnp only Start Firewall: Clear iptables killall: crowdcontrol: no process killed killall: wakeOnLanProxy: no process killed start_qos traffic_shaping wan no IP already sh: cannot create /proc/sys/net/ipv6/conf/eth1/accept_ra: Directory nonexistent start_routev6 rc is IDLE now! NetUSB: Bind to br0

Flashing firmware

Flashing firmware with web browser

  1. Connect to LAN1 and set your PCs IP address to 192.168.0.2
  2. Hold down the reset button and power cycle the device
  3. Keep holding the button until the Power/Status LED flashes yellow
  4. Browse to http://192.168.0.1 user: admin, password:blank
  5. Go to TOOLS | FIRMWARE http://192.168.0.1/tools_firmw.asp
  6. Choose and Upload the firmware - either factory firmware, or another suitable uboot image such as DD-WRT, or soon, OpenWRT (trunk)
  7. When this is working you will get a "Device is upgrading the firmware" page which cycles through from 0 to 100%

I had some troubles getting to this point: Firefox 15.0.1 on Linux amd64, hung at the 'Upload' screen. Chrome 21 on Linux amd64 actually uploaded, (as verified by wireshark) and then hung. I could only succesfully complete this procedure using Windows XP with IE8 (!) My experience contradicts what is documented on the DD-WRT website, which states that Firefox only works.

Flashing firmware with u-boot

This should be possible using TFTP, as desribed elsewhere: http://wiki.openwrt.org/doc/howto/generic.flashing.tftp However, I could not get it to work at all, the device would not properly respond to ARP and may have other issues - see post on the forum.

It is possible to load and run an INITRD kernel over the serial port using kermit, so with a bit more work this procedure can probably be extended to writing an image into the flash.

(Note: using Debian Linux, use `apt-get install ckermit` and run `kermit` )

  1. Connect a TTL serial device (e.g. 3v3 TTL-USB adaptor, etc) to the pins shown in the above images
  2. Power cycle the router
  3. Using kermit, press enter to get to the u-boot menu when prompted. If needed configure to connect using 115200-8n1
  4. At the prompt, type the following, this will wait for a file to be loaded to memory address 0x81000000 (16mb through the RAM)
    loadb
  5. At this point, hit CTRL+/ (Control and Forward Slash) then hit C this will cause kermit to drop to a prompt
  6. At the kermit prompt, type the following, where send «some-image-file» is the filename of the u-boot image. This works best if you run kermit from the same directory as the image.
    send «some-image-file»
  7. This will cause kermit to upload the file. This will take several minutes.
  8. When kermit returns to the prompt, hit C
  9. At the uboot prompt, type
    bootm
  10. This will run the uimage from the default load address of 0x81000000

GPIOs

GPIO AR7242 Pin Default Purpose
0 14 LED WPS (blue)
1 12? LED STATUS (bicolour: orange)
6 81 LED STATUS (bicolour: green) JTAG
7 82 LED WAN (bicolour: orange) JTAG
8 85 BUTTON Reset
9 86 UART 3v3Rx from PC
10 87 UART 3v3Tx to PC
11 88 LED USB (green)
12 89 BUTTON WPS
13 90 Test point TP3
14 91 Test point TP4
15 92 Test point TP5
17 ?? LED WAN (bicolour: green)

Debricking Procedure

In case you get a brick in your DIR-632 yo can use procedure is similar to the DIR-620 and other related devices.

Other Info

Tags

Back to top

toh/d-link/dir-632.txt · Last modified: 2014/03/17 16:13 by al