Alfa_ Hornet_UB - freebsd/freebsd-wifi-build GitHub Wiki
The Alfa networks UB is a Qualcomm Atheros AR9331 design based on the AP121 reference design. It has a variety of different build options - the one documented here is the board with 64MB RAM and 16MB flash.
First, attach a serial cable to the 4 pin header. Use a 3.3v level cable (like the FTDI TTL-232R-3V3 cable). The pinout can be found here - http://wiki.openwrt.org/toh/alfa.network/hornet-ub .
Please note that the VDD line must not be connected! Only connect the Ground, TXD and RXD pins.
I've used a 5v switch mode supply. I think it needs a 12v switch mode supply. Make sure you double check with the manufacturer!
$ cd /path/to/head/checkout/src
$ /path/to/buildscripts/build alfa_hornet_ub
Connect the serial cable and an ethernet cable. Give your FreeBSD build machine an IP address (ethernet!) of 192.168.169.1/24 .
Then, apply power. It will start booting u-boot. Hit any key to break into the boot process.
Then, do the following to assign an IP address:
ar7240> setenv ipaddr 192.168.169.2
ar7240> setenv serverip 192.168.169.1
Then, erase the openwrt install that is on there:
ar7240> erase 0x9f050000 +0xd90000
Then, TFTP over the kernel and copy it into place:
ar7240> tftpboot 0x80050000 kernel.ALFA_HORNET_UB.lzma.uImage
ar7240> cp.b 0x80050000 0x9f050000 +$filesize
Then, TFTP over the rootfs and copy it into place:
ar7240> tftpboot 0x80050000 mfsroot-alfa_hornet_ub.img.ulzma
ar7240> cp.b 0x80050000 0x9f1e0000 +$filesize
Finally, reboot and voila!
- The default boot should place arge0 and arge1 in the bridge group. Here, only arge0 is placed into the bridge group. So if you connect to the second ethernet port, you won't be able to see the device with the default configuration.
- arge0 is connected to the WAN port, via a dedicated PHY. arge1 is connected to the on-chip switch.
- http://wiki.openwrt.org/toh/alfa.network/hornet-ub
- http://www.alfa.com.tw/products_show.php?pc=99&ps=50
- http://www.alfa.com.tw/products_show.php?pc=35&ps=97
This is an Alfa Hornet UB with 64MB RAM and 16MB flash.
U-Boot 1.1.4 (Jul 24 2013 - 15:16:09)
AP121 (ar9331) U-boot
DRAM: 64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 149k for U-Boot at: 83fd8000
Reserving 192k for malloc() at: 83fa8000
Reserving 44 Bytes for Board Info at: 83fa7fd4
Reserving 36 Bytes for Global Data at: 83fa7fb0
Reserving 128k for boot params() at: 83f87fb0
Stack Pointer at: 83f87f98
Now running in RAM - U-Boot at: 83fd8000
Flash Manuf Id 0xc2, DeviceId0 0x20, DeviceId1 0x18
flash size 16777216, sector count = 256
Flash: 16 MB
Using default environment
In: serial
Out: serial
Err: serial
Net: ag7240_enet_initialize...
Fetching MAC Address from 0x83ff0608
Fetching MAC Address from 0x83ff0608
: cfg1 0x5 cfg2 0x7114
eth0: 00:c0:ca:77:58:05
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:c0:ca:77:58:04
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
eth1 up
eth0, eth1
Hit any key to stop autoboot: 4 ... 3 ... 2 ... 1 ... 0
## Booting image at 9f050000 ...
Image Name: FreeBSD
Created: 2013-10-24 20:50:38 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1297435 Bytes = 1.2 MB
Load Address: 80050000
Entry Point: 80050100
Verifying Checksum at 0x9f050040 ...OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80050100) ...
## Giving linux memsize in bytes, 67108864
Starting kernel ...
CPU platform: Atheros AR9330 rev 1
CPU Frequency=400 MHz
CPU DDR Frequency=400 MHz
CPU AHB Frequency=200 MHz
platform frequency: 400 MHz
CPU reference clock: 25 MHz
CPU MDIO clock: 25 MHz
arguments:
a0 = 00000008
a1 = a3f87fb0
a2 = a3f88470
a3 = 00000010
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 v116.147
MMU: Standard TLB, 16 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=0x9ee3519e<PerfCount,WatchRegs,MIPS16,EJTAG>
Config3=0x20
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2013 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 #2 r256951M: Thu Oct 24 13:50:26 PDT 2013
adrian@lucy:/usr/home/adrian/work/freebsd/svn/head/obj/mipseb/mips.mips/usr/home/adrian/work/freebsd/svn/head/src/sys/ALFA_HORNET_UB mips
gcc version 4.2.1 20070831 patched [FreeBSD]
real memory = 67108864 (65536K bytes)
avail memory = 59830272 (57MB)
random device not loaded; using insecure entropy
random: <Software, Yarrow> initialized
nexus0: <MIPS32 root nexus>
clock0: <Generic MIPS32 ticker> on nexus0
Timecounter "MIPS32" frequency 200000000 Hz quality 800
Event timer "MIPS32" frequency 200000000 Hz quality 800
argemdio0: <Atheros AR71xx built-in ethernet interface, MDIO controller> at mem 0x1a000000-0x1a000fff on nexus0
mdio0: <MDIO> on argemdio0
mdioproxy0: <MII/MDIO proxy, MDIO side> on mdio0
arswitch0: <Atheros AR7240 Ethernet Switch> on mdio0
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
etherswitch0: <Switch controller> on arswitch0
mdio1: <MDIO> on arswitch0
mdioproxy1: <MII/MDIO proxy, MDIO side> on mdio1
apb0 at irq 4 on nexus0
uart0: <ar933x> on apb0
uart0: console (115200,n,8,1)
gpio0: <Atheros AR71XX GPIO driver> on apb0
gpio0: [GIANT-LOCKED]
gpio0: function_set: 0x0
gpio0: function_clear: 0x0
gpio0: gpio pinmask=0x0
gpioc0: <GPIO controller> on gpio0
gpiobus0: <GPIO bus> on gpio0
ehci0: <AR71XX Integrated USB 2.0 controller> at mem 0x1b000100-0x1bffffff irq 1 on nexus0
usbus0: set host controller mode
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0 on ehci0
arge0: <Atheros AR71xx built-in ethernet interface> at mem 0x19000000-0x19000fff irq 2 on nexus0
miiproxy0: <MII/MDIO proxy, MII side> on arge0
miiproxy0: attached to target mdio1
arge0: finishing attachment, phymask 0010, proxy set
miibus4: <MII bus> on miiproxy0
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
arge0: Ethernet address: 62:73:64:25:4e:ca
arge1: <Atheros AR71xx built-in ethernet interface> at mem 0x1a000000-0x1a000fff irq 3 on nexus0
arge1: finishing attachment, phymask 0000, proxy null
arge1: Ethernet address: 62:73:64:88:de:26
ath0: Vendor=0x168c, Device=0x0035
ath0: Vendor=0x168c, Device=0x0035
ath0: <Atheros AR933x> at mem 0x18100000-0x1811ffff irq 0 on nexus0
ath0: eeprom @ 0x1fff0000 (16384 bytes)
ath0: eeprom data @ 0xbfff0000
ar9300_set_stub_functions: setting stub functions
ar9300_set_stub_functions: setting stub functions
Bootstrap clock 25MHz
ar9300_attach: calling ar9300_hw_attach
ar9300_hw_attach: calling ar9300_eeprom_attach
ar9300_flash_map: unimplemented for now
Restoring Cal data from DRAM
Restoring Cal data from Flash
Restoring Cal data from Flash
Restoring Cal data from OTP
ar9300_hw_attach: ar9300_eeprom_attach returned 0
ath0: RX status length: 48
ath0: RX buffer size: 4096
ath0: TX descriptor length: 128
ath0: TX status length: 36
ath0: TX buffers per descriptor: 4
ar9300_freebsd_setup_x_tx_desc: called, 0x0/0, 0x0/0, 0x0/0
ath0: ath_edma_setup_rxfifo: type=0, FIFO depth = 16 entries
ath0: ath_edma_setup_rxfifo: type=1, FIFO depth = 128 entries
ath0: [HT] enabling HT modes
ath0: [HT] enabling short-GI in 20MHz mode
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: AR9330 mac 512.1 RF5110 phy 288.1
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: mx25ll128, sector 65536 bytes, 256 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
usbus0: 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
map/rootfs.uncompress: GEOM_ULZMA image found
map/rootfs.uncompress: 148 x 131072 blocks
random: unblocking device.
Root mount waiting for: usbus0
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
Oct 24 20:40:36 init: login_getclass: unknown class 'daemon'
arswitch0port1: link state changed to UP
*** Populating /var ..
*** Loading configuration files ..
*** Restoring from /dev/map/cfg ..
gunzip: unknown compression format
0 blocks
*** Completed.
*** setting up hostname
*** Load kernel modules
kldload: can't load bridgestp: File exists
kldload: can't load if_bridge: No such file or directory
kldload: can't load random: File exists
*** Unblocking /dev/random..
*** bringing up loopback ..
*** 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
*** Interface: arge0: start
arge0: link state changed to DOWN
*** Interface: arge0: done
*** Interface: bridge0: start
bridge0: Ethernet address: 16:8f:fe:64:b5:a0
arge0: promiscuous mode enabled
bridge0: link state changed to DOWN
*** Interface: bridge0: done
*** Default password/login databases ..
*** inetd
*** Done!
FreeBSD/mips (freebsd-wifi-build) (ttyu0)
login: arswitch0port1: link state changed to DOWN
arge0: link state changed to UP
bridge0: link state changed to UP
arge0: link state changed to DOWN
bridge0: link state changed to DOWN
arswitch0port1: link state changed to UP