<div dir="ltr">there's another way to do this that few people use. <div><br></div><div>Back in the E7500 days, the 7505 came along. We experimented with this:</div><div>src/northbridge/intel/e750x</div><div>and put the common files in there. </div><div>Under e750x we had </div><div>e7500</div><div>e7505</div><div><br></div><div>for the different files. </div><div>so, src/northbridge/intel/e750x/{e7500,e7505}</div><div>worked fine. nobody cared enough to really do the work of putting it all together, we were just happy that</div><div>the build system supported the naming in the files and so on.</div><div>Part of the trick is this: in the mainboard file, the part becomes</div><div>src/northbridge/intel/e750x/e7500</div><div>and in e7500 you include parts from src/northbridge/intel/e750x</div><div><br></div><div>So you don't make e750x the northbridge directory; rather you make e750x/e7505 and e750x/e7500 the directory. </div><div>That way, no condition includes or anything. It's a pretty standard build setup.</div><div><br></div><div>this is similar to what we did on the ARM parts a few years back.</div><div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 7, 2015 at 4:08 PM Ben Gardner <<a href="mailto:gardner.ben@gmail.com">gardner.ben@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Dec 7, 2015 at 9:55 AM, Martin Roth <<a href="mailto:gaumless@gmail.com" target="_blank">gaumless@gmail.com</a>> wrote:<br>
> I think we can cut down on some of the code redundancy, but as Alex<br>
> says, they are different chipsets, and we need to be careful about<br>
> trying to combine too much.<br>
><br>
> Here are my suggested steps:<br>
> 1) Look for commonalities between baytrail and other chipsets and move<br>
> pieces things into soc/intel/common or southbridge/intel/common.<br>
> Let's not do a bunch of work just for baytrail that could help all the<br>
> intel chipsets.  I think this should be done regardless of anything<br>
> that we decide about Bay Trail.<br>
><br>
> 2) Figure out which changes in each directory should go to the other.<br>
> Each have gotten some fixes that should be shared with the other<br>
> directory.<br>
><br>
> 3) Make the baytrail directory structures look as similar again -<br>
> rename the soc/fsp_baytrail/baytrail include directory to<br>
> soc/fsp_baytrail/soc/include to match what was done with soc/baytrail.<br>
> Or we can rename them both to just soc/(fsp_)baytrail/include.<br>
> Something, so long as they match.<br>
><br>
> 4) Create a soc/intel/baytrail_common or soc/intel/baytrail/common<br>
> directory and move pieces that are the same for both chipsets into<br>
> those directories.  Work on consolidation, and getting as much as is<br>
> reasonable into that directory.  I'd prefer not to just leave files in<br>
> soc/intel/baytrail because then it's not obvious that the files are<br>
> shared between the two platforms.<br>
><br>
><br>
> Similar steps could be done for the other fsp/non-fsp directories:<br>
> cpu/(fsp_)model_206ax, northbridge/(fsp_)sandybridge, and<br>
> southbridge/intel/(fsp_)bd82x6x.<br>
><br>
> Ben, Michael, Since you seem to be actively working in this code, how<br>
> do you feel about this?<br>
<br>
I'm OK with reducing duplication and unnecessary differences.<br>
There seems to be plenty of duplicate header files.<br>
Without a similar tree structure and filenames, it is difficult to<br>
compare the trees, so I'd sync that first.<br>
<br>
I'd prefer seeing common baytrail stuff in soc/intel/baytrail_common/<br>
vs under baytrail/common.<br>
<br>
Ben<br>
<br>
> Martin<br>
><br>
> On Sun, Dec 6, 2015 at 11:54 PM, Alex G. <<a href="mailto:mr.nuke.me@gmail.com" target="_blank">mr.nuke.me@gmail.com</a>> wrote:<br>
>> On 12/06/2015 08:18 AM, Alexander Couzens wrote:<br>
>>> hi,<br>
>>><br>
>>> baytrail and fsp_baytrail shares a lot of code.<br>
>>> Any ideas how we can merge these?<br>
>><br>
>> That's not a very good idea. There are different sets of interest which<br>
>> use those two code paths, and trying to unify that will only get people<br>
>> stepping on each others toes.<br>
>><br>
>> At most, you can make fsp_baytrail/ use the CPU part of baytrail/, but<br>
>> leave the northbridge and southbridge parts alone.<br>
>><br>
>> My advice, just stash the fsp_baytrail/ in some dark basement and forget<br>
>> about it. If it gets in the way or gives you trouble, let me know, but<br>
>> otherwise, just pretend it doesn't exist<br>
>><br>
>> Alex<br>
>><br>
>> --<br>
>> coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
>> <a href="http://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
<br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="http://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
</blockquote></div>