summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2019-04-18 13:26:39 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-04-19 14:45:16 -0700
commit08234bde615db42c9ba509d2a2b5b1a2d43ac963 (patch)
tree5cdbd13fe93eec044fb14e58b5017d1d3cce2b69
parent1ab49b02f6d8662996ab245f3d2add46f10efddf (diff)
downloadchrome-ec-08234bde615db42c9ba509d2a2b5b1a2d43ac963.tar.gz
kohaku: Remove dynamic GPIO configureation for EN_PP500_A
Hatch uses a different pin for GPIO_EN_PP5000_A, depending on board id. Kohaku does not have this issue and GPIO_EN_PP5000_A can be set correctly in its gpio.inc file. BUG=b:130577280 BRANCH=none TEST=Compiles (no Kohaku device yet to test on). Change-Id: I70a1c37c1362b35a698bb616ff0b658c3ebd1c3f Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574699 Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r--board/kohaku/board.c36
-rw-r--r--board/kohaku/board.h1
-rw-r--r--board/kohaku/gpio.inc3
3 files changed, 2 insertions, 38 deletions
diff --git a/board/kohaku/board.c b/board/kohaku/board.c
index 70b0471301..6511ee31f6 100644
--- a/board/kohaku/board.c
+++ b/board/kohaku/board.c
@@ -298,46 +298,12 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT];
-/* Sets the gpio flags correct taking into account warm resets */
-static void reset_gpio_flags(enum gpio_signal signal, int flags)
-{
- /*
- * If the system was already on, we cannot set the value otherwise we
- * may change the value from the previous image which could cause a
- * brownout.
- */
- if (system_is_reboot_warm() || system_jumped_to_this_image())
- flags &= ~(GPIO_LOW | GPIO_HIGH);
-
- gpio_set_flags(signal, flags);
-}
-
-/* Runtime GPIO defaults */
-enum gpio_signal gpio_en_pp5000_a = GPIO_EN_PP5000_A_V1;
-
-static void board_gpio_set_pp5000(void)
-{
- uint32_t board_id = 0;
-
- /* Errors will count as board_id 0 */
- cbi_get_board_version(&board_id);
-
- if (board_id == 0) {
- reset_gpio_flags(GPIO_EN_PP5000_A_V0, GPIO_OUT_LOW);
- /* Change runtime default for V0 */
- gpio_en_pp5000_a = GPIO_EN_PP5000_A_V0;
- } else if (board_id >= 1) {
- reset_gpio_flags(GPIO_EN_PP5000_A_V1, GPIO_OUT_LOW);
- }
-
-}
+enum gpio_signal gpio_en_pp5000_a = GPIO_EN_PP5000_A;
static void board_init(void)
{
/* Enable gpio interrupt for base accelgyro sensor */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
- /* Select correct gpio signal for PP5000_A control */
- board_gpio_set_pp5000();
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/kohaku/board.h b/board/kohaku/board.h
index 98406f6fb6..9a1d7a17cc 100644
--- a/board/kohaku/board.h
+++ b/board/kohaku/board.h
@@ -96,7 +96,6 @@
#include "registers.h"
/* GPIO signals updated base on board version. */
-#define GPIO_EN_PP5000_A gpio_en_pp5000_a
extern enum gpio_signal gpio_en_pp5000_a;
enum adc_channel {
diff --git a/board/kohaku/gpio.inc b/board/kohaku/gpio.inc
index 9aa52d7d79..c8e1c1bd51 100644
--- a/board/kohaku/gpio.inc
+++ b/board/kohaku/gpio.inc
@@ -44,8 +44,7 @@ GPIO(PCH_WAKE_L, PIN(7, 4), GPIO_ODR_HIGH) /* EC_PCH_WAKE_O
GPIO(PCH_PWRBTN_L, PIN(C, 1), GPIO_ODR_HIGH) /* EC_PCH_PWR_BTN_ODL */
/* Power Sequencing Signals */
-GPIO(EN_PP5000_A_V1, PIN(A, 4), GPIO_DEFAULT)
-GPIO(EN_PP5000_A_V0, PIN(7, 3), GPIO_DEFAULT)
+GPIO(EN_PP5000_A, PIN(A, 4), GPIO_OUT_LOW)
GPIO(EN_A_RAILS, PIN(A, 3), GPIO_OUT_LOW)
GPIO(EC_PCH_RSMRST_L, PIN(A, 6), GPIO_OUT_LOW)
GPIO(EC_PROCHOT_ODL, PIN(6, 3), GPIO_ODR_HIGH)