User Tools

Site Tools


toh:d-link:dsl-2640u

D-Link DSL-2640U(B)

On EU and USA market router branded as 2640B, on Russian market - as 2640U (HW rev B2). This model fully supported in OpenWrt 10.03 (except of ADSL, since Broadcom didnt released source code of their drivers). Notice however the instructions below do not apply to B3 (for details on the unsuccessfull attempts to bring openwrt to this device without opening it, see this thread).

Also, there are models D-Link DSL-2640U/BRU/C (on Broadcom 6338 CPU and Broadcom 4312 WLAN), and D-Link DSL-2640U/BRU/D (on Broadcom 6348 CPU and Broadcom 4318 WLAN). Both of them are not tested for OpenWrt support, though second one should work, probably, with minimal board definitions patching. Routers branded D-Link DSL-2640T and D-Link DSL-2640R have totally different hardware platform - first board built on on TI AR7VW, and second - on TrendChip TC3160 (ADSL2+) and Ralink RT2561 (WLAN).

Hardware

Info

Architecture: MIPS
Vendor: Broadcom
Bootloader: CFE
Board Id: D-4P-W
System-On-Chip: BCM6348SKFBG
CPU/Speed BMIPS3300 V0.7 / 256 MHz
Flash-Chip: Macronix MX29LV320CBTC-90G
Flash size: 4 MiB
RAM: ESMT M12L64164A-7T / 2x8 MiB / SDR-143
Wireless: Broadcom 4318 802.11b/g (onboard)
WLAN Front-End: Skyworks SKY65206-13
Ethernet: Broadcom BCM5325 w/ vlan support swconfig
Internet: ADSL2+
ASDL Line driver: BCM6301KSG
USB: No
Serial: Yes
JTAG: Yes

Hardware of D-Link DSL-2640U(B) identical to such products as ASUS AM604g (former AAM6020VI-B6), and Zhone 6218-I2-x0x (former Paradyne 6218-I2).

Board images

Serial port pinout

dsl2640uconsole.jpg

Console port uses 3.3 V signaling at speed 115200.

CFE startup output

CFE version 1.0.37-6.5.17 for BCM96348 (32bit,SP,BE)
Copyright (C) 2000-2005 Broadcom Corporation.

Boot Address 0xbfc00000

Initializing Arena.
Initializing Devices.
Parallel flash device: name MX29LV320AB, id 0x22a8, size 4096KB
Unknown PHY type
CPU type 0x29107: 256MHz, Bus: 128MHz, Ref: 32MHz
Total memory: 16777216 bytes (16MB)

Total memory used by CFE:  0x80401000 - 0x805257C0 (1198016)
Initialized Data:          0x8041CE20 - 0x8041EDF0 (8144)
BSS Area:                  0x8041EDF0 - 0x804237C0 (18896)
Local Heap:                0x804237C0 - 0x805237C0 (1048576)
Stack Area:                0x805237C0 - 0x805257C0 (8192)
Text (code) segment:       0x80401000 - 0x8041CE20 (114208)
Boot area (physical):      0x00526000 - 0x00566000
Relocation Factor:         I:00000000 - D:00000000

Board IP address                  : 192.168.1.1
Host IP address                   : 192.168.1.100
Gateway IP address                :
Run from flash/host (f/h)         : f
Default host run file name        : vmlinux
Default host flash file name      : bcm963xx_fs_kernel
Boot delay (0-9 seconds)          : 3
Board Id Name                     : D-4P-W
Psi size in KB                    : 24
Number of MAC Addresses (1-32)    : 24
Base MAC Address                  : 00:19:5b:c7:58:01
Ethernet PHY Type                 : External Switch Using Reverse MII
Memory size in MB                 : 16
CMT Thread Number                 : 0
Dying Gasp Enable (0:Disable 1:Enable)  : 1

JTAG connector

(8 pin connector marked as "J7") :

1 - TDO (Test Data Output) 3.306v
2 - SRST (System Reset) 3.306v
3 - TMS (Test Mode Select) 3.292v
4 - TDI (Test Data Input) 3.294v
5 - TCK (Test Clock) 2.795v
6 - TRST (Test Reset) 3.306v
7 - GND (Ground) 0v
8 - n/a

