[U-Boot] [PATCH] OMAP3: Print correct silicon revision
Dirk Behme
dirk.behme at googlemail.com
Thu Apr 23 16:45:28 CEST 2009
Dear Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 21:53 Tue 21 Apr , Sanjeev Premi wrote:
>> The function display_board_info() displays the silicon
>> revision as 2 - based on the return value from get_cpu_rev().
>>
>> This is incorrect as the current Si version is 3.1
>>
>> This patch displays the correct version; but does not
>> change get_cpu_rev() to minimize the code impact.
>>
>> Signed-off-by: Sanjeev Premi <premi at ti.com>
>> ---
>> cpu/arm_cortexa8/omap3/sys_info.c | 37 +++++++++++++++++++++++++++++++++++--
>> 1 files changed, 35 insertions(+), 2 deletions(-)
>>
>> diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c
>> index b385b91..8c6a4d6 100644
>> --- a/cpu/arm_cortexa8/omap3/sys_info.c
>> +++ b/cpu/arm_cortexa8/omap3/sys_info.c
>> @@ -36,6 +36,8 @@ static gpmc_csx_t *gpmc_cs_base = (gpmc_csx_t *)GPMC_CONFIG_CS0_BASE;
>> static sdrc_t *sdrc_base = (sdrc_t *)OMAP34XX_SDRC_BASE;
>> static ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE;
>>
>> +static char omap_revision[8] = "";
> why 8?
> you only have 5 chars
> so
> static char omap_revision[6] = "";
> will be enough
>> +
>> /*****************************************************************
>> * dieid_num_r(void) - read and set die ID
>> *****************************************************************/
>> @@ -90,6 +92,36 @@ u32 get_cpu_rev(void)
>>
>> }
>>
> why not this
> in the cpu header
>
> #define ES20 1
> #define ES21 2
> #define ES30 3
> #define ES31 4
>> +/**
>> + * Converts cpu revision into a string
>> + */
>> +void set_omap_revision(void)
> char* get_str_omap_revision(void)
> {
> u32 idcode;
> ctrl_id_t *id_base;
>
> if (omap_revision[0] != '\0')
> return omap_revision;
>
> if (get_cpu_rev() == CPU_3430_ES1) {
> strcat (omap_revision, "ES1.0");
> }
> else {
> id_base = (ctrl_id_t *)OMAP34XX_ID_L4_IO_BASE;
>
> idcode = readl(&id_base->idcode) >> 28;
>
> switch(idcode) {
> case ES20:
> strcat (omap_revision, "ES2.0");
> break;
> case ES21:
> strcat (omap_revision, "ES2.1");
> break;
> case ES30:
> strcat (omap_revision, "ES3.0");
> break;
> case ES31:
> strcat (omap_revision, "ES3.1");
> break;
> default:
> strcat (str_rev, "ES??");
> }
> return omap_revision;
> }
Did you notice that we had some discussion about this and that Premi
will send an completely redone patch, soon?
http://lists.denx.de/pipermail/u-boot/2009-April/051186.html
http://lists.denx.de/pipermail/u-boot/2009-April/051187.html
http://lists.denx.de/pipermail/u-boot/2009-April/051191.html
http://lists.denx.de/pipermail/u-boot/2009-April/051189.html
http://lists.denx.de/pipermail/u-boot/2009-April/051193.html
http://lists.denx.de/pipermail/u-boot/2009-April/051194.html
http://lists.denx.de/pipermail/u-boot/2009-April/051228.html
http://lists.denx.de/pipermail/u-boot/2009-April/051241.html
Dirk
More information about the U-Boot
mailing list