﻿//=================================================================================================
// KBC Version: 	00.08.09
// Date:		2026/01/05
// Base:		v000808
//=================================================================================================
1. Added PD patch bundle solution.
2. Fixed M/B version display issue.

//=================================================================================================
// KBC Version: 	00.08.08
// Date:		2025/06/27
// Base:		v000807
//=================================================================================================
1. Modify PD port stop power-sharing when PD adapter only.

//=================================================================================================
// KBC Version: 	00.08.07
// Date:		2025/01/06
// Base:		v000806
//=================================================================================================
1. Added Thunderbolt Charging function.
   In battery mode, the Thunderbolt port will not charge the device when the system is in S4/ S5.

//=================================================================================================
// KBC Version: 	00.08.06
// Date:		2024/06/12
// Base:		v000805
//=================================================================================================
1. Added windows flash function.

//=================================================================================================
// KBC Version: 	00.08.05
// Date:		2024/05/03
// Base:		v000804
//=================================================================================================
1. Fix power button delay problem caused by Dock out.

//=================================================================================================
// KBC Version: 	00.08.04
// Date:		2022/12/26
// Base:		v000803
//=================================================================================================
1. Fix PreCharge issue.

//=================================================================================================
// KBC Version: 	00.08.03
// Date:		2022/12/06
// Base:		v000802
//=================================================================================================
1. Delete AttDeviceBcTrigAssert function：send Mute Scan code.
2. Add SCI_BCTRIG_PRESS_CMD Event 0xDE.
       SCI_BCTRIG_RELEAS_CMD Event 0xDF.
3. Add H2RAM COMMAND 0x65.
   date 0x01 = SetBcTrigOutPinLow
   date 0x00 = SetBcTrigOutPinHigh
4. Modify SYS_ON low to be 10 seconds after entering shutdown.
5. Add swap Battery timeout function.
6. Fixed Flash EC completed Power_LED/BAT_LED will not turn off issue
7. Modify H2RAM COMMAND 0xF0 OEM_INTERNAL_TEST_REV Byte(4).

//=================================================================================================
// KBC Version: 	00.08.02
// Date:		2022/09/12
// Base:		v000801
//=================================================================================================
1. Fix Moderstandby Power_LED issue.

//=================================================================================================
// KBC Version: 	00.08.00
// Date:		2022/08/16
// Base:		v000709
//=================================================================================================
1. Add PROXIMITY_DPR# function.
2. Fixed PSensorProcess issue.
3. Modify Battery Temperature Control Mode.
4. [AMI] Update EC sleep time in MS/S5
   (MS)Sleep 1sec, wake up 20ms
   (S5)Sleep 300ms, wake up 20ms
4. Fix the system will hang up at S5 to S0 after 4-sec force shutdown

//=================================================================================================
// KBC Version: 	00.07.09
// Date:		2022/07/29
// Base:		v000708
//=================================================================================================
1. Modify bridge battery function : Suppoer Moder_Standby/S3/S4.
2. Modify Battery Led Control function：Battery_Only + S5 = Battery_LED off.
3. Modify P_Key function：
   3-1. Add 06FC_0x04 = SAS Key.
   3-2. Modify 06FC_0x05 = Programmable function.
   3-3. Modify DOS mode：Scan code(F2) to Scan code(F12).
4. Disable Combkey(P_Key + Power_Button).
5. Add Battery protection function：
   5-1. Standard Mode：Battery FC =1 stop charge.
   5-2. Advanced Mode：Battery percentage >= 80 stop charge.
   5-3. Temperature Mode：Battery FC =1 stop charge + Dynamic charge current for battery Temperature.
   5-4. Advanced Temperature Mode：Battery percentage >= 80 stop charge + Dynamic charge current for battery Temperature.
6. Add battery polymer support：
   6-1. Support set 1 = Battery is Polymer.
   6-2. Support set 0 = Battery is Cylinder.
7. Modify SMBUS block protocol timer from external to internal.
8. Add the UCSI debug function, because the UCSI driver is refreshed randomly in device manager. 
9. Fix the UCSI driver of yellow.
10. Correct 4cc command table.

//=================================================================================================
// KBC Version: 	00.07.08
// Date:		2022/07/13
// Base:		v000707
//=================================================================================================
1. Modify Battery Temperature Protect Function：
   1-1. Modify Battery Temperature < 45°C clear error flag.
   1-2. Modify Charge Current = 0 issue for error flag clear.
   1-3. GPE6(SYS_AC# = High) or Battery discharging：Disable Battery Temperature Protect Function.
2. Modify H2RAM Command 0x60 Battery Learn Mode function.
3. Disable 62/66 Command 0x60 Battery Learn Mode function.
4. Modify SysOnPinCtrlPolling function：GPG1(PM_SLP_WLAN#) is High or GPG6(LAN_EN) is High => GPE0(SYS_ON) not set Low.
5. Modify Power on function：PD_ONLY & PD Watt < 60W & Battery percentage < 10% not Power on.
6. Modify CheckDockStatus function：SetBit(AttDeviceStatus3, ATTDEVICE_DOCK) to SetBit(AttDeviceAttached3, ATTDEVICE_DOCK).
7. Disable BATChargingControl function.
8. Modify ThermalPollingData function：change the buffer from OEM_Temperature3 to OEM_Temperature5.
9. Add GPIO Initial：
   9-1. GPA6(EC_SLP_S0#).
   9-2. GPH7(PM_SLP_S0#).
10. Add PmSlpS0ChkPolling function.
11. Modify ChargerIC dynamic adjustment function.
12. Modify BatteryLedControl function. 13. Modify Stealth Mode function. 14. Add Brightness auto repeat function. 15. Modify volume up/down auto repeat function：count 100mS -> 40mS
16. GPD4(BRI_CHG_LID#) is Low => No send Battery_out Q_Event.
17. Modify Bridge battery function :
    17-1. Add ECRAM for BIOS : 0691_BIT3 => Bridge battery function support, 0:S3, 1:S4.
    17-2. 0691_BIT3 = 0 + EC_S3 : GPD4(BRI_CHG_LID#) is Low , GPJ1(BRI_BAT_ON) set High.
    17-3. 0691_BIT3 = 1 + EC_S5 : GPD4(BRI_CHG_LID#) is Low , GPJ1(BRI_BAT_ON) set High.
18. Fixing wrong power button behavior which is a side effect of combkey function.

//=================================================================================================
// KBC Version: 	00.07.07
// Date:		2022/06/27
// Base:		v000706
//=================================================================================================
1. Implement combkey function
2. Implement intel retimer function for PD FW update
3. EC judges physical GPIO pin when user pressed 4-sec to do force shutdown.Otherwise, EC use eSPI VW bit.

//=================================================================================================
// KBC Version: 	00.07.06
// Date:		2022/06/22
// Base:		v000705
//=================================================================================================
1. Add a delay time around 25ms in “AttDeviceBcTrigAssert”.
2. Modify the conditions of thermal protection from 45C to 50C.
3. Add functions “MstoS0Variable” and “S0toMsVariable”.
4. Modify function name “S3toS0Variable” and “S0toS3Variable”.
5. GPS and WWAN be turned on after resume from S3.
6. Add EventAdpOverieded to monitor flag “AC_ADP_IN”.
7. Enable “CPUPowerControl” and “BATChargingControl”.
8. Fix wrong power state after using stress tool when system resumes from S4/S5 (Tool name: sleeper2.3).
9. Update PD FW update API due to FIFO limitation：
   9-1. SmbFIFOWrite changes to SmbWriteBlock.
   9-2. SmbFIFORead changes to SmbReadBlockLimit.

//=================================================================================================
// KBC Version: 	00.07.05
// Date:		2022/06/13
// Base:		v000704
//=================================================================================================
1. Modify PD FW udate FIFO write structure from 8 bytes to 32 bytes.
2. Change bytecount of address from 0328h to 031Bh.

//=================================================================================================
// KBC Version: 	00.07.04
// Date:		2022/06/02
// Base:		v000703
//=================================================================================================
1. PWRSW/GPE4 (PWRBTN_SW#)
   1-1. Support the EC reset for 8-sec.
   1-2. Support force shutdown for 4-sec
2. Support combkey for P_prog + pwrbtn
3. Add a registor “control0(0x39h)” in chargeIC init talbe, value set to 0x0300
4. Support When thermal is keeping in high, EC will action to do force shutdown，EC will pull down GPE0 to force shutdown
5. Clear error flags of the battery after adapter in
6. Fix write wrong CC value after adapter in

//=================================================================================================
// KBC Version: 	00.07.03
// Date:		2022/05/26
// Base:		v000702
//=================================================================================================
1. Fix CC value should be clear after back from battery learn mode.
2. Fix the volume down only trigger once when user press continuously.
3. Create a new buffer that to avoid write 0 in charger voltage.
4. Remove polling function as below in ChargeIC table,
   4-1. ChargerIcCtrl1Write
   4-2. ChargerIcCtrl2Write
5. For customer request, disable below functions firstly,
   5-1. CPUPowerControl
   5-2. LCDBriControl
   5-3. BATChargingControl
   5-4. These functions will be reopened if any necessary.

//=================================================================================================
// KBC Version: 	00.07.02
// Date:		2022/05/23
// Base:		v000701
//=================================================================================================
1. Modify judging by GPIO pin for “system ac in”: GPE6 -> GPI3(ADPT_IN#) & Flag“PD1_ADAPTER_IN”(PD in) 
2. Update RF_CTRL:
   2-1. GPD5(GNSS_ON) & GPF3(WWAN_PWR) & GPF4(WWAN_ON) initial set OUTPUT+LOW+PULL_DW 
   2-2. PWRSTATE = S3：WWAN_PWR + WWAN_ON + GNSS_ON set OUTPUT+LOW 
   2-3. WWAN_PWR_ON -> Delay 100ms -> WWAN_ON & GNSS_ON 
3. The ChargeIC won’t write the CC value from battery value, just keep write the same CC value by default setting:
   3-1. High capacity: 0x07D0 
   3-2. Low capacity: 0x0708 
4. Fix and add scan code 0x23 in function “AttDeviceBcTrigAssert”
5. Update below values to a token: 
   5-1. ADP_ACL 
   5-2. PD_ ACL 
   5-3. ADP_PROHOT_VALUE 

//=================================================================================================
// KBC Version: 	00.07.01
// Date:		2022/05/10
// Base:		v000700
//=================================================================================================
1. Change GPIO settings as below:
   1-1. GPD5 – GPS(output pin).
   1-2. GPE4 – PWRBTN_SW#(input pin).
2. And keep the same setting for GPI7.

//=================================================================================================
// KBC Version: 	00.07.00
// Date:		2022/05/06
// Base:		v000604
//=================================================================================================
1. Modify charge ic initial setting from ISL95521A to ISL9241
2. Add check modern standby in CheckDockReady/EventVolUpPressed/EventVolDnPressed.
3. Add shipping mode function.
4. Remove token “ISL95521A_SUPPORT”
5. Add detect Hi-cap battery flag
6. Modify battery behavior in modern standby from turn off to normal.

//=================================================================================================
// KBC Version: 	00.06.04
// Date:		2022/04/22
// Base:		v000603
//=================================================================================================
1. Add read CPU temp by OOB of eSPI interface function.

//=================================================================================================
// KBC Version: 	00.06.03
// Date:		2022/04/22
// Base:		v000602
//=================================================================================================
1. Modify battery learn mode function.
   1-1. Turn off battery LED when enable battery learn mode.
   1-2. Add disable learning mode when S0 to S4/S5.
2. Clear normal charging counter when battery stop charging or remove AC.
3. Add send power button Qevent when press power switch key.

//=================================================================================================
// KBC Version: 	00.06.02
// Date:		2022/04/15
// Base:		v000601
//=================================================================================================
1. Modify PECI control behavior from input to output low when into modern standby.

//=================================================================================================
// KBC Version: 	00.06.01
// Date:		2022/04/15
// Base:		v000600
//=================================================================================================
1. Add Modern standby function.
	1-1. Disable battery LED when enter Modern standby.
	1-2. Change PECI status from ALT to Input when enter Modern standby.

//=================================================================================================
// KBC Version: 	00.06.00
// Date:		2022/04/08
// Base:		v000509
//=================================================================================================
1. Add PD_CONNECTOR_MAX token in TPS65994.c
2. Modify UCSI connector number from “2” to “1”.

//=================================================================================================
// KBC Version: 	00.05.09
// Date:		2022/04/01
// Base:		v000506
//=================================================================================================
1. Modify AttDeviceControl function for control behavior by BIOS control.
2. Add DOCK_READY#(GPI6) function.
3. Add DOCK_PWRBTN#(GPJ0) function.
4. Modify battery information in ACPI.
	4-1. Adjust EC read battery register table and function.
	4-2. Adjust ACPI of EC RAM.
5. Modify UCSI connector number from “2” to “1”.

//=================================================================================================
// KBC Version: 	00.05.06
// Date:		2022/03/23
// Base:		v000504
//=================================================================================================
1. Modify GPI3 define of OemGPIO.h
2. Modify Fan DAC initial setting.
3. Modify P-Sensor INT function.
4. Modify AttDeviceControl function name from “AttDeviceControlPolling” to “AttDeviceControl”.
5. Modify AttDeviceControl function.
6. Modify UCSI connector number from “2” to “1”.

//=================================================================================================
// KBC Version: 	00.05.05
// Date:		2022/03/23
// Base:		v000504
//=================================================================================================
1. Modify ChargerIcACL2Write function..
1. Modify UCSI connector number from “2” to “1”.
2. Modify GPI3 define of OemGPIO.h
3. Modify Fan DAC initial setting.
4. Modify P-Sensor INT function.
5. Modify AttDeviceControl function name from “AttDeviceControlPolling” to “AttDeviceControl”.
6. Modify AttDeviceControl function.

//=================================================================================================
// KBC Version: 	00.05.04
// Date:		2022/03/14
// Base:		v000503
//=================================================================================================
1. Modify ChargerIcACL2Write function..

//=================================================================================================
// KBC Version: 	00.05.03
// Date:		2022/03/11
// Base:		v000501
//=================================================================================================
1. Add exit EC Sleep mode when in S0
2. Modify UCSI_CONNECTOR_NUMBER from “2” to “1”
3. Add P_Sensor INT(GPD0) interrupt function

//=================================================================================================
// KBC Version: 	00.05.01
// Date:		2022/03/03
// Base:		v000500
//=================================================================================================
1. Remove LAN_WAKE_SUPPORT token and function.
2. Enable EC_SLEEP_MODE_SUPPORT token
3. Modify EC into Sleep mode condition
	3.1. Only battery and in S3
	3.2. AC exist and battery full charge
4. Modify EC exit sleep mode condition
	4.1. Plug-in AC
	4.2. Plug-in battery
	4.3. Any key press
	4.4. Press PWRBTN_SW#
5. Add press any key behavior and in S3 that OS resume from S3.
6. Change check DOS status form APM mode to OSMode.

//=================================================================================================
// KBC Version: 	00.05.00
// Date:		2022/02/25
// Base:		v000413
//=================================================================================================
1. Add TMR initial function
2. Add auto turn on when AC plug-in (under S5 and BIOS notify)
3. Modify Volume Up/Down multiple function of Volume Up/Down button
   3-1. In APM mode
   3-2. Typematic key
4. Add Stealth mode and programmable function of P1 button
5. Move subfunction” AttDeviceControlPolling” from 100mS to CMD 0x81of ACPI
6. Add S0 to S3 and S3 to S0 of power sequence

//=================================================================================================
// KBC Version: 	00.04.13
// Date:		2022/02/17
// Base:		v000412
//=================================================================================================
1. modify get PCB_board ID
2. add current limit ACL1/ACL2 setting
3. add thermal alarm and notify function by sample code “THERMAL_ALARM&NOTIFY_EVT_20220126.txt”
4. add retimer function by sample code “ReTimer_20220126.txt”
5. modify bridge battery function by sample code “BRI_BAT_ON_new.txt”

//=================================================================================================
// KBC Version: 	00.04.12
// Date:		2022/02/16
// Base:		v000411
//=================================================================================================
1. Add Volume up/down function.

//=================================================================================================
// KBC Version: 	00.04.11
// Date:		2022/02/10
// Base:		v000410
//=================================================================================================
1. Fix HwRevision register declaration.

//=================================================================================================
// KBC Version: 	00.04.10
// Date:		2022/02/10
// Base:		v000409
//=================================================================================================
1. Add "Set ACPI mode" command to 6266 interface to fix Qevent issue.

//=================================================================================================
// KBC Version: 	00.04.09
// Date:		2022/02/10
// Base:		v000408
//=================================================================================================
1. Implement TPS65994 Retimer fuction, but disable this function first.

//=================================================================================================
// KBC Version: 	00.04.08
// Date:		2022/02/10
// Base:		v000407
//=================================================================================================
1. Enable ADC0 and modify scan ADC0 channel function.

//=================================================================================================
// KBC Version: 	00.04.07
// Date:		2022/02/07
// Base:		v000406
//=================================================================================================
1. Arrange register of battery status, according to "Add ACPI_20220120.TXT".

//=================================================================================================
// KBC Version: 	00.04.06
// Date:		2022/02/07
// Base:		v000405
//=================================================================================================
1. Impplement UCSI support and TPS65994 PD module.

//=================================================================================================
// KBC Version: 	00.04.05
// Date:		2022/01/28
// Base:		v000404
//=================================================================================================
1. Implement Thermal protect function, according to "Thermal Policy for R8AA_20224120V3.xlsx".

//=================================================================================================
// KBC Version: 	00.04.04
// Date:		2022/01/28
// Base:		v000403
//=================================================================================================
1. Implement SCI interrupt go through ESPI Virtual Wire pin.

//=================================================================================================
// KBC Version: 	00.04.03
// Date:		2022/01/26
// Base:		v000402
//=================================================================================================
1. Implement PSensor interrupt handle.

//=================================================================================================
// KBC Version: 	00.04.02
// Date:		2022/01/25
// Base:		v000401
//=================================================================================================
1. EIP662286 Implement S4/S5 wake up WLAN support.

//=================================================================================================
// KBC Version: 	00.04.01
// Date:		2022/01/24
// Base:		v000400
//=================================================================================================
1. EIP662258 Fix PSensor initial table in formal release v04

//=================================================================================================
// KBC Version: 	00.04.00
// Date:		2022/01/21
// Base:		v000300
//=================================================================================================
1. Battery
	EIP658956 Implement Battery Learn Mode Control, according to "BAT_LEARNING.txt".
2. Temperature
	a. EIP660444 Implement memory temperature function, according to "GET_MEM_TEMPERATURE_20220114.txt".
	b. EIP660834 Implement FAN control function with DAC4 Output.
3. Attached Device
	a. EIP657003 Implement ACPI set attached device function, according to "ACPI EC SET DEVICE.txt".
	b. EIP659126 Implement Attached Device detect function for BC and MOD2_DET1/2, according to "ACPI EC SET DEVICE_20220107.txt".
	c. EIP659603 Implement Barcode trigger out function of PROG_SW button, according to "BARCODE TRIGGER_OUT_20220110.txt".
	d. EIP657910 Implement Nightvision function of PROG_SW button, according to "Nightvision sample code.TXT".
4. P Sensor
	EIP648956 Implement P Sensor initial, according to "P_sensor Initial.TXT" and "R8_20220114(SX9324 suggest initial).txt".
5. 686C CMD
	EIP658553 Enable ME_SECU & AMP_MUTE function with 686C interface, accroding to "ME_SECU & AMP_MUTE.txt".
6. TwinheadCmd
	EIP660836 Fix OemTwinheadCmd should handle Smbus R/W fail case.
7. KB Matrix
	EIP657913 Implement KB Matrix function, according to "K6A03_Matrix.pdf" and "K6A03-US-181023.pdf" and "K6A03-UK-181023.pdf".
8. PNPCFG
	a. EIP659532 PNPCFG Base Address Selection Change, set from 0x4E/4F to 0x164E/164F.
	b. EIP658479 Fix flash EC external ROM fail, now flash tool ifu242 can flash EC external ROM by set CFG port to 164E.
9. ACPIRAM
	EIP661808 Add new ACPIRAM position, according to "Add ACPI_20220120.TXT".

//=================================================================================================
// KBC Version: 	00.03.00
// Date:		2021/12/23
// Base:		v000200
//=================================================================================================
1. GPIO
	a. EIP649421 Implement BRI_BAT_ON pin control, according to "BRI_BAT_ON.txt".
	b. Implement GNSS_ON pin initial configuration change, according to  "202111261-AMI_EC_GPIO_S0-S5 - Twinhead.xlsx".
	c. EIP654000 Implement BRI_BAT_ON pin initial configuration change, according to "202112091-AMI_EC_GPIO_S0-S5 - Twinhead.xlsx".
2. Battery Protection Behavior
	EIP650030 Implement battery protection behavior, according to "Battery protect behavior.txt".
3. Battery LED
	a. EIP651278 Implement battery LED function, according to "20211125_Bat LED Behavior.xlsx".
	b. EIP654000 Implement battery LED behavior change of "DCS5 BAT<7%", according to "20211209_Bat LED Behavior.xlsx".
4. H2RAM
	EIP655235 Implement OemTwinheadCmd module for ShareRAMWindow Command (H2RAM), refer to "TWINHEAD_R8_H2RAM_Format_v1.2.pdf"
5. Fix
	EIP652158 Fix: power state should not enter "G3toS5" when adapter plug in under S5.

//=================================================================================================
// KBC Version: 	00.02.00
// Date:		2021/11/25
//=================================================================================================
1. EIP650963 Fix: For power on, move "set SYS_ON high" to former of "enable eSPI" in power sequence.

//=================================================================================================
// KBC Version: 	00.01.00
// Date:		2021/11/12
//=================================================================================================
1. Based on AMI ITE5571 code base and "R8 Internal Spec_V01_20210805.pdf".
2. GPIO Initial configuration beased on "202111012-AMI_EC_GPIO_S0-S5 - Twinhead(NEW).xlsx".
3. Power sequence based on "TURN_ON_POWER.TXT", "TURN_OFF_POWER.TXT" and "Load GPIO Config.TXT".
4. ChargerIC initial setting based on "ChargerIC Initial.TXT" and "isl95521a_ds-2016-05-09.pdf".

