On Mon, Feb 1, 2010 at 4:25 PM, John Tyner <jtyner@xxxxxxxxxx> wrote:This patch adds support for using the LL TEMAC Ethernet driver on non-Virtex
5 platforms by adding support for accessing the Soft DMA registers as if
they were memory mapped instead of solely through the DCR's (available on
the Virtex 5).
Signed-off-by: John Tyner <jtyner@xxxxxxxxxx>
Hi John, thanks for doing this work. A couple of comments below.
* TODO:
- * - Fix driver to work on more than just Virtex5. Right now the driver
- * assumes that the locallink DMA registers are accessed via DCR
- * instructions.
* - Factor out locallink DMA code into separate driver
* - Fix multicast assignment.
* - Fix support for hardware checksumming.
@@ -117,12 +114,20 @@
static u32 temac_dma_in32(struct temac_local *lp, int reg)
{
- return dcr_read(lp->sdma_dcrs, reg);
+ if (lp->sdma_regs) {
+ return __raw_readl(lp->sdma_regs + reg);
+ } else {
+ return dcr_read(lp->sdma_dcrs, reg);
+ }
Rather than taking the ugliness an if/else block on every register
access, why not create an ops structure and populate it with the
correct access routines at runtime?
@@ -895,7 +904,7 @@
lp->phy_node = of_parse_phandle(op->node, "phy-handle", 0);
if (lp->phy_node)
- dev_dbg(lp->dev, "using PHY node %s (%p)\n", np->full_name, np);
+ dev_dbg(lp->dev, "using PHY node %s (%p)\n", lp->phy_node->full_name, lp->phy_node);
This looks like an unrelated bug fix. Please put into a separate
patch and post separately.