summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/slippy/board.c33
-rw-r--r--board/slippy/board.h82
2 files changed, 31 insertions, 84 deletions
diff --git a/board/slippy/board.c b/board/slippy/board.c
index ba1a26679d..b170382cec 100644
--- a/board/slippy/board.c
+++ b/board/slippy/board.c
@@ -127,11 +127,12 @@ const struct adc_t adc_channels[ADC_CH_COUNT] = {
{"ECTemp", LM4_ADC_SEQ0, -225, ADC_READ_MAX, 420,
LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0},
+ /* HEY: need different equation for Slippy */
/* 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(11), 0x06 /* IE0 | END0 */, LM4_GPIO_B, (1<<5)},
+ LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)},
};
/* I2C ports */
@@ -139,47 +140,19 @@ 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},
- {"lightbar", I2C_PORT_LIGHTBAR, 400},
{"thermal", I2C_PORT_THERMAL, 100},
};
-#define TEMP_PCH_REG_ADDR ((0x41 << 1) | I2C_FLAG_BIG_ENDIAN)
-#define TEMP_CHARGER_REG_ADDR ((0x43 << 1) | I2C_FLAG_BIG_ENDIAN)
-#define TEMP_USB_REG_ADDR ((0x46 << 1) | I2C_FLAG_BIG_ENDIAN)
-#define TEMP_HINGE_REG_ADDR ((0x44 << 1) | I2C_FLAG_BIG_ENDIAN)
-
-#define TEMP_PCH_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_PCH_REG_ADDR)
-#define TEMP_CHARGER_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_CHARGER_REG_ADDR)
-#define TEMP_USB_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_USB_REG_ADDR)
-#define TEMP_HINGE_ADDR TMP006_ADDR(I2C_PORT_THERMAL, TEMP_HINGE_REG_ADDR)
/* Temperature sensors data; must be in same order as enum temp_sensor_id. */
const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = {
-#ifdef CONFIG_TMP006
- {"I2C-USB C-Die", TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 0, 7},
- {"I2C-USB C-Object", TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 1, 7},
- {"I2C-PCH D-Die", TEMP_SENSOR_TYPE_BOARD, tmp006_get_val, 2, 7},
- {"I2C-PCH D-Object", TEMP_SENSOR_TYPE_CASE, tmp006_get_val, 3, 7},
- {"I2C-Hinge C-Die", TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 4, 7},
- {"I2C-Hinge C-Object", TEMP_SENSOR_TYPE_IGNORED, tmp006_get_val, 5, 7},
- {"I2C-Charger D-Die", TEMP_SENSOR_TYPE_BOARD, tmp006_get_val, 6, 7},
- {"I2C-Charger D-Object", TEMP_SENSOR_TYPE_CASE, tmp006_get_val, 7, 7},
-#endif
-#ifdef CONFIG_ADC
+/* HEY: Need correct I2C addresses and read function for external sensor */
{"ECInternal", TEMP_SENSOR_TYPE_BOARD, chip_temp_sensor_get_val, 0, 4},
-#endif
#ifdef CONFIG_PECI
{"PECI", TEMP_SENSOR_TYPE_CPU, peci_temp_sensor_get_val, 0, 2},
#endif
};
-const struct tmp006_t tmp006_sensors[TMP006_COUNT] = {
- {"USB C", TEMP_USB_ADDR},
- {"PCH D", TEMP_PCH_ADDR},
- {"Hinge C", TEMP_HINGE_ADDR},
- {"Charger D", TEMP_CHARGER_ADDR},
-};
-
struct keyboard_scan_config keyscan_config = {
.output_settle_us = 40,
.debounce_down_us = 6 * MSEC,
diff --git a/board/slippy/board.h b/board/slippy/board.h
index d423f579d7..9e3d4001a3 100644
--- a/board/slippy/board.h
+++ b/board/slippy/board.h
@@ -32,54 +32,24 @@
#define CONFIG_POWER_BUTTON
#define CONFIG_PWM_FAN
#define CONFIG_TEMP_SENSOR
-#define CONFIG_TMP006
#define CONFIG_USB_PORT_POWER_DUMB
#ifndef __ASSEMBLER__
-/* Fan PWM channels */
-#define FAN_CH_CPU 0 /* CPU fan */
-#define FAN_CH_KBLIGHT 1 /* Keyboard backlight */
-#define FAN_CH_POWER_LED 5 /* Power adapter LED */
-
-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
-};
-
-/* Charger module */
-/* Set charger input current limit
- * Note - this value should depend on external power adapter,
- * designed charging voltage, and the maximum power of
- * a running system.
- * Following value 4032 mA is the maximum input limit
- * on Link's design.
- */
-#define CONFIG_CHARGER_INPUT_CURRENT 4032
-#define CONFIG_BQ24725_R_SNS 10 /* 10 mOhm charge sense resistor */
-#define CONFIG_BQ24725_R_AC 20 /* 20 mOhm input current sense resistor */
-
-/* Board specific charging current limit
- * The current constrant of all components on the charging path.
- */
-#define CONFIG_CHARGING_CURRENT_LIMIT 3000 /* PL102 inductor 3.0A(3.8A) */
+/* 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 /* Note: proto0 used port 1 */
-#define I2C_PORT_THERMAL 5
-#define I2C_PORT_LIGHTBAR 1
-#define I2C_PORT_REGULATOR 0
-/* There are only 3 I2C ports used because battery and charger share a port */
-#define I2C_PORTS_USED 3
+#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_GPION
-#define KB_SCAN_ROW_GPIO LM4_GPIO_N
+#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
@@ -165,19 +135,25 @@ enum gpio_signal {
GPIO_COUNT
};
+enum adc_channel {
+ /* EC internal die temperature in degrees K. */
+ ADC_CH_EC_TEMP = 0,
+
+ /* HEY: Slippy 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 {
- /* TMP006 U20, die/object temperature near Mini-DP / USB connectors */
- TEMP_SENSOR_I2C_U20_DIE = 0,
- TEMP_SENSOR_I2C_U20_OBJECT,
- /* TMP006 U11, die/object temperature near PCH */
- TEMP_SENSOR_I2C_U11_DIE,
- TEMP_SENSOR_I2C_U11_OBJECT,
- /* TMP006 U27, die/object temperature near hinge */
- TEMP_SENSOR_I2C_U27_DIE,
- TEMP_SENSOR_I2C_U27_OBJECT,
- /* TMP006 U14, die/object temperature near battery charger */
- TEMP_SENSOR_I2C_U14_DIE,
- TEMP_SENSOR_I2C_U14_OBJECT,
+ /* HEY - need two I2C sensor values */
+
/* EC internal temperature sensor */
TEMP_SENSOR_EC_INTERNAL,
/* CPU die temperature via PECI */
@@ -186,9 +162,7 @@ enum temp_sensor_id {
TEMP_SENSOR_COUNT
};
-/* The number of TMP006 sensor chips on the board. */
-#define TMP006_COUNT 4
-
+/* HEY: The below stuff is for Link. Pick a different pin for Slippy */
/* 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. */