U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] TQM8xx: Fix CFI flash driver support for all TQM8xx based boards
Date: Wed, 17 Sep 2008 06:11:45 +0200	[thread overview]
Message-ID: <200809170611.45914.sr@denx.de> (raw)
In-Reply-To: <1221594389-27663-1-git-send-email-wd@denx.de>

Hi Wolfgang,

On Tuesday 16 September 2008, Wolfgang Denk wrote:
> After switching to using the CFI flash driver, the correct remapping
> of the flash banks was forgotten.
>
> Also, some boards were not adapted, and the old legacy flash driver
> was not removed yet.

Please find some nitpicking comments below.

<snip>

> diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c
> index 96b6103..59bbdbc 100644
> --- a/board/tqc/tqm8xx/tqm8xx.c
> +++ b/board/tqc/tqm8xx/tqm8xx.c
> @@ -1,5 +1,5 @@
>  /*
> - * (C) Copyright 2000-2006
> + * (C) Copyright 2000-2008
>   * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>   *
>   * See file CREDITS for list of people who contributed to this
> @@ -21,16 +21,14 @@
>   * MA 02111-1307 USA
>   */
>
> -#if 0
> -#define DEBUG
> -#endif
> -
>  #include <common.h>
>  #include <mpc8xx.h>
>  #ifdef CONFIG_PS2MULT
>  #include <ps2mult.h>
>  #endif
>
> +extern flash_info_t flash_info[];	/* FLASH chips info */
> +
>  DECLARE_GLOBAL_DATA_PTR;
>
>  static long int dram_size (long int, long int *, long int);
> @@ -451,24 +449,107 @@ int board_early_init_r (void)
>
>  #endif /* CONFIG_PS2MULT */
>
> -/*
> ---------------------------------------------------------------------------
>- */ -/* HMI10 specific stuff								*/
> -/*
> ---------------------------------------------------------------------------
>- */ -#ifdef CONFIG_HMI10
>
> +#ifdef CONFIG_MISC_INIT_R
>  int misc_init_r (void)
>  {
> -# ifdef CONFIG_IDE_LED
> -	volatile immap_t *immap = (immap_t *) CFG_IMMR;
> +	volatile immap_t     *immap  = (immap_t *)CFG_IMMR;
> +	volatile memctl8xx_t *memctl = &immap->im_memctl;
> +
> +#ifdef	CFG_OR_TIMING_FLASH_AT_50MHZ
> +	int scy, trlx, flash_or_timing, clk_diff;
> +
> +	scy = (CFG_OR_TIMING_FLASH_AT_50MHZ & OR_SCY_MSK) >> 4;
> +	if (CFG_OR_TIMING_FLASH_AT_50MHZ & OR_TRLX) {
> +		trlx = OR_TRLX;
> +		scy *= 2;
> +	} else
> +		trlx = 0;
> +
> +		/*
> +		 * We assume that each 10MHz of bus clock require 1-clk SCY
> +		 * adjustment.
> +		 */
> +	clk_diff = (gd->bus_clk / 1000000) - 50;

Indentation looks wrong here.

> +
> +		/*
> +		 * We need proper rounding here. This is what the "+5" and "-5"
> +		 * are here for.
> +		 */
> +	if (clk_diff >= 0)
> +		scy += (clk_diff + 5) / 10;
> +	else
> +		scy += (clk_diff - 5) / 10;

And here. And other places below too.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2008-09-17  4:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 19:46 [U-Boot] [PATCH] TQM8xx: Fix CFI flash driver support for all TQM8xx based boards Wolfgang Denk
2008-09-17  4:11 ` Stefan Roese [this message]
2008-09-17  8:10   ` Wolfgang Denk

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=200809170611.45914.sr@denx.de \
    --to=sr@denx.de \
    --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