diff options
Diffstat (limited to 'board/nucleo-f411re')
-rw-r--r-- | board/nucleo-f411re/board.c | 124 | ||||
-rw-r--r-- | board/nucleo-f411re/board.h | 78 | ||||
-rw-r--r-- | board/nucleo-f411re/build.mk | 12 | ||||
-rw-r--r-- | board/nucleo-f411re/ec.tasklist | 13 | ||||
-rw-r--r-- | board/nucleo-f411re/gpio.inc | 31 | ||||
-rw-r--r-- | board/nucleo-f411re/openocd-flash.cfg | 19 |
6 files changed, 0 insertions, 277 deletions
diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c deleted file mode 100644 index a177a793ab..0000000000 --- a/board/nucleo-f411re/board.c +++ /dev/null @@ -1,124 +0,0 @@ -/* Copyright 2015 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. - */ -/* nucleo-f411re development board configuration */ - -#include "adc.h" -#include "common.h" -#include "console.h" -#include "driver/accelgyro_bmi_common.h" -#include "ec_version.h" -#include "gpio.h" -#include "hooks.h" -#include "i2c.h" -#include "motion_sense.h" - -#include "gpio.h" -#include "registers.h" -#include "task.h" -#include "util.h" - -void user_button_evt(enum gpio_signal signal) -{ - ccprintf("Button %d, %d!\n", signal, gpio_get_level(signal)); -} - -#include "gpio_list.h" - -/* Initialize board. */ -static void board_init(void) -{ - gpio_enable_interrupt(GPIO_USER_BUTTON_L); - - /* No power control yet */ - /* Go to S3 state */ - hook_notify(HOOK_CHIPSET_STARTUP); - - /* Go to S0 state */ - hook_notify(HOOK_CHIPSET_RESUME); -} -DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); - -/* ADC channels */ -const struct adc_t adc_channels[] = { - /* Arduino connectors analog pins */ - [ADC1_0] = {"ADC1_0", 3000, 4096, 0, STM32_AIN(0)}, - [ADC1_1] = {"ADC1_1", 3000, 4096, 0, STM32_AIN(1)}, - [ADC1_4] = {"ADC1_4", 3000, 4096, 0, STM32_AIN(4)}, - [ADC1_8] = {"ADC1_8", 3000, 4096, 0, STM32_AIN(8)}, -}; -BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); - -/* I2C ports */ -const struct i2c_port_t i2c_ports[] = { - {"master", I2C_PORT_MASTER, 100, - GPIO_MASTER_I2C_SCL, GPIO_MASTER_I2C_SDA}, -}; - -const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - -/* Base Sensor mutex */ -static struct mutex g_base_mutex; - -static struct bmi_drv_data_t g_bmi160_data; - -struct motion_sensor_t motion_sensors[] = { - [BASE_ACCEL] = { - .name = "Base Accel", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_BMI160, - .type = MOTIONSENSE_TYPE_ACCEL, - .location = MOTIONSENSE_LOC_BASE, - .drv = &bmi160_drv, - .mutex = &g_base_mutex, - .drv_data = &g_bmi160_data, - .port = I2C_PORT_ACCEL, - .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, - .default_range = 4, /* g, to meet CDD 7.3.1/C-1-4 reqs */ - .min_frequency = BMI_ACCEL_MIN_FREQ, - .max_frequency = BMI_ACCEL_MAX_FREQ, - .config = { - /* EC use accel for angle detection */ - [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, - }, - /* Sensor on for lid angle detection */ - [SENSOR_CONFIG_EC_S3] = { - .odr = 10000 | ROUND_UP_FLAG, - .ec_rate = 100 * MSEC, - }, - }, - }, - - [BASE_GYRO] = { - .name = "Base Gyro", - .active_mask = SENSOR_ACTIVE_S0_S3, - .chip = MOTIONSENSE_CHIP_BMI160, - .type = MOTIONSENSE_TYPE_GYRO, - .location = MOTIONSENSE_LOC_BASE, - .drv = &bmi160_drv, - .mutex = &g_base_mutex, - .drv_data = &g_bmi160_data, - .port = I2C_PORT_ACCEL, - .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, - .default_range = 1000, /* dps */ - .min_frequency = BMI_GYRO_MIN_FREQ, - .max_frequency = BMI_GYRO_MAX_FREQ, - }, -}; -const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); - -#ifdef CONFIG_DMA_HELP -#include "dma.h" -int command_dma_help(int argc, char **argv) -{ - dma_dump(STM32_DMA2_STREAM0); - dma_test(STM32_DMA2_STREAM0); - dma_dump(STM32_DMA2_STREAM0); - return EC_SUCCESS; -} -DECLARE_CONSOLE_COMMAND(dmahelp, command_dma_help, - NULL, "Run DMA test"); -#endif diff --git a/board/nucleo-f411re/board.h b/board/nucleo-f411re/board.h deleted file mode 100644 index 56d2ad41d0..0000000000 --- a/board/nucleo-f411re/board.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright 2015 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. - */ - -/* Nucleo-F411RE development board configuration */ - -#ifndef __BOARD_H -#define __BOARD_H - -/* 84 MHz CPU/AHB/APB2 clock frequency (APB1 = 42 Mhz) */ -#define CPU_CLOCK 84000000 -#define CONFIG_FLASH_WRITE_SIZE STM32_FLASH_WRITE_SIZE_3300 - - -/* the UART console is on USART2 (PA2/PA3) */ -#undef CONFIG_UART_CONSOLE -#define CONFIG_UART_CONSOLE 2 - -/* Optional features */ -#undef CONFIG_LID_SWITCH -#undef CONFIG_HIBERNATE -#define CONFIG_STM_HWTIMER32 -#define CONFIG_WATCHDOG_HELP -#define CONFIG_TASK_PROFILING - -#undef CONFIG_ADC -#define CONFIG_DMA_HELP -#define CONFIG_I2C - -#undef CONFIG_UART_RX_DMA -#define CONFIG_UART_TX_DMA_CH STM32_DMAS_USART2_TX -#define CONFIG_UART_RX_DMA_CH STM32_DMAS_USART2_RX -#define CONFIG_UART_TX_REQ_CH STM32_REQ_USART2_TX -#define CONFIG_UART_RX_REQ_CH STM32_REQ_USART2_RX - -#define CONFIG_ACCELGYRO_BMI160 -#define CONFIG_CMD_ACCELS -#define CONFIG_CMD_ACCEL_INFO -#define CONFIG_CMD_FLASH - -/* I2C ports configuration */ -#define CONFIG_I2C_CONTROLLER -#define CONFIG_I2C_DEBUG -#define I2C_PORT_MASTER 1 -#define I2C_PORT_SLAVE 0 /* needed for DMAC macros (ugh) */ -#define I2C_PORT_ACCEL I2C_PORT_MASTER - -#ifndef __ASSEMBLER__ - -/* Timer selection */ -#define TIM_CLOCK32 2 -#define TIM_WATCHDOG 11 - -#define CONFIG_WP_ALWAYS -#define CONFIG_FLASH_READOUT_PROTECTION - -/* ADC signal */ -enum adc_channel { - ADC1_0 = 0, - ADC1_1, - ADC1_4, - ADC1_8, - /* Number of ADC channels */ - ADC_CH_COUNT -}; - -enum sensor_id { - BASE_ACCEL = 0, - BASE_GYRO, - SENSOR_COUNT, -}; - -#include "gpio_signal.h" - -#endif /* !__ASSEMBLER__ */ - -#endif /* __BOARD_H */ diff --git a/board/nucleo-f411re/build.mk b/board/nucleo-f411re/build.mk deleted file mode 100644 index 3a5fc28558..0000000000 --- a/board/nucleo-f411re/build.mk +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2015 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 STM32F411RE -CHIP:=stm32 -CHIP_FAMILY:=stm32f4 -CHIP_VARIANT:=stm32f411 - -board-y=board.o diff --git a/board/nucleo-f411re/ec.tasklist b/board/nucleo-f411re/ec.tasklist deleted file mode 100644 index b5e3cb82b2..0000000000 --- a/board/nucleo-f411re/ec.tasklist +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright 2015 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. - */ - -/** - * See CONFIG_TASK_LIST in config.h for details. - */ -#define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_NOTEST(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) diff --git a/board/nucleo-f411re/gpio.inc b/board/nucleo-f411re/gpio.inc deleted file mode 100644 index 83a9e51a08..0000000000 --- a/board/nucleo-f411re/gpio.inc +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- mode:c -*- - * - * Copyright 2015 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. - */ - -/* Interrupts */ -GPIO_INT(USER_BUTTON_L, PIN(C, 13), GPIO_INT_BOTH, user_button_evt) - -/* User LED */ -GPIO(USER_LED, PIN(A, 5), GPIO_OUT_LOW) - -GPIO(BMI160_INT2_L, PIN(C, 10), GPIO_OUT_LOW) -/* - * I2C pins should be configured as inputs until I2C module is - * initialized. This will avoid driving the lines unintentionally. - */ -GPIO(MASTER_I2C_SCL, PIN(B, 10), GPIO_INPUT) -GPIO(MASTER_I2C_SDA, PIN(B, 3), GPIO_INPUT) -GPIO(SLAVE_I2C_SCL, PIN(B, 8), GPIO_INPUT) -GPIO(SLAVE_I2C_SDA, PIN(B, 9), GPIO_INPUT) - -UNIMPLEMENTED(ENTERING_RW) -UNIMPLEMENTED(WP_L) - -ALTERNATE(PIN_MASK(A, 0x000C), GPIO_ALT_USART, MODULE_UART, GPIO_PULL_UP) /* USART2: PA2/PA3 */ -ALTERNATE(PIN_MASK(B, 0x0400), GPIO_ALT_I2C, MODULE_I2C, 0) /* I2C MASTER:PB10 */ -ALTERNATE(PIN_MASK(B, 0x0008), GPIO_ALT_I2C_23, MODULE_I2C, 0) /* I2C MASTER:PB3 */ -ALTERNATE(PIN_MASK(B, 0x0200), GPIO_ALT_I2C, MODULE_I2C, 0) /* I2C SLAVE:PB9 */ -ALTERNATE(PIN_MASK(B, 0x0100), GPIO_ALT_I2C, MODULE_I2C, 0) /* I2C SLAVE:PB8 */ diff --git a/board/nucleo-f411re/openocd-flash.cfg b/board/nucleo-f411re/openocd-flash.cfg deleted file mode 100644 index 7a6ea6316c..0000000000 --- a/board/nucleo-f411re/openocd-flash.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2016 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. - -source [find board/st_nucleo_f4.cfg] - -# For flashing, force the board into reset on connect, this ensures that -# code running on the core can't interfere with programming. -reset_config connect_assert_srst - -gdb_port 0 -tcl_port 0 -telnet_port 0 -init -reset init -flash write_image erase unlock $BUILD_DIR/ec.bin 0x08000000 -reset halt -resume -shutdown |