summaryrefslogtreecommitdiff
path: root/board/rainier
diff options
context:
space:
mode:
Diffstat (limited to 'board/rainier')
-rw-r--r--board/rainier/board.c114
-rw-r--r--board/rainier/board.h32
-rw-r--r--board/rainier/build.mk2
-rw-r--r--board/rainier/ec.tasklist2
-rw-r--r--board/rainier/gpio.inc2
-rw-r--r--board/rainier/usb_pd_policy.c6
6 files changed, 74 insertions, 84 deletions
diff --git a/board/rainier/board.c b/board/rainier/board.c
index c992584d76..07a006b671 100644
--- a/board/rainier/board.c
+++ b/board/rainier/board.c
@@ -1,4 +1,4 @@
-/* Copyright 2017 The Chromium OS Authors. All rights reserved.
+/* Copyright 2017 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -40,8 +40,8 @@
#include "usb_pd_tcpm.h"
#include "util.h"
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ##args)
static void tcpc_alert_event(enum gpio_signal signal)
{
@@ -65,41 +65,39 @@ static void warm_reset_request_interrupt(enum gpio_signal signal)
/******************************************************************************/
/* ADC channels. Must be in the exactly same order as in enum adc_channel. */
const struct adc_t adc_channels[] = {
- [ADC_BOARD_ID] = {"BOARD_ID", 16, 4096, 0, STM32_AIN(10)},
+ [ADC_BOARD_ID] = { "BOARD_ID", 16, 4096, 0, STM32_AIN(10) },
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
/******************************************************************************/
/* I2C ports */
const struct i2c_port_t i2c_ports[] = {
- {
- .name = "tcpc0",
- .port = I2C_PORT_TCPC0,
- .kbps = 1000,
- .scl = GPIO_I2C1_SCL,
- .sda = GPIO_I2C1_SDA
- },
+ { .name = "tcpc0",
+ .port = I2C_PORT_TCPC0,
+ .kbps = 1000,
+ .scl = GPIO_I2C1_SCL,
+ .sda = GPIO_I2C1_SDA },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
/* power signal list. Must match order of enum power_signal. */
const struct power_signal_info power_signal_list[] = {
- {GPIO_PP1250_S3_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP1250_S3_PWR_GOOD"},
- {GPIO_PP900_S0_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP900_S0_PWR_GOOD"},
- {GPIO_AP_CORE_PG, POWER_SIGNAL_ACTIVE_HIGH, "AP_PWR_GOOD"},
- {GPIO_AP_EC_S3_S0_L, POWER_SIGNAL_ACTIVE_LOW, "SUSPEND_DEASSERTED"},
+ { GPIO_PP1250_S3_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP1250_S3_PWR_GOOD" },
+ { GPIO_PP900_S0_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP900_S0_PWR_GOOD" },
+ { GPIO_AP_CORE_PG, POWER_SIGNAL_ACTIVE_HIGH, "AP_PWR_GOOD" },
+ { GPIO_AP_EC_S3_S0_L, POWER_SIGNAL_ACTIVE_LOW, "SUSPEND_DEASSERTED" },
};
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
#ifdef CONFIG_TEMP_SENSOR_TMP432
/* Temperature sensors data; must be in same order as enum temp_sensor_id. */
const struct temp_sensor_t temp_sensors[] = {
- {"TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
- TMP432_IDX_LOCAL, 4},
- {"TMP432_Sensor_1", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
- TMP432_IDX_REMOTE1, 4},
- {"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
- TMP432_IDX_REMOTE2, 4},
+ { "TMP432_Internal", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ TMP432_IDX_LOCAL, 4 },
+ { "TMP432_Sensor_1", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ TMP432_IDX_REMOTE1, 4 },
+ { "TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
+ TMP432_IDX_REMOTE2, 4 },
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
@@ -108,9 +106,9 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
* same order as enum temp_sensor_id. To always ignore any temp, use 0.
*/
struct ec_thermal_config thermal_params[] = {
- {{0, 0, 0}, 0, 0}, /* TMP432_Internal */
- {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_1 */
- {{0, 0, 0}, 0, 0}, /* TMP432_Sensor_2 */
+ { { 0, 0, 0 }, 0, 0 }, /* TMP432_Internal */
+ { { 0, 0, 0 }, 0, 0 }, /* TMP432_Sensor_1 */
+ { { 0, 0, 0 }, 0, 0 }, /* TMP432_Sensor_2 */
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
#endif
@@ -125,9 +123,8 @@ const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices);
/******************************************************************************/
/* Wake-up pins for hibernate */
-const enum gpio_signal hibernate_wake_pins[] = {
- GPIO_POWER_BUTTON_L, GPIO_CHARGER_INT_L
-};
+const enum gpio_signal hibernate_wake_pins[] = { GPIO_POWER_BUTTON_L,
+ GPIO_CHARGER_INT_L };
const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
/******************************************************************************/
@@ -142,11 +139,14 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
},
};
-const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
+const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
- .usb_port = 0,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = 0,
+ .driver = &virtual_usb_mux_driver,
+ .hpd_update = &virtual_hpd_update,
+ },
},
};
@@ -173,8 +173,8 @@ int board_set_active_charge_port(int charge_port)
return EC_SUCCESS;
}
-void board_set_charge_limit(int port, int supplier, int charge_ma,
- int max_ma, int charge_mv)
+void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma,
+ int charge_mv)
{
/*
* NOP because there is no internal power therefore no charging.
@@ -190,7 +190,7 @@ int extpower_is_present(void)
int pd_snk_is_vbus_provided(int port)
{
- /* Must be, if we're at a stage where this function is called. */
+ /* Must be, if we're at a stage where this function is called. */
return 1;
}
@@ -207,8 +207,7 @@ static void board_spi_enable(void)
spi_enable(&spi_devices[0], 1);
}
-DECLARE_HOOK(HOOK_CHIPSET_STARTUP,
- board_spi_enable,
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_spi_enable,
MOTION_SENSE_HOOK_PRIO - 1);
static void board_spi_disable(void)
@@ -220,9 +219,8 @@ static void board_spi_disable(void)
gpio_config_module(MODULE_SPI_CONTROLLER, 0);
}
-DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN,
- board_spi_disable,
- MOTION_SENSE_HOOK_PRIO + 1);
+DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_spi_disable,
+ MOTION_SENSE_HOOK_PRIO + 1);
static void board_init(void)
{
@@ -255,8 +253,8 @@ void board_config_pre_init(void)
* Ch4: USART1_TX / Ch5: USART1_RX (1000)
* Ch6: SPI2_RX / Ch7: SPI2_TX (0011)
*/
- STM32_DMA_CSELR(STM32_DMAC_CH4) = (8 << 12) | (8 << 16) |
- (3 << 20) | (3 << 24);
+ STM32_DMA_CSELR(STM32_DMAC_CH4) = (8 << 12) | (8 << 16) | (3 << 20) |
+ (3 << 24);
}
void board_hibernate(void)
@@ -301,16 +299,16 @@ struct {
enum rainier_board_version version;
int expect_mv;
} const rainier_boards[] = {
- { BOARD_VERSION_REV0, 109 }, /* 51.1K , 2.2K(gru 3.3K) ohm */
- { BOARD_VERSION_REV1, 211 }, /* 51.1k , 6.8K ohm */
- { BOARD_VERSION_REV2, 319 }, /* 51.1K , 11K ohm */
- { BOARD_VERSION_REV3, 427 }, /* 56K , 17.4K ohm */
- { BOARD_VERSION_REV4, 542 }, /* 51.1K , 22K ohm */
- { BOARD_VERSION_REV5, 666 }, /* 51.1K , 30K ohm */
- { BOARD_VERSION_REV6, 781 }, /* 51.1K , 39.2K ohm */
- { BOARD_VERSION_REV7, 900 }, /* 56K , 56K ohm */
- { BOARD_VERSION_REV8, 1023 }, /* 47K , 61.9K ohm */
- { BOARD_VERSION_REV9, 1137 }, /* 47K , 80.6K ohm */
+ { BOARD_VERSION_REV0, 109 }, /* 51.1K , 2.2K(gru 3.3K) ohm */
+ { BOARD_VERSION_REV1, 211 }, /* 51.1k , 6.8K ohm */
+ { BOARD_VERSION_REV2, 319 }, /* 51.1K , 11K ohm */
+ { BOARD_VERSION_REV3, 427 }, /* 56K , 17.4K ohm */
+ { BOARD_VERSION_REV4, 542 }, /* 51.1K , 22K ohm */
+ { BOARD_VERSION_REV5, 666 }, /* 51.1K , 30K ohm */
+ { BOARD_VERSION_REV6, 781 }, /* 51.1K , 39.2K ohm */
+ { BOARD_VERSION_REV7, 900 }, /* 56K , 56K ohm */
+ { BOARD_VERSION_REV8, 1023 }, /* 47K , 61.9K ohm */
+ { BOARD_VERSION_REV9, 1137 }, /* 47K , 80.6K ohm */
{ BOARD_VERSION_REV10, 1240 }, /* 56K , 124K ohm */
{ BOARD_VERSION_REV11, 1343 }, /* 51.1K , 150K ohm */
{ BOARD_VERSION_REV12, 1457 }, /* 47K , 200K ohm */
@@ -358,11 +356,9 @@ static struct mutex g_base_mutex;
static struct bmi_drv_data_t g_bmi160_data;
/* Matrix to rotate accelerometer into standard reference frame */
-const mat33_fp_t base_standard_ref = {
- { 0, FLOAT_TO_FP(1), 0},
- { FLOAT_TO_FP(-1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+const mat33_fp_t base_standard_ref = { { 0, FLOAT_TO_FP(1), 0 },
+ { FLOAT_TO_FP(-1), 0, 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
static struct bmp280_drv_data_t bmp280_drv_data;
@@ -436,9 +432,3 @@ int board_allow_i2c_passthru(const struct i2c_cmd_desc_t *cmd_desc)
*/
return 0;
}
-
-int charge_prevent_power_on(int power_button_pressed)
-{
- /* Assume there is always sufficient power from charger to power on. */
- return 0;
-}
diff --git a/board/rainier/board.h b/board/rainier/board.h
index e3d333e2f1..3cf5405f9a 100644
--- a/board/rainier/board.h
+++ b/board/rainier/board.h
@@ -1,4 +1,4 @@
-/* Copyright 2017 The Chromium OS Authors. All rights reserved.
+/* Copyright 2017 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -10,7 +10,7 @@
/* Optional modules */
#define CONFIG_ADC
-#undef CONFIG_ADC_WATCHDOG
+#undef CONFIG_ADC_WATCHDOG
#define CONFIG_CHIPSET_RK3399
#define CONFIG_CMD_ACCELS
#define CONFIG_CMD_RTC
@@ -30,11 +30,11 @@
#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands for testing */
-#undef CONFIG_UART_CONSOLE
+#undef CONFIG_UART_CONSOLE
#define CONFIG_UART_CONSOLE 1
/* Region sizes are no longer a power of 2 so we can't enable MPU */
-#undef CONFIG_MPU
+#undef CONFIG_MPU
/* Enable a different power-on sequence than the one on gru */
#undef CONFIG_CHIPSET_POWER_SEQ_VERSION
@@ -104,38 +104,38 @@
#define CONFIG_USB_PD_COMM_LOCKED
#define PD_OPERATING_POWER_MW 15000
-#define PD_MAX_POWER_MW ((PD_MAX_VOLTAGE_MV * PD_MAX_CURRENT_MA) / 1000)
-#define PD_MAX_CURRENT_MA 3000
-#define PD_MAX_VOLTAGE_MV 12850
+#define PD_MAX_POWER_MW ((PD_MAX_VOLTAGE_MV * PD_MAX_CURRENT_MA) / 1000)
+#define PD_MAX_CURRENT_MA 3000
+#define PD_MAX_VOLTAGE_MV 12850
-#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
-#define PD_POWER_SUPPLY_TURN_OFF_DELAY 50000 /* us */
+#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
+#define PD_POWER_SUPPLY_TURN_OFF_DELAY 50000 /* us */
/* Timer selection */
-#define TIM_CLOCK32 2
+#define TIM_CLOCK32 2
#define TIM_WATCHDOG 7
/* 48 MHz SYSCLK clock frequency */
#define CPU_CLOCK 48000000
/* Optional for testing */
-#undef CONFIG_PECI
-#undef CONFIG_PSTORE
+#undef CONFIG_PECI
+#undef CONFIG_PSTORE
#define CONFIG_TASK_PROFILING
#define I2C_PORT_TCPC0 1
/* Enable Accel over SPI */
-#define CONFIG_SPI_ACCEL_PORT 0 /* The first SPI controller port (SPI2) */
+#define CONFIG_SPI_ACCEL_PORT 0 /* The first SPI controller port (SPI2) */
#define CONFIG_MKBP_INPUT_DEVICES
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_GPIO
/* Define the host events which are allowed to wakeup AP in S3. */
-#define CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK \
- (EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON) |\
- EC_HOST_EVENT_MASK(EC_HOST_EVENT_RTC))
+#define CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK \
+ (EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON) | \
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_RTC))
#ifndef __ASSEMBLER__
diff --git a/board/rainier/build.mk b/board/rainier/build.mk
index b77a900d56..b95d9dc46e 100644
--- a/board/rainier/build.mk
+++ b/board/rainier/build.mk
@@ -1,5 +1,5 @@
# -*- makefile -*-
-# Copyright 2017 The Chromium OS Authors. All rights reserved.
+# Copyright 2017 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
diff --git a/board/rainier/ec.tasklist b/board/rainier/ec.tasklist
index ed574a1d6a..5008495942 100644
--- a/board/rainier/ec.tasklist
+++ b/board/rainier/ec.tasklist
@@ -1,4 +1,4 @@
-/* Copyright 2017 The Chromium OS Authors. All rights reserved.
+/* Copyright 2017 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/board/rainier/gpio.inc b/board/rainier/gpio.inc
index f5a4f360b3..1cf1080e05 100644
--- a/board/rainier/gpio.inc
+++ b/board/rainier/gpio.inc
@@ -1,6 +1,6 @@
/* -*- mode:c -*-
*
- * Copyright 2017 The Chromium OS Authors. All rights reserved.
+ * Copyright 2017 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/board/rainier/usb_pd_policy.c b/board/rainier/usb_pd_policy.c
index 6de1dc9271..45a51015a6 100644
--- a/board/rainier/usb_pd_policy.c
+++ b/board/rainier/usb_pd_policy.c
@@ -1,4 +1,4 @@
-/* Copyright 2017 The Chromium OS Authors. All rights reserved.
+/* Copyright 2017 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -18,8 +18,8 @@
#include "usb_pd.h"
#include "usb_pd_tcpm.h"
-#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args)
-#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args)
+#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args)
+#define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args)
static uint8_t vbus_en;