diff options
35 files changed, 13 insertions, 2759 deletions
diff --git a/board/bolt/board.c b/board/bolt/board.c deleted file mode 100644 index 3ed0443d18..0000000000 --- a/board/bolt/board.c +++ /dev/null @@ -1,250 +0,0 @@ -/* Copyright (c) 2013 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. - */ -/* EC for Bolt board configuration */ - -#include "adc.h" -#include "adc_chip.h" -#include "backlight.h" -#include "chipset.h" -#include "chipset_x86_common.h" -#include "common.h" -#include "driver/temp_sensor/tmp006.h" -#include "extpower.h" -#include "fan.h" -#include "gpio.h" -#include "host_command.h" -#include "i2c.h" -#include "keyboard_scan.h" -#include "lid_switch.h" -#include "peci.h" -#include "power_button.h" -#include "pwm.h" -#include "pwm_chip.h" -#include "registers.h" -#include "switch.h" -#include "temp_sensor.h" -#include "temp_sensor_chip.h" -#include "timer.h" -#include "thermal.h" -#include "util.h" - -/* GPIO signal list. Must match order from enum gpio_signal. */ -const struct gpio_info gpio_list[] = { - /* Inputs with interrupt handlers are first for efficiency */ - {"POWER_BUTTON_L", LM4_GPIO_A, (1<<2), GPIO_INT_BOTH, - power_button_interrupt}, - {"LID_OPEN", LM4_GPIO_A, (1<<3), GPIO_INT_BOTH, - lid_interrupt}, - {"AC_PRESENT", LM4_GPIO_H, (1<<3), GPIO_INT_BOTH, - extpower_interrupt}, - {"PCH_BKLTEN", LM4_GPIO_M, (1<<3), GPIO_INT_BOTH, - backlight_interrupt}, - {"PCH_SLP_S0_L", LM4_GPIO_G, (1<<6), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_SLP_S3_L", LM4_GPIO_G, (1<<7), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_SLP_S5_L", LM4_GPIO_H, (1<<1), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_SLP_SUS_L", LM4_GPIO_G, (1<<3), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_SUSWARN_L", LM4_GPIO_G, (1<<2), GPIO_INT_BOTH, - x86_interrupt}, - /* EC needs to control PP1050_PGOOD as it goes to VCCST_PGOOD. */ - {"PP1050_PGOOD", LM4_GPIO_H, (1<<4), GPIO_ODR_LOW, NULL }, - {"PP1350_PGOOD", LM4_GPIO_H, (1<<6), GPIO_INT_BOTH, - x86_interrupt}, - {"PP5000_PGOOD", LM4_GPIO_N, (1<<0), GPIO_INT_BOTH, - x86_interrupt}, - {"VCORE_PGOOD", LM4_GPIO_C, (1<<6), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_EDP_VDD_EN", LM4_GPIO_J, (1<<1), GPIO_INT_BOTH, - power_interrupt}, - {"RECOVERY_L", LM4_GPIO_A, (1<<5), GPIO_PULL_UP|GPIO_INT_BOTH, - switch_interrupt}, - {"WP", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH, - switch_interrupt}, - - /* Other inputs */ - {"BOARD_VERSION1", LM4_GPIO_Q, (1<<5), GPIO_INPUT, NULL}, - {"BOARD_VERSION2", LM4_GPIO_Q, (1<<6), GPIO_INPUT, NULL}, - {"BOARD_VERSION3", LM4_GPIO_Q, (1<<7), GPIO_INPUT, NULL}, - {"CPU_PGOOD", LM4_GPIO_C, (1<<4), GPIO_INPUT, NULL}, - {"ONEWIRE", LM4_GPIO_F, (1<<7), GPIO_INPUT, NULL}, - {"PCH_CATERR_L", LM4_GPIO_F, (1<<3), GPIO_INPUT, NULL}, - {"THERMAL_DATA_READY_L", LM4_GPIO_B, (1<<0), GPIO_INPUT, NULL}, - {"USB1_OC_L", LM4_GPIO_E, (1<<7), GPIO_INPUT, NULL}, - {"USB1_STATUS_L", LM4_GPIO_E, (1<<6), GPIO_INPUT, NULL}, - {"USB2_OC_L", LM4_GPIO_E, (1<<0), GPIO_INPUT, NULL}, - {"USB2_STATUS_L", LM4_GPIO_D, (1<<7), GPIO_INPUT, NULL}, - {"BAT_DETECT_L", LM4_GPIO_B, (1<<4), GPIO_INPUT, NULL}, - - /* Outputs; all unasserted by default except for reset signals */ - {"CPU_PROCHOT", LM4_GPIO_B, (1<<1), GPIO_OUT_LOW, NULL}, - {"PP1350_EN", LM4_GPIO_H, (1<<5), GPIO_OUT_LOW, NULL}, - {"PP3300_DSW_GATED_EN", LM4_GPIO_J, (1<<3), GPIO_OUT_LOW, NULL}, - {"PP3300_DX_EN", LM4_GPIO_F, (1<<6), GPIO_OUT_LOW, NULL}, - {"PP3300_LTE_EN", LM4_GPIO_D, (1<<2), GPIO_OUT_LOW, NULL}, - {"PP3300_WLAN_EN", LM4_GPIO_J, (1<<0), GPIO_OUT_LOW, NULL}, - {"PP1050_EN", LM4_GPIO_C, (1<<7), GPIO_OUT_LOW, NULL}, - {"VCORE_EN", LM4_GPIO_C, (1<<5), GPIO_OUT_LOW, NULL}, - {"PP5000_EN", LM4_GPIO_H, (1<<7), GPIO_OUT_LOW, NULL}, - {"SYS_PWROK", LM4_GPIO_H, (1<<2), GPIO_OUT_LOW, NULL}, - {"WLAN_OFF_L", LM4_GPIO_J, (1<<4), GPIO_OUT_LOW, NULL}, - - {"ENABLE_BACKLIGHT", LM4_GPIO_M, (1<<7), GPIO_OUT_LOW, NULL}, - {"ENABLE_TOUCHPAD", LM4_GPIO_N, (1<<1), GPIO_OUT_LOW, NULL}, - {"ENTERING_RW", LM4_GPIO_D, (1<<3), GPIO_OUT_LOW, NULL}, - {"LIGHTBAR_RESET_L", LM4_GPIO_J, (1<<2), GPIO_OUT_LOW, NULL}, - {"PCH_DPWROK", LM4_GPIO_G, (1<<0), GPIO_OUT_LOW, NULL}, - /* - * HDA_SDO is technically an output, but we need to leave it as an - * input until we drive it high. So can't use open-drain (HI_Z). - */ - {"PCH_HDA_SDO", LM4_GPIO_G, (1<<1), GPIO_INPUT, NULL}, - {"PCH_WAKE_L", LM4_GPIO_F, (1<<0), GPIO_OUT_HIGH, NULL}, - {"PCH_NMI_L", LM4_GPIO_F, (1<<2), GPIO_ODR_HIGH, NULL}, - {"PCH_PWRBTN_L", LM4_GPIO_H, (1<<0), GPIO_OUT_HIGH, NULL}, - {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, - /* - * PL6 is one of 4 pins on the EC which can't be used in open-drain - * mode. To work around this PCH_RCIN_L is set to an input. It will - * only be set to an output when it needs to be driven to 0. - */ - {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_INPUT, NULL}, - {"PCH_SYSRST_L", LM4_GPIO_F, (1<<1), GPIO_ODR_HIGH, NULL}, - {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_ODR_HIGH, NULL}, - {"TOUCHSCREEN_RESET_L", LM4_GPIO_N, (1<<7), GPIO_OUT_LOW, NULL}, - {"EC_EDP_VDD_EN", LM4_GPIO_J, (1<<5), GPIO_OUT_LOW, NULL}, - - {"LPC_CLKRUN_L", LM4_GPIO_M, (1<<2), GPIO_ODR_HIGH, NULL}, - {"USB1_CTL1", LM4_GPIO_E, (1<<1), GPIO_OUT_LOW, NULL}, - {"USB1_CTL2", LM4_GPIO_E, (1<<2), GPIO_OUT_HIGH, NULL}, - {"USB1_CTL3", LM4_GPIO_E, (1<<3), GPIO_OUT_LOW, NULL}, - {"USB1_ENABLE", LM4_GPIO_E, (1<<4), GPIO_OUT_HIGH, NULL}, - {"USB1_ILIM_SEL", LM4_GPIO_E, (1<<5), GPIO_OUT_LOW, NULL}, - {"USB2_CTL1", LM4_GPIO_D, (1<<0), GPIO_OUT_LOW, NULL}, - {"USB2_CTL2", LM4_GPIO_D, (1<<1), GPIO_OUT_HIGH, NULL}, - {"USB2_CTL3", LM4_GPIO_D, (1<<4), GPIO_OUT_LOW, NULL}, - {"USB2_ENABLE", LM4_GPIO_D, (1<<5), GPIO_OUT_HIGH, NULL}, - {"USB2_ILIM_SEL", LM4_GPIO_D, (1<<6), GPIO_OUT_LOW, NULL}, -}; -BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); - -/* Pins with alternate functions */ -const struct gpio_alt_func gpio_alt_funcs[] = { - {GPIO_A, 0x03, 1, MODULE_UART}, /* UART0 */ - {GPIO_A, 0x40, 3, MODULE_I2C}, /* I2C1 SCL */ - {GPIO_A, 0x80, 3, MODULE_I2C, GPIO_OPEN_DRAIN}, /* I2C1 SDA */ - {GPIO_B, 0x04, 3, MODULE_I2C}, /* I2C0 SCL */ - {GPIO_B, 0x08, 3, MODULE_I2C, GPIO_OPEN_DRAIN}, /* I2C0 SDA */ - {GPIO_B, 0x40, 3, MODULE_I2C}, /* I2C5 SCL */ - {GPIO_B, 0x80, 3, MODULE_I2C, GPIO_OPEN_DRAIN}, /* I2C5 SDA */ - {GPIO_G, 0x30, 1, MODULE_UART}, /* UART2 */ - {GPIO_J, 0x40, 1, MODULE_PECI}, /* PECI Tx */ - {GPIO_J, 0x80, 0, MODULE_PECI, GPIO_ANALOG}, /* PECI Rx */ - {GPIO_L, 0x3f, 15, MODULE_LPC}, /* LPC */ - {GPIO_M, 0x33, 15, MODULE_LPC}, /* LPC */ - {GPIO_N, 0x0c, 1, MODULE_PWM_FAN}, /* FAN0PWM2 */ - {GPIO_N, 0x40, 1, MODULE_PWM_KBLIGHT}, /* FAN0PWM4 */ -}; -const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); - -/* x86 signal list. Must match order of enum x86_signal. */ -const struct x86_signal_info x86_signal_list[] = { - {GPIO_PP5000_PGOOD, 1, "PGOOD_PP5000"}, - {GPIO_PP1350_PGOOD, 1, "PGOOD_PP1350"}, - {GPIO_VCORE_PGOOD, 1, "PGOOD_VCORE"}, - {GPIO_PCH_SLP_S0_L, 1, "SLP_S0#_DEASSERTED"}, - {GPIO_PCH_SLP_S3_L, 1, "SLP_S3#_DEASSERTED"}, - {GPIO_PCH_SLP_S5_L, 1, "SLP_S5#_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, 1, "SLP_SUS#_DEASSERTED"}, -}; -BUILD_ASSERT(ARRAY_SIZE(x86_signal_list) == X86_SIGNAL_COUNT); - -/* ADC channels. Must be in the exactly same order as in enum adc_channel. */ -const struct adc_t adc_channels[] = { - /* EC internal temperature is calculated by - * 273 + (295 - 450 * ADC_VALUE / ADC_READ_MAX) / 2 - * = -225 * ADC_VALUE / ADC_READ_MAX + 420.5 - */ - {"ECTemp", LM4_ADC_SEQ0, -225, ADC_READ_MAX, 420, - LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0}, - - /* IOUT == ICMNT is on PE3/AIN0 */ - /* We have 0.01-ohm resistors, and IOUT is 20X the differential - * voltage, so 1000mA ==> 200mV. - * ADC returns 0x000-0xFFF, which maps to 0.0-3.3V (as configured). - * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 200 - */ - {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 2, 0, - LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, -}; -BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); - -/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ -const struct pwm_t pwm_channels[] = { - {4, 0}, -}; -BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); - -/* Physical fans. These are logically separate from pwm_channels. */ -const struct fan_t fans[] = { - {.flags = FAN_USE_RPM_MODE, - .rpm_min = 1500, - .rpm_max = 9300, - .ch = 2, - .pgood_gpio = GPIO_PP5000_PGOOD, - .enable_gpio = -1, - }, -}; -BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); - -/* I2C ports */ -const struct i2c_port_t i2c_ports[] = { - {"batt_chg", 0, 100}, - {"lightbar", 1, 400}, - {"thermal", 5, 100}, -}; -const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - - -/* Temperature sensors data; must be in same order as enum temp_sensor_id. */ -const struct temp_sensor_t temp_sensors[] = { -/* HEY: Need correct I2C addresses and read function for external sensor */ - {"ECInternal", TEMP_SENSOR_TYPE_BOARD, chip_temp_sensor_get_val, 0, 4}, - {"PECI", TEMP_SENSOR_TYPE_CPU, peci_temp_sensor_get_val, 0, 2}, -}; -BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); - -/* Thermal limits for each temp sensor. All temps are in degrees K. Must be in - * 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}, - /* Only the AP affects the thermal limits and fan speed. */ - {{C_TO_K(100), C_TO_K(114), C_TO_K(110)}, C_TO_K(60), C_TO_K(90)}, -}; -BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); - -struct keyboard_scan_config keyscan_config = { - .output_settle_us = 40, - .debounce_down_us = 6 * MSEC, - .debounce_up_us = 30 * MSEC, - .scan_period_us = 1500, - .min_post_scan_delay_us = 1000, - .poll_timeout_us = SECOND, - .actual_key_mask = { - 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, - 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ - }, -}; - -/** - * Physical detection of battery connection. - */ -int battery_is_connected(void) -{ - return (gpio_get_level(GPIO_BAT_DETECT_L) == 0); -} diff --git a/board/bolt/board.h b/board/bolt/board.h deleted file mode 100644 index 0ab6ea67a0..0000000000 --- a/board/bolt/board.h +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* Configuration for Bolt mainboard */ - -#ifndef __BOARD_H -#define __BOARD_H - -/* Debug features */ -#define CONFIG_CONSOLE_CMDHELP -#define CONFIG_TASK_PROFILING - -/* Optional features */ -#define CONFIG_CHIPSET_X86 -#define CONFIG_CHIPSET_CAN_THROTTLE -#define CONFIG_EXTPOWER_GPIO -#define CONFIG_KEYBOARD_BOARD_CONFIG -#define CONFIG_KEYBOARD_PROTOCOL_8042 -#define CONFIG_LED_DRIVER_DS2413 -#define CONFIG_ONEWIRE -#define CONFIG_POWER_BUTTON -#define CONFIG_POWER_BUTTON_X86 -#define CONFIG_WP_ACTIVE_HIGH - -#define CONFIG_BATTERY_CHECK_CONNECTED -#define CONFIG_BATTERY_LINK -#define CONFIG_BATTERY_SMART -#define CONFIG_BACKLIGHT_LID -#define CONFIG_BACKLIGHT_REQ_GPIO GPIO_PCH_BKLTEN -#define CONFIG_CHARGER -#define CONFIG_CHARGER_BQ24715 -/* 10mOhm sense resitors. */ -#define CONFIG_CHARGER_SENSE_RESISTOR 10 -#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 -/* External Charger maximum current. */ -#define CONFIG_CHARGER_INPUT_CURRENT 5000 -#define CONFIG_FANS 1 -#define CONFIG_PWM -#define CONFIG_PWM_KBLIGHT -#define CONFIG_SWITCH_DEDICATED_RECOVERY -#define CONFIG_TEMP_SENSOR -#define CONFIG_UART_HOST 2 -#define CONFIG_WIRELESS -#if 0 -#define CONFIG_USB_PORT_POWER_DUMB -#endif - - -#ifndef __ASSEMBLER__ - -/* I2C ports */ -#define I2C_PORT_BATTERY 0 -#define I2C_PORT_CHARGER 0 -#define I2C_PORT_LIGHTBAR 1 -#define I2C_PORT_THERMAL 5 - -/* 13x8 keyboard scanner uses an entire GPIO bank for row inputs */ -#define KB_SCAN_ROW_IRQ LM4_IRQ_GPIOK -#define KB_SCAN_ROW_GPIO LM4_GPIO_K - -/* Host connects to keyboard controller module via LPC */ -#define HOST_KB_BUS_LPC - -/* USB ports */ -#define USB_PORT_COUNT 2 - -/* GPIO signal definitions. */ -enum gpio_signal { - /* Inputs with interrupt handlers are first for efficiency */ - GPIO_POWER_BUTTON_L = 0, /* Power button */ - GPIO_LID_OPEN, /* Lid switch */ - GPIO_AC_PRESENT, /* AC power present */ - GPIO_PCH_BKLTEN, /* Backlight enable signal from PCH */ - GPIO_PCH_SLP_S0_L, /* SLP_S0# signal from PCH */ - GPIO_PCH_SLP_S3_L, /* SLP_S3# signal from PCH */ - GPIO_PCH_SLP_S5_L, /* SLP_S5# signal from PCH */ - GPIO_PCH_SLP_SUS_L, /* SLP_SUS# signal from PCH */ - GPIO_PCH_SUSWARN_L, /* SUSWARN# signal from PCH */ - GPIO_PP1050_PGOOD, /* Power good on 1.05V */ - GPIO_PP1350_PGOOD, /* Power good on 1.35V (DRAM) */ - GPIO_PP5000_PGOOD, /* Power good on 5V */ - GPIO_VCORE_PGOOD, /* Power good on core VR */ - GPIO_PCH_EDP_VDD_EN, /* PCH wants EDP enabled */ - GPIO_RECOVERY_L, /* Recovery signal from servo */ - GPIO_WP, /* Write protect input */ - - /* Other inputs */ - GPIO_BOARD_VERSION1, /* Board version stuffing resistor 1 */ - GPIO_BOARD_VERSION2, /* Board version stuffing resistor 2 */ - GPIO_BOARD_VERSION3, /* Board version stuffing resistor 3 */ - GPIO_CPU_PGOOD, /* Power good to the CPU */ - GPIO_ONEWIRE, /* One-wire bus to adapter LED */ - GPIO_PCH_CATERR_L, /* Catastrophic error signal from PCH */ - GPIO_THERMAL_DATA_READY_L, /* From thermal sensor */ - GPIO_USB1_OC_L, /* USB port overcurrent warning */ - GPIO_USB1_STATUS_L, /* USB charger port 1 status output */ - GPIO_USB2_OC_L, /* USB port overcurrent warning */ - GPIO_USB2_STATUS_L, /* USB charger port 2 status output */ - GPIO_BAT_DETECT_L, /* Battery detect from BAT_TEMP */ - - /* Outputs */ - GPIO_CPU_PROCHOT, /* Force CPU to think it's overheated */ - GPIO_PP1350_EN, /* Enable 1.35V supply */ - GPIO_PP3300_DSW_GATED_EN, /* Enable DSW rails */ - GPIO_PP3300_DX_EN, /* Enable power to lots of peripherals */ - GPIO_PP3300_LTE_EN, /* Enable LTE radio */ - GPIO_PP3300_WLAN_EN, /* Enable WiFi power */ - GPIO_PP1050_EN, /* Enable 1.05V regulator */ - GPIO_VCORE_EN, /* Stuffing option - not connected */ - GPIO_PP5000_EN, /* Enable 5V supply */ - GPIO_SYS_PWROK, /* EC thinks everything is up and ready */ - GPIO_WLAN_OFF_L, /* Disable WiFi radio */ - - GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */ - GPIO_ENABLE_TOUCHPAD, /* Enable touchpad power */ - GPIO_ENTERING_RW, /* Indicate when EC is entering RW code */ - GPIO_LIGHTBAR_RESET_L, /* Reset lightbar controllers */ - GPIO_PCH_DPWROK, /* Indicate when VccDSW is good */ - - GPIO_PCH_HDA_SDO, /* HDA_SDO signal to PCH; when high, ME - * ignores security descriptor */ - GPIO_PCH_WAKE_L, /* Wake signal from EC to PCH */ - GPIO_PCH_NMI_L, /* Non-maskable interrupt pin to PCH */ - GPIO_PCH_PWRBTN_L, /* Power button output to PCH */ - GPIO_PCH_PWROK, /* PWROK / APWROK signals to PCH */ - GPIO_PCH_RCIN_L, /* RCIN# line to PCH (for 8042 emulation) */ - GPIO_PCH_SYS_RST_L, /* Reset PCH resume power plane logic */ - GPIO_PCH_SMI_L, /* System management interrupt to PCH */ - GPIO_TOUCHSCREEN_RESET_L, /* Reset touch screen */ - GPIO_EC_EDP_VDD_EN, /* Enable EDP (passthru from PCH) */ - GPIO_LPC_CLKRUN_L, /* Dunno. Probably important, though. */ - - GPIO_USB1_CTL1, /* USB charger port 1 CTL1 output */ - GPIO_USB1_CTL2, /* USB charger port 1 CTL2 output */ - GPIO_USB1_CTL3, /* USB charger port 1 CTL3 output */ - GPIO_USB1_ENABLE, /* USB charger port 1 enable */ - GPIO_USB1_ILIM_SEL, /* USB charger port 1 ILIM_SEL output */ - GPIO_USB2_CTL1, /* USB charger port 2 CTL1 output */ - GPIO_USB2_CTL2, /* USB charger port 2 CTL2 output */ - GPIO_USB2_CTL3, /* USB charger port 2 CTL3 output */ - GPIO_USB2_ENABLE, /* USB charger port 2 enable */ - GPIO_USB2_ILIM_SEL, /* USB charger port 2 ILIM_SEL output */ - - /* Number of GPIOs; not an actual GPIO */ - GPIO_COUNT -}; - -/* x86 signal definitions */ -enum x86_signal { - X86_PGOOD_PP5000 = 0, - X86_PGOOD_PP1350, - X86_PGOOD_VCORE, - X86_PCH_SLP_S0n_DEASSERTED, - X86_PCH_SLP_S3n_DEASSERTED, - X86_PCH_SLP_S5n_DEASSERTED, - X86_PCH_SLP_SUSn_DEASSERTED, - - /* Number of X86 signals */ - X86_SIGNAL_COUNT -}; - -enum adc_channel { - /* EC internal die temperature in degrees K. */ - ADC_CH_EC_TEMP = 0, - - /* Charger current in mA. */ - ADC_CH_CHARGER_CURRENT, - - ADC_CH_COUNT -}; - -enum pwm_channel { - PWM_CH_KBLIGHT, - - /* Number of PWM channels */ - PWM_CH_COUNT -}; - -enum temp_sensor_id { - /* HEY - need two I2C sensor values, and put PECI first */ - - /* EC internal temperature sensor */ - TEMP_SENSOR_EC_INTERNAL, - /* CPU die temperature via PECI */ - TEMP_SENSOR_CPU_PECI, - - TEMP_SENSOR_COUNT -}; - -/* Known board versions for system_get_board_version(). */ -enum board_version { - BOARD_VERSION_PROTO1 = 0, - BOARD_VERSION_EVT = 1, -}; - -/* Wireless signals */ -#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L -#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN -#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN - -#endif /* !__ASSEMBLER__ */ - -#endif /* __BOARD_H */ diff --git a/board/bolt/build.mk b/board/bolt/build.mk deleted file mode 100644 index 7bbc05b261..0000000000 --- a/board/bolt/build.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -*- makefile -*- -# Copyright (c) 2013 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. -# -# Board specific files build -# - -# the IC is TI Stellaris LM4 -CHIP:=lm4 - -board-y=board.o power_sequence.o diff --git a/board/bolt/ec.tasklist b/board/bolt/ec.tasklist deleted file mode 100644 index 395d068bbb..0000000000 --- a/board/bolt/ec.tasklist +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/** - * List of enabled tasks in the priority order - * - * The first one has the lowest priority. - * - * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and - * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, - * where : - * 'n' is the name of the task - * 'r' is the main routine of the task - * 'd' is an opaque parameter passed to the routine at startup - * 's' is the stack size in bytes; must be a multiple of 8 - */ -#define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_NOTEST(LIGHTBAR, lightbar_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(POWERBTN, power_button_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) diff --git a/board/bolt/power_sequence.c b/board/bolt/power_sequence.c deleted file mode 100644 index 0e458aeb26..0000000000 --- a/board/bolt/power_sequence.c +++ /dev/null @@ -1,395 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* X86 chipset power control module for Chrome EC */ - -#include "chipset.h" -#include "chipset_x86_common.h" -#include "common.h" -#include "console.h" -#include "gpio.h" -#include "hooks.h" -#include "lid_switch.h" -#include "registers.h" -#include "system.h" -#include "timer.h" -#include "util.h" -#include "wireless.h" - -/* Console output macros */ -#define CPUTS(outstr) cputs(CC_CHIPSET, outstr) -#define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args) - -/* Input state flags */ -#define IN_PGOOD_PP5000 X86_SIGNAL_MASK(X86_PGOOD_PP5000) -#define IN_PGOOD_PP1350 X86_SIGNAL_MASK(X86_PGOOD_PP1350) -#define IN_PGOOD_VCORE X86_SIGNAL_MASK(X86_PGOOD_VCORE) -#define IN_PCH_SLP_S0n_DEASSERTED X86_SIGNAL_MASK(X86_PCH_SLP_S0n_DEASSERTED) -#define IN_PCH_SLP_S3n_DEASSERTED X86_SIGNAL_MASK(X86_PCH_SLP_S3n_DEASSERTED) -#define IN_PCH_SLP_S5n_DEASSERTED X86_SIGNAL_MASK(X86_PCH_SLP_S5n_DEASSERTED) -#define IN_PCH_SLP_SUSn_DEASSERTED X86_SIGNAL_MASK(X86_PCH_SLP_SUSn_DEASSERTED) - -/* All always-on supplies */ -#define IN_PGOOD_ALWAYS_ON (IN_PGOOD_PP5000) -/* All non-core power rails */ -#define IN_PGOOD_ALL_NONCORE (IN_PGOOD_PP1350) -/* All core power rails */ -#define IN_PGOOD_ALL_CORE (IN_PGOOD_VCORE) -/* Rails required for S3 */ -#define IN_PGOOD_S3 (IN_PGOOD_ALWAYS_ON | IN_PGOOD_PP1350) -/* Rails required for S0 */ -#define IN_PGOOD_S0 (IN_PGOOD_ALWAYS_ON | IN_PGOOD_ALL_NONCORE) - -/* All PM_SLP signals from PCH deasserted */ -#define IN_ALL_PM_SLP_DEASSERTED (IN_PCH_SLP_S3n_DEASSERTED | \ - IN_PCH_SLP_S5n_DEASSERTED) -/* All inputs in the right state for S0 */ -#define IN_ALL_S0 (IN_PGOOD_ALWAYS_ON | IN_PGOOD_ALL_NONCORE | \ - IN_PGOOD_ALL_CORE | IN_ALL_PM_SLP_DEASSERTED) - -static int throttle_cpu; /* Throttle CPU? */ - -void chipset_force_shutdown(void) -{ - CPRINTF("[%T %s()]\n", __func__); - - /* - * Force x86 off. This condition will reset once the state machine - * transitions to G3. - */ - gpio_set_level(GPIO_PCH_DPWROK, 0); -} - -void chipset_reset(int cold_reset) -{ - CPRINTF("[%T %s(%d)]\n", __func__, cold_reset); - if (cold_reset) { - /* - * Drop and restore PWROK. This causes the PCH to reboot, - * regardless of its after-G3 setting. This type of reboot - * causes the PCH to assert PLTRST#, SLP_S3#, and SLP_S5#, so - * we actually drop power to the rest of the system (hence, a - * "cold" reboot). - */ - - /* Ignore if PWROK is already low */ - if (gpio_get_level(GPIO_PCH_PWROK) == 0) - return; - - /* PWROK must deassert for at least 3 RTC clocks = 91 us */ - gpio_set_level(GPIO_PCH_PWROK, 0); - udelay(100); - gpio_set_level(GPIO_PCH_PWROK, 1); - - } else { - /* - * Send a RCIN# pulse to the PCH. This just causes it to - * assert INIT# to the CPU without dropping power or asserting - * PLTRST# to reset the rest of the system. - */ - - /* - * Pulse must be at least 16 PCI clocks long = 500 ns. The gpio - * pin used by the EC (PL6) does not behave in the correct - * manner when configured as open drain. In order to mimic - * open drain, the pin is initially configured as an input. - * When it is needed to drive low, the flags are updated which - * changes the pin to an output and drives the pin low. */ - gpio_set_flags(GPIO_PCH_RCIN_L, GPIO_OUT_LOW); - udelay(10); - gpio_set_flags(GPIO_PCH_RCIN_L, GPIO_INPUT); - } -} - -void chipset_throttle_cpu(int throttle) -{ - if (chipset_in_state(CHIPSET_STATE_ON)) - gpio_set_level(GPIO_CPU_PROCHOT, throttle); -} - -enum x86_state x86_chipset_init(void) -{ - /* Enable interrupts for our GPIOs */ - gpio_enable_interrupt(GPIO_PCH_EDP_VDD_EN); - - /* - * If we're switching between images without rebooting, see if the x86 - * is already powered on; if so, leave it there instead of cycling - * through G3. - */ - if (system_jumped_to_this_image()) { - if ((x86_get_signals() & IN_ALL_S0) == IN_ALL_S0) { - CPRINTF("[%T x86 already in S0]\n"); - return X86_S0; - } else { - /* Force all signals to their G3 states */ - CPRINTF("[%T x86 forcing G3]\n"); - gpio_set_level(GPIO_PCH_PWROK, 0); - gpio_set_level(GPIO_SYS_PWROK, 0); - gpio_set_level(GPIO_VCORE_EN, 0); - gpio_set_level(GPIO_PP1050_EN, 0); - gpio_set_level(GPIO_PP1350_EN, 0); - gpio_set_level(GPIO_PP1050_PGOOD, 0); - gpio_set_level(GPIO_EC_EDP_VDD_EN, 0); - gpio_set_level(GPIO_PP3300_DX_EN, 0); - gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 0); - gpio_set_level(GPIO_PP5000_EN, 0); - gpio_set_level(GPIO_PCH_DPWROK, 0); - wireless_enable(0); - } - } - - return X86_G3; -} - -enum x86_state x86_handle_state(enum x86_state state) -{ - switch (state) { - case X86_G3: - break; - - case X86_S5: - if (gpio_get_level(GPIO_PCH_SLP_S5_L) == 1) - return X86_S5S3; /* Power up to next state */ - - break; - - case X86_S3: - /* - * If lid is closed; hold touchscreen in reset to cut - * power usage. If lid is open, take touchscreen out - * of reset so it can wake the processor. - */ - gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, lid_is_open()); - - /* Check for state transitions */ - if (!x86_has_signals(IN_PGOOD_S3)) { - /* Required rail went away */ - chipset_force_shutdown(); - return X86_S3S5; - } else if (gpio_get_level(GPIO_PCH_SLP_S3_L) == 1) { - /* Power up to next state */ - return X86_S3S0; - } else if (gpio_get_level(GPIO_PCH_SLP_S5_L) == 0) { - /* Power down to next state */ - return X86_S3S5; - } - break; - - case X86_S0: - if (!x86_has_signals(IN_PGOOD_S0)) { - /* Required rail went away */ - chipset_force_shutdown(); - return X86_S0S3; - } else if (gpio_get_level(GPIO_PCH_SLP_S3_L) == 0) { - /* Power down to next state */ - return X86_S0S3; - } - break; - - case X86_G3S5: - /* - * Wait 10ms after +3VALW good, since that powers VccDSW and - * VccSUS. - */ - msleep(10); - - /* Enable PP5000 (5V) rail as 1.05V and 1.35V rails need 5V - * rail to regulate properly. */ - gpio_set_level(GPIO_PP5000_EN, 1); - if (x86_wait_signals(IN_PGOOD_PP5000)) { - chipset_force_shutdown(); - return X86_G3; - } - - /* Assert DPWROK */ - gpio_set_level(GPIO_PCH_DPWROK, 1); - - /* Enable PP1050 rail. Bring up the PP1050_PCH_SUS rail to - * provide 1.05V suspend as early as possible as the RSMSRT# - * signal deasserting indicates both the PP3300_PCH_SUS - * and PP1050_PCH_SUS rails are good. Since PP1050_PGGOOD is - * driven as output to work around VCCST_PWRGD timing problems - * there is no way to know when PP1050_PCH_SUS rail is good. - * Similarly the PP3300_PCH_SUS rail is enabled by SLP_SUS# - * being deasserted without a power good signal. The RSMRST# - * is driven by an RC circuit feeding into schmitt trigger. - * Therefore, the PP1050_PCH_SUS rail is brought up as early - * as possible after DPWROK is asserted so that it will be - * ready by the time RSMRST# is deasserted. */ - gpio_set_level(GPIO_PP1050_EN, 1); - - /* Wait for SLP_SUS# to deassert before enabling PP1050. */ - if (x86_wait_signals(IN_PCH_SLP_SUSn_DEASSERTED)) { - chipset_force_shutdown(); - return X86_G3; - } - - /* Wait 5ms for SUSCLK to stabilize */ - msleep(5); - return X86_S5; - - case X86_S5S3: - /* Wait for the always-on rails to be good */ - if (x86_wait_signals(IN_PGOOD_ALWAYS_ON)) { - chipset_force_shutdown(); - return X86_S5; - } - - /* Turn on power to RAM */ - gpio_set_level(GPIO_PP1350_EN, 1); - if (x86_wait_signals(IN_PGOOD_S3)) { - chipset_force_shutdown(); - return X86_S5; - } - - /* - * Take lightbar out of reset, now that +5VALW is - * available and we won't leak +3VALW through the reset - * line. - */ - gpio_set_level(GPIO_LIGHTBAR_RESET_L, 1); - - /* - * Enable touchpad power so it can wake the system from - * suspend. - */ - gpio_set_level(GPIO_ENABLE_TOUCHPAD, 1); - - /* Call hooks now that rails are up */ - hook_notify(HOOK_CHIPSET_STARTUP); - return X86_S3; - - case X86_S3S0: - /* Wait 20ms before allowing VCCST_PGOOD to rise. */ - msleep(20); - /* Assert VCCST_PGOOD using PP1050_PGOOD. */ - gpio_set_level(GPIO_PP1050_PGOOD, 1); - - /* Turn on power rails */ - gpio_set_level(GPIO_PP3300_DX_EN, 1); - gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 1); - - /* Enable wireless */ - wireless_enable(EC_WIRELESS_SWITCH_ALL); - - /* - * Make sure touchscreen is out if reset (even if the - * lid is still closed); it may have been turned off if - * the lid was closed in S3. - */ - gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, 1); - - /* Wait for non-core power rails good */ - if (x86_wait_signals(IN_PGOOD_S0)) { - chipset_force_shutdown(); - wireless_enable(0); - gpio_set_level(GPIO_EC_EDP_VDD_EN, 0); - gpio_set_level(GPIO_PP3300_DX_EN, 0); - gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 0); - gpio_set_level(GPIO_PP1050_PGOOD, 0); - return X86_S3; - } - - /* - * Enable +CPU_CORE. The CPU itself will request the supplies - * when it's ready. - */ - gpio_set_level(GPIO_VCORE_EN, 1); - - /* Call hooks now that rails are up */ - hook_notify(HOOK_CHIPSET_RESUME); - - /* Wait 99ms after all voltages good */ - msleep(99); - - /* - * Throttle CPU if necessary. This should only be asserted - * when +VCCP is powered (it is by now). - */ - gpio_set_level(GPIO_CPU_PROCHOT, throttle_cpu); - - /* Set PCH_PWROK */ - gpio_set_level(GPIO_PCH_PWROK, 1); - gpio_set_level(GPIO_SYS_PWROK, 1); - return X86_S0; - - case X86_S0S3: - /* Call hooks before we remove power rails */ - hook_notify(HOOK_CHIPSET_SUSPEND); - - /* Drop VCCST_PGOOD */ - gpio_set_level(GPIO_PP1050_PGOOD, 0); - /* Clear PCH_PWROK */ - gpio_set_level(GPIO_SYS_PWROK, 0); - gpio_set_level(GPIO_PCH_PWROK, 0); - - /* Wait 40ns */ - udelay(1); - - /* Disable +CPU_CORE */ - gpio_set_level(GPIO_VCORE_EN, 0); - - /* Disable WWAN, but leave WiFi on */ - wireless_enable(EC_WIRELESS_SWITCH_WLAN | - EC_WIRELESS_SWITCH_WLAN_POWER); - - /* - * Deassert prochot since CPU is off and we're about to drop - * +VCCP. - */ - gpio_set_level(GPIO_CPU_PROCHOT, 0); - - /* Turn off power rails */ - gpio_set_level(GPIO_EC_EDP_VDD_EN, 0); - gpio_set_level(GPIO_PP3300_DX_EN, 0); - gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 0); - return X86_S3; - - case X86_S3S5: - /* Call hooks before we remove power rails */ - hook_notify(HOOK_CHIPSET_SHUTDOWN); - - /* Disable wireless */ - wireless_enable(0); - - /* Disable touchpad power */ - gpio_set_level(GPIO_ENABLE_TOUCHPAD, 0); - - /* Turn off power to RAM */ - gpio_set_level(GPIO_PP1350_EN, 0); - - /* - * Put touchscreen and lightbar in reset, so we won't - * leak +3VALW through the reset line to chips powered - * by +5VALW. - * - * (Note that we're no longer powering down +5VALW due - * to crosbug.com/p/16600, but to minimize side effects - * of that change we'll still reset these components in - * S5.) - */ - gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, 0); - gpio_set_level(GPIO_LIGHTBAR_RESET_L, 0); - - return X86_S5; - - case X86_S5G3: - /* Deassert DPWROK */ - gpio_set_level(GPIO_PCH_DPWROK, 0); - gpio_set_level(GPIO_PP1050_EN, 0); - /* Disable PP5000 (5V) rail. */ - gpio_set_level(GPIO_PP5000_EN, 0); - return X86_G3; - } - - return state; -} - -void power_interrupt(enum gpio_signal signal) -{ - /* Pass through eDP VDD enable from PCH */ - gpio_set_level(GPIO_EC_EDP_VDD_EN, gpio_get_level(GPIO_PCH_EDP_VDD_EN)); -} diff --git a/board/daisy/board.c b/board/daisy/board.c deleted file mode 100644 index 551f32841f..0000000000 --- a/board/daisy/board.c +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (c) 2013 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. - */ -/* Daisy board-specific configuration */ - -#include "battery.h" -#include "chipset.h" -#include "common.h" -#include "gpio.h" -#include "i2c.h" -#include "keyboard_raw.h" -#include "lid_switch.h" -#include "pmu_tpschrome.h" -#include "registers.h" -#include "spi.h" -#include "task.h" -#include "util.h" - -/* - * Daisy keyboard summary: - * 1. KEYSCAN task woken up via GPIO external interrupt when a key is pressed. - * 2. The task scans the keyboard matrix for changes. If key state has - * changed, the board-specific kb_send() function is called. - * 3. For Daisy, the EC is connected via I2C and acts as a slave, so the AP - * must initiate all transactions. EC_INT is driven low to interrupt AP when - * new data becomes available. - * 4. When the AP is interrupted, it initiates two i2c transactions: - * 1. 1-byte write: AP writes 0x01 to make EC send keyboard state. - * 2. 14-byte read: AP reads 1 keyboard packet (13 byte keyboard state + - * 1-byte checksum). - */ - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT (GPIO_OUTPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN) - -/* GPIO signal list. Must match order from enum gpio_signal. */ -const struct gpio_info gpio_list[] = { - /* Inputs with interrupt handlers are first for efficiency */ - {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt}, - {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt}, - {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_RISING, power_interrupt}, - {"CHARGER_INT_L", GPIO_C, (1<<4), GPIO_INT_FALLING, NULL}, - {"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt}, - {"SUSPEND_L", GPIO_A, (1<<7), GPIO_INT_BOTH, power_interrupt}, - {"KB_IN00", GPIO_C, (1<<8), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN01", GPIO_C, (1<<9), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN02", GPIO_C, (1<<10), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN03", GPIO_C, (1<<11), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN04", GPIO_C, (1<<12), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN05", GPIO_C, (1<<14), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN06", GPIO_C, (1<<15), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN07", GPIO_D, (1<<2), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - /* Other inputs */ - {"AC_PWRBTN_L", GPIO_A, (1<<0), GPIO_INT_BOTH, NULL}, - {"SPI1_NSS", GPIO_A, (1<<4), GPIO_INPUT | GPIO_PULL_UP, NULL}, - /* - * I2C pins should be configured as inputs until I2C module is - * initialized. This will avoid driving the lines unintentionally. - */ - {"I2C1_SCL", GPIO_B, (1<<6), GPIO_INPUT, NULL}, - {"I2C1_SDA", GPIO_B, (1<<7), GPIO_INPUT, NULL}, - {"I2C2_SCL", GPIO_B, (1<<10), GPIO_INPUT, NULL}, - {"I2C2_SDA", GPIO_B, (1<<11), GPIO_INPUT, NULL}, - /* Outputs */ - {"AC_STATUS", GPIO_A, (1<<5), GPIO_OUT_HIGH, NULL}, - {"SPI1_MISO", GPIO_A, (1<<6), GPIO_OUT_HIGH, NULL}, - {"EN_PP1350", GPIO_A, (1<<2), GPIO_OUT_LOW, NULL}, - {"EN_PP5000", GPIO_A, (1<<11), GPIO_OUT_LOW, NULL}, - {"EN_PP3300", GPIO_A, (1<<8), GPIO_OUT_LOW, NULL}, - {"PMIC_PWRON_L", GPIO_A, (1<<12), GPIO_OUT_HIGH, NULL}, - {"ENTERING_RW", GPIO_H, (1<<0), GPIO_OUT_LOW, NULL}, - {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, - {"POWER_LED_L", GPIO_B, (1<<3), GPIO_OUT_HIGH, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_ODR_HIGH, NULL}, - {"CODEC_INT", GPIO_H, (1<<1), GPIO_ODR_HIGH, NULL}, - {"KB_OUT00", GPIO_B, (1<<0), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT01", GPIO_B, (1<<8), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT02", GPIO_B, (1<<12), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT03", GPIO_B, (1<<13), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT04", GPIO_B, (1<<14), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT05", GPIO_B, (1<<15), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT06", GPIO_C, (1<<0), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT07", GPIO_C, (1<<1), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT08", GPIO_C, (1<<2), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT09", GPIO_B, (1<<1), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT10", GPIO_C, (1<<5), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT11", GPIO_C, (1<<6), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT12", GPIO_C, (1<<7), GPIO_KB_OUTPUT, NULL}, - - /* Unimplemented signals which we need to emulate for now */ - GPIO_SIGNAL_NOT_IMPLEMENTED("WP_L"), -}; -BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); - -/* Pins with alternate functions */ -const struct gpio_alt_func gpio_alt_funcs[] = { - {GPIO_A, 0x0004, GPIO_ALT_TIM2, MODULE_POWER_LED}, - {GPIO_A, 0x0600, GPIO_ALT_USART, MODULE_UART}, - {GPIO_B, 0x0cc0, GPIO_ALT_I2C, MODULE_I2C}, -}; -const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); - -/* Battery temperature ranges in degrees C */ -const struct battery_temperature_ranges bat_temp_ranges = { - .start_charging_min_c = 5, - .start_charging_max_c = 45, - .charging_min_c = 5, - .charging_max_c = 60, - .discharging_min_c = 0, - .discharging_max_c = 100, -}; - -/* I2C ports */ -const struct i2c_port_t i2c_ports[] = { - {"0", 0, 100}, - {"1", 1, 100}, -}; -const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - -void keyboard_suppress_noise(void) -{ - /* notify audio codec of keypress for noise suppression */ - gpio_set_level(GPIO_CODEC_INT, 0); - gpio_set_level(GPIO_CODEC_INT, 1); -} - -/** - * Board-specific PMU init. - */ -int pmu_board_init(void) -{ - return EC_SUCCESS; -} diff --git a/board/daisy/board.h b/board/daisy/board.h deleted file mode 100644 index 319eeefc62..0000000000 --- a/board/daisy/board.h +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* Daisy board configuration */ - -#ifndef __BOARD_H -#define __BOARD_H - -/* 16 MHz SYSCLK clock frequency */ -#define CPU_CLOCK 16000000 - -/* Optional features */ -#define CONFIG_BATTERY_SMART -#define CONFIG_CHARGER_TPS65090 -#define CONFIG_CHIPSET_GAIA -#define CONFIG_EXTPOWER_SNOW -#define CONFIG_I2C -#define CONFIG_KEYBOARD_PROTOCOL_MKBP -#define CONFIG_KEYBOARD_SUPPRESS_NOISE -#define CONFIG_PMU_TPS65090 -#undef CONFIG_WATCHDOG_HELP - -/* - * Allow dangerous commands all the time, since we don't have a write protect - * switch. This is a serious security hole, but is acceptable here because - * daisy isn't a production board. - */ -#define CONFIG_SYSTEM_UNLOCKED - -#ifndef __ASSEMBLER__ - -/* Keyboard output port list */ -#define KB_OUT_PORT_LIST GPIO_B, GPIO_C - -/* Charging */ -#define I2C_PORT_MASTER 0 /* Note: some Daisy systems used port 1 */ -#define I2C_PORT_BATTERY I2C_PORT_MASTER -#define I2C_PORT_CHARGER I2C_PORT_MASTER -#define I2C_PORT_SLAVE 1 - -/* Timer selection */ -#define TIM_CLOCK_MSB 3 -#define TIM_CLOCK_LSB 4 - -/* GPIO signal list */ -enum gpio_signal { - /* Inputs with interrupt handlers are first for efficiency */ - GPIO_KB_PWR_ON_L = 0, /* Keyboard power button */ - GPIO_PP1800_LDO2, /* LDO2 is ON (end of PMIC sequence) */ - GPIO_SOC1V8_XPSHOLD, /* App Processor ON */ - GPIO_CHARGER_INT_L, - GPIO_LID_OPEN, /* LID switch detection */ - GPIO_SUSPEND_L, /* AP suspend/resume state */ - /* Keyboard inputs */ - GPIO_KB_IN00, - GPIO_KB_IN01, - GPIO_KB_IN02, - GPIO_KB_IN03, - GPIO_KB_IN04, - GPIO_KB_IN05, - GPIO_KB_IN06, - GPIO_KB_IN07, - /* Other inputs */ - GPIO_AC_PWRBTN_L, - GPIO_SPI1_NSS, - GPIO_I2C1_SCL, - GPIO_I2C1_SDA, - GPIO_I2C2_SCL, - GPIO_I2C2_SDA, - /* Outputs */ - GPIO_AC_STATUS, - GPIO_SPI1_MISO, - GPIO_EN_PP1350, /* DDR 1.35v rail enable */ - GPIO_EN_PP5000, /* 5.0v rail enable */ - GPIO_EN_PP3300, /* 3.3v rail enable */ - GPIO_PMIC_PWRON_L, /* 5v rail ready */ - GPIO_ENTERING_RW, /* EC is R/W mode for the kbc mux */ - GPIO_CHARGER_EN, - GPIO_POWER_LED_L, /* Power state keyboard LED */ - GPIO_EC_INT, - GPIO_CODEC_INT, /* To audio codec (KB noise cancellation) */ - GPIO_KB_OUT00, - GPIO_KB_OUT01, - GPIO_KB_OUT02, - GPIO_KB_OUT03, - GPIO_KB_OUT04, - GPIO_KB_OUT05, - GPIO_KB_OUT06, - GPIO_KB_OUT07, - GPIO_KB_OUT08, - GPIO_KB_OUT09, - GPIO_KB_OUT10, - GPIO_KB_OUT11, - GPIO_KB_OUT12, - /* Unimplemented signals we emulate */ - GPIO_WP_L, - /* Number of GPIOs; not an actual GPIO */ - GPIO_COUNT -}; - -#endif /* !__ASSEMBLER__ */ - -#endif /* __BOARD_H */ diff --git a/board/daisy/build.mk b/board/daisy/build.mk deleted file mode 100644 index e471608873..0000000000 --- a/board/daisy/build.mk +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- -# 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. -# -# Board specific files build - -# the IC is STmicro STM32L151RBH6 -CHIP:=stm32 -CHIP_FAMILY:=stm32l -CHIP_VARIANT:=stm32l15x - -board-y=board.o diff --git a/board/daisy/ec.tasklist b/board/daisy/ec.tasklist deleted file mode 100644 index e2133fa1c0..0000000000 --- a/board/daisy/ec.tasklist +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/** - * List of enabled tasks in the priority order - * - * The first one has the lowest priority. - * - * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and - * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, - * where : - * 'n' in the name of the task - * 'r' in the main routine of the task - * 'd' in an opaque parameter passed to the routine at startup - * 's' is the stack size in bytes; must be a multiple of 8 - */ -#define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) diff --git a/board/kirby/battery.c b/board/kirby/battery.c deleted file mode 100644 index e57ac9b996..0000000000 --- a/board/kirby/battery.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 2013 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. - * - * Battery pack info for Kirby - */ - -#include "battery.h" - -/* Battery temperature ranges in degrees C */ -const struct battery_temperature_ranges bat_temp_ranges = { - .start_charging_min_c = 0, - .start_charging_max_c = 45, - .charging_min_c = 0, - .charging_max_c = 60, - .discharging_min_c = 0, - .discharging_max_c = 100, -}; - -static const struct battery_info info = { - /* - * max = 4.2V - * normal = 3.7V - * min = 3.0V - */ - .voltage_max = 4200, - .voltage_normal = 3700, - .voltage_min = 3000, - - /* Pre-charge current: I <= 0.01C */ - .precharge_current = 128, /* mA */ -}; - -const struct battery_info *battery_get_info(void) -{ - return &info; -} diff --git a/board/kirby/board.c b/board/kirby/board.c deleted file mode 100644 index 42241b308d..0000000000 --- a/board/kirby/board.c +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright (c) 2013 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. - */ -/* Kirby board-specific configuration */ - -#include "adc.h" -#include "adc_chip.h" -#include "common.h" -#include "chipset.h" -#include "extpower.h" -#include "gpio.h" -#include "hooks.h" -#include "i2c.h" -#include "keyboard_raw.h" -#include "lid_switch.h" -#include "pwm.h" -#include "pwm_chip.h" -#include "registers.h" -#include "spi.h" -#include "task.h" -#include "util.h" - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - -/* GPIO signal list. Must match order from enum gpio_signal. */ -const struct gpio_info gpio_list[] = { - /* Inputs with interrupt handlers are first for efficiency */ - {"KB_PWR_ON_L", GPIO_A, (1<<0), GPIO_INT_BOTH, power_interrupt}, - {"XPSHOLD", GPIO_E, (1<<5), GPIO_INT_RISING, power_interrupt}, - {"CHARGER_INT_L", GPIO_E, (1<<2), GPIO_INT_FALLING, - NULL /*pmu_irq_handler*/}, - {"USB_CHG_INT", GPIO_E, (1<<15), GPIO_INT_FALLING, - extpower_interrupt}, - {"USBPD_INT_L", GPIO_E, (1<<1), GPIO_INT_FALLING, - NULL /*extpower_interrupt*/}, - {"LID_OPEN", GPIO_E, (1<<6), GPIO_INT_BOTH, lid_interrupt}, - {"SUSPEND_L", GPIO_E, (1<<3), GPIO_INT_BOTH, power_interrupt}, - {"SPI1_NSS", GPIO_A, (1<<4), GPIO_INT_BOTH | GPIO_PULL_UP, - spi_event}, - {"AC_PRESENT_L", GPIO_A, (1<<1), GPIO_INT_BOTH, extpower_interrupt}, - {"KB_IN00", GPIO_E, (1<<7), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN01", GPIO_E, (1<<8), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN02", GPIO_E, (1<<9), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN03", GPIO_E, (1<<10), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN04", GPIO_E, (1<<11), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN05", GPIO_E, (1<<12), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN06", GPIO_E, (1<<13), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN07", GPIO_E, (1<<14), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - /* Other inputs */ - {"WP_L", GPIO_B, (1<<3), GPIO_INPUT, NULL}, - /* Outputs */ - {"CHARGER_EN_L", GPIO_B, (1<<8), GPIO_OUT_HIGH, NULL}, - {"EC_INT", GPIO_C, (1<<9), GPIO_ODR_HIGH, NULL}, - {"EC_INT2", GPIO_B, (1<<4), GPIO_ODR_HIGH, NULL}, - {"ID_MUX", GPIO_B, (1<<11), GPIO_ODR_LOW, NULL}, - {"BCHGR_OTG", GPIO_B, (1<<12), GPIO_OUT_LOW, NULL}, - {"BCHGR_PSEL", GPIO_B, (1<<14), GPIO_OUT_LOW, NULL}, - {"EN_PP3300", GPIO_C, (1<<11), GPIO_OUT_LOW, NULL}, - {"ENTERING_RW", GPIO_B, (1<<15), GPIO_OUT_LOW, NULL}, - {"BST_LED_EN", GPIO_C, (1<<10), GPIO_OUT_LOW, NULL}, - {"I2C1_SCL", GPIO_B, (1<<6), GPIO_ODR_HIGH, NULL}, - {"I2C1_SDA", GPIO_B, (1<<7), GPIO_ODR_HIGH, NULL}, - {"CHG_LED_Y", GPIO_C, (1<<6), GPIO_OUT_HIGH, NULL}, - {"CHG_LED_G", GPIO_C, (1<<7), GPIO_OUT_HIGH, NULL}, - {"CHG_LED_R", GPIO_C, (1<<8), GPIO_OUT_HIGH, NULL}, - {"PMIC_PWRON", GPIO_C, (1<<12), GPIO_OUT_LOW, NULL}, - {"KB_OUT00", GPIO_D, (1<<0), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT01", GPIO_D, (1<<1), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT02", GPIO_D, (1<<2), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT03", GPIO_D, (1<<3), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT04", GPIO_D, (1<<4), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT05", GPIO_D, (1<<5), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT06", GPIO_D, (1<<6), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT07", GPIO_D, (1<<7), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT08", GPIO_D, (1<<8), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT09", GPIO_D, (1<<9), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT10", GPIO_D, (1<<10), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT11", GPIO_D, (1<<11), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT12", GPIO_D, (1<<12), GPIO_KB_OUTPUT, NULL}, - /* - * TODO(crosbug.com/p/23802): These pins are never used for I2C on - * Kirby, but the I2C code won't currently compile unless they're - * defined. - */ - GPIO_SIGNAL_NOT_IMPLEMENTED("I2C2_SCL"), - GPIO_SIGNAL_NOT_IMPLEMENTED("I2C2_SDA"), -}; -BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); - -/* Pins with alternate functions */ -const struct gpio_alt_func gpio_alt_funcs[] = { - {GPIO_C, 0x01c0, GPIO_ALT_TIM3_4, MODULE_LED_KIRBY}, - {GPIO_A, 0x00f0, GPIO_ALT_SPI, MODULE_SPI}, - {GPIO_A, 0x0600, GPIO_ALT_USART, MODULE_UART}, - {GPIO_B, 0x00c0, GPIO_ALT_I2C, MODULE_I2C}, -}; -const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); - -/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ -const struct pwm_t pwm_channels[] = { - {STM32_TIM(3), STM32_TIM_CH(1), PWM_CONFIG_ACTIVE_LOW, - GPIO_CHG_LED_Y}, - {STM32_TIM(3), STM32_TIM_CH(2), PWM_CONFIG_ACTIVE_LOW, - GPIO_CHG_LED_G}, - {STM32_TIM(3), STM32_TIM_CH(3), PWM_CONFIG_ACTIVE_LOW, - GPIO_CHG_LED_R}, -}; -BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); - -/* ADC channels */ -const struct adc_t adc_channels[] = { - /* - * VBUS voltage sense pin. - * Sense pin 1.8V is converted to 4096. Accounting for the 3x - * voltage divider, the conversion factor is 5400mV/4096. - */ - [ADC_CH_USB_VBUS_SNS] = {"USB_VBUS_SNS", 5400, 4096, 0, STM32_AIN(12)}, - /* - * Micro USB D+ sense pin. Voltage divider = 2/3. - * Converted to mV (2700mV/4096). - */ - [ADC_CH_USB_DP_SNS] = {"USB_DP_SNS", 2700, 4096, 0, STM32_AIN(10)}, - /* Micro USB D- sense pin. Same scale as for D+. */ - [ADC_CH_USB_DN_SNS] = {"USB_DN_SNS", 2700, 4096, 0, STM32_AIN(11)}, -}; -BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); - -/* I2C ports */ -const struct i2c_port_t i2c_ports[] = { - {"master", I2C_PORT_MASTER, 100}, -}; -const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - -static void board_update_backlight(void) -{ - gpio_set_level(GPIO_BST_LED_EN, chipset_in_state(CHIPSET_STATE_ON) || - gpio_get_level(GPIO_LID_OPEN)); -} -DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_update_backlight, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_update_backlight, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_update_backlight, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_update_backlight, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_LID_CHANGE, board_update_backlight, HOOK_PRIO_DEFAULT); diff --git a/board/kirby/board.h b/board/kirby/board.h deleted file mode 100644 index 893730121c..0000000000 --- a/board/kirby/board.h +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* Kirby board configuration */ - -#ifndef __BOARD_H -#define __BOARD_H - -/* Optional features */ -#define CONFIG_BATTERY_BQ27541 -#define CONFIG_CHARGER -#define CONFIG_CHARGER_BQ24192 -#define CONFIG_CHARGER_EN_GPIO -#define CONFIG_CHARGER_EN_ACTIVE_LOW -#define CONFIG_ADC -#define CONFIG_ADC_CLOCK -#define CONFIG_CHIPSET_GAIA -#undef CONFIG_CHIPSET_HAS_PP1350 -#undef CONFIG_CHIPSET_HAS_PP5000 -#define CONFIG_EXTPOWER_KIRBY -#define CONFIG_HOST_COMMAND_STATUS -#define CONFIG_I2C -#define CONFIG_KEYBOARD_PROTOCOL_MKBP -#define CONFIG_SPI -#define CONFIG_PWM -#define CONFIG_USB_SWITCH_TSU6721 - -#ifndef __ASSEMBLER__ - -/* Keyboard output port list */ -#define KB_OUT_PORT_LIST GPIO_D - -/* Single I2C port, where the EC is the master. */ -#define I2C_PORT_MASTER 0 -#define I2C_PORT_BATTERY I2C_PORT_MASTER -#define I2C_PORT_CHARGER I2C_PORT_MASTER - -/* Timer selection */ -#define TIM_CLOCK_MSB 2 -#define TIM_CLOCK_LSB 9 -#define TIM_WATCHDOG 4 - -/* PWM signal */ -enum pwm_channel { - /* Y, G, R charging LEDs */ - PWM_CH_CHG_Y = 0, - PWM_CH_CHG_G, - PWM_CH_CHG_R, - - /* Number of PWM channels */ - PWM_CH_COUNT -}; - -/* ADC signals */ -enum adc_channel { - ADC_CH_USB_VBUS_SNS = 0, - ADC_CH_USB_DP_SNS, - ADC_CH_USB_DN_SNS, - /* Number of ADC channels */ - ADC_CH_COUNT -}; - -/* GPIO signal list */ -enum gpio_signal { - /* Inputs with interrupt handlers are first for efficiency */ - GPIO_KB_PWR_ON_L = 0, - GPIO_SOC1V8_XPSHOLD, - GPIO_CHARGER_INT_L, - GPIO_USB_CHG_INT, - GPIO_USBPD_INT_L, - GPIO_LID_OPEN, - GPIO_SUSPEND_L, - GPIO_SPI1_NSS, - GPIO_AC_PRESENT_L, - /* Keyboard inputs */ - GPIO_KB_IN00, - GPIO_KB_IN01, - GPIO_KB_IN02, - GPIO_KB_IN03, - GPIO_KB_IN04, - GPIO_KB_IN05, - GPIO_KB_IN06, - GPIO_KB_IN07, - /* Other inputs */ - GPIO_WP_L, - /* Outputs */ - GPIO_CHARGER_EN_L, - GPIO_EC_INT, - GPIO_EC_INT2, - GPIO_ID_MUX, - GPIO_BCHGR_OTG, - GPIO_BCHGR_PSEL, - GPIO_EN_PP3300, - GPIO_ENTERING_RW, - GPIO_BST_LED_EN, - GPIO_I2C1_SCL, - GPIO_I2C1_SDA, - GPIO_CHG_LED_Y, - GPIO_CHG_LED_G, - GPIO_CHG_LED_R, - GPIO_PMIC_PWRON, - GPIO_KB_OUT00, - GPIO_KB_OUT01, - GPIO_KB_OUT02, - GPIO_KB_OUT03, - GPIO_KB_OUT04, - GPIO_KB_OUT05, - GPIO_KB_OUT06, - GPIO_KB_OUT07, - GPIO_KB_OUT08, - GPIO_KB_OUT09, - GPIO_KB_OUT10, - GPIO_KB_OUT11, - GPIO_KB_OUT12, - /* Unimplemented */ - GPIO_I2C2_SCL, - GPIO_I2C2_SDA, - /* Number of GPIOs; not an actual GPIO */ - GPIO_COUNT -}; - -#endif /* !__ASSEMBLER__ */ - -#endif /* __BOARD_H */ diff --git a/board/kirby/build.mk b/board/kirby/build.mk deleted file mode 100644 index 315c86bdfe..0000000000 --- a/board/kirby/build.mk +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- -# Copyright (c) 2013 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. -# -# Board specific files build - -# the IC is STmicro STM32L151VB -CHIP:=stm32 -CHIP_FAMILY:=stm32l -CHIP_VARIANT:=stm32l15x - -board-y=board.o battery.o led.o diff --git a/board/kirby/ec.tasklist b/board/kirby/ec.tasklist deleted file mode 100644 index 49887281a1..0000000000 --- a/board/kirby/ec.tasklist +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/** - * List of enabled tasks in the priority order - * - * The first one has the lowest priority. - * - * For each task, use the macro TASK(n, r, d, s) where : - * 'n' in the name of the task - * 'r' in the main routine of the task - * 'd' in an opaque parameter passed to the routine at startup - * 's' is the stack size in bytes; must be a multiple of 8 - */ -#define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) diff --git a/board/kirby/led.c b/board/kirby/led.c deleted file mode 100644 index 53f11d10db..0000000000 --- a/board/kirby/led.c +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (c) 2013 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. - * - * Kirby LED driver. - */ - -#include "charge_state.h" -#include "common.h" -#include "console.h" -#include "extpower.h" -#include "gpio.h" -#include "hooks.h" -#include "host_command.h" -#include "pwm.h" -#include "util.h" - -/* Brightness of each color. Range = 0 - 100. */ -#define BRIGHTNESS_RED 50 -#define BRIGHTNESS_GREEN 25 -#define BRIGHTNESS_YELLOW 50 - -static int led_auto_control = 1; - -void led_set_color(uint8_t red, uint8_t green, uint8_t yellow) -{ - if (!yellow) - pwm_enable(PWM_CH_CHG_Y, 0); - if (!green) - pwm_enable(PWM_CH_CHG_G, 0); - if (!red) - pwm_enable(PWM_CH_CHG_R, 0); - - /* Only allow one color of LED */ - if (yellow) { - pwm_enable(PWM_CH_CHG_Y, 1); - pwm_set_duty(PWM_CH_CHG_Y, yellow); - } else if (green) { - pwm_enable(PWM_CH_CHG_G, 1); - pwm_set_duty(PWM_CH_CHG_G, green); - } else if (red) { - pwm_enable(PWM_CH_CHG_R, 1); - pwm_set_duty(PWM_CH_CHG_R, red); - } else { - gpio_config_module(MODULE_LED_KIRBY, 0); - gpio_set_level(GPIO_CHG_LED_Y, 0); - gpio_set_level(GPIO_CHG_LED_G, 0); - gpio_set_level(GPIO_CHG_LED_R, 0); - } -} - -static void led_update_color(void) -{ - enum power_state state = charge_get_state(); - - if (!led_auto_control) - return; - - /* check ac. no ac -> off */ - if (!extpower_is_present()) { - led_set_color(0, 0, 0); - return; - } - - switch (state) { - case PWR_STATE_CHARGE: - led_set_color(0, 0, BRIGHTNESS_YELLOW); - break; - case PWR_STATE_IDLE: - case PWR_STATE_CHARGE_NEAR_FULL: - led_set_color(0, BRIGHTNESS_GREEN, 0); - break; - case PWR_STATE_ERROR: - led_set_color(BRIGHTNESS_RED, 0, 0); - break; - case PWR_STATE_INIT: - case PWR_STATE_UNCHANGE: - case PWR_STATE_IDLE0: - case PWR_STATE_REINIT: - case PWR_STATE_DISCHARGE: - break; - } -} -DECLARE_HOOK(HOOK_INIT, led_update_color, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_AC_CHANGE, led_update_color, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_CHARGE_STATE_CHANGE, led_update_color, HOOK_PRIO_DEFAULT); - -/*****************************************************************************/ -/* Host commands */ - -static int led_command_control(struct host_cmd_handler_args *args) -{ - const struct ec_params_led_control *p = args->params; - struct ec_response_led_control *r = args->response; - int i; - uint8_t clipped[EC_LED_COLOR_COUNT]; - - /* Only support battery LED control */ - if (p->led_id != EC_LED_ID_BATTERY_LED) - return EC_RES_INVALID_PARAM; - - if (p->flags & EC_LED_FLAGS_AUTO) { - led_auto_control = 1; - led_update_color(); - } else if (!(p->flags & EC_LED_FLAGS_QUERY)) { - for (i = 0; i < EC_LED_COLOR_COUNT; ++i) - clipped[i] = MIN(p->brightness[i], 100); - led_auto_control = 0; - led_set_color(clipped[EC_LED_COLOR_RED], - clipped[EC_LED_COLOR_GREEN], - clipped[EC_LED_COLOR_YELLOW]); - } - - r->brightness_range[EC_LED_COLOR_RED] = 100; - r->brightness_range[EC_LED_COLOR_GREEN] = 100; - r->brightness_range[EC_LED_COLOR_BLUE] = 0; - r->brightness_range[EC_LED_COLOR_YELLOW] = 100; - r->brightness_range[EC_LED_COLOR_WHITE] = 0; - args->response_size = sizeof(struct ec_response_led_control); - - return EC_RES_SUCCESS; -} -DECLARE_HOST_COMMAND(EC_CMD_LED_CONTROL, - led_command_control, - EC_VER_MASK(1)); - -/*****************************************************************************/ -/* Console commands */ - -static int command_led(int argc, char **argv) -{ - char *e; - uint8_t brightness; - - if (argc != 3) - return EC_ERROR_PARAM_COUNT; - - brightness = strtoi(argv[2], &e, 0); - if ((e && *e) || brightness < 0 || brightness > 100) - return EC_ERROR_PARAM2; - - if (!strcasecmp(argv[1], "r")) - led_set_color(brightness, 0, 0); - else if (!strcasecmp(argv[1], "g")) - led_set_color(0, brightness, 0); - else if (!strcasecmp(argv[1], "y")) - led_set_color(0, 0, brightness); - else - return EC_ERROR_PARAM1; - - return EC_SUCCESS; -} -DECLARE_CONSOLE_COMMAND(led, command_led, - "<r | g | y> <brightness>", - "Set the color and brightness of the LED", - NULL); diff --git a/board/puppy/board.c b/board/puppy/board.c deleted file mode 100644 index 634dae0ccb..0000000000 --- a/board/puppy/board.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright (c) 2013 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. - */ -/* Puppy board-specific configuration */ - -#include "battery.h" -#include "chipset.h" -#include "common.h" -#include "extpower.h" -#include "gpio.h" -#include "i2c.h" -#include "keyboard_raw.h" -#include "lid_switch.h" -#include "pmu_tpschrome.h" -#include "pwm.h" -#include "pwm_chip.h" -#include "registers.h" -#include "spi.h" -#include "task.h" -#include "util.h" - -#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_ODR_HIGH - -/* GPIO signal list. Must match order from enum gpio_signal. */ -const struct gpio_info gpio_list[] = { - /* Inputs with interrupt handlers are first for efficiency */ - {"KB_PWR_ON_L", GPIO_B, (1<<5), GPIO_INT_BOTH, power_interrupt}, - {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, power_interrupt}, - {"XPSHOLD", GPIO_A, (1<<3), GPIO_INT_BOTH, power_interrupt}, - {"CHARGER_INT_L", GPIO_C, (1<<6), GPIO_INT_FALLING, pmu_irq_handler}, - {"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, lid_interrupt}, - {"SUSPEND_L", GPIO_C, (1<<7), GPIO_KB_INPUT, power_interrupt}, - {"SPI1_NSS", GPIO_A, (1<<4), GPIO_INT_BOTH | GPIO_PULL_UP, - spi_event}, - {"AC_PRESENT", GPIO_A, (1<<0), GPIO_INT_BOTH, extpower_interrupt}, - {"KB_IN00", GPIO_C, (1<<8), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN01", GPIO_C, (1<<9), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN02", GPIO_C, (1<<10), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN03", GPIO_C, (1<<11), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN04", GPIO_C, (1<<12), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN05", GPIO_C, (1<<14), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN06", GPIO_C, (1<<15), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - {"KB_IN07", GPIO_D, (1<<2), GPIO_KB_INPUT, - keyboard_raw_gpio_interrupt}, - /* Other inputs */ - {"WP_L", GPIO_B, (1<<4), GPIO_INPUT, NULL}, - /* Outputs */ - {"AP_RESET_L", GPIO_B, (1<<3), GPIO_OUT_HIGH, NULL}, - {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_ODR_HIGH, NULL}, - {"EN_PP1350", GPIO_H, (1<<1), GPIO_OUT_LOW, NULL}, - {"EN_PP3300", GPIO_A, (1<<8), GPIO_OUT_LOW, NULL}, - {"EN_PP5000", GPIO_A, (1<<11), GPIO_OUT_LOW, NULL}, - {"ENTERING_RW", GPIO_H, (1<<0), GPIO_OUT_LOW, NULL}, - {"I2C1_SCL", GPIO_B, (1<<6), GPIO_ODR_HIGH, NULL}, - {"I2C1_SDA", GPIO_B, (1<<7), GPIO_ODR_HIGH, NULL}, - {"I2C2_SCL", GPIO_B, (1<<10), GPIO_ODR_HIGH, NULL}, - {"I2C2_SDA", GPIO_B, (1<<11), GPIO_ODR_HIGH, NULL}, - {"LED_POWER_L", GPIO_A, (1<<2), GPIO_OUT_HIGH, NULL}, - {"PMIC_PWRON_L", GPIO_A, (1<<12), GPIO_OUT_HIGH, NULL}, - {"PMIC_RESET", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL}, - {"KB_OUT00", GPIO_B, (1<<0), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT01", GPIO_B, (1<<8), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT02", GPIO_B, (1<<12), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT03", GPIO_B, (1<<13), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT04", GPIO_B, (1<<14), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT05", GPIO_B, (1<<15), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT06", GPIO_C, (1<<0), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT07", GPIO_C, (1<<1), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT08", GPIO_C, (1<<2), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT09", GPIO_B, (1<<1), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT10", GPIO_C, (1<<5), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT11", GPIO_C, (1<<4), GPIO_KB_OUTPUT, NULL}, - {"KB_OUT12", GPIO_A, (1<<13), GPIO_KB_OUTPUT, NULL}, -}; -BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); - -/* Pins with alternate functions */ -const struct gpio_alt_func gpio_alt_funcs[] = { - {GPIO_A, 0x0004, GPIO_ALT_TIM2, MODULE_POWER_LED}, - {GPIO_A, 0x00f0, GPIO_ALT_SPI, MODULE_SPI}, - {GPIO_A, 0x0600, GPIO_ALT_USART, MODULE_UART}, - {GPIO_B, 0x0cc0, GPIO_ALT_I2C, MODULE_I2C}, -}; -const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); - -/* Battery temperature ranges in degrees C */ -const struct battery_temperature_ranges bat_temp_ranges = { - .start_charging_min_c = 5, - .start_charging_max_c = 45, - .charging_min_c = 5, - .charging_max_c = 60, - .discharging_min_c = 0, - .discharging_max_c = 100, -}; - -/* I2C ports */ -const struct i2c_port_t i2c_ports[] = { - {"master", I2C_PORT_MASTER, 100}, -}; -const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - -/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ -const struct pwm_t pwm_channels[] = { - {STM32_TIM(2), STM32_TIM_CH(3), - PWM_CONFIG_ACTIVE_LOW, GPIO_LED_POWER_L}, -}; -BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); - -int pmu_board_init(void) -{ - int ver, failure = 0; - - /* Set fast charging timeout to 6 hours*/ - if (!failure) - failure = pmu_set_fastcharge(TIMEOUT_6HRS); - /* Enable external gpio CHARGER_EN control */ - if (!failure) - failure = pmu_enable_ext_control(1); - /* Disable force charging */ - if (!failure) - failure = pmu_enable_charger(0); - - /* Set NOITERM bit */ - if (!failure) - failure = pmu_low_current_charging(1); - - /* - * High temperature charging - * termination voltage: 2.1V - * termination current: 100% - */ - if (!failure) - failure = pmu_set_term_voltage(RANGE_T34, TERM_V2100); - if (!failure) - failure = pmu_set_term_current(RANGE_T34, TERM_I1000); - /* - * Standard temperature charging - * termination voltage: 2.1V - * termination current: 100% - */ - if (!failure) - failure = pmu_set_term_voltage(RANGE_T23, TERM_V2100); - if (!failure) - failure = pmu_set_term_current(RANGE_T23, TERM_I1000); - - /* - * Ignore TPSCHROME NTC reading in T40. This is snow board specific - * setting. Check: - * http://crosbug.com/p/12221 - * http://crosbug.com/p/13171 - */ - if (!failure) - failure = pmu_set_term_voltage(RANGE_T40, TERM_V2100); - if (!failure) - failure = pmu_set_term_current(RANGE_T40, TERM_I1000); - - /* Workaround init values before ES3 */ - if (pmu_version(&ver) || ver < 3) { - /* Termination current: 75% */ - if (!failure) - failure = pmu_set_term_current(RANGE_T34, TERM_I0750); - if (!failure) - failure = pmu_set_term_current(RANGE_T23, TERM_I0750); - if (!failure) - failure = pmu_set_term_current(RANGE_T40, TERM_I0750); - } - - return failure ? EC_ERROR_UNKNOWN : EC_SUCCESS; -} diff --git a/board/puppy/board.h b/board/puppy/board.h deleted file mode 100644 index 5e0b18a3b6..0000000000 --- a/board/puppy/board.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* Puppy board configuration */ - -#ifndef __BOARD_H -#define __BOARD_H - -/* Optional features */ -#define CONFIG_BATTERY_BQ20Z453 -#define CONFIG_BATTERY_SMART -#define CONFIG_CHARGER_TPS65090 -#define CONFIG_CHIPSET_GAIA -#define CONFIG_CMD_PMU -#define CONFIG_EXTPOWER_GPIO -#define CONFIG_HOST_COMMAND_STATUS -#define CONFIG_I2C -#define CONFIG_KEYBOARD_PROTOCOL_MKBP -#define CONFIG_PMU_HARD_RESET -#define CONFIG_PMU_TPS65090 -#define CONFIG_SPI -#define CONFIG_PWM - -#ifndef __ASSEMBLER__ - -/* Keyboard output port list */ -#define KB_OUT_PORT_LIST GPIO_A, GPIO_B, GPIO_C - -/* Single I2C port, where the EC is the master. */ -#define I2C_PORT_MASTER 0 -#define I2C_PORT_BATTERY I2C_PORT_MASTER -#define I2C_PORT_CHARGER I2C_PORT_MASTER - -/* Timer selection */ -#define TIM_CLOCK_MSB 3 -#define TIM_CLOCK_LSB 9 -#define TIM_POWER_LED 2 -#define TIM_WATCHDOG 4 - -/* GPIO signal list */ -enum gpio_signal { - /* Inputs with interrupt handlers are first for efficiency */ - GPIO_KB_PWR_ON_L = 0, - GPIO_PP1800_LDO2, - GPIO_SOC1V8_XPSHOLD, - GPIO_CHARGER_INT_L, - GPIO_LID_OPEN, - GPIO_SUSPEND_L, - GPIO_SPI1_NSS, - GPIO_AC_PRESENT, - /* Keyboard inputs */ - GPIO_KB_IN00, - GPIO_KB_IN01, - GPIO_KB_IN02, - GPIO_KB_IN03, - GPIO_KB_IN04, - GPIO_KB_IN05, - GPIO_KB_IN06, - GPIO_KB_IN07, - /* Other inputs */ - GPIO_WP_L, - /* Outputs */ - GPIO_AP_RESET_L, - GPIO_CHARGER_EN, - GPIO_EC_INT, - GPIO_EN_PP1350, - GPIO_EN_PP3300, - GPIO_EN_PP5000, - GPIO_ENTERING_RW, - GPIO_I2C1_SCL, - GPIO_I2C1_SDA, - GPIO_I2C2_SCL, - GPIO_I2C2_SDA, - GPIO_LED_POWER_L, - GPIO_PMIC_PWRON_L, - GPIO_PMIC_RESET, - GPIO_KB_OUT00, - GPIO_KB_OUT01, - GPIO_KB_OUT02, - GPIO_KB_OUT03, - GPIO_KB_OUT04, - GPIO_KB_OUT05, - GPIO_KB_OUT06, - GPIO_KB_OUT07, - GPIO_KB_OUT08, - GPIO_KB_OUT09, - GPIO_KB_OUT10, - GPIO_KB_OUT11, - GPIO_KB_OUT12, - /* Number of GPIOs; not an actual GPIO */ - GPIO_COUNT -}; - -enum pwm_channel { - PWM_CH_POWER_LED = 0, - /* Number of PWM channels */ - PWM_CH_COUNT -}; - -#endif /* !__ASSEMBLER__ */ - -#endif /* __BOARD_H */ diff --git a/board/puppy/build.mk b/board/puppy/build.mk deleted file mode 100644 index 8de1b957d3..0000000000 --- a/board/puppy/build.mk +++ /dev/null @@ -1,13 +0,0 @@ -# -*- makefile -*- -# Copyright (c) 2013 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. -# -# Board specific files build - -# the IC is STmicro STM32L151R8H6 -CHIP:=stm32 -CHIP_FAMILY:=stm32l -CHIP_VARIANT:=stm32l15x - -board-y=board.o diff --git a/board/puppy/ec.tasklist b/board/puppy/ec.tasklist deleted file mode 100644 index 448879d105..0000000000 --- a/board/puppy/ec.tasklist +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/** - * List of enabled tasks in the priority order - * - * The first one has the lowest priority. - * - * For each task, use the macro TASK(n, r, d, s) where : - * 'n' in the name of the task - * 'r' in the main routine of the task - * 'd' in an opaque parameter passed to the routine at startup - * 's' is the stack size in bytes; must be a multiple of 8 - */ -#define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(POWERLED, power_led_task, NULL, 256) \ - TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) diff --git a/board/slippy/battery.c b/board/slippy/battery.c deleted file mode 100644 index 1e2671bb97..0000000000 --- a/board/slippy/battery.c +++ /dev/null @@ -1,42 +0,0 @@ -/* 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. - * - * Battery pack vendor provided charging profile - */ - -#include "battery.h" -#include "gpio.h" - -/* Reasonable temperature thresholds, since we didn't get vendor data */ -const struct battery_temperature_ranges bat_temp_ranges = { - .start_charging_min_c = 0, - .start_charging_max_c = 50, - .charging_min_c = 0, - .charging_max_c = 50, - .discharging_min_c = -20, - .discharging_max_c = 60, -}; - -static const struct battery_info info = { - - .voltage_max = 16800, - .voltage_normal = 14800, - .voltage_min = 10800, - - /* Pre-charge values. */ - .precharge_current = 256, /* mA */ -}; - -const struct battery_info *battery_get_info(void) -{ - return &info; -} - -/** - * Physical detection of battery connection. - */ -int battery_is_connected(void) -{ - return (gpio_get_level(GPIO_BAT_DETECT_L) == 0); -} diff --git a/board/slippy/board.c b/board/slippy/board.c deleted file mode 100644 index 9a1fc697ed..0000000000 --- a/board/slippy/board.c +++ /dev/null @@ -1,248 +0,0 @@ -/* Copyright (c) 2013 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. - */ -/* EC for Slippy board configuration */ - -#include "adc.h" -#include "adc_chip.h" -#include "backlight.h" -#include "chipset.h" -#include "chipset_x86_common.h" -#include "common.h" -#include "driver/temp_sensor/g781.h" -#include "extpower.h" -#include "fan.h" -#include "gpio.h" -#include "host_command.h" -#include "i2c.h" -#include "jtag.h" -#include "keyboard_scan.h" -#include "lid_switch.h" -#include "peci.h" -#include "power_button.h" -#include "registers.h" -#include "switch.h" -#include "temp_sensor.h" -#include "temp_sensor_chip.h" -#include "thermal.h" -#include "timer.h" -#include "uart.h" -#include "util.h" - -/* GPIO signal list. Must match order from enum gpio_signal. */ -const struct gpio_info gpio_list[] = { - /* Inputs with interrupt handlers are first for efficiency */ - {"POWER_BUTTON_L", LM4_GPIO_A, (1<<2), GPIO_INT_BOTH_DSLEEP, - power_button_interrupt}, - {"LID_OPEN", LM4_GPIO_A, (1<<3), GPIO_INT_BOTH_DSLEEP, - lid_interrupt}, - {"AC_PRESENT", LM4_GPIO_H, (1<<3), GPIO_INT_BOTH_DSLEEP, - extpower_interrupt}, - {"PCH_BKLTEN", LM4_GPIO_M, (1<<3), GPIO_INT_BOTH, - backlight_interrupt}, - {"PCH_SLP_S0_L", LM4_GPIO_G, (1<<6), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_SLP_S3_L", LM4_GPIO_G, (1<<7), GPIO_INT_BOTH_DSLEEP, - x86_interrupt}, - {"PCH_SLP_S5_L", LM4_GPIO_H, (1<<1), GPIO_INT_BOTH_DSLEEP, - x86_interrupt}, - {"PCH_SLP_SUS_L", LM4_GPIO_G, (1<<3), GPIO_INT_BOTH, - x86_interrupt}, - {"PP1050_PGOOD", LM4_GPIO_H, (1<<4), GPIO_INT_BOTH, - x86_interrupt}, - {"PP1350_PGOOD", LM4_GPIO_H, (1<<6), GPIO_INT_BOTH, - x86_interrupt}, - {"PP5000_PGOOD", LM4_GPIO_N, (1<<0), GPIO_INT_BOTH, - x86_interrupt}, - {"VCORE_PGOOD", LM4_GPIO_C, (1<<6), GPIO_INT_BOTH, - x86_interrupt}, - {"PCH_EDP_VDD_EN", LM4_GPIO_J, (1<<1), GPIO_INT_BOTH, - power_interrupt}, - {"RECOVERY_L", LM4_GPIO_A, (1<<5), GPIO_PULL_UP|GPIO_INT_BOTH, - switch_interrupt}, - {"WP_L", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH, - switch_interrupt}, - {"JTAG_TCK", LM4_GPIO_C, (1<<0), GPIO_DEFAULT, - jtag_interrupt}, - {"UART0_RX", LM4_GPIO_A, (1<<0), GPIO_PULL_UP| - GPIO_INT_BOTH_DSLEEP, - uart_deepsleep_interrupt}, - - /* Other inputs */ - {"FAN_ALERT_L", LM4_GPIO_B, (1<<0), GPIO_INPUT, NULL}, - {"PCH_SUSWARN_L", LM4_GPIO_G, (1<<2), GPIO_INT_BOTH, NULL}, - {"USB1_OC_L", LM4_GPIO_E, (1<<7), GPIO_INPUT, NULL}, - {"USB2_OC_L", LM4_GPIO_E, (1<<0), GPIO_INPUT, NULL}, - {"BOARD_VERSION1", LM4_GPIO_Q, (1<<5), GPIO_INPUT, NULL}, - {"BOARD_VERSION2", LM4_GPIO_Q, (1<<6), GPIO_INPUT, NULL}, - {"BOARD_VERSION3", LM4_GPIO_Q, (1<<7), GPIO_INPUT, NULL}, - {"CPU_PGOOD", LM4_GPIO_C, (1<<4), GPIO_INPUT, NULL}, - {"BAT_DETECT_L", LM4_GPIO_B, (1<<4), GPIO_INPUT, NULL}, - - /* Outputs; all unasserted by default except for reset signals */ - {"CPU_PROCHOT", LM4_GPIO_B, (1<<1), GPIO_OUT_LOW, NULL}, - {"PP1350_EN", LM4_GPIO_H, (1<<5), GPIO_OUT_LOW, NULL}, - {"PP3300_DSW_GATED_EN", LM4_GPIO_J, (1<<3), GPIO_OUT_LOW, NULL}, - {"PP3300_DX_EN", LM4_GPIO_J, (1<<2), GPIO_OUT_LOW, NULL}, - {"PP3300_LTE_EN", LM4_GPIO_D, (1<<2), GPIO_OUT_LOW, NULL}, - {"PP3300_WLAN_EN", LM4_GPIO_J, (1<<0), GPIO_OUT_LOW, NULL}, - {"SUSP_VR_EN", LM4_GPIO_C, (1<<7), GPIO_OUT_LOW, NULL}, - {"VCORE_EN", LM4_GPIO_C, (1<<5), GPIO_OUT_LOW, NULL}, - {"PP5000_EN", LM4_GPIO_H, (1<<7), GPIO_OUT_LOW, NULL}, - {"SYS_PWROK", LM4_GPIO_H, (1<<2), GPIO_OUT_LOW, NULL}, - {"WLAN_OFF_L", LM4_GPIO_J, (1<<4), GPIO_OUT_LOW, NULL}, - {"CHARGE_L", LM4_GPIO_E, (1<<6), GPIO_OUT_LOW, NULL}, - - {"ENABLE_BACKLIGHT", LM4_GPIO_M, (1<<7), GPIO_OUT_LOW, NULL}, - {"ENABLE_TOUCHPAD", LM4_GPIO_N, (1<<1), GPIO_OUT_LOW, NULL}, - {"ENTERING_RW", LM4_GPIO_D, (1<<3), GPIO_OUT_LOW, NULL}, - {"PCH_DPWROK", LM4_GPIO_G, (1<<0), GPIO_OUT_LOW, NULL}, - /* - * HDA_SDO is technically an output, but we need to leave it as an - * input until we drive it high. So can't use open-drain (HI_Z). - */ - {"PCH_HDA_SDO", LM4_GPIO_G, (1<<1), GPIO_INPUT, NULL}, - {"PCH_WAKE_L", LM4_GPIO_F, (1<<0), GPIO_OUT_HIGH, NULL}, - {"PCH_NMI_L", LM4_GPIO_F, (1<<2), GPIO_OUT_HIGH, NULL}, - {"PCH_PWRBTN_L", LM4_GPIO_H, (1<<0), GPIO_OUT_HIGH, NULL}, - {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, - /* - * PL6 is one of 4 pins on the EC which can't be used in open-drain - * mode. To work around this PCH_RCIN_L is set to an input. It will - * only be set to an output when it needs to be driven to 0. - */ - {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_INPUT, NULL}, - {"PCH_RSMRST_L", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, - {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_ODR_HIGH, NULL}, - {"TOUCHSCREEN_RESET_L", LM4_GPIO_N, (1<<7), GPIO_OUT_LOW, NULL}, - {"EC_EDP_VDD_EN", LM4_GPIO_J, (1<<5), GPIO_OUT_LOW, NULL}, - - {"LPC_CLKRUN_L", LM4_GPIO_M, (1<<2), GPIO_ODR_HIGH, NULL}, - {"USB1_ENABLE", LM4_GPIO_E, (1<<4), GPIO_OUT_LOW, NULL}, - {"USB2_ENABLE", LM4_GPIO_D, (1<<5), GPIO_OUT_LOW, NULL}, - - {"PCH_SUSACK_L", LM4_GPIO_F, (1<<3), GPIO_OUT_HIGH, NULL}, - {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_ODR_HIGH, NULL}, - {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_ODR_HIGH, NULL}, - - {"BAT_LED0_L", LM4_GPIO_N, (1<<6), GPIO_ODR_HIGH, NULL}, - {"BAT_LED1_L", LM4_GPIO_N, (1<<4), GPIO_ODR_HIGH, NULL}, -}; -BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); - -/* Pins with alternate functions */ -const struct gpio_alt_func gpio_alt_funcs[] = { - {GPIO_A, 0x03, 1, MODULE_UART, GPIO_PULL_UP}, /* UART0 */ - {GPIO_B, 0x04, 3, MODULE_I2C}, /* I2C0 SCL */ - {GPIO_B, 0x08, 3, MODULE_I2C, GPIO_OPEN_DRAIN}, /* I2C0 SDA */ - {GPIO_B, 0x40, 3, MODULE_I2C}, /* I2C5 SCL */ - {GPIO_B, 0x80, 3, MODULE_I2C, GPIO_OPEN_DRAIN}, /* I2C5 SDA */ - {GPIO_G, 0x30, 1, MODULE_UART}, /* UART2 */ - {GPIO_J, 0x40, 1, MODULE_PECI}, /* PECI Tx */ - {GPIO_J, 0x80, 0, MODULE_PECI, GPIO_ANALOG}, /* PECI Rx */ - {GPIO_L, 0x3f, 15, MODULE_LPC}, /* LPC */ - {GPIO_M, 0x33, 15, MODULE_LPC}, /* LPC */ - {GPIO_N, 0x0c, 1, MODULE_PWM_FAN}, /* FAN0PWM2 */ -}; -const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); - -/* x86 signal list. Must match order of enum x86_signal. */ -const struct x86_signal_info x86_signal_list[] = { - {GPIO_PP5000_PGOOD, 1, "PGOOD_PP5000"}, - {GPIO_PP1350_PGOOD, 1, "PGOOD_PP1350"}, - {GPIO_PP1050_PGOOD, 1, "PGOOD_PP1050"}, - {GPIO_VCORE_PGOOD, 1, "PGOOD_VCORE"}, - {GPIO_PCH_SLP_S0_L, 1, "SLP_S0#_DEASSERTED"}, - {GPIO_PCH_SLP_S3_L, 1, "SLP_S3#_DEASSERTED"}, - {GPIO_PCH_SLP_S5_L, 1, "SLP_S5#_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, 1, "SLP_SUS#_DEASSERTED"}, -}; -BUILD_ASSERT(ARRAY_SIZE(x86_signal_list) == X86_SIGNAL_COUNT); - -/* ADC channels. Must be in the exactly same order as in enum adc_channel. */ -const struct adc_t adc_channels[] = { - /* EC internal temperature is calculated by - * 273 + (295 - 450 * ADC_VALUE / ADC_READ_MAX) / 2 - * = -225 * ADC_VALUE / ADC_READ_MAX + 420.5 - */ - {"ECTemp", LM4_ADC_SEQ0, -225, ADC_READ_MAX, 420, - LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0}, - - /* IOUT == ICMNT is on PE3/AIN0 */ - /* We have 0.01-ohm resistors, and IOUT is 20X the differential - * voltage, so 1000mA ==> 200mV. - * ADC returns 0x000-0xFFF, which maps to 0.0-3.3V (as configured). - * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 200 - */ - {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 2, 0, - LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, -}; -BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); - -/* Physical fans. These are logically separate from pwm_channels. */ -const struct fan_t fans[] = { - {.flags = FAN_USE_RPM_MODE, - .rpm_min = 1000, - .rpm_max = 5050, - .ch = 2, - .pgood_gpio = GPIO_PP5000_PGOOD, - .enable_gpio = -1, - }, -}; -BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); - -/* I2C ports */ -const struct i2c_port_t i2c_ports[] = { - {"batt_chg", 0, 100}, - {"thermal", 5, 100}, -}; -const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); - -/* Temperature sensors data; must be in same order as enum temp_sensor_id. */ -const struct temp_sensor_t temp_sensors[] = { - {"PECI", TEMP_SENSOR_TYPE_CPU, peci_temp_sensor_get_val, 0, 2}, - {"ECInternal", TEMP_SENSOR_TYPE_BOARD, chip_temp_sensor_get_val, 0, 4}, - {"G781Internal", TEMP_SENSOR_TYPE_BOARD, g781_get_val, - G781_IDX_INTERNAL, 4}, - {"G781External", TEMP_SENSOR_TYPE_BOARD, g781_get_val, - G781_IDX_EXTERNAL, 4}, -}; -BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); - -/* Thermal limits for each temp sensor. All temps are in degrees K. Must be in - * same order as enum temp_sensor_id. To always ignore any temp, use 0. - */ -struct ec_thermal_config thermal_params[] = { - /* Only the AP affects the thermal limits and fan speed. */ - {{C_TO_K(100), C_TO_K(114), C_TO_K(110)}, C_TO_K(60), C_TO_K(90)}, - {{0, 0, 0}, 0, 0}, - {{0, 0, 0}, 0, 0}, - {{0, 0, 0}, 0, 0}, -}; -BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); - -struct keyboard_scan_config keyscan_config = { - .output_settle_us = 40, - .debounce_down_us = 6 * MSEC, - .debounce_up_us = 30 * MSEC, - .scan_period_us = 1500, - .min_post_scan_delay_us = 1000, - .poll_timeout_us = SECOND, - .actual_key_mask = { - 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, - 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ - }, -}; - -/** - * Discharge battery when on AC power for factory test. - */ -int board_discharge_on_ac(int enable) -{ - if (enable) - gpio_set_level(GPIO_CHARGE_L, 1); - else - gpio_set_level(GPIO_CHARGE_L, 0); - return EC_SUCCESS; -} diff --git a/board/slippy/board.h b/board/slippy/board.h deleted file mode 100644 index 4c73481eca..0000000000 --- a/board/slippy/board.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* Configuration for Slippy mainboard */ - -#ifndef __BOARD_H -#define __BOARD_H - -/* Optional features */ -#define CONFIG_BACKLIGHT_LID -#define CONFIG_BACKLIGHT_REQ_GPIO GPIO_PCH_BKLTEN -#define CONFIG_BATTERY_CHECK_CONNECTED -#define CONFIG_BATTERY_SMART -#define CONFIG_BOARD_VERSION -#define CONFIG_CHARGER -#define CONFIG_CHARGER_BQ24707A -#define CONFIG_CHARGER_DISCHARGE_ON_AC -#define CONFIG_CHIPSET_CAN_THROTTLE -#define CONFIG_CHIPSET_HASWELL -#define CONFIG_CHIPSET_X86 -#define CONFIG_CMD_GSV -#define CONFIG_EXTPOWER_GPIO -#define CONFIG_FANS 1 -#define CONFIG_KEYBOARD_BOARD_CONFIG -#define CONFIG_KEYBOARD_PROTOCOL_8042 -#define CONFIG_LOW_POWER_IDLE -#define CONFIG_POWER_BUTTON -#define CONFIG_POWER_BUTTON_X86 -#define CONFIG_SWITCH_DEDICATED_RECOVERY -#define CONFIG_TEMP_SENSOR -#define CONFIG_TEMP_SENSOR_G781 -#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_PP3300_DX_EN -#define CONFIG_UART_HOST 2 -#define CONFIG_USB_PORT_POWER_DUMB -#define CONFIG_WIRELESS - -#ifndef __ASSEMBLER__ - -/* I2C ports */ -#define I2C_PORT_BATTERY 0 -#define I2C_PORT_CHARGER 0 -#define I2C_PORT_THERMAL 5 - -/* 13x8 keyboard scanner uses an entire GPIO bank for row inputs */ -#define KB_SCAN_ROW_IRQ LM4_IRQ_GPIOK -#define KB_SCAN_ROW_GPIO LM4_GPIO_K - -/* Host connects to keyboard controller module via LPC */ -#define HOST_KB_BUS_LPC - -/* USB ports */ -#define USB_PORT_COUNT 2 - -/* GPIO signal definitions. */ -enum gpio_signal { - /* Inputs with interrupt handlers are first for efficiency */ - GPIO_POWER_BUTTON_L = 0, /* Power button */ - GPIO_LID_OPEN, /* Lid switch */ - GPIO_AC_PRESENT, /* AC power present */ - GPIO_PCH_BKLTEN, /* Backlight enable signal from PCH */ - GPIO_PCH_SLP_S0_L, /* SLP_S0# signal from PCH */ - GPIO_PCH_SLP_S3_L, /* SLP_S3# signal from PCH */ - GPIO_PCH_SLP_S5_L, /* SLP_S5# signal from PCH */ - GPIO_PCH_SLP_SUS_L, /* SLP_SUS# signal from PCH */ - GPIO_PP1050_PGOOD, /* Power good on 1.05V */ - GPIO_PP1350_PGOOD, /* Power good on 1.35V (DRAM) */ - GPIO_PP5000_PGOOD, /* Power good on 5V */ - GPIO_VCORE_PGOOD, /* Power good on core VR */ - GPIO_PCH_EDP_VDD_EN, /* PCH wants EDP enabled */ - GPIO_RECOVERY_L, /* Recovery signal from servo */ - GPIO_WP_L, /* Write protect input */ - GPIO_JTAG_TCK, /* JTAG clock input */ - GPIO_UART0_RX, /* UART0 RX input */ - - /* Other inputs */ - GPIO_FAN_ALERT_L, /* From thermal sensor */ - GPIO_PCH_SUSWARN_L, /* SUSWARN# signal from PCH */ - GPIO_USB1_OC_L, /* USB port overcurrent warning */ - GPIO_USB2_OC_L, /* USB port overcurrent warning */ - GPIO_BOARD_VERSION1, /* Board version stuffing resistor 1 */ - GPIO_BOARD_VERSION2, /* Board version stuffing resistor 2 */ - GPIO_BOARD_VERSION3, /* Board version stuffing resistor 3 */ - GPIO_CPU_PGOOD, /* Power good to the CPU */ - GPIO_BAT_DETECT_L, /* Battery detect. Repurposed BAT_TEMP */ - - /* Outputs */ - GPIO_CPU_PROCHOT, /* Force CPU to think it's overheated */ - GPIO_PP1350_EN, /* Enable 1.35V supply */ - GPIO_PP3300_DSW_GATED_EN, /* Enable DSW rails */ - GPIO_PP3300_DX_EN, /* Enable power to lots of peripherals */ - GPIO_PP3300_LTE_EN, /* Enable LTE radio */ - GPIO_PP3300_WLAN_EN, /* Enable WiFi power */ - GPIO_SUSP_VR_EN, /* Enable 1.05V regulator */ - GPIO_VCORE_EN, /* Stuffing option - not connected */ - GPIO_PP5000_EN, /* Enable 5V supply */ - GPIO_SYS_PWROK, /* EC thinks everything is up and ready */ - GPIO_WLAN_OFF_L, /* Disable WiFi radio */ - GPIO_CHARGE_L, /* Allow battery to charge when on AC */ - - GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */ - GPIO_ENABLE_TOUCHPAD, /* Enable touchpad power */ - GPIO_ENTERING_RW, /* Indicate when EC is entering RW code */ - GPIO_PCH_DPWROK, /* Indicate when VccDSW is good */ - - GPIO_PCH_HDA_SDO, /* HDA_SDO signal to PCH; when high, ME - * ignores security descriptor */ - GPIO_PCH_WAKE_L, /* Wake signal from EC to PCH */ - GPIO_PCH_NMI_L, /* Non-maskable interrupt pin to PCH */ - GPIO_PCH_PWRBTN_L, /* Power button output to PCH */ - GPIO_PCH_PWROK, /* PWROK / APWROK signals to PCH */ - GPIO_PCH_RCIN_L, /* RCIN# line to PCH (for 8042 emulation) */ - GPIO_PCH_RSMRST_L, /* Reset PCH resume power plane logic */ - GPIO_PCH_SMI_L, /* System management interrupt to PCH */ - GPIO_TOUCHSCREEN_RESET_L, /* Reset touch screen */ - GPIO_EC_EDP_VDD_EN, /* Enable EDP (passthru from PCH) */ - GPIO_LPC_CLKRUN_L, /* Dunno. Probably important, though. */ - - GPIO_USB1_ENABLE, /* USB port 1 output power enable */ - GPIO_USB2_ENABLE, /* USB port 2 output power enable */ - - GPIO_PCH_SUSACK_L, /* Acknowledge PCH SUSWARN# signal */ - GPIO_PCH_RTCRST_L, /* Not supposed to be here */ - GPIO_PCH_SRTCRST_L, /* Not supposed to be here */ - - GPIO_BAT_LED0_L, /* Battery charging LED - Blue */ - GPIO_BAT_LED1_L, /* Battery charging LED - Amber */ - - /* Number of GPIOs; not an actual GPIO */ - GPIO_COUNT -}; - -/* x86 signal definitions */ -enum x86_signal { - X86_PGOOD_PP5000 = 0, - X86_PGOOD_PP1350, - X86_PGOOD_PP1050, - X86_PGOOD_VCORE, - X86_PCH_SLP_S0n_DEASSERTED, - X86_PCH_SLP_S3n_DEASSERTED, - X86_PCH_SLP_S5n_DEASSERTED, - X86_PCH_SLP_SUSn_DEASSERTED, - - /* Number of X86 signals */ - X86_SIGNAL_COUNT -}; - -/* Charger module */ -#define CONFIG_CHARGER_SENSE_RESISTOR 10 /* Charge sense resistor, mOhm */ -#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 /* Input sensor resistor, mOhm */ -#define CONFIG_CHARGER_INPUT_CURRENT 4032 /* mA, about half max */ - - -enum adc_channel { - /* EC internal die temperature in degrees K. */ - ADC_CH_EC_TEMP = 0, - - /* Charger current in mA. */ - ADC_CH_CHARGER_CURRENT, - - ADC_CH_COUNT -}; - -enum temp_sensor_id { - /* CPU die temperature via PECI */ - TEMP_SENSOR_CPU_PECI = 0, - /* EC internal temperature sensor */ - TEMP_SENSOR_EC_INTERNAL, - /* G781 internal and external sensors */ - TEMP_SENSOR_I2C_G781_INTERNAL, - TEMP_SENSOR_I2C_G781_EXTERNAL, - - TEMP_SENSOR_COUNT -}; - -/* Wireless signals */ -#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L -#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN -#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN - -/* Discharge battery when on AC power for factory test. */ -int board_discharge_on_ac(int enable); - -#endif /* !__ASSEMBLER__ */ - -#endif /* __BOARD_H */ diff --git a/board/slippy/build.mk b/board/slippy/build.mk deleted file mode 100644 index 2eb0db0bc6..0000000000 --- a/board/slippy/build.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -*- makefile -*- -# Copyright (c) 2013 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. -# -# Board specific files build -# - -# the IC is TI Stellaris LM4 -CHIP:=lm4 - -board-y=board.o battery.o led.o diff --git a/board/slippy/ec.tasklist b/board/slippy/ec.tasklist deleted file mode 100644 index 3bde650552..0000000000 --- a/board/slippy/ec.tasklist +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/** - * List of enabled tasks in the priority order - * - * The first one has the lowest priority. - * - * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and - * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, - * where : - * 'n' is the name of the task - * 'r' is the main routine of the task - * 'd' is an opaque parameter passed to the routine at startup - * 's' is the stack size in bytes; must be a multiple of 8 - */ -#define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ - TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(POWERBTN, power_button_task, NULL, TASK_STACK_SIZE) \ - TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) diff --git a/board/slippy/led.c b/board/slippy/led.c deleted file mode 100644 index c23ce13c17..0000000000 --- a/board/slippy/led.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (c) 2013 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. - * - * Power and battery LED control for Slippy. - */ - -#include "battery.h" -#include "charge_state.h" -#include "chipset.h" -#include "gpio.h" -#include "hooks.h" -#include "lid_switch.h" - -#define LED_TOTAL_TICKS 16 -#define LED_ON_TICKS 4 - -enum led_color { - LED_OFF = 0, - LED_BLUE, - LED_AMBER, - LED_COLOR_COUNT /* Number of colors, not a color itself */ -}; - -static int led_set_color(enum led_color color, enum gpio_signal gpio_led_blue_l, - enum gpio_signal gpio_led_amber_l) -{ - switch (color) { - case LED_OFF: - gpio_set_level(gpio_led_blue_l, 1); - gpio_set_level(gpio_led_amber_l, 1); - break; - case LED_BLUE: - gpio_set_level(gpio_led_blue_l, 0); - gpio_set_level(gpio_led_amber_l, 1); - break; - case LED_AMBER: - gpio_set_level(gpio_led_blue_l, 1); - gpio_set_level(gpio_led_amber_l, 0); - break; - default: - return EC_ERROR_UNKNOWN; - } - return EC_SUCCESS; -} - -static int bat_led_set_color(enum led_color color) -{ - return led_set_color(color, GPIO_BAT_LED0_L, GPIO_BAT_LED1_L); -} - -/* Called by hook task every 250mSec */ -static void led_tick(void) -{ - static int ticks; - uint32_t chflags = charge_get_flags(); - - /* Battery LED is on the c-panel */ - if (!lid_is_open()) { - bat_led_set_color(LED_OFF); - return; - } - - ticks++; - - switch (charge_get_state()) { - case PWR_STATE_CHARGE: - bat_led_set_color(LED_AMBER); - break; - case PWR_STATE_CHARGE_NEAR_FULL: - bat_led_set_color(LED_BLUE); - break; - case PWR_STATE_DISCHARGE: - bat_led_set_color(LED_OFF); - break; - case PWR_STATE_ERROR: - bat_led_set_color((ticks & 0x2) ? LED_AMBER : LED_OFF); - break; - case PWR_STATE_IDLE: /* External power connected in IDLE state. */ - if (chflags & CHARGE_FLAG_FORCE_IDLE) - bat_led_set_color((ticks & 0x4) ? LED_BLUE : LED_OFF); - else - bat_led_set_color(LED_BLUE); - break; - default: - /* Other states don't alter LED behavior */ - break; - } -} -DECLARE_HOOK(HOOK_TICK, led_tick, HOOK_PRIO_DEFAULT); - diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl index 0a28be4e0a..98c7f503c7 100644 --- a/chip/lm4/openocd/lm4x_cmds.tcl +++ b/chip/lm4/openocd/lm4x_cmds.tcl @@ -31,10 +31,6 @@ proc flash_bds { } { flash_lm4 ../../../build/bds/ec.bin 0 } -proc flash_slippy { } { - flash_lm4 ../../../build/slippy/ec.bin 0 -} - proc flash_rambi { } { flash_lm4 ../../../build/rambi/ec.bin 0 } @@ -52,22 +48,6 @@ proc flash_samus_rw { } { flash_lm4 ../../../build/samus/ec.RW.bin 131072 } -proc flash_bolt { } { - flash_lm4 ../../../build/bolt/ec.bin 0 -} - -proc flash_bolt_ro { } { - flash_lm4 ../../../build/bolt/ec.RO.flat 0 -} - -proc flash_bolt_rw { } { - flash_lm4 ../../../build/bolt/ec.RW.bin 131072 -} - -proc flash_slippy_rw { } { - flash_lm4 ../../../build/slippy/ec.RW.bin 131072 -} - proc flash_falco { } { flash_lm4 ../../../build/falco/ec.bin 0 } @@ -91,8 +71,8 @@ proc unprotect_link { } { reset } -# Slippy/peppy/falco have pstate following RO -proc unprotect_slippy { } { +# Peppy/falco have pstate following RO +proc unprotect_peppy { } { reset halt flash erase_sector 0 126 127 reset diff --git a/common/build.mk b/common/build.mk index 8cf26fab6e..dc64e4bcd9 100644 --- a/common/build.mk +++ b/common/build.mk @@ -27,7 +27,6 @@ common-$(CONFIG_PMU_TPS65090)+=pmu_tps65090.o common-$(CONFIG_EOPTION)+=eoption.o common-$(CONFIG_EXTPOWER_FALCO)+=extpower_falco.o common-$(CONFIG_EXTPOWER_GPIO)+=extpower_gpio.o -common-$(CONFIG_EXTPOWER_KIRBY)+=extpower_kirby.o common-$(CONFIG_EXTPOWER_SNOW)+=extpower_snow.o common-$(CONFIG_EXTPOWER_SPRING)+=extpower_spring.o common-$(CONFIG_FANS)+=fan.o diff --git a/common/extpower_kirby.c b/common/extpower_kirby.c deleted file mode 100644 index 1eb16607ae..0000000000 --- a/common/extpower_kirby.c +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -/* USB charging control for kirby board */ - -#include "battery.h" -#include "charger.h" -#include "chipset.h" -#include "console.h" -#include "driver/tsu6721.h" -#include "extpower.h" -#include "gpio.h" -#include "hooks.h" -#include "task.h" -#include "timer.h" -#include "util.h" - -/* Console output macros */ -#define CPUTS(outstr) cputs(CC_USBCHARGE, outstr) -#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) - -int extpower_is_present(void) -{ - return !gpio_get_level(GPIO_AC_PRESENT_L); -} - -static void extpower_update_otg(void) -{ - int dev_type, is_otg; - - dev_type = tsu6721_get_device_type(); - is_otg = dev_type & TSU6721_TYPE_OTG; - - if (is_otg && !gpio_get_level(GPIO_BCHGR_OTG)) { - charger_enable_otg_power(1); - CPRINTF("[%T OTG power enabled]\n"); - } else if (!is_otg && gpio_get_level(GPIO_BCHGR_OTG)) { - charger_enable_otg_power(0); - CPRINTF("[%T OTG power disabled]\n"); - } -} - -static void extpower_deferred(void) -{ - int int_val; - int ac; - static int last_ac = -1; - - int_val = tsu6721_get_interrupts(); - - ac = extpower_is_present(); - if (last_ac != ac) { - last_ac = ac; - hook_notify(HOOK_AC_CHANGE); - } - - if (!int_val) - return; - - extpower_update_otg(); -} -DECLARE_DEFERRED(extpower_deferred); - -/*****************************************************************************/ -/* Hooks */ - -static void extpower_init(void) -{ - tsu6721_reset(); - gpio_enable_interrupt(GPIO_USB_CHG_INT); - gpio_enable_interrupt(GPIO_AC_PRESENT_L); - extpower_update_otg(); -} -DECLARE_HOOK(HOOK_INIT, extpower_init, HOOK_PRIO_LAST); - -void extpower_interrupt(enum gpio_signal signal) -{ - hook_call_deferred(extpower_deferred, 0); -} diff --git a/common/extpower_snow.c b/common/extpower_snow.c index 1153db0058..3713056c9a 100644 --- a/common/extpower_snow.c +++ b/common/extpower_snow.c @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* External power detection for daisy/snow/pit */ +/* External power detection for snow */ #include "common.h" #include "extpower.h" @@ -16,7 +16,7 @@ int extpower_is_present(void) /* * Detect AC state using combined gpio pins * - * On daisy and snow, there's no single gpio signal to detect AC. + * On snow, there's no single gpio signal to detect AC. * GPIO_AC_PWRBTN_L provides AC on and PWRBTN release. * GPIO_KB_PWR_ON_L provides PWRBTN release. * diff --git a/include/config.h b/include/config.h index 0893f604c4..24cf8b5815 100644 --- a/include/config.h +++ b/include/config.h @@ -77,7 +77,7 @@ */ #undef CONFIG_BATTERY_BQ20Z453 /* BQ20Z453 battery used on some ARM laptops */ #undef CONFIG_BATTERY_BQ27541 /* BQ27541 battery */ -#undef CONFIG_BATTERY_LINK /* Battery used on Link, Bolt, etc. */ +#undef CONFIG_BATTERY_LINK /* Battery used on Link */ /* Compile mock battery support; used by tests. */ #undef CONFIG_BATTERY_MOCK @@ -330,9 +330,6 @@ /* Support detecting external power presence via a GPIO */ #undef CONFIG_EXTPOWER_GPIO -/* Support providing power to the device via USB on Kirby. */ -#undef CONFIG_EXTPOWER_KIRBY - /* * Support detecting external power presence via a pair of GPIOs, as used * on Snow. diff --git a/include/module_id.h b/include/module_id.h index 3094ecea7c..776761cfea 100644 --- a/include/module_id.h +++ b/include/module_id.h @@ -25,7 +25,6 @@ enum module_id { MODULE_I2C, MODULE_KEYBOARD, MODULE_KEYBOARD_SCAN, - MODULE_LED_KIRBY, MODULE_LIGHTBAR, MODULE_LPC, MODULE_PECI, diff --git a/power/gaia.c b/power/gaia.c index c6077c921f..e51eab25e0 100644 --- a/power/gaia.c +++ b/power/gaia.c @@ -43,18 +43,13 @@ #define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args) /* Time necessary for the 5V and 3.3V regulator outputs to stabilize */ -#if defined(BOARD_pit) || defined(BOARD_puppy) +#ifdef BOARD_pit #define DELAY_5V_SETUP (2 * MSEC) #define DELAY_3V_SETUP (2 * MSEC) #else #define DELAY_5V_SETUP MSEC #endif -/* Delay between PMIC_PWRON and enabling 3.3V */ -#ifdef BOARD_kirby -#define DELAY_PRE_3V_ENABLE 16620 -#endif - /* Delay between 1.35v and 3.3v rails startup */ #define DELAY_RAIL_STAGGERING 100 /* 100us */ @@ -173,7 +168,7 @@ static int wait_in_signal(enum gpio_signal signal, int value, int timeout) */ static void set_pmic_pwrok(int asserted) { -#if defined(BOARD_pit) || defined(BOARD_kirby) +#ifdef BOARD_pit /* Signal is active-high */ gpio_set_level(GPIO_PMIC_PWRON, asserted); #else @@ -316,9 +311,7 @@ static int gaia_power_init(void) gpio_enable_interrupt(GPIO_KB_PWR_ON_L); gpio_enable_interrupt(GPIO_SOC1V8_XPSHOLD); gpio_enable_interrupt(GPIO_SUSPEND_L); -#ifndef BOARD_kirby gpio_enable_interrupt(GPIO_PP1800_LDO2); -#endif /* Leave power off only if requested by reset flags */ if (!(system_get_reset_flags() & RESET_FLAG_AP_OFF)) { @@ -399,12 +392,6 @@ void chipset_reset(int is_cold) void chipset_force_shutdown(void) { -#ifdef BOARD_kirby - gpio_set_flags(GPIO_SOC1V8_XPSHOLD, GPIO_ODR_LOW); - udelay(DELAY_XPSHOLD_PULL); - gpio_set_flags(GPIO_SOC1V8_XPSHOLD, GPIO_INT_RISING | GPIO_INPUT); -#endif - /* Turn off all rails */ gpio_set_level(GPIO_EN_PP3300, 0); #ifdef CONFIG_CHIPSET_HAS_PP1350 @@ -492,7 +479,7 @@ static int power_on(void) usleep(DELAY_5V_SETUP); #endif -#if defined(BOARD_pit) || defined(BOARD_puppy) +#ifdef BOARD_pit /* * 3.3V rail must come up right after 5V, because it sources power to * various buck supplies. @@ -511,13 +498,6 @@ static int power_on(void) set_pmic_pwrok(1); } -#ifdef BOARD_kirby - /* - * There is no input signal for PMIC ready for 3.3V power. We can only - * for a pre-defined amount of time. - */ - udelay(DELAY_PRE_3V_ENABLE); -#else /* wait for all PMIC regulators to be ready */ wait_in_signal(GPIO_PP1800_LDO2, 1, PMIC_TIMEOUT); @@ -537,7 +517,6 @@ static int power_on(void) gpio_set_level(GPIO_EN_PP1350, 1); /* Wait to avoid large inrush current */ usleep(DELAY_RAIL_STAGGERING); -#endif /* Enable 3.3v power rail, if it's not already on */ gpio_set_level(GPIO_EN_PP3300, 1); diff --git a/test/build.mk b/test/build.mk index 1c98d63bdd..6c7ec33081 100644 --- a/test/build.mk +++ b/test/build.mk @@ -10,14 +10,12 @@ test-list-y=pingpong timer_calib timer_dos timer_jump mutex utils #disable: powerdemo test-list-$(BOARD_bds)+= -test-list-$(BOARD_daisy)+=kb_scan stress test-list-$(BOARD_pit)+=kb_scan stress test-list-$(BOARD_snow)+=kb_scan stress test-list-$(BOARD_spring)+=kb_scan stress -# Bolt and Samus have board-specific chipset code, and the tests don't -# compile with those. Disable them for now. -test-list-$(BOARD_bolt)= +# Samus has board-specific chipset code, and the tests don't +# compile with it. Disable them for now. test-list-$(BOARD_samus)= # Emulator tests diff --git a/test/stress.c b/test/stress.c index d357c389c5..31e3677c95 100644 --- a/test/stress.c +++ b/test/stress.c @@ -35,8 +35,6 @@ struct i2c_test_param_t { {8, 0, 0x60, 0x0, -1}, {8, 0, 0x60, 0x0, 0x40}, {8, 0, 0x4a, 0x1, -1}, -#elif defined(BOARD_daisy) - {8, 1, 0x90, 0x19, -1}, #elif defined(BOARD_link) {8, 0, 0x16, 0x8, -1}, {8, 0, 0x16, 0x9, -1}, @@ -48,7 +46,7 @@ struct i2c_test_param_t { #endif }; /* Disable I2C test for boards without test configuration */ -#if defined(BOARD_bds) || defined(BOARD_mccroskey) || defined(BOARD_slippy) || \ +#if defined(BOARD_bds) || defined(BOARD_mccroskey) || \ defined(BOARD_falco) || defined(BOARD_peppy) || defined(BOARD_wolf) #undef CONFIG_I2C #endif diff --git a/util/flash_ec b/util/flash_ec index 8d53ea6667..055d69b6cc 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -222,8 +222,8 @@ fi save="$(servo_save)" case "${BOARD}" in - daisy | kirby | pit | puppy | snow | spring | discovery | nyan ) flash_stm32 ;; - bolt | samus | falco | peppy | rambi | slippy ) flash_lm4 ;; + pit | snow | spring | discovery | nyan ) flash_stm32 ;; + samus | falco | peppy | rambi ) flash_lm4 ;; link ) flash_link ;; *) die "board ${BOARD} not supported" ;; esac |