summaryrefslogtreecommitdiff
path: root/chip/mchp
diff options
context:
space:
mode:
Diffstat (limited to 'chip/mchp')
-rw-r--r--chip/mchp/adc.c2
-rw-r--r--chip/mchp/clock.c2
-rw-r--r--chip/mchp/dma.c2
-rw-r--r--chip/mchp/dma_chip.h2
-rw-r--r--chip/mchp/espi.c19
-rw-r--r--chip/mchp/fan.c2
-rw-r--r--chip/mchp/flash.c4
-rw-r--r--chip/mchp/gpio.c4
-rw-r--r--chip/mchp/gpio_chip.h6
-rw-r--r--chip/mchp/gpio_cmds.c4
-rw-r--r--chip/mchp/gpspi.c10
-rw-r--r--chip/mchp/gpspi_chip.h2
-rw-r--r--chip/mchp/hwtimer.c2
-rw-r--r--chip/mchp/keyboard_raw.c2
-rw-r--r--chip/mchp/lfw/ec_lfw.c27
-rw-r--r--chip/mchp/lfw/ec_lfw.h1
-rw-r--r--chip/mchp/lfw/ec_lfw.ld10
-rw-r--r--chip/mchp/lfw/ec_lfw_416kb.ld10
-rw-r--r--chip/mchp/lpc.c8
-rw-r--r--chip/mchp/pwm.c2
-rw-r--r--chip/mchp/qmspi.c12
-rw-r--r--chip/mchp/qmspi_chip.h2
-rw-r--r--chip/mchp/spi.c8
-rw-r--r--chip/mchp/spi_chip.h2
-rw-r--r--chip/mchp/system.c6
-rw-r--r--chip/mchp/uart.c2
-rw-r--r--chip/mchp/watchdog.c2
27 files changed, 68 insertions, 87 deletions
diff --git a/chip/mchp/adc.c b/chip/mchp/adc.c
index f09c04d26b..621fe1f3be 100644
--- a/chip/mchp/adc.c
+++ b/chip/mchp/adc.c
@@ -10,9 +10,9 @@
#include "hooks.h"
#include "registers.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "util.h"
+#include "tfdp_chip.h"
/*
* Conversion on a single channel takes less than 12 ms. Set timeout to
diff --git a/chip/mchp/clock.c b/chip/mchp/clock.c
index 0323d16f8f..4701d43b1f 100644
--- a/chip/mchp/clock.c
+++ b/chip/mchp/clock.c
@@ -17,10 +17,10 @@
#include "shared_mem.h"
#include "system.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "uart.h"
#include "util.h"
+#include "tfdp_chip.h"
#include "vboot_hash.h"
/* Console output macros */
diff --git a/chip/mchp/dma.c b/chip/mchp/dma.c
index c921527d7f..8a091286a7 100644
--- a/chip/mchp/dma.c
+++ b/chip/mchp/dma.c
@@ -9,9 +9,9 @@
#include "hooks.h"
#include "registers.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "util.h"
+#include "tfdp_chip.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_DMA, outstr)
diff --git a/chip/mchp/dma_chip.h b/chip/mchp/dma_chip.h
index bfdb8ab9be..6f569a1dc7 100644
--- a/chip/mchp/dma_chip.h
+++ b/chip/mchp/dma_chip.h
@@ -13,8 +13,8 @@
#ifndef _DMA_CHIP_H
#define _DMA_CHIP_H
-#include <stddef.h>
#include <stdint.h>
+#include <stddef.h>
#ifdef __cplusplus
extern "C" {
diff --git a/chip/mchp/espi.c b/chip/mchp/espi.c
index 53d17e90b2..371cf09c5e 100644
--- a/chip/mchp/espi.c
+++ b/chip/mchp/espi.c
@@ -5,26 +5,29 @@
/* ESPI module for Chrome EC */
-#include "acpi.h"
-#include "chipset.h"
#include "common.h"
+#include "acpi.h"
#include "console.h"
-#include "espi.h"
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
#include "keyboard_protocol.h"
-#include "lpc.h"
-#include "lpc_chip.h"
#include "port80.h"
-#include "power.h"
+#include "util.h"
+#include "chipset.h"
+
#include "registers.h"
+#include "espi.h"
+#include "lpc.h"
+#include "lpc_chip.h"
#include "system.h"
#include "task.h"
-#include "tfdp_chip.h"
-#include "timer.h"
+#include "console.h"
#include "uart.h"
#include "util.h"
+#include "power.h"
+#include "timer.h"
+#include "tfdp_chip.h"
/* Console output macros */
#ifdef CONFIG_MCHP_ESPI_DEBUG
diff --git a/chip/mchp/fan.c b/chip/mchp/fan.c
index c68d71bcc8..3f61cb4d2f 100644
--- a/chip/mchp/fan.c
+++ b/chip/mchp/fan.c
@@ -9,8 +9,8 @@
#include "fan.h"
#include "registers.h"
-#include "tfdp_chip.h"
#include "util.h"
+#include "tfdp_chip.h"
/* Maximum fan driver setting value */
#define MAX_FAN_DRIVER_SETTING 0x3ff
diff --git a/chip/mchp/flash.c b/chip/mchp/flash.c
index f0f3a5575e..4b0e407fb2 100644
--- a/chip/mchp/flash.c
+++ b/chip/mchp/flash.c
@@ -6,14 +6,14 @@
#include "common.h"
#include "console.h"
#include "flash.h"
-#include "hooks.h"
#include "host_command.h"
#include "shared_mem.h"
#include "spi.h"
#include "spi_flash.h"
#include "system.h"
-#include "tfdp_chip.h"
#include "util.h"
+#include "hooks.h"
+#include "tfdp_chip.h"
#define PAGE_SIZE 256
diff --git a/chip/mchp/gpio.c b/chip/mchp/gpio.c
index 3ad9d7b6e4..a3cab86fcc 100644
--- a/chip/mchp/gpio.c
+++ b/chip/mchp/gpio.c
@@ -8,13 +8,13 @@
#include "common.h"
#include "gpio.h"
#include "hooks.h"
-#include "lpc_chip.h"
#include "registers.h"
#include "system.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "util.h"
+#include "lpc_chip.h"
+#include "tfdp_chip.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_LPC, outstr)
diff --git a/chip/mchp/gpio_chip.h b/chip/mchp/gpio_chip.h
index ec0f3d2278..e092669b60 100644
--- a/chip/mchp/gpio_chip.h
+++ b/chip/mchp/gpio_chip.h
@@ -13,10 +13,10 @@
#ifndef _GPIO_CHIP_H
#define _GPIO_CHIP_H
-#include "gpio.h"
-
-#include <stddef.h>
#include <stdint.h>
+#include <stddef.h>
+
+#include "gpio.h"
#ifdef __cplusplus
extern "C" {
diff --git a/chip/mchp/gpio_cmds.c b/chip/mchp/gpio_cmds.c
index a53f8cca2a..927d6d0326 100644
--- a/chip/mchp/gpio_cmds.c
+++ b/chip/mchp/gpio_cmds.c
@@ -8,12 +8,12 @@
#include "common.h"
#include "console.h"
#include "gpio.h"
-#include "gpio_chip.h"
#include "hooks.h"
#include "registers.h"
#include "system.h"
-#include "tfdp_chip.h"
#include "util.h"
+#include "gpio_chip.h"
+#include "tfdp_chip.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_LPC, outstr)
diff --git a/chip/mchp/gpspi.c b/chip/mchp/gpspi.c
index a7f7b388c4..0142fe0e3c 100644
--- a/chip/mchp/gpspi.c
+++ b/chip/mchp/gpspi.c
@@ -9,15 +9,15 @@
#include "console.h"
#include "dma.h"
#include "gpio.h"
-#include "gpspi_chip.h"
-#include "hooks.h"
#include "registers.h"
#include "spi.h"
-#include "spi_chip.h"
-#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "util.h"
+#include "hooks.h"
+#include "task.h"
+#include "spi_chip.h"
+#include "gpspi_chip.h"
+#include "tfdp_chip.h"
#define CPUTS(outstr) cputs(CC_SPI, outstr)
#define CPRINTS(format, args...) cprints(CC_SPI, format, ##args)
diff --git a/chip/mchp/gpspi_chip.h b/chip/mchp/gpspi_chip.h
index 16c3208410..7c1285b6cf 100644
--- a/chip/mchp/gpspi_chip.h
+++ b/chip/mchp/gpspi_chip.h
@@ -13,8 +13,8 @@
#ifndef _GPSPI_CHIP_H
#define _GPSPI_CHIP_H
-#include <stddef.h>
#include <stdint.h>
+#include <stddef.h>
/* struct spi_device_t */
#include "spi.h"
diff --git a/chip/mchp/hwtimer.c b/chip/mchp/hwtimer.c
index c72140b18f..2e9ff780fb 100644
--- a/chip/mchp/hwtimer.c
+++ b/chip/mchp/hwtimer.c
@@ -11,8 +11,8 @@
#include "hwtimer.h"
#include "registers.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
+#include "tfdp_chip.h"
void __hw_clock_event_set(uint32_t deadline)
{
diff --git a/chip/mchp/keyboard_raw.c b/chip/mchp/keyboard_raw.c
index 30181776fa..daa0c8e64f 100644
--- a/chip/mchp/keyboard_raw.c
+++ b/chip/mchp/keyboard_raw.c
@@ -11,8 +11,8 @@
#include "keyboard_scan.h"
#include "registers.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "util.h"
+#include "tfdp_chip.h"
/*
* Using direct mode interrupt, do not enable
diff --git a/chip/mchp/lfw/ec_lfw.c b/chip/mchp/lfw/ec_lfw.c
index eb8b3370cb..dfd9814e6e 100644
--- a/chip/mchp/lfw/ec_lfw.c
+++ b/chip/mchp/lfw/ec_lfw.c
@@ -6,23 +6,23 @@
*
*/
-#include "clock.h"
+#include <stdint.h>
+
#include "config.h"
-#include "cpu.h"
#include "cros_version.h"
-#include "dma.h"
#include "gpio.h"
-#include "gpio_list.h"
-#include "hwtimer.h"
-#include "registers.h"
#include "spi.h"
#include "spi_flash.h"
+#include "util.h"
+#include "timer.h"
+#include "dma.h"
+#include "registers.h"
+#include "cpu.h"
+#include "clock.h"
#include "system.h"
+#include "hwtimer.h"
+#include "gpio_list.h"
#include "tfdp_chip.h"
-#include "timer.h"
-#include "util.h"
-
-#include <stdint.h>
#ifdef CONFIG_MCHP_LFW_DEBUG
#include "dma_chip.h"
@@ -305,7 +305,7 @@ void uart_init(void)
}
#endif /* #ifdef CONFIG_UART_CONSOLE */
-noreturn void watchdog_reset(void)
+void fault_handler(void)
{
uart_puts("EXCEPTION!\nTriggering watchdog reset\n");
/* trigger reset in 1 ms */
@@ -315,11 +315,6 @@ noreturn void watchdog_reset(void)
;
}
-void fault_handler(void)
-{
- asm("b watchdog_reset");
-}
-
void jump_to_image(uintptr_t init_addr)
{
void (*resetvec)(void) = (void (*)(void))init_addr;
diff --git a/chip/mchp/lfw/ec_lfw.h b/chip/mchp/lfw/ec_lfw.h
index 0c677e5d0b..2589638954 100644
--- a/chip/mchp/lfw/ec_lfw.h
+++ b/chip/mchp/lfw/ec_lfw.h
@@ -7,7 +7,6 @@
*/
#include <stdint.h>
-
#include <stdnoreturn.h>
/* Why naked? This is dangerous except for
diff --git a/chip/mchp/lfw/ec_lfw.ld b/chip/mchp/lfw/ec_lfw.ld
index d178a42280..f0071a55e9 100644
--- a/chip/mchp/lfw/ec_lfw.ld
+++ b/chip/mchp/lfw/ec_lfw.ld
@@ -79,15 +79,7 @@ SECTIONS
FILL(0xFF);
. = ORIGIN(SRAM) + LENGTH(SRAM) - 1;
BYTE(0xFF); /* emit at least a byte to make linker happy */
- } >SRAM
+ }
__image_size = LOADADDR(.text) + SIZEOF(.text) - ORIGIN(VECTOR);
-
- /*
- * Discard C++ exception index table and exception table. These are
- * described in more detail in "Exception Handling ABI for ARM
- * Architecture":
- * https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface
- */
- /DISCARD/ : { *(.ARM.*) }
}
diff --git a/chip/mchp/lfw/ec_lfw_416kb.ld b/chip/mchp/lfw/ec_lfw_416kb.ld
index c7dfacada3..f27d046e7d 100644
--- a/chip/mchp/lfw/ec_lfw_416kb.ld
+++ b/chip/mchp/lfw/ec_lfw_416kb.ld
@@ -83,15 +83,7 @@ SECTIONS
FILL(0xFF);
. = ORIGIN(SRAM) + LENGTH(SRAM) - 1;
BYTE(0xFF); /* emit at least a byte to make linker happy */
- } >SRAM
+ }
__image_size = LOADADDR(.text) + SIZEOF(.text) - ORIGIN(VECTOR);
-
- /*
- * Discard C++ exception index table and exception table. These are
- * described in more detail in "Exception Handling ABI for ARM
- * Architecture":
- * https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface
- */
- /DISCARD/ : { *(.ARM.*) }
}
diff --git a/chip/mchp/lpc.c b/chip/mchp/lpc.c
index e41e4b0c78..da9b045b22 100644
--- a/chip/mchp/lpc.c
+++ b/chip/mchp/lpc.c
@@ -5,24 +5,24 @@
/* LPC module for MCHP MEC family */
-#include "acpi.h"
-#include "chipset.h"
#include "common.h"
+#include "acpi.h"
#include "console.h"
-#include "espi.h"
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
#include "keyboard_protocol.h"
#include "lpc.h"
#include "lpc_chip.h"
+#include "espi.h"
#include "port80.h"
#include "registers.h"
#include "system.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "util.h"
+#include "chipset.h"
+#include "tfdp_chip.h"
/* Console output macros */
#ifdef CONFIG_MCHP_DEBUG_LPC
diff --git a/chip/mchp/pwm.c b/chip/mchp/pwm.c
index 706228fa53..d0e88b5175 100644
--- a/chip/mchp/pwm.c
+++ b/chip/mchp/pwm.c
@@ -12,8 +12,8 @@
#include "pwm.h"
#include "pwm_chip.h"
#include "registers.h"
-#include "tfdp_chip.h"
#include "util.h"
+#include "tfdp_chip.h"
#define CPUTS(outstr) cputs(CC_PWM, outstr)
#define CPRINTS(format, args...) cprints(CC_PWM, format, ##args)
diff --git a/chip/mchp/qmspi.c b/chip/mchp/qmspi.c
index a0d31b72e3..6979bdae6a 100644
--- a/chip/mchp/qmspi.c
+++ b/chip/mchp/qmspi.c
@@ -8,17 +8,17 @@
#include "common.h"
#include "console.h"
#include "dma.h"
-#include "dma_chip.h"
#include "gpio.h"
-#include "hooks.h"
-#include "qmspi_chip.h"
#include "registers.h"
#include "spi.h"
-#include "spi_chip.h"
-#include "task.h"
-#include "tfdp_chip.h"
#include "timer.h"
#include "util.h"
+#include "hooks.h"
+#include "task.h"
+#include "dma_chip.h"
+#include "spi_chip.h"
+#include "qmspi_chip.h"
+#include "tfdp_chip.h"
#define CPUTS(outstr) cputs(CC_SPI, outstr)
#define CPRINTS(format, args...) cprints(CC_SPI, format, ##args)
diff --git a/chip/mchp/qmspi_chip.h b/chip/mchp/qmspi_chip.h
index 899f59516f..5a66c34e62 100644
--- a/chip/mchp/qmspi_chip.h
+++ b/chip/mchp/qmspi_chip.h
@@ -13,8 +13,8 @@
#ifndef _QMSPI_CHIP_H
#define _QMSPI_CHIP_H
-#include <stddef.h>
#include <stdint.h>
+#include <stddef.h>
/* struct spi_device_t */
#include "spi.h"
diff --git a/chip/mchp/spi.c b/chip/mchp/spi.c
index 4445666790..195c10d8a6 100644
--- a/chip/mchp/spi.c
+++ b/chip/mchp/spi.c
@@ -9,14 +9,14 @@
#include "console.h"
#include "dma.h"
#include "gpio.h"
-#include "hooks.h"
-#include "qmspi_chip.h"
#include "registers.h"
#include "spi.h"
-#include "spi_chip.h"
-#include "task.h"
#include "timer.h"
#include "util.h"
+#include "hooks.h"
+#include "task.h"
+#include "spi_chip.h"
+#include "qmspi_chip.h"
#if defined(CONFIG_MCHP_GPSPI) && !defined(LFW)
#include "gpspi_chip.h"
#endif
diff --git a/chip/mchp/spi_chip.h b/chip/mchp/spi_chip.h
index e651901ea4..f8c4c1169c 100644
--- a/chip/mchp/spi_chip.h
+++ b/chip/mchp/spi_chip.h
@@ -13,8 +13,8 @@
#ifndef _SPI_CHIP_H
#define _SPI_CHIP_H
-#include <stddef.h>
#include <stdint.h>
+#include <stddef.h>
/* struct spi_device_t */
#include "spi.h"
diff --git a/chip/mchp/system.c b/chip/mchp/system.c
index 65470c43b9..bb5224c455 100644
--- a/chip/mchp/system.c
+++ b/chip/mchp/system.c
@@ -5,9 +5,11 @@
/* System module for Chrome EC : MCHP hardware specific implementation */
+#include <stdnoreturn.h>
+
+#include "common.h" /* includes config.h and board.h */
#include "clock.h"
#include "clock_chip.h"
-#include "common.h" /* includes config.h and board.h */
#include "console.h"
#include "cpu.h"
#include "gpio.h"
@@ -23,8 +25,6 @@
#include "timer.h"
#include "util.h"
-#include <stdnoreturn.h>
-
#define CPUTS(outstr) cputs(CC_LPC, outstr)
#define CPRINTS(format, args...) cprints(CC_LPC, format, ##args)
diff --git a/chip/mchp/uart.c b/chip/mchp/uart.c
index 59ea3e1c35..00bfc77e14 100644
--- a/chip/mchp/uart.c
+++ b/chip/mchp/uart.c
@@ -13,9 +13,9 @@
#include "registers.h"
#include "system.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "uart.h"
#include "util.h"
+#include "tfdp_chip.h"
#define TX_FIFO_SIZE 16
diff --git a/chip/mchp/watchdog.c b/chip/mchp/watchdog.c
index 50edda70e0..0de4398fdb 100644
--- a/chip/mchp/watchdog.c
+++ b/chip/mchp/watchdog.c
@@ -8,8 +8,8 @@
#include "hooks.h"
#include "registers.h"
#include "task.h"
-#include "tfdp_chip.h"
#include "watchdog.h"
+#include "tfdp_chip.h"
void watchdog_reload(void)
{