Opened 10 years ago

Closed 10 years ago

Last modified 20 months ago

#1408 closed defect (fixed)

LiFePo batteries does not indicate /sys/class/battery/psu-0/technology

Reported by: jg Owned by: dwmw2
Priority: normal Milestone:
Component: embedded controller Version:
Keywords: power Cc: rsmith, dwmw2
Blocked By: Blocking:
Deployments affected: Action Needed:
Verified: no


The file says "unknown".

Not clear if this is due to the EC, the firmware or the Linux driver.

Attachments (1) (51 bytes) - added by David.Lin 10 years ago.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by David.Lin

comment:1 Changed 10 years ago by David.Lin

The batteries types are in the gas gauge address 0x5f.
Please use command 0x18 to read batteries types.
Example (

./iorwb 0x6c 0x18 Read gas gauge
./iorwb 0x68 0x5f
Read address 0x5f
./iorwb 0x68 return batteries types

(the scripts do not check the IBF and OBF bits in the 6c status register, so their correct operation depends on timing assumptions that are not guaranteed)

Batteries types define as following:
(1)NiMH (GP)

The battery type is 0x11.

(2)LiFePO4 (BYD)

The battery type is 0x22.

(3)LiFePO4 (GP )

The battery type is 0x12.

comment:2 Changed 10 years ago by wmb@…

We are having reliability problems with the EC commands accessed via ports 68 and 6c. I have tried a lot of different variations of code to access those commands. The work some of the times, but other times the IBF bit fails to go to 0 when expected, and the OBF bit sometimes does not go to 1 when expected.

We need a clear and complete specification for how the EC port 68/6c protocol works. Shell scripts that access the registers slowly without IBF/OBF checking are not an adequate specification. And we need extensive testing to make sure the EC executes the protocol reliably. We also need to do a code review to see if any bugs in the implementation can be found by code inspection.

comment:3 Changed 10 years ago by David.Lin

I am sorry for reliability problems with EC commands.
You can access 0xFB5F via ports 0x380. This data is battery type as above.

comment:4 Changed 10 years ago by jg

  • Keywords power added
  • Verified unset

comment:5 Changed 10 years ago by David.Lin

  • Owner changed from David.Lin to dwmw2
  • Verified unset

David Woodhouse, Please use command 0x18 to read batteries types.
The EC commands protocol reference web

comment:6 Changed 10 years ago by rsmith

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in new kernels.

comment:7 Changed 20 months ago by Quozl

  • Milestone Trial-3 deleted

Milestone Trial-3 deleted

Note: See TracTickets for help on using tickets.