diff options
Diffstat (limited to 'board/adv/board.c')
-rw-r--r-- | board/adv/board.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/board/adv/board.c b/board/adv/board.c deleted file mode 100644 index 9e3a4ff392..0000000000 --- a/board/adv/board.c +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ -/* ADV board-specific configuration */ - -#include "board.h" -#include "common.h" -#include "gpio.h" -#include "registers.h" -#include "util.h" - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN) - -/* GPIO interrupt handlers prototypes */ -#ifndef CONFIG_TASK_GAIAPOWER -#define gaia_power_event NULL -#else -void gaia_power_event(enum gpio_signal signal); -#endif -#ifndef CONFIG_TASK_KEYSCAN -#define matrix_interrupt NULL -#endif - -/* GPIO signal list. Must match order from enum gpio_signal. */ -const struct gpio_info gpio_list[GPIO_COUNT] = { - /* Inputs with interrupt handlers are first for efficiency */ - {"KB_PWR_ON", GPIO_A, (1<<0), GPIO_INT_BOTH, gaia_power_event}, - {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, gaia_power_event}, - {"XPSHOLD", GPIO_A, (1<<11), GPIO_INT_RISING, gaia_power_event}, - {"CHARGER_INT", GPIO_B, (1<<0), GPIO_INT_RISING, NULL}, - {"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, NULL}, - {"KB_IN00", GPIO_C, (1<<8), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN01", GPIO_C, (1<<9), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN02", GPIO_C, (1<<10), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN03", GPIO_C, (1<<11), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN04", GPIO_C, (1<<12), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN05", GPIO_C, (1<<14), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN06", GPIO_C, (1<<15), GPIO_KB_INPUT, matrix_interrupt}, - {"KB_IN07", GPIO_D, (1<<2), GPIO_KB_INPUT, matrix_interrupt}, - /* Other inputs */ - /* Outputs */ - {"EN_PP1350", GPIO_A, (1<<9), GPIO_OUT_LOW, NULL}, - {"EN_PP5000", GPIO_A, (1<<10), GPIO_OUT_LOW, NULL}, - {"EN_PP3300", GPIO_A, (1<<8), GPIO_OUT_LOW, NULL}, - {"PMIC_PWRON", GPIO_A, (1<<12), GPIO_OUT_HIGH, NULL}, - {"ENTERING_RW", GPIO_B, (1<<1), GPIO_OUT_LOW, NULL}, - {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_OUT_LOW, NULL}, - {"KB_OUT00", GPIO_B, (1<<5), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT01", GPIO_B, (1<<8), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT02", GPIO_B, (1<<12), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT03", GPIO_B, (1<<14), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT04", GPIO_B, (1<<15), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT05", GPIO_C, (1<<0), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT06", GPIO_C, (1<<2), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT07", GPIO_C, (1<<4), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT08", GPIO_C, (1<<5), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT09", GPIO_C, (1<<6), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT10", GPIO_B, (1<<13), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT11", GPIO_C, (1<<1), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT12", GPIO_C, (1<<7), GPIO_KB_OUTPUT, NULL}, - -}; - -void configure_board(void) -{ - /* Enable all GPIOs clocks - * TODO: more fine-grained enabling for power saving - */ - STM32_RCC_AHBENR |= 0x3f; - STM32_RCC_APB2ENR |= 0x01; - - /* Select Alternate function for USART2 on pins PA2/PA3 */ - gpio_set_alternate_function(GPIO_A, (1<<2) | (1<<3), GPIO_ALT_USART); -} |