mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
stm32l: de-duplicate stubs used for all STM32L based boards
Avoid duplicating in each board file, the stub functions replacing not implemented drivers on the STM32L platform. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=make BOARD=daisy && make BOARD=discovery Change-Id: I25cd949c31e53a90c39f623617c7d52517a3d205
This commit is contained in:
@@ -42,35 +42,3 @@ void configure_board(void)
|
||||
/* Select Alternate function for USART1 on pins PA9/PA10 */
|
||||
gpio_set_alternate_function(GPIO_A, (1<<9) | (1<<10), GPIO_ALT_USART);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stubs for non implemented drivers
|
||||
* TODO: implement
|
||||
*/
|
||||
int jtag_pre_init(void)
|
||||
{
|
||||
/* stop TIM2, TIM3 and watchdogs when the JTAG stops the CPU */
|
||||
STM32L_DBGMCU_APB1FZ |= 0x00001803;
|
||||
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int eeprom_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int i2c_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int power_button_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int adc_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -34,35 +34,3 @@ void configure_board(void)
|
||||
gpio_set_alternate_function(GPIO_B, (1<<10) | (1<<11), GPIO_ALT_USART);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Stubs for non implemented drivers
|
||||
* TODO: implement
|
||||
*/
|
||||
int jtag_pre_init(void)
|
||||
{
|
||||
/* stop TIM2, TIM3 and watchdogs when the JTAG stops the CPU */
|
||||
STM32L_DBGMCU_APB1FZ |= 0x00001803;
|
||||
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int eeprom_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int i2c_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int power_button_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int adc_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
CORE:=cortex-m
|
||||
|
||||
chip-y=uart.o clock.o hwtimer.o system.o gpio.o
|
||||
chip-y+=jtag.o stubs.o
|
||||
chip-$(CONFIG_TASK_WATCHDOG)+=watchdog.o
|
||||
|
||||
16
chip/stm32l/jtag.c
Normal file
16
chip/stm32l/jtag.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/* 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.
|
||||
*/
|
||||
/* Settings to enable JTAG debugging */
|
||||
|
||||
#include "jtag.h"
|
||||
#include "registers.h"
|
||||
|
||||
int jtag_pre_init(void)
|
||||
{
|
||||
/* stop TIM2, TIM3 and watchdogs when the JTAG stops the CPU */
|
||||
STM32L_DBGMCU_APB1FZ |= 0x00001803;
|
||||
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
30
chip/stm32l/stubs.c
Normal file
30
chip/stm32l/stubs.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* 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.
|
||||
*/
|
||||
/* Stubs for non implemented drivers */
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* TODO: implement
|
||||
*/
|
||||
int eeprom_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int i2c_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int power_button_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
int adc_init(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user