diff options
author | Mary Ruthven <mruthven@google.com> | 2018-10-15 16:43:42 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-04 05:40:00 -0700 |
commit | fd2a6277b4b2262efda3d22e46ec9a48bc7339b2 (patch) | |
tree | 5aa32b343c83acae02943523bea51fb50f3c66a9 | |
parent | 4b5cbd49cc11ad3f341c6aea9f372da1c390c0e5 (diff) | |
download | chrome-ec-fd2a6277b4b2262efda3d22e46ec9a48bc7339b2.tar.gz |
cr50: make ccd_mode_l pseudo open drain
gpio.c has support for making pins open drain. This implementation will
prevent the signals from being driven high. Use the gpio.c support
instead of the hack we were using before.
BUG=none
BRANCH=cr50
TEST=the EC can assert CCD_MODE_L when cr50 has it deasserted. Verify
this on a ARM and x86 device in the lab.
Change-Id: I7f2a465782f2c60a850c25153fb65eb96fff0712
Signed-off-by: Mary Ruthven <mruthven@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1282019
Commit-Ready: Mary Ruthven <mruthven@chromium.org>
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | board/cr50/gpio.inc | 11 | ||||
-rw-r--r-- | chip/g/rdd.c | 6 |
2 files changed, 6 insertions, 11 deletions
diff --git a/board/cr50/gpio.inc b/board/cr50/gpio.inc index cd9348fd2c..7a8fc11787 100644 --- a/board/cr50/gpio.inc +++ b/board/cr50/gpio.inc @@ -100,8 +100,9 @@ GPIO(SYS_RST_L_OUT, PIN(0, 4), GPIO_INPUT) /* * Indicate to EC when CCD is enabled. EC can pull this down too, to tell us if * it decided instead. + * This is pseudo open drain. */ -GPIO(CCD_MODE_L, PIN(0, 5), GPIO_INPUT | GPIO_PULL_UP) +GPIO(CCD_MODE_L, PIN(0, 5), GPIO_ODR_HIGH | GPIO_PULL_UP) /* Battery present signal is active low */ GPIO(BATT_PRES_L, PIN(0, 6), GPIO_INPUT) @@ -175,13 +176,7 @@ PINMUX(GPIO(EN_PP3300_INA_L), B7, DIO_INPUT) * only change it to an output when we want to assert the signal. */ PINMUX(GPIO(SYS_RST_L_OUT), M0, DIO_INPUT) -/* - * CCD_MODE_L is an input above, but we need to be able to drive it as - * an output if Rdd detects the debug cable. So set DIO_OUTPUT as - * well. It will be tristated initially, because we don't set - * GPIO_OUTPUT above. - */ -PINMUX(GPIO(CCD_MODE_L), M1, DIO_INPUT | DIO_OUTPUT) +PINMUX(GPIO(CCD_MODE_L), M1, DIO_INPUT) PINMUX(GPIO(BATT_PRES_L), M2, 0) /* * Update closed_source_set1.c if pinmux for I2C_SCL_INA or I2C_SDA_INA is diff --git a/chip/g/rdd.c b/chip/g/rdd.c index 9460ad35e6..c58dce4806 100644 --- a/chip/g/rdd.c +++ b/chip/g/rdd.c @@ -74,7 +74,7 @@ static void rdd_disconnect(void) * This disables the SBUx muxes, if we were the only one driving * CCD_MODE_L. */ - gpio_set_flags(GPIO_CCD_MODE_L, GPIO_INPUT); + gpio_set_level(GPIO_CCD_MODE_L, 1); } DECLARE_DEFERRED(rdd_disconnect); @@ -99,8 +99,8 @@ static void rdd_connect(void) CPRINTS("Rdd connect"); state = DEVICE_STATE_CONNECTED; - /* Start pulling CCD_MODE_L low to enable the SBUx muxes */ - gpio_set_flags(GPIO_CCD_MODE_L, GPIO_OUT_LOW); + /* Assert CCD_MODE_L to enable the SBUx muxes */ + gpio_set_level(GPIO_CCD_MODE_L, 0); } DECLARE_DEFERRED(rdd_connect); |