Files
OpenCellular/board
Randall Spangler 3c2c1398ec Set SPI lines to inputs when AP is off
When AP is off, turn off pullup on NSS, and set MISO to an input so
the SPI module won't drive it high if the last sent bit was a 1.  This
reduces leakage when the AP is off.

This patch also fixes a bug where gpio_set_alternate_function() set
the wrong pins to normal-mode when func=-1; that didn't hit anything
else because that functionality wasn't used on STM32 until now.

BUG=chrome-os-partner:19304
BRANCH=none
TEST=boot pit

On EC console, with AP on, 'rw 0x40020000' returns
read 0x40020000 = 0x6569aa20  <- must have 0x____aa__

Then 'apshutdown' and 'rw 0x40020000' returns
read 0x40020000 = 0x65690020  <- must have 0x____00__

The 'power on' and AP turns back on.  At u-boot prompt,
'sspi 2:0 256 9f00000000' returns
FDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFEEC010001
(some number of 0xFD's followed by FEEC...)  This shows SPI
functionality is restored when AP is powered back on, and not
just at init time.

Change-Id: Ia3cd3e0bc222dc663d635509918fa3d383fd7971
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51182
Reviewed-by: Simon Glass <sjg@chromium.org>
2013-05-16 13:07:15 -07:00
..
2013-05-16 11:10:28 -07:00