summaryrefslogtreecommitdiff
path: root/board/bds
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-05-17 09:50:42 -0700
committerRandall Spangler <rspangler@chromium.org>2012-05-17 10:50:54 -0700
commit103e055ddac9b3810d74be1336e61ecbebb4fd6d (patch)
tree3dadad62a5c31e723263e2a2343afacbc97505d0 /board/bds
parent5907675a477a2fd8af974d0cb1619cae57a83290 (diff)
downloadchrome-ec-103e055ddac9b3810d74be1336e61ecbebb4fd6d.tar.gz
Disable unused BDS functionality
This was used on the hybrid Badger-Lumpy systems for one-off testing. It wouldn't necessarily work on a bare Badger board, and maintaining it resulted in frequent build breaks. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=build link, bds, daisy; boot link and bds Change-Id: Ib64ccad9f38d76832ab57f7254dbf32f3d5e4a5e
Diffstat (limited to 'board/bds')
-rw-r--r--board/bds/board.c62
-rw-r--r--board/bds/board.h106
-rw-r--r--board/bds/board_temp_sensor.c37
-rw-r--r--board/bds/build.mk2
-rw-r--r--board/bds/dummy_charger.c88
-rw-r--r--board/bds/ec.tasklist8
6 files changed, 10 insertions, 293 deletions
diff --git a/board/bds/board.c b/board/bds/board.c
index 1e61f7d2b2..b9c6ee564d 100644
--- a/board/bds/board.c
+++ b/board/bds/board.c
@@ -5,18 +5,12 @@
/* Stellaris EKB-LM4F-EAC board-specific configuration */
#include "board.h"
-#include "chipset.h"
#include "gpio.h"
-#include "power_button.h"
#include "registers.h"
#include "util.h"
#include "lm4_adc.h"
#include "adc.h"
-#ifndef CONFIG_TASK_POWERBTN
-#define power_button_interrupt NULL
-#endif
-
/* ADC channels. Must be in the exactly same order as in enum adc_channel. */
const struct adc_t adc_channels[ADC_CH_COUNT] =
{
@@ -33,72 +27,20 @@ const struct adc_t adc_channels[ADC_CH_COUNT] =
* Note that on BDS, this is really just the turn pot on the Badger
* board, but that's good enough for debugging the ADC.
*/
- {"ChargerCurrent", LM4_ADC_SEQ1, 33 * 4000, ADC_READ_MAX * 16, 0,
+ {"BDSPot", LM4_ADC_SEQ1, 33 * 4000, ADC_READ_MAX * 16, 0,
LM4_AIN(0), 0x06 /* IE0 | END0 */},
};
/* 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_BUTTONn", LM4_GPIO_C, (1<<5), GPIO_PULL_UP | GPIO_INT_BOTH,
- power_button_interrupt},
- {"LID_SWITCHn", LM4_GPIO_D, (1<<0), GPIO_PULL_UP | GPIO_INT_BOTH,
- power_button_interrupt},
- {"RECOVERYn", LM4_GPIO_D, (1<<1), GPIO_PULL_UP | GPIO_INT_BOTH,
- power_button_interrupt},
- /* Other inputs */
- /* Outputs */
+ {"RECOVERYn", LM4_GPIO_D, (1<<1), GPIO_PULL_UP, NULL},
{"DEBUG_LED", LM4_GPIO_A, (1<<7), GPIO_OUT_LOW, NULL},
/* Unimplemented signals which we need to emulate for now */
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_WAKEn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_PWRBTNn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_BKLTEN"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SLP_An"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SLP_ME_CSW_DEVn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SLP_S3n"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SLP_S4n"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SLP_S5n"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SLP_SUSn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SUSWARNn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_1_5V_DDR"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_1_5V_PCH"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_1_8VS"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_5VALW"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_CPU_CORE"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_VCCP"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_VCCSA"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PGOOD_VGFX_CORE"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("ENABLE_1_5V_DDR"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("ENABLE_BACKLIGHT"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("ENABLE_VCORE"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("ENABLE_VS"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_DPWROK"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_PWROK"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_RSMRSTn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SMIn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("PCH_SUSACKn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("SHUNT_1_5V_DDR"),
GPIO_SIGNAL_NOT_IMPLEMENTED("WRITE_PROTECT"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("LIGHTBAR_RESETn"),
- GPIO_SIGNAL_NOT_IMPLEMENTED("AC_PRESENT"),
};
-/* BDS system is only half-wired to an x86 chipset, so it can't tell what state
- * the chipset is in. Rather than scatter ifdef's everywhere, put a mock
- * chipset interface here. */
-int chipset_in_state(int state_mask)
-{
- return 1; /* Sure, I'm in whatever state you want. */
-}
-
-
-void chipset_exit_hard_off(void)
-{
-}
-
-
void configure_board(void)
{
}
diff --git a/board/bds/board.h b/board/bds/board.h
index 8d02c0926b..b570dfdeb3 100644
--- a/board/bds/board.h
+++ b/board/bds/board.h
@@ -8,44 +8,10 @@
#ifndef __BOARD_H
#define __BOARD_H
-/* Fan PWM channels */
-#define FAN_CH_KBLIGHT 1 /* Keyboard backlight */
-#define FAN_CH_POWER_LED 3 /* Power adapter LED */
-#define FAN_CH_CPU 4 /* CPU fan */
-
-/* TODO: these should really only be used inside lpc.c; once they are, remove
- * from board header files. */
-/* LPC channels */
-#define LPC_CH_KERNEL 0 /* Kernel commands */
-#define LPC_CH_PORT80 1 /* Port 80 debug output */
-#define LPC_CH_CMD_DATA 2 /* Data for kernel/user-mode commands */
-#define LPC_CH_KEYBOARD 3 /* 8042 keyboard emulation */
-#define LPC_CH_USER 4 /* User-mode commands */
-#define LPC_CH_COMX 7 /* UART emulation */
-/* LPC pool offsets */
-#define LPC_POOL_OFFS_KERNEL 0 /* Kernel commands - 0=in, 1=out */
-#define LPC_POOL_OFFS_PORT80 4 /* Port 80 - 4=in, 5=out */
-#define LPC_POOL_OFFS_COMX 8 /* UART emulation range - 8-15 */
-#define LPC_POOL_OFFS_KEYBOARD 16 /* Keyboard - 16=in, 17=out */
-#define LPC_POOL_OFFS_USER 20 /* User commands - 20=in, 21=out */
-#define LPC_POOL_OFFS_CMD_DATA 512 /* Data range for commands - 512-1023 */
-/* LPC pool data pointers */
-#define LPC_POOL_KERNEL (LM4_LPC_LPCPOOL + LPC_POOL_OFFS_KERNEL)
-#define LPC_POOL_PORT80 (LM4_LPC_LPCPOOL + LPC_POOL_OFFS_PORT80)
-#define LPC_POOL_COMX (LM4_LPC_LPCPOOL + LPC_POOL_OFFS_COMX)
-#define LPC_POOL_KEYBOARD (LM4_LPC_LPCPOOL + LPC_POOL_OFFS_KEYBOARD)
-#define LPC_POOL_CMD_DATA (LM4_LPC_LPCPOOL + LPC_POOL_OFFS_CMD_DATA)
-#define LPC_POOL_USER (LM4_LPC_LPCPOOL + LPC_POOL_OFFS_USER)
-/* LPC COMx I/O address (in x86 I/O address space) */
-#define LPC_COMX_ADDR 0x2f8 /* COM2, since superIO uses COM1 */
-
enum adc_channel
{
- /* EC internal die temperature in degrees K. */
- ADC_CH_EC_TEMP = 0,
- /* Treat BDS pot input as charger current. */
- ADC_CH_CHARGER_CURRENT,
-
+ ADC_CH_EC_TEMP = 0, /* EC internal die temperature in degrees K. */
+ ADC_CH_BDS_POT, /* BDS pot input. */
ADC_CH_COUNT
};
@@ -54,82 +20,24 @@ enum adc_channel
#define I2C_PORT_CHARGER 5 // port 1 / PA6:7 on Link, user LED on badger
#define I2C_PORT_THERMAL 5 // port 5 / PB6:7 on link, but PG6:7 on badger
#define I2C_PORT_LIGHTBAR 5 // port 5 / PA6:7 on link, but PG6:7 on badger
-/* I2C port speeds in kbps */
-#define I2C_SPEED_BATTERY 100
-#define I2C_SPEED_CHARGER 100
+/* I2C port speeds in kbps. All the same because they all share a port */
+#define I2C_SPEED_BATTERY 400
+#define I2C_SPEED_CHARGER 400
#define I2C_SPEED_LIGHTBAR 400
-#define I2C_SPEED_THERMAL 400 /* TODO: TMP007 supports 3.4Mbps
- operation; use faster speed? */
-
-/* Keyboard scanner uses an entire GPIO bank for row inputs */
-#define KB_SCAN_ROW_IRQ LM4_IRQ_GPIOH
-#define KB_SCAN_ROW_GPIO LM4_GPIO_H
-
-/* Host connects to keyboard controller module via LPC */
-#define HOST_KB_BUS_LPC
-
-/* USB charge port */
-#define USB_CHARGE_PORT_COUNT 0
+#define I2C_SPEED_THERMAL 400
/* GPIO signal list */
enum gpio_signal {
- /* Inputs with interrupt handlers are first for efficiency */
- GPIO_POWER_BUTTONn = 0, /* Power button */
- GPIO_LID_SWITCHn, /* Lid switch */
- GPIO_RECOVERYn, /* Recovery signal from DOWN button */
- /* Other inputs */
- /* Outputs */
+ GPIO_RECOVERYn = 0, /* Recovery signal from DOWN button */
GPIO_DEBUG_LED, /* Debug LED */
/* Signals which aren't implemented on BDS but we'll emulate anyway, to
* make it more convenient to debug other code. */
- GPIO_PCH_WAKEn, /* Wake output to PCH */
- GPIO_PCH_PWRBTNn, /* Power button output to PCH */
-
- GPIO_PCH_BKLTEN, /* Backlight enable signal from PCH */
- GPIO_PCH_SLP_An, /* SLP_A# signal from PCH */
- GPIO_PCH_SLP_ME_CSW_DEVn, /* SLP_ME_CSW_DEV# signal from PCH */
- GPIO_PCH_SLP_S3n, /* SLP_S3# signal from PCH */
- GPIO_PCH_SLP_S4n, /* SLP_S4# signal from PCH */
- GPIO_PCH_SLP_S5n, /* SLP_S5# signal from PCH */
- GPIO_PCH_SLP_SUSn, /* SLP_SUS# signal from PCH */
- GPIO_PCH_SUSWARNn, /* SUSWARN# signal from PCH */
- GPIO_PGOOD_1_5V_DDR, /* Power good on +1.5V_DDR */
- GPIO_PGOOD_1_5V_PCH, /* Power good on +1.5V_PCH */
- GPIO_PGOOD_1_8VS, /* Power good on +1.8VS */
- GPIO_PGOOD_5VALW, /* Power good on +5VALW */
- GPIO_PGOOD_CPU_CORE, /* Power good on +CPU_CORE */
- GPIO_PGOOD_VCCP, /* Power good on +VCCP */
- GPIO_PGOOD_VCCSA, /* Power good on +VCCSA */
- GPIO_PGOOD_VGFX_CORE, /* Power good on +VGFX_CORE */
- GPIO_ENABLE_1_5V_DDR, /* Enable +1.5V_DDR supply */
- GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */
- GPIO_ENABLE_VCORE, /* Enable +CPU_CORE and +VGFX_CORE */
- GPIO_ENABLE_VS, /* Enable VS power supplies */
- GPIO_PCH_DPWROK, /* DPWROK signal to PCH */
- GPIO_PCH_PWROK, /* PWROK / APWROK signals to PCH */
- GPIO_PCH_RSMRSTn, /* Reset PCH resume power plane logic */
- GPIO_PCH_SMIn, /* System management interrupt to PCH */
- GPIO_PCH_SUSACKn, /* Acknowledge PCH SUSWARN# signal */
- GPIO_SHUNT_1_5V_DDR, /* Shunt +1.5V_DDR; may also enable +3V_TP
- * depending on stuffing. */
GPIO_WRITE_PROTECT, /* Write protect input */
- GPIO_LIGHTBAR_RESETn, /* Reset lightbar controllers (Proto1+) */
- GPIO_AC_PRESENT, /* AC present signal */
/* Number of GPIOs; not an actual GPIO */
GPIO_COUNT
};
-enum temp_sensor_id {
- TEMP_SENSOR_EC_INTERNAL = 0, /* EC internal temperature sensor */
- TEMP_SENSOR_CASE_DIE,
- TEMP_SENSOR_OBJECT,
-
- TEMP_SENSOR_COUNT
-};
-
-#define TMP006_COUNT 1
-
/* Target value for BOOTCFG. This currently toggles the polarity bit without
* enabling the boot loader, simply to prove we can program it. */
#define BOOTCFG_VALUE 0xfffffdfe
diff --git a/board/bds/board_temp_sensor.c b/board/bds/board_temp_sensor.c
deleted file mode 100644
index fbc82b7e46..0000000000
--- a/board/bds/board_temp_sensor.c
+++ /dev/null
@@ -1,37 +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.
- */
-
-/* BDS-specific temp sensor module for Chrome EC */
-
-#include "temp_sensor.h"
-#include "chip_temp_sensor.h"
-#include "board.h"
-#include "i2c.h"
-#include "tmp006.h"
-#include "util.h"
-
-#define TEMP_CASE_DIE_REG_ADDR ((0x40 << 1) | I2C_FLAG_BIG_ENDIAN)
-#define TEMP_CASE_DIE_ADDR \
- TMP006_ADDR(I2C_PORT_THERMAL, TEMP_CASE_DIE_REG_ADDR)
-
-/* Temperature sensors data. Must be in the same order as enum
- * temp_sensor_id.
- */
-const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = {
-#ifdef CONFIG_TASK_TEMPSENSOR
- {"ECInternal", TEMP_SENSOR_POWER_NONE, TEMP_SENSOR_TYPE_BOARD,
- chip_temp_sensor_get_val, 0},
-#endif
-#ifdef CONFIG_TMP006
- {"CaseDie", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_BOARD,
- tmp006_get_val, 0},
- {"Object", TEMP_SENSOR_POWER_VS, TEMP_SENSOR_TYPE_CASE,
- tmp006_get_val, 1},
-#endif
-};
-
-const struct tmp006_t tmp006_sensors[TMP006_COUNT] = {
- {"TMP006", TEMP_CASE_DIE_ADDR},
-};
diff --git a/board/bds/build.mk b/board/bds/build.mk
index d53bdde96c..08eb00be8a 100644
--- a/board/bds/build.mk
+++ b/board/bds/build.mk
@@ -10,5 +10,3 @@
CHIP:=lm4
board-y=board.o
-board-$(CONFIG_CHARGER)+=dummy_charger.o
-board-y+=board_temp_sensor.o
diff --git a/board/bds/dummy_charger.c b/board/bds/dummy_charger.c
deleted file mode 100644
index 836b3b6cf9..0000000000
--- a/board/bds/dummy_charger.c
+++ /dev/null
@@ -1,88 +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.
- */
-
-#include "board.h"
-#include "charger.h"
-#include "console.h"
-#include "i2c.h"
-#include "util.h"
-
-/* Address of battery charger */
-#define CHARGER_ADDR 0x12
-
-/* Address of battery */
-#define BATTERY_ADDR 0x16
-
-int charger_init(void)
-{
- return EC_SUCCESS;
-}
-
-/*****************************************************************************/
-/* Console commands */
-
-static int command_charger(int argc, char **argv)
-{
- int rv;
- int d;
-
- ccputs("Reading battery charger...\n");
-
- rv = i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, 0xfe, &d);
- if (rv)
- return rv;
- ccprintf(" Manufacturer ID: 0x%04x\n", d);
-
- rv = i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, 0xff, &d);
- ccprintf(" Device ID: 0x%04x\n", d);
-
- rv = i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, 0x12, &d);
- ccprintf(" Option: 0x%04x\n", d);
-
- rv = i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, 0x14, &d);
- ccprintf(" Charge current: 0x%04x\n", d);
-
- rv = i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, 0x15, &d);
- ccprintf(" Charge voltage: 0x%04x\n", d);
-
- rv = i2c_read16(I2C_PORT_CHARGER, CHARGER_ADDR, 0x3f, &d);
- ccprintf(" Input current: 0x%04x\n", d);
-
- return EC_SUCCESS;
-}
-DECLARE_CONSOLE_COMMAND(charger, command_charger);
-
-
-static int command_battery(int argc, char **argv)
-{
- int rv;
- int d;
-
- ccputs("Reading battery...\n");
-
- rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, 0x08, &d);
- if (rv)
- return rv;
- ccprintf(" Temperature: 0x%04x = %d C\n",
- d, (d-2731)/10);
-
- rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, 0x09, &d);
- ccprintf(" Voltage: 0x%04x = %d mV\n", d, d);
-
- rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, 0x0f, &d);
- ccprintf(" Remaining capacity: 0x%04x = %d mAh\n", d, d);
- rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, 0x10, &d);
- ccprintf(" Full charge capacity: 0x%04x = %d mAh\n", d, d);
-
- rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, 0x14, &d);
- ccprintf(" Desired charge current: 0x%04x = %d mA\n", d, d);
- rv = i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, 0x15, &d);
- ccprintf(" Desired charge voltage: 0x%04x = %d mV\n", d, d);
-
-
- return EC_SUCCESS;
-}
-DECLARE_CONSOLE_COMMAND(battery, command_battery);
-
diff --git a/board/bds/ec.tasklist b/board/bds/ec.tasklist
index cda33f352a..beaaec5552 100644
--- a/board/bds/ec.tasklist
+++ b/board/bds/ec.tasklist
@@ -16,10 +16,4 @@
#define CONFIG_TASK_LIST \
TASK(WATCHDOG, watchdog_task, NULL) \
TASK(LIGHTBAR, lightbar_task, NULL) \
- TASK(PWM, pwm_task, NULL) \
- TASK(KEYSCAN, keyboard_scan_task, NULL) \
- TASK(TYPEMATIC, keyboard_typematic_task, NULL) \
- TASK(POWERBTN, power_button_task, NULL) \
- TASK(CONSOLE, console_task, NULL) \
- TASK(HOSTCMD, host_command_task, NULL) \
- TASK(I8042CMD, i8042_command_task, NULL)
+ TASK(CONSOLE, console_task, NULL)