Subject: Re(2): ifconfig bm0 on iMac
To: Dan Winship <danw@MIT.EDU>
From: Benjamin Herrenschmidt <benh@mipsys.com>
List: port-macppc
Date: 08/31/1999 14:08:17
On Tue, Aug 31, 1999, Dan Winship <danw@MIT.EDU> wrote:

>I'm not convinced. Linux and Darwin don't have this problem (I think?
>Can anyone confirm?) I suspect we're doing something wrong somewhere
>(failing to set some grackle-specific status bit or something) which
>is causing these problems.

The bmac driver in Linux indeed uses some of the special "FCR" (i.e.
Feature Control Register) bits in mac-io (ohare, heathrow or paddington).
This register is located at mac-io base + 0x38. You can find an
approximative description of those bits in 3 of Linux source files: 

include/asm-ppc/ohare.h (the original macros found for ohare)
include/asm/feature.h (the abstract values we use on linuxppc)
arch/ppc/kernel/feature.c (the code that deals with those,contains useful
tables)

Here are two bits of linux bmac driver source code:

static void
bmac_reset_chip(struct device *dev)
{
	struct bmac_data *bp = (struct bmac_data *) dev->priv;
	volatile struct dbdma_regs *rd = bp->rx_dma;
	volatile struct dbdma_regs *td = bp->tx_dma;
	 
	dbdma_reset(rd);
	dbdma_reset(td);

	feature_set(bp->node, FEATURE_BMac_IO_enable);
	udelay(10000);
	feature_set(bp->node, FEATURE_BMac_reset);
	udelay(10000);
	feature_clear(bp->node, FEATURE_BMac_reset);
	udelay(10000);
}

feature_set() and feature_clear will set/clear FCR bits according to
tables provided in feature.c. As far as I know, the bmac bits are: (note
that the FCR register must be accessed in little endian, like any of
Apple's ASIC registers).

	0x80000000,		/* FEATURE_BMac_reset */
	0x60000000,		/* FEATURE_BMac_IO_enable */

Also, Paul Mackerras recently added some code to correctly configure the
PHY on the recent (Lombard) powerbooks.