From 09ac4e68f3364a081187366d178ba8f0ae62ed6a Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 28 Mar 2013 05:43:03 +0000 Subject: [PATCH] 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 --- sys/mips/atheros/ar933x_chip.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/mips/atheros/ar933x_chip.c b/sys/mips/atheros/ar933x_chip.c index c997d8e44b58..4152c0694771 100644 --- a/sys/mips/atheros/ar933x_chip.c +++ b/sys/mips/atheros/ar933x_chip.c @@ -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