summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-12-06 15:17:33 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-12-16 20:28:32 +0000
commit05bd0cdec7a3132fda3127c3c9daeed0ebae0dae (patch)
tree37720df1bbd03c8590a33212dfd147eab7b5430e /chip
parent33ea7aa4739390c2cce578ac8310f0d7b5b3679c (diff)
downloadchrome-ec-05bd0cdec7a3132fda3127c3c9daeed0ebae0dae.tar.gz
Rename mixed-case config constants
This renames constants used in compiler conditionals to uppercase. BOARD_foo CHIP_foo CHIP_FAMILY_foo CHIP_VARIANT_foo CORE_foo Mixed-case constants are still defined by the makefile, but are now no longer used. I will make one more pass in a week or so to catch any that are part of someone else's CL, since otherwise this change might silently merge correctly but result in incorrect compilation. Then I will remove defining the mixed-case constants. BUG=chromium:322144 BRANCH=none TEST=Build all boards. Also, "git grep 'BOARD_[a-z]'" should return no results (similarly for CHIP, CORE, etc.) Change-Id: I6418412e9f7ec604a35c2d426d12475dd83e7076 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179206 Reviewed-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/lm4/clock.c4
-rw-r--r--chip/stm32/clock-stm32f.c4
-rw-r--r--chip/stm32/config_chip.h8
-rw-r--r--chip/stm32/hwtimer.c4
-rw-r--r--chip/stm32/power_led.c2
-rw-r--r--chip/stm32/pwm.c4
-rw-r--r--chip/stm32/registers.h30
-rw-r--r--chip/stm32/system.c6
-rw-r--r--chip/stm32/uart.c4
9 files changed, 33 insertions, 33 deletions
diff --git a/chip/lm4/clock.c b/chip/lm4/clock.c
index bb3ca3be30..4fa72c5ca1 100644
--- a/chip/lm4/clock.c
+++ b/chip/lm4/clock.c
@@ -143,7 +143,7 @@ int clock_get_freq(void)
void clock_init(void)
{
-#ifdef BOARD_bds
+#ifdef BOARD_BDS
/*
* Perform an auto calibration of the internal oscillator using the
* 32.768KHz hibernate clock, unless we've already done so. This is
@@ -435,7 +435,7 @@ static int command_sleep(int argc, char **argv)
if (argc >= 5)
flash_pm = strtoi(argv[4], NULL, 10);
-#ifdef BOARD_bds
+#ifdef BOARD_BDS
/* Remove LED current sink. */
gpio_set_level(GPIO_DEBUG_LED, 0);
#endif
diff --git a/chip/stm32/clock-stm32f.c b/chip/stm32/clock-stm32f.c
index 96218f115f..a9fd61fcf0 100644
--- a/chip/stm32/clock-stm32f.c
+++ b/chip/stm32/clock-stm32f.c
@@ -113,14 +113,14 @@ static void __rtc_alarm_irq(void)
}
DECLARE_IRQ(STM32_IRQ_RTC_ALARM, __rtc_alarm_irq, 1);
-#if defined(BOARD_snow) || defined(BOARD_spring)
+#if defined(BOARD_SNOW) || defined(BOARD_SPRING)
/*
* stays on HSI (8MHz), no prescaler, PLLSRC = HSI/2, PLLMUL = x4
* no MCO => PLLCLK = 16 Mhz
*/
#define DESIRED_CPU_CLOCK 16000000
#define RCC_CFGR 0x00080000
-#elif defined(BOARD_mccroskey)
+#elif defined(BOARD_MCCROSKEY)
/*
* HSI = 8MHz, no prescaler, no MCO
* PLLSRC = HSI/2, PLLMUL = x12 => PLLCLK = 48MHz
diff --git a/chip/stm32/config_chip.h b/chip/stm32/config_chip.h
index 4ae81b2e51..2d439a800e 100644
--- a/chip/stm32/config_chip.h
+++ b/chip/stm32/config_chip.h
@@ -13,14 +13,14 @@
#define CONFIG_UART_CONSOLE 1
/* Use variant specific configuration for flash / UART / IRQ */
-#if defined(CHIP_VARIANT_stm32l15x)
+#if defined(CHIP_VARIANT_STM32L15X)
#include "config-stm32l15x.h"
-#elif defined(CHIP_VARIANT_stm32l100)
+#elif defined(CHIP_VARIANT_STM32L100)
#include "config-stm32l100.h"
-#elif defined(CHIP_VARIANT_stm32f100)
+#elif defined(CHIP_VARIANT_STM32F100)
/* STM32F100xx is currently the only outlier in the STM32F series */
#include "config-stm32f100.h"
-#elif defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_VARIANT_STM32F10X)
/* STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx, and STM32F107xx */
#include "config-stm32f10x.h"
#else
diff --git a/chip/stm32/hwtimer.c b/chip/stm32/hwtimer.c
index abd2d2ba7b..0d238b53d4 100644
--- a/chip/stm32/hwtimer.c
+++ b/chip/stm32/hwtimer.c
@@ -169,12 +169,12 @@ void __hw_timer_enable_clock(int n, int enable)
* Mapping of timers to reg/mask is split into a few different ranges,
* some specific to individual chips.
*/
-#if defined(CHIP_FAMILY_stm32f)
+#if defined(CHIP_FAMILY_STM32F)
if (n == 1) {
reg = &STM32_RCC_APB2ENR;
mask = STM32_RCC_PB2_TIM1;
}
-#elif defined(CHIP_FAMILY_stm32l)
+#elif defined(CHIP_FAMILY_STM32L)
if (n >= 9 && n <= 11) {
reg = &STM32_RCC_APB2ENR;
mask = STM32_RCC_PB2_TIM9 << (n - 9);
diff --git a/chip/stm32/power_led.c b/chip/stm32/power_led.c
index 976ab0208f..3c391dab86 100644
--- a/chip/stm32/power_led.c
+++ b/chip/stm32/power_led.c
@@ -64,7 +64,7 @@ static void power_led_manual_off(void)
* configure it as an open-drain output and set it to high impedence,
* but reconfiguring as an input had better results in testing.
*/
-#ifdef BOARD_snow
+#ifdef BOARD_SNOW
gpio_set_flags(GPIO_LED_POWER_L, GPIO_INPUT);
gpio_set_level(GPIO_LED_POWER_L, 1);
#else
diff --git a/chip/stm32/pwm.c b/chip/stm32/pwm.c
index b8683ed9f4..b09b9e7da1 100644
--- a/chip/stm32/pwm.c
+++ b/chip/stm32/pwm.c
@@ -38,7 +38,7 @@ static void pwm_configure(enum pwm_channel ch)
const struct gpio_info *gpio = gpio_list + pwm->pin;
timer_ctlr_t *tim = (timer_ctlr_t *)(pwm->tim.base);
volatile unsigned *ccmr = NULL;
-#ifdef CHIP_FAMILY_stm32f
+#ifdef CHIP_FAMILY_STM32F
int mask = gpio->mask;
volatile uint32_t *gpio_cr = NULL;
uint32_t val;
@@ -47,7 +47,7 @@ static void pwm_configure(enum pwm_channel ch)
if (using_pwm[ch])
return;
-#ifdef CHIP_FAMILY_stm32f
+#ifdef CHIP_FAMILY_STM32F
if (mask < 0x100) {
gpio_cr = &STM32_GPIO_CRL(gpio->port);
} else {
diff --git a/chip/stm32/registers.h b/chip/stm32/registers.h
index ead13c58d1..e1c3cc1a1a 100644
--- a/chip/stm32/registers.h
+++ b/chip/stm32/registers.h
@@ -133,11 +133,11 @@
#define STM32_TIM6_BASE 0x40001000
#define STM32_TIM7_BASE 0x40001400
#define STM32_TIM8_BASE 0x40013400 /* STM32F10x only */
-#if defined(CHIP_FAMILY_stm32l)
+#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 */
-#elif defined(CHIP_VARIANT_stm32f10x)
+#elif defined(CHIP_VARIANT_STM32F10X)
#define STM32_TIM9_BASE 0x40014C00 /* STM32F10x only */
#define STM32_TIM10_BASE 0x40015000 /* STM32F10x only */
#define STM32_TIM11_BASE 0x40015400 /* STM32F10x only */
@@ -216,7 +216,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define DUMMY_GPIO_BANK GPIO_A
-#if defined(CHIP_FAMILY_stm32l)
+#if defined(CHIP_FAMILY_STM32L)
#define STM32_GPIOA_BASE 0x40020000
#define STM32_GPIOB_BASE 0x40020400
#define STM32_GPIOC_BASE 0x40020800
@@ -248,7 +248,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define GPIO_ALT_RI 0xE
#define GPIO_ALT_EVENTOUT 0xF
-#elif defined(CHIP_FAMILY_stm32f)
+#elif defined(CHIP_FAMILY_STM32F)
#define STM32_GPIOA_BASE 0x40010800
#define STM32_GPIOB_BASE 0x40010c00
#define STM32_GPIOC_BASE 0x40011000
@@ -322,7 +322,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_FAMILY_stm32l)
+#if defined(CHIP_FAMILY_STM32L)
#define STM32_RCC_BASE 0x40023800
#define STM32_RCC_CR REG32(STM32_RCC_BASE + 0x00)
@@ -360,7 +360,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_FAMILY_stm32f)
+#elif defined(CHIP_FAMILY_STM32F)
#define STM32_RCC_BASE 0x40021000
#define STM32_RCC_CR REG32(STM32_RCC_BASE + 0x00)
@@ -425,7 +425,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
#define STM32_RTC_BASE 0x40002800
-#if defined(CHIP_FAMILY_stm32l)
+#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)
@@ -444,7 +444,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_FAMILY_stm32f)
+#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)
@@ -459,7 +459,7 @@ typedef volatile struct timer_ctlr timer_ctlr_t;
/* --- Backup Registers --- */
#define STM32_BKP_BASE 0x40006c00
-#if defined(CHIP_VARIANT_stm32f10x)
+#if defined(CHIP_VARIANT_STM32F10X)
#define STM32_BKP_ENTRIES 42
#define STM32_BKP_DATA(n) \
REG16(STM32_BKP_BASE + (n < 11 ? 0x4 : 0x40) + 4 * (n))
@@ -521,7 +521,7 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
/* --- Flash --- */
-#if defined(CHIP_FAMILY_stm32l)
+#if defined(CHIP_FAMILY_STM32L)
#define STM32_FLASH_REGS_BASE 0x40023c00
#define STM32_FLASH_ACR REG32(STM32_FLASH_REGS_BASE + 0x00)
@@ -560,7 +560,7 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
#define STM32_OPTB_WRP3L 0x18
#define STM32_OPTB_WRP3H 0x1c
-#elif defined(CHIP_FAMILY_stm32f)
+#elif defined(CHIP_FAMILY_STM32F)
#define STM32_FLASH_REGS_BASE 0x40022000
#define STM32_FLASH_ACR REG32(STM32_FLASH_REGS_BASE + 0x00)
@@ -602,7 +602,7 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
#define STM32_ADC2_BASE 0x40012800 /* STM32F10x only */
#define STM32_ADC3_BASE 0x40013C00 /* STM32F10x only */
-#if defined(CHIP_VARIANT_stm32f100)
+#if defined(CHIP_VARIANT_STM32F100)
#define STM32_ADC_SR REG32(STM32_ADC1_BASE + 0x00)
#define STM32_ADC_CR1 REG32(STM32_ADC1_BASE + 0x04)
#define STM32_ADC_CR2 REG32(STM32_ADC1_BASE + 0x08)
@@ -618,7 +618,7 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
#define STM32_ADC_JSQR REG32(STM32_ADC1_BASE + 0x38)
#define STM32_ADC_JDR(n) REG32(STM32_ADC1_BASE + 0x3C + ((n)&3) * 4)
#define STM32_ADC_DR REG32(STM32_ADC1_BASE + 0x4C)
-#elif defined(CHIP_FAMILY_stm32l)
+#elif defined(CHIP_FAMILY_STM32L)
#define STM32_ADC_SR REG32(STM32_ADC1_BASE + 0x00)
#define STM32_ADC_CR1 REG32(STM32_ADC1_BASE + 0x04)
#define STM32_ADC_CR2 REG32(STM32_ADC1_BASE + 0x08)
@@ -651,9 +651,9 @@ typedef volatile struct stm32_spi_regs stm32_spi_regs_t;
/* --- DMA --- */
-#if defined(CHIP_FAMILY_stm32l)
+#if defined(CHIP_FAMILY_STM32L)
#define STM32_DMA1_BASE 0x40026000
-#elif defined(CHIP_FAMILY_stm32f)
+#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 41d47218fa..2cd4063709 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 */
-#ifdef CHIP_FAMILY_stm32l
+#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_FAMILY_stm32f)
+#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;
@@ -197,7 +197,7 @@ void system_reset(int flags)
if (flags & SYSTEM_RESET_HARD) {
-#ifdef CHIP_FAMILY_stm32l
+#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 f2650591ed..5e21a128d4 100644
--- a/chip/stm32/uart.c
+++ b/chip/stm32/uart.c
@@ -192,7 +192,7 @@ static void uart_freq_change(void)
{
int div = DIV_ROUND_NEAREST(clock_get_freq(), CONFIG_UART_BAUD_RATE);
-#ifdef CHIP_FAMILY_stm32l
+#ifdef CHIP_FAMILY_STM32L
if (div / 16 > 0) {
/*
* CPU clock is high enough to support x16 oversampling.
@@ -254,7 +254,7 @@ void uart_init(void)
STM32_USART_CR1(UARTN) |= STM32_USART_CR1_RXNEIE;
#endif
-#ifdef CHIP_FAMILY_stm32l
+#ifdef CHIP_FAMILY_STM32L
/* Use single-bit sampling */
STM32_USART_CR3(UARTN) |= STM32_USART_CR3_ONEBIT;
#endif