<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="chsdate"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="chmetcnv"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:&#23435;&#20307;;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@&#23435;&#20307;";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
 /* Page Definitions */
 @page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>

<div class=Section1 style='layout-grid:15.6pt'>

<p class=MsoNormal style='layout-grid-mode:char'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'>Hi, all,<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>I
am trying to use cfi <st1:chmetcnv TCSC="0" NumberType="1" Negative="False"
HasSpace="True" SourceValue="1.4" UnitName="in" w:st="on">1.4 in</st1:chmetcnv>
linux-<st1:chsdate IsROCDate="False" IsLunarDate="False" Day="30" Month="12"
Year="1899" w:st="on">2.4.21</st1:chsdate>(use Intel P30 strata flash), as I
find in datasheet, Intel extended query structure is almost the same in CFI 1.3
&amp; 1.4. <o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>So
I just modified some code about CFI MinorVersion&#8217;s judgement in cfi_cmdset_0001.c
and cfi_cmdset_0001.h:<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>I
got CFI_QUERY_SIZE as 36, and I can read the MajorVersion,</span></font><span
lang=EN-US> </span><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>MinorVersion etc in the query, but the number of
device hard-partition always read as zero.<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>What
happened? What should I do to solve this issue?<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>in
cfi_cmdset_0001.h:<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&#8230;.<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>#define
CFI_READ_QUERY(map, base, adr, extp, size) \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>do
{&nbsp; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
struct cfi_private *__cfi = map-&gt;fldrv_priv; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int __ofs_factor = __cfi-&gt;interleave * __cfi-&gt;device_type; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int __i; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (__i=0; __i&lt;(size); __i++)&nbsp; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
((unsigned char*)(extp))[__i] =&nbsp; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cfi_read_query(map, (base+(((adr)+__i)*__ofs_factor))); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>}while(0);
<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>#define
CFI_QUERY_SIZE(map, base, adr) ({ \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
struct cfi_private *__cfi = map-&gt;fldrv_priv; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int __ofs_factor = __cfi-&gt;interleave * __cfi-&gt;device_type; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
struct cfi_pri_intelext __ext; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
struct cfi_intelext_regioninfo __rinfo; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int __ofs = 0, __num_r, __ri; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CFI_READ_QUERY(map, base, adr, (&amp;__ext), sizeof(__ext)); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs += sizeof(__ext); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (__ext.MajorVersion == '1' &amp;&amp; ((__ext.MinorVersion == '3') ||<b><span
style='font-weight:bold'> (__ext.MinorVersion == '4')</span></b>)) { \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs += (__ext.NumProtectionFields - 1) * (sizeof(__u32) + 6); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs += 6; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__num_r = cfi_read_query(map, (base + ((adr+__ofs)*__ofs_factor))); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs ++; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (__ri=0; __ri &lt; __num_r; __ri++) { \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CFI_READ_QUERY(map, base, adr+__ofs, (&amp;__rinfo), sizeof(__rinfo)); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs += sizeof(__rinfo); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs += (__rinfo.NumBlockTypes - 1) * sizeof(struct cfi_intelext_blockinfo); \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
__ofs; \<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>})<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>&#8230;.<o:p></o:p></span></font></p>

<p class=MsoNormal align=left style='text-align:left;layout-grid-mode:char'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Times New Roman"><span lang=EN-US><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>