[U-Boot] [PATCH v2 02/22] omap4: add OMAP4430 revision check

Wolfgang Denk
2011-05-15T19:09:11Z

Dear Aneesh V,

In message <1305472900-4004-3-git-send-email-aneesh@ti.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> ---
> V2:
> * Added a revision string in addition to the revision number
> Helps in printing out the OMAP revision at bootup
...
> +const char *omap4_rev_string(void)
> +{
> + const char *omap4_rev = NULL;
> + switch (omap4_revision()) {
> + case OMAP4430_ES1_0:
> + omap4_rev = "OMAP4430 ES1.0";
> + break;
> + case OMAP4430_ES2_0:
> + omap4_rev = "OMAP4430 ES2.0";
> + break;
> + case OMAP4430_ES2_1:
> + omap4_rev = "OMAP4430 ES2.1";
> + break;
> + case OMAP4430_ES2_2:
> + omap4_rev = "OMAP4430 ES2.2";
> + break;

Such code does not really scale well. Can this not be improved? I
think we just had similar discussions for i.MX5x - please check what
the result of these was.

> + default:
> + omap4_rev = "OMAP4 - Unknown Rev";
> + break;

Please also output what the unknown revision was - this saves at least
one debug round if you ever run into this case.

> +}
> diff --git a/arch/arm/include/asm/arch-omap4/omap4.h b/arch/arm/include/asm/arch-omap4/omap4.h
> index a30bb33..1f88732 100644
> --- a/arch/arm/include/asm/arch-omap4/omap4.h
> +++ b/arch/arm/include/asm/arch-omap4/omap4.h
> @@ -51,6 +51,11 @@
> #define CONTROL_PADCONF_CORE (OMAP44XX_L4_CORE_BASE + 0x100000)
> #define CONTROL_PADCONF_WKUP (OMAP44XX_L4_CORE_BASE + 0x31E000)
>
> +/* CONTROL_ID_CODE */
> +#define CONTROL_ID_CODE (CTRL_BASE + 0x204)

C struct?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Change is the essential process of all existence.
-- Spock, "Let That Be Your Last Battlefield",
stardate 5730.2