Message ID | AANLkTikGFyT-0PgmOsQ6V7Wbm=TTRgPYPcbAum4JTRj3@mail.gmail.com |
---|---|
State | Changes Requested |
Delegated to: | Sandeep Paulraj |
Headers | show |
Dear Asad Akbar, In message <AANLkTikGFyT-0PgmOsQ6V7Wbm=TTRgPYPcbAum4JTRj3@mail.gmail.com> you wrote: > --===============1953672346== > Content-Type: multipart/alternative; boundary=90e6ba4fc2ea812fab049e842c5a > > --90e6ba4fc2ea812fab049e842c5a > Content-Type: text/plain; charset=ISO-8859-1 Please send patches always in-line, never as attachements. > --- Signed-off-by: line missing. > @@ -3,8 +3,9 @@ > * Texas Instruments, <www.ti.com> > * > * Author : > - * Aneesh V <aneesh@ti.com> > - * Steve Sakoman <steve@sakoman.com> > + * Aneesh V <aneesh@ti.com> > + * Steve Sakoman <steve@sakoman.com> > + * Asad Akbar <asadakbar@gmail.com> Please omit unrelated changes. > +/** > + * Registers addresses. > + */ > +#define DEVICE_IDENTIFICATION_BASE 0x4A002000 > +#define DIE_ID_0 0x200 > +#define ID_CODE 0x204 > +#define DIE_ID_1 0x208 > +#define DIE_ID_2 0x20C > +#define DIE_ID_3 0x210 > +#define PROD_ID_0 0x214 > +#define PROD_ID_1 0x218 Please use a C struct instead. > +#define DEVICE_TYPE_GP 0xF0 > +#define DEVICE_TYPE_HS 0xF1 /* TODO: It has to be > updated. */ > +#define DEVICE_TYPE_EMU 0xF2 /* TODO: It has to be > updated. */ > +#define DEVICE_TYPE_TST 0xF3 /* TODO: It has to be > updated. */ Your patch is corrupted by line wrapping. Please use "git send-email" to submit patches. See http://www.denx.de/wiki/U-Boot/Patches > + /* Reader PROD_ID_0 register. */ > + val32 = __raw_readl (DEVICE_IDENTIFICATION_BASE + PROD_ID_0); NAK. Please use C structs. Are you absolutely sure that you must use __raw_readl() here? Also, there are white space errors. Please make sure to run your patch through checkpatch.pl before submitting. > u32 get_board_rev(void) > { > - return 0x20; > + return 0x20; NAK. Please stick to the coding style. > int print_cpuinfo(void) > { > + u32 val32; > + u32 id[4] = { 0 }; > + > + /* Reader ID_CODE register. */ > + val32 = __raw_readl (DEVICE_IDENTIFICATION_BASE + ID_CODE); > + > + /* Make sure that it is as per documentation. */ > + if (val32 & 0x1) > + { > + /** > + * Get silicon type. > + */ > + if (val32 == 0x0B85202F) > + { > + printf("Silicon Type: OMAP4430 ES1.0\n"); > + } > + else if (val32 == 0x1B85202F) > + { > + printf("Silicon Type: OMAP4430 ES2.0\n"); NAK. Please stick to the coding style. Best regards, Wolfgang Denk
diff --git a/arch/arm/cpu/armv7/omap4/sys_info.c b/arch/arm/cpu/armv7/omap4/sys_info.c index b9e5765..14145fb 100644 --- a/arch/arm/cpu/armv7/omap4/sys_info.c +++ b/arch/arm/cpu/armv7/omap4/sys_info.c @@ -3,8 +3,9 @@ * Texas Instruments, <www.ti.com> * * Author : - * Aneesh V <aneesh@ti.com> - * Steve Sakoman <steve@sakoman.com> + * Aneesh V <aneesh@ti.com> + * Steve Sakoman <steve@sakoman.com> + * Asad Akbar <asadakbar@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -25,12 +26,40 @@ #include <common.h> #include <asm/arch/sys_proto.h> +/** + * Registers addresses. + */ +#define DEVICE_IDENTIFICATION_BASE 0x4A002000 +#define DIE_ID_0 0x200 +#define ID_CODE 0x204 +#define DIE_ID_1 0x208 +#define DIE_ID_2 0x20C +#define DIE_ID_3 0x210 +#define PROD_ID_0 0x214 +#define PROD_ID_1 0x218 + +/** + * Device types + */ +#define DEVICE_TYPE_GP 0xF0 +#define DEVICE_TYPE_HS 0xF1 /* TODO: It has to be updated. */ +#define DEVICE_TYPE_EMU 0xF2 /* TODO: It has to be updated. */ +#define DEVICE_TYPE_TST 0xF3 /* TODO: It has to be updated. */ + /* * get_device_type(): tell if GP/HS/EMU/TST */ u32 get_device_type(void) { - return 0; + u32 val32; + + /* Reader PROD_ID_0 register. */ + val32 = __raw_readl (DEVICE_IDENTIFICATION_BASE + PROD_ID_0); + + /* Get only device type bits. */ + val32 &= 0xFF; + + return (val32);