OpenWrt - jjPlus JA76PF0
Przygotowanie i instalacja OpenWrt na routerze jjPlus JA76PF0Ostatnia zmiana: 2012-10-18 22:36
1. Krótka specyfikacja
2. Stan projektu
3. Port szeregowy
4. Instalacja przez bootloader
5. Instalacja przez sysupgrade
6. Czujnik temperatury
7. bootlog
Strona producenta: http://www.jjplus.com/
Krótka specyfikacja
- architektura: Atheros ar71xx- bootloader: Redboot
- procesor Atheros AR7161 rev 2 680MHz
- Flash: 8 MiB
- RAM: 64MiB
- WLAN: brak (3 złącza miniPCI)
- chipset Ethernet: Atheros AR8316 10/100/1000 Mbps, 1xwan, 4xlan
- 2x USB 2.0
- 1x rs232c TTL
- przycisk reset oraz wps
- gpio, serial, dodatkowe wyjścia LCD, czujnik temperatury LM75, magistrala i2c
Zasilanie normalnie, 12V. Zużycie energii - bez kart WIFI i urządzeń USB - ok. 5,5W.
Stan projektu
Płytka obecnie jest obsługiwany przez OpenWrt Attitude Adjustment, trunk oraz Gargoyle (>1.5.6). StGargoyle PL dostępne jest dla JA76PF0 na tej stronie: http://ecco.selfip.net/gargoyle-pl/ar71xx/. Link do łatki ze wsparciem dla tej platformy: https://dev.openwrt.org/ticket/8385
Port szeregowy
Dostępny jest na płytce, port UART/CN3
4 RX
6 TX
8 GND
Instalacja przez bootloader
Po kolei należy:- wyłączyć zasilanie płytki
- podłączyć kabel ethernet do rutera (do portu wan) i komputera
- ustawić adres karty sieciowej w komputerze na stałe na 192.168.1.1
- w katalogu głównym serwera TFTPD umieścić pliki openwrt-ar71xx-ja76pf-kernel.bin oraz openwrt-ar71xx-ja76pf-rootfs-squashfs.bin
- uruchomić serwer tftpd
- podłączyć kabel szeregowy do płytki
- uruchomić terminal z parametrami 115200 8n1
- włączyć zasilanie
- przez Ctrl-C przerwać ładowanie bootloadera.
Następnie wystarczy wydać polecenia:
fis init
load -r -b 0x80060000 openwrt-ar71xx-ja76pf-kernel.bin
fis create linux
load -r -b %{FREEMEMLO} openwrt-ar71xx-ja76pf-rootfs-squashfs.bin
fis create rootfs
fis load -l linux
exec -c "board=JA76PF"
fis load -l linux
exec -c "board=JA76PF"
UWAGA: domyślny adres płytki w bootloaderze to 192.168.1.2. Po instalacji openwrt adres zostaje normalnie ustawiony na 192.168.1.1
Instalacja przez sysupgrade
Wystarczy jak w normalnym OpenWrt przesłać plik sysupgrade do routera i wydać polecenie sysupgrade -n nazwa_obrazu.Czujnik temperatury
Należy zainstalować pakiety i2c-tools, kmod-i2c-core wraz z zależnościami. Następnie odczytać temperaturę:
root@OpenWrt:/# i2cdetect -l
i2c-0 i2c i2c-gpio0 I2C adapter
root@OpenWrt:/# i2cdetect i2c-gpio0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@OpenWrt:/# i2cget i2c-gpio0 0x48 0xaa w
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x48, data address
0xaa, using read word data.
Continue? [Y/n]
0x0133
root@OpenWrt:/#
Można także zainstalować pakiet kmod-hwmon-lm75 i załadować moduł lm75 z parametrem force=0,0x48. Odczyt temperatury:
# echo lm75 0x48 > /sys/devices/platform/i2c-gpio.0/i2c-0/new_device
# cat /sys/devices/platform/i2c-gpio.0/i2c-0/0-0048/temp1_input
bootlog
Linux version 2.6.32.27 (cezary@eko.one.pl) (gcc version 4.3.3 (GCC) ) #2 Sat Mar 19 12:02:14 CET 2011
prom: fw_arg0=00000002, fw_arg1=80050020, fw_arg2=80050000, fw_arg3=00000008
MyLoader: sysp=00000000, boardp=3c05b800, parts=00000000
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2, CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
Determined physical RAM map:
memory: 04000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
On node 0 totalpages: 16384
free_area_init_node: node 0, pgdat 802e6d70, node_mem_map 81000000
Normal zone: 128 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 16256 pages, LIFO batch:3
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200 board=JA76PF ethaddr=00.15.61.90.1f.ea
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000002
Readback ErrCtl register=00000002
Memory: 61660k/65536k available (2167k kernel code, 3808k reserved, 423k data, 152k init, 0k highmem)
SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:56
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is jjPlus JA76PF
registering PCI controller with io_map_base unset
bio: create slab <bio-0> at 0
i2c-gpio i2c-gpio.0: using pins 1 (SDA) and 0 (SCL)
pci 0000:00:00.0: reg 10 32bit mmio pref: [0x000000-0xfffffff]
pci 0000:00:00.0: reg 14 io port: [0x00-0xff]
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
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.
yaffs Mar 19 2011 11:34:34 Installing.
msgmni has been set to 120
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console [ttyS0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: m25p64 (8192 Kbytes)
spi0.0: searching for MyLoader partition table at offset 0x10000
spi0.0: searching for MyLoader partition table at offset 0x20000
spi0.0: searching for MyLoader partition table at offset 0x30000
spi0.0: searching for MyLoader partition table at offset 0x40000
spi0.0: no MyLoader partition table found
Searching for RedBoot partition table in spi0.0 at offset 0x7e0000
6 RedBoot partitions found on MTD device spi0.0
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "RedBoot"
0x000000040000-0x000000120000 : "linux"
0x000000120000-0x0000007e0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=3E0000, len=400000
0x0000003e0000-0x0000007e0000 : "rootfs_data"
0x0000007e0000-0x0000007ef000 : "FIS directory"
0x0000007ef000-0x0000007f0000 : "RedBoot config"
0x0000007f0000-0x000000800000 : "boardconfig"
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth0: AR8316 switch driver attached.
eth0: connected to PHY at ag71xx-mdio:00 [uid=004dd041, driver=Atheros AR8216/AR8316]
eth1: Atheros AG71xx at 0xba000000, irq 5
eth1: connected to PHY at ag71xx-mdio:04 [uid=004dd041, driver=Atheros AR8216/AR8316]
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=25)
TCP westwood registered
NET: Registered protocol family 17
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:2.
Freeing unused kernel memory: 152k freed
Please be patient, while OpenWrt loads ...
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
Button Hotplug driver version 0.3.1
Registered led device: ja76pf:green:led1
Registered led device: ja76pf:green:led2
ar71xx: pll_reg 0xb8050010: 0x110000
eth0: link up (1000Mbps/Full duplex)
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
eth0: link down
device eth0 entered promiscuous mode
Compat-wireless backport release: compat-wireless-2011-01-31-19-g74d6d79
Backport based on wireless-testing.git master-2011-02-25
cfg80211: Calling CRDA to update world regulatory domain
SCSI subsystem initialized
ar71xx: pll_reg 0xb8050010: 0x110000
eth0: link up (1000Mbps/Full duplex)
br-lan: port 1(eth0) entering forwarding state
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: World regulatory domain updated:
cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR71xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
nf_conntrack version 0.5.0 (966 buckets, 3864 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ar71xx-ohci ar71xx-ohci: Atheros AR71xx built-in OHCI controller
ar71xx-ohci ar71xx-ohci: new USB bus registered, assigned bus number 2
ar71xx-ohci ar71xx-ohci: irq 14, io mem 0x1c000000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
i2c /dev entries driver
lm75 0-0048: hwmon0: sensor 'lm75'
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
USB Serial support registered for GSM modem (1-port)
usbcore: registered new interface driver option
option: v0.7.2:USB Driver for GSM modems
fuse init (API version 7.13)
ar71xx-wdt: enabling watchdog timer