diff mbox

[U-Boot,v2,6/14] cmd: Add Kconfig option for CMD_MTDPARTS and related options

Message ID 4fdcc47c7f580f43cd5cd5e7b10517e1f8699c65.1479817585.git-series.maxime.ripard@free-electrons.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Maxime Ripard Nov. 22, 2016, 12:38 p.m. UTC
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 <maxime.ripard@free-electrons.com>
---
 cmd/Kconfig    | 19 +++++++++++++++++++
 cmd/mtdparts.c |  8 ++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

Comments

Tom Rini Nov. 22, 2016, 3:14 p.m. UTC | #1
On Tue, Nov 22, 2016 at 01:38:36PM +0100, Maxime Ripard wrote:

> 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 <maxime.ripard@free-electrons.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/cmd/Kconfig b/cmd/Kconfig
index e339d8638aa5..cd98e2a2bd00 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -717,6 +717,25 @@  config CMD_FS_GENERIC
 	help
 	  Enables filesystem commands (e.g. load, ls) that work for multiple
 	  fs types.
+
+config CMD_MTDPARTS
+	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