mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
veyron: Porting to the new EC(STM32F071)
* Changed chip in build.mk * Renamed the Port H pins * Switched to 32bit timer * Remapped UART DMA Channel BUG=None TEST=Flash the new chip; UART Debug, SPI HC, I2C Battery should work. Everything else should work (besides power usage) BRANCH=None Change-Id: Ia73f3f6b4e8b7b42af4dfa592b7ff435ee379206 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/210522 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
b2a426efaf
commit
e7e66acd66
@@ -57,3 +57,19 @@ int board_discharge_on_ac(int enable)
|
||||
{
|
||||
return charger_discharge_on_ac(enable);
|
||||
}
|
||||
|
||||
void board_config_pre_init(void)
|
||||
{
|
||||
/* enable SYSCFG clock */
|
||||
STM32_RCC_APB2ENR |= 1 << 0;
|
||||
|
||||
/* Remap USART DMA to match the USART driver */
|
||||
/*
|
||||
* the DMA mapping is :
|
||||
* Chan 2 : TIM1_CH1
|
||||
* Chan 3 : SPI1_TX
|
||||
* Chan 4 : USART1_TX
|
||||
* Chan 5 : USART1_RX
|
||||
*/
|
||||
STM32_SYSCFG_CFGR1 |= (1 << 9) | (1 << 10); /* Remap USART1 RX/TX DMA */
|
||||
}
|
||||
|
||||
@@ -27,10 +27,15 @@
|
||||
#define CONFIG_VBOOT_HASH
|
||||
#define CONFIG_LED_COMMON
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
#undef CONFIG_CONSOLE_CMDHELP
|
||||
#define CONFIG_BOARD_PRE_INIT
|
||||
#define CONFIG_STM_HWTIMER32
|
||||
#undef CONFIG_WATCHDOG_HELP
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
/* 48 MHz SYSCLK clock frequency */
|
||||
#define CPU_CLOCK 48000000
|
||||
|
||||
/* Keyboard output port list */
|
||||
#define KB_OUT_PORT_LIST GPIO_A, GPIO_B, GPIO_C
|
||||
|
||||
@@ -40,10 +45,8 @@
|
||||
#define I2C_PORT_CHARGER I2C_PORT_MASTER
|
||||
|
||||
/* Timer selection */
|
||||
#define TIM_CLOCK_MSB 3
|
||||
#define TIM_CLOCK_LSB 9
|
||||
#define TIM_POWER_LED 2
|
||||
#define TIM_WATCHDOG 4
|
||||
#define TIM_CLOCK32 2
|
||||
#define TIM_WATCHDOG 4
|
||||
|
||||
#include "gpio_signal.h"
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#
|
||||
# Board specific files build
|
||||
|
||||
# the IC is STmicro STM32L100RBT6
|
||||
# the IC is STmicro STM32F071RB
|
||||
CHIP:=stm32
|
||||
CHIP_FAMILY:=stm32l
|
||||
CHIP_VARIANT:=stm32l15x
|
||||
CHIP_FAMILY:=stm32f0
|
||||
CHIP_VARIANT:=stm32f07x
|
||||
|
||||
board-y=board.o battery.o led.o
|
||||
|
||||
@@ -28,11 +28,13 @@ GPIO(WP_L, B, 4, GPIO_INPUT, NULL)
|
||||
|
||||
/* Outputs */
|
||||
GPIO(AP_RESET_H, B, 3, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL)
|
||||
GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL)
|
||||
GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(EC_INT, B, 9, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW, NULL)
|
||||
GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW, NULL)
|
||||
GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL)
|
||||
GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL)
|
||||
GPIO(PMIC_PWRON_L, A, 12, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL)
|
||||
GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL)
|
||||
GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL)
|
||||
@@ -46,13 +48,11 @@ GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL)
|
||||
GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL)
|
||||
GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL)
|
||||
GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL)
|
||||
GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL)
|
||||
GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL)
|
||||
GPIO(EC_BL_OVERRIDE, H, 1, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(PMIC_SOURCE_PWR_H, B, 10, GPIO_OUT_LOW, NULL)
|
||||
GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(PMIC_PWRON_L, A, 12, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(PMIC_SOURCE_PWR_H, B, 10, GPIO_OUT_LOW, NULL)
|
||||
GPIO(PMIC_USB_CTRL1_H, C, 6, GPIO_OUT_HIGH, NULL)
|
||||
GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_OUT_HIGH, NULL)
|
||||
|
||||
ALTERNATE(A, 0x00f0, GPIO_ALT_SPI, MODULE_SPI, GPIO_DEFAULT)
|
||||
ALTERNATE(A, 0x0600, GPIO_ALT_USART, MODULE_UART, GPIO_DEFAULT)
|
||||
ALTERNATE(B, 0x00c0, GPIO_ALT_I2C, MODULE_I2C, GPIO_DEFAULT)
|
||||
ALTERNATE(A, 0x00f0, 0, MODULE_SPI, 0)
|
||||
ALTERNATE(A, 0x0600, 1, MODULE_UART, 0)
|
||||
ALTERNATE(B, 0x00c0, 1, MODULE_I2C, 0)
|
||||
|
||||
Reference in New Issue
Block a user