CFI 1.4 intel cmdset in linux-2.4.21

Jason Chen jason_chen at usish.com
Fri Mar 17 20:10:20 EST 2006


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; \

})

..

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.infradead.org/pipermail/linux-mtd/attachments/20060318/17f4a691/attachment.html 


More information about the linux-mtd mailing list