From patchwork Tue Mar 9 07:03:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Ungerer X-Patchwork-Id: 47153 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B5233B7D2A for ; Tue, 9 Mar 2010 17:59:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752621Ab0CIG7r (ORCPT ); Tue, 9 Mar 2010 01:59:47 -0500 Received: from rex.securecomputing.com ([203.24.151.4]:53062 "EHLO cyberguard.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751873Ab0CIG7p (ORCPT ); Tue, 9 Mar 2010 01:59:45 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by bne.snapgear.com (Postfix) with ESMTP id 2DBF7EBAB4; Tue, 9 Mar 2010 16:59:44 +1000 (EST) X-Virus-Scanned: amavisd-new at snapgear.com Received: from bne.snapgear.com ([127.0.0.1]) by localhost (bne.snapgear.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bzxd5c8N5uJv; Tue, 9 Mar 2010 16:59:43 +1000 (EST) Received: from snapgear.com (bnelabfw.scur.com [10.46.129.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bne.snapgear.com (Postfix) with ESMTP; Tue, 9 Mar 2010 16:59:43 +1000 (EST) Received: from goober.internal.moreton.com.au (localhost [127.0.0.1]) by snapgear.com (8.14.3/8.14.3/Debian-9ubuntu1) with ESMTP id o2973udc013670; Tue, 9 Mar 2010 17:03:56 +1000 Received: (from gerg@localhost) by goober.internal.moreton.com.au (8.14.3/8.14.3/Submit) id o2973pbP013668; Tue, 9 Mar 2010 17:03:51 +1000 Date: Tue, 9 Mar 2010 17:03:51 +1000 From: Greg Ungerer Message-Id: <201003090703.o2973pbP013668@goober.internal.moreton.com.au> CC: , Subject: [PATCH] net: add ColdFire support to the smc91x driver To: X-Mailer: mail (GNU Mailutils 2.0) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org net: add ColdFire support to the smc91x driver Some embedded ColdFire based boards use the SMC 91x family of ethernet devices. (For example the Freescale M5249C3 and MoretonBay NETtel). Add IO access support to the SMC91x driver, and allow this driver to be configured for ColdFire platforms. Signed-off-by: Greg Ungerer --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 5479954..5af3dcd 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h @@ -330,6 +330,34 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r, #include +#elif defined(CONFIG_COLDFIRE) + +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_NOWAIT 1 + +static inline void mcf_insw(void *a, unsigned char *p, int l) +{ + u16 *wp = (u16 *) p; + while (l-- > 0) + *wp++ = readw(a); +} + +static inline void mcf_outsw(void *a, unsigned char *p, int l) +{ + u16 *wp = (u16 *) p; + while (l-- > 0) + writew(*wp++, a); +} + +#define SMC_inw(a, r) _swapw(readw((a) + (r))) +#define SMC_outw(v, a, r) writew(_swapw(v), (a) + (r)) +#define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l) +#define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l) + +#define SMC_IRQ_FLAGS (IRQF_DISABLED) + #else /* diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index dd9a09c..44142d8 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -895,7 +895,7 @@ config SMC91X select CRC32 select MII depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \ - MIPS || BLACKFIN || MN10300 + MIPS || BLACKFIN || MN10300 || COLDFIRE help This is a driver for SMC's 91x series of Ethernet chipsets, including the SMC91C94 and the SMC91C111. Say Y if you want it