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.

@bitbucket

Had a quick look thru the datasheet of the KSZ8041NL:

Reset pin is pin32, low active. Bit 0,1,2  of the PHY address are set by pin 13,14,15, while the upper two bits are always 0, i.e. the PHY address is 1,..,7 . Default address is 1, if these three pins are open.
Maybe you could check the config with a voltmeter ...

(Last edited by jal2 on 27 May 2008, 23:11)

MikroTik send me their Atheros Eth GPL driver that though don't use in their RouterOS. You may get this driver here

(Last edited by acoul on 28 May 2008, 08:09)

jal2 wrote:

a driver usally probes all addresses from 0 to 0x1f by reading register 2 and 3 (PHY ID, ID2) until something != 0xffff is read. If this fails, maybe the clock on MDC isn't enabled or the PHY isn't released from reset (some GPIO?).

Yes, at 0x0 there is something not like 0xffff, but there are some questions about autonegotiation process and so on. I'm working on this.

upd: Right value is 0. Link detection works, speed too.

Wireless (ath5k) works too, but it is not stable at high loads.

(Last edited by bitbucket on 28 May 2008, 15:25)

As non developer,
I wonder why Mikrotik doesn't release their patches to the public (and rather send them to single developers)... while such practice won't be strictly a GPL violation wouldn't be much better to make a public release?
And why do they not release as soon as their RouterOS? Why do developers accept to receive the Mikrotik patches after months?
I don't want to be polemic, I'm just wondering, because searching in the forum I found many complains about this issue that comes back each time openwrt has to support  a new Mikrotik card.
Can anyone please shed some light of this?

Compex find an easyer solution than to write a new driver for atheros ar7130 ethernet smile

I have in my hands the new model of compex board, the wp-543
It mounts a atheros ar7130  (no cooler over the cpu.. mikrotik has it..)
It offers two minipci cards
It has nand flash as hard disk like mikrotik boards, from 4 to 32mb depending from the model.
There are seven GPIO pin usable !
May be they haven't the driver for the internal ethernet, but they solved the problem using a realtek rtl8201 external ethernet chip.
The result seem good and the price is around the same that mikrotik.
At what i can see the board boot.. (for now i didn't connect it because i'm mounting the serial connector and i haven't pinout informatios, and no level shifter.. just the time to connect it and i'll tell you more).
Normally compex ship his boards with an openwrt inside. So i think they allready have an openwrt patched for this architecture.

Note: this are pre-production boards and you can see it because the master is patched manually adding wires to correct erros.
The only problem: i thimk they are ever using compex bootloader, that require the system packet as trx.. This is ever boring, also because i don't know if the trx format will be the same or will be changed for BE mips.

Sorry.. I have only one so i can't send it to openwrt group, but if you need to test it we can find a way to give you remote access to the system i use to develop it, then we can work on it together. I' m really interested on having an openwrt booting on ar7130. Now it seem to be the better architecture for unexpensives CPE.


FOUND THE LEVEL SHIFTER.
Something tell me that as i connect the serial cable to the correct computer and not the one that is off i can see a bit more..
(115200, 7n1)

MyLoader vesion 2.44.0124
System memory: 32MB

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

DIO PHY scan:
PHY ID [3] = 0000-8201
ink Up, Full Duplex, 100 Mbps

Load Firmware

Loading Firmware  Done.

Linux version 2.6.17 (leihui@rdserver.localdomain) (gcc version 3.4.6) #6 Tue Apr 15 14:32:31 SGT 2008
CPU revision is: 00019374
Determined physical RAM map:
memory: 02000000 @ 0000000 (usable)
Built 1 zonelists
Kernel command line: console=ttyS0,115200 rootfs=squashfs root=/dev/mtdblock3
Primary instruction cache 64kB, physically tagged, 4-way, linesize 32 byes.
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: 256 (order: 8, 1024 bytes)
Using 150.000 MHz high precision timer.
Console: colour dummy device 80x25
Dentry cache ash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 30304k/32768k available (1599k kernel code, 2448k reserved, 260k data, 140k init, 0k highmem)
Mount-cache hash table entries: 512
Checking for 'wait' instruction...  available.
NET: Registered protocolfamily 16
calling simple_config callback..
TC classifier action (bugs to netdev@vger.kernel.org cc hadi@cyberus.ca)
NET: Registered protocol family 2
IP route cache hash table entres: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
AR7100 GPIOC major 0
squashfs: version 3.1 (2006/08/19) Phillip Lougher
Initializing Cryptographic API
io scheduler noop registeredo scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A
RAMDISKdriver initialized: 1 RAM disks of 4096K size 1024 blocksize
PPP generic driver version 2.4.2
NET: Registered protocol family 24
ar7100_flash_init : using MyLoader flash mpping
Searching for MyLoader partition table in ar7100-nor0 at offset 0x10000
Creating 5 MTD partitions on "ar7100-nor0":
0x00000000-0x00010000 : "MyLoader"
0x00010000-0x0020000 : "Partition Table"
0x00020000-0x000f0000 : "kernel"
0x00100000-0x003d0000 : "rootfs"
0x003f0000-0x00400000 : "data"
u32 classifier
    Actions configured
