/* * The ethernet interfaces forget the MAC address assigned by u-boot * if the clocks are turned off. Usually, u-boot on kirkwood boards * has no DT support to properly set local-mac-address property. * As a workaround, we get the MAC address from mv643xx_eth registers * and update the port device node if no valid MAC address is set.
*/
for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") { struct device_node *pnp = of_get_parent(np); struct clk *clk; struct property *pmac;
u8 tmpmac[ETH_ALEN]; void __iomem *io;
u8 *macaddr;
u32 reg;
if (!pnp) continue;
/* skip disabled nodes or nodes with valid MAC address*/ if (!of_device_is_available(pnp) ||
!of_get_mac_address(np, tmpmac)) goto eth_fixup_skip;
clk = of_clk_get(pnp, 0); if (IS_ERR(clk)) goto eth_fixup_skip;
io = of_iomap(pnp, 0); if (!io) goto eth_fixup_no_map;
/* ensure port clock is not gated to not hang CPU */
clk_prepare_enable(clk);
/* store MAC address register contents in local-mac-address */
pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL); if (!pmac) goto eth_fixup_no_mem;
/* * Disable propagation of mbus errors to the CPU local bus, as this * causes mbus errors (which can occur for example for PCI aborts) to * throw CPU aborts, which we're not set up to deal with.
*/ staticvoid kirkwood_disable_mbus_error_propagation(void)
{ void __iomem *cpu_config;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.