<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 19, 2014 at 5:58 AM, Allen Yan <span dir="ltr"><<a href="mailto:lexkde@gmail.com" target="_blank">lexkde@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Hi, David,<br>
   I was reading flashrom code base following the internal programmer<br>
way. I also read mail<br>
"<a href="http://www.flashrom.org/pipermail/flashrom/2013-March/010704.html" target="_blank">http://www.flashrom.org/pipermail/flashrom/2013-March/010704.html</a>"<br>
and checked the Ibex peak datasheet about ME firmware. Here are some<br>
questions:<br>
about "Locking and unlocking of access protections of flash chips"<br>
 1 which mechanism locks the flash?a software  way or a hardware way<br>
by the programmer. As in the Atmel AT25DL161, the protection ways are<br>
"hardware protection, using WP pin", "Sector lockdown with permanent<br>
freeze option", "individual sector protection with global<br>
protect/unprotect feature".<br></blockquote><div><br></div><div>All of the above :-)</div><div><br></div><div>You will need to determine:</div><div>- Which write-protection scheme is in place? Is it intended to prevent erroneous software from writing to the flash, or is it intended to prevent any re-writing of the flash?</div>

<div>- Can it be disabled / worked around so that content can be updated?</div><div>- How to restore the settings when you are finished.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


 2 Does this problem concerns the ME firmware issue.<br></blockquote><div><br></div><div>Yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


 3 How to do the test? Is the test at specific mainboard and flash chip enough?<br></blockquote><div><br></div><div>IIRC Flashrom already tests for motherboards which are known to require a workaround, for example if a GPIO must be inverted in order to de-assert /WP. board_enable.c has many of these tests. It also knows about block protect bits in SPI ROMs.</div>

<div><br></div><div>I think the main issue with modern systems (Intel in particular) is the management engine.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


 4 How to value the work at last as stefan mentioned in the suggestion?<br>
<br>
<br>
Actually, a little frustrating after I saw stefanct's mail.<br></blockquote><div><br></div><div>It's very valuable :-) I put some effort into this functionality for ChromeOS, since handling write-protection is a requirement for Chromebooks. Here are some examples:</div>

<div>Skip regions locked via flash descriptor for Intel platforms: <a href="https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/1ed1d35d8fbce7571accb84c2ba76f7b6f273844">https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/1ed1d35d8fbce7571accb84c2ba76f7b6f273844</a><br>

</div><div>writeprotect.c, which contains block protect mapping for several flash chips: <a href="https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/master/writeprotect.c">https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/master/writeprotect.c</a><br>

</div><div><br></div><div>Unfortunately we never reached a consensus regarding how to port this code to upstream. It would be nice if somebody like you can help to re-factor this code so that it can be accepted upstream.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">On 3/18/14, Stefan Tauner <<a href="mailto:stefan.tauner@student.tuwien.ac.at">stefan.tauner@student.tuwien.ac.at</a>> wrote:<br>
> On Mon, 17 Mar 2014 09:56:43 +0800<br>
> 严进一 <<a href="mailto:lexkde@gmail.com">lexkde@gmail.com</a>> wrote:<br>
><br>
>> Hi,<br>
>> I am Jinyi Yan , a second year PhD candidate from Shanghai Institute of<br>
>> Micro-system and Information Technology, Chinese Academy of Sciences. I<br>
>> used to be a mainboard BIOS engineer in ASUS Technology Suzhou Co., Ltd<br>
>> for about two years (2007.7~2009.2). My major now is optoelectronics. But<br>
>> I have a lot of fun while programming, in my heart the working experience<br>
>> of being a BIOS engineer is still very exciting.<br>
>> I think GsoC is a nice platform for me to participate the open source<br>
>> community. When I search the GsoC projects and organizations, the coreboot<br>
>> and flashrom projects are definitely the right choices for me. I have a<br>
>> spare ASUS P5KPL PC at my hand, but the chipset is not in the support list<br>
>> of coreboot project. So I consider the flashrom project is the better<br>
>> choice. I also have a home-made flash programmer based on uspasp.<br>
>> I'd like to choose “Locking and unlocking of access protections of flash<br>
>> chips” for GSoC 2014.<br>
>> Now I'm not very familiar with the program structure of flashrom, so I<br>
>> expect your guidence and hope to contribute for flashrom and coreboot even<br>
>> if my application is not accpeted.<br>
>> Thanks! Look forward to your kind advice!<br>
><br>
> Hello Jinyi,<br>
><br>
> thanks for your interest in flashrom. I have been the most active<br>
> flashrom developer in the last years and would probably be responsible<br>
> to integrate your work and answer questions if you get stuck. I agree<br>
> that the coreboot-related projects are probably the best choice for you<br>
> (there are not many low-level projects participating sadly... that's<br>
> how I ended up here too ;). I also have to admit that the P5KPL is<br>
> probably not very helpful AFAICT. But I don't think that this is a show<br>
> stopper regarding coreboot (or seabios) projects and that your skills<br>
> and insights obtained at ASUS regarding x86 might be more useful in a<br>
> non-flashrom project. Also, the project you chose requires to<br>
> understand two code bases ("ours" and that maintained by google/<br>
> chromiumos ppl) and interact with two communities and persuade at least<br>
> one of them that your solution is sound and profitable. On the other<br>
> hand, I am biased because I will apply for a flashrom GSoC project<br>
> myself probably. ;)<br>
> The code bases have a very similar core so that should not be a big<br>
> issue at all. Producing something that will be praised by everyone on<br>
> the other hand is really hard. The vanilla flashrom community is<br>
> traditionally very (very) picky regarding changes, especially user<br>
> interface changes. This is also the reason why there is a chromiumos<br>
> fork of flashrom...<br>
><br>
> I have talked to David (dhendrix) and he is willing to mentor you this<br>
> year. If you want to pursue this project (and the patch you sent seems<br>
> to indicate that ;) I suggest you talk to him directly about details<br>
> of the assignment (here or on IRC).<br>
><br>
> Adding new flash chips as you have done is a very good first step to<br>
> get to know flashrom a bit better. The fun begins with the awkward<br>
> models though :)<br>
> I suggest you test flashrom on any hardware available to you (including<br>
> network cards for example)... there is always room for improvement and<br>
> learning a foreign code base is always easier when on has a specific<br>
> goal to reach.<br>
> --<br>
> Kind regards/Mit freundlichen Grüßen, Stefan Tauner<br>
><br>
> _______________________________________________<br>
> flashrom mailing list<br>
> <a href="mailto:flashrom@flashrom.org">flashrom@flashrom.org</a><br>
> <a href="http://www.flashrom.org/mailman/listinfo/flashrom" target="_blank">http://www.flashrom.org/mailman/listinfo/flashrom</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.
</div></div>