/* Bits are written to the PHY serially using the PIR register, just like a bit banger.  */
static void sh_eth_mii_write_phy_bits(int port, u32 val, int len)
/* Bits are written to the PHY serially using the PIR register, just like a bit banger.  */
static void sh_eth_mii_write_phy_bits(int port, u32 val, int len)
{
	int i;
	u32 pir;
	for (i = len - 1; i >= 0; i--) {
		pir = 2 | ((val & 1 << i) ? 1 << 2 : 0);
		outl(pir, PIR(port));
		udelay(1);
		pir = 3 | ((val & 1 << i) ? 1 << 2 : 0);
		outl(pir, PIR(port));
		udelay(1);
		pir = 2 | ((val & 1 << i) ? 1 << 2 : 0);
		outl(pir, PIR(port));
		udelay(1);
	}
}