<div dir="ltr">Hello John,<div><br></div><div>After bit a googling on the open net, looking into coreboot tree:</div><div><div>[zoran@localhost coreboot]$ git describe</div><div>4.4-1345-g62d1313</div></div><div><br></div><div>And searching through it, and bit thinking, I would suggest you the following:</div><div><i><u><span style="font-size:12.8px">> So two questions,</span><br style="font-size:12.8px"><span style="font-size:12.8px">> 1) Is my reading of the fsp_baytrail code correct and the SMI_LOCK bit </span><span style="font-size:12.8px">is really being set by the FSP code paths.</span><br style="font-size:12.8px">><br style="font-size:12.8px"><span style="font-size:12.8px">> 2) Anyone know how to _not_ set the bit either via coreboot change or </span><span style="font-size:12.8px">FSP configuration maybe via BCT?</span></u></i><br></div><div><br></div><div>You should inspect very carefully two files in the following directory:</div><div><div>[zoran@localhost sch]$ pwd</div><div>/home/zoran/projects/coreboot/coreboot/src/soc/intel/sch</div><div>[zoran@localhost sch]$ ls -al smi*</div><div>-rw-rw-r--. 1 zoran zoran 10411 Aug 31 03:29 <b><font color="#ff0000">smi.c</font></b></div><div>-rw-rw-r--. 1 zoran zoran 11558 Aug 31 03:29 <b><font color="#ff0000">smihandler.c</font></b></div><div>[zoran@localhost sch]$ </div></div><div><br></div><div>All the answers on your two questions you'll find there. ;-)</div><div><br></div><div>Regards,</div><div>Zoran</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 19, 2016 at 6:38 PM, John Fastabend <span dir="ltr"><<a href="mailto:john.fastabend@gmail.com" target="_blank">john.fastabend@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm using the fsp_baytrail (minnowboard-max) code base with the Intel<br>
provided FSP Gold4 binary for the platform.<br>
<br>
Everything boots fine but I was looking at the SMI/smm code paths and<br>
wanted to trigger an SMI from an I/O port write. It appears this is<br>
being disabled the GBL_SMI_EN bit is disabled and can not be set because<br>
the SMI_LOCK bit is being set.<br>
<br>
I read through some of the code and it looks like other platforms such<br>
as skylake have explicit control over this bit and clear/set it in the<br>
coreboot source code. Even the baytrail platform (sans fsp) seems to<br>
set/clear it directly.<br>
<br>
For fsp_baytrail I don't see any coreboot code setting the SMI_LOCK bit<br>
at all and some tracing seems to indicate it is being set in the FSP<br>
parts of the code.<br>
<br>
So two questions,<br>
<br>
 1) Is my reading of the fsp_baytrail code correct and the SMI_LOCK bit<br>
    is really being set by the FSP code paths.<br>
<br>
 2) Anyone know how to _not_ set the bit either via coreboot change or<br>
    FSP configuration maybe via BCT?<br>
<br>
Sorry if this is really an FSP question I didn't see any good FSP<br>
mailing list to CC or just send its own mail to.<br>
<br>
For reference the SMI_LOCK bit is in this register,<br>
<br>
        General PM Configuration 2 (GEN_PMCON2)—Offset 24h<br>
<br>
at bit 4, and the GBL_SMI_EN is in this register,<br>
<br>
        SMI_EN - SMI Control and Enable (SMI_EN)—Offset 30h<br>
<br>
at bit 0. I use the following code snippets to add debugging into the<br>
coreboot code paths,<br>
<br>
+       pmc = inl(PMC_BASE_ADDRESS + 0x24);<br>
+       printk(BIOS_INFO, "SMI# : PMC: 0x08x\n", pmc)<br>
<br>
to read the smi_lock bit and the following to read/set the smi_enable<br>
bit which fails due to the above bit being set,<br>
<br>
+       outl(smi_en | 0x1, get_pmbase() + SMI_EN);<br>
+       smi_en = inl(get_pmbase() + SMI_EN);<br>
+       printk(BIOS_INFO, "post write SMI# : 0x08x\n", smi_en);<br>
<br>
Any hints, help, comments would be appreciated at the moment I'm just<br>
sort of scanning the FSP spec to try and glean something useful.<br>
<br>
Thanks,<br>
John<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
<a href="https://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://www.coreboot.org/<wbr>mailman/listinfo/coreboot</a></font></span></blockquote></div><br></div>