public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] IXP425: Improving print_cpuinfo code Part 1/1
Date: Tue, 16 Dec 2008 22:54:07 +0100	[thread overview]
Message-ID: <20081216215407.GI24266@game.jcrosoft.org> (raw)
In-Reply-To: <49384718.RDeSlY+9Cb0AIN+u%stefan.althoefer@web.de>

On 22:09 Thu 04 Dec     , Stefan Althoefer wrote:
> [PATCH] IXP425: Improving print_cpuinfo code
> 
> The existing version of print_cpuinfo did read the
> processor ID and detects clock speed from this.
> 
> This is not correct, as the IXP425 has the ability
> to "downgrade" clock speed by using strapping resistors.
> 
> The improved code reads strapping information from
> register and corrects the actual clock speed. Both
> information are displayed.
> 
> 
> The patch is against "latest" u-boot git-repository
> 
> Please (still) be patient if style of submission or patches are
> offending.
> 
> Signed-off-by: Stefan Althoefer <stefan.althoefer@web.de>
> ----
> 
> diff -uprN u-boot-orig//cpu/ixp/cpu.c u-boot/cpu/ixp/cpu.c
> --- u-boot-orig//cpu/ixp/cpu.c	2008-12-02 17:25:31.000000000 +0100
> +++ u-boot/cpu/ixp/cpu.c	2008-12-03 11:35:37.000000000 +0100
> @@ -45,32 +45,68 @@ DECLARE_GLOBAL_DATA_PTR;
>  int print_cpuinfo (void)
>  {
>  	unsigned long id;
> +	unsigned long cfg_clk;
>  	int speed = 0;
> +	int model = 0;
>  
>  	asm ("mrc p15, 0, %0, c0, c0, 0":"=r" (id));
> +	cfg_clk = *IXP425_EXP_CFG0 >> 21;
please use readx/writex 
>  
> -	puts("CPU:   Intel IXP425 at ");
> +	puts("CPU:   Intel IXP42X");
>  	switch ((id & 0x000003f0) >> 4) {
>  	case 0x1c:
> -		loops_per_jiffy = 887467;
> -		speed = 533;
> +		model = 533;
> +		switch (cfg_clk) {
> +		case 0x1:
> +			speed = 400;
> +			break;
> +		case 0x3:
> +			speed = 266;
> +			break;
> +		default:
> +			speed = 533;
> +			break;
> +		}
>  		break;
>  
>  	case 0x1d:
> -		loops_per_jiffy = 666016;
> -		speed = 400;
> +		model = 400;
> +		switch (cfg_clk) {
> +		case 0x3:
> +			speed = 266;
> +			break;
> +		default:
> +			speed = 400;
> +			break;
> +		}
>  		break;
>  
>  	case 0x1f:
> -		loops_per_jiffy = 442901;
> +		model = 266;
>  		speed = 266;
>  		break;
>  	}
>  
> +	/* FIXME: is there any need for the jiffies? */
	for the IRQ delay
> +	switch (speed) {
> +	case 266:
> +		loops_per_jiffy = 442901;
> +		break;
> +	case 400:
> +		loops_per_jiffy = 666016;
> +		break;
> +	case 533:
> +		loops_per_jiffy = 887467;
> +		break;
> +	}
Best Regards,
J.

  parent reply	other threads:[~2008-12-16 21:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 21:09 [U-Boot] [PATCH] IXP425: Changing serial port initialization sequence Part 1/1 Stefan Althoefer
2008-12-04 21:09 ` [U-Boot] [PATCH] IXP425: Improving print_cpuinfo code " Stefan Althoefer
2008-12-04 21:08   ` [U-Boot] [PATCH] ARM: add IDE init to lib_arm/board.c " Stefan Althoefer
2008-12-16 21:58     ` Jean-Christophe PLAGNIOL-VILLARD
2008-12-16 23:19       ` Stefan Althoefer
2008-12-17 12:45         ` michael
2008-12-17 13:10           ` michael
2008-12-17 14:35             ` Jean-Christophe PLAGNIOL-VILLARD
2008-12-17 20:47               ` Stefan Althoefer
2008-12-17  7:56       ` michael
2008-12-16 21:54   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2008-12-16 22:28     ` [U-Boot] [PATCH] IXP425: Improving print_cpuinfo code " Stefan Althoefer
2008-12-16 23:18       ` 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=20081216215407.GI24266@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --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