From patchwork Tue Jun 16 07:42:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 30554 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 n5G7gYWo006691 for ; Tue, 16 Jun 2009 07:42:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760052AbZFPHma (ORCPT ); Tue, 16 Jun 2009 03:42:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760221AbZFPHma (ORCPT ); Tue, 16 Jun 2009 03:42:30 -0400 Received: from mail.renesas.com ([202.234.163.13]:33782 "EHLO mail03.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758294AbZFPHm3 (ORCPT ); Tue, 16 Jun 2009 03:42:29 -0400 X-AuditID: ac140386-0000000900003037-b9-4a374ce54928 Received: from guardian03.idc.renesas.com ([172.20.8.202]) by mail03.idc.renesas.com (sendmail) with ESMTP id n5G7gT3D004517; Tue, 16 Jun 2009 16:42:29 +0900 (JST) Received: (from root@localhost) by guardian03.idc.renesas.com with id n5G7gTMl015608; Tue, 16 Jun 2009 16:42:29 +0900 (JST) Received: from mta04.idc.renesas.com (localhost [127.0.0.1]) by mta04.idc.renesas.com with ESMTP id n5G7gRB5009302; Tue, 16 Jun 2009 16:42:27 +0900 (JST) Received: from [172.30.8.158] by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KLB00LA9MQTY2@ims05.idc.renesas.com>; Tue, 16 Jun 2009 16:42:29 +0900 (JST) Date: Tue, 16 Jun 2009 16:42:20 +0900 From: Nobuhiro Iwamatsu Subject: [PATCH] sh: Add support mtd mapping for highlander To: Linux-sh Cc: Paul Mundt Message-id: <4A374CDC.8000407@renesas.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-2022-JP Content-transfer-encoding: 7bit User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/boards/mach-highlander/setup.c | 49 +++++++++++++++++++++++++ arch/sh/include/mach-common/mach/highlander.h | 3 ++ 2 files changed, 52 insertions(+), 0 deletions(-) diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c index 20fe72c..df054e5 100644 --- a/arch/sh/boards/mach-highlander/setup.c +++ b/arch/sh/boards/mach-highlander/setup.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -178,6 +179,53 @@ static struct platform_device ax88796_device = { .resource = ax88796_resources, }; +static struct mtd_partition nor_flash_partitions[] = { + { + .name = "loader", + .offset = 0x00000000, + .size = 512 * 1024, + }, + { + .name = "bootenv", + .offset = MTDPART_OFS_APPEND, + .size = 512 * 1024, + }, + { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = 4 * 1024 * 1024, + }, + { + .name = "data", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct physmap_flash_data nor_flash_data = { + .width = 4, + .parts = nor_flash_partitions, + .nr_parts = ARRAY_SIZE(nor_flash_partitions), +}; + +/* This config is flash board for mass production. */ +static struct resource nor_flash_resources[] = { + [0] = { + .start = PA_NORFLASH_ADDR, + .end = PA_NORFLASH_ADDR + PA_NORFLASH_SIZE - 1, + .flags = IORESOURCE_MEM, + } +}; + +static struct platform_device nor_flash_device = { + .name = "physmap-flash", + .dev = { + .platform_data = &nor_flash_data, + }, + .num_resources = ARRAY_SIZE(nor_flash_resources), + .resource = nor_flash_resources, +}; + static struct resource smbus_resources[] = { [0] = { .start = PA_SMCR, @@ -209,6 +257,7 @@ static struct platform_device *r7780rp_devices[] __initdata = { &m66592_usb_peripheral_device, &heartbeat_device, &smbus_device, + &nor_flash_device, #ifndef CONFIG_SH_R7780RP &ax88796_device, #endif diff --git a/arch/sh/include/mach-common/mach/highlander.h b/arch/sh/include/mach-common/mach/highlander.h index bd26a84..eaba0a5 100644 --- a/arch/sh/include/mach-common/mach/highlander.h +++ b/arch/sh/include/mach-common/mach/highlander.h @@ -2,6 +2,9 @@ #define __ASM_SH_RENESAS_R7780RP_H /* Box specific addresses. */ +#define PA_NORFLASH_ADDR 0x00000000 +#define PA_NORFLASH_SIZE 0x04000000 + #if defined(CONFIG_SH_R7780MP) #define PA_BCR 0xa4000000 /* FPGA */ #define PA_SDPOW (-1)