Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| toh:d-link:dir-300 [2018/04/08 18:59] – [Tags] danitool | toh:d-link:dir-300 [2019/11/23 05:46] – [Original Firmware flash layout] sefralgon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== D-Link DIR-300 Rev.A1 (Airlink AR335W/ | ====== D-Link DIR-300 Rev.A1 (Airlink AR335W/ | ||
| + | |||
| + | {{section> | ||
| + | |||
| |:!: Note: For D-Link DIR-300 Rev.B (other hardware (HW), please see **[[toh: | |:!: Note: For D-Link DIR-300 Rev.B (other hardware (HW), please see **[[toh: | ||
| - | ====== Supported Versions | + | ===== Supported Versions ===== |
| ^ Version/ | ^ Version/ | ||
| | A1 | - | Kamikaze 8.09 | - | | | A1 | - | Kamikaze 8.09 | - | | ||
| Line 23: | Line 26: | ||
| ===== First Time Installation... ===== | ===== First Time Installation... ===== | ||
| + | |||
| + | Before you install, you might need to back up the original firmware. It can be done in multiple ways, including but not limited to using UART and/or Telnet. The most important partition is Board/ | ||
| + | |||
| + | ==== Original Firmware flash layout ==== | ||
| + | < | ||
| + | # cat /proc/mtd | ||
| + | dev: size erasesize name | ||
| + | mtd0: 00400000 00010000 " | ||
| + | mtd1: 001ce000 00010000 " | ||
| + | mtd2: 003b0000 00010000 " | ||
| + | mtd3: 00010000 00010000 " | ||
| + | mtd4: 00020000 00010000 " | ||
| + | mtd5: 00010000 00010000 " | ||
| + | mtd6: 00010000 00010000 " | ||
| + | mtd7: 00400000 00010000 " | ||
| + | </ | ||
| + | |||
| + | Partition sizes correspond to DIR-300 v1.05_a319 firmware. While upgrade partition has multiple sections, only '' | ||
| + | |||
| + | ^ Layer0 | ||
| + | ^ Layer1 | ||
| + | ^ Layer2 | ||
| + | |||
| + | When original firmware is flashed onto the router, first 96B are stripped, since it's a header of some kind. The rest of it is written directly to '' | ||
| + | |||
| + | The data on the end of upgrade partition is likely remaining from past installation of some alt firmware and not used for anything. | ||
| + | |||
| ==== Flash Layout ==== | ==== Flash Layout ==== | ||
| First let's have a quick view at the [[docs: | First let's have a quick view at the [[docs: | ||
| Line 228: | Line 258: | ||
| Resetting the wireless router... done'' | Resetting the wireless router... done'' | ||
| ===== Reflash ===== | ===== Reflash ===== | ||
| + | ==== via Bootloader for Latest Openwrt (18.06.1)==== | ||
| + | For reflashing via the [[docs: | ||
| + | You have to compile by your own - Not enough memory to boot the openwrt. Example of configuration where device boot fine - No gui/www, no dhcp server, only ssh. | ||
| + | < | ||
| + | CONFIG_TARGET_ath25=y | ||
| + | CONFIG_TARGET_ath25_Default=y | ||
| + | CONFIG_TARGET_BOARD=" | ||
| + | # CONFIG_ATH_USER_REGD is not set | ||
| + | # CONFIG_IPV6 is not set | ||
| + | CONFIG_KERNEL_COREDUMP=y | ||
| + | CONFIG_KERNEL_DEBUG_INFO=y | ||
| + | CONFIG_KERNEL_DEBUG_KERNEL=y | ||
| + | CONFIG_KERNEL_ELF_CORE=y | ||
| + | # CONFIG_KERNEL_IPV6 is not set | ||
| + | CONFIG_KERNEL_SWAP=y | ||
| + | # CONFIG_PACKAGE_ATH_DFS is not set | ||
| + | # CONFIG_PACKAGE_MAC80211_MESH is not set | ||
| + | # CONFIG_PACKAGE_dnsmasq is not set | ||
| + | # CONFIG_PACKAGE_firewall is not set | ||
| + | # CONFIG_PACKAGE_iptables is not set | ||
| + | # CONFIG_PACKAGE_kmod-ipt-conntrack is not set | ||
| + | # CONFIG_PACKAGE_kmod-ipt-core is not set | ||
| + | # CONFIG_PACKAGE_kmod-ipt-nat is not set | ||
| + | # CONFIG_PACKAGE_kmod-ipt-offload is not set | ||
| + | # CONFIG_PACKAGE_kmod-nf-conntrack is not set | ||
| + | # CONFIG_PACKAGE_kmod-nf-flow is not set | ||
| + | # CONFIG_PACKAGE_kmod-nf-ipt is not set | ||
| + | # CONFIG_PACKAGE_kmod-nf-ipt6 is not set | ||
| + | # CONFIG_PACKAGE_kmod-nf-nat is not set | ||
| + | # CONFIG_PACKAGE_kmod-nf-reject is not set | ||
| + | # CONFIG_PACKAGE_kmod-ppp is not set | ||
| + | # CONFIG_PACKAGE_libip4tc is not set | ||
| + | # CONFIG_PACKAGE_libip6tc is not set | ||
| + | # CONFIG_PACKAGE_libpthread is not set | ||
| + | # CONFIG_PACKAGE_libxtables is not set | ||
| + | # CONFIG_PACKAGE_odhcpd-ipv6only is not set | ||
| + | # CONFIG_PACKAGE_opkg is not set | ||
| + | # CONFIG_PACKAGE_ppp is not set | ||
| + | CONFIG_PACKAGE_kmod-lib-crc-ccitt=y | ||
| + | </ | ||
| + | On tftp server, two files are needed: | ||
| + | < | ||
| + | openwrt-ath25-generic-kernel.lzma | ||
| + | openwrt-ath25-generic-squashfs-rootfs.bin | ||
| + | </ | ||
| + | Connect to telnet to 192.168.1.10 port 9000 | ||
| + | < | ||
| + | fis init | ||
| + | ip_address -h 192.168.1.2 | ||
| + | load -r -b %{FREEMEMLO} openwrt-ath25-generic-kernel.lzma | ||
| + | fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7 | ||
| + | load -r -b %{FREEMEMLO} openwrt-ath25-generic-squashfs-rootfs.bin | ||
| + | fis create rootfs | ||
| + | </ | ||
| ==== via Bootloader ==== | ==== via Bootloader ==== | ||
| For reflashing via the [[docs: | For reflashing via the [[docs: | ||
| Line 297: | Line 381: | ||
| ==== Info ==== | ==== Info ==== | ||
| + | ^ Architecture | ||
| + | ^ Vendor | ||
| + | ^ Bootloader | ||
| + | ^ System-On-Chip | ||
| + | ^ CPU Speed | 182 Mhz | | ||
| + | ^ Flash-Chip | ||
| + | ^ Flash size | 4 MiB | | ||
| + | ^ RAM 16 MiB | ||
| + | ^ Wireless | ||
| + | ^ Ethernet | ||
| + | ^ USB | No | | ||
| + | ^ Serial | ||
| + | ^ JTAG | [[# | ||
| - | | **Architecture: | + | ==== Serial ==== |
| - | | **Vendor:** Atheros | + | |
| - | | **Bootloader: | + | -> JP1 |
| - | | **System-On-Chip:** AR2317 (MIPS 4KEc V6.4) | | + | |
| - | | **CPU Speed:** 182 Mhz | | + | |
| - | | **Flash-Chip: | + | |
| - | | **Flash size:** 4 MiB | | + | |
| - | | **RAM:** 16 MiB | | + | |
| - | | **Wireless: | + | |
| - | | **Ethernet: | + | |
| - | | **USB:** No | | + | |
| - | | **Serial:** [[# | + | |
| - | | **JTAG:** [[# | + | |
| - | ==== Serial Port (JP1) ==== | ||
| '' | '' | ||
| Line 326: | Line 412: | ||
| If you just see non-printable characters in the console, you may want to change baudrate. In some case, where MicroRedboot is install, the speed is 115200. | If you just see non-printable characters in the console, you may want to change baudrate. In some case, where MicroRedboot is install, the speed is 115200. | ||
| - | ==== JTAG (J6) ==== | + | ==== JTAG ==== |
| + | |||
| + | -> J6 | ||
| The router follows the MIPS 2.6 EJTAG Specification and has the same PIN information. But on the board the PINS are laid out as | The router follows the MIPS 2.6 EJTAG Specification and has the same PIN information. But on the board the PINS are laid out as | ||
| Line 337: | Line 426: | ||
| The default network configuration is: | The default network configuration is: | ||
| - | ^ Interface Name ^ Description ^ Default configuration ^ | + | ^ Interface Name |
| - | | br-lan | LAN & WiFi | 192.168.1.1/ | + | | br-lan |
| - | | eth0.1 | LAN ports (1 to 4) | None | | + | | eth0.1 |
| - | | eth0.2 | WAN port | DHCP | | + | | eth0.2 |
| - | | ath0 | WiFi | Disabled | | + | | ath0 |
| ==== WiFi ==== | ==== WiFi ==== | ||
| Line 348: | Line 437: | ||
| ==== Switch Ports (for VLANs) ==== | ==== Switch Ports (for VLANs) ==== | ||
| Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit, 5 is the internal connection to the router itself. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on. | Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit, 5 is the internal connection to the router itself. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on. | ||
| - | ^ Port | Internet (WAN) | LAN 1 | LAN 2 | LAN 3 | LAN 4 | | + | |
| - | ^ Switch port | 4 | 3 | 2 | 1 | 0 | | + | ^ Port | Internet (WAN) |
| + | ^ Switch port | ||
| ==== Failsafe mode ==== | ==== Failsafe mode ==== | ||
| Line 367: | Line 457: | ||
| - | ====== Mods ====== | + | ===== Mods ===== |
| - | ===== CPU Overclock from 183 to 200 MHz ===== | + | ==== CPU Overclock from 183 to 200 MHz ==== |
| Assuming OpenWrt is already installed, log on the the device via SSH, then do: | Assuming OpenWrt is already installed, log on the the device via SSH, then do: | ||
| Line 394: | Line 484: | ||
| '' | '' | ||
| - | ===== SD-card slot mod ===== | + | ==== SD-card slot mod ==== |
| There is a working mod to add a SD-card slot to your DIR-300. Follow the instructions [[http:// | There is a working mod to add a SD-card slot to your DIR-300. Follow the instructions [[http:// | ||
| + | ==== OpenWrt bootlog ==== | ||
| + | <WRAP bootlog> | ||
| + | < | ||
| + | [ 0.000000] Linux version 4.14.67 (kofec@E5420Mint) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7981-a6e11ccb13)) #0 Wed Aug 29 19:00:58 2018 | ||
| + | [ 0.000000] bootconsole [early0] enabled | ||
| + | [ 0.000000] CPU0 revision is: 00019064 (MIPS 4KEc) | ||
| + | [ 0.000000] Determined physical RAM map: | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] Initrd not found or empty - disabling initrd | ||
| + | [ 0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes. | ||
| + | [ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes | ||
| + | [ 0.000000] Zone ranges: | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] Movable zone start for each node | ||
| + | [ 0.000000] Early memory node ranges | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000000ffffff] | ||
| + | [ 0.000000] On node 0 totalpages: 4096 | ||
| + | [ 0.000000] free_area_init_node: | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] | ||
| + | [ 0.000000] random: get_random_bytes called from 0x803a2724 with crng_init=0 | ||
| + | [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 | ||
| + | [ 0.000000] pcpu-alloc: [0] 0 | ||
| + | [ 0.000000] Built 1 zonelists, mobility grouping off. Total pages: 4064 | ||
| + | [ 0.000000] Kernel command line: console=ttyS0, | ||
| + | [ 0.000000] PID hash table entries: 64 (order: -4, 256 bytes) | ||
| + | [ 0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) | ||
| + | [ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) | ||
| + | [ 0.000000] Memory: 12076K/ | ||
| + | [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, | ||
| + | [ 0.000000] NR_IRQS: 128 | ||
| + | [ 0.000000] clocksource: | ||
| + | [ 0.000044] sched_clock: | ||
| + | [ 0.093925] Calibrating delay loop... 183.70 BogoMIPS (lpj=918528) | ||
| + | [ 0.247254] pid_max: default: 32768 minimum: 301 | ||
| + | [ 0.303331] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) | ||
| + | [ 0.381815] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) | ||
| + | [ 0.478520] clocksource: | ||
| + | [ 0.595452] futex hash table entries: 256 (order: -1, 3072 bytes) | ||
| + | [ 0.670236] NET: Registered protocol family 16 | ||
| + | [ 0.725362] Can't analyze schedule() prologue at 8031ebb8 | ||
| + | [ 0.874847] clocksource: | ||
| + | [ 0.941291] NET: Registered protocol family 2 | ||
| + | [ 0.996916] TCP established hash table entries: 1024 (order: 0, 4096 bytes) | ||
| + | [ 1.079706] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) | ||
| + | [ 1.155501] TCP: Hash tables configured (established 1024 bind 1024) | ||
| + | [ 1.232162] UDP hash table entries: 256 (order: 0, 4096 bytes) | ||
| + | [ 1.301397] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) | ||
| + | [ 1.377303] NET: Registered protocol family 1 | ||
| + | [ 1.429005] PCI: CLS 0 bytes, default 16 | ||
| + | [ 1.459740] Radio config found at offset 0xf8 (0x1f8) | ||
| + | [ 1.549079] Crashlog allocated RAM at address 0xf00000 | ||
| + | [ 1.630362] workingset: timestamp_bits=30 max_order=12 bucket_order=0 | ||
| + | [ 1.739465] squashfs: version 4.0 (2009/ | ||
| + | [ 1.808609] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. | ||
| + | [ 1.992085] io scheduler noop registered | ||
| + | [ 2.038321] io scheduler deadline registered (default) | ||
| + | [ 2.100486] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled | ||
| + | [ 2.196960] serial8250: ttyS0 at MMIO 0x11100000 (irq = 9, base_baud = 5750000) is a 16550A | ||
| + | [ 2.296346] console [ttyS0] enabled | ||
| + | [ 2.379633] bootconsole [early0] disabled | ||
| + | [ 2.480695] ar2315-spiflash ar2315-spiflash.0: | ||
| + | [ 2.575388] Searching for RedBoot partition table in spiflash at offset 0x3d0000 | ||
| + | [ 3.039138] Searching for RedBoot partition table in spiflash at offset 0x3e0000 | ||
| + | [ 3.502859] 6 RedBoot partitions found on MTD device spiflash | ||
| + | [ 3.572014] Creating 6 MTD partitions on " | ||
| + | [ 3.631853] 0x000000000000-0x000000030000 : " | ||
| + | [ 3.704474] 0x000000030000-0x000000160000 : " | ||
| + | [ 3.784163] 0x000000160000-0x0000003e0000 : " | ||
| + | [ 3.849281] mtd: device 2 (rootfs) set to be root filesystem | ||
| + | [ 3.917851] 1 squashfs-split partitions found on MTD device rootfs | ||
| + | [ 3.992372] 0x0000002d0000-0x0000003e0000 : " | ||
| + | [ 4.074338] 0x0000003e0000-0x0000003ef000 : "FIS directory" | ||
| + | [ 4.152968] 0x0000003ef000-0x0000003f0000 : " | ||
| + | [ 4.232712] 0x0000003f0000-0x000000400000 : " | ||
| + | [ 4.376558] eth0: Atheros AR231x: 00: | ||
| + | [ 4.519858] IP17xx: Found IP175C at 0:00 | ||
| + | [ 4.688305] libphy: ar231x_eth_mii: | ||
| + | [ 4.906966] eth0: attached PHY driver [IC+ IP17xx] (mii_bus: | ||
| + | [ 4.996733] NET: Registered protocol family 17 | ||
| + | [ 5.050827] 8021q: 802.1Q VLAN Support v1.8 | ||
| + | [ 5.158519] VFS: Mounted root (squashfs filesystem) readonly on device 31:2. | ||
| + | [ 5.245421] Freeing unused kernel memory: 184K | ||
| + | [ 5.298969] This architecture does not have kernel memory protection. | ||
| + | [ 5.694951] random: fast init done | ||
| + | [ 8.640944] init: Console is alive | ||
| + | [ 8.683616] init: - watchdog - | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ | ||
| + | [ 137.135206] random: crng init done | ||
| + | </ | ||
| + | </ | ||
| - | + | ===== Tags ===== | |
| - | ==== Tags ==== | + | [[meta: |
| {{tag> | {{tag> | ||