Fredrik Pettai | 16 May 2009 13:13
Favicon

Crosscompiling NetBSD for Fonera not working with HEAD?

I got a old FON2100 from a friend and thought it would be fun to try  
runing NetBSD on it.
I searched and found this old thread: http://mail-index.netbsd.org/port-evbmips/2008/01/23/msg000012.html
So I looked at the Changelog, and HEAD seems to have gotten at least  
ath(4) and HAL updated in HEAD.
However, then I crosscompile the MERAKI kernel, it fails due to a  
missing file (from HAL i believe):

/usr/src/sys/arch/mips/atheros/ar5315.c:72:75: error: contrib/dev/ath/ 
ah_soc.h : No such file or directory
nbmkdep: compile failed.

More verbose output below.

#./build.sh -m evbmips-eb kernel=MERAKI
...
#    create  MERAKI/ar5315.d
CC=/usr/src/tooldir.NetBSD-5.0_RC4-i386/bin/mipseb--netbsd-gcc /usr/ 
src/tooldir.NetBSD-5.0_RC4-i386/bin/nbmkdep -f ar5315.d --  -G 0 -mno- 
abicalls -msoft-float -ffixed-23 -ffreestanding -fno-zero-initialized- 
in-bss -g -Os -std=gnu99 -fno-strict-aliasing   -Werror -Wall -Wno- 
main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes - 
Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno- 
unreachable-code -Wno-sign-compare -Wno-pointer-sign -Wno-attributes  - 
Werror    -Devbmips -I.  -I/usr/src/sys/../common/include -I/usr/src/ 
sys/arch  -I/usr/src/sys -nostdinc -DMIPS3_ENABLE_CLOCK_INTR -DMIPS32 - 
DSOFTFLOAT -DVNODE_OP_NOINLINE -DDIAGNOSTIC -DMAXUSERS=32 -D_KERNEL - 
D_KERNEL_OPT -I/usr/src/sys/lib/libkern/../../../common/lib/libc/quad - 
I/usr/src/sys/lib/libkern/../../../common/lib/libc/string -I/usr/src/ 
sys/lib/libkern/../../../common/lib/libc/arch/mips/string   -I/usr/src/ 
(Continue reading)

David Young | 16 May 2009 21:34
Picon
Favicon

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

On Sat, May 16, 2009 at 01:13:04PM +0200, Fredrik Pettai wrote:
> I got a old FON2100 from a friend and thought it would be fun to try  
> runing NetBSD on it.

Cool!  I've run NetBSD on the Meraki, but never on a Fonera.

> I searched and found this old thread: http://mail-index.netbsd.org/port-evbmips/2008/01/23/msg000012.html
> So I looked at the Changelog, and HEAD seems to have gotten at least  
> ath(4) and HAL updated in HEAD.
> However, then I crosscompile the MERAKI kernel, it fails due to a  
> missing file (from HAL i believe):
>
> /usr/src/sys/arch/mips/atheros/ar5315.c:72:75: error: contrib/dev/ath/ 
> ah_soc.h : No such file or directory
> nbmkdep: compile failed.

It seems that the file has moved to
src/sys/external/isc/atheros_hal/dist/ah_soc.h.

I think that you need to change the #include line to #include
"ah_soc.h", and to make sure that the kernel configuration
includes sys/external/isc/atheros_hal/conf/files.ath_hal and
sys/external/isc/atheros_hal/conf/std.ath_hal in one way or another.
You can use the i386 kernel configuration as an example:

