Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp58731img; Tue, 19 Mar 2019 15:39:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxJ7NyYA4/0PAE0NMBnguBHDwABgJIFFginTuBa3hiPlxZYMFQpk8veB83x5CoNeNZBlnh X-Received: by 2002:a63:2c3:: with SMTP id 186mr4069411pgc.161.1553035145726; Tue, 19 Mar 2019 15:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553035145; cv=none; d=google.com; s=arc-20160816; b=o9Wtg7xmsJfmlum+GFrx+aouP2hIOBdB/J6vwmUXM1EzmthvRZCoovOZ6xjdAhqTol oR1wDpyRHcAOqtfkK5pfGNQ6oSoCBcWStPg5iDxaoPcfmVbRfCPBpBTn9rHAYrgCepVP iKUFS9ALUDP76Y1b1uMEH3S7LgDrnkFE/2NtDJhAUEsfx6Y+EacJSrF8lmpN1dF31qWL ZyCS2ow3xiKfw74pON9/T6+Jcq1xYHFK3Mu4p66Fu4IBPa71A06sT9I4sTSYzdyEdMyP qEvBiNGTlPoUyl2UlusxpW8NiiTgAS+tY7irm6xvDabGz+/9wVOWEhvkN/qZVlBOX7HK 1dFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=d2uS3JYGyQ73AUhjSqp6WbiOn0rKDAb2enK7Ui9OG1k=; b=qEUKPmTiW1mfHVC6H5oAvJGAX4IVnidBPj1iKbAm9dXxgpy4k9vNQcY8ErZGfUpHnu dNgdfhXHTmgbBzku9TrpQplJyfcrbs+M+OkpkwORhog2Fr6NVnxPZrJyAsVhbcC7x3XK qmkTNv1mfsp8S+LbTAG03gwRgsQiyVFvNdY8t+hczPcd+8p23AMhEHKSB2eGyKgcgHNT 32IuLBMFwOR83XikFpZ7Pk9SEllcM9NWrQjP5BAIpdOzi2cfSq0spnGu1L0AZaIYERPM mgkVsvIlhMFoaLuebcKgWGM3/1yeCVmtLJwEnKWaf3O4BtrEj6K8RKNAzqo4cndzAaYd 2B3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EWpvVzXr; 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=QUARANTINE 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 j19si98922pfh.124.2019.03.19.15.38.50; Tue, 19 Mar 2019 15:39:05 -0700 (PDT) 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=EWpvVzXr; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbfCSWhx (ORCPT + 99 others); Tue, 19 Mar 2019 18:37:53 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44517 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfCSWhw (ORCPT ); Tue, 19 Mar 2019 18:37:52 -0400 Received: by mail-lj1-f194.google.com with SMTP id n18so501075ljg.11; Tue, 19 Mar 2019 15:37:51 -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=epJ+chQsvO8Zq8jQAxWnowyl0xI48M091vYKjM+Q4eA/im/jtxEO3yElqf1UCFbnSX rmQe/7JLPdrONyFRUUwazlcedCXUye0ZjxBD4wIOGPGJYQEJGLLLddKG0xbce+nhCBly Q8tCpCNMf4NngZiU5Yc0wfWxPctxU6Z3MtsxW7RNyPszhT6vYc8t4wKLouM9R0A5LVvR k67UbDIbCHO68PkX9HHxh+rb2zzMzwC0FL6N+9bgnrum91+CdNk8xUoa5YLLdU4P6jf3 MXJ/O5/PTIHRd+tZGm+r4Qi/0z5bCiEDjWuw2re8JWSNtTuu8eI5fWZ7tZrbPZvf20b9 7PEw== X-Gm-Message-State: APjAAAVD4W81H98Tq+ERUS2vPkY2urDr/QRARy9n+jJIM2d9KyCzqzuU dNvXJeHoxo0uKr0jtfIop4M3TtBU 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 Cc: Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Tony Lindgren , Aaro Koskinen , linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.19.2