• Andre Przywara's avatar
    allwinner: power: fix DRIVEVBUS pin setup · d93eb446
    Andre Przywara authored
    
    
    The DRIVEVBUS pin setup was broken in two ways:
    - To configure this pin as an output pin, one has to *clear* the bit in
      register 0x8f. It is 0 by default, but rebooting from Linux might have
      left this bit set.
    - Doing this just configures the pin as an output pin, but doesn't
      actually drive power to it. This is done via bit 2 in register 0x30.
    
    Fix the routine to both properly configure the pin and drive power to
    it. Add an axp_clrsetbits() helper on the way.
    
    Now this isn't really perfect, still:
    We only need to setup the PMIC power rails that are needed for U-Boot.
    DRIVEVBUS typically controls the VBUS voltage for the host function of
    an USB-OTG port, something we typically don't want in U-Boot (fastboot,
    using the USB *device* functionality, is much more common). The
    BananaPi-M64 uses the regulator in this way, but the Remix Mini PC
    actually controls the power of both its USB ports via this line.
    
    Technically we should differentiate here: if DRIVEVBUS controls a
    microUSB-B socket, the power should stay off, any host-type A sockets
    should be supplied, though.
    For now just always enable the power, that shouldn't really hurt the
    USB-OTG functionality anyway.
    Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
    d93eb446
sunxi_power.c 9.07 KB