stm32mon: do not print zeros received when draining the input.
stm32mon: do not print zeros received when draining the input.

When stm32mon starts up, before trying to program the EC it first
drains the EC console device and displays the contents on the console.

In case of programming over Cr50 the EC console device buffer could be
filled up with many hundreds of zeros which were received by the Cr50
UART when the EC was held in reset, as the Cr50 UART does not process
the 'break' condition properly and considers all received zeros valid
data.

This patch adds code to discard zeros received from the EC console
before flash programming starts, so that the zeros do not flood the
terminal where stm32mon is invoked.

BRANCH=none
BUG=none
TEST=no more zeros printed when stm32mon is invoked, the number of
     discarded zeros is reported.

Change-Id: I86c6fe45d1ef55ce7be5aa7511231edb24cfb2be
Signed-off-by: Vadim Bendebury <5515d6d2d0829cbe0dd0dcf2094aaded06d58514@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1168158
Reviewed-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec