Skip to content

Commit 1ddbfac

Browse files
committed
Move ECPM init from common to SoC code
ECPM is an ITE system block. Move it out of common code. Signed-off-by: Tim Crawford <tcrawford@system76.com>
1 parent af79a48 commit 1ddbfac

5 files changed

Lines changed: 11 additions & 26 deletions

File tree

src/board/system76/common/common.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ board-common-y += acpi.c
44
board-common-y += battery.c
55
board-common-y += config.c
66
board-common-$(CONFIG_HAVE_DGPU) += dgpu.c
7-
board-common-y += ecpm.c
87
board-common-$(CONFIG_BUS_ESPI) += espi.c
98
board-common-y += fan.c
109
board-common-y += kbc.c

src/board/system76/common/ecpm.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/board/system76/common/include/board/ecpm.h

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/board/system76/common/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <board/battery.h>
77
#include <board/board.h>
88
#include <board/dgpu.h>
9-
#include <board/ecpm.h>
109
#include <board/fan.h>
1110
#include <board/gpio.h>
1211
#include <board/kbc.h>
@@ -60,7 +59,6 @@ void init(void) {
6059
#if CONFIG_HAVE_DGPU
6160
dgpu_init();
6261
#endif
63-
ecpm_init();
6462
kbc_init();
6563
kbled_init();
6664
#ifdef PARALLEL_DEBUG

src/ec/ite/ec.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <ec/ec.h>
44
#include <arch/arch.h>
5+
#include <ec/ecpm.h>
56
#include <ec/gctrl.h>
67
#include <common/debug.h>
78
#include <common/macro.h>
@@ -25,6 +26,15 @@ static void gctrl_init(void) {
2526
BADRSEL = 0;
2627
}
2728

29+
static void ecpm_init(void) {
30+
// Clock gate EGPC, CIR, and SWUC
31+
CGCTRL2 |= BIT(6) | BIT(5) | BIT(4);
32+
// Clock gate UART, SSPI, and DBGR
33+
CGCTRL3 |= BIT(2) | BIT(1) | BIT(0);
34+
// Clock gate CEC
35+
CGCTRL4 |= BIT(0);
36+
}
37+
2838
void ec_init(void) {
2939
arch_init();
3040

@@ -38,4 +48,5 @@ void ec_init(void) {
3848
#endif
3949

4050
gctrl_init();
51+
ecpm_init();
4152
}

0 commit comments

Comments
 (0)