OpenWrt Forum Archive

Topic: D-LINK DIR-632, wireless router with 8 ports switch!

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

Please, make openwrt running on this great router!

http://ecx.images-amazon.com/images/I/41iy2t%2BUY2L.jpg

http://ecx.images-amazon.com/images/I/41KmWL9kIsL.jpg

http://farm6.static.flickr.com/5108/5620838314_00d6fbb06d_b_d.jpg

http://www.dd-wrt.com/phpBB2/files/p5110023_332.jpg

http://www.dd-wrt.com/phpBB2/files/p5110021_122.jpg

Hardware Spect:
PCB ver.: A1
D-Link Firmware: 1.0.2 dated: 2010/11/26
CPU: AR7241 or AR7242 @ 400Mhz(MIPS32 24Kc)*
Wireless NIC: AR9287 <= from FCC ID search's photo
8 port switch chip: RTL8309G
rom ROM size: 8mb <= The D-Link official rom is 7.6mb*
RAM: 32MB <= my guess.*
KY capacitor <= not Japanese brand.
One USB, can connect to a USB hub, for more usb devices sharing.
USB 3G: It support D-Link its own DWM-156 3G nic.
Power in: 100~240V 0.4A, Power Out 5V 2.5A

*: CPU: CPU, RAM and ROM are covered by metal plate and photos form FCC ID search are not clear enough to identify the chips' model number. The above info is my guess based on my research from the web or some common technical sense. From Openwrt.com supported hardware, routers use Athero AR9287 wirelsss nic are based on Athero AR7241 CPU. I downloaded D-Link GPL source code for DIR-632, it states as AR7242. As from Openwrt.com, all the ar724x cpus use Target ar71xx for firmware source code compiling. RAM: all the ar7241 cpu routers have 32mb of ram. ROM: The official rom is around 7.6mb. The physical rom size can't be smaller that that. DIR-632 does have many help description written in asp and built into the ROM file, which make sense why it is 8mb rom.

(Last edited by LKS on 27 Oct 2011, 12:19)

USB too, sweet. Non-Gigabit Ethernet ports, not so sweet.

(Last edited by robrob on 27 Oct 2011, 12:19)

robrob wrote:

USB too, sweet. Non-Gigabit Ethernet ports, not so sweet.

lol. but if u need more of 4 ports, the 632 is "the guy"!

ps: its not newer router, but its the only I found with 8 ports.

There is nothig sweet in many ports. Cheap 100Mb switch helps.

Pilot6 wrote:

There is nothig sweet in many ports. Cheap 100Mb switch helps.

IF u need 8ports, you need 8 ports...

Hi

Tell me how to connect the JTAG and UART?

Pilot6 wrote:

There is nothig sweet in many ports. Cheap 100Mb switch helps.

It might be good for OpenFlow

woow nice!!....Thank you for sharing.
guild wars 2 gold

(Last edited by jash08 on 15 Aug 2012, 05:17)

Is this supported by Openwrt yet? Just got one really cheap.

Thanks.

TorontoFish wrote:

Is this supported by Openwrt yet? Just got one really cheap.

I'm here for the same question.  I was prompted by tigerdirect.ca selling them cheap today (C$40).

It seems clear that it isn't yet supported.  A cursory look suggests that it could be easily supported: Atheros chips are generally good for OpenWRT and there is enough RAM and flash.  But there could be roadblocks.

Perhaps you would like to undertake an adventure?  Not me: not enough time.

Good luck!

Hugh wrote:
TorontoFish wrote:

Is this supported by Openwrt yet? Just got one really cheap.

I'm here for the same question.  I was prompted by tigerdirect.ca selling them cheap today (C$40).

It seems clear that it isn't yet supported.  A cursory look suggests that it could be easily supported: Atheros chips are generally good for OpenWRT and there is enough RAM and flash.  But there could be roadblocks.

Perhaps you would like to undertake an adventure?  Not me: not enough time.

Good luck!

Hi Hugh,

Perhaps, I got it cheap anyway ($4.97 plus tax at a local Staples clearance bin). I am a little busy with WifiRadio project now, but I am planning to work on Dir-632 once I am freed from that.

Where do you suggest I start with Dir-632?

Hi all

I have just purchased some of these, and am trying to make it work.

