svn commit: r188882 - projects/mips/sys/mips/atheros
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Fri Feb 20 19:13:11 PST 2009
Author: gonzo
Date: Sat Feb 21 03:13:10 2009
New Revision: 188882
URL: http://svn.freebsd.org/changeset/base/188882
Log:
- Reset USB chip and init control registers
Modified:
projects/mips/sys/mips/atheros/ar71xx_machdep.c
Modified: projects/mips/sys/mips/atheros/ar71xx_machdep.c
==============================================================================
--- projects/mips/sys/mips/atheros/ar71xx_machdep.c Sat Feb 21 03:11:43 2009 (r188881)
+++ projects/mips/sys/mips/atheros/ar71xx_machdep.c Sat Feb 21 03:13:10 2009 (r188882)
@@ -98,6 +98,7 @@ platform_start(__register_t a0 __unused,
{
vm_offset_t kernend;
uint64_t platform_counter_freq;
+ uint32_t reg;
/* clear the BSS and SBSS segments */
kernend = round_page((vm_offset_t)&end);
@@ -134,6 +135,26 @@ platform_start(__register_t a0 __unused,
mips_proc0_init();
mutex_init();
+ /*
+ * Reset USB devices
+ */
+ reg = ATH_READ_REG(AR71XX_RST_RESET);
+ reg |=
+ RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY;
+ ATH_WRITE_REG(AR71XX_RST_RESET, reg);
+ DELAY(1000);
+ reg &=
+ ~(RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY);
+ ATH_WRITE_REG(AR71XX_RST_RESET, reg);
+
+ ATH_WRITE_REG(AR71XX_USB_CTRL_CONFIG,
+ USB_CTRL_CONFIG_OHCI_DES_SWAP | USB_CTRL_CONFIG_OHCI_BUF_SWAP |
+ USB_CTRL_CONFIG_EHCI_DES_SWAP | USB_CTRL_CONFIG_EHCI_BUF_SWAP);
+
+ ATH_WRITE_REG(AR71XX_USB_CTRL_FLADJ,
+ (32 << USB_CTRL_FLADJ_HOST_SHIFT) | (3 << USB_CTRL_FLADJ_A5_SHIFT));
+ DELAY(1000);
+
#ifdef DDB
kdb_init();
#endif
More information about the svn-src-projects
mailing list