<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>Hello<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US>When I started the implementation of my new
hardware platform AT91SAM9263, I wondered about the distinction of these to
symbols. The naming suggest that <i>platform</i> is the name by which the
target is referenced in the command line <b>tools/build.py MACHINE=&lt;platform&gt;
&#8230;</b> while <i>platform_dir</i> is the location where the
platform-specific files should reside. However, the observation was that in given
examples the values were the same.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Since I foresee that we will have another
ATMEL platform which is quite similar to the current one, I plan to draw it
from the same platform directory. The few differences can well be controlled by
a preprocessor directive. For this purpose I could either create my own one by
adding it to <i>cpp_defines,</i> or make use of <i>MACHINE_&lt;platform&gt;</i>
which is automatically created.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>However, an attempt to change the name of
the platform directory and adapt <i>platform_dir</i> accordingly made the build
fail. It turned out that the value of <i>platform_dir </i>is nowhere considered
in the build scripts, effectively rendering it useless. The main reason for
this behaviour is found in <i>pistachio/SConscript</i> around line 76:<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US
style='color:#1F497D'>platform = env.machine.platform<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US
style='color:#1F497D'>platform_dir =&nbsp; &quot;#&quot; +
os.path.join(&quot;platform&quot;, src_platform, args[&quot;package&quot;])<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>These two statements establish the platform
path from the value of the symbol <i>platform</i> while the value of <i>platform_dir</i>
is ignored. Since changing the first line to &#8216;platform =
env.machine.platform_dir&#8217; would not work, because &#8216;platform&#8217;
is used several times further on in <i>pistachio/SConscript</i> where it must
deliver the platform name and not the directory, I made the following change:<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US
style='color:#1F497D'>platform = env.machine.platform<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US
style='color:#1F497D'># FK: make the platform file location distinct from the
platform name<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt'><span style='color:#1F497D'>src_platform
= env.machine.platform_dir<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US
style='color:#1F497D'>platform_dir =&nbsp; &quot;#&quot; + os.path.join(&quot;platform&quot;,
src_platform, args[&quot;package&quot;])<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>This works as expected, and I would
appreciate is this could go into the next version of OKL4.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>There is another concept to support
multiple platforms from the same sources: that is introducing subplatforms.
However, this approach requires their introduction into the generic build
scripts of PISTACHIO and IGUANA (as can be seen with the s3c2410 platform), that
is why I dismissed this solution.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Regards<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Frank<o:p></o:p></span></p>

</div>

</body>

</html>