I so far created a profile for it and succesfully adjusted the firmware settings so that the factory web interface would let me install openwrt firmware.  This bricked it of course :-) 
So my next step is to get out the soldering iron and attach a serial port to see what went wrong.

The factory firmware loaded needs the image to be 7488kb + 24 bytes long - 7667736 bytes.  The 24 bytes at the end needs to be the string "A101-AR7242-RT-100324-02"  If this criteria isnt met it wont flash the image.
The kernel image is 2031616 bytes and the filesystems 5636096.  This seems a bit odd, as the mtdparts I have seen reported elsewhere has 1984k + 5568k, like there is a spare 64k at the end of the filesystem area.

There appear to be two TRAC issues covering this device, but I cant work out how to apply for an account.
https://dev.openwrt.org/ticket/13069
There are two other threads so I will post to point them to here seeing as there are some good photos here.

Possibly my brick is the same problem as 13069, but I didnt flash a generic image but a DIR632 profile I made.
My profile adjusted the kernel and filesystem sizes to match the default mtdparts:

mtdparts=spi0.0:256k(u-boot)ro,64k(nvram),1984k(linux),5568k(rootfs),64k(MAC),192k(LP),64k(ART)ro,7488k@0x50000(firmware)

I suspect with 13069 the problem may be that mtd3 is starting at a different location in flash.
In my case I think there must be some more I/O setup to deal with, or I just got something wrong.

With luck it wont be too much effort, DDWRT seems to have it working and also the entire source code was at the DLINK website.


By way of introduction:  I have been running OpenWRT for years on various devices, the DIR-632 is the first I have that didn't work out of the box when I got to it, so time fo a challenge :-)  My website is http://blog.oldcomputerjunk.net

The flash is interesting, the board has a 16-pin layout with an 8-pin SPI flash used instead.

25L6445 M2I-10G 3H417200

apparently 8MB serial flash device
256B page 4kb sector 32/64k block NOR flash with 4k OTP bits and BP0-BP3 write protect

There is also what I hope is JTAG next to the serial port, and two unused LED pinouts, and unused pins for a power switch so if lucky plenty of spare GPIO.  This actually is shaping up to be a potentially very hackable board, I wonder why it wasn't ported before - maybe no-one every buys 8-port switch routers, maybe thats why they were so cheap...

Unbricking Procedure for DIR632:

1. Connect to LAN1 and set your 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 yellow LED flashes
4. Browse to 192.168.0.1
5. Choose and Upload the firmware ****
6. If this actially works, you will get "Device is upgrading the firmware" through to 100%..

From Firefox on Linux, this hung at 'Upload'; Chrome uploaded (verified by wireshark) then hung
I had to dig out a Windows computer (XP with IE8) to get this procedure to work.
So I was able to revert my failed openwrt flash back to the stock firmware.

This is very odd, the DD-WRT instructions only succeed apparently for Firefox! (see link below)

Stock firmware downloaded from:
ftp://files.dlink.com.au/products/dir-6 … /Firmware/

The GPL sources are available at:
ftp://gpl.dlink.com/DIR-632/

(Information based on that found at http://www.dd-wrt.com/wiki/index.php/D- … re_upgrade )

Hello oldcomputerjunk;

I also have one of these units.

I can flash it with Windows XP X32 bit using your procedure.
It will not work on Widows 7 X64 bit with IE10.

I tried several custom builds but could not get them to take.

I reverted to the dd-wrt image.

Keep up the exploring.
Let me know if I can help.

~john

Factory Boot Log:

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 <sfrost@snowman.net>.  [url]http://snowman.net/projects/ipt_recent/[/url]

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

edit - wrong log (doh)

(Last edited by oldcomputerjunk on 10 Apr 2013, 14:40)

Thanks John

When I get a firmware that flashes without bricking I'll post it somewhere for you to play with. No warranty though :-)

Bit of an update, after a lot of false starts (including u-boot TFTP which just doesnt seem to want to work) I have managed to get a initrd image (RAM only) booting with eth0 detected (not eth1) and I can now see the MTD, so not far off a basic flash image, although only one ethernet port, no wireless.  I also have USB, WPS, and (green) WAN LED and (orange) power LEDs working.
To get the image to boot I had to use kermit over the serial console (!), first time I have used kermit since BBSing with my Commodore 64 about 20 years ago...

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
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:  0 
ar7240> loadb
## Ready for binary (kermit) download to 0x81000000 at 115200 bps...

----------------------------------------------------
C-Kermit 8.0.211, 10 Apr 2004, for Linux
 Copyright (C) 1985, 2004,
  Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/develop/openwrt/repos/openwrt/bin/ar71xx/) C-Kermit>send openwrt-ar71xx-generic-dir-632-a1-initramfs-uImage.bin
