-
Notifications
You must be signed in to change notification settings - Fork 60
TpLink TL WR1043nd v2
This is just a quick braindump; it'll get tidied up soon.
- Figure out a decent fix for setting a default ath0 MAC address - the EEPROM has it as 00:02:03:04:05:06. Sigh.
- Yes, this means that at least for now, a static mac address will need to be set via 'netif_parent_cfg' (eg netif_wlan0_parent_cfg="ether xx:xx:xx:xx:xx:xx")
- Add support to arswitch to read 'hints' for a default per-port vlan configuration so LAN/WAN segmentation works.
http://wiki.openwrt.org/toh/tp-link/tl-wr1043nd
Look at the v2 bits, not the v1 bits.
- QCA9558 SoC, 720MHz
- 64 MiB RAM
- 8 MiB NOR flash
- 3x3 2GHz 802.11n
- AR8327N switch
- 2 USB 2.0 ethernet ports
The AR8327 has two CPU ports and 5 external ports. Here's how they're hooked up:
- port0 (internal) - SoC arge1
- port1 - LAN1
- port2 - LAN2
- port3 - LAN3
- port4 - LAN4
- port5 - WAN
- port6 (internal) - SoC arge0
It's arranged this way because the arge0 port in the QCA955x SoC has extra features (which FreeBSD/Linux currently doesn't use) - hardware NAT and routing support, for example.
The switch defaults to booting as all ports connected to all other ports. So there's no LAN/WAN distinction. You can use the etherswitchcfg tool to create either dot1q VLANs or per-port VLANs to segment traffic between LAN and WAN.
(TODO: add an example here for per-port VLANs.)
- Checkout FreeBSD-HEAD
- /path/to/scripts/build tl-wr1043ndv2
It'll spit out an image in /tftpboot/TL-WR1043NDv2.factory.bin
Then, via serial console (which you have to add pins for, and get a 3.3v USB RS232 thing):
- power on
- type 'tpl' over and over until it drops you into the uboot prompt
setenv ipaddr (local IP)
setenv serverip (TFTP server IP)
tftp 0x80060000 tl-wr1043ndv2.factory.bin
erase 0x9f020000 +0x7b0000
cp.b 0x80060000 0x9f020000 0x7b0000
reset
It should then boot FreeBSD.
ap135> reset
U-Boot 1.1.4 (Jun 13 2014 - 15:14:01)
ap135 - Scorpion 1.0DRAM:
sri
Scorpion 1.0
ath_ddr_initial_config(178): (16bit) ddr2 init
tap = 0x00000003
Tap (low, high) = (0x0, 0x1c)
Tap values = (0xe, 0xe, 0xe, 0xe)
64 MB
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x17
flash size 8MB, sector count = 128
Flash: 8 MB
Using default environment
*** Warning *** : PCIe WLAN Module not found !!!
*** Warning *** : PCIe WLAN Module not found !!!
In: serial
Out: serial
Err: serial
Net: ath_gmac_enet_initialize...
athrs_sgmii_res_cal: cal value = 0xe
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
ath_gmac_enet_initialize: reset mask:c02200
Scorpion ----> S17 PHY *
athrs17_reg_init: complete
: cfg1 0x80000000 cfg2 0x7114
eth0: ba:be:fa:ce:08:41
eth0 up
athrs17_reg_init_wan done
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x800c0000 cfg2 0x7214
eth1: ba:be:fa:ce:08:41
eth1 up
eth0, eth1
Setting 0x18116290 to 0x60c1a14f
Autobooting in 1 seconds
## Booting image at 9f020000 ...
Uncompressing Kernel Image ... OK
Starting kernel ...
CPU platform: Atheros AR9558 rev 0
CPU Frequency=720 MHz
CPU DDR Frequency=600 MHz
CPU AHB Frequency=200 MHz
platform frequency: 720 MHz
CPU reference clock: 40 MHz
CPU MDIO clock: 40 MHz
arguments:
a0 = 00000007
a1 = a3f8bfb0
a2 = 04000000
a3 = 00000008
Cmd line:argv is invalid
Environment:
envp is invalid
Cache info:
picache_stride = 4096
picache_loopcount = 16
pdcache_stride = 4096
pdcache_loopcount = 8
cpu0: MIPS Technologies processor v80.151
MMU: Standard TLB, 32 entries
L1 i-cache: 4 ways of 512 sets, 32 bytes per line
L1 d-cache: 4 ways of 256 sets, 32 bytes per line
Config1=0xbee3519e<PerfCount,WatchRegs,MIPS16,EJTAG>
Config3=0x2e28
qca955x_chip_init_gmac: gmac_cfg=0x00000001
qca955x_configure_gmac: ETH_CFG=0x0003c001
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2015 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.0-CURRENT #3 r279943M: Sat Mar 14 00:45:55 PDT 2015
adrian@lucy-11i386:/usr/home/adrian/work/freebsd/head-embedded/obj/mips/mips.mips/usr/home/adrian/work/freebsd/head-embedded/src/sys/TL-WR1043NDv2 mips
gcc version 4.2.1 20070831 patched [FreeBSD]
real memory = 67108864 (65536K bytes)
avail memory = 59428864 (56MB)
random: entropy device infrastructure driver
random: selecting highest priority adaptor <Dummy>
random: SOFT: yarrow init()
random: selecting highest priority adaptor <Yarrow>
nexus0: <MIPS32 root nexus>
clock0: <Generic MIPS32 ticker> on nexus0
Timecounter "MIPS32" frequency 360000000 Hz quality 800
Event timer "MIPS32" frequency 360000000 Hz quality 800
argemdio0: <Atheros AR71xx built-in ethernet interface, MDIO controller> at mem 0x19000000-0x19000fff on nexus0
mdio0: <MDIO> on argemdio0
mdioproxy0: <MII/MDIO proxy, MDIO side> on mdio0
arswitch0: <Atheros AR8327 Ethernet Switch (ver 1 rev 4)> on mdio0
arswitch0: ar8327_fetch_pdata_port: port 0: speed=3, duplex=1, txpause=1, rxpause=1
arswitch0: ar8327_fetch_pdata_port: port 6: speed=3, duplex=1, txpause=1, rxpause=1
miibus0: <MII bus> on arswitch0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
miibus1: <MII bus> on arswitch0
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus1
ukphy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
miibus2: <MII bus> on arswitch0
ukphy2: <Generic IEEE 802.3u media interface> PHY 2 on miibus2
ukphy2: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
miibus3: <MII bus> on arswitch0
ukphy3: <Generic IEEE 802.3u media interface> PHY 3 on miibus3
ukphy3: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
miibus4: <MII bus> on arswitch0
ukphy4: <Generic IEEE 802.3u media interface> PHY 4 on miibus4
ukphy4: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
etherswitch0: <Switch controller> on arswitch0
mdio1: <MDIO> on arswitch0
mdioproxy1: <MII/MDIO proxy, MDIO side> on mdio1
argemdio1: <Atheros AR71xx built-in ethernet interface, MDIO controller> at mem 0x1a000000-0x1a000fff on nexus0
mdio2: <MDIO> on argemdio1
mdioproxy2: <MII/MDIO proxy, MDIO side> on mdio2
apb0 at irq 4 on nexus0
uart0: <16550 or compatible> at mem 0x18020003-0x1802001a irq 3 on apb0
uart0: console (115200,n,8,1)
gpio0: <Atheros AR71XX GPIO driver> at mem 0x18040000-0x18040fff irq 2 on apb0
gpio0: [GIANT-LOCKED]
gpio0: gpio pinmask=0x0
gpiobus0: <GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0
ehci0: <AR71XX Integrated USB 2.0 controller> at mem 0x1b000100-0x1b0010ff irq 1 on nexus0
usbus0: set host controller mode
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0 on ehci0
ehci1: <AR71XX Integrated USB 2.0 controller> at mem 0x1b400100-0x1b4010ff irq 1 on nexus0
usbus1: set host controller mode
usbus1: EHCI version 1.0
usbus1: set host controller mode
usbus1 on ehci1
arge0: <Atheros AR71xx built-in ethernet interface> at mem 0x19000000-0x19000fff irq 2 on nexus0
arge0: Overriding MAC from EEPROM
arge0: arge_fetch_pll_config: pll_1000 = 0x56000000
arge0: arge_attach: overriding MII mode to 'RGMII'
arge0: finishing attachment, phymask 0000, proxy null
arge0: Ethernet address: c4:6e:1f:56:41:70
arge1: <Atheros AR71xx built-in ethernet interface> at mem 0x1a000000-0x1a000fff irq 3 on nexus0
arge1: arge_fetch_pll_config: pll_1000 = 0x3000101
arge1: arge_attach: overriding MII mode to 'SGMII'
arge1: finishing attachment, phymask 0000, proxy null
arge1: Ethernet address: c4:6e:1f:56:41:71
ath0: Vendor=0x168c, Device=0x0039
ath0: Vendor=0x168c, Device=0x0039
ath0: <Qualcomm Atheros QCA955x> at mem 0x18100000-0x1811ffff irq 0 on nexus0
ath0: eeprom @ 0x1fff0000 (16384 bytes)
ath0: eeprom data @ 0xbfff0000
check DDR Activity - HIGH
ar9300_set_reset: Scorpion SoC RTC reset done.
Bootstrap clock 40MHz
Enterprise mode: 0x43fc0000
ar9300_attach: calling ar9300_hw_attach
ar9300_hw_attach: calling ar9300_eeprom_attach
ar9300_flash_map: unimplemented for now
Restoring Cal data from DRAM
ar9300_hw_attach: ar9300_eeprom_attach returned 0
ath0: [HT] enabling HT modes
ath0: [HT] enabling short-GI in 20MHz mode
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 stream STBC transmit enabled
ath0: [HT] 3 RX streams; 3 TX streams
ath0: AR9550 mac 1024.0 RF5110 phy 1.7
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000
spi0: <AR71XX SPI> at mem 0x1f000000-0x1f00000f on nexus0
spibus0: <spibus bus> on spi0
mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0
mx25l0: w25q64, sector 65536 bytes, 128 sectors
ar71xx_wdog0: <Atheros AR71XX watchdog timer> on nexus0
Timecounters tick every 1.000 msec
arswitch0port1: link state changed to DOWN
arswitch0port2: link state changed to DOWN
arswitch0port3: link state changed to DOWN
arswitch0port4: link state changed to DOWN
arswitch0port5: link state changed to DOWN
usbus0: 480Mbps High Speed USB v2.0
usbus1: 480Mbps High Speed USB v2.0
ugen0.1: <Atheros> at usbus0
uhub0: <Atheros EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ugen1.1: <Atheros> at usbus1
uhub1: <Atheros EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
map/rootfs.uncompress: GEOM_ULZMA image found
map/rootfs.uncompress: 289 x 65536 blocks
random: unblocking device.
Root mount waiting for: usbus1 usbus0
uhub1: 1 port with 1 removable, self powered
uhub0: 1 port with 1 removable, self powered
Trying to mount root from ufs:map/rootfs.uncompress []...
warning: no time-of-day clock registered, system time will not be set accurately
arswitch0: arswitch_miipollstat: port 3: port -> UP
arswitch0port4: link state changed to UP
Mar 14 07:00:47 init: login_getclass: unknown class 'daemon'
*** Populating /var ..
*** Loading configuration files ..
*** Restoring from /dev/map/cfg ..
gunzip: unknown compression format
1+0 records in
1+0 records out
65536 bytes transferred in 5.164686 secs (12689 bytes/sec)
0 blocks
*** Completed.
*** setting up hostname
*** Load kernel modules
kldload: can't load bridgestp: module already loaded or in kernel
module_register: module if_bridge already exists!
Module if_bridge failed to register: 17
kldload: can't load if_bridge: module already loaded or in kernel
kldload: can't load random: No such file or directory
*** bringing up loopback ..
*** Default password/login databases ..
*** Starting networking via /etc/rc.d/base/net
dev.ath.0.txq_mcastq_maxdepth: 512 -> 32
sysctl: unknown oid 'dev.ath.1.txq_mcastq_maxdepth': No such file or directory
dev.ath.0.hal.force_full_reset: 0 -> 1
sysctl: unknown oid 'dev.ath.1.hal.force_full_reset': No such file or directory
*** Interface: arge0: start
*** Interface: arge0: done
*** Interface: bridge0: start
bridge0: Ethernet address: 06:16:9a:5d:b4:bb
arge0: promiscuous mode enabled
bridge0: link state changed to UP
*** Interface: bridge0: done
*** inetd
*** Done!
FreeBSD/mips (freebsd-wifi-build) (ttyu0)
login: root
No home directory.
Logging in with home = "/".
uname # uname -a
FreeBSD freebsd-wifi-build 11.0-CURRENT FreeBSD 11.0-CURRENT #3 r279943M: Sat Mar 14 00:45:55 PDT 2015 adrian@lucy-11i386:/usr/home/adrian/work/freebsd/head-embedded/obj/mips/mips.mips/usr/home/adrian/work/freebsd/head-embedded/src/sys/TL-WR1043NDv2 mips
#