% grep external sys/arch/i386/conf/*
sys/arch/i386/conf/std.i386:include "external/isc/atheros_hal/conf/std.ath_hal"

% grep files.ath_hal sys/conf/*
sys/conf/files:include "external/isc/atheros_hal/conf/files.ath_hal"
(Continue reading)

Fredrik Pettai | 17 May 2009 23:44
Favicon

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

On May 16, 2009, at 9:34 PM, David Young wrote:
> On Sat, May 16, 2009 at 01:13:04PM +0200, Fredrik Pettai wrote:
>> I got a old FON2100 from a friend and thought it would be fun to try
>> runing NetBSD on it.
>
> Cool!  I've run NetBSD on the Meraki, but never on a Fonera.
>
>> I searched and found this old thread: http://mail-index.netbsd.org/port-evbmips/2008/01/23/msg000012.html
>> So I looked at the Changelog, and HEAD seems to have gotten at least
>> ath(4) and HAL updated in HEAD.
>> However, then I crosscompile the MERAKI kernel, it fails due to a
>> missing file (from HAL i believe):
>>
>> /usr/src/sys/arch/mips/atheros/ar5315.c:72:75: error: contrib/dev/ 
>> ath/
>> ah_soc.h : No such file or directory
>> nbmkdep: compile failed.
>
> It seems that the file has moved to
> src/sys/external/isc/atheros_hal/dist/ah_soc.h.
>
> I think that you need to change the #include line to #include
> "ah_soc.h", and to make sure that the kernel configuration
> includes sys/external/isc/atheros_hal/conf/files.ath_hal and
> sys/external/isc/atheros_hal/conf/std.ath_hal in one way or another.
> You can use the i386 kernel configuration as an example:
>
> % grep external sys/arch/i386/conf/*
> sys/arch/i386/conf/std.i386:include "external/isc/atheros_hal/conf/ 
> std.ath_hal"
(Continue reading)

Arnaud Lacombe | 18 May 2009 23:56
Picon
Gravatar

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

Hi,

This is due to the -Wl,--fatal-warnings flags passed to ld(1). This
seems to be a known issue:

share/mk/bsd.sys.mk:
 Set linker warnings to be fatal
# XXX no proper way to avoid "FOO is a patented algorithm" warnings
# XXX on linking static libs
.if (!defined(MKPIC) || ${MKPIC} != "no") && \
    (!defined(LDSTATIC) || ${LDSTATIC} != "-static")
LDFLAGS+=       -Wl,--fatal-warnings
.endif

I wonder why the logic didn't do its job...

Btw, if FOO is not defined, it will expand to "", doesn't it ? So what
is the point of the !defined() check ?

 - Arnaud

On Sun, May 17, 2009 at 5:44 PM, Fredrik Pettai <pettai <at> nordu.net> wrote:
> On May 16, 2009, at 9:34 PM, David Young wrote:
>>
>> On Sat, May 16, 2009 at 01:13:04PM +0200, Fredrik Pettai wrote:
>>>
>>> I got a old FON2100 from a friend and thought it would be fun to try
>>> runing NetBSD on it.
>>
>> Cool!  I've run NetBSD on the Meraki, but never on a Fonera.
(Continue reading)

Fredrik Pettai | 22 May 2009 16:58
Favicon

Re: Crosscompiling NetBSD for Fonera (mips) not working with HEAD?

Hello,

I had problems building release with "LDSTATIC=-static" on an older  
NetBSD machine, so I updated everything to current (HEAD) just to  
verify if those problems where fixed. But now I got problems building  
release due to librump:

# ./build.sh -m evbmips-eb tools
...
# echo "LDSTATIC=-static" >> /etc/mk.conf
# ./build.sh -m evbmips-eb -u release
...
#   compile  librump/intr.o
/usr/src/tooldir.NetBSD-5.99.11-i386/bin/mipseb--netbsd-gcc -O2 - 
ffreestanding -fno-strict-aliasing -Wno-pointer-sign -Wall -Wstrict- 
prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno- 
traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow - 
Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter  -Werror   -I/ 
usr/src/lib/librump/../../sys/rump/include  -D_RUMPKERNEL -D_KERNEL - 
DMULTIPROCESSOR -D_MODULE -DMODULAR -DMAXUSERS=32 -DDIAGNOSTIC - 
DCOMPAT_50 -DDEBUGPRINT -I/usr/src/lib/librump -I. -I/usr/src/lib/ 
librump/../../sys/rump/../../common/include -I/usr/src/lib/ 
librump/../../sys/rump/../arch -I/usr/src/lib/librump/../../sys/rump/ 
include -I/usr/src/lib/librump/../../sys/rump/librump/rumpkern/opt - 
nostdinc -I/usr/src/lib/librump/../../sys/rump/.. -I/usr/src/lib/ 
librump/../../sys/rump/librump/rumpkern -I/usr/src/lib/librump/../../ 
sys/rump/librump/rumpnet -I/usr/src/lib/librump/../../sys/rump/librump/ 
rumpvfs -I/usr/src/lib/librump/../../sys/rump/../lib/libkern/arch/ 
mips   -I/usr/src/lib/librump/../../sys/rump/../lib/libkern/../../../ 
common/lib/libc/quad -I/usr/src/lib/librump/../../sys/rump/../lib/ 
(Continue reading)

Arnaud Lacombe | 16 May 2009 21:42
Picon
Gravatar

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

Hi David,

Yes, this fix the kernel build. This change need also to be made in a
couple or others files/headers (cf patch attached). I don't think any
of these files include `ah_soc.h' for HAL related purpose, cf the XXX
comment found in one of them:

#include <contrib/dev/ath/ah_soc.h>    /* XXX really doesn't belong in hal */

