Przygotowanie i instalacja OpenWrt na routerze Compex WPE53G
Ostatnia zmiana: 2013-11-26 18:43

Compex WPE53G jest platformą opartą o znany SoC Atheros
- procesor Atheros AR2317 180MHz
- sflash 4MB
- ram 16MB
- 1x RS232C TTL
- 1x jtag
- WiFi 802.11b/g (Atheros 2317)
- 1x port Ethernet 10/100

Obsługiwany jest przez wersję stabilną Backfire oraz trunk.

Kompilacja

Należy użyć obrazu dostępnego standardowo w OpenWrt (http://downloads.openwrt.org/backfire/10.03.1-rc4/atheros/openwrt-atheros-wpe53g-squashfs.bin) lub skompilować samodzielnie: jako platformę należy wybrać Atheros AR231x/AR5312, target profile - (default), target image - squashfs. W Kernel modules -> Wireless drivers należy zaznaczyć kmod-madwifi. Inne pakiety można zaznaczyć wg potrzeb.
Firmware należy skompilować w standardowy sposób (make). Plik wynikowy dla WPE53G to .

Port szeregowy

Dostępny jest na płytce - złącze JP1. Przypisanie pinów jest następujące:


pin sygnał

1 VCC
2 RX
3 TX
4 GND

Ustawienia dla bootloadera są standardowe (115200 8n1). UWAGA: standardowo OpenWrt jest kompilowane z tym przypadku na 9600, więc po załadowaniu bootloadera i kernela należy zmienić prędkość interfejsu żeby można było zobaczyć dalsze komunikaty startowe!

Instalacja przez tftp.

Należy nacisnąć i przytrzymać przez ok 10s przycisk reset. Urządzenie wejdzie w tryb diagnostyczny (pulsuje dioda diagnostic).
Należy teraz ustawić adres IP karty sieciowej w komputerze na 192.168.168.2, a następnie przez tftp przesłać obraz:


    $ atftp -p -l openwrt-atheros-wpe53g-squashfs.bin 192.168.168.1

Instalacja przez bootloader

Standardowy bootloader w Compexie to MyLoader. Aby uruchomić go w trybie ładowania obrazu należy
- odłączyć zasilanie rutera
- podłączyć kabel sieciowy ethernet do komputera i rutera
- ustawić adres karty sieciowej na komputerze na stałe na 192.168.168.2
- nacisnąć i przytrzymać przycisk reset
- włączyć zasilanie.
Powinien zgłosić się MyLoader w trybie ładowania oprogramowania:


MyLoader version 2.43.0706
System memory: 16MB

Probing for Serial flash ...
Found SPI serial flash
Flash memory: 4MB


Update Firmware (Image Mode)

Mini TFTP Server 1.0 (IP : 192.168.168.1)
Usage (Windows 2000/XP) :
    tftp -i 192.168.168.1 put <filename>

Należy teraz przez pomocy klienta tftp przesłać oprogramowanie do routera. W przypadku linuksa i atftp wygląda to następująco:


    $ atftp -p -l openwrt-atheros-wpe53g-squashfs.bin 192.168.168.1

Bootloader powinien odpowiedzieć ładowaniem pliku


Starting the TFTP download from IP (192.168.168.2)...
..............................................................................................
TFTP download completed...

Updating firmware, please wait ......

Po kilkunastu sekundach oprogramowanie powinno się wgrać, a bootloader znów powinien to potwierdzić komunikatem


Update firmware successfully! Please reboot.

Co też czynimy. Po chwili powinien być dostępny system.

Bootlog



Linux version 2.6.30.10 (cezary@eko.one.pl) (gcc version 4.3.3 (GCC) ) #1 Sun Jun 6 07:58:37 CEST 2010
console [early0] enabled
CPU revision is: 00019064 (MIPS 4KEc)
Determined physical RAM map:
    memory: 01000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
    Normal 0x00000000 -> 0x00001000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00001000
On node 0 totalpages: 4096
free_area_init_node: node 0, pgdat 802aee70, node_mem_map 802e7000
    Normal zone: 32 pages used for memmap
    Normal zone: 0 pages reserved
    Normal zone: 4064 pages, LIFO batch:0
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064
Kernel command line: console=ttyS0,9600 rootfstype=squashfs,jffs2
Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes
NR_IRQS:128
PID hash table entries: 64 (order: 6, 256 bytes)
console handover: boot [early0] -> real [ttyS0]
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 13268k/16384k available (2093k kernel code, 3116k reserved, 400k data, 128k init, 0k highmem)
Calibrating delay loop... 183.50 BogoMIPS (lpj=917504)
Mount-cache hash table entries: 512
net_namespace: 1008 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switched to high resolution mode on CPU 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
Radio config found at offset 0xf8(0x1f8)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 25
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
gpiodev: gpio device registered with major 254
gpiodev: gpio platform device registered with access mask FFFFFFFF
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0xb1100003 (irq = 37) is a 16550A
eth0: Atheros AR231x: 00:80:48:65:47:08, irq 4
ar231x_eth_mii: probed
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01)
cmdlinepart partition parsing not available
Searching for RedBoot partition table in spiflash at offset 0x3d0000
Searching for RedBoot partition table in spiflash at offset 0x3e0000
Searching for RedBoot partition table in spiflash at offset 0x3f0000
No RedBoot partition table detected in spiflash
spiflash: searching for MyLoader partition table at offset 0x10000
4 MyLoader partitions found on MTD device spiflash
Creating 4 MTD partitions on "spiflash":
0x000000000000-0x000000010000 : "myloader"
0x000000010000-0x000000020000 : "partition_table"
0x000000020000-0x000000150000 : "linux"
0x000000150000-0x0000003f0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=310000, len=E0000
0x000000310000-0x0000003f0000 : "rootfs_data"
TCP westwood registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
Freeing unused kernel memory: 128k freed
Please be patient, while OpenWrt loads ...
eth0: Configuring MAC for full duplex
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
device eth0 entered promiscuous mode
br-lan: port 1(eth0) entering forwarding state
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
nf_conntrack version 0.5.0 (256 buckets, 1024 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ath_hal: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
ath_hal: 2009-05-08 (AR5212, AR5312, RF5111, RF5112, RF2316, RF2317, REGOPS_FUNC, TX_DESC_SWAP, XR)
ath_ahb: trunk
wlan: trunk
wlan: mac acl policy registered
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_ahb: wifi0: Atheros 2317 WiSoC REV1: mem=0xb0000000, irq=3
IRQ 3/wifi0: IRQF_DISABLED is not guaranteed on shared IRQs