Should be no functional changes; this is just rearranging code.
BUG=none
TEST=boot system and type on console; should still work
Change-Id: I1c0d44db2d32048b1aaf458728b887b4a008c8cd
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24644
Tristage all columns as soon as possible right after the power button is
pressed. This can avoid the silego chip to reset the EC.
Resume the interrupt mode after power button is released so that the
deasserted columns doesn't trigger EC reset.
Also change some function names for export.
BUG=chrome-os-partner:7486
TEST=
press g first, then power button. repeat many times. system is not rebooted.
press power button first, then g. repeat many times. system is not rebooted.
ESC+power is still reseting system.
The long press power button still shutdowns system.
Change-Id: Ie5dec20ec3d3c4ffbd4acf5a4dd7f63eec38af56
The phenomenon is that there is a char on-hold in port 0x60 and the kernel
never picks it up. Hence the keyboard cannnot be recognized after resume.
It comes from multiple reasons:
1. The command I8042_CMD_RESET_BAT(0xff) and I8042_CMD_ENABLE(0xf4) didn't
clean the buffer.
2. clean_underlying_buffer() has clean the queue, but forgot to clean the
TOH (TO Host). Add keyboard_clean_buffer() to clean the TOH (To Host).
3. When KB interrupt is just enabled, the IRQ didn't sent if there is
a char queued in buffer already. keyboard_resume_interrupt() solves
this.
4. Not all keyboard reset should reset the buffer. Only the enable/disble
of controller RAM should NOT reset buffer. Other enable/disable
should clean the buffer.
5. i8042 commands (those commands to port 0x64) should NOT return ACK
even the parameter byte(s) goes to port 0x60.
6. Keyboard was disabled by kernel, but key stroke still sent to host
(this needs the BIOS to fix).
Also fix the minor issues:
1. I8042_CMD_RESEND should not return I8042_RET_ACK.
2. I8042_DIS_KB/I8042_ENA_KB should effect the controller RAM content.
3. only send out the scan code when keyboard is enabled.
4. add kblog command for future debug (disabled by default because it
neeeds 1KB of memory).
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
BUG=chrome-os-partner:9525
TEST=tested on link. Start from S0.
1. Run powerd_suspend.
2. Expect system is in S3.
3. Press any key to wake up system.
4. Expect system is up and keyboard is working.
5. repeat for 20+ times.
Change-Id: I1c48822687d7c1f7ef0e8d8bca54bf9b05fd785f
During the reboot_ec command, the keyboard state is lost after jump.
We need to restore info including:
- code set
- controller_ram[0]:
- XLATE
- KB/TP disabled
- KB/TP IRQ enabled
Remove the un-necessary keyboard_init() function.
BUG=chrome-os-partner:9102
TEST=tested on link.
EC runs on A
% ectool reboot_ec A
keyboard still working
% ectool reboot_ec RO
keybaord still working
% ectool reboot_ec RO
keybaord still working
ESC + power yo reset all system
repeat above steps and the keyboard keeps working.
Change-Id: I0fe21f7876459fc8047ff018fbfaaef5311cc49b
The reboot_ec command could warm boot the EC while the host is still
running. However, this resets the internal state so that the keyboard
module is disabled on the EC side.
Check the reset cause during the keyboard init code. If it is wrm boot,
enable the keyboard (assume the host is on).
BUG=chrome-os-partner:9102
TEST=on link 1.0
% ectool version
Firmware copy: RO
% ectool reboot_ec RO
the keyboard keeps working.
Change-Id: I0009c561e2cd88789e50f9129b494538e50ee00e
This CL attempts to abstract underlying bus from i8042 code. Nearly
all i8042 logic is isolated already. This patch is intended to allow
us to use i8042 logic for processing keys and commands on boards which
do not necessarily use LPC as the host <--> KBC bus interface.
This CL does the following:
- Define KBC bus <--> host (kbc_host_bus) on a per-board basis in
board.c.
- Add generic wrappers in place of lpc_keyboard_* in i8042 code.
- Define the behavior of generic wrappers in EC-specific keyboard
sources. If board.c specifies LPC, then send via LPC.
TODO: This needs to be tested on real hardware...
Signed-off-by: David Hendricks <dhendrix@chromium.org>
BUG=None
TEST=Locally compiled for Link, BDS and Discovery.
Change-Id: I9cabd514bd44fd6b508c26994eccc3011eedbc0f