From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/7] OMAP3: Beagle: Add board revision detection
Date: Thu, 05 Feb 2009 20:12:48 +0100 [thread overview]
Message-ID: <498B3A30.2030900@googlemail.com> (raw)
In-Reply-To: <20090204232213.GJ31498@game.jcrosoft.org>
Dear Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
>
>> /******************************************************************************
>> + * Routine: board_identify
>> + * Description: Detect if we are running on a Beagle revision Ax/Bx or
>> + * Cx. This can be done by GPIO_171. If this is low, we are
>> + * running on a revision C board.
>> + *****************************************************************************/
>> +void board_identify(void)
>> +{
>> + gpio_t *gpio6_base = (gpio_t *)OMAP34XX_GPIO6_BASE;
>> +
>> + /* Configure GPIO 171 as input */
> we may need to start to think about merge to the gpiolib to simplify it
>> + writel(readl(&gpio6_base->oe) | GPIO11, &gpio6_base->oe);
>> +
>> + /* Get value of GPIO 171 */
>> + beagle_revision_c = readl(&gpio6_base->datain) & BOARD_REVISION_MASK;
>> +
>> + printf("Board revision ");
>> + if (beagle_revision_c) {
> ???
> I'm not a fan of glabal var
And I'm not a fan of bad weather. But I'm not sure if it really
matters here what we are fans of? ;)
> please create a function that will return if it's
> a rev c or not
And where should this function you propose get the info from which
board revision it is?
Note that we follow here (and in the serial number patch) the concept
of "touch hardware only once, remember the value and then deal with
the remembered value. Don't touch hardware again if done already".
I.e. it's the concept behind this to not have a function to read HW
(and do masking etc) again and again if revision value is needed.
Dirk
next prev parent reply other threads:[~2009-02-05 19:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 5:53 [U-Boot] [PATCH 0/7] OMAP3: Add some additional improvements and fixes Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 1/7] OMAP3: Overo: Clean up pin mux and GPIO configuration Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 2/7] OMAP3: Beagle: Add board revision detection Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 3/7] OMAP3: Add OMAP3 auto detection Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 4/7] OMAP3: Pandora: Update pin mux Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 5/7] OMAP3: Add serial number based on die ID Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 6/7] OMAP3: Add OMAP3 core changes for MUSB Dirk Behme
2009-02-02 5:53 ` [U-Boot] [PATCH 7/7] OMAP3: Clean up MMC code Dirk Behme
2009-02-11 22:26 ` [U-Boot] [PATCH 6/7] OMAP3: Add OMAP3 core changes for MUSB Jean-Christophe PLAGNIOL-VILLARD
2009-02-12 18:56 ` Dirk Behme
2009-02-04 23:28 ` [U-Boot] [PATCH 5/7] OMAP3: Add serial number based on die ID Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:14 ` Dirk Behme
2009-02-11 22:24 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-12 18:56 ` Dirk Behme
2009-02-11 22:34 ` Wolfgang Denk
2009-02-04 23:24 ` [U-Boot] [PATCH 4/7] OMAP3: Pandora: Update pin mux Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:13 ` Dirk Behme
2009-02-05 19:52 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 20:01 ` Dirk Behme
2009-02-05 20:54 ` Grazvydas Ignotas
2009-02-04 23:22 ` [U-Boot] [PATCH 2/7] OMAP3: Beagle: Add board revision detection Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:12 ` Dirk Behme [this message]
2009-02-11 22:17 ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-04 23:18 ` [U-Boot] [PATCH 1/7] OMAP3: Overo: Clean up pin mux and GPIO configuration Jean-Christophe PLAGNIOL-VILLARD
2009-02-05 19:11 ` Dirk Behme
2009-02-04 12:46 ` [U-Boot] [PATCH 0/7] OMAP3: Add some additional improvements and fixes Jason Kridner
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=498B3A30.2030900@googlemail.com \
--to=dirk.behme@googlemail.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