From patchwork Thu Jun 2 11:54:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 843462 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p52BsOmk012060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Jun 2011 11:54:46 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QS6Tf-0004M8-A1; Thu, 02 Jun 2011 11:54:15 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QS6Te-0005Dp-W7; Thu, 02 Jun 2011 11:54:15 +0000 Received: from mail-wy0-f177.google.com ([74.125.82.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QS6Tb-0005DE-GE; Thu, 02 Jun 2011 11:54:12 +0000 Received: by wyb28 with SMTP id 28so758770wyb.36 for ; Thu, 02 Jun 2011 04:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=/vMjafArVmEpW/fhd+vKeomt4iZZTvPphvXoDtP2QW8=; b=OaNnmrCahYtMWDeLIo2SAhNPdhkCWpmmQr+H5gcEYwTnbzm7WWSyufZre21eBtHg48 nCv19KBKxh6/8bcdbtT7tAOiUJfWGTt/+rE3cHVj2Iactsrf82PqtQBxhwVoVvGP6Ai1 8mx3yx3XasSdSwvzOL1g482I7w3HW8RXsje+0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=l2eJ/JMEisOG827v2zOF7EyNqL/YXodZJDXrY40npwRkbuELkRSYz0BCkQKUoBAz9r 5ZK9LMXoJxcubdWtj8+vPSModSvoKI8KvGbMXpTXCIwdX70qQtzWj6iCPrcqN90R+b8W 310emmWhE+XgH1Q7EmDP12VlY7EnX1g1Xb/mQ= Received: by 10.216.136.151 with SMTP id w23mr5930709wei.86.1307015648237; Thu, 02 Jun 2011 04:54:08 -0700 (PDT) Received: from doriath.ww600.siemens.net ([91.213.169.4]) by mx.google.com with ESMTPS id w62sm281899wec.18.2011.06.02.04.54.04 (version=SSLv3 cipher=OTHER); Thu, 02 Jun 2011 04:54:07 -0700 (PDT) From: Dmitry Eremin-Solenikov To: linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org Subject: [PATCH 1/2] clps711x/ceiva: port to use physmap flash Date: Thu, 2 Jun 2011 15:54:07 +0400 Message-Id: <1307015648-17505-1-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.4.4 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110602_075411_975749_8BF6EA16 X-CRM114-Status: GOOD ( 19.11 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (dbaryshkov[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: Artem Bityutskiy , Russell King , David Woodhouse X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 02 Jun 2011 11:54:46 +0000 (UTC) Port ceiva machine to use physmap flash instead of custom mapping driver (which even can't compile cleanly with current kernels). All info is gathered from drivers/mtd/maps/ceiva.c. Compile tested only. Signed-off-by: Dmitry Eremin-Solenikov --- arch/arm/mach-clps711x/ceiva.c | 60 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 60 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c index 16481cf..00e3c45 100644 --- a/arch/arm/mach-clps711x/ceiva.c +++ b/arch/arm/mach-clps711x/ceiva.c @@ -26,6 +26,9 @@ #include #include +#include +#include +#include #include #include @@ -46,6 +49,56 @@ static struct map_desc ceiva_io_desc[] __initdata = { } }; +/* Flash / Partition sizing */ +/* For the 28F8003, we use the block mapping to calcuate the sizes */ +#define MAX_SIZE_KiB (16 + 8 + 8 + 96 + (7*128)) +#define BOOT_PARTITION_SIZE_KiB (16) +#define PARAMS_PARTITION_SIZE_KiB (8) +#define KERNEL_PARTITION_SIZE_KiB (4*128) +/* Use both remaining portion of first flash, and all of second flash */ +#define ROOT_PARTITION_SIZE_KiB ((3*128) + (8*128)) + +static struct mtd_partition ceiva_partitions[] = { + { + .name = "Ceiva BOOT partition", + .size = BOOT_PARTITION_SIZE_KiB*1024, + .offset = 0, + + }, { + .name = "Ceiva parameters partition", + .size = PARAMS_PARTITION_SIZE_KiB*1024, + .offset = (16 + 8) * 1024, + }, { + .name = "Ceiva kernel partition", + .size = (KERNEL_PARTITION_SIZE_KiB)*1024, + .offset = 0x20000, + + }, { + .name = "Ceiva root filesystem partition", + .offset = MTDPART_OFS_APPEND, + .size = (ROOT_PARTITION_SIZE_KiB)*1024, + } +}; + +static struct physmap_flash_data __initdata ceiva_flash_data = { + .width = CEIVA_FLASH_WIDTH, + .parts = ceiva_partitions, + .nr_parts = ARRAY_SIZE(ceiva_partitions), + .probe_type = "jedec_probe", +}; + +static struct resource __initdata ceiva_flash_resouces[] = { + { + .start = CS0_PHYS_BASE, + .end = CS0_PHYS_BASE + SZ_32M, + .flags = IORESOURCE_MEM, + }, + { + .start = CS1_PHYS_BASE, + .end = CS1_PHYS_BASE + SZ_32M, + .flags = IORESOURCE_MEM, + } +}; static void __init ceiva_map_io(void) { @@ -53,11 +106,18 @@ static void __init ceiva_map_io(void) iotable_init(ceiva_io_desc, ARRAY_SIZE(ceiva_io_desc)); } +static void __init ceiva_init(void) +{ + platform_device_register_resndata(NULL, "physmap-flash", -1, + ceiva_flash_resouces, ARRAY_SIZE(ceiva_flash_resouces), + &ceiva_flash_data, sizeof(ceiva_flash_data)); +} MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame") /* Maintainer: Rob Scott */ .boot_params = 0xc0000100, .map_io = ceiva_map_io, .init_irq = clps711x_init_irq, + .init_machine = ceiva_init, .timer = &clps711x_timer, MACHINE_END