IPv4 oer IPv4 tunneling driver
GRE over IPv4 tunneling driver
ip_conntrack version 2.4 (256 buckets, 2048 max) - 204 bytes per conntrack
p_conntrack_pptp version 3.1 loaded
ip_nat_pptp version 3.0 loaded
ip_tables: (C) 2000-2006 Netfilter Core Team
CP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
FS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 140k freed
lgorithmics/MIPS FPU Emulator v1.5
More product id needs to be defined?
--------config_sys_get errr--------
g7100_mod: module license 'unspecified' taints kernel.
AG7100: Length per segment 1536
AG7100: Max segments per packet2
AG7100: Max tx descriptor count    200
AG7100: Max rx descriptor count    252
AG7100: fifo cfg 3 008001ff
tart watchdog:
watchdog: No such devic
Start button:
tart switch:
Start localtime:
tart netif:
failed to open dev/button
tart account:
tart network:
lan load.
lan: 0.8.4.2 (Atheros/multi-bss)
lan: mac acl policy registered
lan: client bridge registered
th_hal: 0.9.17.1 (AR5212, RF5112, RF2413, RF5413, REGOPS_FUNC)
th_rate_sample: 1.2
th_pci: 0.9.4.5 (Atheros/multi-bss)
PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
ifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/Wencryption support: WEP AES AES_CCM TKIP
wifi0: mac 7.8 phy 4.5 radio 5.6
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw quee 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 5212: mem=0x10000000, irq=48
PCI: Enabling device 0000:00:01.0 (0000 -> 0002)
PCI: Enabling device 0000:00:01.0 (0000 -> 0002)
ifi1: unable to attach hardware; HAL status 13
lan 0 init.
lan 1 init.
wifi1 doesn't exist
wla 2 init.
wifi2 doesn't exist
wlan 0 config.
lan 1 config.
lan 2 config.
tart wlan:
wlan 0 create.
th0
unc ieee80211_ioctl_siwessid, line 853
et.ath0.maxaid = 33
nvalid command : tx_chainmask
Invalid command: rx_chainmask
lan 1 create.
wlan_applet_create: radio 1 does not exist
lan 2 create.
wlan_applet_create: radio 2 does not exist
tart vaps:
Error: service wlan1 not found!
Error: service wlan1 not found!
Error: service wlan1 not found!
Start wlan1:
Error: servie wlan1 not found!
Error: service wlan2 not found!
Error: service wlan2 not found!
Error: service wlan2 not found!
Start wlan2:
Error: service wlan2 not found!
Start bridge:
G7100: cfg1 0xf cfg2 0x7014
G7100: unit 0 phy is up...Mii 100Mbps full duplex
AG7100: pll reg 0x18050010: 0x1099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cg_3: 0x8001ff
AG7100: cfg_4: 0x3ffff
AG7100: cfg_5: 0x3ffff
AG7100: done cfg2 0x7115 ifctl 0x10000 miictrl 0x11
Writing 4
evice eth0 entered promiscuous mode
evice ath0 entered promiscuous mode
tart wds:
br0: port 1(eth0) entering learning state
br0: topology change detected, propagating
br0: port 1(eth0) entering forwarding state
r0: port 2(ath0) entering learning state
br0: topology change detected, propagating
br0: port 2(ath0) entering forwarding state
tart stp:
tart duplex:
pen device error!
Start loop:
tart apencrypt:
wlan  start.
lan 1 start.
wlan_applet_start: radio 1 does not exist.
lan 2 start.
wlan_applet_start: radio 2 does not exist.
tart lan:
tart execd:
tart uconfig:
tart ntpdate:
tart mem_management:
tpdate: time.nist.gov - unknown host.
tart inetd:
tart snmpd:
tart webs:
tart monitorps:

Note that i put two wireless cards, and the compex firmware see only one.
Another note: the two minipci connectors are too near to put two new compex 26db minipci cards.There is barely the space for two normal minipci.



Enrico.

studioideasw@gmail.com wrote:

