From: Masami Komiya <mkomiya@crossnet.co.jp>
To: David Woodhouse <dwmw2@infradead.org>
Cc: mtd@infradead.org
Subject: Re: (No Subject)
Date: Wed, 25 Apr 2001 21:19:40 +0900 [thread overview]
Message-ID: <3AE6C0DC.CFA18C77@crossnet.co.jp> (raw)
In-Reply-To: 25105.988194419@redhat.com
David Woodhouse wrote:
>
> mkomiya@crossnet.co.jp said:
> > Our hardware has one flash memory in 16bit mode. CPU is SH4 of
> > Hitachi. That is 32bit type CPU and can connect the device in 16bit
> > mode. In this case, interleave is 1 and bus width is 2.
>
> > Before using cfi->device_type instead of CFI_DEVICETYPE_X8 MTD driver
> > cannot calculate the address of the CFI command correctly.
>
> Which CFI command is being sent to the wrong address? The unlock commands?
Yes, unlock command in do_write_oneword() when the unalined data
is written.
> The cfi_cmdset_0002 code passes CFI_DEVICETYPE_X8 to the cfi_send_gen_cmd
> function when doing the unlock cycles, instead of cfi->device_type, because
> the unlock addresses (cfi->addr_unlock[12]) are supposed to have been
> pre-calculated so they don't need shifting.
>
> I think that cfi_probe.c calculates the correct addresses for 8-bit chips
> and for 16-bit chips in 8-bit mode. I suspect that we may be calculating
> the wrong unlock addresses for 16-bit chips which are actually in 16-bit
> mode.
When the unalined data is written in 16-bit mode,
word mode command is needed with 1bit shift for one interleave.
> Your patch changes 8-bit devices to use (0xaaa,0x555) and changes _all_
> 16-bit devices to use (0x555,0x2aa). I suspect that you should be changing
> only the 16-bit devices _in 16-bit mode_ to use 0x555, 0x2aa, while leaving
> the 16-bit devices in 8-bit mode as they were.
I was misunderstanding about the definitions in cfi_probe_chip().
Attached patch is for cfi_cmdset_0002.c applied simon's patch.
*** cfi_probe.c.org Wed Apr 18 17:26:35 2001
--- cfi_probe.c Wed Apr 25 20:52:03 2001
***************
*** 202,209 ****
cfi->addr_unlock2=0x2aa;
break;
case CFI_DEVICETYPE_X16:
! cfi->addr_unlock1=0xaaa;
! cfi->addr_unlock2=0x555;
break;
case CFI_DEVICETYPE_X32:
cfi->addr_unlock1=0x1555;
--- 202,215 ----
cfi->addr_unlock2=0x2aa;
break;
case CFI_DEVICETYPE_X16:
! if (map->buswidth == 2) {
! cfi->addr_unlock1=0x555;
! cfi->addr_unlock2=0x2aa;
! }
! else {
! cfi->addr_unlock1=0xaaa;
! cfi->addr_unlock2=0x555;
! }
break;
case CFI_DEVICETYPE_X32:
cfi->addr_unlock1=0x1555;
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
next prev parent reply other threads:[~2001-04-25 12:17 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-24 11:29 (No Subject) simon.munton
2001-04-24 14:46 ` David Woodhouse
2001-04-25 9:51 ` Masami Komiya
2001-04-25 10:26 ` David Woodhouse
2001-04-25 12:19 ` Masami Komiya [this message]
2001-04-25 12:26 ` David Woodhouse
2001-04-25 12:55 ` Masami Komiya
2001-04-25 13:30 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2001-05-02 15:17 (no subject) Zydla Tsui
2001-05-02 15:24 zud sdf
2001-05-02 15:32 ` David Woodhouse
2001-05-02 15:29 zud sdf
2001-05-02 15:59 zud sdf
2001-09-14 16:25 Siders, Keith
2001-09-14 16:32 ` David Woodhouse
2001-09-14 20:11 Siders, Keith
2001-12-19 19:01 ilatypov
2001-12-28 23:48 Sheela Kashyap
2001-12-28 23:52 ` David Woodhouse
2002-01-02 23:57 ` Sheela Kashyap
2002-01-03 0:06 ` David Woodhouse
2002-01-03 0:27 ` Sheela Kashyap
2002-01-03 9:26 ` David Woodhouse
2002-01-03 18:57 ` Sheela Kashyap
2002-01-03 15:46 Allen Curtis
2002-03-15 4:15 Jim Zeus
2002-03-15 9:27 ` David Woodhouse
2002-03-15 9:55 Jim Zeus
2002-03-15 10:15 ` David Woodhouse
2002-03-17 10:21 Jim Zeus
2002-03-17 10:32 ` David Woodhouse
2002-03-18 7:42 Jim Zeus
2002-03-18 8:38 ` David Woodhouse
2002-03-19 7:59 Jim Zeus
2002-03-27 8:01 Jim Zeus
2002-03-27 8:06 ` David Woodhouse
2002-04-11 6:13 Jim Zeus
2002-04-19 3:23 swimming_fisher
2002-04-29 14:19 Jim Zeus
2002-05-03 11:46 victor.martin
2002-06-19 2:24 Áº²¨
2002-07-02 17:00 Roy Lauer
2002-07-15 10:25 Valls Pellicer,Joan
2002-11-15 20:58 Wauviel
2002-11-19 21:13 BBRAM Jörn Engel
2002-11-20 2:01 ` (no subject) Taeil Um
2002-11-20 7:20 ` David Woodhouse
2002-11-21 8:40 ` Taeil Um
2004-11-16 11:42 Artem B. Bityuckiy
2004-11-16 13:48 Artem B. Bityuckiy
2004-11-16 13:55 ` David Woodhouse
2005-06-21 14:48 David L
2005-07-03 2:47 Amit Sharma
2005-07-03 12:04 ` Artem B. Bityuckiy
2005-07-18 12:06 murasfdg sjhfsd
2005-07-23 4:50 Mr.Derrick Tanner.
2005-09-15 13:22 Konstantin Kletschke
2005-10-20 16:05 Korolev, Alexey
2006-03-10 13:57 Selmeci, Tamas
2009-05-18 12:20 Mnl
2009-05-18 15:18 Mnl
2009-06-01 11:20 Mnl
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=3AE6C0DC.CFA18C77@crossnet.co.jp \
--to=mkomiya@crossnet.co.jp \
--cc=dwmw2@infradead.org \
--cc=mtd@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox