mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
glados: Switch to V2 board
Switch to V2 glados as the default, and remove support for V1. BUG=chrome-os-partner:43075 TEST=`make buildall -j` BRANCH=None Change-Id: I58f33225177d259916e8877084c2c431922e7bc5 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/293303 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
571b7bb640
commit
4e355700aa
@@ -99,15 +99,6 @@ const struct adc_t adc_channels[] = {
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
|
||||
|
||||
#ifdef GLADOS_BOARD_V1
|
||||
const struct i2c_port_t i2c_ports[] = {
|
||||
{"batt", MEC1322_I2C0_0, 100, GPIO_I2C0_0_SCL, GPIO_I2C0_0_SDA},
|
||||
{"muxes", MEC1322_I2C0_1, 100, GPIO_I2C0_1_SCL, GPIO_I2C0_1_SDA},
|
||||
{"pd_mcu", MEC1322_I2C1, 1000, GPIO_I2C1_SCL, GPIO_I2C1_SDA},
|
||||
{"sensors", MEC1322_I2C2, 400, GPIO_I2C2_SCL, GPIO_I2C2_SDA },
|
||||
{"pmic", MEC1322_I2C3, 400, GPIO_I2C3_SCL, GPIO_I2C3_SDA },
|
||||
};
|
||||
#else
|
||||
const struct i2c_port_t i2c_ports[] = {
|
||||
{"pmic", MEC1322_I2C0_0, 400, GPIO_I2C0_0_SCL, GPIO_I2C0_0_SDA},
|
||||
{"muxes", MEC1322_I2C0_1, 400, GPIO_I2C0_1_SCL, GPIO_I2C0_1_SDA},
|
||||
@@ -115,7 +106,6 @@ const struct i2c_port_t i2c_ports[] = {
|
||||
{"sensors", MEC1322_I2C2, 400, GPIO_I2C2_SCL, GPIO_I2C2_SDA },
|
||||
{"batt", MEC1322_I2C3, 100, GPIO_I2C3_SCL, GPIO_I2C3_SDA },
|
||||
};
|
||||
#endif
|
||||
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
|
||||
|
||||
/* SPI devices */
|
||||
@@ -336,18 +326,6 @@ uint32_t board_get_gpio_hibernate_state(uint32_t port, uint32_t pin)
|
||||
GPIO_TO_PORT_MASK_PAIR(GPIO_CHARGE_LED_2),
|
||||
};
|
||||
|
||||
#ifdef GLADOS_BOARD_V1
|
||||
/*
|
||||
* Leave PCH RTCRST deasserted.
|
||||
* TODO(crosbug.com/p/42774): Remove this once we have a
|
||||
* pull-down on PCH_RTCRST.
|
||||
*/
|
||||
const uint32_t rtcrst_gpio[2] =
|
||||
GPIO_TO_PORT_MASK_PAIR(GPIO_PCH_RTCRST);
|
||||
if (port == rtcrst_gpio[0] && pin == rtcrst_gpio[1])
|
||||
return GPIO_OUTPUT | GPIO_LOW;
|
||||
#endif
|
||||
|
||||
/* LED GPIOs should be driven low to turn off LEDs */
|
||||
for (i = 0; i < ARRAY_SIZE(led_gpios); ++i)
|
||||
if (led_gpios[i][0] == port && led_gpios[i][1] == pin)
|
||||
|
||||
@@ -8,13 +8,6 @@
|
||||
#ifndef __CROS_EC_BOARD_H
|
||||
#define __CROS_EC_BOARD_H
|
||||
|
||||
/*
|
||||
* Certain changes make V1 boards incompatible with V2.
|
||||
* TODO(crosbug.com/p/43075): Remove support for V1 when appropriate.
|
||||
*/
|
||||
#define GLADOS_BOARD_V1
|
||||
/* #define GLADOS_BOARD_V2 */
|
||||
|
||||
/* Optional features */
|
||||
#define CONFIG_ADC
|
||||
#define CONFIG_BATTERY_CUT_OFF
|
||||
@@ -93,18 +86,6 @@
|
||||
#define GPIO_BAT_LED_GREEN GPIO_CHARGE_LED_2
|
||||
|
||||
/* I2C ports */
|
||||
#ifdef GLADOS_BOARD_V1
|
||||
#define I2C_PORT_BATTERY MEC1322_I2C0_0
|
||||
#define I2C_PORT_CHARGER MEC1322_I2C0_0
|
||||
#define I2C_PORT_USB_CHARGER_1 MEC1322_I2C0_1
|
||||
#define I2C_PORT_USB_MUX MEC1322_I2C0_1
|
||||
#define I2C_PORT_PD_MCU MEC1322_I2C1
|
||||
#define I2C_PORT_TCPC MEC1322_I2C1
|
||||
#define I2C_PORT_ALS MEC1322_I2C2
|
||||
#define I2C_PORT_ACCEL MEC1322_I2C2
|
||||
#define I2C_PORT_PMIC MEC1322_I2C3
|
||||
#define I2C_PORT_USB_CHARGER_2 MEC1322_I2C3
|
||||
#else
|
||||
#define I2C_PORT_PMIC MEC1322_I2C0_0
|
||||
/* TODO(shawnn): Verify that the charge detectors aren't swapped */
|
||||
#define I2C_PORT_USB_CHARGER_1 MEC1322_I2C0_0
|
||||
@@ -116,7 +97,6 @@
|
||||
#define I2C_PORT_ACCEL MEC1322_I2C2
|
||||
#define I2C_PORT_BATTERY MEC1322_I2C3
|
||||
#define I2C_PORT_CHARGER MEC1322_I2C3
|
||||
#endif
|
||||
|
||||
/* Thermal sensors read through PMIC ADC interface */
|
||||
#define I2C_PORT_THERMAL I2C_PORT_PMIC
|
||||
@@ -183,16 +163,8 @@ enum temp_sensor_id {
|
||||
#define PD_MAX_POWER_MW 60000
|
||||
#define PD_MAX_CURRENT_MA 3000
|
||||
|
||||
#ifdef GLADOS_BOARD_V1
|
||||
/*
|
||||
* TODO: max voltage should be 20V, but this causes excessive i2c noise
|
||||
* on battery bus on proto0, which leads to inconsistent charging.
|
||||
*/
|
||||
#define PD_MAX_VOLTAGE_MV 5000
|
||||
#else
|
||||
/*** Try to negotiate to 20V since i2c noise problems should be fixed. ***/
|
||||
/* Try to negotiate to 20V since i2c noise problems should be fixed. */
|
||||
#define PD_MAX_VOLTAGE_MV 20000
|
||||
#endif
|
||||
|
||||
/* Reset PD MCU */
|
||||
void board_reset_pd_mcu(void);
|
||||
|
||||
@@ -26,11 +26,7 @@ GPIO_INT(USB_C0_BC12_INT_L, PIN(124), GPIO_INT_FALLING, usb0_evt)
|
||||
GPIO_INT(USB_C1_BC12_INT_L, PIN(145), GPIO_INT_FALLING, usb1_evt)
|
||||
|
||||
/* Delayed PWR_OK from PMIC */
|
||||
#ifdef GLADOS_BOARD_V1
|
||||
GPIO_INT(PMIC_DPWROK, PIN(55), GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt)
|
||||
#else
|
||||
GPIO_INT(PMIC_DPWROK, PIN(133), GPIO_INT_BOTH, power_signal_interrupt)
|
||||
#endif
|
||||
|
||||
GPIO(PD_RST_L, PIN(130), GPIO_ODR_HIGH)
|
||||
GPIO(USB2_OTG_ID, PIN(13), GPIO_ODR_LOW)
|
||||
@@ -98,16 +94,6 @@ GPIO(SYS_RESET_L, PIN(121), GPIO_ODR_HIGH)
|
||||
GPIO(CHARGE_LED_1, PIN(155), GPIO_OUT_LOW)
|
||||
GPIO(CHARGE_LED_2, PIN(156), GPIO_OUT_LOW)
|
||||
|
||||
#ifdef GLADOS_BOARD_V1
|
||||
GPIO(ACCEL4_INT, PIN(133), GPIO_INPUT)
|
||||
/* Sensor input for KB PROX - UNUSED */
|
||||
GPIO(KB_PROX_INT_L, PIN(141), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(USB_C1_CHARGE_EN_L, PIN(157), GPIO_OUT_LOW)
|
||||
GPIO(PP1800_DX_AUDIO_EN, PIN(160), GPIO_OUT_LOW)
|
||||
GPIO(PCH_RTCRST, PIN(163), GPIO_OUT_LOW)
|
||||
GPIO(TABLET_MODE, PIN(201), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(EC_WAKE_CLK, PIN(210), GPIO_INPUT)
|
||||
#else
|
||||
/* Inhibit the AP from booting until we can supply enough current */
|
||||
GPIO(PCH_BATLOW_L, PIN(55), GPIO_OUT_LOW)
|
||||
GPIO(ACCEL4_INT, PIN(157), GPIO_INPUT)
|
||||
@@ -117,7 +103,6 @@ GPIO(TABLET_MODE, PIN(160), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(PCH_RTCRST, PIN(163), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(PMIC_SLP_SUS_L, PIN(201), GPIO_OUT_LOW)
|
||||
GPIO(USB_C1_CHARGE_EN_L, PIN(210), GPIO_OUT_LOW)
|
||||
#endif
|
||||
|
||||
/* Alternate functions GPIO definitions */
|
||||
|
||||
|
||||
@@ -65,7 +65,11 @@ void chipset_force_shutdown(void)
|
||||
void chipset_force_g3(void)
|
||||
{
|
||||
CPRINTS("Forcing G3");
|
||||
#ifdef GLADOS_BOARD_V2
|
||||
/*
|
||||
* Kunimitsu doesn't yet have pass-thru SLP_SUS_L / BATLOW.
|
||||
* TODO(crosbug.com/p/43075): Remove this when new boards roll out.
|
||||
*/
|
||||
#ifndef BOARD_KUNIMITSU
|
||||
gpio_set_level(GPIO_PMIC_SLP_SUS_L, 0);
|
||||
gpio_set_level(GPIO_PCH_BATLOW_L, 0);
|
||||
#endif
|
||||
@@ -132,7 +136,7 @@ enum power_state power_handle_state(enum power_state state)
|
||||
*/
|
||||
int rsmrst_in = gpio_get_level(GPIO_RSMRST_L_PGOOD);
|
||||
int rsmrst_out = gpio_get_level(GPIO_PCH_RSMRST_L);
|
||||
#ifdef GLADOS_BOARD_V2
|
||||
#ifndef BOARD_KUNIMITSU
|
||||
int tries = 0;
|
||||
#endif
|
||||
|
||||
@@ -193,7 +197,7 @@ enum power_state power_handle_state(enum power_state state)
|
||||
return POWER_G3;
|
||||
}
|
||||
|
||||
#ifdef GLADOS_BOARD_V2
|
||||
#ifndef BOARD_KUNIMITSU
|
||||
/*
|
||||
* Allow up to 1s for charger to be initialized, in case
|
||||
* we're trying to boot the AP with no battery.
|
||||
|
||||
Reference in New Issue
Block a user