summaryrefslogtreecommitdiff
path: root/board/daisy/board.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-04-05 13:15:14 -0700
committerChromeBot <chrome-bot@google.com>2013-04-08 10:31:43 -0700
commit6878c3da716350e5a2b20d84bc588188d6f9cca8 (patch)
treed75a4628727f1b8896c86bdf3681c7cc85341f3b /board/daisy/board.c
parentfcb1e1c8197949ab5d0ada5f103fa1af268aefbe (diff)
downloadchrome-ec-6878c3da716350e5a2b20d84bc588188d6f9cca8.tar.gz
Clean up daisy GPIO and SPI init
Much of the board init duplicated stuff already done in gpio init, so remove it. Powering the SPI module should be done in spi.c, not board.c. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; boot EC on daisy Change-Id: I9a99eeeb971ebbf7de5b9c0548153684fbb7fff6 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47469 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/daisy/board.c')
-rw-r--r--board/daisy/board.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c
index a0f8cb3bd3..e67ec8d3a8 100644
--- a/board/daisy/board.c
+++ b/board/daisy/board.c
@@ -135,31 +135,9 @@ int board_i2c_host_port(void)
}
#endif /* CONFIG_I2C_HOST_AUTO */
-void board_config_pre_init(void)
+void board_config_post_gpio_init(void)
{
- /* Enable all GPIOs clocks
- * TODO: more fine-grained enabling for power saving
- */
- STM32_RCC_AHBENR |= 0x3f;
- /* Required to configure external IRQ lines (SYSCFG_EXTICRn) */
- /* FIXME: This seems to break USB download in U-Boot (?!?) */
- STM32_RCC_APB2ENR |= 1 << 0;
-
- /* Enable SPI */
- STM32_RCC_APB2ENR |= (1<<12);
-
- /*
- * I2C SCL/SDA on PB10-11 and PB6-7, bi-directional, no pull-up/down,
- * initialized as hi-Z until alt. function is set
- */
- STM32_GPIO_PUPDR_OFF(GPIO_B) &= ~((3 << (11*2)) | (3 << (10*2)) |
- (3 << (7*2)) | (3 << (6*2)));
- STM32_GPIO_MODER_OFF(GPIO_B) &= ~((3 << (11*2)) | (3 << (10*2)) |
- (3 << (7*2)) | (3 << (6*2)));
- STM32_GPIO_MODER_OFF(GPIO_B) |= (1 << (11*2)) | (1 << (10*2)) |
- (1 << (7*2)) | (1 << (6*2));
- STM32_GPIO_OTYPER_OFF(GPIO_B) |= (1<<11) | (1<<10) | (1<<7) | (1<<6);
- STM32_GPIO_BSRR_OFF(GPIO_B) |= (1<<11) | (1<<10) | (1<<7) | (1<<6);
+ /* I2C SCL/SDA on PB10-11 and PB6-7 */
gpio_set_alternate_function(GPIO_B, (1<<11) |
(1<<10) |
(1<<7) |
@@ -167,14 +145,6 @@ void board_config_pre_init(void)
/* Select Alternate function for USART1 on pins PA9/PA10 */
gpio_set_alternate_function(GPIO_A, (1<<9) | (1<<10), GPIO_ALT_USART);
-
- /* EC_INT is output, open-drain */
- STM32_GPIO_OTYPER_OFF(GPIO_B) |= (1<<9);
- STM32_GPIO_PUPDR_OFF(GPIO_B) &= ~(0x3 << (2*9));
- STM32_GPIO_MODER_OFF(GPIO_B) &= ~(0x3 << (2*9));
- STM32_GPIO_MODER_OFF(GPIO_B) |= 0x1 << (2*9);
- /* put GPIO in Hi-Z state */
- gpio_set_level(GPIO_EC_INT, 1);
}
void keyboard_suppress_noise(void)