View source for GTA02 sysfs
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to GTA02 sysfs.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Return to GTA02 sysfs.
sysfs is a filesystem that is mounted on /sys which contains various fake "files" that are actually filled by a variety of drivers and other kernel subsystems. You can often also write stuff into these "files" using
echo 1 > /sys/blah...
to change settings and behaviours of the kernel and drivers dynamically. (When doing this, take care you have a space before the redirection operator > or the shell will do something completely different with your command.)
Normally you set these two guys at the same time for the same mode, but there is a trick possible to select logical host mode but leave the power arrangements as if it was in device mode and apply external power. You need to externally add 15K pulldowns on D+ and D- if you do this, because we did not enable them the normal way. With this, you can have a USB device attached to GTA02, and use external power and charge the battery at the same time.
If you cat this you get a list of possible resume sources in text with one or more * at the left of the active source that woke us. You need a recent U-Boot to get the * set.
For extreme meddlers (I salute you), these let you control the wait states and other characteristics of the memory regions of the Freerunner. Information and warnings about how to use these are here:
http://git.openmoko.org/?p=kernel.git;a=commitdiff;h=fd25f90517322fc6c07bfb8d34752d3cb41cb4b6
FIQ is used to provide precision interrupt service in order to implement the HDQ protocol used to the battery couloumb counter. This shows how many FIQ interrupts have been run since the kernel started. It's turned off unless it is required.
If you cat this, you will see the raw contents of HDQ device register space. This is the bq27000 couloumb counter in our case.
This allows you to write to raw HDQ registers, using "<decimal register index> <decimal value>"
Most of these are coming from the coulomb counter over HDQ dynamically, but the bq27000 does not update a lot of its registers any more often than once per 4 seconds. Therefore a lot of this info can be a bit stale or averaged over that period.
Just says "Battery"
This will summarize what goes on generally with the battery
Battery voltage in uV, averaged. Obviously this depends on load and place on discharge curve, etc.
Current being drawn from battery (+ve) or pushed into battery during charging (-ve) in uA
Coulomb Counter's estimate of the capacity of the battery measured in uA/h. It roughly means that if full, for one hour it could supply current at this rate. I saw 1197913 reported on mine, so it estimates it can provide 1.2A for an hour.
This is the battery temperature reported by the Coulomb Counter chip that is part of the physical battery. It is in Celcius * 10, so 251 means 25.1 degrees.
"Li-ion"
At current rate of discharge, estimate of how long we can run for. If battery is not discharging, it won't make an estimate and will return a magic value "3932100" meaning "no estimate". The coulomb counter averages the load and adjusts this value slowly to be its estimate of when we will blow chunks.
This estimates how long until we are fully charged, at current rate of charging, in seconds. If we are not charging, it gives the magic value "3932100" meaning "no estimate".
This is the remaining capacity of charge in the battery in percent. This is probably the most useful figure here.
Shows the detected charger type followed by the mode it is running in. So "charger 500mA mode 100mA" would be the case for non-enumerated USB connection, "charger 500mA mode 500mA" for after enumeration.
This is added to allow the PMU to be told to take more current than the default rules allow. Use it only if you know your charger source can handle it. For example
echo 500 > /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/force_usb_limit_dangerous
will allow PMU to draw 500mA even though you are connected to a dumb charger where the limit is normally held at 100mA, since it didn't enumerate the GTA02. You can give 0, 100, 500 or 1000 here, but make sure your charger source can handle what you give here, otherwise it can exceed what is safe for your charging source to provide.
cat this to get a dump of the I2C registers for the PMU, useful for debugging power problems.
cat this to get a dump of codec registers. Note they are 9-bit wide.
You can write to any codec register by echoing "<codec reg index in hex> <value in hex>" to here
cat this to get a dump of selected Glamo regs. You can write the regs by echoing "<glamo reg index in decimal> <value in decimal>" here.