summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMulin Chao <mlchao@nuvoton.com>2016-02-10 22:01:18 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-10 15:45:51 -0800
commit71a8c029824f62693c9afbade597a58337cb2632 (patch)
treee9626c3ec725624c2e0cda25566a9d4aabf08029
parent27ce00c164c2e27177afc1a9cf1ece380ba1e0c2 (diff)
downloadchrome-ec-71a8c029824f62693c9afbade597a58337cb2632.tar.gz
nuc: Fixed bug that some of DP80's data is skipping
Fixed the bug that some of DP80's data is skipping if the speed of writing by host is high. The solution is grabbing all data and sending them to UART until FIFO of DP80 is empty in ISR. Modified sources: 1. lpc.c: Fixed the bug that some of DP80's data is skipping. BUG=chrome-os-partner:34346 TEST=make buildall -j; test nuvoton IC specific drivers BRANCH=none Change-Id: Ie53a5c7f0a80a1f836b571a00871cb57b42c87db Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/326931 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/npcx/lpc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/chip/npcx/lpc.c b/chip/npcx/lpc.c
index 5d5e13e185..c86872e927 100644
--- a/chip/npcx/lpc.c
+++ b/chip/npcx/lpc.c
@@ -548,10 +548,17 @@ DECLARE_IRQ(NPCX_IRQ_PM_CHAN_OBE, lpc_pmc_obe_interrupt, 2);
void lpc_port80_interrupt(void)
{
- port_80_write(NPCX_DP80BUF);
+ /* Send port 80 data to UART continuously if FIFO is not empty */
+ while (IS_BIT_SET(NPCX_DP80STS, 6))
+ port_80_write(NPCX_DP80BUF);
+
+ /* If FIFO is overflow */
+ if (IS_BIT_SET(NPCX_DP80STS, 7)) {
+ SET_BIT(NPCX_DP80STS, 7);
+ CPRINTS("DP80 FIFO Overflow!");
+ }
- /* No matter what , just clear error status bit */
- SET_BIT(NPCX_DP80STS, 7);
+ /* Clear pending bit of host writing */
SET_BIT(NPCX_DP80STS, 5);
}
DECLARE_IRQ(NPCX_IRQ_PORT80, lpc_port80_interrupt, 2);