Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 2013 05:43:03 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248809 - head/sys/mips/atheros
Message-ID:  <201303280543.r2S5h3II013248@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Mar 28 05:43:03 2013
New Revision: 248809
URL: http://svnweb.freebsd.org/changeset/base/248809

Log:
  Fix the AR933x platform device start/stop code.
  
  This was ported from the AR724x code and I think that also doesn't
  quite work.  I'll investigate that soon.
  
  With this in place the system reset path works, so 'reset' from kdb
  actually resets the SoC.
  
  Tested:
  
  * AP121 test board

Modified:
  head/sys/mips/atheros/ar933x_chip.c

Modified: head/sys/mips/atheros/ar933x_chip.c
==============================================================================
--- head/sys/mips/atheros/ar933x_chip.c	Thu Mar 28 05:39:45 2013	(r248808)
+++ head/sys/mips/atheros/ar933x_chip.c	Thu Mar 28 05:43:03 2013	(r248809)
@@ -119,25 +119,19 @@ ar933x_chip_detect_sys_frequency(void)
 static void
 ar933x_chip_device_stop(uint32_t mask)
 {
-	uint32_t mask_inv, reg;
+	uint32_t reg;
 
-	mask_inv = mask;
 	reg = ATH_READ_REG(AR933X_RESET_REG_RESET_MODULE);
-	reg |= mask;
-	reg &= ~mask_inv;
-	ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg);
+	ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg | mask);
 }
 
 static void
 ar933x_chip_device_start(uint32_t mask)
 {
-	uint32_t mask_inv, reg;
+	uint32_t reg;
 
-	mask_inv = mask;
 	reg = ATH_READ_REG(AR933X_RESET_REG_RESET_MODULE);
-	reg &= ~mask;
-	reg |= mask_inv;
-	ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg);
+	ATH_WRITE_REG(AR933X_RESET_REG_RESET_MODULE, reg & ~mask);
 }
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303280543.r2S5h3II013248>