1.. SPDX-License-Identifier: GPL-2.0 2 3Kernel driver kbatt 4=================== 5 6Supported chips: 7 8 * KEBA battery monitoring controller (IP core in FPGA) 9 10 Prefix: 'kbatt' 11 12Authors: 13 14 Gerhard Engleder <eg@keba.com> 15 Petar Bojanic <boja@keba.com> 16 17Description 18----------- 19 20The KEBA battery monitoring controller is an IP core for FPGAs, which 21monitors the health of a coin cell battery. The coin cell battery is 22typically used to supply the RTC during power off to keep the current 23time. E.g., the CP500 FPGA includes this IP core to monitor the coin cell 24battery of PLCs and the corresponding cp500 driver creates an auxiliary 25device for the kbatt driver. 26 27This driver provides information about the coin cell battery health to 28user space. Actually the user space shall be informed that the coin cell 29battery is nearly empty and needs to be replaced. 30 31The coin cell battery must be tested actively to get to know if its nearly 32empty or not. Therefore, a load is put on the coin cell battery and the 33resulting voltage is evaluated. This evaluation is done by some hard wired 34analog logic, which compares the voltage to a defined limit. If the 35voltage is above the limit, then the coin cell battery is assumed to be 36ok. If the voltage is below the limit, then the coin cell battery is 37nearly empty (or broken, removed, ...) and shall be replaced by a new one. 38The KEBA battery monitoring controller allows to start the test of the 39coin cell battery and to get the result if the voltage is above or below 40the limit. The actual voltage is not available. Only the information if 41the voltage is below a limit is available. 42 43The test load, which is put on the coin cell battery for the health check, 44is similar to the load during power off. Therefore, the lifetime of the 45coin cell battery is reduced directly by the duration of each test. To 46limit the negative impact to the lifetime the test is limited to at most 47once every 10 seconds. The test load is put on the coin cell battery for 48100ms. Thus, in worst case the coin cell battery lifetime is reduced by 491% of the uptime or 3.65 days per year. As the coin cell battery lasts 50multiple years, this lifetime reduction negligible. 51 52This driver only provides a single alarm attribute, which is raised when 53the coin cell battery is nearly empty. 54 55====================== ==== =================================================== 56Attribute R/W Contents 57====================== ==== =================================================== 58in0_min_alarm R voltage of coin cell battery under load is below 59 limit 60====================== ==== =================================================== 61