<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div class="markdown-here-wrapper" data-md-url="https://mail.notes.na.collabserv.com/verse" dir="ltr" markdown-here-wrapper-content-modified="true" style="" ><p style="margin: 0px 0px 1.2em ! important;" >Hi All,</p>
<p style="margin: 0px 0px 1.2em ! important;" >This mail is to discuss how to handle GPIO differences (e.g. functionality, IN/OUT) between different HWs.</p>
<p style="margin: 0px 0px 1.2em ! important;" >I went into a case the P8 uses two GPIOs, but P9 does not use them: in <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >skeleton/op-hostctl/control_host_obj.c</code>:</p>
<pre style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;font-size: 1em; line-height: 1.2em;margin: 1.2em 0px;" ><code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;white-space: pre; overflow: auto; border-radius: 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em 0.7em; display: block ! important;" >GPIO Throttle = (GPIO){ "BMC_THROTTLE" };
GPIO idbtn = (GPIO){ "IDBTN" };
...
rc |= gpio_write(&Throttle,1);
rc |= gpio_write(&idbtn,0);
</code></pre>
<p style="margin: 0px 0px 1.2em ! important;" >In P9, <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >BMC_THROTTLE</code> is renamed to <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >N_MODE_N</code>, and changed to an <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >IN</code> GPIO; <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >IDBTN</code> is changed to <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >IN</code> GPIO as well.<br>If we keep the above code and overriding the GPIOs, writing <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >BMC_THROTTLE</code> takes no effect, but writing to <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;" >IDBTN</code> may break the function of its related front panel button.</p>
<p style="margin: 0px 0px 1.2em ! important;" >So I think we need to distinguish such cases to avoid issues.</p>
<p style="margin: 0px 0px 1.2em ! important;" >The question is, how to change the code to support different HWs that have unique GPIOs?</p>
<p style="margin: 0px 0px 1.2em ! important;" >—<br>Lei YU (郁雷)<br>IBM OpenPOWER Application Engineer<br>Tel: (86-21)6092-2710<br>E-Mail: shyulei@cn.ibm.com</p>
<div style="height:0;width:0;max-height:0;max-width:0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