From: Oleksij Rempel <linux@rempel-privat.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] cfi_flash: size_ratio should not be 0
Date: Thu, 23 May 2013 15:37:18 +0200 [thread overview]
Message-ID: <519E1B8E.1000502@rempel-privat.de> (raw)
In-Reply-To: <20130523131341.GN32299@pengutronix.de>
Am 23.05.2013 15:13, schrieb Sascha Hauer:
> On Wed, May 22, 2013 at 09:53:40AM +0200, Oleksij Rempel wrote:
>> We will get size = 0 if size_ratio = 0
>>
>> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
>> ---
>> drivers/mtd/nor/cfi_flash.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
>> index 4b4e29d..85e96ce 100644
>> --- a/drivers/mtd/nor/cfi_flash.c
>> +++ b/drivers/mtd/nor/cfi_flash.c
>> @@ -371,7 +371,8 @@ static ulong flash_get_size (struct flash_info *info)
>> size_ratio = info->portwidth / info->chipwidth;
>> /* if the chip is x8/x16 reduce the ratio by half */
>> if ((info->interface == FLASH_CFI_X8X16)
>> - && (info->chipwidth == FLASH_CFI_BY8)) {
>> + && (info->chipwidth == FLASH_CFI_BY8)
>> + && (size_ratio != 1)) {
>> size_ratio >>= 1;
>> }
>
> Could you elaborate in which constellation this happens?
It happens in my case with MX29LV320MBTC attached to atheros ar2313.
Both of them support x8 and x16 modes, but attached only in x8. Plus
this chip enables LSB in 8 bit mode.
--
Regards,
Oleksij
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-05-23 13:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 7:53 [PATCH 0/2] cfi fixes Oleksij Rempel
2013-05-22 7:53 ` [PATCH 1/2 v2] cfi_flash: add shift option for some cfi memory chips Oleksij Rempel
2013-05-23 13:13 ` Sascha Hauer
2013-05-22 7:53 ` [PATCH 2/2] cfi_flash: size_ratio should not be 0 Oleksij Rempel
2013-05-23 13:13 ` Sascha Hauer
2013-05-23 13:37 ` Oleksij Rempel [this message]
2013-05-27 8:30 ` Sascha Hauer
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=519E1B8E.1000502@rempel-privat.de \
--to=linux@rempel-privat.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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