diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-05-20 13:06:55 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-05-20 17:01:29 -0700 |
commit | 93ec62ebc3ae238749915f8161a2673a7d2928d9 (patch) | |
tree | 0f64111dc448e6c5d2d4d8dedfed775a9d4cc7b8 | |
parent | 9fb93c09d30d83a4aae778887faaed72da5675b0 (diff) | |
download | chrome-ec-93ec62ebc3ae238749915f8161a2673a7d2928d9.tar.gz |
Create board configuration for falco bringup
This change just copies slippy and tweaks a few things that were
slippy-specific instead of not-link-specific (there are still bugs
open for those things).
BUG=chrome-os-partner:18788
BRANCH=none
TEST=manual
Since there are no Falco-specific changes yet (just slippy with another
name), I can try it on Slippy:
cros_workon --board falco start chromeos-ec
emerge-falco chromeos-ec
~/trunk/src/platform/ec/util/flash_ec --board falco
I also built and tested Link EC, to make sure nothing broke there either.
Change-Id: I9b3682032bd51adab4450520dfe52e3036750ef9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55820
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | board/falco/board.c | 168 | ||||
-rw-r--r-- | board/falco/board.h | 179 | ||||
-rw-r--r-- | board/falco/build.mk | 12 | ||||
-rw-r--r-- | board/falco/ec.tasklist | 29 | ||||
-rw-r--r-- | chip/lm4/clock.c | 7 | ||||
-rw-r--r-- | chip/lm4/flash.c | 4 | ||||
-rw-r--r-- | chip/lm4/openocd/lm4x_cmds.tcl | 4 | ||||
-rw-r--r-- | chip/lm4/system.c | 4 | ||||
-rw-r--r-- | test/build.mk | 1 | ||||
-rw-r--r-- | test/stress.c | 3 | ||||
-rwxr-xr-x | util/flash_ec | 2 |
11 files changed, 402 insertions, 11 deletions
diff --git a/board/falco/board.c b/board/falco/board.c new file mode 100644 index 0000000000..83a0a7317e --- /dev/null +++ b/board/falco/board.c @@ -0,0 +1,168 @@ +/* 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 Link board configuration */ + +#include "adc.h" +#include "chip_temp_sensor.h" +#include "common.h" +#include "extpower.h" +#include "gpio.h" +#include "i2c.h" +#include "keyboard_scan.h" +#include "lid_switch.h" +#include "lm4_adc.h" +#include "peci.h" +#include "power_button.h" +#include "registers.h" +#include "switch.h" +#include "temp_sensor.h" +#include "timer.h" +#include "tmp006.h" +#include "util.h" +#include "x86_power.h" + +/* GPIO signal list. Must match order from enum gpio_signal. */ +const struct gpio_info gpio_list[GPIO_COUNT] = { + /* 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, + switch_interrupt}, + {"PCH_SLP_S0_L", LM4_GPIO_G, (1<<6), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PCH_SLP_S3_L", LM4_GPIO_G, (1<<7), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PCH_SLP_S5_L", LM4_GPIO_H, (1<<1), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PCH_SLP_SUS_L", LM4_GPIO_G, (1<<3), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PCH_SUSWARN_L", LM4_GPIO_G, (1<<2), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PP1050_PGOOD", LM4_GPIO_H, (1<<4), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PP1350_PGOOD", LM4_GPIO_H, (1<<6), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PP5000_PGOOD", LM4_GPIO_N, (1<<0), GPIO_INT_BOTH, + x86_power_interrupt}, + {"VCORE_PGOOD", LM4_GPIO_C, (1<<6), GPIO_INT_BOTH, + x86_power_interrupt}, + {"PCH_EDP_VDD_EN", LM4_GPIO_J, (1<<1), GPIO_INT_BOTH, + x86_power_interrupt}, + {"RECOVERY_L", LM4_GPIO_A, (1<<5), GPIO_PULL_UP|GPIO_INT_BOTH, + switch_interrupt}, + {"WRITE_PROTECT", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH, + switch_interrupt}, + + /* Other inputs */ + {"FAN_ALERT_L", LM4_GPIO_B, (1<<0), GPIO_INPUT, 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}, + + /* 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}, + {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_OUT_HIGH, NULL}, + {"PCH_RSMRST_L", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, + {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_OUT_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_OUT_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_HI_Z, NULL}, + {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_HI_Z, NULL}, +}; + +/* ADC channels. Must be in the exactly same order as in enum adc_channel. */ +const struct adc_t adc_channels[ADC_CH_COUNT] = { + /* 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}, + + /* HEY: need different equation for Falco */ + /* Charger current is mapped from 0~4000mA to 0~1.6V. + * And ADC maps 0~3.3V to ADC_READ_MAX. + */ + {"ChargerCurrent", LM4_ADC_SEQ1, 33 * 4000, ADC_READ_MAX * 16, 0, + LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, +}; + +/* I2C ports */ +const struct i2c_port_t i2c_ports[I2C_PORTS_USED] = { + /* Note: battery and charger share a port. Only include it once in + * this list so we don't double-initialize it. */ + {"batt_chg", I2C_PORT_BATTERY, 100}, + {"thermal", I2C_PORT_THERMAL, 100}, +}; + + +/* Temperature sensors data; must be in same order as enum temp_sensor_id. */ +const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { +/* HEY: Need correct I2C addresses and read function for external sensor */ + {"ECInternal", TEMP_SENSOR_TYPE_BOARD, chip_temp_sensor_get_val, 0, 4}, +#ifdef CONFIG_PECI + {"PECI", TEMP_SENSOR_TYPE_CPU, peci_temp_sensor_get_val, 0, 2}, +#endif +}; + +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 */ + }, +}; + +/** + * Configure the GPIOs for the pwm module. + */ +void configure_fan_gpios(void) +{ + /* PN2:3 alternate function 1 = channel 0 PWM/tach */ + gpio_set_alternate_function(LM4_GPIO_N, 0x0c, 1); +} diff --git a/board/falco/board.h b/board/falco/board.h new file mode 100644 index 0000000000..c35f0e948c --- /dev/null +++ b/board/falco/board.h @@ -0,0 +1,179 @@ +/* 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 Falco mainboard */ + +#ifndef __BOARD_H +#define __BOARD_H + +/* Debug features */ +#define CONFIG_ASSERT_HELP +#define CONFIG_CONSOLE_CMDHELP +#define CONFIG_PANIC_HELP +#define CONFIG_TASK_PROFILING + +/* Optional features */ +/*HEY #define CONFIG_SMART_BATTERY */ +/*HEY #define CONFIG_BATTERY_LINK */ +/*HEY #define CONFIG_CHARGER_BQ24725 */ +#ifdef HAS_TASK_CHIPSET +#define CONFIG_CHIPSET_X86_HASWELL +#endif +#define CONFIG_CUSTOM_KEYSCAN +#define CONFIG_EXTPOWER_GPIO +#ifdef HAS_TASK_KEYPROTO +#define CONFIG_KEYBOARD_PROTOCOL_8042 +#endif +#define CONFIG_LID_SWITCH +#define CONFIG_LPC +#define CONFIG_PECI +#define CONFIG_POWER_BUTTON +#define CONFIG_PWM_FAN +#define CONFIG_TEMP_SENSOR +#define CONFIG_USB_PORT_POWER_DUMB + +#ifndef __ASSEMBLER__ + +/* PWM channels */ +#define FAN_CH_CPU 2 /* CPU fan */ +#define FAN_CH_BL_DISPLAY 4 /* LVDS backlight (from PCH, cleaned by EC) */ + +/* I2C ports */ +#define I2C_PORT_BATTERY 0 +#define I2C_PORT_CHARGER 0 +#define I2C_PORT_THERMAL 2 +/* There are only two I2C ports used because battery and charger share a port */ +#define I2C_PORTS_USED 2 + +/* 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 + +/* GPIOs for second UART port */ +#define CONFIG_HOST_UART 2 +#define CONFIG_HOST_UART_IRQ LM4_IRQ_UART2 +#define CONFIG_HOST_UART2_GPIOS_PG4_5 + +/* 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_WRITE_PROTECT, /* Write protect input */ + + /* Other inputs */ + GPIO_FAN_ALERT_L, /* From thermal sensor */ + 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 */ + + /* 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 radio */ + 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 chip? Or just the 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) */ + GPOI_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 */ + + /* Number of GPIOs; not an actual GPIO */ + GPIO_COUNT +}; + +enum adc_channel { + /* EC internal die temperature in degrees K. */ + ADC_CH_EC_TEMP = 0, + + /* HEY: Falco MB has only one discrete thermal sensor, but it has two + * values (one internal and one external). Both should be here. + * HEY: There may be a BAT_TEMP sensor on the battery pack too. + */ + + /* HEY: Be prepared to read this (ICMNT). */ + /* Charger current in mA. */ + ADC_CH_CHARGER_CURRENT, + + ADC_CH_COUNT +}; + +enum temp_sensor_id { + /* HEY - need two I2C sensor values */ + + /* EC internal temperature sensor */ + TEMP_SENSOR_EC_INTERNAL, + /* CPU die temperature via PECI */ + TEMP_SENSOR_CPU_PECI, + + TEMP_SENSOR_COUNT +}; + +/* HEY: The below stuff is for Link. Pick a different pin for Falco */ +/* Target value for BOOTCFG. This is set to PE2/USB1_CTL1, which has an external + * pullup. If this signal is pulled to ground when the EC boots, the EC will get + * into the boot loader and we can recover bricked EC. */ +#define BOOTCFG_VALUE 0x7fff88fe + +/* Known board versions for system_get_board_version(). */ +enum board_version { + BOARD_VERSION_PROTO1 = 0, + BOARD_VERSION_EVT = 1, +}; + + +#endif /* !__ASSEMBLER__ */ + +#endif /* __BOARD_H */ diff --git a/board/falco/build.mk b/board/falco/build.mk new file mode 100644 index 0000000000..1843369ed4 --- /dev/null +++ b/board/falco/build.mk @@ -0,0 +1,12 @@ +# -*- 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 diff --git a/board/falco/ec.tasklist b/board/falco/ec.tasklist new file mode 100644 index 0000000000..fa89bc836b --- /dev/null +++ b/board/falco/ec.tasklist @@ -0,0 +1,29 @@ +/* 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) \ + /*HEY TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) */ \ + TASK_NOTEST(THERMAL, thermal_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(SWITCH, switch_task, NULL, TASK_STACK_SIZE) \ + TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) diff --git a/chip/lm4/clock.c b/chip/lm4/clock.c index 05a0aac36f..c0a5558cdb 100644 --- a/chip/lm4/clock.c +++ b/chip/lm4/clock.c @@ -27,7 +27,7 @@ static int freq; */ static void disable_pll(void) { -#ifndef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ +#ifdef BOARD_link /* FIXME: crosbug.com/p/19366 */ /* Switch to 16MHz internal oscillator and power down the PLL */ LM4_SYSTEM_RCC = LM4_SYSTEM_RCC_SYSDIV(0) | LM4_SYSTEM_RCC_BYPASS | @@ -48,7 +48,7 @@ static void enable_pll(void) /* Disable the PLL so we can reconfigure it */ disable_pll(); -#ifndef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ +#ifdef BOARD_link /* FIXME: crosbug.com/p/19366 */ /* * Enable the PLL (PWRDN is no longer set) and set divider. PLL is * still bypassed, since it hasn't locked yet. @@ -95,8 +95,6 @@ int clock_get_freq(void) void clock_init(void) { - -#ifndef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ #ifdef BOARD_bds /* * Perform an auto calibration of the internal oscillator using the @@ -120,7 +118,6 @@ void clock_init(void) */ LM4_SYSTEM_MOSCCTL = 0x04; #endif -#endif /* * TODO: UART seems to glitch unless we wait 500k cycles before diff --git a/chip/lm4/flash.c b/chip/lm4/flash.c index 3351fd851e..0b451d53ad 100644 --- a/chip/lm4/flash.c +++ b/chip/lm4/flash.c @@ -163,7 +163,7 @@ static int write_buffer(void) { int t; -#ifdef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ +#ifndef BOARD_link /* FIXME: crosbug.com/p/19366 */ return EC_ERROR_UNKNOWN; #endif @@ -239,7 +239,7 @@ int flash_physical_write(int offset, int size, const char *data) int flash_physical_erase(int offset, int size) { -#ifdef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ +#ifndef BOARD_link /* FIXME: crosbug.com/p/19366 */ return EC_ERROR_UNKNOWN; #endif if (all_protected) diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl index d34d7352f7..d289cdbbef 100644 --- a/chip/lm4/openocd/lm4x_cmds.tcl +++ b/chip/lm4/openocd/lm4x_cmds.tcl @@ -35,6 +35,10 @@ proc flash_slippy { } { flash_lm4 ../../../build/slippy/ec.bin 0 } +proc flash_falco { } { + flash_lm4 ../../../build/falco/ec.bin 0 +} + proc unprotect_link { } { reset halt flash erase_sector 0 254 255 diff --git a/chip/lm4/system.c b/chip/lm4/system.c index 6944db7716..5a13725305 100644 --- a/chip/lm4/system.c +++ b/chip/lm4/system.c @@ -295,7 +295,7 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) void system_pre_init(void) { -#ifndef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ +#ifdef BOARD_link /* FIXME: crosbug.com/p/19366 */ volatile uint32_t scratch __attribute__((unused)); /* Enable clocks to the hibernation module */ @@ -345,7 +345,7 @@ void system_pre_init(void) /* HEY: read LM4_SYSTEM_BOOTCFG bit 4 to determine WRKEY value */ -#ifndef BOARD_slippy /* FIXME: crosbug.com/p/19366 */ +#ifdef BOARD_link /* FIXME: crosbug.com/p/19366 */ /* Initialize bootcfg if needed */ if (LM4_SYSTEM_BOOTCFG != BOOTCFG_VALUE) { LM4_FLASH_FMD = BOOTCFG_VALUE; diff --git a/test/build.mk b/test/build.mk index 3100f0df49..6a302a6b02 100644 --- a/test/build.mk +++ b/test/build.mk @@ -23,6 +23,7 @@ test-list-$(BOARD_spring)+=kb_scan flash stress # TODO(victoryang): Fix them test-list-$(BOARD_link)= test-list-$(BOARD_slippy)= +test-list-$(BOARD_falco)= # Emulator tests test-list-host=mutex pingpong utils kb_scan kb_mkbp lid_sw power_button hooks diff --git a/test/stress.c b/test/stress.c index e62212e69f..ce3e671147 100644 --- a/test/stress.c +++ b/test/stress.c @@ -49,7 +49,8 @@ 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_slippy) || \ + defined(BOARD_falco) #undef CONFIG_I2C #endif diff --git a/util/flash_ec b/util/flash_ec index ef104750b7..28b5bd1073 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -202,7 +202,7 @@ save="$(servo_save)" case "${BOARD}" in daisy | snow | spring | pit ) flash_daisy ;; - link | slippy ) flash_link ;; + link | slippy | falco ) flash_link ;; *) die "board ${BOARD} not supported" ;; esac |