From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] mtd: Get rid of board_mtdparts_default()
Date: Tue, 11 Dec 2018 23:55:26 +0100 [thread overview]
Message-ID: <20181211213409.GA11948@lenoch> (raw)
In-Reply-To: <20181210153850.3272-2-boris.brezillon@bootlin.com>
Hi Boris,
On Mon, Dec 10, 2018 at 04:38:50PM +0100, Boris Brezillon wrote:
> The only implementer of this function has been patched to use
> CONFIG_MTD{IDS,PARTS}_DEFAULT instead. Let's get rid of this function
> and the associated CONFIG_SYS_MTDPARTS_RUNTIME option.
the only implementer of this fuction did so for a good reason. What is
a motivation to remove it?
The requirement is to be able to use single u-boot binary on all igep2
boards ever produced. These comes with various NAND and OneNAND chips
and I was not able to come with single static partition configuration
to support them all. Hence runtime detection. That code could be used
on all OMAP3 boards as BootROM reads up to first four sectors searching
for SPL (MLO).
Thank you,
ladis
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
> board/isee/igep00x0/igep00x0.c | 17 -----------------
> cmd/mtdparts.c | 6 ------
> drivers/mtd/mtd_uboot.c | 10 ++--------
> include/configs/omap3_igep00x0.h | 2 --
> scripts/config_whitelist.txt | 1 -
> 5 files changed, 2 insertions(+), 34 deletions(-)
>
> diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
> index 367af82d4a16..3552be6f3902 100644
> --- a/board/isee/igep00x0/igep00x0.c
> +++ b/board/isee/igep00x0/igep00x0.c
> @@ -239,20 +239,3 @@ int misc_init_r(void)
>
> return 0;
> }
> -
> -void board_mtdparts_default(const char **mtdids, const char **mtdparts)
> -{
> - struct mtd_info *mtd = get_mtd_device(NULL, 0);
> - if (mtd) {
> - static char ids[24];
> - static char parts[48];
> - const char *linux_name = "omap2-nand";
> - if (strncmp(mtd->name, "onenand0", 8) == 0)
> - linux_name = "omap2-onenand";
> - snprintf(ids, sizeof(ids), "%s=%s", mtd->name, linux_name);
> - snprintf(parts, sizeof(parts), "mtdparts=%s:%dk(SPL),-(UBI)",
> - linux_name, 4 * mtd->erasesize >> 10);
> - *mtdids = ids;
> - *mtdparts = parts;
> - }
> -}
> diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
> index f7ed1a077974..6b5644523898 100644
> --- a/cmd/mtdparts.c
> +++ b/cmd/mtdparts.c
> @@ -122,9 +122,6 @@ DECLARE_GLOBAL_DATA_PTR;
> #define MTDPARTS_DEFAULT NULL
> #endif
> #endif
> -#if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
> -extern void board_mtdparts_default(const char **mtdids, const char **mtdparts);
> -#endif
> static const char *mtdids_default = MTDIDS_DEFAULT;
> static const char *mtdparts_default = MTDPARTS_DEFAULT;
>
> @@ -1733,9 +1730,6 @@ int mtdparts_init(void)
> memset(last_ids, 0, sizeof(last_ids));
> memset(last_parts, 0, sizeof(last_parts));
> memset(last_partition, 0, sizeof(last_partition));
> -#if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
> - board_mtdparts_default(&mtdids_default, &mtdparts_default);
> -#endif
> use_defaults = 1;
> initialized = 1;
> }
> diff --git a/drivers/mtd/mtd_uboot.c b/drivers/mtd/mtd_uboot.c
> index d638f700d041..ed619abac390 100644
> --- a/drivers/mtd/mtd_uboot.c
> +++ b/drivers/mtd/mtd_uboot.c
> @@ -13,8 +13,6 @@
>
> #define MTD_NAME_MAX_LEN 20
>
> -void board_mtdparts_default(const char **mtdids, const char **mtdparts);
> -
> static const char *get_mtdids(void)
> {
> __maybe_unused const char *mtdparts = NULL;
> @@ -23,9 +21,7 @@ static const char *get_mtdids(void)
> if (mtdids)
> return mtdids;
>
> -#if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
> - board_mtdparts_default(&mtdids, &mtdparts);
> -#elif defined(MTDIDS_DEFAULT)
> +#if defined(MTDIDS_DEFAULT)
> mtdids = MTDIDS_DEFAULT;
> #elif defined(CONFIG_MTDIDS_DEFAULT)
> mtdids = CONFIG_MTDIDS_DEFAULT;
> @@ -133,9 +129,7 @@ static const char *get_mtdparts(void)
> if (mtdparts || !use_defaults)
> return mtdparts;
>
> -#if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
> - board_mtdparts_default(&mtdids, &mtdparts);
> -#elif defined(MTDPARTS_DEFAULT)
> +#if defined(MTDPARTS_DEFAULT)
> mtdparts = MTDPARTS_DEFAULT;
> #elif defined(CONFIG_MTDPARTS_DEFAULT)
> mtdparts = CONFIG_MTDPARTS_DEFAULT;
> diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h
> index b9d65697521b..280a094cdbae 100644
> --- a/include/configs/omap3_igep00x0.h
> +++ b/include/configs/omap3_igep00x0.h
> @@ -87,8 +87,6 @@
>
> #endif
>
> -#define CONFIG_SYS_MTDPARTS_RUNTIME
> -
> /* OneNAND config */
> #define CONFIG_USE_ONENAND_BOARD_INIT
> #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index b8addeaf693a..72608071c486 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -3511,7 +3511,6 @@ CONFIG_SYS_MRAM_SIZE
> CONFIG_SYS_MSC0_VAL
> CONFIG_SYS_MSC1_VAL
> CONFIG_SYS_MSC2_VAL
> -CONFIG_SYS_MTDPARTS_RUNTIME
> CONFIG_SYS_MX5_CLK32
> CONFIG_SYS_MX5_HCLK
> CONFIG_SYS_MX6_CLK32
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
next prev parent reply other threads:[~2018-12-11 22:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 15:38 [U-Boot] [PATCH 1/2] configs: igep: Define default mtdids/mtdparts Boris Brezillon
2018-12-10 15:38 ` [U-Boot] [PATCH 2/2] mtd: Get rid of board_mtdparts_default() Boris Brezillon
2018-12-10 21:50 ` Enric Balletbo Serra
2018-12-11 22:55 ` Ladislav Michl [this message]
2018-12-12 9:32 ` Boris Brezillon
2018-12-12 11:37 ` Ladislav Michl
2018-12-12 17:36 ` Boris Brezillon
2018-12-21 10:26 ` Enric Balletbo Serra
2018-12-10 21:50 ` [U-Boot] [PATCH 1/2] configs: igep: Define default mtdids/mtdparts Enric Balletbo Serra
2018-12-21 10:22 ` Enric Balletbo Serra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181211213409.GA11948@lenoch \
--to=ladis@linux-mips.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox