mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [RFC] MXS/i.MX23: detecting the boot source
Date: Tue, 21 May 2013 10:01:09 +0200	[thread overview]
Message-ID: <201305211001.09158.jbe@pengutronix.de> (raw)
In-Reply-To: <20130521065718.GK32299@pengutronix.de>

Sascha Hauer wrote:
> On Fri, May 17, 2013 at 10:18:39AM +0200, Juergen Beisert wrote:
> > The boot source for the i.MX23 is configured via a few GPIOs, which are
> > later be used for different purposes (like LCD data for example). The SoC
> > internal ROM reads these GPIOs and uses the selected boot source.
> >
> > For various reasons the boot source is also of interest when Barebox is
> > running. This detection approach reads again the GPIOs. It switches
> > temporarily the pins to act as GPIOs and input, reads their values, and
> > switches back to their previous functions.
> >
> > Could this be a reliable way to detect the boot source?
>
> I don't know. Are the bootstrap pins used as outputs only in the normal
> usecase? Otherwise I could imagine that something is overriding the
> bootstrap pins by the time you read them.

These where also my thoughts. The pins the ROM reads can also be used as
GPIO, LCD data out and for the Embedded Trace Macrocell (ETM). Maybe not 
perfectly reliable, but the chance is high that it works as expected.

There is no real latch register to save the settings after reset (at least I 
didn't found one). Maybe the ROM stores this value somewhere in the internal 
SRAM (like the i.MX28 ROM does), but how to know where....?

> > BTW: is there a reason why the bootsource will create environment
> > variables, while other detected features find their way to the "global"
> > device?
>
> No, at least not a good one ;)

Ahh, okay :)

> > +static uint32_t mxs23_boot_save_loc(void)
>
> Should you continue working on this please change the name to something
> like mx23_get_bootsource(). This function does not save anything.

Yes, will do so.

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

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

  reply	other threads:[~2013-05-21  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  8:18 Juergen Beisert
2013-05-21  6:57 ` Sascha Hauer
2013-05-21  8:01   ` Juergen Beisert [this message]
2013-05-21  8:44   ` [PATCH] MXS/i.MX23: add boot source detection Juergen Beisert
2013-05-23  7:54     ` 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=201305211001.09158.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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