summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-05-02 12:55:20 -0700
committerChromeBot <chrome-bot@google.com>2013-05-02 18:10:45 -0700
commit9d2b32aabf4bdcda050dd3c6b61e169802509273 (patch)
tree648b776fbd2634080b96d3510cde409c4356b9db /chip
parenta182372cbdfdc7f3fd1f31cc4ab98dda7109bba4 (diff)
downloadchrome-ec-9d2b32aabf4bdcda050dd3c6b61e169802509273.tar.gz
Add some ifdefs to distinguish between Link and Slippy
I'll still need to decide what to do differently for Slippy, but for now let's just identify the places where there will likely be a difference. BUG=chrome-os-partner:18825 BRANCH=slippy TEST=manual Link still works. Change-Id: I950f0e5356ccf9838f2140d853122235f884e34f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49931
Diffstat (limited to 'chip')
-rw-r--r--chip/lm4/gpio.c15
-rw-r--r--chip/lm4/i2c.c2
-rw-r--r--chip/lm4/pwm_fan.c4
-rw-r--r--chip/lm4/switch.c2
-rw-r--r--chip/lm4/system.c2
5 files changed, 20 insertions, 5 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c
index 8429262abe..ab6423d570 100644
--- a/chip/lm4/gpio.c
+++ b/chip/lm4/gpio.c
@@ -217,13 +217,18 @@ void gpio_pre_init(void)
}
}
-/* List of GPIO IRQs to enable */
+/* List of GPIO IRQs to enable. Don't automatically enable interrupts for
+ * the keyboard input GPIO bank - that's handled separately. Of course the
+ * bank is different for different systems. */
static const uint8_t gpio_irqs[] = {
LM4_IRQ_GPIOA, LM4_IRQ_GPIOB, LM4_IRQ_GPIOC, LM4_IRQ_GPIOD,
LM4_IRQ_GPIOE, LM4_IRQ_GPIOF, LM4_IRQ_GPIOG, LM4_IRQ_GPIOH,
- LM4_IRQ_GPIOJ, LM4_IRQ_GPIOK, LM4_IRQ_GPIOL, LM4_IRQ_GPIOM,
+ LM4_IRQ_GPIOJ,
+#if defined(KB_SCAN_ROW_IRQ) && (KB_SCAN_ROW_IRQ != LM4_IRQ_GPIOK)
+ LM4_IRQ_GPIOK,
+#endif
+ LM4_IRQ_GPIOL, LM4_IRQ_GPIOM,
#if defined(KB_SCAN_ROW_IRQ) && (KB_SCAN_ROW_IRQ != LM4_IRQ_GPION)
- /* Don't enable interrupts for the keyboard input GPIO bank */
LM4_IRQ_GPION,
#endif
LM4_IRQ_GPIOP, LM4_IRQ_GPIOQ
@@ -280,7 +285,9 @@ GPIO_IRQ_FUNC(__gpio_f_interrupt, LM4_GPIO_F);
GPIO_IRQ_FUNC(__gpio_g_interrupt, LM4_GPIO_G);
GPIO_IRQ_FUNC(__gpio_h_interrupt, LM4_GPIO_H);
GPIO_IRQ_FUNC(__gpio_j_interrupt, LM4_GPIO_J);
+#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_K)
GPIO_IRQ_FUNC(__gpio_k_interrupt, LM4_GPIO_K);
+#endif
GPIO_IRQ_FUNC(__gpio_l_interrupt, LM4_GPIO_L);
GPIO_IRQ_FUNC(__gpio_m_interrupt, LM4_GPIO_M);
#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_N)
@@ -304,7 +311,9 @@ DECLARE_IRQ(LM4_IRQ_GPIOF, __gpio_f_interrupt, 1);
DECLARE_IRQ(LM4_IRQ_GPIOG, __gpio_g_interrupt, 1);
DECLARE_IRQ(LM4_IRQ_GPIOH, __gpio_h_interrupt, 1);
DECLARE_IRQ(LM4_IRQ_GPIOJ, __gpio_j_interrupt, 1);
+#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_K)
DECLARE_IRQ(LM4_IRQ_GPIOK, __gpio_k_interrupt, 1);
+#endif
DECLARE_IRQ(LM4_IRQ_GPIOL, __gpio_l_interrupt, 1);
DECLARE_IRQ(LM4_IRQ_GPIOM, __gpio_m_interrupt, 1);
#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_N)
diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c
index 506538eebf..12b53c2aa8 100644
--- a/chip/lm4/i2c.c
+++ b/chip/lm4/i2c.c
@@ -238,7 +238,7 @@ exit:
*/
static void configure_gpio(void)
{
-#ifdef BOARD_link
+#ifdef BOARD_link /* HEY: Slippy? */
/* PA6:7 = I2C1 SCL/SDA; PB2:3 = I2C0 SCL/SDA; PB6:7 = I2C5 SCL/SDA */
gpio_set_alternate_function(LM4_GPIO_A, 0xc0, 3);
gpio_set_alternate_function(LM4_GPIO_B, 0xcc, 3);
diff --git a/chip/lm4/pwm_fan.c b/chip/lm4/pwm_fan.c
index aac96757af..a19e42cca2 100644
--- a/chip/lm4/pwm_fan.c
+++ b/chip/lm4/pwm_fan.c
@@ -47,7 +47,7 @@ struct pwm_fan_state {
*/
static void configure_fan_gpios(void)
{
- /* HEY: this is Link only */
+ /* HEY: this is Link only. Slippy is PM2:3 */
/* PM6:7 alternate function 1 = channel 0 PWM/tach */
gpio_set_alternate_function(LM4_GPIO_M, 0xc0, 1);
}
@@ -164,8 +164,10 @@ static int command_fan_info(int argc, char **argv)
(LM4_FAN_FANSTS >> (2 * FAN_CH_CPU)) & 0x03);
ccprintf("Mode: %s\n", pwm_get_rpm_mode() ? "rpm" : "duty");
ccprintf("Enable: %s\n", pwm_get_fan_enabled() ? "yes" : "no");
+#ifdef BOARD_link /* HEY: Slippy? */
ccprintf("Power: %s\n",
gpio_get_level(GPIO_PGOOD_5VALW) ? "yes" : "no");
+#endif
return EC_SUCCESS;
}
diff --git a/chip/lm4/switch.c b/chip/lm4/switch.c
index 081d90b33b..57d8dffa88 100644
--- a/chip/lm4/switch.c
+++ b/chip/lm4/switch.c
@@ -550,12 +550,14 @@ DECLARE_HOST_COMMAND(EC_CMD_SWITCH_ENABLE_BKLIGHT,
static int switch_command_enable_wireless(struct host_cmd_handler_args *args)
{
+#ifdef BOARD_link /* HEY: Slippy? */
const struct ec_params_switch_enable_wireless *p = args->params;
gpio_set_level(GPIO_RADIO_ENABLE_WLAN,
p->enabled & EC_WIRELESS_SWITCH_WLAN);
gpio_set_level(GPIO_RADIO_ENABLE_BT,
p->enabled & EC_WIRELESS_SWITCH_BLUETOOTH);
+#endif
return EC_RES_SUCCESS;
}
diff --git a/chip/lm4/system.c b/chip/lm4/system.c
index 8bd3235da9..4a29d7ed9a 100644
--- a/chip/lm4/system.c
+++ b/chip/lm4/system.c
@@ -341,6 +341,8 @@ void system_pre_init(void)
check_reset_cause();
+ /* HEY: read LM4_SYSTEM_BOOTCFG bit 4 to determine WRKEY value */
+
/* Initialize bootcfg if needed */
if (LM4_SYSTEM_BOOTCFG != BOOTCFG_VALUE) {
LM4_FLASH_FMD = BOOTCFG_VALUE;