Page MenuHomeFreeBSD

AXP209 Power Management Unit
ClosedPublic

Authored by manu_bidouilliste.com on Jan 15 2016, 1:51 PM.
Tags
Referenced Files
Unknown Object (File)
May 24 2024, 9:47 PM
Unknown Object (File)
May 22 2024, 3:19 PM
Unknown Object (File)
May 22 2024, 3:03 PM
Unknown Object (File)
May 22 2024, 12:44 AM
Unknown Object (File)
May 21 2024, 7:09 PM
Unknown Object (File)
May 21 2024, 7:08 PM
Unknown Object (File)
May 21 2024, 7:08 PM
Unknown Object (File)
May 21 2024, 7:08 PM
Subscribers

Details

Summary

Basic support for the AXP209 found in board with A10 and A20 SoC.
It prints in dmesg what is the source of power (AC, USB, Battery) and shutdown the SoC at shutdown

Test Plan

Apply I2C patch (review D4846)
Apply patch and build kernel
Verify that the board correctly shutdown when 'shutdown -p now'

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu_bidouilliste.com retitled this revision from to AXP209 Power Management Unit.
manu_bidouilliste.com updated this object.
manu_bidouilliste.com edited the test plan for this revision. (Show Details)
manu_bidouilliste.com set the repository for this revision to rS FreeBSD src repository - subversion.
manu_bidouilliste.com added a project: ARM.
sys/arm/allwinner/axp209.c
124–126 ↗(On Diff #12357)

This should move to the attach function.

130 ↗(On Diff #12357)

You should return BUS_PROBE_DEFAULT here.

137 ↗(On Diff #12357)

This looks like odd indentation

143 ↗(On Diff #12357)

What are these magic values?

146 ↗(On Diff #12357)

I think this should be under bootverbose.

sys/arm/allwinner/files.allwinner
17 ↗(On Diff #12357)

the sorting on this file is a little off

manu_bidouilliste.com edited edge metadata.

Only printf messages when in bootverbose.
Get our i2c addr in attach instead of probe.
Explain the bit logic to find the power source.

The new diff handle all your remarks (I hope)

sys/arm/allwinner/axp209.c
126 ↗(On Diff #12469)

You're still setting this in the probe function. Its doesn't seem to be used so could be removed

150 ↗(On Diff #12469)

Google thinks register 0x00 is the Power State Register, it would be nice if there was a macro for this, e.g.

#define AXP209_PSR 0x00

Add register defines
Remove dev from softc since we don't need it.

Last comment are now fixed.

Rename driver to axp209_pmu
As driver name ends with number it is not really pretty to have axp2090 in dmesg.

sys/arm/allwinner/axp209.c
55 ↗(On Diff #13127)

#define<tab>AXP...

56–57 ↗(On Diff #13127)

s/REG00/PSR/g (and below with REG32 -> SHUTBAT)

153 ↗(On Diff #13127)

How long is this line? It's difficult to tell if it's past the 80 character limit.

Rename register define to have name instead of reg number.
Fix style(9)

Update diff because of recent -HEAD change.
Also add axp209 to A10 kernel config file.

andrew added a reviewer: andrew.

There are a few style(9) issues, but I'll fix them before committing.

This revision is now accepted and ready to land.Feb 15 2016, 7:02 PM
This revision was automatically updated to reflect the committed changes.