<p>Pratikkumar V Prajapati has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21008">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">device_t struct: Introduce device specific data field<br><br>Let device store anything it needs. For CPU, data pointer would<br>store microcode patch address (MP init code sets it now). This would be<br>efficient as, device_t can be located easily and its data can be accessed.<br><br>e.g. to get microcode patch address for CPU device<br><br>device_t dev = dev_find_path(NULL, DEVICE_PATH_CPU_CLUSTER);<br>and then dev->data can be used, rather than loading microcode each<br>time from boot media.<br><br>Change-Id: I7e377621dd9c00388c4e148c451f9e01cb7fe4fa<br>Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com><br>---<br>M src/include/device/device.h<br>M src/soc/intel/common/block/cpu/mp_init.c<br>2 files changed, 3 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/08/21008/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/include/device/device.h b/src/include/device/device.h<br>index 54d4ec3..04962dd 100644<br>--- a/src/include/device/device.h<br>+++ b/src/include/device/device.h<br>@@ -146,6 +146,7 @@<br>  const char *name;<br> #endif<br>    DEVTREE_CONST void *chip_info;<br>+       const void *data; /* device specific data. Store anything you want */<br> };<br> <br> /**<br>diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c<br>index fd8b5db..7e57b79 100644<br>--- a/src/soc/intel/common/block/cpu/mp_init.c<br>+++ b/src/soc/intel/common/block/cpu/mp_init.c<br>@@ -102,7 +102,7 @@<br>  */<br> void get_microcode_info(const void **microcode, int *parallel)<br> {<br>- *microcode =microcode_patch;<br>+ *microcode = microcode_patch;<br>         *parallel = 1;<br> }<br> <br>@@ -114,6 +114,7 @@<br>    microcode_patch = intel_microcode_find();<br>     intel_microcode_load_unlocked(microcode_patch);<br> <br>+   dev->data = microcode_patch;<br>       /*<br>     * TODO: This parameter "microcode_patch" should be removed<br>          * in this function call once the following two cases are resolved -<br></pre><p>To view, visit <a href="https://review.coreboot.org/21008">change 21008</a>. To unsubscribe, 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/21008"/><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: I7e377621dd9c00388c4e148c451f9e01cb7fe4fa </div>
<div style="display:none"> Gerrit-Change-Number: 21008 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> </div>