Message ID | 20170104101056.18a5069e@bbrezillon |
---|---|
State | Deferred |
Delegated to: | Tom Rini |
Headers | show |
Hi Boris, On Wed, Jan 04, 2017 at 10:10:56AM +0100, Boris Brezillon wrote: > Hi Maxime, > > On Tue, 22 Nov 2016 13:38:36 +0100 > Maxime Ripard <maxime.ripard@free-electrons.com> 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> > > --- > > cmd/Kconfig | 19 +++++++++++++++++++ > > cmd/mtdparts.c | 8 ++++++++ > > 2 files changed, 27 insertions(+), 0 deletions(-) > > > > 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" > > depends on MTD > > Also, it seems that MTD_DEVICE and MTD_PARTITIONS still have to be > defined in the board/soc config header, which is kind of disturbing. Indeed > I modified the patch (see below) to add hidden MTD_DEVICE and > MTD_PARTITIONS options and select them from MTDPARTS. This way you can > get rid of all MTD related definitions in sunxi-common.h. > > I also have 3 more patches [1][2][3] to expose UBIFS and NAND suboptions > through Kconfig in order to get rid of the extra definitions you add in > sunxi-common.h (patch 9). Let me know if you want me to send them > separately, otherwise, you can include them in your series. Looks good. I won't have time to send them before a while, so feel free to send them separately. Thanks! Maxime
diff --git a/cmd/Kconfig b/cmd/Kconfig index 91bd3fb0b58e..05afc2864744 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -763,6 +763,28 @@ 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" + depends on MTD + select MTD_DEVICE + select MTD_PARTITIONS + 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 diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 3a9705c41bdf..bebb2f78533e 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -35,6 +35,14 @@ config FLASH_PIC32 This enables access to Microchip PIC32 internal non-CFI flash chips through PIC32 Non-Volatile-Memory Controller. +config MTD_DEVICE + bool + depends on MTD + +config MTD_PARTITIONS + bool + depends on MTD + endmenu source "drivers/mtd/nand/Kconfig"