From patchwork Tue Apr 28 08:02:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 20350 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3S856ch016108 for ; Tue, 28 Apr 2009 08:05:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932261AbZD1IFF (ORCPT ); Tue, 28 Apr 2009 04:05:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932256AbZD1IFE (ORCPT ); Tue, 28 Apr 2009 04:05:04 -0400 Received: from rv-out-0506.google.com ([209.85.198.236]:52657 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932207AbZD1IFA (ORCPT ); Tue, 28 Apr 2009 04:05:00 -0400 Received: by rv-out-0506.google.com with SMTP id f9so301198rvb.1 for ; Tue, 28 Apr 2009 01:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=lIiMGjJWueaihEgSO8tFRNogihtVsZFXCI8O2rzmK3w=; b=eOCt1sS4F/2kobBOro/2TOm/1I/9shiVahgc8qanC/2QJIrx8cVXfQwfyX3WZV9I5J Rn5mDsIRdyHraSmPGEXHy4VnzpGmjTZCNnmvuUqhaSxysbzE4byGwpTGguf7b4E3cMGw w4tvHizlyt8EEvJXwKMZdrMejQGd2rvM5E6Nw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=pQhpmrWKXCGu4BjV6AmDvSy5vs1l8qlLIJPCgaWbIUC4q8uPCCohV2GMwjG/a7b5uF xKTzXWmvJ0dZufgLh3RgMWH9+vAJNMuTMdzAxOcTKGcqduqG8Al22mCZoWtaU30J/Or/ xkB5BBM3WcPQii4J0R85kVBEF4HlpatUkkYJM= Received: by 10.115.14.1 with SMTP id r1mr2972655wai.27.1240905898990; Tue, 28 Apr 2009 01:04:58 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id l30sm3515232waf.0.2009.04.28.01.04.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Apr 2009 01:04:57 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: steve.glendinning@smsc.com, Magnus Damm , lethal@linux-sh.org Date: Tue, 28 Apr 2009 17:02:13 +0900 Message-Id: <20090428080213.16323.31667.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: smsc911x support for the rsk7203 board Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch adds support for the LAN9118 ethernet on rsk7203. The LAN9118 controller is hooked up using a 16-bit data bus, but the rsk7203 board does not swap the byte lanes as needed between the sh7203 processor and the the ethernet controller. In the processor the CS memory window is configured in 16-bit mode but the smsc911x driver is told to do 32-bit accesses to improve performance. The SMSC911X_SWAP_FIFO flag is used to tell the driver to do software byte swapping of fifo data. Signed-off-by: Magnus Damm Acked-by: Steve Glendinning --- Needs "smsc911x: add fifo byteswap support V2". arch/sh/boards/mach-rsk/devices-rsk7203.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/sh/boards/mach-rsk/devices-rsk7203.c +++ work/arch/sh/boards/mach-rsk/devices-rsk7203.c 2009-04-21 20:30:23.000000000 +0900 @@ -26,13 +26,13 @@ static struct smsc911x_platform_config s .phy_interface = PHY_INTERFACE_MODE_MII, .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, - .flags = SMSC911X_USE_16BIT, + .flags = SMSC911X_USE_32BIT | SMSC911X_SWAP_FIFO, }; static struct resource smsc911x_resources[] = { [0] = { .start = 0x24000000, - .end = 0x24000000 + 0x100, + .end = 0x240000ff, .flags = IORESOURCE_MEM, }, [1] = { @@ -99,6 +99,10 @@ static int __init rsk7203_devices_setup( gpio_request(GPIO_FN_TXD0, NULL); gpio_request(GPIO_FN_RXD0, NULL); + /* Setup LAN9118: CS1 in 16-bit Big Endian Mode, IRQ0 at Port B */ + ctrl_outl(0x36db0400, 0xfffc0008); /* CS1BCR */ + gpio_request(GPIO_FN_IRQ0_PB, NULL); + return platform_add_devices(rsk7203_devices, ARRAY_SIZE(rsk7203_devices)); }