summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.toolchain5
-rw-r--r--board/daisy/build.mk1
-rw-r--r--board/mccroskey/build.mk2
-rw-r--r--board/pit/build.mk1
-rw-r--r--board/snow/build.mk1
-rw-r--r--board/spring/build.mk1
-rw-r--r--chip/stm32/build.mk6
-rw-r--r--chip/stm32/clock-stm32f.c (renamed from chip/stm32/clock-stm32f100.c)0
l---------chip/stm32/clock-stm32f10x.c1
-rw-r--r--chip/stm32/clock-stm32l.c (renamed from chip/stm32/clock-stm32l15x.c)0
-rw-r--r--chip/stm32/flash-stm32f.c (renamed from chip/stm32/flash-stm32f100.c)0
l---------chip/stm32/flash-stm32f10x.c1
-rw-r--r--chip/stm32/flash-stm32l.c (renamed from chip/stm32/flash-stm32l15x.c)0
-rw-r--r--chip/stm32/gpio-stm32f.c (renamed from chip/stm32/gpio-stm32f100.c)0
l---------chip/stm32/gpio-stm32f10x.c1
-rw-r--r--chip/stm32/gpio-stm32l.c (renamed from chip/stm32/gpio-stm32l15x.c)0
-rw-r--r--chip/stm32/hwtimer.c4
-rw-r--r--chip/stm32/i2c-stm32f.c (renamed from chip/stm32/i2c-stm32f100.c)0
l---------chip/stm32/i2c-stm32f10x.c1
-rw-r--r--chip/stm32/i2c-stm32l.c (renamed from chip/stm32/i2c-stm32l15x.c)0
-rw-r--r--chip/stm32/jtag-stm32f.c (renamed from chip/stm32/jtag-stm32f100.c)0
l---------chip/stm32/jtag-stm32f10x.c1
-rw-r--r--chip/stm32/jtag-stm32l.c (renamed from chip/stm32/jtag-stm32l15x.c)0
-rw-r--r--chip/stm32/registers.h22
-rw-r--r--chip/stm32/system.c8
-rw-r--r--chip/stm32/uart.c4
-rw-r--r--common/flash_common.c4
-rw-r--r--common/i2c_common.c4
28 files changed, 34 insertions, 34 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain
index c9de7aaf78..9eaf2c4ceb 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -34,8 +34,9 @@ CFLAGS_COVERAGE=$(if $(TEST_COVERAGE),-fprofile-arcs -ftest-coverage \
-DTEST_COVERAGE,)
CFLAGS_DEFINE=-DOUTDIR=$(out) -DCHIP=$(CHIP) -DBOARD_TASKFILE=ec.tasklist \
-DBOARD=$(BOARD) -DBOARD_$(BOARD) -DCORE=$(CORE) \
- -DCHIP_$(CHIP) -DCHIP_VARIANT=$(CHIP_VARIANT) \
- -DCHIP_VARIANT_$(CHIP_VARIANT) -DPROJECT=$(PROJECT)
+ -DPROJECT=$(PROJECT) -DCHIP_$(CHIP) \
+ -DCHIP_VARIANT=$(CHIP_VARIANT) -DCHIP_VARIANT_$(CHIP_VARIANT) \
+ -DCHIP_FAMILY=$(CHIP_FAMILY) -DCHIP_FAMILY_$(CHIP_FAMILY)
CPPFLAGS=$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) $(CFLAGS_TEST) \
$(EXTRA_CFLAGS) $(CFLAGS_COVERAGE)
CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(CFLAGS_WARN) $(CFLAGS_y)
diff --git a/board/daisy/build.mk b/board/daisy/build.mk
index 3fd1e94556..c6b8ef64ea 100644
--- a/board/daisy/build.mk
+++ b/board/daisy/build.mk
@@ -7,6 +7,7 @@
# the IC is STmicro STM32L151R8H6
CHIP:=stm32
+CHIP_FAMILY:=stm32l
CHIP_VARIANT:=stm32l15x
board-y=board.o
diff --git a/board/mccroskey/build.mk b/board/mccroskey/build.mk
index aedcb384eb..b3956b1645 100644
--- a/board/mccroskey/build.mk
+++ b/board/mccroskey/build.mk
@@ -7,7 +7,7 @@
# the IC is STmicro STM32F102R8
CHIP:=stm32
-
+CHIP_FAMILY:=stm32f
CHIP_VARIANT:=stm32f10x
board-y=board.o
diff --git a/board/pit/build.mk b/board/pit/build.mk
index 2aec946f29..8de1b957d3 100644
--- a/board/pit/build.mk
+++ b/board/pit/build.mk
@@ -7,6 +7,7 @@
# the IC is STmicro STM32L151R8H6
CHIP:=stm32
+CHIP_FAMILY:=stm32l
CHIP_VARIANT:=stm32l15x
board-y=board.o
diff --git a/board/snow/build.mk b/board/snow/build.mk
index 53d994e236..88b201efd5 100644
--- a/board/snow/build.mk
+++ b/board/snow/build.mk
@@ -7,6 +7,7 @@
# the IC is STmicro STM32F100R8
CHIP:=stm32
+CHIP_FAMILY:=stm32f
CHIP_VARIANT:=stm32f100
board-y=board.o
diff --git a/board/spring/build.mk b/board/spring/build.mk
index 8c1bc9c0a6..28c73da08f 100644
--- a/board/spring/build.mk
+++ b/board/spring/build.mk
@@ -6,6 +6,7 @@
# the IC is STmicro STM32F100RB
CHIP:=stm32
+CHIP_FAMILY:=stm32f
CHIP_VARIANT:=stm32f100
board-y=board.o
diff --git a/chip/stm32/build.mk b/chip/stm32/build.mk
index b45f6b6929..24ae387ca7 100644
--- a/chip/stm32/build.mk
+++ b/chip/stm32/build.mk
@@ -10,11 +10,11 @@
CORE:=cortex-m
chip-y=dma.o hwtimer.o system.o uart.o
-chip-y+=jtag-$(CHIP_VARIANT).o clock-$(CHIP_VARIANT).o gpio-$(CHIP_VARIANT).o
+chip-y+=jtag-$(CHIP_FAMILY).o clock-$(CHIP_FAMILY).o gpio-$(CHIP_FAMILY).o
chip-$(CONFIG_SPI)+=spi.o
-chip-$(CONFIG_I2C)+=i2c-$(CHIP_VARIANT).o
+chip-$(CONFIG_I2C)+=i2c-$(CHIP_FAMILY).o
chip-$(CONFIG_WATCHDOG)+=watchdog.o
chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o
chip-$(HAS_TASK_POWERLED)+=power_led.o
-chip-$(CONFIG_FLASH)+=flash-$(CHIP_VARIANT).o
+chip-$(CONFIG_FLASH)+=flash-$(CHIP_FAMILY).o
chip-$(CONFIG_ADC)+=adc.o
diff --git a/chip/stm32/clock-stm32f100.c b/chip/stm32/clock-stm32f.c
index e878d7856d..e878d7856d 100644
--- a/chip/stm32/clock-stm32f100.c
+++ b/chip/stm32/clock-stm32f.c
diff --git a/chip/stm32/clock-stm32f10x.c b/chip/stm32/clock-stm32f10x.c
deleted file mode 120000
index 4abd363cde..0000000000
--- a/chip/stm32/clock-stm32f10x.c
+++ /dev/null
@@ -1 +0,0 @@
-clock-stm32f100.c \ No newline at end of file
diff --git a/chip/stm32/clock-stm32l15x.c b/chip/stm32/clock-stm32l.c
index 79b618363f..79b618363f 100644
--- a/chip/stm32/clock-stm32l15x.c
+++ b/chip/stm32/clock-stm32l.c
diff --git a/chip/stm32/flash-stm32f100.c b/chip/stm32/flash-stm32f.c
index c0f5ae4cd3..c0f5ae4cd3 100644
--- a/chip/stm32/flash-stm32f100.c
+++ b/chip/stm32/flash-stm32f.c
diff --git a/chip/stm32/flash-stm32f10x.c b/chip/stm32/flash-stm32f10x.c
deleted file mode 120000
index e9df79b196..0000000000
--- a/chip/stm32/flash-stm32f10x.c
+++ /dev/null
@@ -1 +0,0 @@
-flash-stm32f100.c \ No newline at end of file
diff --git a/chip/stm32/flash-stm32l15x.c b/chip/stm32/flash-stm32l.c
index afb614b921..afb614b921 100644
--- a/chip/stm32/flash-stm32l15x.c
+++ b/chip/stm32/flash-stm32l.c
diff --git a/chip/stm32/gpio-stm32f100.c b/chip/stm32/gpio-stm32f.c
index fdc2ff2549..fdc2ff2549 100644
--- a/chip/stm32/gpio-stm32f100.c
+++ b/chip/stm32/gpio-stm32f.c
diff --git a/chip/stm32/gpio-stm32f10x.c b/chip/stm32/gpio-stm32f10x.c
deleted file mode 120000
index 8e60b73de0..0000000000
--- a/chip/stm32/gpio-stm32f10x.c
+++ /dev/null
@@ -1 +0,0 @@
-gpio-stm32f100.c \ No newline at end of file
diff --git a/chip/stm32/gpio-stm32l15x.c b/chip/stm32/gpio-stm32l.c
index 8f7a0fc5f0..8f7a0fc5f0 100644
--- a/chip/stm32/gpio-stm32l15x.c
+++ b/chip/stm32/gpio-stm32l.c
diff --git a/chip/stm32/hwtimer.c b/chip/stm32/hwtimer.c
index 8067843734..5957e0e974 100644
--- a/chip/stm32/hwtimer.c
+++ b/chip/stm32/hwtimer.c
@@ -165,12 +165,12 @@ void __hw_timer_enable_clock(int n, int enable)
volatile uint32_t *reg;
uint32_t mask = 0;
-#if defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#if defined(CHIP_FAMILY_stm32f)
if (n == 1) {
reg = &STM32_RCC_APB2ENR;
mask = 1 << 11;
}
-#elif defined(CHIP_VARIANT_stm32l15x)
+#elif defined(CHIP_FAMILY_stm32l)
if (n >= 9 && n <= 11) {
reg = &STM32_RCC_APB2ENR;
mask = 1 << (n - 7);
diff --git a/chip/stm32/i2c-stm32f100.c b/chip/stm32/i2c-stm32f.c
index 3cdcbe84fd..3cdcbe84fd 100644
--- a/chip/stm32/i2c-stm32f100.c
+++ b/chip/stm32/i2c-stm32f.c
diff --git a/chip/stm32/i2c-stm32f10x.c b/chip/stm32/i2c-stm32f10x.c
deleted file mode 120000
index 26f2e35b1b..0000000000
--- a/chip/stm32/i2c-stm32f10x.c
+++ /dev/null
@@ -1 +0,0 @@
-i2c-stm32f100.c \ No newline at end of file
diff --git a/chip/stm32/i2c-stm32l15x.c b/chip/stm32/i2c-stm32l.c
index 36f6817815..36f6817815 100644
--- a/chip/stm32/i2c-stm32l15x.c
+++ b/chip/stm32/i2c-stm32l.c
diff --git a/chip/stm32/jtag-stm32f100.c b/chip/stm32/jtag-stm32f.c
index 9d55fdb906..9d55fdb906 100644
--- a/chip/stm32/jtag-stm32f100.c
+++ b/chip/stm32/jtag-stm32f.c
diff --git a/chip/stm32/jtag-stm32f10x.c b/chip/stm32/jtag-stm32f10x.c
deleted file mode 120000
index 64c8bc10d7..0000000000
--- a/chip/stm32/jtag-stm32f10x.c
+++ /dev/null
@@ -1 +0,0 @@
-jtag-stm32f100.c \ No newline at end of file
diff --git a/chip/stm32/jtag-stm32l15x.c b/chip/stm32/jtag-stm32l.c
index 71e5f711e2..71e5f711e2 100644
--- a/chip/stm32/jtag-stm32l15x.c
+++ b/chip/stm32/jtag-stm32l.c
diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h
index f4f054b99e..6a1f63ac09 100644
--- a/chip/stm32/registers.h
+++ b/chip/stm32/registers.h
@@ -133,7 +133,7 @@
#define STM32_TIM6_BASE 0x40001000
#define STM32_TIM7_BASE 0x40001400
#define STM32_TIM8_BASE 0x40013400 /* STM32F10x only */
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_FAMILY_stm32l)
#define STM32_TIM9_BASE 0x40010800 /* STM32L15X only */
#define STM32_TIM10_BASE 0x40010C00 /* STM32L15X only */
#define STM32_TIM11_BASE 0x40011000 /* STM32L15X only */
@@ -216,7 +216,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define GPIO_G STM32_GPIOG_BASE
#define GPIO_H STM32_GPIOH_BASE
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_FAMILY_stm32l)
#define STM32_GPIOA_BASE 0x40020000
#define STM32_GPIOB_BASE 0x40020400
#define STM32_GPIOC_BASE 0x40020800
@@ -247,7 +247,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define GPIO_ALT_RI 0xE
#define GPIO_ALT_EVENTOUT 0xF
-#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_FAMILY_stm32f)
#define STM32_GPIOA_BASE 0x40010800
#define STM32_GPIOB_BASE 0x40010c00
#define STM32_GPIOC_BASE 0x40011000
@@ -319,7 +319,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define STM32_PWR_CR_LPSDSR (1 << 0)
#define STM32_PWR_CSR REG32(STM32_PWR_BASE + 0x04)
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_FAMILY_stm32l)
#define STM32_RCC_BASE 0x40023800
#define STM32_RCC_CR REG32(STM32_RCC_BASE + 0x00)
@@ -354,7 +354,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define STM32_SYSCFG_PMC REG32(STM32_SYSCFG_BASE + 0x04)
#define STM32_SYSCFG_EXTICR(n) REG32(STM32_SYSCFG_BASE + 8 + 4 * (n))
-#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_FAMILY_stm32f)
#define STM32_RCC_BASE 0x40021000
#define STM32_RCC_CR REG32(STM32_RCC_BASE + 0x00)
@@ -405,7 +405,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define STM32_RTC_BASE 0x40002800
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_FAMILY_stm32l)
#define STM32_RTC_TR REG32(STM32_RTC_BASE + 0x00)
#define STM32_RTC_DR REG32(STM32_RTC_BASE + 0x04)
#define STM32_RTC_CR REG32(STM32_RTC_BASE + 0x08)
@@ -424,7 +424,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define STM32_BKP_DATA(n) STM32_RTC_BACKUP(n)
#define STM32_BKP_ENTRIES 20
-#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_FAMILY_stm32f)
#define STM32_RTC_CRH REG32(STM32_RTC_BASE + 0x00)
#define STM32_RTC_CRL REG32(STM32_RTC_BASE + 0x04)
#define STM32_RTC_PRLH REG32(STM32_RTC_BASE + 0x08)
@@ -501,7 +501,7 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
/* --- Flash --- */
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_FAMILY_stm32l)
#define STM32_FLASH_REGS_BASE 0x40023c00
#define STM32_FLASH_ACR REG32(STM32_FLASH_REGS_BASE + 0x00)
@@ -540,7 +540,7 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
#define STM32_OPTB_WRP3L 0x18
#define STM32_OPTB_WRP3H 0x1c
-#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_FAMILY_stm32f)
#define STM32_FLASH_REGS_BASE 0x40022000
#define STM32_FLASH_ACR REG32(STM32_FLASH_REGS_BASE + 0x00)
@@ -601,9 +601,9 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
/* --- DMA --- */
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_FAMILY_stm32l)
#define STM32_DMA1_BASE 0x40026000
-#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_FAMILY_stm32f)
#define STM32_DMA1_BASE 0x40020000
#else
#error Unsupported chip variant
diff --git a/chip/stm32/system.c b/chip/stm32/system.c
index 0530624b06..746cbd8001 100644
--- a/chip/stm32/system.c
+++ b/chip/stm32/system.c
@@ -151,14 +151,14 @@ void system_pre_init(void)
while (!(STM32_RCC_CSR & (1 << 1)))
;
/* re-configure RTC if needed */
-#if defined(CHIP_VARIANT_stm32l15x)
+#ifdef CHIP_FAMILY_stm32l
if ((STM32_RCC_CSR & 0x00C30000) != 0x00420000) {
/* the RTC settings are bad, we need to reset it */
STM32_RCC_CSR |= 0x00800000;
/* Enable RTC and use LSI as clock source */
STM32_RCC_CSR = (STM32_RCC_CSR & ~0x00C30000) | 0x00420000;
}
-#elif defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_FAMILY_stm32f)
if ((STM32_RCC_BDCR & 0x00018300) != 0x00008200) {
/* the RTC settings are bad, we need to reset it */
STM32_RCC_BDCR |= 0x00010000;
@@ -166,7 +166,7 @@ void system_pre_init(void)
STM32_RCC_BDCR = (STM32_RCC_BDCR & ~0x00018300) | 0x00008200;
}
#else
-#error "Unsupported chip variant"
+#error "Unsupported chip family"
#endif
check_reset_cause();
@@ -203,7 +203,7 @@ void system_reset(int flags)
if (flags & SYSTEM_RESET_HARD) {
-#ifdef CHIP_VARIANT_stm32l15x
+#ifdef CHIP_FAMILY_stm32l
/*
* Ask the flash module to reboot, so that we reload the
* option bytes.
diff --git a/chip/stm32/uart.c b/chip/stm32/uart.c
index b4770edff8..cade7542f8 100644
--- a/chip/stm32/uart.c
+++ b/chip/stm32/uart.c
@@ -118,7 +118,7 @@ static void uart_freq_change(void)
{
int div = DIV_ROUND_NEAREST(clock_get_freq(), CONFIG_UART_BAUD_RATE);
-#ifdef CHIP_VARIANT_stm32l15x
+#ifdef CHIP_FAMILY_stm32l
if (div / 16 > 0) {
/*
* CPU clock is high enough to support x16 oversampling.
@@ -165,7 +165,7 @@ void uart_init(void)
/* DMA disabled, special modes disabled, error interrupt disabled */
STM32_USART_CR3(UARTN) = 0x0000;
-#ifdef CHIP_VARIANT_stm32l15x
+#ifdef CHIP_FAMILY_stm32l
/* Use single-bit sampling */
STM32_USART_CR3(UARTN) |= STM32_USART_CR3_ONEBIT;
#endif
diff --git a/common/flash_common.c b/common/flash_common.c
index 30221c288d..1f8c199cbd 100644
--- a/common/flash_common.c
+++ b/common/flash_common.c
@@ -106,7 +106,7 @@ int flash_dataptr(int offset, int size_req, int align, const char **ptrp)
}
/* crosbug.com/p/13066 - not supported on STM32L */
-#ifndef CHIP_VARIANT_stm32l15x
+#ifndef CHIP_FAMILY_stm32l
int flash_is_erased(uint32_t offset, int size)
{
const uint32_t *ptr;
@@ -578,7 +578,7 @@ static int flash_command_protect(struct host_cmd_handler_args *args)
if (!(r->flags & EC_FLASH_PROTECT_RO_NOW))
r->writable_flags |= EC_FLASH_PROTECT_RO_AT_BOOT;
-#if defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#ifdef CHIP_FAMILY_stm32f
/*
* TODO: ignore all-now on STM32F if WP isn't asserted; this is left
* over from limitations in early snow.
diff --git a/common/i2c_common.c b/common/i2c_common.c
index 6ee923fadd..79920e5a36 100644
--- a/common/i2c_common.c
+++ b/common/i2c_common.c
@@ -345,10 +345,10 @@ static void scan_bus(int port, const char *desc)
watchdog_reload(); /* Otherwise a full scan trips watchdog */
ccputs(".");
-#if defined(CHIP_VARIANT_stm32f100) || defined(CHIP_VARIANT_stm32f10x)
+#ifdef CHIP_FAMILY_stm32f
/*
* Hope that address 0 exists, because the i2c_xfer()
- * implementation on STM32 can't read a byte without writing
+ * implementation on STM32F can't read a byte without writing
* one first.
*
* TODO: remove when that limitation is fixed.