All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ppc4xx: Fix FDT EBC mappings on Canyonlands
Date: Mon, 22 Jun 2009 13:18:39 +0200	[thread overview]
Message-ID: <200906221318.40016.sr@denx.de> (raw)
In-Reply-To: <1245668897-20971-1-git-send-email-felix@embedded-sol.com>

Hi Felix,

On Monday 22 June 2009 13:08:17 Felix Radensky wrote:
> This patch fixes 2 problems with FDT EBC mappings on Canyonlands.
> First, NAND EBC mapping was missing, making Linux NAND driver
> unusable on this board. Second, NOR remapping code assumed that
> NOR is always on CS0, however when booting from NAND NOR is on CS3.
> ---
>  board/amcc/canyonlands/canyonlands.c |   38
> ++++++++++++++++++++++++++------- include/configs/canyonlands.h        |   
> 2 +
>  2 files changed, 32 insertions(+), 8 deletions(-)
>
> diff --git a/board/amcc/canyonlands/canyonlands.c
> b/board/amcc/canyonlands/canyonlands.c index 2b74689..78c32b0 100644
> --- a/board/amcc/canyonlands/canyonlands.c
> +++ b/board/amcc/canyonlands/canyonlands.c
> @@ -577,20 +577,42 @@ int misc_init_r(void)
>  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
>  void ft_board_setup(void *blob, bd_t *bd)
>  {
> -	u32 val[4];
>  	int rc;
> +	int i;
> +	u32 bxcr;
> +	u32 ranges[EBC_NUM_BANKS * 4];
> +	u32 *p = ranges;
> +	char *ebc_path = "/plb/opb/ebc";
>
>  	ft_cpu_setup(blob, bd);
>
> +	/*
> +	 * Read 4xx EBC bus bridge registers to get mappings of the
> +	 * peripheral banks into the OPB/PLB address space
> +	 */
> +	for (i = 0; i < EBC_NUM_BANKS; i++) {
> +		mtdcr(ebccfga, EBC_BXCR(i));
> +		bxcr = mfdcr(ebccfgd);
> +
> +		if ((bxcr & EBC_BXCR_BU_MASK) != EBC_BXCR_BU_NONE) {
> +			*p++ = i;
> +			*p++ = 0;
> +			*p++ = bxcr & EBC_BXCR_BAS_MASK;
> +			*p++ = EBC_BXCR_BANK_SIZE(bxcr);
> +		}
> +	}

This is a copy from cpu/ppc4xx/fdt.c. I suggest you just call 
__ft_board_setup() and just additionally fixup the canyonlands specifics to 
not duplicate this code.

Thanks.

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:[~2009-06-22 11:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 11:08 [U-Boot] [PATCH] ppc4xx: Fix FDT EBC mappings on Canyonlands Felix Radensky
2009-06-22 11:18 ` Stefan Roese [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-06-22 12:30 Felix Radensky
2009-06-23  8:43 ` Stefan Roese

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=200906221318.40016.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.