<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: Xilinx EDK BSP generation of device trees for microblaze and PowerPC</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Here's what I've gotten so far:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hard_Ethernet_MAC: xps-ll-temac@81c00000 {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #address-cells = &lt;1&gt;;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #size-cells = &lt;1&gt;;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; network@81c00000 {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compatible = &quot;xlnx,xps-ll-temac-1.00.a&quot;, &quot;xlnx,xps-ll-temac&quot;;<BR>
&n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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } ;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } ;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DDR2_SDRAM: memory@90000000 {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_type = &quot;memory&quot;;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg = &lt; 90000000 10000000 &gt;;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } ;<BR>
<BR>
So: the mpmc generates a 'memory' node, corresponding to it's memory interface.&nbsp; It also gets a separate entry which contains the (optional, not present in this example) slave management interface (for ECC and performance information), and any sdma ports.&nbsp; In this case, this node is mpmc@90000000, because there is no management interface.&nbsp; If a management interface was present, then it would be @ the management address.<BR>
The mpmc gets a compatible string that describes its management interface.<BR>
The sdma port has information about the tx and rx interrupts and the slave management interface.&nbsp; Note that the slave management interface has the correct baseaddress for port3, generated from the base SDMA_CTRL_ address from the mpmc + the port 3 offset.&nbsp; Note that sdma has an artificial compatible name.&nbsp; I'm not sure whether the ll_dma driver can be easily convinced to bind to this, or whether the ll_temac driver will just traverse the device tree and then do a match against this.<BR>
<BR>
The temac works similarly, although the temac itself doesn't have a slave interface, so no compatible node for it.&nbsp; The sub nodes get the compatible string for the ll_temac driver.&nbsp; In this case, there is only one temac port active.&nbsp; Some of the parameters are specific to port 0, in which case the parameter names (e.g. phyaddr) are generated by stripping off the complete C_TEMAC0 prefix.&nbsp; Other parameters (e.g. phy-type) are common to both sub nodes, but are duplicated to make it easier for the driver to get the information out.&nbsp; At runtime, the driver has to follow the llink-connected path to find what it is connected to, and use the dma code, or the fifo code.<BR>
<BR>
the xps-ll-fifo structure is a bit simpler, with llink-connected pointing to the fifo, which looks like a 'normal' peripheral.<BR>
<BR>
Points for comment:<BR>
1) I don't like the &quot;PIM3&quot; label, which is artificial (i.e. it doesn't correspond to a name in the .mhs) and not guaranteed to be unique.&nbsp; However, in the BSP generator it seems awkward to generate path references easily in a single pass.&nbsp; What I'd might prefer is:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DDR2_SDRAM: mpmc@90000000 {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sdma@3 {<BR>
<BR>
and refer to the sdma port using something like &lt;&amp;DDR2_SDRAM/sdma@3&gt;, but I don't think you can do that in dtc?<BR>
<BR>
2) Not sure whether this is really simpler than just having a 'simple' node with both temacs and letting the driver sort everything out.&nbsp; In particular, I'm concerned about maintaining a bunch of semantic information about the ll_temac driver outside of the driver itself.<BR>
<BR>
3) All of this is very different in structure from the way that the xparameters are organized.&nbsp; The ll_temac BSP code copies the xparameters out of the MPMC and they are simply other parameters of the ll_temac driver.&nbsp; Although the above structure better represents the actual system, there is another organization for people to be confused about.<BR>
<BR>
Steve<BR>
<BR>
-----Original Message-----<BR>
From: linuxppc-dev-bounces+stephen.neuendorffer=xilinx.com@ozlabs.org on behalf of Stephen Neuendorffer<BR>
Sent: Tue 11/20/2007 11:44 AM<BR>
To: microblaze-uclinux@itee.uq.edu.au; linuxppc-dev@ozlabs.org; Grant Likely; Michal Simek<BR>
Subject: Xilinx EDK BSP generation of device trees for microblaze and PowerPC<BR>
<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
I've updated some code from Michel Simek to generate Flat Device Trees<BR>
from Xilinx EDK projects.&nbsp; This code is now hosted at:<BR>
git://git.xilinx.com/gen-mhs-devtree.git<BR>
<BR>
This has one major advantage over the gen-mhs-devtree.py approach:<BR>
default IP core parameters that are not specified in the mhs file can<BR>
now be generated, since EDK pulls these in from the core .mpd file.<BR>
I've also managed to incorporate a few more improvements from the<BR>
previous review, so the BSP generator should include at least as much<BR>
information as gen-mhs-devtree.py<BR>
<BR>
The next major order of business is to represent the DMA engines in the<BR>
MPMC and locallink connections to the lltemac.<BR>
<BR>
Steve<BR>
<BR>
_______________________________________________<BR>
Linuxppc-dev mailing list<BR>
Linuxppc-dev@ozlabs.org<BR>
<A HREF="https://ozlabs.org/mailman/listinfo/linuxppc-dev">https://ozlabs.org/mailman/listinfo/linuxppc-dev</A><BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>