Simple schematics of JTAG connection

Many thanks for this info to http://pudeev.livejournal.com/

Broadcom tag

This device's CFE has tag 3.10, so it's currently not possible to flash openwrt via vendor's (unmodified) http, ftp, tftp services.

More http://wiki.openwrt.org/doc/techref/brcm63xx.imagetag

Installation

There are 2 methods to install OpenWrt on this hardware:

Using modified vendor's firmware

Don't try this unless you are sure OpenWrt firmware you are trying to flash will work just as planned.

  1. Get GPL source code from D-Link's ftp
  2. Modify userapps\opensource\ftpd\fwsyscall.c in the vendor's firmware as described in bugzilla.
  3. Compile and flash modified firmware.
  4. Login via telnet and use tftp to flash OpenWrt (you need to set up tftpd on your machine)

Flashing via Serial Cable

Set up tftpd on your machine, then access router's CFE, and run

cfe> flashimage ip_of_tftpd:openwrt-DSL2640B-squashfs-cfe.bin

Upgrading OpenWrt

Read about sysupgrade if you don't have a serial cable. I don't know whether it works.

Uninstalling OpenWrt

Hold reset button and power on the router. Power led should be red. Configure your host to have IP 192.168.1.100. Visit http://192.168.1.1 and follow the instructions. When you are going to flash D-Link's firmware, the CFE will be overwritten, so be careful.

Configuration

Switch Ports

Switch is detected by roboswitch kernel module as 2350 on eth1.

Switch Port Ethernet Connector
0 4
1 3
2 2
3 1
4
5 (CPU)

VLAN Handling

Here is an example that shows 2 VLANs configuration. WAN is assigned to ethernet connector #4. ADSL (eth0) is not used.

/etc/config/network:

config 'switch' 'eth1'
	option 'enable' '1'
	option 'enable_vlan' '1'
	option 'reset' '1'

config 'switch_vlan' 'vlan0'
	option 'vlan' '0'
	option 'device' 'eth1'
	option 'ports' '1 2 3 5*'

config 'switch_vlan' 'vlan1'
	option 'vlan' '1'
	option 'device' 'eth1'
	option 'ports' '0 5t'

config 'interface' 'loopback'
	option 'ifname' 'lo'
	option 'proto' 'static'
	option 'ipaddr' '127.0.0.1'
	option 'netmask' '255.0.0.0'

config 'interface' 'lan'
	option 'type' 'bridge'
	option 'ifname' 'eth1.0'
	option 'proto' 'static'
	option 'macaddr' 'xx:xx:xx:xx:xx:xx'
	option 'netmask' '255.255.255.0'
	option 'nat' '1'
	option 'mtu' '1500'
	option 'defaultroute' '0'
	option 'peerdns' '0'
	option 'ipaddr' '172.16.1.1'

config 'interface' 'wan'
	option 'ifname' 'eth1.1'
	option 'mtu' '1500'
	option 'proto' 'dhcp'

ADSL driver status

Take a look at the topic in the forum: BCM 63xx chips - ADSL State of art.

Somehow ADSL source code leaked to public. It is not free software, of course, so it's pretty much unusable.

Wi-Fi 802.11g Stability Problem

AP mode in BCM4318 is not officially supported. Due to a bug in b43 kernel module there may be packet loss and chip lockup at high transmission rates:

http://linuxwireless.org/en/users/Drivers/b43#Known_issues

https://forum.openwrt.org/viewtopic.php?id=24208

I don't experience this problem in 802.11b mode.

Also take a look at OpenFWWF project: http://www.ing.unibs.it/openfwwf/

Notes

The original GPL sourcecode v1.00 can be downloaded Here Here. It consist on a Linux 2.? kernel with binary Broadcom tools&drivers and sourcecode of the kernel and the rest of tools.

Tags

toh/d-link/dsl-2640u.txt · Last modified: 2013/05/15 15:42 (external edit)