<p>Furquan Shaikh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25306">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/ifdtool: Fix region access control for SKL/KBL<br><br>The default values used by ifdtool for setting region access control<br>do not match the expected values for SKL/KBL as per the SPI<br>programming guide. This change adds platform "sklkbl" that sets region<br>access control bits differently for SKL/KBL images.<br><br>BUG=b:76098647<br>BRANCH=poppy<br>TEST=Verified that the access control bits on KBL images is set<br>correctly.<br><br>Change-Id: I1328d8006c25be282b3223268d8f1fd0a64e2ed3<br>Signed-off-by: Furquan Shaikh <furquan@google.com><br>---<br>M util/ifdtool/ifdtool.c<br>M util/ifdtool/ifdtool.h<br>2 files changed, 18 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/25306/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c</span><br><span>index 8397f5c..290c777 100644</span><br><span>--- a/util/ifdtool/ifdtool.c</span><br><span>+++ b/util/ifdtool/ifdtool.c</span><br><span>@@ -826,6 +826,20 @@</span><br><span>                 /* TXE can only write Device Expansion */</span><br><span>            fmba->flmstr2 |= 0x20 << wr_shift;</span><br><span>          break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case PLATFORM_SKLKBL:</span><br><span style="color: hsl(120, 100%, 40%);">+         /* CPU/BIOS can read descriptor, BIOS and GbE. */</span><br><span style="color: hsl(120, 100%, 40%);">+             fmba->flmstr1 |= 0xb << rd_shift;</span><br><span style="color: hsl(120, 100%, 40%);">+            /* CPU/BIOS can write BIOS and Gbe. */</span><br><span style="color: hsl(120, 100%, 40%);">+                fmba->flmstr1 |= 0xa << wr_shift;</span><br><span style="color: hsl(120, 100%, 40%);">+            /* ME can read descriptor, ME and GbE. */</span><br><span style="color: hsl(120, 100%, 40%);">+             fmba->flmstr2 |= 0xd << rd_shift;</span><br><span style="color: hsl(120, 100%, 40%);">+            /* ME can write ME. */</span><br><span style="color: hsl(120, 100%, 40%);">+                fmba->flmstr2 |= 0x4 << wr_shift;</span><br><span style="color: hsl(120, 100%, 40%);">+            /* GbE can read GbE and descriptor. */</span><br><span style="color: hsl(120, 100%, 40%);">+                fmba->flmstr3 |= 0x9 << rd_shift;</span><br><span style="color: hsl(120, 100%, 40%);">+            /* GbE can write GbE. */</span><br><span style="color: hsl(120, 100%, 40%);">+              fmba->flmstr3 |= 0x8 << wr_shift;</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</span><br><span>       default:</span><br><span>             /* CPU/BIOS can read descriptor, BIOS, and GbE. */</span><br><span>           fmba->flmstr1 |= 0xb << rd_shift;</span><br><span>@@ -1325,6 +1339,8 @@</span><br><span>           case 'p':</span><br><span>                    if (!strcmp(optarg, "aplk")) {</span><br><span>                             platform = PLATFORM_APOLLOLAKE;</span><br><span style="color: hsl(120, 100%, 40%);">+                       } else if (!strcmp(optarg, "sklkbl")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             platform = PLATFORM_SKLKBL;</span><br><span>                  } else {</span><br><span>                             fprintf(stderr, "Unknown platform: %s\n", optarg);</span><br><span>                                 exit(EXIT_FAILURE);</span><br><span>diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h</span><br><span>index cd5af79..ad299a9 100644</span><br><span>--- a/util/ifdtool/ifdtool.h</span><br><span>+++ b/util/ifdtool/ifdtool.h</span><br><span>@@ -22,7 +22,8 @@</span><br><span> };</span><br><span> </span><br><span> enum platform {</span><br><span style="color: hsl(0, 100%, 40%);">-       PLATFORM_APOLLOLAKE</span><br><span style="color: hsl(120, 100%, 40%);">+   PLATFORM_APOLLOLAKE,</span><br><span style="color: hsl(120, 100%, 40%);">+  PLATFORM_SKLKBL,</span><br><span> };</span><br><span> </span><br><span> #define LAYOUT_LINELEN 80</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25306">change 25306</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/25306"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I1328d8006c25be282b3223268d8f1fd0a64e2ed3 </div>
<div style="display:none"> Gerrit-Change-Number: 25306 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Furquan Shaikh <furquan@google.com> </div>