From owner-svn-src-projects@FreeBSD.ORG Sat Feb 21 03:13:11 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EF9106564A; Sat, 21 Feb 2009 03:13:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00F218FC13; Sat, 21 Feb 2009 03:13:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1L3DA6R046724; Sat, 21 Feb 2009 03:13:10 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3DAkb046723; Sat, 21 Feb 2009 03:13:10 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200902210313.n1L3DAkb046723@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 21 Feb 2009 03:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188882 - projects/mips/sys/mips/atheros X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:13:11 -0000 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