From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 16 Sep 2010 13:05:52 +0200 Subject: [U-Boot] [PATCH] Kirkwood: print_cpuinfo fixed for valid devid revid In-Reply-To: <1284648724-6871-1-git-send-email-prafulla@marvell.com> References: <1284648724-6871-1-git-send-email-prafulla@marvell.com> Message-ID: <4C91FA10.6080105@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.