[U-Boot] [PATCH] Kirkwood: print_cpuinfo fixed for valid devid revid

Albert ARIBAUD albert.aribaud at free.fr
Thu Sep 16 13:05:52 CEST 2010


Hi Prafulla,

Le 16/09/2010 16:52, Prafulla Wadaskar a écrit :

 > diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c 
b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
 > index 82c978b..5feb0b5 100644
 > --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c
 > +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c

 > @@ -271,20 +272,32 @@ static void kw_sysrst_check(void)
 >   #if defined(CONFIG_DISPLAY_CPUINFO)
 >   int print_cpuinfo(void)
 >   {
 > -	char *name = "Unknown";
 > +	char *rev, name[6];
 > +	u16 devid = (readl(KW_REG_PCIE_DEVID)>>  16)&  0xffff;
 > +	u8 revid = readl(KW_REG_PCIE_REVID)&  0xff;
 >
 > -	switch (readl(KW_REG_DEVICE_ID)&  0x03) {
 > -	case 1:
 > -		name = "88F6192_A0";
 > +	if ((readl(KW_REG_DEVICE_ID)&  0x03)>  2) {
 > +		debug("Error.. %s:Unsupported Kirkwood SoC\n", __FUNCTION__);

Maybe you could add the actual content of the device ID register so that 
the operator can read it on the console?

 > +		return -1;
 > +	}
 > +
 > +	switch (revid) {
 > +	case 0:
 > +		rev = "Z0";
 >   		break;
 >   	case 2:
 > -		name = "88F6281_A0";
 > +		rev = "A0";
 > +		break;
 > +	case 3:
 > +		rev = "A1";
 >   		break;
 >   	default:
 > -		printf("SoC:   Unsupported Kirkwood\n");
 > -		return -1;
 > +		rev = "??";

Same here with this "??": replacing it with the actual revision ID 
register value would allow the operator to read it directly on the console.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list