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:zsun:wifi-card-reader [2016/05/06 00:47] – Added more info related to internal Linux nochkin | toh:zsun:wifi-card-reader [2018/03/07 22:20] – link to LEDE forum added tmomas | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Zsun wifi card reader ====== | ||
| + | |||
| + | **Status:** upstream support merge [[https:// | ||
| + | |||
| + | See also [[https:// | ||
| + | |||
| + | ===== Summary ===== | ||
| + | |||
| + | Zsun produces an Atheros AR9331 based wireless card reader. Coming with 64 MiB RAM and 16 MiB SPI flash it can easily run OpenWrt. The device can be bought for ~$11 on AliExpress, DealExtreme or similar websites. | ||
| + | |||
| + | Along with the [[toh: | ||
| + | |||
| + | This thing has many uses ranging from plain networking to embedded systems. For example it can be used as a: | ||
| + | * wireless AP/ | ||
| + | * supports at least two connections with good quality (for example a client connection and an AP) | ||
| + | * embedded Linux device, you can turn it into a " | ||
| + | * an OpenVPN plug-in AP | ||
| + | * mesh network participant, | ||
| + | * wifi hacktivism, such as [[https:// | ||
| + | * use it for its intende purpose: serving files :-) | ||
| + | |||
| + | |||
| + | ===== Pictures ===== | ||
| + | {{media: | ||
| + | {{media: | ||
| + | {{media: | ||
| + | {{media: | ||
| + | |||
| + | ===== Hardware ===== | ||
| + | |||
| + | The device consists of two PCBs sandwiched together and connected via 8 pins. | ||
| + | The bottom PCB only contains the SD card reader chip and SD slot, so it can be safely removed without affecting operation. | ||
| + | |||
| + | Here's the summary: | ||
| + | |||
| + | | **Architecture: | ||
| + | | **Vendor:** Atheros/ | ||
| + | | **System-On-Chip: | ||
| + | | **Flash size:** 16MiB SPI | | ||
| + | | **RAM:** 64MiB (32MiB version possibly out there) | | ||
| + | | **Ethernet port:** yes, via external PHY, TX/RX pairs on testpoints | | ||
| + | | **Serial:** yes, on testpoints, 115200 8N1 | | ||
| + | | **Bootloader: | ||
| + | | **Extras:** GL827L card reader controller, WAS7227Q USB switch | | ||
| + | |||
| + | As you can see we have some extra goodies on board such as the WAS7227Q USB switch, which connects the SD card reader chip to either the AR9331 SoC (GPIO21 HIGH) or the USB plug (GPIO21 LOW). | ||
| + | |||
| + | Talking about GPIOs, they operate at 2.5V logic level and they can be identified as such: | ||
| + | |||
| + | * GPIO0: LED | ||
| + | * GPIO18: card reader reset | ||
| + | * GPIO21: USB switch | ||
| + | * GPIO22: card detect | ||
| + | |||
| + | Bootstrap GPIOs: | ||
| + | * GPIO0: Crystal frequency of external clock 0=25, 1=40 MHz | ||
| + | * GPIO1: Booting from internal 0=ROM, 1=SPI Flash | ||
| + | * GPIO11: 0=General JTAG, 1=CPU ICE | ||
| + | * GPIO12/28: external memory type (00=SDR, 01=DDR, 10=DDR2) | ||
| + | * GPIO13: USB mode 0=device, 1=host | ||
| + | * GPIO16: Download firmware from 0=USB, 1=MDIO | ||
| + | |||
| + | As you may have noticed from the table above an Ethernet port ('' | ||
| + | |||
| + | or you can use this python tool (very slow >1kb/s ) | ||
| + | [[https:// | ||
| + | |||
| + | ===== Flashing ===== | ||
| + | |||
| + | Upstream support is halted, and may not merge. You can follow these guides: | ||
| + | * [[https:// | ||
| + | * [[http:// | ||
| + | |||
| + | From serial console only (untested) | ||
| + | [[https:// | ||
| + | |||
| + | ===== Credits ===== | ||
| + | * The Warsaw Hackerspace for [[https:// | ||
| + | * phasenoise for the [[http:// | ||
| + | * Benjamin Henrion for figuring out the [[http:// | ||
| + | |||
| + | ===== Original firmware ===== | ||
| + | ===== Software information ===== | ||
| + | < | ||
| + | # cat / | ||
| + | system type : Atheros AR9330 (Hornet) | ||
| + | processor | ||
| + | cpu model : MIPS 24Kc V7.4 | ||
| + | BogoMIPS | ||
| + | wait instruction | ||
| + | microsecond timers | ||
| + | tlb_entries | ||
| + | extra interrupt vector | ||
| + | hardware watchpoint | ||
| + | ASEs implemented | ||
| + | shadow register sets : 1 | ||
| + | core : 0 | ||
| + | VCED exceptions | ||
| + | VCEI exceptions | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | rootfs / rootfs rw 0 0 | ||
| + | /dev/root / jffs2 rw,relatime 0 0 | ||
| + | /proc /proc proc rw,relatime 0 0 | ||
| + | devpts /dev/pts devpts rw, | ||
| + | none /tmp ramfs rw,relatime 0 0 | ||
| + | sysfs /sys sysfs rw,relatime 0 0 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat /proc/mtd | ||
| + | dev: size | ||
| + | mtd0: 00010000 00010000 " | ||
| + | mtd1: 00010000 00010000 " | ||
| + | mtd2: 00e90000 00010000 " | ||
| + | mtd3: 00130000 00010000 " | ||
| + | mtd4: 00010000 00010000 " | ||
| + | mtd5: 00010000 00010000 " | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | major minor # | ||
| + | |||
| + | 31 0 64 mtdblock0 | ||
| + | 31 1 64 mtdblock1 | ||
| + | 31 2 14912 mtdblock2 | ||
| + | 31 3 1216 mtdblock3 | ||
| + | 31 4 64 mtdblock4 | ||
| + | 31 5 64 mtdblock5 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | 00000000-03ffffff : System RAM | ||
| + | 00002000-0023d507 : Kernel code | ||
| + | 0023d508-002e05ff : Kernel data | ||
| + | 18020000-18020fff : serial8250.0 | ||
| + | 1b000000-1bffffff : ar7240-ehci.0 | ||
| + | 1b000000-1bffffff : ehci_hcd | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | console=ttyS0, | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | Linux version 2.6.31--LSDK-9.2.0_U11.14 (root@jwyue) (gcc version 4.3.3 (GCC) ) #1 Wed Dec 17 15:53:04 CST 2014 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | name : ecb(arc4) | ||
| + | driver | ||
| + | module | ||
| + | priority | ||
| + | refcnt | ||
| + | selftest | ||
| + | type : blkcipher | ||
| + | blocksize | ||
| + | min keysize | ||
| + | max keysize | ||
| + | ivsize | ||
| + | geniv : < | ||
| + | |||
| + | name : stdrng | ||
| + | driver | ||
| + | module | ||
| + | priority | ||
| + | refcnt | ||
| + | selftest | ||
| + | type : rng | ||
| + | seedsize | ||
| + | |||
| + | name : lzma | ||
| + | driver | ||
| + | module | ||
| + | priority | ||
| + | refcnt | ||
| + | selftest | ||
| + | type : pcomp | ||
| + | |||
| + | name : arc4 | ||
| + | driver | ||
| + | module | ||
| + | priority | ||
| + | refcnt | ||
| + | selftest | ||
| + | type : cipher | ||
| + | blocksize | ||
| + | min keysize | ||
| + | max keysize | ||
| + | |||
| + | name : aes | ||
| + | driver | ||
| + | module | ||
| + | priority | ||
| + | refcnt | ||
| + | selftest | ||
| + | type : cipher | ||
| + | blocksize | ||
| + | min keysize | ||
| + | max keysize | ||
| + | |||
| + | name : sha1 | ||
| + | driver | ||
| + | module | ||
| + | priority | ||
| + | refcnt | ||
| + | selftest | ||
| + | type : shash | ||
| + | blocksize | ||
| + | digestsize | ||
| + | descsize | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | MemTotal: | ||
| + | MemFree: | ||
| + | Buffers: | ||
| + | Cached: | ||
| + | SwapCached: | ||
| + | Active: | ||
| + | Inactive: | ||
| + | Active(anon): | ||
| + | Inactive(anon): | ||
| + | Active(file): | ||
| + | Inactive(file): | ||
| + | Unevictable: | ||
| + | Mlocked: | ||
| + | SwapTotal: | ||
| + | SwapFree: | ||
| + | Dirty: | ||
| + | Writeback: | ||
| + | AnonPages: | ||
| + | Mapped: | ||
| + | Slab: 4424 kB | ||
| + | SReclaimable: | ||
| + | SUnreclaim: | ||
| + | PageTables: | ||
| + | NFS_Unstable: | ||
| + | Bounce: | ||
| + | WritebackTmp: | ||
| + | CommitLimit: | ||
| + | Committed_AS: | ||
| + | VmallocTotal: | ||
| + | VmallocUsed: | ||
| + | VmallocChunk: | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # ifconfig | ||
| + | ath0 Link encap: | ||
| + | UP BROADCAST RUNNING MULTICAST | ||
| + | RX packets:365 errors:0 dropped:0 overruns:0 frame:0 | ||
| + | TX packets:309 errors:0 dropped:0 overruns:0 carrier:0 | ||
| + | collisions: | ||
| + | RX bytes:46390 (45.3 KiB) TX bytes:55642 (54.3 KiB) | ||
| + | |||
| + | br0 Link encap: | ||
| + | inet addr: | ||
| + | UP BROADCAST RUNNING MULTICAST | ||
| + | RX packets:369 errors:0 dropped:0 overruns:0 frame:0 | ||
| + | TX packets:168 errors:0 dropped:0 overruns:0 carrier:0 | ||
| + | collisions: | ||
| + | RX bytes:33282 (32.5 KiB) TX bytes:17181 (16.7 KiB) | ||
| + | |||
| + | eth0 Link encap: | ||
| + | UP BROADCAST MULTICAST | ||
| + | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| + | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
| + | collisions: | ||
| + | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| + | |||
| + | eth1 Link encap: | ||
| + | inet addr: | ||
| + | UP BROADCAST MULTICAST | ||
| + | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| + | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
| + | collisions: | ||
| + | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| + | |||
| + | lo Link encap:Local Loopback | ||
| + | inet addr: | ||
| + | UP LOOPBACK RUNNING | ||
| + | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| + | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
| + | collisions: | ||
| + | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| + | |||
| + | wifi0 Link encap: | ||
| + | UP BROADCAST RUNNING MULTICAST | ||
| + | RX packets: | ||
| + | TX packets: | ||
| + | collisions: | ||
| + | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| + | Interrupt:2 Memory: | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # brctl show | ||
| + | bridge name | ||
| + | br0 | ||
| + | ath0 | ||
| + | </ | ||
| + | |||
| + | ===== Bootlogs===== | ||
| + | ==== Firmware bootlog ==== | ||
| + | <WRAP bootlog> | ||
| + | < | ||
| + | arg 7: mem=64M | ||
| + | CPU revision is: 00019374 (MIPS 24Kc) | ||
| + | Determined physical RAM map: | ||
| + | | ||
| + | User-defined physical RAM map: | ||
| + | | ||
| + | Zone PFN ranges: | ||
| + | Normal | ||
| + | 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: | ||
| + | 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: console=ttyS0, | ||
| + | PID hash table entries: 256 (order: 8, 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=00000000 | ||
| + | Readback ErrCtl register=00000000 | ||
| + | Memory: 61736k/ | ||
| + | NR_IRQS:128 | ||
| + | plat_time_init: | ||
| + | Calibrating delay loop... 266.24 BogoMIPS (lpj=532480) | ||
| + | Mount-cache hash table entries: 512 | ||
| + | NET: Registered protocol family 16 | ||
| + | ===== ar7240_platform_init: | ||
| + | bio: create slab < | ||
| + | SCSI subsystem initialized | ||
| + | usbcore: registered new interface driver usbfs | ||
| + | usbcore: registered new interface driver hub | ||
| + | usbcore: registered new device driver usb | ||
| + | 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 | ||
| + | AR7240 GPIOC major 0 | ||
| + | squashfs: version 4.0 (2009/ | ||
| + | NTFS driver 2.1.29 [Flags: R/W DEBUG]. | ||
| + | JFFS2 version 2.2 (NAND) (ZLIB) (RTIME) (c) 2001-2006 Red Hat, Inc. | ||
| + | fuse init (API version 7.12) | ||
| + | msgmni has been set to 120 | ||
| + | alg: No test for lzma (lzma-generic) | ||
| + | alg: No test for stdrng (krng) | ||
| + | io scheduler noop registered (default) | ||
| + | gpio: ath-gpio module inited! | ||
| + | Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled | ||
| + | ttyS0: detected caps 00000000 should be 00000100 | ||
| + | serial8250.0: | ||
| + | console [ttyS0] enabled | ||
| + | brd: module loaded | ||
| + | PPP generic driver version 2.4.2 | ||
| + | PPP Deflate Compression module registered | ||
| + | PPP BSD Compression module registered | ||
| + | PPP MPPE Compression module registered | ||
| + | NET: Registered protocol family 24 | ||
| + | PPPoL2TP kernel driver, V1.0 | ||
| + | 6 cmdlinepart partitions found on MTD device ar7240-nor0 | ||
| + | Creating 6 MTD partitions on " | ||
| + | 0x000000000000-0x000000010000 : " | ||
| + | 0x000000010000-0x000000020000 : " | ||
| + | 0x000000020000-0x000000eb0000 : " | ||
| + | 0x000000eb0000-0x000000fe0000 : " | ||
| + | 0x000000fe0000-0x000000ff0000 : " | ||
| + | 0x000000ff0000-0x000001000000 : " | ||
| + | usbmon: debugfs is not available | ||
| + | usbcore: registered new interface driver usbserial | ||
| + | USB Serial support registered for generic | ||
| + | usbcore: registered new interface driver usbserial_generic | ||
| + | usbserial: USB Serial Driver core | ||
| + | USB Serial support registered for GSM modem (1-port) | ||
| + | usbcore: registered new interface driver option | ||
| + | option: v0.7.2:USB Driver for GSM modems | ||
| + | Netfilter messages via NETLINK v0.30. | ||
| + | nf_conntrack version 0.5.0 (1024 buckets, 4096 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. | ||
| + | xt_time: kernel timezone is -0000 | ||
| + | ip_tables: (C) 2000-2006 Netfilter Core Team | ||
| + | ClusterIP Version 0.8 loaded successfully | ||
| + | arp_tables: (C) 2002 David S. Miller | ||
| + | TCP cubic registered | ||
| + | NET: Registered protocol family 17 | ||
| + | Bridge firewalling registered | ||
| + | Ebtables v2.0 registered | ||
| + | ebt_ulog: out of memory trying to call netlink_kernel_create | ||
| + | 802.1Q VLAN Support v1.8 Ben Greear < | ||
| + | All bugs added by David S. Miller < | ||
| + | arch/ | ||
| + | ar7240wdt_init: | ||
| + | VFS: Mounted root (jffs2 filesystem) on device 31:2. | ||
| + | Freeing unused kernel memory: 132k freed | ||
| + | ATHR_GMAC: Length per segment 1536 | ||
| + | ATHR_GMAC: fifo cfg 3 01f00140 | ||
| + | ATHR_GMAC: Mac address for unit 0:bfff0000 | ||
| + | ATHR_GMAC: 00: | ||
| + | ATHR_GMAC: Max segments per packet : 1 | ||
| + | ATHR_GMAC: Max tx descriptor count : 40 | ||
| + | ATHR_GMAC: Max rx descriptor count : 252 | ||
| + | ATHR_GMAC: Mac capability flags : 4403 | ||
| + | ATHR_GMAC: Mac address for unit 1:bfff0006 | ||
| + | ATHR_GMAC: 00: | ||
| + | ATHR_GMAC: Max segments per packet : 1 | ||
| + | ATHR_GMAC: Max tx descriptor count : 40 | ||
| + | ATHR_GMAC: Max rx descriptor count : 96 | ||
| + | ATHR_GMAC: Mac capability flags : 4D83 | ||
| + | athr_gmac_ring_alloc Allocated 640 at 0x83979c00 | ||
| + | athr_gmac_ring_alloc Allocated 4032 at 0x8394d000 | ||
| + | Setting Drop CRC Errors, Pause Frames and Length Error frames | ||
| + | Setting PHY... | ||
| + | athr_gmac_ring_alloc Allocated 640 at 0x83979800 | ||
| + | athr_gmac_ring_alloc Allocated 1536 at 0x83977800 | ||
| + | ATHRS26: resetting s26 | ||
| + | ATHRS26: s26 reset done | ||
| + | Setting Drop CRC Errors, Pause Frames and Length Error frames | ||
| + | Setting PHY... | ||
| + | device eth0 entered promiscuous mode | ||
| + | ehci_hcd: USB 2.0 ' | ||
| + | Port Status 1c000004 | ||
| + | ar7240-ehci ar7240-ehci.0: | ||
| + | ar7240-ehci ar7240-ehci.0: | ||
| + | ehci_reset Intialize USB CONTROLLER in host mode: 3 | ||
| + | ehci_reset Port Status 1c000000 | ||
| + | ar7240-ehci ar7240-ehci.0: | ||
| + | ehci_reset Intialize USB CONTROLLER in host mode: 3 | ||
| + | ehci_reset Port Status 1c000000 | ||
| + | ar7240-ehci ar7240-ehci.0: | ||
| + | usb usb1: configuration #1 chosen from 1 choice | ||
| + | hub 1-0:1.0: USB hub found | ||
| + | hub 1-0:1.0: 1 port detected | ||
| + | Initializing USB Mass Storage driver... | ||
| + | usbcore: registered new interface driver usb-storage | ||
| + | USB Mass Storage support registered. | ||
| + | **** drop_caches_sysctl_handler: | ||
| + | asf: module license ' | ||
| + | Disabling lock debugging due to kernel taint | ||
| + | ath_hal: 0.9.17.1 (AR9380, DEBUG, REGOPS_FUNC, | ||
| + | ath_rate_atheros: | ||
| + | ath_dev: Copyright (c) 2001-2007 Atheros Communications, | ||
| + | ath_ahb: 9.2.0_U11.14 (Atheros/ | ||
| + | __ath_attach: | ||
| + | ACBKMinfree = 48 | ||
| + | ACBEMinfree = 32 | ||
| + | ACVIMinfree = 16 | ||
| + | ACVOMinfree = 0 | ||
| + | CABMinfree = 48 | ||
| + | UAPSDMinfree = 0 | ||
| + | Bootstrap clock 25MHz | ||
| + | ar9300RadioAttach: | ||
| + | Restoring Cal data from Flash | ||
| + | Using Cal data from Flash 0xbfff0000 | ||
| + | ath_get_caps[5184] rx chainmask mismatch actual 1 sc_chainmak 0 | ||
| + | ath_get_caps[5159] tx chainmask mismatch actual 1 sc_chainmak 0 | ||
| + | SC Callback Registration for wifi0 | ||
| + | wifi0: Atheros 9380: mem=0xb8100000, | ||
| + | wlan_vap_create : enter. devhandle=0x83c202c0, | ||
| + | wlan_vap_create : exit. devhandle=0x83c202c0, | ||
| + | device ath0 entered promiscuous mode | ||
| + | br0: port 2(ath0) entering forwarding state | ||
| + | | ||
| + | Scan in progress.. Cancelling it | ||
| + | br0: port 2(ath0) entering disabled state | ||
| + | | ||
| + | | ||
| + | br0: port 2(ath0) entering forwarding state | ||
| + | usb 1-1: new high speed USB device using ar7240-ehci and address 2 | ||
| + | usb 1-1: configuration #1 chosen from 1 choice | ||
| + | scsi0 : SCSI emulation for USB Mass Storage devices | ||
| + | usb-storage: | ||
| + | usb-storage: | ||
| + | usb 1-1: USB disconnect, address 2 | ||
| + | usb 1-1: new high speed USB device using ar7240-ehci and address 3 | ||
| + | usb 1-1: configuration #1 chosen from 1 choice | ||
| + | scsi1 : SCSI emulation for USB Mass Storage devices | ||
| + | usb-storage: | ||
| + | usb-storage: | ||
| + | scsi 1:0:0:0: Direct-Access | ||
| + | usb-storage: | ||
| + | sd 1:0:0:0: [sda] 124735488 512-byte logical blocks: (63.8 GB/59.4 GiB) | ||
| + | sd 1:0:0:0: [sda] Write Protect is off | ||
| + | sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00 | ||
| + | sd 1:0:0:0: [sda] Assuming drive cache: write through | ||
| + | sd 1:0:0:0: [sda] Assuming drive cache: write through | ||
| + | sda: sda1 | ||
| + | sd 1:0:0:0: [sda] Assuming drive cache: write through | ||
| + | sd 1:0:0:0: [sda] Attached SCSI removable disk | ||
| + | ath_tx_edma_tasklet: | ||
| + | </ | ||