New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 631302 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Closed: Nov 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

stm32 usb config hardcoded to 500mA

Project Member Reported by nsanders@chromium.org, Jul 26 2016

Issue description

OS: cros_ec

All stm32 devices with USB indicate that they draw 500mA power. Realistically, most draw 0 and some draw ~<100mA. Can this default to something lower and have a config that can be adjusted per board?

At: https://chromium.googlesource.com/chromiumos/platform/ec/+/master/chip/stm32/usb.c#71

This causes init warnings on Mac as passive hubs' ports shouldn't provide 500mA by spec. 
 

Comment 1 by vpalatin@google.com, Jul 26 2016

> This causes init warnings on Mac as passive hubs' ports shouldn't provide 500mA by spec. 

Actually most of the hubs on the market (I would say > 90%) 'workaround' this issue by declaring themselves as self-powered even when they are bus-powered.
I'm even surprised you found one not doing this one weird trick (which is obviously not compliant), last time I tried to find one, I had to test at least a dozen.

> All stm32 devices with USB indicate that they draw 500mA power. 
> Realistically, most draw 0 and some draw ~<100mA. 
> Can this default to something lower and have a config that can be adjusted per board?

Actually some Apple hardware will also cut your power if you consume more than your declaration.

Having a per-board config is a good idea but I would let the default as is (it was a 'conscious' decision on this topic).

By the way, about the 'most draw 0', I'm not sure about your remark here, if we have self-powered devices (do we ? servo v4?), they should be declared as such rather than bus-powered.

Comment 2 Deleted

I was thinking of ryu and cr50, which are self powered.

Comment 4 by vpalatin@google.com, Jul 26 2016

for ryu and cr50, we can just remove the bus-powered bit (0x80) in bmAttributes, that's a more correct solution.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4

commit 3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4
Author: Nick Sanders <nsanders@chromium.org>
Date: Tue Jul 26 15:22:34 2016

servo_v4: servo_micro: cr50: fix usb power declaration

Servo_micro sets usb config maxpower to 100mA.

Servo_v4 is set to self powered as it's powered by a
shared vbus and not be the bub it's connected to.

cr50 is self powered as no power is transmitted as part of CCD.

* Add CONFIG_USB_MAXPOWER_MA to define USB maximum power draw requested
per board.
* Add CONFIG_USB_SELF_POWERED to indicate that a device is not
powered by allocated USB power.

BUG= chromium:631302 
TEST=lsusb reports 100mA bMaxPower (micro), Self powered (v4)
BRANCH=None

Change-Id: I79b8ce46f32d94f16104a4a8080104e30dce7f2c
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/363153
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>

[modify] https://crrev.com/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4/chip/stm32/usb.c
[modify] https://crrev.com/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4/board/cr50/board.h
[modify] https://crrev.com/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4/board/servo_micro/board.h
[modify] https://crrev.com/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4/chip/g/usb.c
[modify] https://crrev.com/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4/include/config.h
[modify] https://crrev.com/3e42a3b059d35310fe41bcc55d2d1b5d0efe0bd4/board/servo_v4/board.h

Comment 6 by dchan@chromium.org, Oct 26 2016

Labels: servov4
Owner: nsanders@chromium.org
Status: Fixed (was: Untriaged)

Comment 8 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 9 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 10 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 11 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 13 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment