Letux 400 Hardware

Power

Table of Content

Power supply control

Power

The power supply is controlled using an LPC915 accessed via I2C/SMBUS. The schematic shows a P89LPC915 microcontroller specifically. See: https://style.nxp.com/docs/en/user-guide/UM10107.pdf

Of more direct relevance to drivers interacting with this microcontroller is the I2C-accessible interface it is programmed to expose, described as follows.

I2C Interface

In the legacy (letux-400) kernel, the I2C address of the microcontroller is given as (0x50 >> 1) or 0x28.

The mipsbook-mcu.c driver seems to reference the following I2C-accessible addresses, registers or "commands" (as Linux calls them):

Register Purpose
0xd8 control (bit 0 written for power off)
0xd9 status (bit 0 provides status)
0xdb voltage level

It is possible that the register numbers are coincidentally similar to the internal microcontroller registers (described in a section below), but they should not be confused.

See: https://web.archive.org/web/20090226101357/http://projects.kwaak.net/twiki/bin/view/Epc700/LPC915F

Voltage Level

LIPO battery with usable range 7.0V - 8.4V.

Battery level scaled by resistor divider to 3V from 8.4V with LPC915 powered by 3.3V (presumably used as reference), measuring the level in 255 increments (255 corresponds to 3.3V).

level in V = (3.3V / 255) * (8.4V / 3.0V) * value
level in µV = (3300000µv / 255) * (8400000µV / 3000000µV) * value
level in µV = 36235 * value

Without a battery installed, the voltage level merely reflects the supply voltage.

Shutdown (Power Down/Off)

Writing a byte with bit 0 set (for example, a value of 1) to I2C address 0xd8 will cause power to be disconnected after a short delay.

Microcontroller Internals

Registers related to I2C defined in the NXP documentation are given as follows:

Register Purpose
0xd8 control
0xd9 status (bits 7..3 provide status code)
0xda data
0xdb address

These are special function registers in the microcontroller itself, not I2C-accessible addresses or registers.

Resources

The following files in the vendor kernel are informative:

  • drivers/char/jzchar/minipc-misc.c

In modern kernels, the following files are pertinent:

  • drivers/power/supply/mipsbook-mcu.c

Created: 4 years 4 months ago
by Paul Boddie

Updated: 4 years 2 months ago
by Paul Boddie

Old Revisions