All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: Charles Hardin <ckhardin@exablox.com>
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	David Daney <david.daney@cavium.com>,
	Jeremy Fitzhardinge <jeremy@exablox.com>
Subject: Re: [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during boot
Date: Fri, 07 Sep 2012 10:57:35 -0700	[thread overview]
Message-ID: <504A358F.50904@gmail.com> (raw)
In-Reply-To: <1346853293-9166-1-git-send-email-ckhardin@exablox.com>

On 09/05/2012 06:54 AM, Charles Hardin wrote:
> The cavium code assumed that all NOR on the boot bus was
> an 8-bit NOR part and hardcoded the bankwidth. The simple
> solution was to add the code that queries the configuration
> register for the width of the bus that has been hardware strapped
> to the Cavium. This allows both 8-bit and 16-bit parts to be
> discovered during boot.
>
> Signed-off-by: Charles Hardin <ckhardin@exablox.com>
>
> diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c
> index e44a55b..9e46976 100644
> --- a/arch/mips/cavium-octeon/flash_setup.c
> +++ b/arch/mips/cavium-octeon/flash_setup.c
> @@ -51,7 +51,17 @@ static int __init flash_init(void)
>   		flash_map.name = "phys_mapped_flash";
>   		flash_map.phys = region_cfg.s.base << 16;
>   		flash_map.size = 0x1fc00000 - flash_map.phys;
> -		flash_map.bankwidth = 1;
> +		switch (region_cfg.s.width) {
> +		default:
> +		case 0:
> +			/* 8-bit bus */
> +			flash_map.bankwidth = 1;
> +			break;
> +		case 1:
> +			/* 16-bit bus */
> +			flash_map.bankwidth = 2;
> +			break;
> +		}

A slightly less verbose version of this would be:

-       flash_map.bankwidth = 1;
+       flash_map.bankwidth = region_cfg.s.width + 1;


Can you test that instead?

If it works, Acked-by me.

David Daney

  reply	other threads:[~2012-09-07 17:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 13:54 [PATCH] mips/octeon: 16-Bit NOR flash was not being detected during boot Charles Hardin
2012-09-07 17:57 ` David Daney [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-05 20:19 Charles Hardin

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=504A358F.50904@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=ckhardin@exablox.com \
    --cc=david.daney@cavium.com \
    --cc=jeremy@exablox.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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.