public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* CFI 1.4 intel cmdset in linux-2.4.21
@ 2006-03-18  1:10 Jason Chen
  2006-04-03 17:13 ` Nicolas Pitre
  2006-04-04  9:30 ` Alexey, Korolev
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Chen @ 2006-03-18  1:10 UTC (permalink / raw)
  To: linux-mtd

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* CFI 1.4 intel cmdset in linux-2.4.21
@ 2006-03-18  7:02 Jason Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Chen @ 2006-03-18  7:02 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 2105 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: 14331 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CFI 1.4 intel cmdset in linux-2.4.21
  2006-03-18  1:10 CFI 1.4 intel cmdset in linux-2.4.21 Jason Chen
@ 2006-04-03 17:13 ` Nicolas Pitre
  2006-04-04  9:30 ` Alexey, Korolev
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Pitre @ 2006-04-03 17:13 UTC (permalink / raw)
  To: Jason Chen; +Cc: linux-mtd

On Sat, 18 Mar 2006, Jason Chen wrote:

> 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. 
> 
[...]
> 
> What happened? What should I do to solve this issue?

Upgrade to a later kernel where this is known to be fixed, or backport 
the latest MTD snapshot to your old kernel (but then you're on your 
own if you do so).


Nicolas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CFI 1.4 intel cmdset in linux-2.4.21
  2006-03-18  1:10 CFI 1.4 intel cmdset in linux-2.4.21 Jason Chen
  2006-04-03 17:13 ` Nicolas Pitre
@ 2006-04-04  9:30 ` Alexey, Korolev
  1 sibling, 0 replies; 4+ messages in thread
From: Alexey, Korolev @ 2006-04-04  9:30 UTC (permalink / raw)
  To: Jason Chen; +Cc: linux-mtd

Hi Chen,

It looks that you have updated MTD of Linux 2.4.21. Default MTD of Linux 
2.4.21 doesn't attempt to parse h/w partitions.

To avoid issues I would recommend you to use Linux 2.4.21 without 
additional MTD patches.
This case just substitution of '3' for '4' in cfi_cmdset_0001.c will 
help you.

Thanks,
Alexey

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-04  9:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-18  1:10 CFI 1.4 intel cmdset in linux-2.4.21 Jason Chen
2006-04-03 17:13 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox