diff options
author | Alexandru M Stan <amstan@chromium.org> | 2014-08-26 15:51:01 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-09-04 15:50:13 +0000 |
commit | 27a2fdf6651c2f2096c1555afcc8cba982be5f08 (patch) | |
tree | f7e09233ceb9115e7ae03e2b2844d2d2af757280 /board | |
parent | 41fdea92b53b6e186046dd1c1db3ff83b780504a (diff) | |
download | chrome-ec-27a2fdf6651c2f2096c1555afcc8cba982be5f08.tar.gz |
Veyron: Reset the PMIC properly at power on
There was a way to brick the PMIC by programming its registers with a bad
configuration, this could prevent the AP from powering up properly (thus not
being able to unbrick it). The PMIC retains register state through S5 (presumably
due to RTC business) and they do not get reset at bootup unless the OTP reset is
asserted.
The OTP reset actually has to be asserted in a special(rather long as well)
sequence.
A bug was discovered while making this change(crosbug.com/p/31635): usleep does
not work for long delays. Since I needed at least 300ms on one of the delays I
used a workaround with a loop.
I also cleaned up some old tegra stuff and renamed things to be more semantic.
BUG=None
BRANCH=None
TEST=From the AP set a PMIC register from the default value of 0x7d to 0xfd:
user@ap~$ modprobe i2c-dev
user@ap~$ i2cget -f -y 0 0x1b 0x24
Check what the default state is, mine was 0x7d
user@ap~$ i2cset -f -y 0 0x1b 0x24 0xfd #or change 0xfd to something!=default
Cold reboot the dut("apreset" or "power on\npower off" will work) then check if
the PMIC registers got reset:
user@ap~$ modprobe i2c-dev
user@ap~$ i2cget -f -y 0 0x1b 0x24
0x7d(or whatever your default state was) #good
0xfd #bad, did not reset properly
Using "user@ap~$ i2cset -f -y 0 0x1b 0x24 0x00" instead will prove the bricking
of the PMIC/AP.
Change-Id: Iad96781ffde085befe6dea20edd255ca3e7e1357
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/214360
Reviewed-by: Doug Anderson <dianders@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/veyron/gpio.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/board/veyron/gpio.inc b/board/veyron/gpio.inc index 86dc7b7060..ec464bc9b7 100644 --- a/board/veyron/gpio.inc +++ b/board/veyron/gpio.inc @@ -27,7 +27,6 @@ GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) GPIO(WP_L, B, 4, GPIO_INPUT, NULL) /* Outputs */ -GPIO(AP_RESET, B, 3, GPIO_OUT_HIGH, NULL) GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) @@ -48,7 +47,8 @@ GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(PMIC_PWREN, A, 12, GPIO_OUT_HIGH, NULL) +GPIO(PMIC_PWREN, A, 12, GPIO_OUT_LOW, NULL) +GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW, NULL) GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW, NULL) GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) |