[PATCH 3/4] clk: kirkwood: Add CLK_IGNORE_UNUSED to ethernet ge0 and ge1 clocks

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Mon Sep 30 17:31:31 EDT 2013


On Mon, Sep 30, 2013 at 06:03:29PM -0300, Ezequiel Garcia wrote:

> These clocks should never be gated, since the ethernet interfaces
> forget the assigned MAC address assigned if their clock source is
> turned off.

Hrm, this hack is only needed to support the hack of passing the MAC
address from the bootloader to the kernel via the ethernet registers.

If local-mac-address is present in the DT (or fixed up via ATAGS) then
none of this is needed.

Boards that have well formed DT's don't need this.

The major downside to this patch is we never get power savings by
disabling the 2nd GE. On my boards it is not connected so we always
want to see it powered down.

Our bootloader gates the power and turns off the clock, having Linux
turn the clock back on without knowing how to control the power seems
like a possible problem.

I don't have code, but when this was first brought up it was suggested
to add local-mac-address to the DT nodes if it isn't present in the
common code and don't mess with the clocks.

Psudeo code:

void marvell_dt_ethernet_fixup(void)
{
 for_each_compatible_node(np, "marvell,kirkwood-eth-port")
 {
   if (of_get_mac_address(np) != NULL)
      continue;
   regs = ioremap(of_regs(np->parent,0));
   address = (readl(regs + MAC_ADDR_HIGH) << 32) | 
              readl(regs + MAC_ADDR_LOW))
   iounmap(regs);
   of_add_property(np, {"local-mac-address" = address});
 }
}

Jason



More information about the linux-arm-kernel mailing list