public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stelian Pop <stelian@popies.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2] Add display cpuinfo for Atmel at91 arm926ejs based	cores
Date: Mon, 1 Jun 2009 21:59:55 +0200	[thread overview]
Message-ID: <20090601195953.GA4991@galileo> (raw)
In-Reply-To: <1243880503-25092-1-git-send-email-linux@bohmer.net>

Hi R?my,

I do have a few comments, see below:

On Mon, Jun 01, 2009 at 08:21:42PM +0200, Remy Bohmer wrote:

>  V2 reworked comments from Jean-Christophe PLAGNIOL-VILLARD
[...]

> +COBJS-$(CONFIG_DISPLAY_CPUINFO) +=cpuinfo.o

missing space ?

> +	switch ((cidr & AT91_CIDR_EPROC) >> 5) {
> +	 /* 0x1 = ARM946ES, 0x2 = ARM7TDMI, 0x4 = ARM920T */
> +	case 0x5: txt = "ARM926EJS";	break;
> +	default:  txt = "undefined";	break;

since there are only four choices (until now at least...), why not
put the 'txt' for all of them ?

and the 'undefined' string is not a good choice: it represents a
configuration not known to U-Boot, but its numeric value is well
defined. So I suggest you change this to 'unknown', or even better,
'unknown: 0xfoo'.

> +	}
> +	printf("Embedded Processor: %s\n", txt);
> +
> +	switch ((cidr & AT91_CIDR_ARCH) >> 20) {
> +	case 0x19: txt = "AT91SAM9xx";		break;
> +	case 0x29: txt = "AT91SAM9XExx";	break;
> +	case 0x39: txt = "CAP9";		break;
> +	default:   txt = "undefined";		break;

same comments as above for 'undefined'.

> +	switch ((cidr & AT91_CIDR_NVPTYP) >> 28) {
> +	case 0x0: txt = "ROM";				 break;
> +	case 0x1: txt = "ROMless or onchip flash";	 break;
> +	case 0x2: txt = "Embedded flash memory";	 break;
> +	case 0x3: txt = "ROM and Embedded flash memory"; break;
> +	case 0x4: txt = "SRAM emulating ROM";		 break;
> +	default:  txt = "undefined";			 break;

ditto.

> +	switch (cidr & AT91_CIDR_SRAMSIZ) {
> +	case AT91_CIDR_SRAMSIZ_1K: txt = "1K";		break;
> +	case AT91_CIDR_SRAMSIZ_2K: txt = "2K";		break;
> +	case AT91_CIDR_SRAMSIZ_112K: txt = "112K";	break;
> +	case AT91_CIDR_SRAMSIZ_4K: txt = "4K";		break;
> +	case AT91_CIDR_SRAMSIZ_80K: txt = "80K";	break;
> +	case AT91_CIDR_SRAMSIZ_160K: txt = "160K";	break;
> +	case AT91_CIDR_SRAMSIZ_8K: txt = "8K";		break;
> +	case AT91_CIDR_SRAMSIZ_16K: txt = "16K";	break;
> +	case AT91_CIDR_SRAMSIZ_32K: txt = "32K";	break;
> +	case AT91_CIDR_SRAMSIZ_64K: txt = "64K";	break;
> +	case AT91_CIDR_SRAMSIZ_128K: txt = "128K";	break;
> +	case AT91_CIDR_SRAMSIZ_256K: txt = "256K";	break;
> +	case AT91_CIDR_SRAMSIZ_96K: txt = "96K";	break;
> +	case AT91_CIDR_SRAMSIZ_512K: txt = "512K";	break;
> +	default:  txt = "undefined";			break;

bad alignment here (you did align the 'txt =' properly in all other
switch/case statements, but not here).

ditto for 'undefined'.

Stelian.

-- 
Stelian Pop <stelian@popies.net>

  parent reply	other threads:[~2009-06-01 19:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-02 20:06 [U-Boot] [patch] Add display cpuinfo for Atmel at91sam9261 Cores Remy Bohmer
2009-05-18 20:25 ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-01 18:21   ` [U-Boot] [PATCH V2] Add display cpuinfo for Atmel at91 arm926ejs based cores Remy Bohmer
2009-06-01 18:21     ` [U-Boot] [PATCH] Enable display CPU-Info for at91sam9261 Remy Bohmer
2009-06-01 20:03       ` Stelian Pop
2009-06-01 20:22         ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-02 19:17           ` Remy Bohmer
2009-06-01 19:59     ` Stelian Pop [this message]
2009-06-01 20:20       ` [U-Boot] [PATCH V2] Add display cpuinfo for Atmel at91 arm926ejs based cores Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090601195953.GA4991@galileo \
    --to=stelian@popies.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox