#Maintained by: RehabMan for: Laptop Patches #battery_Fujitsu-Lifebook-A555.txt # Fujitsu Lifebook A555 (Broadwell) battery fix v2 by Ressetkk # This is alternative patch for Fujitsu Lifebook A555 since the original B1B2 method did not work in first case - the _BIX/_BIF method returned wrong values. # I’ve decided to use offsets and RECB/WECB methods for all 16-bit+ fields and it worked somehow. # If this patch does not work for you try to use another one # Rename all needed fields into device label EC0 code_regex (BNAM,)\s+(120) replace_matched begin BNAX,%2,//%1%2 0xD0 end; into device label EC0 code_regex (BCNO,)\s+(256) replace_matched begin BCNX,%2,//%1%2 0x80 end; into device label EC0 code_regex (SMD0,)\s+(264) replace_matched begin SMDX,%2,//%1%2 0x1C end; into device label EC0 code_regex (SMW0,)\s+(16) replace_matched begin SMWX,%2,//%1%2 0x1C end; into device label EC0 code_regex (BATD,)\s+(16) replace_matched begin BATX,%2,//%1%2 0x63 end; into device label EC0 code_regex (BT1I,)\s+(16) replace_matched begin BTIX,%2,//%1%2 0x46 end; into device label EC0 code_regex (BT1C,)\s+(16) replace_matched begin BTCX,%2,//%1%2 0x48 end; into device label EC0 code_regex (BT1V,)\s+(16) replace_matched begin BTVX,%2,//%1%2 0x50 end; into device label EC0 code_regex (BTAP,)\s+(16) replace_matched begin BTAX,%2,//%1%2 0x6A end; into device label EC0 code_regex (BTFC,)\s+(16) replace_matched begin BTFX,%2,//%1%2 0x6C end; into device label EC0 code_regex (BTDV,)\s+(16) replace_matched begin BTDX,%2,//%1%2 0x75 end; into device label EC0 code_regex (BTCC,)\s+(16) replace_matched begin BCCX,%2,//%1%2 0xE2 end; # Replace all renamed method with proper RECB and WECB methods # SMD0 into method label SMRW code_regex Store\s\(Arg3,\s\\_SB.PCI0.LPCB.EC0.SMD0\) replaceall_matched begin \\_SB.PCI0.LPCB.EC0.WECB(0x1C,264, Arg3) end; into method label SMRW code_regex \(\\_SB.PCI0.LPCB.EC0.SMD0 replaceall_matched begin (\\_SB.PCI0.LPCB.EC0.RECB(0x1C,264) end; # SMW0 into method label SMRW code_regex Store\s\(Arg3,\s\\_SB.PCI0.LPCB.EC0.SMW0\) replaceall_matched begin \\_SB.PCI0.LPCB.EC0.WECB(0x1C,16, Arg3) end; into method label SMRW code_regex \(\\_SB.PCI0.LPCB.EC0.SMW0 replaceall_matched begin (\\_SB.PCI0.LPCB.EC0.RECB(0x1C,16) end; # BCNO into method label UPBX code_regex \(\^\^PCI0.LPCB.EC0.BCNO replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x80,256) end; into method label UPBI code_regex \(\^\^PCI0.LPCB.EC0.BCNO replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x80,256) end; # BNAM into method label UPBX code_regex \(\^\^PCI0.LPCB.EC0.BNAM replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xD0,120) end; into method label UPBI code_regex \(\^\^PCI0.LPCB.EC0.BNAM replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xD0,120) end; # BATD into method label SELE code_regex \(BATD replaceall_matched begin (RECB(0x63,16) end; into method label _PSR code_regex \^\^PCI0.LPCB.EC0.BATD\) replaceall_matched begin \^^PCI0.LPCB.EC0.RECB(0x63,16)\)\ end; # BTAP into method label UPBX code_regex \(\^\^PCI0.LPCB.EC0.BTAP replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x6A,16) end; into method label UPBI code_regex \(\^\^PCI0.LPCB.EC0.BTAP replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x6A,16) end; into method label S203 code_regex \(\^\^PCI0.LPCB.EC0.BTAP replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x6A,16) end; into method label CHKB code_regex \\_SB.PCI0.LPCB.EC0.BTAP\) replaceall_matched begin \\_SB.PCI0.LPCB.EC0.RECB(0x6A,16)\)\ end; # BTFC into method label UPBX code_regex \(\^\^PCI0.LPCB.EC0.BTFC replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x6C,16) end; into method label UPBI code_regex \(\^\^PCI0.LPCB.EC0.BTFC replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x6C,16) end; into method label S203 code_regex \(\^\^PCI0.LPCB.EC0.BTFC replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x6C,16) end; # BTDV into method label UPBX code_regex \(\^\^PCI0.LPCB.EC0.BTDV replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x75,16) end; into method label UPBI code_regex \(\^\^PCI0.LPCB.EC0.BTDV replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x75,16) end; # BTCC into method label UPBX code_regex \(\^\^PCI0.LPCB.EC0.BTCC replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xE2,16) end; into method label S203 code_regex \(\^\^PCI0.LPCB.EC0.BTCC replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0xE2,16) end; # BT1I into method label UPBS code_regex \(\^\^PCI0.LPCB.EC0.BT1I replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x46,16) end; # BT1C into method label UPBS code_regex \(\^\^PCI0.LPCB.EC0.BT1C replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x48,16) end; # BT1V into method label UPBS code_regex \(\^\^PCI0.LPCB.EC0.BT1V replaceall_matched begin (^^PCI0.LPCB.EC0.RECB(0x50,16) end; # Add RECB and WECB methods # utility methods to read/write buffers from/to EC into method label RE1B parent_label EC0 remove_entry; into method label RECB parent_label EC0 remove_entry; into device label EC0 insert begin Method (RE1B, 1, NotSerialized)\n {\n OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n Return(BYTE)\n }\n Method (RECB, 2, Serialized)\n // Arg0 - offset in bytes from zero-based EC\n // Arg1 - size of buffer in bits\n {\n ShiftRight(Add(Arg1,7), 3, Arg1)\n Name(TEMP, Buffer(Arg1) { })\n Add(Arg0, Arg1, Arg1)\n Store(0, Local0)\n While (LLess(Arg0, Arg1))\n {\n Store(RE1B(Arg0), Index(TEMP, Local0))\n Increment(Arg0)\n Increment(Local0)\n }\n Return(TEMP)\n }\n end; into method label WE1B parent_label EC0 remove_entry; into method label WECB parent_label EC0 remove_entry; into device label EC0 insert begin Method (WE1B, 2, NotSerialized)\n {\n OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n Store(Arg1, BYTE)\n }\n Method (WECB, 3, Serialized)\n // Arg0 - offset in bytes from zero-based EC\n // Arg1 - size of buffer in bits\n // Arg2 - value to write\n {\n ShiftRight(Add(Arg1,7), 3, Arg1)\n Name(TEMP, Buffer(Arg1) { })\n Store(Arg2, TEMP)\n Add(Arg0, Arg1, Arg1)\n Store(0, Local0)\n While (LLess(Arg0, Arg1))\n {\n WE1B(Arg0, DerefOf(Index(TEMP, Local0)))\n Increment(Arg0)\n Increment(Local0)\n }\n }\n end;