Files
OpenCellular/util/uut/main.h
CHLin dcaf8edc47 util: uartupdatetool (UUT): Add tool to flash firmware by UART
When the FLPRG# strap pin is set to active low, and npcx7 chip is reset,
it will enter uut mode. This CL adds the host tool to communicate with
npcx chip in uut mode to flash ec firmware via UART port.

BRANCH=none
BUG=none
TEST=No build errors for make buildall.
TEST=
------------------------------------------------------------------------
1. Connect the servo connector (J24) on npcx7 EVB to servo board v2 via
flex cable.
2. Manually turn the switch SW1.6 to "ON" on npcx7 EVB.
3. Reset ec by issuing Power-Up or VCC1_RST reset.
4. Manually turn the switch SW1.6 to "OFF" on npcx7 EVB.
5. Move npcx7_evb from array BOARDS_NPCX_7M7X_JTAG to BOARDS_NPCX_UUT in
flash_ec.
6. "./util/flash_ec --board=npcx7_evb."

Change-Id: I2c588418e809e59f97ef4c3ad7ad13a3fef42f11
Signed-off-by: Dror Goldstein <dror.goldstein@nuvoton.com>
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/952037
Commit-Ready: CH Lin <chlin56@nuvoton.com>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Tested-by: CH Lin <chlin56@nuvoton.com>
Tested-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-04-18 02:07:59 -07:00

75 lines
1.9 KiB
C

/*
* Copyright 2018 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __UTIL_UUT_MAIN_H
#define __UTIL_UUT_MAIN_H
#include <stdbool.h>
/*---------------------------------------------------------------------------
* Constant definitions
*---------------------------------------------------------------------------
*/
/* Maximum Read/Write data size per packet */
#define MAX_RW_DATA_SIZE 256
/* Base for string conversion */
#define BASE_DECIMAL 10
#define BASE_HEXADECIMAL 16
/* Verbose control messages display */
#define DISPLAY_MSG(msg) \
{ \
if (verbose) \
printf msg; \
}
#define SUCCESS true
#define FAIL false
#ifdef __cplusplus
extern "C" {
#endif
/*--------------------------------------------------------------------------
* Global variables
*--------------------------------------------------------------------------
*/
extern bool verbose;
extern bool console;
/*--------------------------------------------------------------------------
* Global functions
*--------------------------------------------------------------------------
*/
/*---------------------------------------------------------------------------
* Function: display_color_msg
*
* Parameters:
* success - SUCCESS for successful message, FAIL for erroneous
* massage.
* fmt - Massage to dispaly (format and arguments).
*
* Returns: none
* Side effects: Using DISPLAY_MSG macro.
* Description:
* This routine displays a message using color attributes:
* In case of a successful message, use green foreground text on
* black background.
* In case of an erroneous message, use red foreground text on
* black background.
*--------------------------------------------------------------------------
*/
void display_color_msg(bool success, char *fmt, ...);
#ifdef __cplusplus
}
#endif
#endif /* __UTIL_UUT_MAIN_H */