From: Tom <Tom.Rix@windriver.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2 board at runtime.
Date: Tue, 02 Jun 2009 21:07:56 -0500 [thread overview]
Message-ID: <4A25DAFC.103@windriver.com> (raw)
In-Reply-To: <20090601162235.GC6399@game.jcrosoft.org>
Jean-Christophe,
I have resubmitted the board revision patches based on your comments.
Tom
Jean-Christophe PLAGNIOL-VILLARD wrote:
>>
>> +/* Used to track the revision of the board */
>> +int zoom2_revision = ZOOM2_REVISION_UNKNOWN;
>>
> add static and as the beagle provide a function to get the current version
>
Ok see
+/* Used to track the revision of the board */
+static ZOOM2_REVISION zoom2_revision = ZOOM2_REVISION_UNKNOWN;
+
+/*
+ * Routine: zoom2_get_revision
+ * Description: Return the revision of the Zoom2 this code is running on.
+ */
+ZOOM2_REVISION zoom2_get_revision(void)
+{
+ return zoom2_revision;
+}
>> + printf("Board revision ");
>> + if (ZOOM2_REVISION_PRODUCTION == zoom2_revision)
>> + printf("Production\n");
>> + else if (ZOOM2_REVISION_BETA == zoom2_revision)
>> + printf("Beta\n");
>> + else
>> + printf("Unknown\n");
>>
> please use switch
>
Ok see
+ printf("Board revision ");
+ switch (zoom2_revision) {
+ case (ZOOM2_REVISION_PRODUCTION):
+ printf("Production\n");
+ break;
+ case (ZOOM2_REVISION_BETA):
+ printf("Beta\n");
+ break;
+ default:
+ printf("Unknown\n");
+ break;
+ }
+}
>>
>> +#define ZOOM2_REVISION_UNKNOWN 0
>> +#define ZOOM2_REVISION_ALPHA 1
>> +#define ZOOM2_REVISION_BETA 2
>> +#define ZOOM2_REVISION_PRODUCTION 3
>>
> please use an emum
>
>
Ok see
+typedef enum {
+ ZOOM2_REVISION_UNKNOWN = 0,
+ ZOOM2_REVISION_ALPHA,
+ ZOOM2_REVISION_BETA,
+ ZOOM2_REVISION_PRODUCTION
+}
I also made a slight change to the beagle.c in patch 3/3 comment here
/*
* Routine: beagle_get_revision
- * Description: Return revision of the BeagleBoard this code is running on.
+ * Description: Return the revision of the BeagleBoard this code is
running on.
* If it is a revision Ax/Bx board, this function returns 0,
* on a revision C board you will get a 1.
*/
next prev parent reply other threads:[~2009-06-03 2:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-29 14:58 [U-Boot] Zoom2, Beagle board revision detection Tom Rix
2009-05-29 14:58 ` [U-Boot] [PATCH 1/3] Fix a typo in the instructions on using omap3's gpio interface Tom Rix
2009-05-29 14:58 ` [U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2 board at runtime Tom Rix
2009-05-29 14:58 ` [U-Boot] [PATCH 3/3] Beagle Convert the board version detection to use the OMAP3 GPIO interface Tom Rix
2009-06-01 16:22 ` [U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2 board at runtime Jean-Christophe PLAGNIOL-VILLARD
2009-06-03 2:07 ` Tom [this message]
2009-06-03 18:29 ` [U-Boot] [PATCH 1/3] Fix a typo in the instructions on using omap3's gpio interface Jean-Christophe PLAGNIOL-VILLARD
2009-05-31 16:23 ` [U-Boot] Zoom2, Beagle board revision detection Dirk Behme
-- strict thread matches above, loose matches on Subject: below --
2009-06-03 1:53 [U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2 Tom Rix
2009-06-03 1:53 ` [U-Boot] [PATCH 1/3] Fix a typo in the instructions on using omap3's gpio interface Tom Rix
2009-06-03 1:53 ` [U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2 board at runtime Tom Rix
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=4A25DAFC.103@windriver.com \
--to=tom.rix@windriver.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