Compex find an easyer solution than to write a new driver for atheros ar7130 ethernet smile

g7100_mod: module license 'unspecified' taints kernel.
AG7100: Length per segment 1536
AG7100: Max segments per packet2
AG7100: Max tx descriptor count    200
AG7100: Max rx descriptor count    252
AG7100: fifo cfg 3 008001ff

G7100: cfg1 0xf cfg2 0x7014
G7100: unit 0 phy is up...Mii 100Mbps full duplex
AG7100: pll reg 0x18050010: 0x1099  AG7100: cfg_1: 0x1ff0000
AG7100: cfg_2: 0x3ff
AG7100: cg_3: 0x8001ff
AG7100: cfg_4: 0x3ffff
AG7100: cfg_5: 0x3ffff
AG7100: done cfg2 0x7115 ifctl 0x10000 miictrl 0x11
Writing 4

Nothing new. The same driver, like in mikrotik.

Wireless driver is madwifi.

As non developer,
I wonder why Mikrotik doesn't release their patches to the public (and rather send them to single developers)... while such practice won't be strictly a GPL violation wouldn't be much better to make a public release?
And why do they not release as soon as their RouterOS? Why do developers accept to receive the Mikrotik patches after months?
I don't want to be polemic, I'm just wondering, because searching in the forum I found many complains about this issue that comes back each time openwrt has to support  a new Mikrotik card.
Can anyone please shed some light of this?

It's quite simple, really. Selling hardware is a low margin business. Selling services, on the other hand...

The longer they can delay sending out patches, the more customers will flock to use RouterOS instead. In other words, they will be less than cooperative in providing patches. This is a bit of a shame of course, as they are bound to do so by GPL. Send in the lawyers! smile

rbiz wrote:

The longer they can delay sending out patches, the more customers will flock to use RouterOS instead. In other words, they will be less than cooperative in providing patches.

actually this is not true.  the market sector that will use RouterOS will do so no matter what the open source alternative has to offer.  similarly the open source market share will also use only open source software no matter what the RouterOS has to offer.  Not helping the open source development alternative will only hurt hardware sales, and hardware sales while having a lower profit margin it does sport a larger market share.  the funny thing is that RouterOS cost is included on the RouterBord hardware therof delaying driver patches for the open source community does not make any sense at all.

Alright, so explain why those 'malakas' at MT are being so obstructive? There must be more to it than them just being evil.

I can see a number of reasons:
* people will need to upgrade their RouterOS license for more concurrent connections
* the creation of a captive market and customer binding
* competitive reasons: releasing patches means their competition (other hardware manufacturers) won't have to write them and they would then benefit from their work

According to the wiki on mikrotik, their biggest customers are small isp's. these are clients who will need to upgrade their routeros for sure. if they could opt for a stable and tested solution from openwrt, they would not shell out the cash for the routeros instead.

Speaking of which, why is RouterOS not GPL? As it's based on it, should its sources not have been released a long long time ago... They shield with their license agreement when you ask, but that agreement is not relevant on this occasion, if a judge were to decide.

I'm not telling you how things should be, I'm telling you how they are. I know they should behave such and such. In this world, being right and getting what you deserve are two different things. You can get more with a gun and a kind word, than with just a a kind word. In this case, the law needs to be exercised. Or stop complaining.

rbiz, I think that situation about ar7100 and mikrotik is simple.
It seems that the other manifacturers have problems with ar7100 boards for various reasons. Ubiquity is delayed with PStationX and Compex has not released anything yet.
Mikrotik has the advantage to sell a very good board with very good price without competition in this price tag (for now). We have to admit that mikrotik developers are very good and they achived to make this chipset to work. Is very logical to keep their work private as long as they can. I am sure that they will release the code later, if they dont, all these that you are thinking will be correct.

(Last edited by Slammer on 1 Jun 2008, 00:34)

the issue here is not MikroTik but Atheros.  As with their 802.11 products, their view for the open source community is not clear yet otherwise a linux SDK for the ar7100 family would have been released a long time ago.  Usually competition is a good factor  to convince hardware companies to be more supportive to open source development.  thereof the new Intel products based on atom CPU will provide some good reconsideration to Atheros about open source driver support :-)

open source is a trend so it's just a matter of time :-)

Slammer wrote:

... Is very logical to keep their work private as long as they can. I am sure that they will release the code later, if they dont, all these that you are thinking will be correct.

I fully agree, this is logical, but is it also legal? In other words, are they violating the GPL?

I dont know if it is legal or not. I think that is common to have restricted kernel modules in linux world (for example nvidia and ati).
Always there is a solution. It is possible for mikrotik to give us an object module (with no source code) to make a full operating kernel. If mikrotik wants openwrt customers will do it.

