mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mci: core: add device parameter for eMMC boot ack
Date: Mon, 18 May 2020 11:06:00 +0200	[thread overview]
Message-ID: <8fb591b12086537f6a87bbd5056b6c38f506e99d.camel@pengutronix.de> (raw)
In-Reply-To: <20200518070848.GP11869@pengutronix.de>

Am Montag, den 18.05.2020, 09:08 +0200 schrieb Sascha Hauer:
> On Wed, May 13, 2020 at 01:46:36PM +0200, Lucas Stach wrote:
> > This adds an easy way to enable the boot acknowledge function of
> > a eMMC device, without the need to frob the EXT_CSD setting via
> > the mmc_extcsd command.
> > A boot ack is required whenever the boot partitions are read via
> > the fast initialization boot protocol.
> > 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> >  drivers/mci/mci-core.c | 33 +++++++++++++++++++++++++++------
> >  include/mci.h          |  2 ++
> >  2 files changed, 29 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> > index f3718327f18d..d33bc0c1a41e 100644
> > --- a/drivers/mci/mci-core.c
> > +++ b/drivers/mci/mci-core.c
> > @@ -516,6 +516,7 @@ static int mmc_change_freq(struct mci *mci)
> >  
> >  		mci->ext_csd_part_config = mci->ext_csd[EXT_CSD_PARTITION_CONFIG];
> >  		mci->bootpart = (mci->ext_csd_part_config >> 3) & 0x7;
> > +		mci->boot_ack_enable = (mci->ext_csd_part_config >> 6) & 0x1;
> >  	}
> >  
> >  	return 0;
> > @@ -1592,6 +1593,17 @@ static int mci_set_boot(struct param_d *param, void *priv)
> >  			  EXT_CSD_PARTITION_CONFIG, mci->ext_csd_part_config);
> >  }
> >  
> > +static int mci_set_boot_ack(struct param_d *param, void *priv)
> > +{
> > +	struct mci *mci = priv;
> > +
> > +	mci->ext_csd_part_config &= ~(0x1 << 6);
> > +	mci->ext_csd_part_config |= mci->boot_ack_enable << 6;
> > +
> > +	return mci_switch(mci,
> > +			  EXT_CSD_PARTITION_CONFIG, mci->ext_csd_part_config);
> > +}
> 
> There's only one correct setting for each board or SoC. Instead of
> letting the user choose between right and wrong, can't we add a hook to
> be called from the board/SoC code? A device tree property might be an
> option as well, something like barebox,enable-boot-ack.

A DT property might work, but my initial line of thinking was to set
this from a platform specific barebox_update call, where having the
parameter would certainly help to keep some sort of abstraction.

Regards,
Lucas


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-05-18  9:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 11:46 Lucas Stach
2020-05-18  7:08 ` Sascha Hauer
2020-05-18  9:06   ` Lucas Stach [this message]
2020-08-31 12:20   ` Jan Lübbe
2022-05-20  4:34   ` Ahmad Fatoum
2022-05-30 11:40     ` Sascha Hauer

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=8fb591b12086537f6a87bbd5056b6c38f506e99d.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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