summaryrefslogtreecommitdiff
path: root/chip/npcx
diff options
context:
space:
mode:
Diffstat (limited to 'chip/npcx')
-rw-r--r--chip/npcx/adc.c2
-rw-r--r--chip/npcx/espi.c17
-rw-r--r--chip/npcx/fan.c13
-rw-r--r--chip/npcx/flash.c6
-rw-r--r--chip/npcx/gpio.c12
-rw-r--r--chip/npcx/header.c4
-rw-r--r--chip/npcx/hwtimer.c2
-rw-r--r--chip/npcx/keyboard_raw.c4
-rw-r--r--chip/npcx/lct.c2
-rw-r--r--chip/npcx/lpc.c4
-rw-r--r--chip/npcx/peci.c2
-rw-r--r--chip/npcx/ps2.c4
-rw-r--r--chip/npcx/registers.h2
-rw-r--r--chip/npcx/sha256_chip.c2
-rw-r--r--chip/npcx/shi.c2
-rw-r--r--chip/npcx/spi.c4
-rw-r--r--chip/npcx/spiflashfw/npcx_monitor.c3
-rw-r--r--chip/npcx/system-npcx7.c8
-rw-r--r--chip/npcx/system-npcx9.c8
-rw-r--r--chip/npcx/uart.c2
-rw-r--r--chip/npcx/uartn.c7
-rw-r--r--chip/npcx/watchdog.c8
22 files changed, 57 insertions, 61 deletions
diff --git a/chip/npcx/adc.c b/chip/npcx/adc.c
index 73d4ec48b3..f01419bf67 100644
--- a/chip/npcx/adc.c
+++ b/chip/npcx/adc.c
@@ -9,8 +9,8 @@
#include "atomic.h"
#include "clock.h"
#include "clock_chip.h"
-#include "common.h"
#include "console.h"
+#include "common.h"
#include "gpio.h"
#include "hooks.h"
#include "registers.h"
diff --git a/chip/npcx/espi.c b/chip/npcx/espi.c
index e73d04e988..d64a22860d 100644
--- a/chip/npcx/espi.c
+++ b/chip/npcx/espi.c
@@ -5,18 +5,18 @@
/* ESPI module for Chrome EC */
-#include "chipset.h"
-#include "console.h"
-#include "espi.h"
-#include "hooks.h"
-#include "lpc_chip.h"
-#include "power.h"
#include "registers.h"
#include "system.h"
#include "task.h"
-#include "timer.h"
+#include "chipset.h"
+#include "console.h"
#include "uart.h"
#include "util.h"
+#include "power.h"
+#include "espi.h"
+#include "lpc_chip.h"
+#include "hooks.h"
+#include "timer.h"
/* Console output macros */
#if !(DEBUG_ESPI)
@@ -274,9 +274,6 @@ void espi_wait_vw_not_dirty(enum espi_vw_signal signal, unsigned int timeout_us)
uint64_t timeout;
sig_idx = espi_vw_get_signal_index(signal);
- /* Cannot find signal index */
- if (sig_idx < 0)
- return;
for (offset = 0; offset < ESPI_VWEVSM_NUM; offset++) {
uint8_t vw_idx = VWEVSM_IDX_GET(NPCX_VWEVSM(offset));
diff --git a/chip/npcx/fan.c b/chip/npcx/fan.c
index 9ceccaba33..6a246f5c6a 100644
--- a/chip/npcx/fan.c
+++ b/chip/npcx/fan.c
@@ -7,19 +7,20 @@
#include "clock.h"
#include "clock_chip.h"
-#include "console.h"
#include "fan.h"
#include "fan_chip.h"
#include "gpio.h"
#include "hooks.h"
-#include "math_util.h"
+#include "registers.h"
+#include "util.h"
#include "pwm.h"
#include "pwm_chip.h"
-#include "registers.h"
-#include "system.h"
-#include "task.h"
+#include "console.h"
#include "timer.h"
-#include "util.h"
+#include "task.h"
+#include "hooks.h"
+#include "system.h"
+#include "math_util.h"
#if !(DEBUG_FAN)
#define CPRINTS(...)
diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c
index dc8de6e3ee..390cb1fa64 100644
--- a/chip/npcx/flash.c
+++ b/chip/npcx/flash.c
@@ -6,18 +6,18 @@
/* Flash memory module for Chrome EC */
#include "builtin/assert.h"
-#include "console.h"
#include "flash.h"
#include "host_command.h"
-#include "hwtimer_chip.h"
#include "registers.h"
#include "spi_flash_reg.h"
#include "switch.h"
#include "system.h"
-#include "task.h"
#include "timer.h"
#include "util.h"
+#include "task.h"
#include "watchdog.h"
+#include "console.h"
+#include "hwtimer_chip.h"
static int all_protected; /* Has all-flash protection been requested? */
static int addr_prot_start;
diff --git a/chip/npcx/gpio.c b/chip/npcx/gpio.c
index a976b3b122..4127b79e30 100644
--- a/chip/npcx/gpio.c
+++ b/chip/npcx/gpio.c
@@ -7,19 +7,19 @@
#include "builtin/assert.h"
#include "common.h"
-#include "ec_commands.h"
#include "gpio.h"
#include "gpio_chip.h"
-#include "hooks.h"
-#include "host_command.h"
-#include "hwtimer_chip.h"
#include "i2c.h"
+#include "hooks.h"
#include "registers.h"
-#include "system.h"
-#include "system_chip.h"
#include "task.h"
#include "timer.h"
#include "util.h"
+#include "system.h"
+#include "system_chip.h"
+#include "ec_commands.h"
+#include "host_command.h"
+#include "hwtimer_chip.h"
#if !(DEBUG_GPIO)
#define CPUTS(...)
diff --git a/chip/npcx/header.c b/chip/npcx/header.c
index 81e5e986af..2db7d9094c 100644
--- a/chip/npcx/header.c
+++ b/chip/npcx/header.c
@@ -10,11 +10,11 @@
* This header is used by Nuvoton EC Booter.
*/
+#include <stdint.h>
+
#include "config.h"
#include "registers.h"
-#include <stdint.h>
-
/* Signature used by fw header */
#define SIG_FW_EC 0x2A3B4D5E
diff --git a/chip/npcx/hwtimer.c b/chip/npcx/hwtimer.c
index e2e2fe4b19..dfa06f69b2 100644
--- a/chip/npcx/hwtimer.c
+++ b/chip/npcx/hwtimer.c
@@ -8,12 +8,12 @@
#include "clock.h"
#include "clock_chip.h"
#include "common.h"
-#include "console.h"
#include "hooks.h"
#include "hwtimer.h"
#include "hwtimer_chip.h"
#include "math_util.h"
#include "registers.h"
+#include "console.h"
#include "task.h"
#include "timer.h"
#include "util.h"
diff --git a/chip/npcx/keyboard_raw.c b/chip/npcx/keyboard_raw.c
index 1774e7353d..cb2be7911e 100644
--- a/chip/npcx/keyboard_raw.c
+++ b/chip/npcx/keyboard_raw.c
@@ -5,11 +5,11 @@
/* Functions needed by keyboard scanner module for Chrome EC */
-#include "clock.h"
#include "common.h"
-#include "gpio.h"
#include "keyboard_raw.h"
#include "keyboard_scan.h"
+#include "clock.h"
+#include "gpio.h"
#include "registers.h"
#include "task.h"
diff --git a/chip/npcx/lct.c b/chip/npcx/lct.c
index 8f720e1376..19568cac44 100644
--- a/chip/npcx/lct.c
+++ b/chip/npcx/lct.c
@@ -4,9 +4,9 @@
*/
/* LCT (Long Countdown Timer) module for Chrome EC */
+#include "lct_chip.h"
#include "console.h"
#include "hooks.h"
-#include "lct_chip.h"
#include "registers.h"
#include "rtc.h"
#include "task.h"
diff --git a/chip/npcx/lpc.c b/chip/npcx/lpc.c
index b44420e025..48e094f3fc 100644
--- a/chip/npcx/lpc.c
+++ b/chip/npcx/lpc.c
@@ -20,12 +20,12 @@
#include "lpc_chip.h"
#include "port80.h"
#include "registers.h"
-#include "sib_chip.h"
#include "system.h"
-#include "system_chip.h"
+#include "sib_chip.h"
#include "task.h"
#include "uart.h"
#include "util.h"
+#include "system_chip.h"
/* Console output macros */
#if !(DEBUG_LPC)
diff --git a/chip/npcx/peci.c b/chip/npcx/peci.c
index 8a4372f7bd..7c213648f4 100644
--- a/chip/npcx/peci.c
+++ b/chip/npcx/peci.c
@@ -15,8 +15,8 @@
#include "peci.h"
#include "registers.h"
#include "task.h"
-#include "temp_sensor.h"
#include "timer.h"
+#include "temp_sensor.h"
#include "util.h"
/* Initial PECI baud rate */
diff --git a/chip/npcx/ps2.c b/chip/npcx/ps2.c
index 5fc91ef241..a8a65e63ea 100644
--- a/chip/npcx/ps2.c
+++ b/chip/npcx/ps2.c
@@ -8,11 +8,11 @@
#include "atomic.h"
#include "clock.h"
#include "console.h"
-#include "gpio.h"
#include "hooks.h"
+#include "gpio.h"
#include "ps2_chip.h"
-#include "registers.h"
#include "task.h"
+#include "registers.h"
#include "timer.h"
#include "util.h"
diff --git a/chip/npcx/registers.h b/chip/npcx/registers.h
index a583fb1c64..922d787323 100644
--- a/chip/npcx/registers.h
+++ b/chip/npcx/registers.h
@@ -8,9 +8,9 @@
#ifndef __CROS_EC_REGISTERS_H
#define __CROS_EC_REGISTERS_H
-#include "clock_chip.h"
#include "common.h"
#include "compile_time_macros.h"
+#include "clock_chip.h"
/******************************************************************************/
/*
diff --git a/chip/npcx/sha256_chip.c b/chip/npcx/sha256_chip.c
index 4d90ba6e74..e2590cad65 100644
--- a/chip/npcx/sha256_chip.c
+++ b/chip/npcx/sha256_chip.c
@@ -32,7 +32,7 @@ enum ncl_sha_type {
* The base address of the table that holds the function pointer for each
* SHA256 API in ROM.
*/
-#define NCL_SHA_BASE_ADDR 0x0000013CUL
+#define NCL_SHA_BASE_ADDR 0x00000100UL
struct ncl_sha {
/* Get the SHA context size required by SHA APIs. */
uint32_t (*get_context_size)(void);
diff --git a/chip/npcx/shi.c b/chip/npcx/shi.c
index dde2243462..d5f19c9191 100644
--- a/chip/npcx/shi.c
+++ b/chip/npcx/shi.c
@@ -15,12 +15,12 @@
#include "clock.h"
#include "console.h"
#include "gpio.h"
+#include "task.h"
#include "hooks.h"
#include "host_command.h"
#include "registers.h"
#include "spi.h"
#include "system.h"
-#include "task.h"
#include "timer.h"
#include "util.h"
diff --git a/chip/npcx/spi.c b/chip/npcx/spi.c
index bbe6b33a9d..0161ce63ef 100644
--- a/chip/npcx/spi.c
+++ b/chip/npcx/spi.c
@@ -5,11 +5,11 @@
/* SPI module for Chrome EC */
-#include "clock.h"
-#include "clock_chip.h"
#include "console.h"
#include "gpio.h"
#include "hooks.h"
+#include "clock.h"
+#include "clock_chip.h"
#include "registers.h"
#include "spi.h"
#include "task.h"
diff --git a/chip/npcx/spiflashfw/npcx_monitor.c b/chip/npcx/spiflashfw/npcx_monitor.c
index 0d8530a456..5b7a767992 100644
--- a/chip/npcx/spiflashfw/npcx_monitor.c
+++ b/chip/npcx/spiflashfw/npcx_monitor.c
@@ -5,13 +5,12 @@
* NPCX SoC spi flash update tool - monitor firmware
*/
+#include <stdint.h>
#include "config.h"
#include "npcx_monitor.h"
#include "registers.h"
#include "util.h"
-#include <stdint.h>
-
/*****************************************************************************/
/* spi flash internal functions */
void sspi_flash_pinmux(int enable)
diff --git a/chip/npcx/system-npcx7.c b/chip/npcx/system-npcx7.c
index 386544ed04..5cacbec749 100644
--- a/chip/npcx/system-npcx7.c
+++ b/chip/npcx/system-npcx7.c
@@ -11,16 +11,16 @@
#include "console.h"
#include "cpu.h"
#include "ec_commands.h"
-#include "gpio.h"
#include "hooks.h"
-#include "hwtimer_chip.h"
#include "lct_chip.h"
#include "registers.h"
-#include "rom_chip.h"
#include "system.h"
-#include "system_chip.h"
#include "task.h"
#include "util.h"
+#include "gpio.h"
+#include "hwtimer_chip.h"
+#include "system_chip.h"
+#include "rom_chip.h"
#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args)
#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ##args)
diff --git a/chip/npcx/system-npcx9.c b/chip/npcx/system-npcx9.c
index 386544ed04..5cacbec749 100644
--- a/chip/npcx/system-npcx9.c
+++ b/chip/npcx/system-npcx9.c
@@ -11,16 +11,16 @@
#include "console.h"
#include "cpu.h"
#include "ec_commands.h"
-#include "gpio.h"
#include "hooks.h"
-#include "hwtimer_chip.h"
#include "lct_chip.h"
#include "registers.h"
-#include "rom_chip.h"
#include "system.h"
-#include "system_chip.h"
#include "task.h"
#include "util.h"
+#include "gpio.h"
+#include "hwtimer_chip.h"
+#include "system_chip.h"
+#include "rom_chip.h"
#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args)
#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ##args)
diff --git a/chip/npcx/uart.c b/chip/npcx/uart.c
index d77c3579c5..bc87b5921e 100644
--- a/chip/npcx/uart.c
+++ b/chip/npcx/uart.c
@@ -6,7 +6,6 @@
/* UART module for Chrome EC */
#include "clock.h"
-#include "clock_chip.h"
#include "common.h"
#include "console.h"
#include "gpio.h"
@@ -14,6 +13,7 @@
#include "hwtimer_chip.h"
#include "lpc.h"
#include "registers.h"
+#include "clock_chip.h"
#include "system.h"
#include "task.h"
#include "timer.h"
diff --git a/chip/npcx/uartn.c b/chip/npcx/uartn.c
index 66cb30062b..9bcaccd94c 100644
--- a/chip/npcx/uartn.c
+++ b/chip/npcx/uartn.c
@@ -6,16 +6,15 @@
/* UART module for Chrome EC */
+#include <clock.h>
#include "common.h"
+#include <gpio.h>
+#include <gpio_chip.h>
#include "registers.h"
#include "system.h"
#include "task.h"
#include "util.h"
-#include <clock.h>
-#include <gpio.h>
-#include <gpio_chip.h>
-
#ifdef NPCX_UART_FIFO_SUPPORT
/* Enable UART Tx FIFO empty interrupt */
#define NPCX_UART_TX_EMPTY_INT_EN(n) \
diff --git a/chip/npcx/watchdog.c b/chip/npcx/watchdog.c
index 7998378565..8ae9ee0474 100644
--- a/chip/npcx/watchdog.c
+++ b/chip/npcx/watchdog.c
@@ -8,14 +8,14 @@
#include "clock.h"
#include "common.h"
#include "console.h"
+#include "registers.h"
+#include "hwtimer_chip.h"
#include "gpio.h"
#include "hooks.h"
-#include "hwtimer_chip.h"
-#include "registers.h"
-#include "system_chip.h"
-#include "task.h"
#include "timer.h"
+#include "task.h"
#include "util.h"
+#include "system_chip.h"
#include "watchdog.h"
/* WDCNT value for watchdog period */