From mboxrd@z Thu Jan 1 00:00:00 1970 From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe) Date: Mon, 30 Sep 2013 15:31:31 -0600 Subject: [PATCH 3/4] clk: kirkwood: Add CLK_IGNORE_UNUSED to ethernet ge0 and ge1 clocks In-Reply-To: <1380575010-8573-4-git-send-email-ezequiel.garcia@free-electrons.com> References: <1380575010-8573-1-git-send-email-ezequiel.garcia@free-electrons.com> <1380575010-8573-4-git-send-email-ezequiel.garcia@free-electrons.com> Message-ID: <20130930213131.GB10393@obsidianresearch.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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