summaryrefslogtreecommitdiff
path: root/baseboard/hatch/baseboard.c
diff options
context:
space:
mode:
authorCHLin <CHLIN56@nuvoton.com>2019-07-16 17:12:43 +0800
committerCommit Bot <commit-bot@chromium.org>2019-07-23 13:49:25 +0000
commit3fb2394b245c9d98e631443eff70f97758413f3e (patch)
tree85c0e6d647f460572b23ad7b1dd6428b5a3a4c04 /baseboard/hatch/baseboard.c
parent0ae8c5584d3648c76bd8e8fca0a27ae20d1bb761 (diff)
downloadchrome-ec-3fb2394b245c9d98e631443eff70f97758413f3e.tar.gz
npcx7: UART: wait for Tx empty before enabling deep-sleep
In the original firmware (in the uart_buffering.c), it clears the SLEEP_MASK_UART immediately after it pushes all characters from its Tx buffer to UART's FIFO without checking the status of transmission. It may break the transmission because EC goes to deep sleep before UART TX (FIFO or shift register) becomes empty. This CL fixes it by: (1) Don't clear SLEEP_MASK_UART immediately when uart_tx_stop is called. (2) Enable the NXMIP (No Transmit in Progress) interrupt. (3) Clear SLEEP_MASK_UART in the UART interrupt handler when NXMIP is set. This fix only needs to apply to NPCX7 chips which have UART FIFO support. BRANCH=none BUG=b:137143640 TEST=No error for "make buildall" TEST=run 10 iterations of uart_stress_tester on yorp with command: ./util/uart_stress_tester.py /dev/ttyUSB2 -t 360; make sure no character lost in each iteration as below: ... INFO | UartSerial| /dev/ttyUSB2 | Detected as EC UART INFO | UartSerial| EC | Ready to test INFO | ChargenTest | Ports are ready to test INFO | ChargenTest | Test starts INFO | UartSerial| EC | Test thread starts INFO | UartSerial| EC | Test thread is done INFO | UartSerial| EC | 0 char lost / 4147200 (0.0 %) INFO | ChargenTest | PASS: lost 0 character(s) from the test INFO | ChargenTest | Test is done Change-Id: I97b1f572e8b9ebdb5102aa3e98ae2963d768b5b3 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1703944 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com>
Diffstat (limited to 'baseboard/hatch/baseboard.c')
0 files changed, 0 insertions, 0 deletions