I buy only boards with openwrt support for my applications (not a lot of them, about 50-100 per year). It is very clear for me that I can't buy RB4xx boards for now (I prefer to pay something more and to buy alix boards) , and many of us are thinking the same.

(Last edited by Slammer on 1 Jun 2008, 13:12)

Is anyone toying with the new RB4xx's?

Once OpenWRT runs to an acceptable standard on the RB433AH, I'll get about 60 of these over the next few years. If MikroTik is reading this: I don't want your RouterOS, but thanks.

Ethernet working, but not so stable (it hangs on high pps load), wireless - ath5k driver works (ap client), but also not so stable.

bitbucket wrote:

Ethernet working, but not so stable (it hangs on high pps load), wireless - ath5k driver works (ap client), but also not so stable.

have you tried with the Mikrotik GPL ethernet driver?  it has some differences from the Chinese one.

acoul wrote:
bitbucket wrote:

Ethernet working, but not so stable (it hangs on high pps load), wireless - ath5k driver works (ap client), but also not so stable.

have you tried with the Mikrotik GPL ethernet driver?  it has some differences from the Chinese one.

No, I have not. I found problem with ethernet: too short receive rings. I changed
#define CONFIG_AG7100_NUMBER_TX_PKTS 32 -> 128
#define CONFIG_AG7100_NUMBER_RX_PKTS 32 -> 128
now it works stable: 100Mbps by 64byte packets received without any problems. But RB411 reacts on commands very sloooow.

Now I trying to get a wireless card working.

add: at high load via wireless kernel hangs here:
arch/mips/rb/rb400/irq.c:

static inline void rb400_flush_pci_to_memory(void)
{
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1)); <----------- this loop forever
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1));
}

if I comment out this function at irq handler, the kernel complains on a PCI error.

(Last edited by bitbucket on 5 Jun 2008, 14:57)

Is the available code for the AR7100 (Mikrotik patches and Ethernet driver) ready to be integrated into the standard OpenWRT build system? Has anyone attempted to do so?  In particular I am wanting  support for the RouterBoard 450.

If no one has done this work yet and the code is ready, then I will be attempting to do so this week but I don't want to duplicate effort.

I think the main problem is the pci/irq issue that bitbucket has reported.  You may find some code for this hardware here

bitbucket wrote:

add: at high load via wireless kernel hangs here:
arch/mips/rb/rb400/irq.c:

static inline void rb400_flush_pci_to_memory(void)
{
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1)); <----------- this loop forever
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1));
}

if I comment out this function at irq handler, the kernel complains on a PCI error.

Have you tried to terminate the while after some loops (1000 is just a wild guess)?

static inline void rb400_flush_pci_to_memory(void)
{
        int limit;
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        limit=1000;
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1) && limit-- > 0);
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        limit=1000;
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1) && limit-- > 0);
}
jal2 wrote:
static inline void rb400_flush_pci_to_memory(void)
{
        int limit;
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        limit=1000;
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1) && limit-- > 0);
        rb400_writel(1, REG_DDR_PCI_FLUSH);
        limit=1000;
        while ((rb400_readl(REG_DDR_PCI_FLUSH) & 0x1) && limit-- > 0);
}

Will be "PCI Error ... " from ops-rb400.c/rb400_check_error()

bitbucket wrote:

Will be "PCI Error ... " from ops-rb400.c/rb400_check_error()

Too bad sad
I wonder if this is the PCI bug brainslayer talked about in the
DD-WRT forum (German only, posting from Mon May 26, 2008 11:31 pm)
recently. He mentioned a "severe CPU/PCI bus bug limiting the PCI throughput" confirmed by Atheros. Anyhow he seems to be a bit biased against Mikrotik products.

Has anyone already bugged Atheros (and Mikrotik?) about this issue (together with the question for datasheets, errata etc. for the AR71xx)?

(Last edited by jal2 on 13 Jun 2008, 07:40)

jal2 wrote:

Has anyone already bugged Atheros (and Mikrotik?) about this issue (together with the question for datasheets, errata etc. for the AR71xx)?

I did.  They should both be reading this tread.

(Last edited by acoul on 13 Jun 2008, 09:32)

Btw, Mikrotik solved this problem: they routeros works on high pps load.

bitbucket wrote:

Btw, Mikrotik solved this problem: they routeros works on high pps load.

that's why they are hiding the patches.....
They are selling already their products while the others are behind.

(Last edited by Slammer on 14 Jun 2008, 09:58)

Sorry, posts 76 to 75 are missing from our archive.