From patchwork Mon Jan 23 13:46:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 718572 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3v6Xgp4tD0z9sDF for ; Tue, 24 Jan 2017 00:47:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E9244B868; Mon, 23 Jan 2017 14:47:42 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YXp-P40W4BHv; Mon, 23 Jan 2017 14:47:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BDEF4B252; Mon, 23 Jan 2017 14:47:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 134B84A078 for ; Mon, 23 Jan 2017 14:47:12 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3T7D4p0edJxk for ; Mon, 23 Jan 2017 14:47:11 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by theia.denx.de (Postfix) with ESMTP id CCD464AA22 for ; Mon, 23 Jan 2017 14:47:11 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 110) id BC98C20C07; Mon, 23 Jan 2017 14:47:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 9100620BA0; Mon, 23 Jan 2017 14:47:14 +0100 (CET) From: Maxime Ripard To: Jagan Teki , Scott Wood Date: Mon, 23 Jan 2017 14:46:47 +0100 Message-Id: <4d7dcc7d7f75daa9314985cec75c4e0a3b591049.1485179128.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , Alexander Kaplan , Maxime Ripard , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v4 5/16] cmd: Add Kconfig option for CMD_MTDPARTS and related options X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" CMD_MTDPARTS is something the user might or might not want to select, and might depends on (or be selected by) other options too. This is even truer for the MTDIDS_DEFAULT and MTDPARTS_DEFAULT options that might change from one board to another, or from one user to the other, depending on what it expects and what storage devices are available. In order to ease that configuration, add those options to Kconfig. Signed-off-by: Maxime Ripard Reviewed-by: Tom Rini --- cmd/Kconfig | 20 ++++++++++++++++++++ cmd/mtdparts.c | 8 ++++++++ 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 91bd3fb0b58e..da8e98e8143f 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -763,6 +763,26 @@ config CMD_FS_GENERIC help Enables filesystem commands (e.g. load, ls) that work for multiple fs types. + +config CMD_MTDPARTS + depends on ARCH_SUNXI + bool "MTD partition support" + help + MTD partition support + +config MTDIDS_DEFAULT + string "Default MTD IDs" + depends on CMD_MTDPARTS + help + Defines a default MTD ID + +config MTDPARTS_DEFAULT + string "Default MTD partition scheme" + depends on CMD_MTDPARTS + help + Defines a default MTD partitioning scheme in the Linux MTD command + line partitions format + endmenu config CMD_UBI diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index b9b160dc1e2f..112bf1f3e3cd 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -110,11 +110,19 @@ DECLARE_GLOBAL_DATA_PTR; /* default values for mtdids and mtdparts variables */ #if !defined(MTDIDS_DEFAULT) +#ifdef CONFIG_MTDIDS_DEFAULT +#define MTDIDS_DEFAULT CONFIG_MTDIDS_DEFAULT +#else #define MTDIDS_DEFAULT NULL #endif +#endif #if !defined(MTDPARTS_DEFAULT) +#ifdef CONFIG_MTDPARTS_DEFAULT +#define MTDPARTS_DEFAULT CONFIG_MTDPARTS_DEFAULT +#else #define MTDPARTS_DEFAULT NULL #endif +#endif #if defined(CONFIG_SYS_MTDPARTS_RUNTIME) extern void board_mtdparts_default(const char **mtdids, const char **mtdparts); #endif