OpenWrt Forum Archive

Topic: Atheros AR7100

The content of this topic has been archived between 30 Mar 2018 and 1 May 2018. Unfortunately there are posts – most likely complete pages – missing.

acoul wrote:

Bad news:
* no serial console (yet)

If using kernel 2.6.22.14, for which there is patch mt mikrotik, serial console works.

acoul wrote:

* network dies on ping with large packet size

ping -s 65507 192.168.1.1

I'll try to investigate, where problem is.

upd, fix:
ag7100.c:
-#define AG7100_TX_REAP_THRESH        AG7100_TX_DESC_CNT/2
+#define AG7100_TX_REAP_THRESH        (AG7100_TX_DESC_CNT-AG7100_TX_DESC_CNT/4)

(Last edited by bitbucket on 28 Jun 2008, 11:27)

bitbucket wrote:
BrainSlayer wrote:

its a hal one liner. the kernel is not affected in any way

As always, atheros hide some special 'killer feature' from us. smile We'll keep searching.

I think, that card can't transmit faster than it does when sending self looped TX descriptor with TXDONE IRQ event off. Also, adjusting some interframe timings (sifs, aifs, postbackoff) may boost performance, but not such much.

BrainSlayer wrote:

i compared routeros speed with my solution and mine was faster. about 60 mbit TCP in 802.11a turbo mode was possible without any issues. (usually some more with some tricks)

At which platform ? ag7130 @ 300MHz with build in CPU ethernet IC ?
Because it is possible get 60Mbit in one way at 36Mbit trubo rate without compression. But I used faster cpu (x86).

yes. ag7130 with 300 mhz (ubiquiti litestation x) and kendin phy connected to it. at x86 i get a higher rate. my record with fast framing enabled was much over 70 mbit. (i have no exact value in front of me yet, the test was some months ago)

BrainSlayer wrote:

yes. ag7130 with 300 mhz (ubiquiti litestation x) and kendin phy connected to it. at x86 i get a higher rate. my record with fast framing enabled was much over 70 mbit. (i have no exact value in front of me yet, the test was some months ago)

Sounds very promising for rb411. Next target is to find, where to hack the ath5k driver. smile

update.

* ethernet works rock solid (bitbucket fix)
* mtd/nand/yaffs code included. mounts partitions but does not read MikroTik data
* serial code included but still hardware not recognized

bitbacket Mikrotik 2.6.22.14 patched kernel:

cat /proc/tty/driver/serial

0: uart:16550A mmio:0x00000000 irq:19 tx:732 rx:52 RTS|DTR|DSR|CD
1: uart:unknown port:00000000 irq:0
2: uart:unknown port:00000000 irq:0
3: uart:unknown port:00000000 irq:0

openwrt 2.6.23.17 Mikrotik ported patched kernel:

cat /proc/tty/driver/serial

0: uart:unknown mmio:0x00000000 irq:19
1: uart:unknown port:00000000 irq:0
2: uart:unknown port:00000000 irq:0
3: uart:unknown port:00000000 irq:0

here is the diff of the dmesg from the two kernels above:

< Linux version 2.6.22.14 (root@atlas) (gcc version 4.1.1) #119 Fri Jun 13 13:20:39 MSD 2008
---
> Linux version 2.6.23.17 (alex@extreme) (gcc version 4.2.4) #1 Sun Jun 29 19:33:05 EEST 2008
8,12c8,12
<   DMA zone: 64 pages used for memmap
<   DMA zone: 0 pages reserved
<   DMA zone: 8128 pages, LIFO batch:0
<   Normal zone: 0 pages used for memmap
< Built 1 zonelists.  Total pages: 8128
---
>   Normal zone: 64 pages used for memmap
>   Normal zone: 0 pages reserved
>   Normal zone: 8128 pages, LIFO batch:0
>   Movable zone: 0 pages used for memmap
> Built 1 zonelists in Zone order.  Total pages: 8128
23a24
> console [ttyS0] enabled
26,27c27,28
< Memory: 27580k/32768k available (1930k kernel code, 5188k reserved, 301k data, 1540k init, 0k highmem)
< Calibrating delay loop... 198.65 BogoMIPS (lpj=99328)
---
> Memory: 28140k/32768k available (2070k kernel code, 4628k reserved, 321k data, 804k init, 0k highmem)
> Calibrating delay loop... 199.47 BogoMIPS (lpj=997376)
39c40,43
< yaffs Jun  4 2008 16:41:00 Installing.
---
> squashfs: version 3.0 (2006/03/15) Phillip Lougher
> Registering mini_fo version $Id$
> JFFS2 version 2.2. (NAND) (SUMMARY)  Β© 2001-2006 Red Hat, Inc.
> yaffs Jun 29 2008 19:32:12 Installing.
41c45
< io scheduler anticipatory registered (default)
---
> io scheduler deadline registered (default)
43,45c47,49
< serial8250: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A
< RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
< loop: module loaded
---
> ICPlus IP175C: Registered new driver
> Infineon ADM6996: Registered new driver
> Marvell 88E6060: Registered new driver
52,53d55
< tun: Universal TUN/TAP device driver, 1.6
< tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
63c65
< TCP cubic registered
---
> TCP vegas registered

(Last edited by acoul on 29 Jun 2008, 23:09)

update.

* mtd/nand/yaffs & serial console work fine thanks to Gabor Juhos fixes.

you may find images and packages here:
ar7100 imagesar7100 extra packages

(Last edited by acoul on 1 Jul 2008, 18:47)

acoul wrote:

update.

* mtd/nand/yaffs & serial console work fine thanks to Gabor Juhos fixes.

you may find images and packages here:
ar7100 imagesar7100 extra packages

Hi, I've just compiled a kernel but it hangs on ethernet boot at "jumping to kernel code".

lorenzo.allegrucci wrote:
acoul wrote:

update.

* mtd/nand/yaffs & serial console work fine thanks to Gabor Juhos fixes.

you may find images and packages here:
ar7100 imagesar7100 extra packages

Hi, I've just compiled a kernel but it hangs on ethernet boot at "jumping to kernel code".

did you try a netboot?  what size had the kernel you tried to boot?

(Last edited by acoul on 1 Jul 2008, 18:47)

acoul wrote:
lorenzo.allegrucci wrote:
acoul wrote:

update.

* mtd/nand/yaffs & serial console work fine thanks to Gabor Juhos fixes.

you may find images and packages here:
ar7100 imagesar7100 extra packages

Hi, I've just compiled a kernel but it hangs on ethernet boot at "jumping to kernel code".

did you try a netboot?  what size had the kernel you tried to boot?

Yes I tried a netboot, the size of vmlinux.elf is 3494892.

can you try this netboot kernel?  what hardware are you using?

acoul: serial console and mounting of mtd partitions works ok now (netbooting openwrt-ar7100-vmlinux.elf)

but there is still problem after flashing kernel and rootfs, it is unable to find rootfs on mtdblock1

...
VFS: Cannot open root device "<NULL>" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00       3840 mtdblock0 (driver?)
1f01      61440 mtdblock1 (driver?)
1f02        256 mtdblock2 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Test in RB450. Compile acoul target/linux/ar7100 in trunk r11571
Boot and serial OK.
But the ethernet do not work.

