<div dir="ltr"><div><span style="font-size:13.63636302948px">>> I will probably commit this patch before you get a chance to test it</span><br></div><span style="font-size:13.63636302948px">>> again because I want to do the 0.9.8 release soonish, but I'd</span><br style="font-size:13.63636302948px"><span style="font-size:13.63636302948px">>> appreciate a later test very much too if you want to do that.</span><br><div><span style="font-size:13.63636302948px">^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span></div><div><span style="font-size:13.63636302948px"><br></span></div><div><span style="font-size:13.63636302948px">Dear Stefan,</span></div><div><span style="font-size:13.63636302948px"><br></span></div><div><span style="font-size:13.63636302948px">      Thanks for the review and remedy.</span></div><div><span style="font-size:13.63636302948px">      Certainly, I will again verify the patch once it being committed into official svn-stream</span><span style="font-size:13.63636302948px"> </span><span style="font-size:13.63636302948px"> (Looks not in r1860 yet?)</span></div><div><span style="font-size:13.63636302948px">      and/or 0.9.8-release.</span></div><div><span style="font-size:13.63636302948px">   </span></div><div><span style="font-size:13.63636302948px">Thank you</span></div><div>Tai-Hong Wu (T.H.Wu Type</div><div><span style="font-size:13.63636302948px"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-26 23:36 GMT+08:00 Stefan Tauner <span dir="ltr"><<a href="mailto:stefan.tauner@alumni.tuwien.ac.at" target="_blank">stefan.tauner@alumni.tuwien.ac.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Silvermont (Bay Trail, Rangeley, Avoton) seems to still use the old<br>
density encoding with 3 bits per chip. Documentation is unavailable<br>
(held concealed by Intel) but thanks to the efforts of Tai-Hong<br>
(Type) Wu the layout is clear now. This patch is based on his one<br>
but solves the issue differently reducing the code complexity.<br>
<br>
Signed-off-by: T.H.Wu Type <<a href="mailto:thwu@lunartoday.com">thwu@lunartoday.com</a>><br>
Signed-off-by: Stefan Tauner <<a href="mailto:stefan.tauner@alumni.tuwien.ac.at">stefan.tauner@alumni.tuwien.ac.at</a>><br>
---<br>
<br>
Hello Tai-Hong,<br>
<br>
thanks a lot for your patch! And sorry for the late reply. Now that<br>
I got some time I have looked into your patch. Your solution seems<br>
to work fine but I decided that I'd rather move the dual output<br>
supported bit to the "common" bit field struct and rename all<br>
involved structs accordingly. This gets rid of the rather unreadable<br>
double ternary branch.<br>
<br>
I will probably commit this patch before you get a chance to test it<br>
again because I want to do the 0.9.8 release soonish, but I'd<br>
appreciate a later test very much too if you want to do that.<br>
<br>
 ich_descriptors.c | 38 +++++++++++++++++++-------------------<br>
 ich_descriptors.h | 18 +++++++-----------<br>
 2 files changed, 26 insertions(+), 30 deletions(-)<br>
