mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
remove deprecated stm32-based boards
We no longer support ADV EVT0 board and Discovery reference design. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=make BOARD=daisy && make BOARD=link Change-Id: I7eb81e5271c070b17f018ac9c14491f1804c0e08
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -1,68 +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 configuration */
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
/* 16 MHz SYSCLK clock frequency */
|
||||
#define CPU_CLOCK 16000000
|
||||
|
||||
/* Use USART2 as console serial port */
|
||||
#define CONFIG_CONSOLE_UART 2
|
||||
|
||||
#define USB_CHARGE_PORT_COUNT 0
|
||||
|
||||
/* GPIO signal list */
|
||||
enum gpio_signal {
|
||||
/* Inputs with interrupt handlers are first for efficiency */
|
||||
GPIO_KB_PWR_ON = 0, /* Power button */
|
||||
GPIO_PP1800_LDO2, /* LDO2 is ON (end of PMIC sequence) */
|
||||
GPIO_SOC1V8_XPSHOLD, /* App Processor ON */
|
||||
GPIO_CHARGER_INT,
|
||||
GPIO_LID_OPEN, /* LID switch detection */
|
||||
/* Keyboard inputs */
|
||||
GPIO_KB_IN00,
|
||||
GPIO_KB_IN01,
|
||||
GPIO_KB_IN02,
|
||||
GPIO_KB_IN03,
|
||||
GPIO_KB_IN04,
|
||||
GPIO_KB_IN05,
|
||||
GPIO_KB_IN06,
|
||||
GPIO_KB_IN07,
|
||||
/* Other inputs */
|
||||
/* Outputs */
|
||||
GPIO_EN_PP1350, /* DDR 1.35v rail enable */
|
||||
GPIO_EN_PP5000, /* 5.0v rail enable */
|
||||
GPIO_EN_PP3300, /* 3.3v rail enable */
|
||||
GPIO_PMIC_PWRON, /* 5v rail ready */
|
||||
GPIO_EC_ENTERING_RW, /* EC is R/W mode for the kbc mux */
|
||||
GPIO_CHARGER_EN,
|
||||
GPIO_EC_INT,
|
||||
/* Keyboard outputs */
|
||||
GPIO_KB_OUT00,
|
||||
GPIO_KB_OUT01,
|
||||
GPIO_KB_OUT02,
|
||||
GPIO_KB_OUT03,
|
||||
GPIO_KB_OUT04,
|
||||
GPIO_KB_OUT05,
|
||||
GPIO_KB_OUT06,
|
||||
GPIO_KB_OUT07,
|
||||
GPIO_KB_OUT08,
|
||||
GPIO_KB_OUT09,
|
||||
GPIO_KB_OUT10,
|
||||
GPIO_KB_OUT11,
|
||||
GPIO_KB_OUT12,
|
||||
|
||||
/* Number of GPIOs; not an actual GPIO */
|
||||
GPIO_COUNT
|
||||
};
|
||||
|
||||
void configure_board(void);
|
||||
|
||||
void matrix_interrupt(enum gpio_signal signal);
|
||||
|
||||
#endif /* __BOARD_H */
|
||||
@@ -1,11 +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.
|
||||
#
|
||||
# Board specific files build
|
||||
|
||||
# the IC is STmicro STM32L151R8H6
|
||||
CHIP:=stm32
|
||||
CHIP_VARIANT:=stm32l15x
|
||||
|
||||
board-y=board.o
|
||||
@@ -1,20 +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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* List of enabled tasks in the priority order
|
||||
*
|
||||
* The first one has the lowest priority.
|
||||
*
|
||||
* For each task, use the macro TASK(n, r, d) where :
|
||||
* 'n' in the name of the task
|
||||
* 'r' in the main routine of the task
|
||||
* 'd' in an opaque parameter passed to the routine at startup
|
||||
*/
|
||||
#define CONFIG_TASK_LIST \
|
||||
TASK(WATCHDOG, watchdog_task, NULL) \
|
||||
TASK(KEYSCAN, keyboard_scan_task, NULL) \
|
||||
TASK(GAIAPOWER, gaia_power_task, NULL) \
|
||||
TASK(CONSOLE, console_task, NULL)
|
||||
@@ -1,67 +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.
|
||||
*/
|
||||
/* STM32L Discovery board-specific configuration */
|
||||
|
||||
#include "board.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)
|
||||
|
||||
#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 */
|
||||
{"USER_BUTTON", GPIO_A, (1<<0), 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 */
|
||||
{"BLUE_LED", GPIO_B, (1<<6), GPIO_OUT_LOW, NULL},
|
||||
{"GREEN_LED", GPIO_B, (1<<7), 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<<13), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT04", GPIO_B, (1<<14), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT05", GPIO_B, (1<<15), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT06", GPIO_C, (1<<0), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT07", GPIO_C, (1<<1), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT08", GPIO_C, (1<<2), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT09", GPIO_A, (1<<1), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT10", GPIO_A, (1<<2), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT11", GPIO_C, (1<<6), GPIO_KB_OUTPUT, NULL},
|
||||
{"KB_OUT12", GPIO_C, (1<<7), GPIO_KB_OUTPUT, NULL},
|
||||
};
|
||||
|
||||
void configure_board(void)
|
||||
{
|
||||
/* Enable all GPIOs clocks in normal run-mode, enable keyboard
|
||||
* GPIO clocks in low-power (sleep) mode.
|
||||
* TODO: more fine-grained enabling for power saving
|
||||
*/
|
||||
STM32_RCC_AHBENR |= 0x3f;
|
||||
STM32_RCC_AHBLPENR |= 0x0e;
|
||||
STM32_RCC_APB2ENR |= 0x01;
|
||||
|
||||
#if CONFIG_CONSOLE_UART == 1
|
||||
/* Select Alternate function for USART1 on pins PA9/PA10 */
|
||||
gpio_set_alternate_function(GPIO_A, (1<<9) | (1<<10), GPIO_ALT_USART);
|
||||
#elif CONFIG_CONSOLE_UART == 3
|
||||
/* Select Alternate function for USART3 on pins PB10/PB11 */
|
||||
gpio_set_alternate_function(GPIO_B, (1<<10) | (1<<11), GPIO_ALT_USART);
|
||||
#endif
|
||||
}
|
||||
@@ -1,62 +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.
|
||||
*/
|
||||
|
||||
/* STM32L Discovery board configuration */
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
/* 16 MHz SYSCLK clock frequency */
|
||||
#define CPU_CLOCK 16000000
|
||||
|
||||
/* Use USART3 as console serial port */
|
||||
#define CONFIG_CONSOLE_UART 1
|
||||
|
||||
#define USB_CHARGE_PORT_COUNT 0
|
||||
|
||||
/* Host connects to keyboard controller module via I2C */
|
||||
#define HOST_KB_BUS_I2C
|
||||
|
||||
/* GPIO signal list */
|
||||
enum gpio_signal {
|
||||
/* Inputs with interrupt handlers are first for efficiency */
|
||||
GPIO_USER_BUTTON = 0, /* Blue user button */
|
||||
/* Keyboard inputs */
|
||||
GPIO_KB_IN00,
|
||||
GPIO_KB_IN01,
|
||||
GPIO_KB_IN02,
|
||||
GPIO_KB_IN03,
|
||||
GPIO_KB_IN04,
|
||||
GPIO_KB_IN05,
|
||||
GPIO_KB_IN06,
|
||||
GPIO_KB_IN07,
|
||||
/* Other inputs */
|
||||
/* Outputs */
|
||||
GPIO_BLUE_LED, /* Blue debug LED */
|
||||
GPIO_GREEN_LED, /* Green debug LED */
|
||||
/* Keyboard outputs */
|
||||
GPIO_KB_OUT00,
|
||||
GPIO_KB_OUT01,
|
||||
GPIO_KB_OUT02,
|
||||
GPIO_KB_OUT03,
|
||||
GPIO_KB_OUT04,
|
||||
GPIO_KB_OUT05,
|
||||
GPIO_KB_OUT06,
|
||||
GPIO_KB_OUT07,
|
||||
GPIO_KB_OUT08,
|
||||
GPIO_KB_OUT09,
|
||||
GPIO_KB_OUT10,
|
||||
GPIO_KB_OUT11,
|
||||
GPIO_KB_OUT12,
|
||||
|
||||
/* Number of GPIOs; not an actual GPIO */
|
||||
GPIO_COUNT
|
||||
};
|
||||
|
||||
void configure_board(void);
|
||||
|
||||
void matrix_interrupt(enum gpio_signal signal);
|
||||
|
||||
#endif /* __BOARD_H */
|
||||
@@ -1,11 +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.
|
||||
#
|
||||
# Board specific files build
|
||||
|
||||
# the IC is STmicro STM32L151R8H6
|
||||
CHIP:=stm32
|
||||
CHIP_VARIANT:=stm32l15x
|
||||
|
||||
board-y=board.o
|
||||
@@ -1,19 +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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* List of enabled tasks in the priority order
|
||||
*
|
||||
* The first one has the lowest priority.
|
||||
*
|
||||
* For each task, use the macro TASK(n, r, d) where :
|
||||
* 'n' in the name of the task
|
||||
* 'r' in the main routine of the task
|
||||
* 'd' in an opaque parameter passed to the routine at startup
|
||||
*/
|
||||
#define CONFIG_TASK_LIST \
|
||||
TASK(WATCHDOG, watchdog_task, NULL) \
|
||||
TASK(KEYSCAN, keyboard_scan_task, NULL) \
|
||||
TASK(CONSOLE, console_task, NULL)
|
||||
@@ -20,11 +20,7 @@
|
||||
#define CONFIG_IRQ_COUNT 45
|
||||
|
||||
/* Debug UART parameters for panic message */
|
||||
#ifdef BOARD_adv
|
||||
#define CONFIG_UART_ADDRESS 0x40004400 /* USART2 */
|
||||
#else
|
||||
#define CONFIG_UART_ADDRESS 0x40013800 /* USART1 */
|
||||
#endif
|
||||
#define CONFIG_UART_DR_OFFSET 0x04
|
||||
#define CONFIG_UART_SR_OFFSET 0x00
|
||||
#define CONFIG_UART_SR_TXEMPTY 0x80
|
||||
|
||||
@@ -66,10 +66,8 @@ struct kbc_gpio {
|
||||
int pin;
|
||||
};
|
||||
|
||||
#if defined(BOARD_daisy) || defined(BOARD_adv)
|
||||
#if defined(BOARD_daisy)
|
||||
static const uint32_t ports[] = { GPIO_B, GPIO_C, GPIO_D };
|
||||
#elif defined(BOARD_discovery)
|
||||
static const uint32_t ports[] = { GPIO_A, GPIO_B, GPIO_C, GPIO_D };
|
||||
#else
|
||||
#error "Need to specify GPIO ports used by keyboard"
|
||||
#endif
|
||||
@@ -183,7 +181,7 @@ static int check_keys_changed(void)
|
||||
udelay(50);
|
||||
|
||||
r = 0;
|
||||
#if defined(BOARD_daisy) || defined(BOARD_discovery) || defined(BOARD_adv)
|
||||
#if defined(BOARD_daisy)
|
||||
tmp = STM32_GPIO_IDR(C);
|
||||
/* KB_COL00:04 = PC8:12 */
|
||||
if (tmp & (1 << 8))
|
||||
|
||||
@@ -157,7 +157,7 @@ static int spi_init(void)
|
||||
{
|
||||
int port;
|
||||
|
||||
#if defined(BOARD_discovery) || defined(BOARD_daisy)
|
||||
#if defined(BOARD_daisy)
|
||||
/**
|
||||
* SPI1
|
||||
* PA7: SPI1_MOSI
|
||||
|
||||
@@ -59,14 +59,8 @@ int watchdog_init(int period_ms)
|
||||
void watchdog_task(void)
|
||||
{
|
||||
while (1) {
|
||||
#ifdef BOARD_discovery
|
||||
gpio_set_level(GPIO_GREEN_LED, 1);
|
||||
#endif
|
||||
usleep(500000);
|
||||
watchdog_reload();
|
||||
#ifdef BOARD_discovery
|
||||
gpio_set_level(GPIO_GREEN_LED, 0);
|
||||
#endif
|
||||
usleep(500000);
|
||||
watchdog_reload();
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ static void jump_to_other_image(void)
|
||||
if (system_jumped_to_this_image())
|
||||
return;
|
||||
|
||||
#if !defined(BOARD_daisy) && !defined(BOARD_discovery) && !defined(BOARD_adv)
|
||||
/* TODO: (crosbug.com/p/8572) Daisy and discovery don't define a GPIO
|
||||
#if !defined(BOARD_daisy)
|
||||
/* TODO: (crosbug.com/p/8572) Daisy doesn't define a GPIO
|
||||
* for the recovery signal from servo, so can't check it. */
|
||||
if (gpio_get_level(GPIO_RECOVERYn) == 0) {
|
||||
CPUTS("[Vboot staying in RO due to recovery signal]\n");
|
||||
|
||||
Reference in New Issue
Block a user