(/develop/openwrt/repos/openwrt/bin/ar71xx/) C-Kermit>c
Connecting to /dev/ttyUSB0, speed 115200
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
## Total Size      = 0x002a0d4c = 2755916 Bytes
## Start Addr      = 0x81000000
ar7240> bootm 81000000
## Booting image at 81000000 ...
   Image Name:   MIPS OpenWrt Linux-3.8.6
   Created:      2013-04-14  13:38:12 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    2755852 Bytes =  2.6 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 33554432

Starting kernel ...

[    0.000000] Linux version 3.8.6 (andrew@atlantis3) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r36329) ) #3 Sun Apr 14 23:07:35 CST 2013
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7242 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:5.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=DIR-632-A1 console=ttyS0,115200 root=/dev/mtd3 mtdparts=ar7240-nor0:256k(u-boot)ro,64k(nvram),1984k(linux),5568k(rootfs),64k(MAC),192k(LP),64k(ART)ro,7488k@0x50000(firmware) rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 27128k/32768k available (2192k kernel code, 5640k reserved, 587k data, 1952k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.100000] MIPS: machine is D-Link DIR-632 rev. A1
[    0.100000] dir_632_a1_setup()
[    0.130000] dir_632_a1_setup() register_mdio:
[    0.140000] dir_632_a1_setup() register_eth:
[    0.340000] ar71xx: invalid PHY interface mode for GE1
[    0.340000] dir_632_a1_setup() register_m25p80:
[    0.350000] dir_632_a1_setup() register_leds:
[    0.350000] dir_632_a1_setup() pci_init:
[    0.360000] registering PCI controller with io_map_base unset
[    0.370000] bio: create slab <bio-0> at 0
[    0.380000] PCI host bridge to bus 0000:00
[    0.380000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    0.390000] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.390000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.400000] pci 0000:00:00.0: fixup device configuration
[    0.400000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1000ffff 64bit]
[    0.410000] pci 0000:00:00.0: using irq 40 for pin 1
[    0.410000] Switching to clocksource MIPS
[    0.420000] NET: Registered protocol family 2
[    0.420000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.430000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.440000] TCP: Hash tables configured (established 512 bind 512)
[    0.440000] TCP: reno registered
[    0.450000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.450000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.460000] NET: Registered protocol family 1
[    3.750000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.750000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    3.770000] msgmni has been set to 52
[    3.770000] io scheduler noop registered
[    3.770000] io scheduler deadline registered (default)
[    3.780000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    3.810000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    3.810000] console [ttyS0] enabled, bootconsole disabled
[    3.810000] console [ttyS0] enabled, bootconsole disabled
[    3.830000] ath79-spi ath79-spi: master is unqueued, this is deprecated
[    3.830000] m25p80 spi0.0: found mx25l6405d, expected m25p80
[    3.840000] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    3.860000] libphy: ag71xx_mdio: probed
[    3.870000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RMII
[    4.420000] ag71xx ag71xx.0 eth0: connected to PHY at ag71xx-mdio.0:00 [uid=00000000, driver=Generic PHY]
[    4.430000] TCP: cubic registered
[    4.440000] NET: Registered protocol family 17
[    4.440000] 8021q: 802.1Q VLAN Support v1.8
[    4.460000] Freeing unused kernel memory: 1952k freed
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
- init -
init started: BusyBox v1.19.4 (2013-04-13 16:51:22 CST)
[   10.670000] Compat-drivers backport release: compat-drivers-2013-01-21-1
[   10.680000] Backport based on wireless-testing.git master-2013-02-22
[   10.690000] compat.git: wireless-testing.git
[   10.720000] cfg80211: Calling CRDA to update world regulatory domain
[   10.720000] cfg80211: World regulatory domain updated:
[   10.730000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   10.740000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.740000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.750000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   10.760000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.770000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   10.880000] usbcore: registered new interface driver usbfs
[   10.880000] usbcore: registered new interface driver hub
[   10.890000] usbcore: registered new device driver usb
[   11.010000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[   11.040000] ieee80211 phy0: Atheros AR9287 Rev:2 mem=0xb0000000, irq=40
[   11.050000] cfg80211: Calling CRDA for country: US
[   11.050000] cfg80211: Regulatory domain changed to country: US
[   11.060000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   11.070000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   11.070000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   11.080000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.090000] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.100000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   11.110000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[   11.160000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   11.300000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   11.320000] ehci-platform: EHCI generic platform driver
[   11.340000] nf_conntrack version 0.5.0 (454 buckets, 1816 max)
[   11.570000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

Please press Enter to activate this console. sysinit: 1+0 records in

sysinit: 1+0 records out

sysinit: 1+0 records in

sysinit: 1+0 records out

sysinit: 1+0 records in

sysinit: 1+0 records out

[   14.080000] device eth0 entered promiscuous mode
sysinit: 'radio0' is disabled

sysinit: 'radio0' is disabled

sysinit: 'radio0' is disabled




BusyBox v1.19.4 (2013-04-13 16:51:22 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (Bleeding Edge, r36329)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:/# lspci
00:00.0 Network controller: Atheros Communications Inc. AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
root@OpenWrt:/# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00800000 00010000 "spi0.0"
root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 1A:64:1B:01:E5:A3  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 1A:64:1B:01:E5:A3  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4 

Except, eth0 doesnt seem to send any data :-[

(Last edited by oldcomputerjunk on 14 Apr 2013, 15:33)

Well I got wifi and USB working...
but not ethernet still! this is driving me nuts I have spent hours trying to find the right combination to get the packets flowing.  It turns out that the driver in DD-WRT is architected quite differently, so I am at the point of completely copying in the DDWRT AG7240 driver and totally replacing the existing ar71xx_ag7240 driver for this board

I will try and submit a set of patches in the next couple of days. 

Basically my process now is:
- patch kernel
- rebuild minimal image with initrd enabled
- load into ram using kermit and run using uboot

the ethernet I can at least build as a module which I can then transfer over the wifi which is faster than kermit-sending the entire image, provided it doesnt crash when you load/unload

BusyBox v1.19.4 (2013-04-13 16:51:22 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (Bleeding Edge, r36332)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:/# ifconfig br-lan down ; uci set wireless.radio0.disabled=0 ; wifi
 up ; ifconfig wlan0 192.168.1.1 ; iwconfig wlan0 essid andrew3; 
ifconfig: SIOCGIFFLAGS: No such device
/sbin/wifi: eval: line 1: hostapd_set_log_options: not found
/sbin/wifi: eval: line 1: hostapd_set_bss_options: not found
/sbin/wifi: eval: line 1: hostapd: not found
Failed to start hostapd for phy0
root@OpenWrt:/# [   52.820000] wlan0: authenticate with 54:e6:fc:b7:60:6c
[   52.850000] wlan0: direct probe to 54:e6:fc:b7:60:6c (try 1/3)
[   53.080000] wlan0: send auth to 54:e6:fc:b7:60:6c (try 2/3)
[   53.080000] wlan0: authenticated
[   53.100000] wlan0: associate with 54:e6:fc:b7:60:6c (try 1/3)
[   53.100000] wlan0: RX AssocResp from 54:e6:fc:b7:60:6c (capab=0x401 status=0 aid=1)
[   53.110000] wlan0: associated

root@OpenWrt:/# ping 192.168..111
ping: bad address '192.168..111'
root@OpenWrt:/# ping 192.168.1.8
PING 192.168.1.8 (192.168.1.8): 56 data bytes
^C
--- 192.168.1.8 ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
root@OpenWrt:/# ifconfig br-lan down ; uci set wireless.radio0.disabled=0 ; wifi
 up ; ifconfig wlan0 192.168.1.1 ; iwconfig wlan0 essid andrew3; 
[   63.310000] wlan0: deauthenticating from 54:e6:fc:b7:60:6c by local choice (reason=3)
/sbin/wifi: eval: line 1: hostapd_set_log_options: not found
/sbin/wifi: eval: line 1: hostapd_set_bss_options: not found
/sbin/wifi: eval: line 1: hostapd: not found
Failed to start hostapd for phy0
[   64.470000] wlan0: authenticate with 54:e6:fc:b7:60:6c
[   64.490000] wlan0: send auth to 54:e6:fc:b7:60:6c (try 1/3)
root@OpenWrt:/# [   64.500000] wlan0: authenticated
[   64.520000] wlan0: associate with 54:e6:fc:b7:60:6c (try 1/3)
[   64.530000] wlan0: RX AssocResp from 54:e6:fc:b7:60:6c (capab=0x401 status=0 aid=1)
[   64.540000] wlan0: associated

root@OpenWrt:/# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:432 errors:0 dropped:0 overruns:0 frame:0
          TX packets:432 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:35424 (34.5 KiB)  TX bytes:35424 (34.5 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:00:22:22:22:22  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:180 (180.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/# ping 192.168.1.8
PING 192.168.1.8 (192.168.1.8): 56 data bytes
64 bytes from 192.168.1.8: seq=1 ttl=64 time=4.861 ms
64 bytes from 192.168.1.8: seq=2 ttl=64 time=4.738 ms
64 bytes from 192.168.1.8: seq=3 ttl=64 time=5.946 ms

Not been around here long but I find this thread highly educational.

I'm sure others have provided a running commentary on their efforts to port OpenWRT to router 'X' in the past but this is the first one that I've seen from the start. The number of posts is also quite low which, for me, encourages me to read.

If you get this working I'd like to make it a case study on a Wiki page that I created. The page is targetted at noobs like myself.

I'm sure there are other suitable case studies within the forum which I will find, over time.

Cheers

jeq
P.S. Did this DIR-632 cost $45 ? Just curious.

This is my first porting attempt for OpenWRT, hence the apparent over-verbosity :-)

I picked up two DIR-632 from msy.com.au for $11 (!) on special the other week...

BTW I have Ethernet working now but it is a big ugly hack, so trying to untangle everything and make something likely to be accepted according to the patch submission guide is taking me some time...

I am planning on putting something on the wiki when I get this finished. I think it has taken me over 30 hours so far, but if I had to do it again I think it would only take me about 5-10 having learned all the tricks

What did you hack in order to get it working?

Also did you try to get tfpboot command to work?
This would so much easier than kermit... and faster smile

(Last edited by jaceq on 19 Apr 2013, 14:56)

heh... had a world of pain with TFTP...

First the router was ignoring ARP packets and I had to make it send TFTP on 255.255.255.255. Prior to this, it would send out ARP, and I could see my PC respond with ARP return packets, but nothing would happen.

Setting the server to 255.255.255.255 in uboot I could finally see TFTP requests at my PC, but uboot was then not responding.  So after looking through the D-link source code, it turns out for some inane reason U-boot ignores return TFTP packets that dont have port 69 as the source from the server!  tftpd and tftpd-hpa both make a new UDP session with a random assigned port as the source and these get silently ignored by the router, if you beliebe the source code.  In the end I discovered that dnsmasq has a tftp server which responds on the same session, i.e. the TFTP packets sent from the server have the correct destination port (as opened by the router) and a source port of 69 as well...

Except, still no response on the router.  At this point I gave up and started using kermit, my main goal here was to get WRT working not debug the factory uboot!

I am starting to wonder if this device has a dodgy switch, that might explain a lot of my other troubles...



Currently, eth0 works, eth1 works and wlan0 work. 

But if you enable the bridge br-lan as soon as you try and even pin the kernel panics. 

So I will shortly (with luck, by the end of the weekend) be submitting my patches, and updating the wiki with 'partly supported - work in progress'! because at least at that stage anyone game enough can build and flash and have a go at sorting out the switch which I think is the problem with my bridge.  And I will unpack my other DIR632 and see if the problem repeats there...

So it is now working, but the switch is not.
The kernel panic now appears to be just a warning in dmesg.

I can setup eth0, eth1 and wlan and they seem to work with static IPs.
But  two computers on the switch cant see each other.  They can both ping the router.

I am going to package this up and submit tomorrow, so that anyone feeling adventurous can build from the trunk and try this out.
I have started updating the wiki page now.

Sleep beckons...

I'm really excited that you're porting OpenWRT to the DIR-632.

I also bought a couple from MSY (at $11, I figure it was a great investment) and I put DD-WRT on them to stash away for family members as the need arises - but OpenWRT is much more interesting.

Good luck with your patches, and I look forward to giving this a test soon.