diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-06-15 15:58:23 +0000 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-06-15 13:18:40 -0700 |
commit | b4d996a5ea2cfeb8358a83bc1698a23b819e9242 (patch) | |
tree | ce4b9253eb74fc0eab0c7a09a594f3a9952ec42f | |
parent | cca78cfcfdda7700dc3e5659ef68cadedaef136b (diff) | |
download | chrome-ec-b4d996a5ea2cfeb8358a83bc1698a23b819e9242.tar.gz |
Move System Control Block registers to core header
The SCB registers are defined in the ARMv7-M architecture, so they are
common to all chips.
We will need System Control Register (SCR aka SYSCTRL) to implement
power management on stm32.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=make BOARD=link && make BOARD=snow
Change-Id: I35c283731306541b3d21398c96fdca89954fe20a
Reviewed-on: https://gerrit.chromium.org/gerrit/25392
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | chip/lm4/clock.c | 3 | ||||
-rw-r--r-- | chip/lm4/registers.h | 2 | ||||
-rw-r--r-- | core/cortex-m/cpu.h | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/chip/lm4/clock.c b/chip/lm4/clock.c index a342404fd5..6031767872 100644 --- a/chip/lm4/clock.c +++ b/chip/lm4/clock.c @@ -7,6 +7,7 @@ #include "board.h" #include "clock.h" +#include "cpu.h" #include "config.h" #include "console.h" #include "gpio.h" @@ -184,7 +185,7 @@ static int command_sleep(int argc, char **argv) } /* set deep sleep bit */ if (level >= 4) - LM4_SCB_SYSCTRL |= 0x4; + CPU_SCB_SYSCTRL |= 0x4; /* go to low power mode (forever ...) */ if (level > 1) while (1) { diff --git a/chip/lm4/registers.h b/chip/lm4/registers.h index 63bb3dbeca..dccd86e179 100644 --- a/chip/lm4/registers.h +++ b/chip/lm4/registers.h @@ -365,8 +365,6 @@ static inline int lm4_fan_addr(int ch, int offset) #define LM4_IRQ_GPIOQ7 131 /* 132 - 138 reserved */ -#define LM4_SCB_SYSCTRL LM4REG(0xe000ed10) - /* GPIO */ #define LM4_GPIO_PORTA_BASE 0x40004000 #define LM4_GPIO_PORTB_BASE 0x40005000 diff --git a/core/cortex-m/cpu.h b/core/cortex-m/cpu.h index bd94e179fe..7e032164a7 100644 --- a/core/cortex-m/cpu.h +++ b/core/cortex-m/cpu.h @@ -21,4 +21,6 @@ #define CPU_NVIC_APINT CPUREG(0xe000ed0c) #define CPU_NVIC_SWTRIG CPUREG(0xe000ef00) +#define CPU_SCB_SYSCTRL CPUREG(0xe000ed10) + #endif /* __CPU_H */ |