The HAL itself builds fine and is already included.

 - Arnaud

On Sat, May 16, 2009 at 3:34 PM, David Young <dyoung <at> pobox.com> wrote:
> On Sat, May 16, 2009 at 01:13:04PM +0200, Fredrik Pettai wrote:
>> I got a old FON2100 from a friend and thought it would be fun to try
>> runing NetBSD on it.
>
> Cool!  I've run NetBSD on the Meraki, but never on a Fonera.
>
>> I searched and found this old thread: http://mail-index.netbsd.org/port-evbmips/2008/01/23/msg000012.html
>> So I looked at the Changelog, and HEAD seems to have gotten at least
>> ath(4) and HAL updated in HEAD.
>> However, then I crosscompile the MERAKI kernel, it fails due to a
>> missing file (from HAL i believe):
>>
>> /usr/src/sys/arch/mips/atheros/ar5315.c:72:75: error: contrib/dev/ath/
>> ah_soc.h : No such file or directory
>> nbmkdep: compile failed.
>
(Continue reading)

Fredrik Pettai | 17 May 2009 21:54
Favicon

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

On May 16, 2009, at 9:42 PM, Arnaud Lacombe wrote:
> Hi David,
>
> Yes, this fix the kernel build. This change need also to be made in a
> couple or others files/headers (cf patch attached). I don't think any
> of these files include `ah_soc.h' for HAL related purpose, cf the XXX
> comment found in one of them:

Yes, that did the trick.

While at the topic of Fon, I not sure which way is the best to flash  
it, and what forthcoming problems I might run into.
The most reasonable guide/up-to-date I found was the one for the  
MERAKI mini.

http://www.cuwin.net/manual/howto/meraki

I guess that this one would work with Fon as well (as you (David)  
mentioned earlier, they are very similar).

There is a comment in the end of this wiki article
(http://www.cuwin.net/manual/howto/meraki#comment-91 
) which mention questions about the root filesystem. I also thought  
about while analyzing the currently installed Fon image via the home- 
built serial cable. Openwrt uses JFFS2, but that doesn't seem to be  
supported by NetBSD (AFAIK). How did you do (with installing the  
userland) on the MERAKI mini?

Re,
/P
(Continue reading)

Fredrik Pettai | 28 Jun 2009 23:17
Favicon

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

On May 17, 2009, at 9:54 PM, Fredrik Pettai wrote:
> On May 16, 2009, at 9:42 PM, Arnaud Lacombe wrote:
>> Hi David,
>>
>> Yes, this fix the kernel build. This change need also to be made in a
>> couple or others files/headers (cf patch attached). I don't think any
>> of these files include `ah_soc.h' for HAL related purpose, cf the XXX
>> comment found in one of them:
>
> Yes, that did the trick.
>
> While at the topic of Fon, I not sure which way is the best to flash  
> it, and what forthcoming problems I might run into.
> The most reasonable guide/up-to-date I found was the one for the  
> MERAKI mini.

Picking up this thread now that things calm down during the summer.

Well, I got the 5.99.11 kernel booting on one box now. Although there  
is still trouble with the ath0 wifi driver.
(Referring to this old thread: http://mail-index.netbsd.org/port-evbmips/2008/01/23/msg000011.html)

However, the HAL status is now Unknown instead of Atheros 2315 WiSoC.

RedBoot> go
MIPS32/64 params: cpu arch: 32
MIPS32/64 params: TLB entries: 16
MIPS32/64 params: Icache: line = 16, total = 16384, ways = 4
                  sets = 256
MIPS32/64 params: Dcache: line = 16, total = 16384, ways = 4
(Continue reading)

Arnaud Lacombe | 29 Jun 2009 01:23
Picon
Gravatar

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

On Sun, Jun 28, 2009 at 5:17 PM, Fredrik Pettai<pettai <at> nordu.net> wrote:
> Memory size: 0x01000000
> Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
>    2006, 2007, 2008, 2009
>    The NetBSD Foundation, Inc.  All rights reserved.
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>    The Regents of the University of California.  All rights reserved.
>
> NetBSD 5.99.11 (FON2100) #0: Sun Jun 28 22:58:42 CEST 2009
>        root <at> netbsd5.99.11:/usr/obj/sys/arch/evbmips/compile/FON2100
> Atheros AR2315
> total memory = 16384 KB
> avail memory = 12984 KB
> mainbus0 (root)
> cpu0 at mainbus0: 184.00MHz (hz cycles = 920000, delay divisor = 92)
> cpu0: MIPS 4KEc (Rev 2) (0x19064) Rev. 100 with software emulated floating
> point
> cpu0: 16KB/16B 4-way set-associative L1 Instruction cache, 16 TLB entries
> cpu0: 16KB/16B 4-way set-associative write-back L1 Data cache
> wdog0 at mainbus0: 5 second period
> arbus0 at mainbus0
> com0 at arbus0 addr 0x11100000 cpu irq 0 misc irq 0: ns16550a, working fifo
> com0: console
> ae0 at arbus0 addr 0x10500000 cpu irq 2: Atheros AR531X 10/100 Ethernet
> ae0: Ethernet address 00:18:84:1b:65:10
> ukphy0 at ae0 phy 0: Generic IEEE 802.3u media interface
> ukphy0: AC101L 10/100 media interface (OUI 0x0010a9, model 0x0012), rev. 1
> ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
> ae0: WARNING: powerhook_establish is deprecated
> ath0 at arbus0 addr 0x10000000 cpu irq 1: Unknown AR531X WLAN
(Continue reading)

Fredrik Pettai | 28 Jun 2009 23:56
Favicon

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

On Jun 28, 2009, at 11:17 PM, Fredrik Pettai wrote:
> On May 17, 2009, at 9:54 PM, Fredrik Pettai wrote:
>> On May 16, 2009, at 9:42 PM, Arnaud Lacombe wrote:
>>> Hi David,
>>>
>>> Yes, this fix the kernel build. This change need also to be made  
>>> in a
>>> couple or others files/headers (cf patch attached). I don't think  
>>> any
>>> of these files include `ah_soc.h' for HAL related purpose, cf the  
>>> XXX
>>> comment found in one of them:
>>
>> Yes, that did the trick.
>>
>> While at the topic of Fon, I not sure which way is the best to  
>> flash it, and what forthcoming problems I might run into.
>> The most reasonable guide/up-to-date I found was the one for the  
>> MERAKI mini.
>
> Picking up this thread now that things calm down during the summer.
>
> Well, I got the 5.99.11 kernel booting on one box now. Although  
> there is still trouble with the ath0 wifi driver.
> (Referring to this old thread: http://mail-index.netbsd.org/port-evbmips/2008/01/23/msg000011.html)
>
> However, the HAL status is now Unknown instead of Atheros 2315 WiSoC.

I just tested a fresh NetBSD 5.99.14 built kernel and it give me  
almost the same error:
(Continue reading)

Arnaud Lacombe | 29 Jun 2009 02:07
Picon
Gravatar

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

Hi,

On Sun, Jun 28, 2009 at 5:56 PM, Fredrik Pettai<pettai <at> nordu.net> wrote:
> ath0 at arbus0 addr 0x10000000 cpu irq 1: Unknown AR531X WLAN
> ath0: unable to attach hardware; HAL status 3221368608
> ath0: ath_attach failed
>
can you please build a MERAKI kernel with:

options ATHHAL_DEBUG

in the config file to try to get more info from the HAL ?

Thanks,

 - Arnaud

Fredrik Pettai | 29 Jun 2009 05:22
Favicon

Re: Crosscompiling NetBSD for Fonera not working with HEAD?

Hi,

On Jun 29, 2009, at 2:07 AM, Arnaud Lacombe wrote:
> Hi,
>
> On Sun, Jun 28, 2009 at 5:56 PM, Fredrik Pettai<pettai <at> nordu.net>  
> wrote:
>> ath0 at arbus0 addr 0x10000000 cpu irq 1: Unknown AR531X WLAN
>> ath0: unable to attach hardware; HAL status 3221368608
>> ath0: ath_attach failed
>>
> can you please build a MERAKI kernel with:
>
> options ATHHAL_DEBUG
>
> in the config file to try to get more info from the HAL ?

That by itself didn't give any more information.

However, I looked around in the conf files and noted that in sys/ 
external/isc/atheros_hal/conf/std.ath_hal, these lines were commented  
out:

#options ATHHAL_AR5312
#options ATHHAL_AR2316
#options ATHHAL_AR2317

So I removed the comments, and now the kernel recognize the WiSoc  
2315, but crashes afterwards:

(Continue reading)


Gmane