public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1]: environment in eMMC boot partition
Date: Sat, 8 Oct 2016 19:50:58 -0400	[thread overview]
Message-ID: <20161008235058.GA23927@bill-the-cat> (raw)
In-Reply-To: <alpine.LFD.2.20.1610081501260.24822@maverick.koi8.net>

On Sat, Oct 08, 2016 at 03:41:50PM -0700, Sergey Kubushyn wrote:
> On Sat, 8 Oct 2016, Tom Rini wrote:
> 
> >On Wed, Oct 05, 2016 at 01:28:07PM -0700, Sergey Kubushyn wrote:
> >
> >>This allows to place U-Boot environment into eMMC boot partition thus
> >>saving space on user partition for the OS (or whatever.) When booting
> >>off of eMMC many (all?) MCUs can use dedicated boot0/boot1 partitions
> >>to boot so U-Boot (or SPL) is written to one (or both) such partitions.
> >>When such boot configuration is used it makes sense to place environment
> >>in the same partition where the U-Boot itself is so the entire user
> >>partition is available for the OS.
> >>
> >>It might be not well polished yet but it is a simple patch that can be
> >>reworked later.
> >>
> >>It uses 4 Kconfig variables right now which probably belong to the board
> >>Kconfig. Those are:
> >>
> >>CONFIG_ENV_IN_EMMC_BOOT -- tells that environment is in eMMC boot
> >> partition if defined
> >>
> >>CONFIG_EMMC_ENV_PART -- tells which boot partition environment should be
> >> stored in (either 1 or 2)
> >>
> >>CONFIG_EMMC_BOOT_PART -- which boot partition will be used by eMMC to
> >> read U-Boot/SPL binary for boot protocol (either 1 or 2.) That can be
> >> different from the environment partition
> >>
> >>CONFIG_EMMC_BOOT_ACK -- tells that eMMC should provide boot ACKs if
> >> defined
> >>
> >>Here is an excerpt from actual board Kconfig:
> >
> >I think what's missing is that in the other cases where we do
> >environment in the eMMC boot partitions we don't need the boot ack part.
> >Can you see if the existing hooks work, when you add in something for
> >boot ack?
> 
> Eh, I _DO_ use existing hook. And one of the parameters passed to that
> hook is boot ack (drivers/mmc/mmc_boot.c, line 101):
> 
> === Cut ===
> int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
> === Cut ===
> 
> I could've just set it to 0 unconditionally but there might be some board
> configs that might require it to be enabled so I made it configurable.
> 
> And I don't think we have any boards with environment in boot partition
> because there is simply no support for this in common/enc_mmc.c. Remember,

I've put environment on the boot partitions on the eMMC on Beaglebone
black for a number of years.  See include/configs/am335x_evm.h:
#elif defined(CONFIG_EMMC_BOOT)
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV          1
#define CONFIG_SYS_MMC_ENV_PART         2
#define CONFIG_ENV_OFFSET               0x0
#define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET +
CONFIG_ENV_SIZE)
#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

Now, I fully accept that it's not working in your case and there must be
something further needed.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/e02f10cf/attachment.sig>

  reply	other threads:[~2016-10-08 23:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 20:28 [U-Boot] [PATCH 1/1]: environment in eMMC boot partition Sergey Kubushyn
2016-10-08 17:46 ` Tom Rini
2016-10-08 22:41   ` Sergey Kubushyn
2016-10-08 23:50     ` Tom Rini [this message]
2016-10-09  0:40       ` Sergey Kubushyn
2016-10-08 23:52     ` Tom Rini

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=20161008235058.GA23927@bill-the-cat \
    --to=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox