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).
Read about sysupgrade if you don't have a serial cable. I don't know whether it works.
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.
Switch is detected by roboswitch kernel module as 2350 on eth1.
Here is an example that shows 2 VLANs configuration. WAN is assigned to ethernet connector #4. ADSL (eth0) is not used.
An EU version of the DSL-2640U(B) using the preparation firmware EU_DSL-2640B_EU_4.00_310022.wrt linked on https://dev.openwrt.org/ticket/5472, followed by an OpenWrt installation via tftp, means that debrick can be achieved as follows.
Press in the reset button at the back - keep pressed
Power recycle the unit
Release the reset button
You can now reload the D-Link firmware through a web browser via http://192.168.1.1/ regardless of what your previous IP was.