Re: Crosscompiling NetBSD for Fonera not working with HEAD?

Arnaud Lacombe <[email protected]> Sat, 16 May 2009 15:42:30 -0400
Newsgroups gmane.os.netbsd.ports.evbmips
Message-ID <[email protected]>
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 <[email protected]> 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"
>
> % grep files.ath_hal sys/conf/*
> sys/conf/files:include "external/isc/atheros_hal/conf/files.ath_hal"
>
> Let me know if you need more help.
>
> Dave
>
> --
> David Young             OJC Technologies
> [email protected]      Urbana, IL * (217) 278-3933
>
MERAKI-ah_soc.h-fix.diff (text/x-diff, 3 KB)
diff --git a/sys/arch/mips/atheros/ar5312_board.c b/sys/arch/mips/atheros/ar5312_board.c
index d4baa17..7bee224 100644
--- a/sys/arch/mips/atheros/ar5312_board.c
+++ b/sys/arch/mips/atheros/ar5312_board.c
@@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: ar5312_board.c,v 1.1 2006/09/26 06:37:32 gdamore Exp
 #include <mips/atheros/include/ar5312reg.h>
 #include <mips/atheros/include/ar531xvar.h>
 
-#include <contrib/dev/ath/ah_soc.h>
+#include <external/isc/atheros_hal/dist/ah_soc.h>
 
 extern const char *ether_sprintf(const uint8_t *);
 
diff --git a/sys/arch/mips/atheros/ar5315.c b/sys/arch/mips/atheros/ar5315.c
index 3d2c118..94af273 100644
--- a/sys/arch/mips/atheros/ar5315.c
+++ b/sys/arch/mips/atheros/ar5315.c
@@ -69,7 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: ar5315.c,v 1.5 2008/01/23 05:23:59 dyoung Exp $");
 
 #include <prop/proplib.h>
 
-#include <contrib/dev/ath/ah_soc.h>	/* XXX really doesn't belong in hal */
+#include <external/isc/atheros_hal/dist/ah_soc.h>	/* XXX really doesn't belong in hal */
 
 #include <mips/atheros/include/ar5315reg.h>
 #include <mips/atheros/include/ar531xvar.h>
diff --git a/sys/arch/mips/atheros/ar5315_board.c b/sys/arch/mips/atheros/ar5315_board.c
index 548929c..0b962af 100644
--- a/sys/arch/mips/atheros/ar5315_board.c
+++ b/sys/arch/mips/atheros/ar5315_board.c
@@ -66,7 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: ar5315_board.c,v 1.1 2006/09/26 06:37:32 gdamore Exp
 #include <net/if.h>
 #include <net/if_ether.h>
 
-#include <contrib/dev/ath/ah_soc.h>	/* XXX really doesn't belong in hal */
+#include <external/isc/atheros_hal/dist/ah_soc.h>	/* XXX really doesn't belong in hal */
 
 #include <mips/atheros/include/ar5315reg.h>
 #include <mips/atheros/include/ar531xvar.h>
diff --git a/sys/arch/mips/atheros/dev/if_ath_arbus.c b/sys/arch/mips/atheros/dev/if_ath_arbus.c
index c0b0bfe..7aca68b 100644
--- a/sys/arch/mips/atheros/dev/if_ath_arbus.c
+++ b/sys/arch/mips/atheros/dev/if_ath_arbus.c
@@ -64,8 +64,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_ath_arbus.c,v 1.15 2008/07/09 19:47:23 joerg Exp
 #include <dev/pci/pcidevs.h>
 #include <dev/ic/ath_netbsd.h>
 #include <dev/ic/athvar.h>
-#include <contrib/dev/ath/ah.h>
-#include <contrib/dev/ath/ah_soc.h>	/* XXX really doesn't belong in hal */
+#include <external/isc/atheros_hal/dist/ah.h>
+#include <external/isc/atheros_hal/dist/ah_soc.h>	/* XXX really doesn't belong in hal */
 
 struct ath_arbus_softc {
 	struct ath_softc	sc_ath;
diff --git a/sys/arch/mips/atheros/include/ar5312reg.h b/sys/arch/mips/atheros/include/ar5312reg.h
index 27dfbc5..9ac1719 100644
--- a/sys/arch/mips/atheros/include/ar5312reg.h
+++ b/sys/arch/mips/atheros/include/ar5312reg.h
@@ -197,11 +197,12 @@
 #define	AR5312_MISC_IRQ_UART0		4
 #define	AR5312_MISC_IRQ_UART0_DMA	5
 #define	AR5312_MISC_IRQ_WDOG		6
+
 /*
  * Board data.  This is located in flash somewhere, ar531x_board_info
  * locates it.
  */
-#include <contrib/dev/ath/ah_soc.h>	/* XXX really doesn't belong in hal */
+#include <external/isc/atheros_hal/dist/ah_soc.h>	/* XXX really doesn't belong in hal */
 
 /* XXX write-around for now */
 #define	AR5312_BOARD_MAGIC		AR531X_BD_MAGIC