sungem on imac G5

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Mar 18 11:21:31 EST 2005


On Thu, 2005-03-17 at 20:30 +0100, Markus Demleitner wrote:
> Hi all,
> 
> Sorry for lowering the discussion level, but I believe this is most
> appropriate mailing list for my woes.
> 
> My problem is that with the 2.6.11.2 kernel, patched with benh's
> recent patches (the sungem driver has date 
> 2005-03-10 23:04:36.000000000 +0000), networking on an iMac G5 works
> like a charm when OF hasn't touched the network card.

Can you try this patch ?

Index: linux-work/arch/ppc64/kernel/pmac_feature.c
===================================================================
--- linux-work.orig/arch/ppc64/kernel/pmac_feature.c	2005-03-15 11:56:46.000000000 +1100
+++ linux-work/arch/ppc64/kernel/pmac_feature.c	2005-03-18 11:20:21.000000000 +1100
@@ -220,6 +220,34 @@
 	return 0;
 }
 
+static long __pmac g5_eth_phy_reset(struct device_node* node, long param, long value)
+{
+	struct device_node *phy;
+	int need_reset;
+	unsigned long flags;
+
+	/*
+	 * We must not reset the combo PHYs, only the BCM5221 found in
+	 * the iMac G5.
+	 */
+	phy = of_get_next_child(node, NULL);
+	if (!phy)
+		return -ENODEV;
+	need_reset = device_is_compatible(phy, "B5221");
+	of_node_put(phy);
+	if (!need_reset)
+		return 0;
+
+	/* PHY reset is GPIO 29, not in device-tree unfortunately */
+	MACIO_OUT8(K2_GPIO_EXTINT_0 + 29,
+		   KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
+	/* Thankfully, this is now always called at a time when we can
+	 * schedule by sungem.
+	 */
+	msleep(10);
+	MACIO_OUT8(K2_GPIO_EXTINT_0 + 29, 0);
+}
+
 #ifdef CONFIG_SMP
 static long __pmac g5_reset_cpu(struct device_node* node, long param, long value)
 {
@@ -306,6 +334,7 @@
 	{ PMAC_FTR_ENABLE_MPIC,		g5_mpic_enable },
 	{ PMAC_FTR_READ_GPIO,		g5_read_gpio },
 	{ PMAC_FTR_WRITE_GPIO,		g5_write_gpio },
+	{ PMAC_FTR_GMAC_PHY_RESET,	g5_eth_phy_reset },
 #ifdef CONFIG_SMP
 	{ PMAC_FTR_RESET_CPU,		g5_reset_cpu },
 #endif /* CONFIG_SMP */





More information about the Linuxppc64-dev mailing list