public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Zoom2, Beagle board revision detection.
@ 2009-05-29 14:58 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-31 16:23 ` [U-Boot] Zoom2, Beagle board revision detection Dirk Behme
  0 siblings, 2 replies; 9+ messages in thread
From: Tom Rix @ 2009-05-29 14:58 UTC (permalink / raw)
  To: u-boot

This is against the arm/next branch 

Zoom2 has two meaningful board revisions : production and beta.  This change
will allow the board differences to be handled at runtime.  

The Zoom2 change is based on how the Beagle Board does its board revision
but since it is newer, it uses the OMAP3 GPIO API that was recently added. 

This was run tested on Zoom2 beta and production boards.

Since I was taking a close look at the Beagle code,  I updated it to also
use the OMAP3 GPIO API.

This was run tested on a Beagle B7 board.  A version C board was not 
available for testing.  It would be good if someone verified the Beagle change
with a versioin C board.   

Tom

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2
@ 2009-06-03  1:53 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
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Rix @ 2009-06-03  1:53 UTC (permalink / raw)
  To: u-boot

Jean-Christophe, 

Based on your review I have made the changes you asked for. 

Tom

> @@ -60,6 +61,46 @@ static u32 gpmc_serial_TL16CP754C[GPMC_MAX_REG] = {
>  	0x1D0904C4, 0
>  };
>  
> +/* 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
> +

Tom : Ok added
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
> +}

Tom : Ok done.
See
+	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

Tom : Ok
See 
+typedef enum {
+	ZOOM2_REVISION_UNKNOWN = 0,
+	ZOOM2_REVISION_ALPHA,
+	ZOOM2_REVISION_BETA,
+	ZOOM2_REVISION_PRODUCTION
+} ZOOM2_REVISION;

----------------------------------------------------------

Also changed this comment in beagle.c

 /*
  * 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-03 18:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox