Received: by 10.223.164.202 with SMTP id h10csp5676001wrb; Tue, 21 Nov 2017 13:45:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMaIuNyLgpcGMjOfmNr3dhPKo0tfc1j9Fdha19rxS53wTVZsX5wqEX7UDkH5H36qR2lB1uZs X-Received: by 10.84.130.6 with SMTP id 6mr19651328plc.402.1511300745326; Tue, 21 Nov 2017 13:45:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511300745; cv=none; d=google.com; s=arc-20160816; b=AeuV99z0oQinvYmD0IfEikVaCJEk2u0XegLW/TUrT/MBwse2POompgrUQI2Q5xE2oY ranA6XnW4+PLsRWfuUOJiCMraQFp/mw70vbVsqMfXP5wJWXN8Y21W16n3EYXHsf2z38X PsEIJQUdo03g29/khWqTgS3rgB6UIxhP0G8DbNtluTYyD9r12KjrDr1LTOlcEqxAwUaG bud5KdNN9WxyOsAuZ71ymFujB9WlqfkEglySK57FBRmZJvV2YVZswhm2FP5o4xPohAnO AOdK+wC8DT7Ted+7TNUiPqMpWzI8ufSPMlfVwEuP3CryBIpufKEtXvH1z/kNW3QrHHfC urXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GhwkxcH585Ji59npv7VkmxfWZGr6tohCPoQ5pT9q+jE=; b=Qas0CSSm2hd41jSmfsT0608tcI3pVGd3TZKw/6FH7eeoc8VJhcWa6OY/umZ0oB9ZmM P1VH7exsQMlk+1/F+MO6AGVcaUtYZ6OmrjRDLe0FWW1JTW07NyGTPumDiLgiNtS88EwY hT1at+7mtKF6KeyI9/nQXMryMjU7g1L87Dus0nkpka6qXU+XVt3wa3n47EcI3OyHl3wy 2jjBu54a+fprn3DoqE+2AkDlRC8OVBRDY+6hOvfjxjzIfiKqtjKdtkSooeXal6WxN2eI jX9YPLcYDJKFmT9e3ewTWmnSxiHnVmV639/pnzyi7AL8Ho1noLn7fmzbHK+npalE7qQU 7EKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dg3zEy55; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si11545460pgr.136.2017.11.21.13.45.34; Tue, 21 Nov 2017 13:45:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dg3zEy55; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbdKUVo2 (ORCPT + 76 others); Tue, 21 Nov 2017 16:44:28 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:42355 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbdKUVn4 (ORCPT ); Tue, 21 Nov 2017 16:43:56 -0500 Received: by mail-wr0-f193.google.com with SMTP id o14so12648548wrf.9 for ; Tue, 21 Nov 2017 13:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GhwkxcH585Ji59npv7VkmxfWZGr6tohCPoQ5pT9q+jE=; b=Dg3zEy55qmABOS4AmHmxY0vhtUr+9Q/rqJdI6GbF/bTbbsdOY9KD0CCph1NB7j91iK QpGAkWVrwtm7JGzejXVhA7lN2NGyidJo6U4QGf/qPxSHL/xI88k6ZVLKG14EQwQLbIUI 8bSIb6CnQleZkvTmz/uE5PZFoXsZhrEb7GxWP2mGlHH9e9d9X1F7tR5qYTwfy6aEg7/h PUJCUzzzoElZ1+6uTmRpsY57kuPMw8SPKgREoilhgH3TH3q0DU4O5aDX8lRT43/brXvh YEL4ZNvbeFAFFiUB7rZoLfJEdk983NE5Eok6NexTj5uPDrcrDuQVXfcmwOB0l5a/YSpq Tg7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GhwkxcH585Ji59npv7VkmxfWZGr6tohCPoQ5pT9q+jE=; b=OpHodZX9O6WyCgZ3m5BHtmk8JvHTfIY6kb8pMqbEa6DvNYzbfmZlZsjnqD1a5hcYFK lR1a0mrZnKLRKEX4rVuIsFq9Bf8azydmhqxDqO4EbEuu+jAChoGjpQTvyvM8htgXCcoX rLzHOmm7p6dxM1kTw/8k0etJ2dxYWhfV7z48Ovjl1uqB/Z3eCLoimuThNubvq7StNm90 yF0lPV26VwmJuqj+/9tyd07liWqGub/bDQA7KFKFtKrFnB+UYWm0V7eWU7mGrMWN+tRA lHWb6sVtUldubX60zmaTaSUhGVYp/X/4MVq2P7h/nn73VJV3NEO9QS/WJUjRMgoAo5dj btsA== X-Gm-Message-State: AJaThX59vj/dLY2Sqq/SzmLzw/iwG99Qokaj0sU7GVwr1wDHFm/OD0Jz VmBkDaWWn/JvpEJCXPN2ekI= X-Received: by 10.223.164.22 with SMTP id d22mr17484015wra.232.1511300634890; Tue, 21 Nov 2017 13:43:54 -0800 (PST) Received: from andrea-ThinkPad-T520.homenet.telecomitalia.it (host196-120-dynamic.180-80-r.retail.telecomitalia.it. [80.180.120.196]) by smtp.gmail.com with ESMTPSA id g7sm16804999wra.38.2017.11.21.13.43.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:43:54 -0800 (PST) From: Andrea Adami To: linux-arm-kernel@lists.infradead.org Cc: Robert Jarzmik , Haojian Zhuang , Dmitry Eremin-Solenikov , Russell King , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ARM: pxa/tosa: Remove hardcoded partitioning, use sharpslpart parser Date: Tue, 21 Nov 2017 22:43:49 +0100 Message-Id: <1511300631-1343-2-git-send-email-andrea.adami@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511300631-1343-1-git-send-email-andrea.adami@gmail.com> References: <1511300631-1343-1-git-send-email-andrea.adami@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the introduction of sharpslpart partition parser we can now read the offsets from NAND: we specify the list of the parsers as platform data, with cmdlinepart and ofpart parsers first allowing to override the part. table written in NAND. This is done here in the board file. Emulators like qemu will need to pass the mtdparts in the cmdline. Signed-off-by: Andrea Adami --- arch/arm/mach-pxa/tosa.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 13de660..b90560b 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -673,24 +673,6 @@ static int tosa_tc6393xb_suspend(struct platform_device *dev) return 0; } -static struct mtd_partition tosa_nand_partition[] = { - { - .name = "smf", - .offset = 0, - .size = 7 * 1024 * 1024, - }, - { - .name = "root", - .offset = MTDPART_OFS_APPEND, - .size = 28 * 1024 * 1024, - }, - { - .name = "home", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = { @@ -700,10 +682,16 @@ static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = { .pattern = scan_ff_pattern }; +static const char * const probes[] = { + "cmdlinepart", + "ofpart", + "sharpslpart", + NULL, +}; + static struct tmio_nand_data tosa_tc6393xb_nand_config = { - .num_partitions = ARRAY_SIZE(tosa_nand_partition), - .partition = tosa_nand_partition, .badblock_pattern = &tosa_tc6393xb_nand_bbt, + .part_parsers = probes, }; static int tosa_tc6393xb_setup(struct platform_device *dev) -- 2.7.4 From 1584732426218433165@xxx Wed Nov 22 02:43:33 +0000 2017 X-GM-THRID: 1584732426218433165 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread