public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jason Chen" <jason_chen@usish.com>
To: <linux-mtd@lists.infradead.org>
Subject: CFI 1.4 intel cmdset in linux-2.4.21
Date: Sat, 18 Mar 2006 01:10:20 -0000	[thread overview]
Message-ID: <001e01c64a28$a55fe3f0$6601a8c0@IT0010600> (raw)

[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]

Hi, all,

I am trying to use cfi 1.4 in linux-2.4.21(use Intel P30 strata flash), as I
find in datasheet, Intel extended query structure is almost the same in CFI
1.3 & 1.4. 

So I just modified some code about CFI MinorVersion's judgement in
cfi_cmdset_0001.c and cfi_cmdset_0001.h:

 

I got CFI_QUERY_SIZE as 36, and I can read the MajorVersion, MinorVersion
etc in the query, but the number of device hard-partition always read as
zero.

 

What happened? What should I do to solve this issue?

 

in cfi_cmdset_0001.h:

..

#define CFI_READ_QUERY(map, base, adr, extp, size) \

do {  \

         struct cfi_private *__cfi = map->fldrv_priv; \

         int __ofs_factor = __cfi->interleave * __cfi->device_type; \

         int __i; \

         for (__i=0; __i<(size); __i++)  \

                   ((unsigned char*)(extp))[__i] =  \

                            cfi_read_query(map,
(base+(((adr)+__i)*__ofs_factor))); \

}while(0); 

 

#define CFI_QUERY_SIZE(map, base, adr) ({ \

         struct cfi_private *__cfi = map->fldrv_priv; \

         int __ofs_factor = __cfi->interleave * __cfi->device_type; \

         struct cfi_pri_intelext __ext; \

         struct cfi_intelext_regioninfo __rinfo; \

         int __ofs = 0, __num_r, __ri; \

         CFI_READ_QUERY(map, base, adr, (&__ext), sizeof(__ext)); \

         __ofs += sizeof(__ext); \

         if (__ext.MajorVersion == '1' && ((__ext.MinorVersion == '3') ||
(__ext.MinorVersion == '4'))) { \

                   __ofs += (__ext.NumProtectionFields - 1) * (sizeof(__u32)
+ 6); \

                   __ofs += 6; \

                   __num_r = cfi_read_query(map, (base +
((adr+__ofs)*__ofs_factor))); \

                   __ofs ++; \

                   for (__ri=0; __ri < __num_r; __ri++) { \

                            CFI_READ_QUERY(map, base, adr+__ofs, (&__rinfo),
sizeof(__rinfo)); \

                            __ofs += sizeof(__rinfo); \

                            __ofs += (__rinfo.NumBlockTypes - 1) *
sizeof(struct cfi_intelext_blockinfo); \

                   } \

         } \

         __ofs; \

})

..

 

 

 


[-- Attachment #2: Type: text/html, Size: 14421 bytes --]

             reply	other threads:[~2006-03-18  1:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-18  1:10 Jason Chen [this message]
2006-04-03 17:13 ` CFI 1.4 intel cmdset in linux-2.4.21 Nicolas Pitre
2006-04-04  9:30 ` Alexey, Korolev
  -- strict thread matches above, loose matches on Subject: below --
2006-03-18  7:02 Jason Chen

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='001e01c64a28$a55fe3f0$6601a8c0@IT0010600' \
    --to=jason_chen@usish.com \
    --cc=linux-mtd@lists.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