[U-Boot] [PATCH 2/3] ZOOM2 detect the version of the zoom2 board at runtime.

Tom Tom.Rix at windriver.com
Wed Jun 3 04:07:56 CEST 2009


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




More information about the U-Boot mailing list