diff options
author | wbx <wbx@openadk.org> | 2011-04-12 19:22:32 +0200 |
---|---|---|
committer | wbx <wbx@openadk.org> | 2011-04-12 19:22:32 +0200 |
commit | 933e74c07231e815bbfd9ed90073308eaf253a00 (patch) | |
tree | f1733a1feb58ecf8f2d51eb9585edd2ee23f648b | |
parent | 0c8fa8e61a481d2d25c55e20c0ebd5176375e623 (diff) | |
parent | 819692c26044aa5bb280a08fa017de9d55ca18b9 (diff) |
resolve merge conflict
-rw-r--r-- | package/gettext/Makefile | 14 | ||||
-rw-r--r-- | package/pcc-libs/Makefile | 29 | ||||
-rw-r--r-- | package/pcc-libs/patches/100-adk.patch | 12 | ||||
-rw-r--r-- | package/pcc-libs/patches/patch-csu_linux_crtbegin_c | 35 | ||||
-rw-r--r-- | package/pcc-libs/patches/patch-csu_linux_crtend_c | 32 | ||||
-rw-r--r-- | package/pcc/Makefile | 46 | ||||
-rw-r--r-- | package/pcc/patches/100-adk.patch | 23 | ||||
-rw-r--r-- | package/pcc/patches/200-cc_ccom_Makefile_in.patch | 33 | ||||
-rw-r--r-- | package/pcc/patches/999-autoconf.patch | 38 | ||||
-rw-r--r-- | target/config/Config.in | 1 | ||||
-rw-r--r-- | target/linux/config/Config.in.netdevice | 14 | ||||
-rw-r--r-- | target/linux/patches/2.6.37/atheros.patch | 6332 | ||||
-rw-r--r-- | target/mips/sys-available/fon-fon2100 | 8 |
13 files changed, 6610 insertions, 7 deletions
diff --git a/package/gettext/Makefile b/package/gettext/Makefile index 665115d06..14d502958 100644 --- a/package/gettext/Makefile +++ b/package/gettext/Makefile @@ -52,24 +52,24 @@ CONFIGURE_ENV+= nls_cv_use_gnu_gettext=yes \ INSTALL_STYLE:= manual -libintl-install: +post-build: + ${INSTALL_DIR} ${STAGING_DIR}/usr/include ${STAGING_DIR}/usr/lib + $(CP) $(WRKBUILD)/gettext-runtime/intl/libintl.h ${STAGING_DIR}/usr/include + ${CP} ${WRKBUILD}/gettext-runtime/intl/.libs/libintl.so* \ + ${STAGING_DIR}/usr/lib + +post-install: ${INSTALL_DIR} ${IDIR_LIBINTL}/usr/lib ${CP} ${WRKBUILD}/gettext-runtime/intl/.libs/libintl.so* \ ${IDIR_LIBINTL}/usr/lib - -libintl-dev-install: ${INSTALL_DIR} ${IDIR_LIBINTL_DEV}/usr/include ${INSTALL_DATA} ${WRKBUILD}/gettext-runtime/intl/libintl.h \ ${IDIR_LIBINTL_DEV}/usr/include - -gettext-install: ${INSTALL_DIR} ${IDIR_GETTEXT}/usr/bin $(INSTALL_BIN) $(WRKBUILD)/gettext-tools/src/.libs/xgettext \ $(IDIR_GETTEXT)/usr/bin $(INSTALL_BIN) $(WRKBUILD)/gettext-runtime/src/.libs/gettext \ $(IDIR_GETTEXT)/usr/bin - -msgfmt-install: ${INSTALL_DIR} ${IDIR_MSGFMT}/usr/bin ${INSTALL_DIR} ${IDIR_MSGFMT}/usr/lib ${CP} ${WRKBUILD}/gettext-tools/libgettextpo/.libs/libgettextpo.so* \ diff --git a/package/pcc-libs/Makefile b/package/pcc-libs/Makefile new file mode 100644 index 000000000..9533b97c9 --- /dev/null +++ b/package/pcc-libs/Makefile @@ -0,0 +1,29 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= pcc-libs +PKG_VERSION:= 1.0.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= a8dfcd6d3be512bc3f16f96c9abf132e +PKG_DESCR:= Runtime for the Portable C Compiler +PKG_SECTION:= lang +PKG_URL:= http://pcc.ludd.ltu.se/ +PKG_SITES:= http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/ + +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz + +include $(TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,PCC_LIBS,pcc-libs,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +# we cross-compile a native compiler for the target system +CONFIGURE_ARGS+= --host=${REAL_GNU_TARGET_NAME} +CONFIGURE_ARGS+= --target=${REAL_GNU_TARGET_NAME} + +pcc-libs-install: + $(INSTALL_DIR) $(IDIR_PCC_LIBS)/usr/bin + cd ${WRKINST} && cp -r * ${IDIR_PCC_LIBS}/ + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/pcc-libs/patches/100-adk.patch b/package/pcc-libs/patches/100-adk.patch new file mode 100644 index 000000000..a588900d9 --- /dev/null +++ b/package/pcc-libs/patches/100-adk.patch @@ -0,0 +1,12 @@ +diff -pur pcc-libs-1.0.0~/csu/linux/Makefile pcc-libs-1.0.0/csu/linux/Makefile +--- pcc-libs-1.0.0.orig/csu/linux/Makefile 2009-08-13 11:16:46.000000000 +0200 ++++ pcc-libs-1.0.0/csu/linux/Makefile 2011-04-07 20:36:10.068600370 +0200 +@@ -4,7 +4,7 @@ VERSION ?= 0.9.9 + PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib + SRCDIR ?= . + +-CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes ++CFLAGS += -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes + + OBJS = crt0.o crt1.o gcrt1.o crti.o crtn.o crtbegin.o crtend.o + diff --git a/package/pcc-libs/patches/patch-csu_linux_crtbegin_c b/package/pcc-libs/patches/patch-csu_linux_crtbegin_c new file mode 100644 index 000000000..a4f9777b3 --- /dev/null +++ b/package/pcc-libs/patches/patch-csu_linux_crtbegin_c @@ -0,0 +1,35 @@ +--- pcc-libs-1.0.0.orig/csu/linux/crtbegin.c 2009-08-17 01:07:07.000000000 +0200 ++++ pcc-libs-1.0.0/csu/linux/crtbegin.c 2011-04-12 08:36:48.951412645 +0200 +@@ -1,4 +1,4 @@ +-/* $Id: crtbegin.c,v 1.6 2009/08/16 23:07:07 gmcgarry Exp $ */ ++/* $Id: crtbegin.c,v 1.7 2011/04/12 04:44:19 gmcgarry Exp $ */ + /*- + * Copyright (c) 1998, 2001, 2002 The NetBSD Foundation, Inc. + * All rights reserved. +@@ -40,16 +40,16 @@ void __do_global_dtors_aux(void); + extern void (*__CTOR_LIST__[1])(void); + extern void (*__DTOR_LIST__[1])(void); + +-asm( " .section .ctors\n" +- " .align 2\n" ++asm( " .section .ctors,\"aw\",@progbits\n" ++ " .align 4\n" + "__CTOR_LIST__:\n" + #ifdef __x86_64__ + " .quad -1\n" + #else + " .long -1\n" + #endif +- " .section .dtors\n" +- " .align 2\n" ++ " .section .dtors,\"aw\",@progbits\n" ++ " .align 4\n" + "__DTOR_LIST__:\n" + #ifdef __x86_64__ + " .quad -1\n" +@@ -120,4 +120,4 @@ void __call_##func(void) \ + MD_CALL_STATIC_FUNCTION(.init, __do_global_ctors_aux) + MD_CALL_STATIC_FUNCTION(.fini, __do_global_dtors_aux) + +-IDENT("$Id: crtbegin.c,v 1.6 2009/08/16 23:07:07 gmcgarry Exp $"); ++IDENT("$Id: crtbegin.c,v 1.7 2011/04/12 04:44:19 gmcgarry Exp $"); diff --git a/package/pcc-libs/patches/patch-csu_linux_crtend_c b/package/pcc-libs/patches/patch-csu_linux_crtend_c new file mode 100644 index 000000000..257f7138f --- /dev/null +++ b/package/pcc-libs/patches/patch-csu_linux_crtend_c @@ -0,0 +1,32 @@ +--- pcc-libs-1.0.0.orig/csu/linux/crtend.c 2009-08-17 01:07:07.000000000 +0200 ++++ pcc-libs-1.0.0/csu/linux/crtend.c 2011-04-12 08:36:48.951412645 +0200 +@@ -1,4 +1,4 @@ +-/* $Id: crtend.c,v 1.3 2009/08/16 23:07:07 gmcgarry Exp $ */ ++/* $Id: crtend.c,v 1.4 2011/04/12 04:44:19 gmcgarry Exp $ */ + /*- + * Copyright (c) 2008 Gregory McGarry <g.mcgarry@ieee.org> + * +@@ -17,7 +17,7 @@ + + #include "common.h" + +-asm( " .section .ctors\n" ++asm( " .section .ctors,\"aw\",@progbits\n" + #ifdef __x86_64__ + " .quad 0\n" + #else +@@ -25,7 +25,7 @@ asm( " .section .ctors\n" + #endif + ); + +-asm( " .section .dtors\n" ++asm( " .section .dtors,\"aw\",@progbits\n" + #ifdef __x86_64__ + " .quad 0\n" + #else +@@ -33,4 +33,4 @@ asm( " .section .dtors\n" + #endif + ); + +-IDENT("$Id: crtend.c,v 1.3 2009/08/16 23:07:07 gmcgarry Exp $"); ++IDENT("$Id: crtend.c,v 1.4 2011/04/12 04:44:19 gmcgarry Exp $"); diff --git a/package/pcc/Makefile b/package/pcc/Makefile new file mode 100644 index 000000000..a20d3dece --- /dev/null +++ b/package/pcc/Makefile @@ -0,0 +1,46 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= pcc +PKG_VERSION:= 1.0.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 6e5d851ee57fe58702fe4e80ecd1f852 +PKG_DESCR:= Portable C Compiler +PKG_SECTION:= lang +PKG_DEPENDS:= pcc-libs +# binutils +PKG_URL:= http://pcc.ludd.ltu.se/ +PKG_SITES:= http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/ +PKG_NOPARALLEL:= 1 + +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz + +include $(TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,PCC,pcc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +# we cross-compile a native compiler for the target system +CONFIGURE_ARGS+= --host=${REAL_GNU_TARGET_NAME} +CONFIGURE_ARGS+= --target=${REAL_GNU_TARGET_NAME} +CONFIGURE_ARGS+= --with-assembler=/usr/bin/as +CONFIGURE_ARGS+= --with-linker=/usr/bin/ld + +ifeq ($(ADK_TARGET_LIB_GLIBC),y) +TARGET_CPPFLAGS+= -DADK_FOR_GLIBC +else +ifeq ($(ADK_TARGET_LIB_EGLIBC),y) +TARGET_CPPFLAGS+= -DADK_FOR_GLIBC +else +ifeq ($(ADK_TARGET_LIB_UCLIBC),y) +TARGET_CPPFLAGS+= -DADK_FOR_UCLIBC +endif +endif +endif + +pcc-install: + $(INSTALL_DIR) $(IDIR_PCC) + cd ${WRKINST} && cp -r * ${IDIR_PCC}/ + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/pcc/patches/100-adk.patch b/package/pcc/patches/100-adk.patch new file mode 100644 index 000000000..fe2143dd8 --- /dev/null +++ b/package/pcc/patches/100-adk.patch @@ -0,0 +1,23 @@ +Index: os/linux/ccconfig.h +=================================================================== +RCS file: /cvsroot/pcc/os/linux/ccconfig.h,v +retrieving revision 1.19 +diff -u -p -r1.19 ccconfig.h +--- a/os/linux/ccconfig.h 9 Nov 2010 08:40:50 -0000 1.19 ++++ b/os/linux/ccconfig.h 2 Apr 2011 14:19:17 -0000 +@@ -67,6 +67,15 @@ + #error defines for arch missing + #endif + ++#ifdef ADK_FOR_UCLIBC ++#undef DYNLINKER ++#define DYNLINKER { "-dynamic-linker", "/lib/ld-uClibc.so.0", NULL } ++#elif defined(ADK_FOR_GLIBC) ++/* see above */ ++#else ++#error What now? ++#endif ++ + #ifndef LIBDIR + #define LIBDIR "/usr/lib/" + #endif diff --git a/package/pcc/patches/200-cc_ccom_Makefile_in.patch b/package/pcc/patches/200-cc_ccom_Makefile_in.patch new file mode 100644 index 000000000..31e051edd --- /dev/null +++ b/package/pcc/patches/200-cc_ccom_Makefile_in.patch @@ -0,0 +1,33 @@ +$MirOS: ports/lang/pcc/patches/patch-cc_ccom_Makefile_in,v 1.4 2011/04/02 17:45:46 tg Exp $ + + • fix missing @CPPFLAGS@ + • fix cross-compiling + +--- a/cc/ccom/Makefile.in.orig Sun Apr 11 15:00:40 2010 ++++ b/cc/ccom/Makefile.in Sat Apr 2 17:43:44 2011 +@@ -11,9 +11,14 @@ XFL=-DPCC_DEBUG + CC = @CC@ + EXEEXT = @EXEEXT@ + CC_FOR_BUILD = @CC_FOR_BUILD@ ++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ ++CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ -D_ISOC99_SOURCE \ ++ @ADD_CPPFLAGS@ ${XFL} -Dos_${TARGOS} -Dmach_${TARGMACH} \ ++ -I${srcdir} -I${builddir} -I${top_builddir} -I${MIPDIR} -I${MDIR} \ ++ -I${top_srcdir}/os/${TARGOS} + _CFLAGS = @CFLAGS@ + CFLAGS = $(_CFLAGS) @ADD_CFLAGS@ +-CPPFLAGS = @ADD_CPPFLAGS@ ${XFL} -Dos_${TARGOS} -Dmach_${TARGMACH} \ ++CPPFLAGS = @CPPFLAGS@ @ADD_CPPFLAGS@ ${XFL} -Dos_${TARGOS} -Dmach_${TARGMACH} \ + -D_ISOC99_SOURCE \ + -I${srcdir} -I${builddir} -I${top_builddir} -I${MIPDIR} -I${MDIR} \ + -I${top_srcdir}/os/${TARGOS} +@@ -92,7 +97,8 @@ compat.o: $(MIPDIR)/compat.c external.h + $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(MIPDIR)/compat.c + + external.h external.c: ${MIPDIR}/mkext.c $(MDIR)/table.c +- $(CC_FOR_BUILD) $(DEFS) $(CPPFLAGS) $(CFLAGS) -DMKEXT -o mkext \ ++ $(CC_FOR_BUILD) $(DEFS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) \ ++ -DMKEXT -o mkext \ + ${MIPDIR}/mkext.c $(MDIR)/table.c ${MIPDIR}/common.c + ./mkext + diff --git a/package/pcc/patches/999-autoconf.patch b/package/pcc/patches/999-autoconf.patch new file mode 100644 index 000000000..531b5291b --- /dev/null +++ b/package/pcc/patches/999-autoconf.patch @@ -0,0 +1,38 @@ +--- a/configure Fri Apr 1 13:58:07 2011 ++++ b/configure Sat Apr 2 19:21:15 2011 +@@ -672,6 +672,8 @@ ac_ct_CC + EXEEXT + OBJEXT + CC_FOR_BUILD ++CPPFLAGS_FOR_BUILD ++CFLAGS_FOR_BUILD + CPP + GREP + EGREP +@@ -3292,6 +3294,8 @@ else + echo "${ECHO_T}not cross compiling" >&6; } + CC_FOR_BUILD=${CC-cc} + ++ test -n "$CPPFLAGS_FOR_BUILD" || CPPFLAGS_FOR_BUILD=$CPPFLAGS ++ test -n "$CFLAGS_FOR_BUILD" || CFLAGS_FOR_BUILD=$CFLAGS + fi + + +@@ -5765,6 +5769,8 @@ ac_ct_CC!$ac_ct_CC$ac_delim + EXEEXT!$EXEEXT$ac_delim + OBJEXT!$OBJEXT$ac_delim + CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim ++CPPFLAGS_FOR_BUILD!$CPPFLAGS_FOR_BUILD$ac_delim ++CFLAGS_FOR_BUILD!$CFLAGS_FOR_BUILD$ac_delim + CPP!$CPP$ac_delim + GREP!$GREP$ac_delim + EGREP!$EGREP$ac_delim +@@ -5787,7 +5793,7 @@ LIBOBJS!$LIBOBJS$ac_delim + LTLIBOBJS!$LTLIBOBJS$ac_delim + _ACEOF + +- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then ++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 80; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/target/config/Config.in b/target/config/Config.in index 6fee28c9e..33ae6f44f 100644 --- a/target/config/Config.in +++ b/target/config/Config.in @@ -181,6 +181,7 @@ config ADK_TARGET_CFLAGS config ADK_TARGET_CMDLINE string default "console=tty no_auto_cmd" if ADK_TARGET_SYSTEM_LEMOTE_YEELONG + default "console=ttyS0,9600" if ADK_TARGET_SYSTEM_FON_FON2100 default "console=ttyS0,38400" if ADK_TARGET_SYSTEM_PCENGINES_WRAP default "console=ttyS0,115200 console=tty0 geodewdt.nowayout=1" if ADK_TARGET_SYSTEM_PCENGINES_ALIX1C default "console=ttyS0,115200 console=tty0" if ADK_TARGET_SYSTEM_IBM_X40 diff --git a/target/linux/config/Config.in.netdevice b/target/linux/config/Config.in.netdevice index 5a7dedd14..bbd2990e9 100644 --- a/target/linux/config/Config.in.netdevice +++ b/target/linux/config/Config.in.netdevice @@ -7,6 +7,9 @@ config ADK_KERNEL_NETDEVICES config ADK_KERNEL_NET_ETHERNET boolean +config ADK_KERNEL_PHYLIB + boolean + config ADK_KERNEL_MII boolean @@ -73,6 +76,17 @@ config ADK_KERNEL_VIA_RHINE default n help +config ADK_KERNEL_AR231X_ETHERNET + boolean + select ADK_KERNEL_NETDEVICES + select ADK_KERNEL_NET_ETHERNET + select ADK_KERNEL_NET_PCI + select ADK_KERNEL_MII + select ADK_KERNEL_PHYLIB + default y if ADK_TARGET_SYSTEM_FON_FON2100 + default n + help + config ADK_KERNEL_KORINA boolean select ADK_KERNEL_NETDEVICES diff --git a/target/linux/patches/2.6.37/atheros.patch b/target/linux/patches/2.6.37/atheros.patch new file mode 100644 index 000000000..ee5184a00 --- /dev/null +++ b/target/linux/patches/2.6.37/atheros.patch @@ -0,0 +1,6332 @@ +diff -Nur linux-2.6.37.orig/arch/mips/Kbuild.platforms linux-2.6.37/arch/mips/Kbuild.platforms +--- linux-2.6.37.orig/arch/mips/Kbuild.platforms 2011-01-05 01:50:19.000000000 +0100 ++++ linux-2.6.37/arch/mips/Kbuild.platforms 2011-04-12 08:12:01.000000000 +0200 +@@ -5,6 +5,7 @@ + platforms += bcm47xx + platforms += bcm63xx + platforms += cavium-octeon ++platforms += ar231x + platforms += cobalt + platforms += dec + platforms += emma +diff -Nur linux-2.6.37.orig/arch/mips/Kconfig linux-2.6.37/arch/mips/Kconfig +--- linux-2.6.37.orig/arch/mips/Kconfig 2011-01-05 01:50:19.000000000 +0100 ++++ linux-2.6.37/arch/mips/Kconfig 2011-04-12 08:12:01.000000000 +0200 +@@ -102,6 +102,20 @@ + help + Support for BCM63XX based boards + ++config ATHEROS_AR231X ++ bool "Atheros 231x/531x SoC support" ++ select CEVT_R4K ++ select CSRC_R4K ++ select DMA_NONCOHERENT ++ select IRQ_CPU ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select GENERIC_GPIO ++ select SYS_HAS_EARLY_PRINTK ++ help ++ Support for AR231x and AR531x based boards ++ + config MIPS_COBALT + bool "Cobalt Server" + select CEVT_R4K +@@ -716,6 +730,7 @@ + + endchoice + ++source "arch/mips/ar231x/Kconfig" + source "arch/mips/alchemy/Kconfig" + source "arch/mips/bcm63xx/Kconfig" + source "arch/mips/jazz/Kconfig" +diff -Nur linux-2.6.37.orig/arch/mips/ar231x/Kconfig linux-2.6.37/arch/mips/ar231x/Kconfig +--- linux-2.6.37.orig/arch/mips/ar231x/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.37/arch/mips/ar231x/Kconfig 2011-04-12 08:12:33.000000000 +0200 +@@ -0,0 +1,27 @@ ++config ATHEROS_AR5312 ++ bool "Atheros 5312/2312+ support" ++ depends on ATHEROS_AR231X ++ default y ++ ++config ATHEROS_AR2315 ++ bool "Atheros 2315+ support" ++ depends on ATHEROS_AR231X ++ select DMA_NONCOHERENT ++ select CEVT_R4K ++ select CSRC_R4K ++ select IRQ_CPU ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_SUPPORTS_BIG_ENDIAN ++ select GENERIC_GPIO ++ default y ++ ++config ATHEROS_AR2315_PCI ++ bool "PCI support" ++ depends on ATHEROS_AR2315 ++ select HW_HAS_PCI ++ select PCI ++ select USB_ARCH_HAS_HCD ++ select USB_ARCH_HAS_OHCI ++ select USB_ARCH_HAS_EHCI ++ default y +diff -Nur linux-2.6.37.orig/arch/mips/ar231x/Makefile linux-2.6.37/arch/mips/ar231x/Makefile +--- linux-2.6.37.orig/arch/mips/ar231x/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.37/arch/mips/ar231x/Makefile 2011-04-12 08:12:01.000000000 +0200 +@@ -0,0 +1,17 @@ ++# ++# This file is subject to the terms and conditions of the GNU General Public ++# License. See the file "COPYING" in the main directory of this archive ++# for more details. ++# ++# Copyright (C) 2006 FON Technology, SL. ++# Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org> ++# Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org> ++# ++ ++obj-y += board.o prom.o devices.o ++ ++obj-$(CONFIG_EARLY_PRINTK) += early_printk.o ++ ++obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o ++obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o ++obj-$(CONFIG_ATHEROS_AR2315_PCI) += pci.o +diff -Nur linux-2.6.37.orig/arch/mips/ar231x/Platform linux-2.6.37/arch/mips/ar231x/Platform +--- linux-2.6.37.orig/arch/mips/ar231x/Platform 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.37/arch/mips/ar231x/Platform 2011-04-12 08:12:01.000000000 +0200 +@@ -0,0 +1,6 @@ ++# ++# Atheros AR5312/AR2312 WiSoC ++# ++platform-$(CONFIG_ATHEROS_AR231X) += ar231x/ ++cflags-$(CONFIG_ATHEROS_AR231X) += -I$(srctree)/arch/mips/include/asm/mach-ar231x ++load-$(CONFIG_ATHEROS_AR231X) += 0xffffffff80041000 +diff -Nur linux-2.6.37.orig/arch/mips/ar231x/ar2315.c linux-2.6.37/arch/mips/ar231x/ar2315.c +--- linux-2.6.37.orig/arch/mips/ar231x/ar2315.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.37/arch/mips/ar231x/ar2315.c 2011-04-12 08:12:01.000000000 +0200 +@@ -0,0 +1,683 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved. ++ * Copyright (C) 2006 FON Technology, SL. ++ * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org> ++ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> ++ */ ++ ++/* ++ * Platform devices for Atheros SoCs ++ */ ++ ++#include <generated/autoconf.h> ++#include <linux/init.h> ++#include <linux/module.h> ++#include <linux/types.h> ++#include <linux/string.h> ++#include <linux/platform_device.h> ++#include <linux/kernel.h> ++#include <linux/reboot.h> ++#include <linux/delay.h> ++#include <linux/leds.h> ++#include <asm/bootinfo.h> ++#include <asm/reboot.h> ++#include <asm/time.h> ++#include <asm/irq.h> ++#include <asm/io.h> ++#include <asm/gpio.h> ++ ++#include <ar231x_platform.h> ++#include <ar2315_regs.h> ++#include <ar231x.h> ++#include "devices.h" ++#include "ar2315.h" ++ ++static u32 gpiointmask = 0, gpiointval = 0; ++ ++static inline void ar2315_gpio_irq(void) ++{ ++ u32 pend; ++ int bit = -1; ++ ++ /* only do one gpio interrupt at a time */ ++ pend = (ar231x_read_reg(AR2315_GPIO_DI) ^ gpiointval) & gpiointmask; ++ ++ if (pend) { ++ bit = fls(pend) - 1; ++ pend &= ~(1 << bit); ++ gpiointval ^= (1 << bit); ++ } ++ ++ if (!pend) ++ ar231x_write_reg(AR2315_ISR, AR2315_ISR_GPIO); ++ ++ /* Enable interrupt with edge detection */ ++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(bit)) != AR2315_GPIO_CR_I(bit)) ++ return; ++ ++ if (bit >= 0) ++ do_IRQ(AR531X_GPIO_IRQ_BASE + bit); ++} ++ ++#ifdef CONFIG_ATHEROS_AR2315_PCI ++static inline void pci_abort_irq(void) ++{ ++ ar231x_write_reg(AR2315_PCI_INT_STATUS, AR2315_PCI_ABORT_INT); ++} ++ ++static inline void pci_ack_irq(void) ++{ ++ ar231x_write_reg(AR2315_PCI_INT_STATUS, AR2315_PCI_EXT_INT); ++} ++ ++void ar2315_pci_irq(int irq) ++{ ++ if (ar231x_read_reg(AR2315_PCI_INT_STATUS) == AR2315_PCI_ABORT_INT) ++ pci_abort_irq(); ++ else { ++ do_IRQ(irq); ++ pci_ack_irq(); ++ } ++} ++#endif /* CONFIG_ATHEROS_AR2315_PCI */ ++ ++/* ++ * Called when an interrupt is received, this function ++ * determines exactly which interrupt it was, and it ++ * invokes the appropriate handler. ++ * ++ * Implicitly, we also define interrupt priority by ++ * choosing which to dispatch first. ++ */ ++static asmlinkage void ++ar2315_irq_dispatch(void) ++{ ++ int pending = read_c0_status() & read_c0_cause(); ++ ++ if (pending & CAUSEF_IP3) ++ do_IRQ(AR2315_IRQ_WLAN0_INTRS); ++ else if (pending & CAUSEF_IP4) ++ do_IRQ(AR2315_IRQ_ENET0_INTRS); ++#ifdef CONFIG_ATHEROS_AR2315_PCI ++ else if (pending & CAUSEF_IP5) ++ ar2315_pci_irq(AR2315_IRQ_LCBUS_PCI); ++#endif ++ else if (pending & CAUSEF_IP2) { ++ unsigned int misc_intr = ar231x_read_reg(AR2315_ISR) & ar231x_read_reg(AR2315_IMR); ++ ++ if (misc_intr & AR2315_ISR_SPI) ++ do_IRQ(AR531X_MISC_IRQ_SPI); ++ else if (misc_intr & AR2315_ISR_TIMER) ++ do_IRQ(AR531X_MISC_IRQ_TIMER); ++ else if (misc_intr & AR2315_ISR_AHB) ++ do_IRQ(AR531X_MISC_IRQ_AHB_PROC); ++ else if (misc_intr & AR2315_ISR_GPIO) ++ ar2315_gpio_irq(); ++ else if (misc_intr & AR2315_ISR_UART0) ++ do_IRQ(AR531X_MISC_IRQ_UART0); ++ else if (misc_intr & AR2315_ISR_WD) ++ do_IRQ(AR531X_MISC_IRQ_WATCHDOG); ++ else ++ do_IRQ(AR531X_MISC_IRQ_NONE); ++ } else if (pending & CAUSEF_IP7) ++ do_IRQ(AR531X_IRQ_CPU_CLOCK); ++} ++ ++static void ar2315_set_gpiointmask(int gpio, int level) ++{ ++ u32 reg; ++ ++ reg = ar231x_read_reg(AR2315_GPIO_INT); ++ reg &= ~(AR2315_GPIO_INT_M | AR2315_GPIO_INT_LVL_M); ++ reg |= gpio | AR2315_GPIO_INT_LVL(level); ++ ar231x_write_reg(AR2315_GPIO_INT, reg); ++} ++ ++static void ar2315_gpio_intr_enable(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* Enable interrupt with edge detection */ ++ if ((ar231x_read_reg(AR2315_GPIO_CR) & AR2315_GPIO_CR_M(gpio)) != AR2315_GPIO_CR_I(gpio)) ++ return; ++ ++ gpiointmask |= (1 << gpio); ++ ar2315_set_gpiointmask(gpio, 3); ++} ++ ++static unsigned int ar2315_gpio_intr_startup(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* reconfigure GPIO line as input */ ++ ar231x_mask_reg(AR2315_GPIO_CR, AR2315_GPIO_CR_M(gpio), AR2315_GPIO_CR_I(gpio)); ++ ar2315_gpio_intr_enable(irq); ++ return 0; ++} ++ ++static void ar2315_gpio_intr_disable(unsigned int irq) ++{ ++ unsigned int gpio = irq - AR531X_GPIO_IRQ_BASE; ++ ++ /* Disable interrupt */ ++ gpiointmask &= ~(1 << gpio); ++ ar2315_set_gpiointmask(gpio, 0); ++} ++ ++static void ++ar2315_gpio_intr_end(unsigned int irq) ++{ ++ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) ++ ar2315_gpio_intr_enable(irq); ++} ++ ++static struct irq_chip ar2315_gpio_intr_controller = { ++ .name = "AR2315-GPIO", ++ .startup = ar2315_gpio_intr_startup, ++ .ack = ar2315_gpio_intr_disable, ++ .mask_ack = ar2315_gpio_intr_disable, ++ .mask = ar2315_gpio_intr_disable, ++ .unmask = ar2315_gpio_intr_enable, ++ .end = ar2315_gpio_intr_end, ++}; ++ ++static void ++ar2315_misc_intr_enable(unsigned int irq) ++{ ++ unsigned int imr; ++ ++ imr = ar231x_read_reg(AR2315_IMR); ++ switch(irq) { ++ case AR531X_MISC_IRQ_SPI: ++ imr |= AR2315_ISR_SPI; ++ break; ++ case AR531X_MISC_IRQ_TIMER: ++ imr |= AR2315_ISR_TIMER; ++ break; ++ case AR531X_MISC_IRQ_AHB_PROC: ++ imr |= AR2315_ISR_AHB; ++ break; ++ case AR531X_MISC_IRQ_GPIO: ++ imr |= AR2315_ISR_GPIO; ++ break; ++ case AR531X_MISC_IRQ_UART0: ++ imr |= AR2315_ISR_UART0; ++ break; ++ case AR531X_MISC_IRQ_WATCHDOG: ++ imr |= AR2315_ISR_WD; ++ break; ++ default: ++ break; ++ } ++ ar231x_write_reg(AR2315_IMR, imr); ++} ++ ++static void ++ar2315_misc_intr_disable(unsigned int irq) ++{ ++ unsigned int imr; ++ ++ imr = ar231x_read_reg(AR2315_IMR); ++ switch(irq) { ++ case AR531X_MISC_IRQ_SPI: ++ imr &= ~AR2315_ISR_SPI; ++ break; ++ case AR531X_MISC_IRQ_TIMER: ++ imr &= ~AR2315_ISR_TIMER; ++ break; ++ case AR531X_MISC_IRQ_AHB_PROC: ++ imr &= ~AR2315_ISR_AHB; ++ break; ++ case AR531X_MISC_IRQ_GPIO: ++ imr &= ~AR2315_ISR_GPIO; ++ break; ++ case AR531X_MISC_IRQ_UART0: ++ imr &= ~AR2315_ISR_UART0; ++ break; ++ case AR531X_MISC_IRQ_WATCHDOG: ++ imr &= ~AR2315_ISR_WD; ++ break; ++ default: ++ break; ++ } ++ ar231x_write_reg(AR2315_IMR, imr); ++} ++ ++static void ++ar2315_misc_intr_end(unsigned int irq) ++{ ++ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) ++ ar2315_misc_intr_enable(irq); ++} ++ ++ ++static struct irq_chip ar2315_misc_intr_controller = { ++ .name = "AR2315-MISC", ++ .ack = ar2315_misc_intr_disable, ++ .mask_ack = ar2315_misc_intr_disable, ++ .mask = ar2315_misc_intr_disable, ++ .unmask = ar2315_misc_intr_enable, ++ .end = ar2315_misc_intr_end, ++}; ++ ++static irqreturn_t ar2315_ahb_proc_handler(int cpl, void *dev_id) ++{ ++ ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET); ++ ar231x_read_reg(AR2315_AHB_ERR1); ++ ++ printk(KERN_ERR "AHB fatal error\n"); ++ machine_restart("AHB error"); /* Catastrophic failure */ ++ ++ return IRQ_HANDLED; ++} ++ ++static struct irqaction ar2315_ahb_proc_interrupt = { ++ .handler = ar2315_ahb_proc_handler, ++ .flags = IRQF_DISABLED, ++ .name = "ar2315_ahb_proc_interrupt", ++}; ++ ++static struct irqaction cascade = { ++ .handler = no_action, ++ .flags = IRQF_DISABLED, ++ .name = "cascade", ++}; ++ ++void ++ar2315_irq_init(void) ++{ ++ int i; ++ ++ if (!is_2315()) ++ return; ++ ++ ar231x_irq_dispatch = ar2315_irq_dispatch; ++ gpiointval = ar231x_read_reg(AR2315_GPIO_DI); ++ for (i = 0; i < AR531X_MISC_IRQ_COUNT; i++) { ++ int irq = AR531X_MISC_IRQ_BASE + i; ++ set_irq_chip_and_handler(irq, &ar2315_misc_intr_controller, ++ handle_level_irq); ++ } ++ for (i = 0; i < AR531X_GPIO_IRQ_COUNT; i++) { ++ int irq = AR531X_GPIO_IRQ_BASE + i; ++ set_irq_chip_and_handler(irq, &ar2315_gpio_intr_controller, ++ handle_level_irq); ++ } ++ setup_irq(AR531X_MISC_IRQ_GPIO, &cascade); ++ setup_irq(AR531X_MISC_IRQ_AHB_PROC, &ar2315_ahb_proc_interrupt); ++ setup_irq(AR2315_IRQ_MISC_INTRS, &cascade); ++} ++ ++const struct ar231x_gpiodev ar2315_gpiodev; ++ ++static u32 ++ar2315_gpio_get_output(void) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR2315_GPIO_CR); ++ reg &= ar2315_gpiodev.valid_mask; ++ return reg; ++} ++ ++static u32 ++ar2315_gpio_set_output(u32 mask, u32 val) ++{ ++ u32 reg; ++ ++ reg = ar231x_read_reg(AR2315_GPIO_CR); ++ reg &= ~mask; ++ reg |= val; ++ ar231x_write_reg(AR2315_GPIO_CR, reg); ++ return reg; ++} ++ ++static u32 ++ar2315_gpio_get(void) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR2315_GPIO_DI); ++ reg &= ar2315_gpiodev.valid_mask; ++ return reg; ++} ++ ++static u32 ++ar2315_gpio_set(u32 mask, u32 value) ++{ ++ u32 reg; ++ reg = ar231x_read_reg(AR2315_GPIO_DO); ++ reg &= ~mask; ++ reg |= value; ++ ar231x_write_reg(AR2315_GPIO_DO, reg); ++ return reg; ++} ++ ++const struct ar231x_gpiodev ar2315_gpiodev = { ++ .valid_mask = (1 << 22) - 1, ++ .get_output = ar2315_gpio_get_output, ++ .set_output = ar2315_gpio_set_output, ++ .get = ar2315_gpio_get, ++ .set = ar2315_gpio_set, ++}; ++ ++static struct ar231x_eth ar2315_eth_data = { ++ .reset_base = AR2315_RESET, ++ .reset_mac = AR2315_RESET_ENET0, ++ .reset_phy = AR2315_RESET_EPHY0, ++ .phy_base = AR2315_ENET0, ++ .config = &ar231x_board, ++}; ++ ++static struct resource ar2315_spiflash_res[] = { ++ { ++ .name = "flash_base", ++ .flags = IORESOURCE_MEM, ++ .start = KSEG1ADDR(AR2315_SPI_READ), ++ .end = KSEG1ADDR(AR2315_SPI_READ) + 0x1000000 - 1, ++ }, ++ { ++ .name = "flash_regs", ++ .flags = IORESOURCE_MEM, ++ .start = 0x11300000, ++ .end = 0x11300012, ++ }, ++}; ++ ++static struct platform_device ar2315_spiflash = { ++ .id = 0, ++ .name = "spiflash", ++ .resource = ar2315_spiflash_res, ++ .num_resources = ARRAY_SIZE(ar2315_spiflash_res) ++}; ++ ++static struct platform_device ar2315_wdt = { ++ .id = 0, ++ .name = "ar2315_wdt", ++}; ++ ++#define SPI_FLASH_CTL 0x00 ++#define SPI_FLASH_OPCODE 0x04 ++#define SPI_FLASH_DATA 0x08 ++ ++static inline u32 ++spiflash_read_reg(int reg) ++{ ++ return ar231x_read_reg(KSEG1ADDR(AR2315_SPI) + reg); ++} ++ ++static inline void ++spiflash_write_reg(int reg, u32 data) ++{ ++ ar231x_write_reg(KSEG1ADDR(AR2315_SPI) + reg, data); ++} ++ ++static u32 ++spiflash_wait_status(void) ++{ ++ u32 reg; ++ ++ do { ++ reg = spiflash_read_reg(SPI_FLASH_CTL); ++ } while (reg & SPI_CTL_BUSY); ++ ++ return reg; ++} ++ ++static u8 ++spiflash_probe(void) ++{ ++ u32 reg; ++ ++ reg = spiflash_wait_status(); ++ reg &= ~SPI_CTL_TX_RX_CNT_MASK; ++ reg |= (1 << 4) | 4 | SPI_CTL_START; ++ ++ spiflash_write_reg(SPI_FLASH_OPCODE, 0xab); ++ spiflash_write_reg(SPI_FLASH_CTL, reg); ++ ++ reg = spiflash_wait_status(); ++ reg = spiflash_read_reg(SPI_FLASH_DATA); ++ reg &= 0xff; ++ ++ return (u8) reg; ++} ++ ++ ++#define STM_8MBIT_SIGNATURE 0x13 ++#define STM_16MBIT_SIGNATURE 0x14 ++#define STM_32MBIT_SIGNATURE 0x15 ++#define STM_64MBIT_SIGNATURE 0x16 ++#define STM_128MBIT_SIGNATURE 0x17 ++ ++static u8 __init * ++ar2315_flash_limit(void) ++{ ++ u32 flash_size = 0; ++ ++ /* probe the flash chip size */ ++ switch(spiflash_probe()) { ++ case STM_8MBIT_SIGNATURE: ++ flash_size = 0x00100000; ++ break; ++ case STM_16MBIT_SIGNATURE: ++ flash_size = 0x00200000; ++ break; ++ case STM_32MBIT_SIGNATURE: ++ flash_size = 0x00400000; ++ break; ++ case STM_64MBIT_SIGNATURE: ++ flash_size = 0x00800000; ++ break; ++ case STM_128MBIT_SIGNATURE: ++ flash_size = 0x01000000; ++ break; ++ } ++ ++ ar2315_spiflash_res[0].end = ar2315_spiflash_res[0].start + ++ flash_size - 1; ++ return (u8 *) ar2315_spiflash_res[0].end + 1; ++} ++ ++#ifdef CONFIG_LEDS_GPIO ++static struct gpio_led ar2315_leds[6]; ++static struct gpio_led_platform_data ar2315_led_data = { ++ .leds = (void *) ar2315_leds, ++}; ++ ++static struct platform_device ar2315_gpio_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = (void *) &ar2315_led_data, ++ } ++}; ++ ++static void __init ++ar2315_init_gpio(void) ++{ ++ static char led_names[6][6]; ++ int i, led = 0; ++ ++ ar2315_led_data.num_leds = 0; ++ for(i = 1; i < 8; i++) ++ { ++ if((i == AR2315_RESET_GPIO) || ++ (i == ar231x_board.config->resetConfigGpio)) ++ continue; ++ ++ if(i == ar231x_board.config->sysLedGpio) ++ strcpy(led_names[led], "wlan"); ++ else ++ sprintf(led_names[led], "gpio%d", i); ++ ++ ar2315_leds[led].name = led_names[led]; ++ ar2315_leds[led].gpio = i; ++ ar2315_leds[led].active_low = 0; ++ led++; ++ } ++ ar2315_led_data.num_leds = led; ++ platform_device_register(&ar2315_gpio_leds); ++} ++#else ++static inline void ar2315_init_gpio(void) ++{ ++} ++#endif ++ ++int __init ++ar2315_init_devices(void) ++{ ++ if (!is_2315()) ++ return 0; ++ ++ /* Find board configuration */ ++ ar231x_find_config(ar2315_flash_limit()); ++ ar2315_eth_data.macaddr = ar231x_board.config->enet0_mac; ++ ++ ar2315_init_gpio(); ++ platform_device_register(&ar2315_wdt); ++ platform_device_register(&ar2315_spiflash); ++ ar231x_add_ethernet(0, AR2315_ENET0, AR2315_IRQ_ENET0_INTRS, ++ &ar2315_eth_data); ++ ar231x_add_wmac(0, AR2315_WLAN0, AR2315_IRQ_WLAN0_INTRS); |