From patchwork Wed Jul 22 16:22:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 36860 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 n6MGQUiR025236 for ; Wed, 22 Jul 2009 16:26:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751736AbZGVQ02 (ORCPT ); Wed, 22 Jul 2009 12:26:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752933AbZGVQ02 (ORCPT ); Wed, 22 Jul 2009 12:26:28 -0400 Received: from mail-fx0-f218.google.com ([209.85.220.218]:54022 "EHLO mail-fx0-f218.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbZGVQ02 (ORCPT ); Wed, 22 Jul 2009 12:26:28 -0400 Received: by fxm18 with SMTP id 18so302128fxm.37 for ; Wed, 22 Jul 2009 09:26:27 -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=IV3SyqSoyrswkCbflGeYzWCghYTyPmYMS2vzIq4MCTE=; b=Ld45jQlllI2YqRU0UJn8k7hLQLQgbmTFDBpbQFm+CQXYsQ6Qr5DdP8mPNbn5Az7y9t 9JrtpW5BlqJP60DLGOgSwhO5j+Xs2X1I+pN2iawenk50WyGaqIZhUoMr5jsVLyjZ0Jre 9TT8chfC81clfF1C4lYXT98Il+2BZA/da4Mos= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=DCRHW673VA5ZFPx4Nem58mOZ2/lsSrVuMVdthaFghWXIvskHWzz70E7kPOzuEsZJD3 d4navMUSVOY3+V8Cd+0yEbxp05RsyVqXcylSiPZoyksXRN/l7xEia/wkGNbAvXYlG7XB p00N5eFzyhLRsUyRcEKRQ2HL/2rVQJR6cN4hM= Received: by 10.86.76.11 with SMTP id y11mr951203fga.56.1248279987170; Wed, 22 Jul 2009 09:26:27 -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 3sm1322507fge.13.2009.07.22.09.26.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Jul 2009 09:26:26 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 23 Jul 2009 01:22:28 +0900 Message-Id: <20090722162228.18182.95719.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: kfr2r09 board support - NOR 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 NOR flash support to the kfr2r09 board. NOR flash support is added by describing the NOR flash chip hooked up to CS0 as platform device data for the physmap-flash MTD driver. Signed-off-by: Magnus Damm --- Applies on top of the SCIF patch. arch/sh/boards/mach-kfr2r09/setup.c | 54 ++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) -- 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 --- 0009/arch/sh/boards/mach-kfr2r09/setup.c +++ work/arch/sh/boards/mach-kfr2r09/setup.c 2009-07-23 00:36:29.000000000 +0900 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -18,13 +19,64 @@ #include #include +static struct mtd_partition kfr2r09_nor_flash_partitions[] = +{ + { + .name = "boot", + .offset = 0, + .size = (4 * 1024 * 1024), + .mask_flags = MTD_WRITEABLE, /* Read-only */ + }, + { + .name = "other", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct physmap_flash_data kfr2r09_nor_flash_data = { + .width = 2, + .parts = kfr2r09_nor_flash_partitions, + .nr_parts = ARRAY_SIZE(kfr2r09_nor_flash_partitions), +}; + +static struct resource kfr2r09_nor_flash_resources[] = { + [0] = { + .name = "NOR Flash", + .start = 0x00000000, + .end = 0x03ffffff, + .flags = IORESOURCE_MEM, + } +}; + +static struct platform_device kfr2r09_nor_flash_device = { + .name = "physmap-flash", + .resource = kfr2r09_nor_flash_resources, + .num_resources = ARRAY_SIZE(kfr2r09_nor_flash_resources), + .dev = { + .platform_data = &kfr2r09_nor_flash_data, + }, +}; + +static struct platform_device *kfr2r09_devices[] __initdata = { + &kfr2r09_nor_flash_device, +}; + +#define BSC_CS0BCR 0xfec10004 +#define BSC_CS0WCR 0xfec10024 + static int __init kfr2r09_devices_setup(void) { /* enable SCIF1 serial port for YC401 console support */ gpio_request(GPIO_FN_SCIF1_RXD, NULL); gpio_request(GPIO_FN_SCIF1_TXD, NULL); - return 0; + /* setup NOR flash at CS0 */ + ctrl_outl(0x36db0400, BSC_CS0BCR); + ctrl_outl(0x00000500, BSC_CS0WCR); + + return platform_add_devices(kfr2r09_devices, + ARRAY_SIZE(kfr2r09_devices)); } device_initcall(kfr2r09_devices_setup);