From patchwork Tue Mar 19 22:37:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 10860549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 553C56C2 for ; Tue, 19 Mar 2019 22:38:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3293029916 for ; Tue, 19 Mar 2019 22:38:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26A202988B; Tue, 19 Mar 2019 22:38:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B201F29916 for ; Tue, 19 Mar 2019 22:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=30ZxmOre2Cw+XDyL1BxQhcrGTImHXfkjSq30y8DCUOw=; b=IGerT5g55kbMO+ J4ouW7TiDoEYtUX6jP2v/NXuzlImBFOPrc9lm/3RgtS5GY0cVZen1+ft7LtxOW8zg5Jr00MZUYPo/ 3J2fK5eafeNj5xaBa/xQ+Etz3kfjMy8dRKY8gv/7q1BxxfsvbrYk9Gnh5zD9xGUkJaaZluMKmKaqy GLaxP5Va1YnxlPWGLRyRmFZYf1CUZOKfX+wbAKgWQFYZaH78IITBk/WAZt81TU0NI13LF9AqJcA1T kkpkn4dG/45sxwYGznq3lLVVmwy+lx59phIfxpqoSlsbtwGNiVvcLn9WKSCMDV+i2XGz7d3C9FJZR N0zLSmzjIWn9ehjTE3kw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6NMy-00005d-Db; Tue, 19 Mar 2019 22:38:04 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6NMm-0008Om-OB; Tue, 19 Mar 2019 22:37:53 +0000 Received: by mail-lj1-x243.google.com with SMTP id j89so558751ljb.1; Tue, 19 Mar 2019 15:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=d2uS3JYGyQ73AUhjSqp6WbiOn0rKDAb2enK7Ui9OG1k=; b=EWpvVzXrXBYLmg4ieBzv3cl784Xf9T968WwgPowvJKcHSmFbwGgIcs6Of9Z4/tz/7s EZeoucooRipWxBcUbTnfXUFLV1+ZrWulSBMXOUEACygIoWjxo3UgbJYkyKYQvWsMGleR QriXZGfH7BvlyVeeAhMg5RVYoJsg+lssZlpsynrchTqGeOoetgP20B/PD0yOWsHY3blE +hS1HiGrTaVyVpWjTndgKqUXm+AB5XlxI457V+dt1y8mbJbOnvWNY2vbc83X/V5h14gK ypUF7jpoGhrBag36xsFshcHgLBMlEaSTF89VAGrTw8A8QAllZ7LdI0YfCVkYIXinxYtb PskA== 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:mime-version :content-transfer-encoding; bh=d2uS3JYGyQ73AUhjSqp6WbiOn0rKDAb2enK7Ui9OG1k=; b=rOY1QBFJbmxMpm1dpFVwUK2dfgYcFh/uBocPNLJwo1TuetraXvNxm2xwcSWBm5K3nq q/ezPBJBjfhbBevEG9qwgrMHuaLHJhmVMbDvosRnck7xZuK1x3ff5hOMykqLK+GRSzWy 6NwjXVmVmml+HPRzFC//HjbG11AEg8eFDkHNryfWofypG2uGSWDjE5XMCROzgQMbcS11 F5+1oVcLQlHKL0U+7PSc9wV67UGdacfyRQivcjiH+Y1LOehhCaD1Nz5yrTvkmRdWqnQW UyjGrHEP+psc4Tm5zCcZpBW3eUyNF5bM/gxIorWaTKD/XcPV0ozkAsjzd2If8fSarJPD BNJw== X-Gm-Message-State: APjAAAVWuaJIv6JvUNgrylmcVA90yLJZxOijrBXhW6lk2cnH8OU5UKBg EvXqVEUzoqYn/JNaiuQNUVw= X-Google-Smtp-Source: APXvYqxRGGAMBczbx5QCobRazLvMcrQnc58m6gR2XMzSf0XUPwTAHtOEYTkf0qZQql0G5AidHWzl0w== X-Received: by 2002:a2e:5b44:: with SMTP id p65mr15344283ljb.182.1553035070683; Tue, 19 Mar 2019 15:37:50 -0700 (PDT) Received: from z50.gdansk-morena.vectranet.pl (109241207190.gdansk.vectranet.pl. [109.241.207.190]) by smtp.gmail.com with ESMTPSA id t18sm51192ljg.64.2019.03.19.15.37.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Mar 2019 15:37:49 -0700 (PDT) From: Janusz Krzysztofik To: Boris Brezillon , Miquel Raynal Subject: [PATCH] mtd: rawnand: ams-delta: Drop board specific partition info Date: Tue, 19 Mar 2019 23:37:18 +0100 Message-Id: <20190319223718.26131-1-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_153752_790996_3E09D15D X-CRM114-Status: GOOD ( 16.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-omap@vger.kernel.org, Aaro Koskinen , Tony Lindgren , Richard Weinberger , Janusz Krzysztofik , linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP After recent modifications, only a hardcoded partition info makes the driver device specific. Other than that, the driver uses GPIO exclusively and can be used on any hardware. Drop the partition info and use MTD partition parser with default list of partition types instead. Amstrad Delta users should append the followig partition info to their kernel command line, possibly by embedding it in CONFIG_CMDLINE: mtdparts=ams-delta-nand:3584k(Kernel),256k(u-boot),256k(u-boot_params),\ 256k(Amstrad_LDR),27m(File_system),768k(PBL_reserved). For their convenience, select CONFIG_MTD_CMDLINE_PARTS symbol from that board Kconfig automatically if this NAND driver is also selected. Signed-off-by: Janusz Krzysztofik Cc: Tony Lindgren --- arch/arm/mach-omap1/Kconfig | 1 + drivers/mtd/nand/raw/ams-delta.c | 28 +--------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index c4694f26b5c4..62cf20f22828 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -171,6 +171,7 @@ config MACH_AMS_DELTA select LEDS_GPIO_REGISTER select REGULATOR select REGULATOR_FIXED_VOLTAGE + select MTD_CMDLINE_PARTS if MTD_NAND_AMS_DELTA help Support for the Amstrad E3 (codename Delta) videophone. Say Y here if you have such a device. diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c index 8312182088c1..2e8e37ea549a 100644 --- a/drivers/mtd/nand/raw/ams-delta.c +++ b/drivers/mtd/nand/raw/ams-delta.c @@ -41,31 +41,6 @@ struct ams_delta_nand { bool data_in; }; -/* - * Define partitions for flash devices - */ - -static const struct mtd_partition partition_info[] = { - { .name = "Kernel", - .offset = 0, - .size = 3 * SZ_1M + SZ_512K }, - { .name = "u-boot", - .offset = 3 * SZ_1M + SZ_512K, - .size = SZ_256K }, - { .name = "u-boot params", - .offset = 3 * SZ_1M + SZ_512K + SZ_256K, - .size = SZ_256K }, - { .name = "Amstrad LDR", - .offset = 4 * SZ_1M, - .size = SZ_256K }, - { .name = "File system", - .offset = 4 * SZ_1M + 1 * SZ_256K, - .size = 27 * SZ_1M }, - { .name = "PBL reserved", - .offset = 32 * SZ_1M - 3 * SZ_256K, - .size = 3 * SZ_256K }, -}; - static void ams_delta_write_commit(struct ams_delta_nand *priv) { gpiod_set_value(priv->gpiod_nwe, 0); @@ -315,8 +290,7 @@ static int ams_delta_init(struct platform_device *pdev) return err; /* Register the partitions */ - err = mtd_device_register(mtd, partition_info, - ARRAY_SIZE(partition_info)); + err = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0); if (err) goto err_nand_cleanup;