jumping to kernel code
Linux version 2.6.23.17 (marcos@nwmt) (gcc version 4.1.2) #1 Tue Jul 1 09:49:13 BRT 2008
CPU revision is: 00019374
Determined physical RAM map:
User-defined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Built 1 zonelists in Zone order.  Total pages: 8128
Kernel command line: console=ttyS0,115200 gpio=4031 mem=32M kmac=00:0C:42:2E:86:45 board=450 boot=1
Primary instruction cache 64kB, physically tagged, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, linesize 32 bytes.
Synthesized TLB refill handler (20 instructions).
Synthesized TLB load handler fastpath (32 instructions).
Synthesized TLB store handler fastpath (32 instructions).
Synthesized TLB modify handler fastpath (31 instructions).
Cache parity protection disabled
PID hash table entries: 128 (order: 7, 512 bytes)
Using 150.000 MHz high precision timer.
Console: colour dummy device 80x25
console [ttyS0] enabled
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28092k/32768k available (2074k kernel code, 4676k reserved, 325k data, 844k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
Generic PHY: Registered new driver
NET: Registered protocol family 2
Time: MIPS clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  .. 2001-2006 Red Hat, Inc.
yaffs Jul  1 2008 09:38:09 Installing.
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A
serial8250.0: ttyS1 at I/O 0x3f8 (irq = 4) is a 16450
serial8250.0: ttyS2 at I/O 0x2f8 (irq = 3) is a 16450
serial8250.0: ttyS3 at I/O 0x3e8 (irq = 4) is a 16450
serial8250 serial8250.0: unable to register port at index 3 (IO2e8 MEM0 IRQ3): -28
ICPlus IP175C: Registered new driver
Infineon ADM6996: Registered new driver
Marvell 88E6060: Registered new driver
AG7100: Length per segment 1536
AG7100: Max segments per packet 2
AG7100: Max tx descriptor count    256
AG7100: Max rx descriptor count    128
AG7100: fifo cfg 3 008001ff
AG7100CHH: Mac address for unit 0 '00:0c:42:2e:86:45'
RB400 nand
NAND SPI clock 25000 kHz (AHB 150000 kHz / 6)
FLASH SPI clock 25000 kHz (AHB 150000 kHz / 6)
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00040000-0x00400000 : "RouterBoard NAND Boot"
0x00400000-0x04000000 : "RouterBoard NAND Main"
0x00000000-0x00040000 : "RouterBoard NAND Booter"
TCP vegas registered
NET: Registered protocol family 1
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>
Freeing unused kernel memory: 844k freed                                                                      
Algorithmics/MIPS FPU Emulator v1.5
ag7100_ring_alloc Allocated 3072 at 0x8107c000
ag7100_ring_alloc Allocated 1536 at 0x81098000
AG7100: cfg1 0xf cfg2 0x7014
ksz_phy: autonegotiation does not completed
AG7100: unit 0 phy is up...GMii 10Mbps full duplex
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cfg_3: 0x8001ff
AG7100: cfg_4: 0xffff
AG7100: cfg_5: 0x7ffef
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0
Writing 4
[sighandler]: No more events to be processed, quitting.
[cleanup]: Waiting for children.
[cleanup]: All children terminated.
- preinit -                                                                                                   
ag7100_ring_free Freeing at 0x8107c000
ag7100_ring_free Freeing at 0x81098000
ag7100_ring_alloc Allocated 3072 at 0x8107c000
ag7100_ring_alloc Allocated 1536 at 0x81098000
AG7100: cfg1 0xf cfg2 0x7115
ksz_phy: autonegotiation does not completed
AG7100: unit 0 phy is up...GMii 10Mbps full duplex
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cfg_3: 0x8001ff
AG7100: cfg_4: 0xffff
AG7100: cfg_5: 0x7ffef
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0
Writing 4

(Last edited by mtvlv on 2 Jul 2008, 02:22)

@qyx: known problem. need to work on the image/Makefile to include the yaffs/mtdblock1 like in rb523 tree, work in progress.

@mtvlv: rb450 is little different from the rb411 I am working on.  I think there is a via gigabit chip in it. can you confirm this?

acoul wrote:

can you try this netboot kernel?  what hardware are you using?

openwrt-ar7100-vmlinux.elf boots fine, I'm using an RB411

acoul wrote:

@mtvlv: rb450 is little different from the rb411 I am working on.  I think there is a via gigabit chip in it. can you confirm this?

RB450 has an ICplus IP175C
http://www.icplus.com.tw/pp-IP175C.html

strange, ADM6996_PHY is compiled in the kernel and from the comments of this driver:

Currently supports the IP175C PHY

@mtvlv: can you use this netboot image?

number6 wrote:

RB450 has an ICplus IP175C
http://www.icplus.com.tw/pp-IP175C.html

I've been looking into this chip and it looks to be well documented with a full datasheet and app notes.  As well, there is a PHY driver for it (added in 2.6.23).  The kernel seems to recognize that there is an Ethernet port there, but looking at the driver code (icplus.c in kernel), only basic initialization is done.  My guess is that we need to add some IOCTL support into the driver and to put together a user space config tool.  I'll try to contact the author of the original icplus.c code to see if he has done any work in this area.

(Last edited by number6 on 2 Jul 2008, 17:52)

@mtvlv: can you use this netboot image?

Boot ok. Ethernet not. As say number6, only basic initialization is done

jumping to kernel code
Linux version 2.6.23.17 (alex@extreme) (gcc version 4.2.4) #2 Mon Jun 30 14:04:06 EEST 2008
CPU revision is: 00019374
...
NET: Registered protocol family 16
Generic PHY: Registered new driver
NET: Registered protocol family 2
Time: MIPS clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
...
ICPlus IP175C: Registered new driver
Infineon ADM6996: Registered new driver
Marvell 88E6060: Registered new driver
AG7100: Length per segment 1536
AG7100: Max segments per packet 2
AG7100: Max tx descriptor count    256
AG7100: Max rx descriptor count    128
AG7100: fifo cfg 3 008001ff
AG7100CHH: Mac address for unit 0 '00:0c:42:2e:86:45'
...
ag7100_ring_alloc Allocated 3072 at 0x81239000
ag7100_ring_alloc Allocated 1536 at 0x8061c800
AG7100: cfg1 0xf cfg2 0x7014
ksz_phy: autonegotiation does not completed
AG7100: unit 0: phy not up carrier 1
Writing 4
[sighandler]: No more events to be processed, quitting.
[cleanup]: Waiting for children.
[cleanup]: All children terminated.
- preinit -

AG7100: unit 0 phy is up...GMii 10Mbps full duplex
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cfg_3: 0x8001ff
AG7100: cfg_4: 0xffff
AG7100: cfg_5: 0x7ffef
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0
ag7100_ring_free Freeing at 0x81239000
ag7100_ring_free Freeing at 0x8061c800
ag7100_ring_alloc Allocated 3072 at 0x81239000
ag7100_ring_alloc Allocated 1536 at 0x8061c800
AG7100: cfg1 0xf cfg2 0x7115
ksz_phy: autonegotiation does not completed
Writing 4
ag7100_ring_free Freeing at 0x81239000
ag7100_ring_free Freeing at 0x8061c800
ag7100_ring_alloc Allocated 3072 at 0x81239000
ag7100_ring_alloc Allocated 1536 at 0x8061c800
AG7100: cfg1 0xf cfg2 0x7115
ksz_phy: autonegotiation does not completed
AG7100: unit 0 phy is up...GMii 10Mbps full duplex
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cfg_3: 0x8001ff
AG7100: cfg_4: 0xffff
AG7100: cfg_5: 0x7ffef
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0
Writing 4

When I disconnect the rj45 from eth0 port:

unit 0: phy not up carrier 1

When I connect again:

AG7100: unit 0 phy is up...GMii 10Mbps full duplex
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cfg_3: 0x8001ff
AG7100: cfg_4: 0xffff
AG7100: cfg_5: 0x7ffef
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0

@mtvlv & number6: you may give a try this netboot image

acoul wrote:

@mtvlv & number6: you may give a try this netboot image

The image boots fine but I am unable to send/receive traffic.  I have one Ethernet cable connected to Eth1 (as labeled by Mikrotik, left-most RJ-45).  The MAC address returned by "ifconfig eth0" matches that in the Mac swear below.  Here are some of the startup swears:

ICPlus IP175C: Registered new driver                                           
Infineon ADM6996: Registered new driver                                         
Marvell 88E6060: Registered new driver                                         
AG7100: Length per segment 1536                                                 
AG7100: Max segments per packet 2                                               
AG7100: Max tx descriptor count    256                                         
AG7100: Max rx descriptor count    128                                         
AG7100: fifo cfg 3 008001ff                                                     
AG7100CHH: Mac address for unit 0 '00:0c:42:2e:9f:4f'
..snip..
AG7100: unit 0 phy is up...GMii 10M
bps full duplex                                                                 
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000                 
AG7100: cfg_2: 0x3ff                                                           
AG7100: cfg_3: 0x8001ff                                                         
AG7100: cfg_4: 0xffff                                                           
AG7100: cfg_5: 0x7ffef                                                         
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0                                 
ag7100_ring_free Freeing at 0x8039b000                                         
ag7100_ring_free Freeing at 0x8136a800                                         
ag7100_ring_alloc Allocated 3072 at 0x8039b000                                 
ag7100_ring_alloc Allocated 1536 at 0x8136a800                                 
AG7100: cfg1 0xf cfg2 0x7115                                                   
ksz_phy: autonegotiation does not completed                                     
Writing 4                                                                       
ag7100_ring_free Freeing at 0x8039b000                                         
ag7100_ring_free Freeing at 0x8136a800                                         
ag7100_ring_alloc Allocated 3072 at 0x8039b000                                 
ag7100_ring_alloc Allocated 1536 at 0x8136a800                                 
AG7100: cfg1 0xf cfg2 0x7115                                                   
ksz_phy: autonegotiation does not completed                                     
Writing 4                                                                       
ag7100_ring_free Freeing at 0x8039b000                                         
ag7100_ring_free Freeing at 0x8136a800                                         
ag7100_ring_alloc Allocated 3072 at 0x8039b000                                 
ag7100_ring_alloc Allocated 1536 at 0x8136a800                                 
AG7100: cfg1 0xf cfg2 0x7115                                                   
ksz_phy: autonegotiation does not completed                                     
Writing 4                                                                       
AG7100: unit 0 phy is up...GMii 10Mbps full duplex                             
AG7100: pll reg 0x18050010: 0x991099  AG7100: cfg_1: 0x1ff0000                 
AG7100: cfg_2: 0x3ff                                                           
AG7100: cfg_3: 0x8001ff                                                         
AG7100: cfg_4: 0xffff                                                           
AG7100: cfg_5: 0x7ffef                                                         
AG7100: done cfg2 0x7115 ifctl 0x0 miictrl 0x0

number6 wrote:
acoul wrote:

@mtvlv & number6: you may give a try this netboot image

The image boots fine but I am unable to send/receive traffic.  I have one Ethernet cable connected to Eth1 (as labeled by Mikrotik, left-most RJ-45).  The MAC address returned by "ifconfig eth0" matches that in the Mac swear below.  Here are some of the startup swears:

AG7100: unit 0 phy is up...GMii 10M

Not sure if this is a red herring or not, but the AG7100 swear is always "10M", even if I force the link speed to other speeds on the other end of the Ethernet link using ethtool.

Same for me. When make an external ping, I see the led of port blinking. But no RX packages inifconfig. The two leds is up => 100Mbps PHY connect

Linux version 2.6.23.17 (alex@extreme) (gcc version 4.2.4) #3 Wed Jul 2 22:56:34 EEST 2008

The original Mikrotik supplied patch created linux/drivers/net/admtek.c which contains the following routines:

icplus_read_reg
icplus_write_reg
icplus_dump_regs
icplus_stop_engine
icplus_init_engine

One of the first steps performed by the ic175.c standard kernel PHY driver is:
err = phydev->bus->write(phydev->bus, 30, 0, 0x175c);
err = phydev->bus->write(phydev->bus, 29, 31, 0x175c);

One of the first steps in icplus_init_engine:
icplus_write_reg(29, 31, 0x175C);
icplus_write_reg(30, 0, 0x175C);

Due to this similarity, it may be possible to cut-and-paste the full Mikrotik initialization routine into ic175.c and then modify it to suit by referencing the ic175 datasheet.

I'll attempt this tomorrow (UTC-4) if I find cycles.

update. this update is the source that creates the netboot images posted yesterday.

* include some extra ethernet drivers from mikrotik ag7100 released GPL code.  work in progress.

(Last edited by acoul on 3 Jul 2008, 10:49)

acoul: I just untarred your latest tree and noticed that you have both an ag7100 and ag7100-old directory.  In the ag7100-old directory is ipPhy.c which manages the PHY on the RB450.  Any reason why you don't include this in the ag7100 directory?  It would seem to be a necessity to get this working on the RB450.

my bad.  I forgot to transfer the new files from the:

build_dir/linux-ar7100/linux-2.6.23.17/drivers/net/ag7100 
to the 
target/linux/ar7100/files/drivers/net/ag7100

fixed. please checkout again the source code. the ag7100-old directory is where tha mikrotik original files reside.  this code does not compile clean.