summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Adolfsson <sadolfsson@google.com>2018-04-24 10:33:24 +0200
committerchrome-bot <chrome-bot@chromium.org>2018-05-11 09:30:31 -0700
commit802337c26daaa07b42127bdf6de62f9b0afd306a (patch)
tree5d6eb31070e252dbc49b65fb2923f98f6d7db288
parent13ea63266c805fa86b16204f01a29a748e2d1ca4 (diff)
downloadchrome-ec-802337c26daaa07b42127bdf6de62f9b0afd306a.tar.gz
npcx: CEC: Add stub implementation of CEC
Add CEC stub implementation and enable it for Fizz. All it does is print a message when the driver is initialized. Signed-off-by: Stefan Adolfsson <sadolfsson@chromium.org> BUG=b:76467407 BRANCH=none TEST=Check that "CEC initialized" is printed on the console when the EC boots. CQ-DEPEND=CL:1030219 Change-Id: I1cf674e664e091354e344e0c08a69bd09f415904 Reviewed-on: https://chromium-review.googlesource.com/1030220 Commit-Ready: Stefan Adolfsson <sadolfsson@chromium.org> Tested-by: Stefan Adolfsson <sadolfsson@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--board/fizz/board.h1
-rw-r--r--chip/npcx/build.mk1
-rw-r--r--chip/npcx/cec.c22
-rw-r--r--chip/npcx/registers.h1
4 files changed, 25 insertions, 0 deletions
diff --git a/board/fizz/board.h b/board/fizz/board.h
index 69b61ce641..5224b22d67 100644
--- a/board/fizz/board.h
+++ b/board/fizz/board.h
@@ -19,6 +19,7 @@
#define CONFIG_ADC
#define CONFIG_BOARD_VERSION_CBI
#define CONFIG_CRC8
+#define CONFIG_CEC
#define CONFIG_CROS_BOARD_INFO
#define CONFIG_DEDICATED_RECOVERY_BUTTON
#define CONFIG_EMULATED_SYSRQ
diff --git a/chip/npcx/build.mk b/chip/npcx/build.mk
index 13c4a60015..215edf58fb 100644
--- a/chip/npcx/build.mk
+++ b/chip/npcx/build.mk
@@ -29,6 +29,7 @@ chip-$(CONFIG_LPC)+=lpc.o
chip-$(CONFIG_ESPI)+=espi.o
chip-$(CONFIG_PECI)+=peci.o
chip-$(CONFIG_HOSTCMD_SPS)+=shi.o
+chip-$(CONFIG_CEC)+=cec.o
# pwm functions are implemented with the fan functions
chip-$(CONFIG_PWM)+=pwm.o
chip-$(CONFIG_SPI)+=spi.o
diff --git a/chip/npcx/cec.c b/chip/npcx/cec.c
new file mode 100644
index 0000000000..f21789781f
--- /dev/null
+++ b/chip/npcx/cec.c
@@ -0,0 +1,22 @@
+/* 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.
+ */
+
+#include "console.h"
+#include "hooks.h"
+#include "registers.h"
+
+#if !(DEBUG_CEC)
+#define CPRINTF(...)
+#define CPRINTS(...)
+#else
+#define CPRINTF(format, args...) cprintf(CC_CEC, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_CEC, format, ## args)
+#endif
+
+static void cec_init(void)
+{
+ CPRINTS("CEC initialized");
+}
+DECLARE_HOOK(HOOK_INIT, cec_init, HOOK_PRIO_LAST);
diff --git a/chip/npcx/registers.h b/chip/npcx/registers.h
index c30ada4207..32ad827833 100644
--- a/chip/npcx/registers.h
+++ b/chip/npcx/registers.h
@@ -65,6 +65,7 @@
#define DEBUG_LPC 0
#define DEBUG_ESPI 0
#define DEBUG_WOV 0
+#define DEBUG_CEC 0
/* Modules Map */
#define NPCX_ESPI_BASE_ADDR 0x4000A000