public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [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 19:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-06-03  1:53     ` [U-Boot] [PATCH 3/3] Beagle Convert the board version detection to use the OMAP3 GPIO interface Tom Rix
2009-06-03 18:30       ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-03 18:44     ` [U-Boot] [PATCH 2/3 V3] ZOOM2 detect the version of the zoom2 board at runtime Jean-Christophe PLAGNIOL-VILLARD
2009-06-03 19:05       ` Tom
2009-06-03 18:21   ` [U-Boot] [PATCH 1/3] Fix a typo in the instructions on using omap3's gpio interface Jean-Christophe PLAGNIOL-VILLARD
2009-06-03 18:43     ` Tom

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