<br>
diff --git a/ich_descriptors.c b/ich_descriptors.c<br>
index 1966f66..90f70ee 100644<br>
--- a/ich_descriptors.c<br>
+++ b/ich_descriptors.c<br>
@@ -127,27 +127,27 @@ static const char *pprint_density(enum ich_chipset cs, const struct ich_descript<br>
        case CHIPSET_ICH10:<br>
        case CHIPSET_5_SERIES_IBEX_PEAK:<br>
        case CHIPSET_6_SERIES_COUGAR_POINT:<br>
-       case CHIPSET_7_SERIES_PANTHER_POINT: {<br>
+       case CHIPSET_7_SERIES_PANTHER_POINT:<br>
+       case CHIPSET_BAYTRAIL: {<br>
                uint8_t size_enc;<br>
                if (idx == 0) {<br>
-                       size_enc = desc->component.old.comp1_density;<br>
+                       size_enc = desc->component.dens_old.comp1_density;<br>
                } else {<br>
-                       size_enc = desc->component.old.comp2_density;<br>
+                       size_enc = desc->component.dens_old.comp2_density;<br>
                }<br>
                if (size_enc > 5)<br>
                        return "reserved";<br>
                return size_str[size_enc];<br>
        }<br>
        case CHIPSET_8_SERIES_LYNX_POINT:<br>
-       case CHIPSET_BAYTRAIL:<br>
        case CHIPSET_8_SERIES_LYNX_POINT_LP:<br>
        case CHIPSET_8_SERIES_WELLSBURG:<br>
        case CHIPSET_9_SERIES_WILDCAT_POINT: {<br>
                uint8_t size_enc;<br>
                if (idx == 0) {<br>
-                       size_enc = desc->component.new.comp1_density;<br>
+                       size_enc = desc->component.dens_new.comp1_density;<br>
                } else {<br>
-                       size_enc = desc->component.new.comp2_density;<br>
+                       size_enc = desc->component.dens_new.comp2_density;<br>
                }<br>
                if (size_enc > 7)<br>
                        return "reserved";<br>
@@ -207,16 +207,16 @@ void prettyprint_ich_descriptor_component(enum ich_chipset cs, const struct ich_<br>
                msg_pdbg2("Component 2 density:            %s\n", pprint_density(cs, desc, 1));<br>
        else<br>
                msg_pdbg2("Component 2 is not used.\n");<br>
-       msg_pdbg2("Read Clock Frequency:           %s\n", pprint_freq(cs, desc->component.common.freq_read));<br>
-       msg_pdbg2("Read ID and Status Clock Freq.: %s\n", pprint_freq(cs, desc->component.common.freq_read_id));<br>
-       msg_pdbg2("Write and Erase Clock Freq.:    %s\n", pprint_freq(cs, desc->component.common.freq_write));<br>
-       msg_pdbg2("Fast Read is %ssupported.\n", desc->component.common.fastread ? "" : "not ");<br>
-       if (desc->component.common.fastread)<br>
+       msg_pdbg2("Read Clock Frequency:           %s\n", pprint_freq(cs, desc->component.modes.freq_read));<br>
+       msg_pdbg2("Read ID and Status Clock Freq.: %s\n", pprint_freq(cs, desc->component.modes.freq_read_id));<br>
+       msg_pdbg2("Write and Erase Clock Freq.:    %s\n", pprint_freq(cs, desc->component.modes.freq_write));<br>
+       msg_pdbg2("Fast Read is %ssupported.\n", desc->component.modes.fastread ? "" : "not ");<br>
+       if (desc->component.modes.fastread)<br>
                msg_pdbg2("Fast Read Clock Frequency:      %s\n",<br>
-                         pprint_freq(cs, desc->component.common.freq_fastread));<br>
+                         pprint_freq(cs, desc->component.modes.freq_fastread));<br>
        if (cs > CHIPSET_6_SERIES_COUGAR_POINT)<br>
                msg_pdbg2("Dual Output Fast Read Support:  %sabled\n",<br>
-                         desc->component.new.dual_output ? "dis" : "en");<br>
+                         desc->component.modes.dual_output ? "dis" : "en");<br>
        if (desc->component.FLILL == 0)<br>
                msg_pdbg2("No forbidden opcodes.\n");<br>
        else {<br>
@@ -816,22 +816,22 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors<br>
        case CHIPSET_5_SERIES_IBEX_PEAK:<br>
        case CHIPSET_6_SERIES_COUGAR_POINT:<br>
        case CHIPSET_7_SERIES_PANTHER_POINT:<br>
+       case CHIPSET_BAYTRAIL:<br>
                if (idx == 0) {<br>
-                       size_enc = desc->component.old.comp1_density;<br>
+                       size_enc = desc->component.dens_old.comp1_density;<br>
                } else {<br>
-                       size_enc = desc->component.old.comp2_density;<br>
+                       size_enc = desc->component.dens_old.comp2_density;<br>
                }<br>
                size_max = 5;<br>
                break;<br>
        case CHIPSET_8_SERIES_LYNX_POINT:<br>
-       case CHIPSET_BAYTRAIL:<br>
        case CHIPSET_8_SERIES_LYNX_POINT_LP:<br>
        case CHIPSET_8_SERIES_WELLSBURG:<br>
        case CHIPSET_9_SERIES_WILDCAT_POINT:<br>
                if (idx == 0) {<br>
-                       size_enc = desc->component.new.comp1_density;<br>
+                       size_enc = desc->component.dens_new.comp1_density;<br>
                } else {<br>
-                       size_enc = desc->component.new.comp2_density;<br>
+                       size_enc = desc->component.dens_new.comp2_density;<br>
                }<br>
                size_max = 7;<br>
                break;<br>
@@ -842,7 +842,7 @@ int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors<br>
        }<br>
<br>
        if (size_enc > size_max) {<br>
-               msg_perr("Density of ICH SPI component with index %d is invalid."<br>
+               msg_perr("Density of ICH SPI component with index %d is invalid.\n"<br>
                         "Encoded density is 0x%x while maximum allowed is 0x%x.\n",<br>
                         idx, size_enc, size_max);<br>
                return -1;<br>
diff --git a/ich_descriptors.h b/ich_descriptors.h<br>
index c41f9d9..2c21598 100644<br>
--- a/ich_descriptors.h<br>
+++ b/ich_descriptors.h<br>
@@ -123,23 +123,19 @@ struct ich_desc_component {<br>
                                 freq_fastread  :3,<br>
                                 freq_write     :3,<br>
                                 freq_read_id   :3,<br>
-                                               :2;<br>
-               } common;<br>
+                                dual_output    :1, /* new since Cougar Point/6 */<br>
+                                               :1;<br>
+               } modes;<br>
                struct {<br>
                        uint32_t comp1_density  :3,<br>
                                 comp2_density  :3,<br>
-                                               :11,<br>
-                                               :13,<br>
-                                               :2;<br>
-               } old;<br>
+                                               :26;<br>
+               } dens_old;<br>
                struct {<br>
                        uint32_t comp1_density  :4, /* new since Lynx Point/8 */<br>
                                 comp2_density  :4,<br>
-                                               :9,<br>
-                                               :13,<br>
-                                dual_output    :1, /* new since Cougar Point/6 */<br>
-                                               :1;<br>
-               } new;<br>
+                                               :24;<br>
+               } dens_new;<br>
        };<br>
        union {                 /* 0x04 */<br>
                uint32_t FLILL; /* Flash Invalid Instructions Register */<br>
<span class="HOEnZb"><font color="#888888">--<br>
Kind regards, Stefan Tauner<br>
<br>
</font></span></blockquote></div><br></div></div>