From patchwork Mon Feb 27 17:22:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 732981 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 lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vX7wx6BnMz9s73 for ; Tue, 28 Feb 2017 04:29:05 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 8EF49C21F2D; Mon, 27 Feb 2017 17:24:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 412FDC21E30; Mon, 27 Feb 2017 17:22:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3A5B6C21C5D; Mon, 27 Feb 2017 17:22:32 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id E6CA4C21C88 for ; Mon, 27 Feb 2017 17:22:31 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 72945207E9; Mon, 27 Feb 2017 18:22:31 +0100 (CET) Received: from localhost (LFbn-1-10722-90.w90-89.abo.wanadoo.fr [90.89.71.90]) by mail.free-electrons.com (Postfix) with ESMTPSA id 42ECC207EB; Mon, 27 Feb 2017 18:22:21 +0100 (CET) From: Maxime Ripard To: Jagan Teki , Scott Wood Date: Mon, 27 Feb 2017 18:22:04 +0100 Message-Id: <1bdf2d72d782d9ee61d8f5564b7018b6b8a2817b.1488215509.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Cc: Maxime Ripard , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v5 5/16] cmd: Add Kconfig option for CMD_MTDPARTS and related options X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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 ef5315631476..0734d669dbd7 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -801,6 +801,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