g: deactivate the PHY during usb_release

The USB controller should disable the PHY itself when usb is released,
but from the power tests I ran it does not. This change adds a call in
usb_release to deactivate the PHY.

It looks like having the AP on vs off also makes a difference in power
consumption. I am looking into that now, but until that is resolved turn
of the AP off while testing this USB change to see the effects on power.

BUG=chrome-os-partner:54331
BRANCH=none
TEST=manual
	Without deactivating the PHY put cr50 into deep sleep on gru.
	run 'reboot ap-off'
	measure pp3300_haven_mw and it is around 4.5mW
	Add deactivating the PHY during usb_release.
	Put cr50 into deep sleep
	run 'reboot ap-off'
	measure the power and the average should be around 2mW

Change-Id: I16e6885a4e40c78e81d9bbc42c9af79e5f55047e
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/362159
Commit-Ready: Dan Shi <dshi@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Mary Ruthven
2016-07-21 17:06:34 -07:00
committed by chrome-bot
parent fac4f79fc5
commit e9a1e9eb41

View File

@@ -1360,6 +1360,9 @@ void usb_release(void)
/* disable interrupt handlers */
task_disable_irq(GC_IRQNUM_USB0_USBINTR);
/* Deactivate the PHY */
GR_USB_GGPIO = GGPIO_WRITE(USB_CUSTOM_CFG_REG, 0);
/* disable clocks */
clock_enable_module(MODULE_USB, 0);
/* TODO: pin-mux */