diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-08-12 11:56:17 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2005-08-12 11:56:17 +0000 |
commit | 184f0197af89b634e2f395b0e91cd22ea44d1582 (patch) | |
tree | 2e50d8404a5fc74088a010a37d5ef9ca7d08d251 /sys/dev/usb | |
parent | 932835371b9f040c1aea7ca9eccb9955f5f1ef3c (diff) |
Add some delays in the GPIO code so AX88178 phy gets powered up.
Suggested by ASIX.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_axe.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 6b226c6b452..3f4151a8ee1 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.31 2005/08/11 05:24:17 jsg Exp $ */ +/* $OpenBSD: if_axe.c,v 1.32 2005/08/12 11:56:16 jsg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -547,22 +547,34 @@ USB_ATTACH(axe) printf("gpio0 path not done! PHY not enabled\n"); else { axe_cmd(sc, AXE_CMD_WRITE_GPIO, 0, 0x008c, NULL); + usbd_delay_ms(sc->axe_udev, 40); if (phymode != 1) { axe_cmd(sc, AXE_CMD_WRITE_GPIO, 0, 0x003c, NULL); + usbd_delay_ms(sc->axe_udev, 30); + axe_cmd(sc, AXE_CMD_WRITE_GPIO, 0, 0x001c, NULL); + usbd_delay_ms(sc->axe_udev, 300); + axe_cmd(sc, AXE_CMD_WRITE_GPIO, 0, 0x003c, NULL); + usbd_delay_ms(sc->axe_udev, 30); } else { + DPRINTF(("axe gpio phymode == 1 path\n")); axe_cmd(sc, AXE_CMD_WRITE_GPIO, 0, 0x0004, NULL); + usbd_delay_ms(sc->axe_udev, 30); axe_cmd(sc, AXE_CMD_WRITE_GPIO, 0, 0x000c, NULL); + usbd_delay_ms(sc->axe_udev, 30); } } axe_cmd(sc, AXE_CMD_SW_PHY_SELECT, 0, 0, NULL); + usbd_delay_ms(sc->axe_udev, 150); /* soft reset */ axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_178_RESET_PRL | AXE_178_RESET_MAGIC, NULL); - delay(500); + usbd_delay_ms(sc->axe_udev, 150); axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); + /* XXX is a delay this long required for PHY to work? */ + usbd_delay_ms(sc->axe_udev, 1500); } /* |