All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hector Palacios <hector.palacios@digi.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] env_mmc: make board configurable the partition for the environment
Date: Wed, 15 Jan 2014 17:37:55 +0100	[thread overview]
Message-ID: <52D6B963.1050301@digi.com> (raw)
In-Reply-To: <CAP9ODKr-KwKpRP3gYK1t5qWaWBJPuA6DrPrkLNEof3fRUfJtAw@mail.gmail.com>

Hello Otavio,

On 01/15/2014 12:09 PM, Otavio Salvador wrote:
> Hello Hector,
>
> On Wed, Jan 15, 2014 at 8:53 AM, Hector Palacios <hector.palacios@digi.com
> <mailto:hector.palacios@digi.com>> wrote:
>
>     This complements commit 9404a5fc7cb58 "env_mmc: allow environment to be
>     in an eMMC partition" by allowing boards to accommodate the partition
>     to use for the environment in different scenarios (similarly to what is
>     done with the mmc dev number). Depending on the detected boot media,
>     boards may decide to store the environment in a different partition.
>
>     The __weak function also allows to remove some ifdefs from the code.
>     If CONFIG_SYS_MMC_ENV_PART is not defined, partition 0 is assumed
>     (default value for U-Boot when a partition is not provided).
>
>     Signed-off-by: Hector Palacios <hector.palacios@digi.com
>     <mailto:hector.palacios@digi.com>>
>     CC: Stephen Warren <swarren at nvidia.com <mailto:swarren@nvidia.com>>
>     CC: Andy Fleming <afleming at freescale.com <mailto:afleming@freescale.com>>
>     ---
>       common/env_mmc.c | 27 +++++++++++++++------------
>       1 file changed, 15 insertions(+), 12 deletions(-)
>
>     diff --git a/common/env_mmc.c b/common/env_mmc.c
>     index 78c2bc7a1f08..d569b070e005 100644
>     --- a/common/env_mmc.c
>     +++ b/common/env_mmc.c
>     @@ -64,6 +64,13 @@ __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32
>     *env_addr)
>       __weak int mmc_get_env_devno(void)
>       {
>              return CONFIG_SYS_MMC_ENV_DEV;
>     +
>     +__weak int mmc_get_env_partno(void)
>     +{
>     +#ifdef CONFIG_SYS_MMC_ENV_PART
>     +       return CONFIG_SYS_MMC_ENV_PART;
>     +#endif
>     +       return 0;
>
>
> Maybe:
>
> #ifndef CONFIG_SYS_MMC_ENV_PART
> #define CONFIG_SYS_MMC_ENV_PART 0
> #endif
>
> __weak int mmc_get_env_partno(void)
> {
>      return CONFIG_SYS_MMC_ENV_PART;
> }

Much better. I'll do this for both patches. Thanks.

Best regards,
--
Hector Palacios

  reply	other threads:[~2014-01-15 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 10:53 [U-Boot] [PATCH 1/2] env_mmc: make board configurable the partition for the environment Hector Palacios
2014-01-15 10:53 ` [U-Boot] [PATCH 2/2] env_mmc: default to 0 if CONFIG_SYS_MMC_ENV_DEV not defined Hector Palacios
2014-01-15 11:10   ` Otavio Salvador
2014-01-15 17:40   ` Stephen Warren
2014-01-16 18:13     ` Hector Palacios
2014-01-15 11:09 ` [U-Boot] [PATCH 1/2] env_mmc: make board configurable the partition for the environment Otavio Salvador
2014-01-15 16:37   ` Hector Palacios [this message]
2014-01-15 17:37 ` Stephen Warren

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=52D6B963.1050301@digi.com \
    --to=hector.palacios@digi.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.