From patchwork Thu Aug 6 14:58:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 39626 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 n76F3Kf6005944 for ; Thu, 6 Aug 2009 15:03:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753744AbZHFPC6 (ORCPT ); Thu, 6 Aug 2009 11:02:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753901AbZHFPC6 (ORCPT ); Thu, 6 Aug 2009 11:02:58 -0400 Received: from rv-out-0506.google.com ([209.85.198.231]:6681 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753744AbZHFPC5 (ORCPT ); Thu, 6 Aug 2009 11:02:57 -0400 Received: by rv-out-0506.google.com with SMTP id f6so170398rvb.1 for ; Thu, 06 Aug 2009 08:02:58 -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=s4sFlgbARm+oLAedanFrQVDajkoHw5krocoG+OR+g5c=; b=pRvlK0oTYRGptylVjy8tOhClwsx51N+ffz4BvZLZTDB3WDJRPZA7QOC2NLQAMlF8Me iIJY6YT0lSBqDtCSiSMH5e94nlJ8Q5vPsziRjMDDWKouFv/UWr2EpAo5A4CkCrx83mFg bz3sNz+PDXKayKm9xo1aPU/FqwO6wqMRJrBZE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=OeOqBHMMKQYaGFTcgVq/dSd3LoyubRXF/3czAcs4EkBEPpztcxNjS/45y6kUCssXH6 YFbjnqoWQi8pZTo832YWOed5nEpLPa0ohX/waIeujQYzxAs/LF8qXPearigUWaAZ8CRu QBts6OofkzGxQGUJKABrKWVFWI/mcvkRS4fdw= Received: by 10.140.166.21 with SMTP id o21mr338342rve.210.1249570978207; Thu, 06 Aug 2009 08:02: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 k41sm342845rvb.47.2009.08.06.08.02.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Aug 2009 08:02:55 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: tony@atomide.com, kyungmin.park@samsung.com, lethal@linux-sh.org, linux-mtd@lists.infradead.org, Magnus Damm , dwmw2@infradead.org, akpm@linux-foundation.org Date: Thu, 06 Aug 2009 23:58:43 +0900 Message-Id: <20090806145843.4475.33947.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: kfr2r09 board support - NAND flash 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 NAND flash chip attached to CS4 on the KFR2R09 board. The device is driven by the platform device driver "onenand-flash". Signed-off-by: Magnus Damm --- No merge/build time dependencies, but needs the following patch to start working on the actual hardware: "[PATCH] mtd: make onenand/generic.c more generic" arch/sh/boards/mach-kfr2r09/setup.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 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 --- 0003/arch/sh/boards/mach-kfr2r09/setup.c +++ work/arch/sh/boards/mach-kfr2r09/setup.c 2009-08-06 21:37:18.000000000 +0900 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,21 @@ static struct platform_device kfr2r09_no }, }; +static struct resource kfr2r09_nand_flash_resources[] = { + [0] = { + .name = "NAND Flash", + .start = 0x10000000, + .end = 0x1001ffff, + .flags = IORESOURCE_MEM, + } +}; + +static struct platform_device kfr2r09_nand_flash_device = { + .name = "onenand-flash", + .resource = kfr2r09_nand_flash_resources, + .num_resources = ARRAY_SIZE(kfr2r09_nand_flash_resources), +}; + static struct sh_keysc_info kfr2r09_sh_keysc_info = { .mode = SH_KEYSC_MODE_1, /* KEYOUT0->4, KEYIN0->4 */ .scan_timing = 3, @@ -161,12 +177,15 @@ static struct platform_device kfr2r09_sh static struct platform_device *kfr2r09_devices[] __initdata = { &kfr2r09_nor_flash_device, + &kfr2r09_nand_flash_device, &kfr2r09_sh_keysc_device, &kfr2r09_sh_lcdc_device, }; #define BSC_CS0BCR 0xfec10004 #define BSC_CS0WCR 0xfec10024 +#define BSC_CS4BCR 0xfec10010 +#define BSC_CS4WCR 0xfec10030 static int __init kfr2r09_devices_setup(void) { @@ -178,6 +197,10 @@ static int __init kfr2r09_devices_setup( ctrl_outl(0x36db0400, BSC_CS0BCR); ctrl_outl(0x00000500, BSC_CS0WCR); + /* setup NAND flash at CS4 */ + ctrl_outl(0x36db0400, BSC_CS4BCR); + ctrl_outl(0x00000500, BSC_CS4WCR); + /* setup KEYSC pins */ gpio_request(GPIO_FN_KEYOUT0, NULL); gpio_request(GPIO_FN_KEYOUT1, NULL);