summaryrefslogtreecommitdiff
path: root/board/max32660-eval
diff options
context:
space:
mode:
authorJerry Bradshaw <jerry.bradshaw@maximintegrated.com>2019-06-06 08:52:13 -0500
committerCommit Bot <commit-bot@chromium.org>2019-07-17 21:27:38 +0000
commit21a255ea953e8ac64d05147ad7f11491db126cf4 (patch)
treec71d32772410dd7748b599619d8741b10d152b93 /board/max32660-eval
parent0e3dd9d2cc19b65654f8090aa02f8dac20358c2e (diff)
downloadchrome-ec-21a255ea953e8ac64d05147ad7f11491db126cf4.tar.gz
Basic implentation of the Maxim Integrated MAX32660 within the EC OS
Includes System Clock, Timer, Uart, Watchdog Change-Id: I195059c87d97e70c6a134304143613b86b623e22 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1647741 Reviewed-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Jerry Bradshaw <jerry.bradshaw@maximintegrated.com> Commit-Queue: Jes Klinke <jbk@chromium.org>
Diffstat (limited to 'board/max32660-eval')
-rw-r--r--board/max32660-eval/board.c19
-rw-r--r--board/max32660-eval/board.h39
-rw-r--r--board/max32660-eval/build.mk12
-rw-r--r--board/max32660-eval/ec.tasklist22
-rw-r--r--board/max32660-eval/gpio.inc18
5 files changed, 110 insertions, 0 deletions
diff --git a/board/max32660-eval/board.c b/board/max32660-eval/board.c
new file mode 100644
index 0000000000..65e69c2453
--- /dev/null
+++ b/board/max32660-eval/board.c
@@ -0,0 +1,19 @@
+/* Copyright 2019 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.
+ */
+
+/* MAX32660 EvalKit Board Specific Configuration */
+
+#include "i2c.h"
+#include "board.h"
+#include "console.h"
+#include "ec_commands.h"
+#include "gpio.h"
+#include "hooks.h"
+#include "timer.h"
+#include "registers.h"
+#include "util.h"
+#include "gpio_list.h"
+
+#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args)
diff --git a/board/max32660-eval/board.h b/board/max32660-eval/board.h
new file mode 100644
index 0000000000..fba6c60cef
--- /dev/null
+++ b/board/max32660-eval/board.h
@@ -0,0 +1,39 @@
+/* Copyright 2019 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.
+ */
+
+/* MAX32660 board configuration */
+
+#ifndef __CROS_EC_BOARD_H
+#define __CROS_EC_BOARD_H
+
+/* Optional features */
+#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands */
+
+#define CONFIG_FPU
+
+/* Modules we want to exclude */
+#undef CONFIG_LID_SWITCH
+#undef CONFIG_PECI
+#undef CONFIG_SWITCH
+
+/* #define CONFIG_I2C_SLAVE */
+/* #define CONFIG_HOSTCMD_I2C_SLAVE_ADDR (0x51 << 1) */
+
+/* Write protect is active high */
+#define CONFIG_WP_ACTIVE_HIGH
+
+#undef CONFIG_WATCHDOG_PERIOD_MS
+#define CONFIG_WATCHDOG_PERIOD_MS 2240
+
+#ifndef __ASSEMBLER__
+
+/* Second UART port */
+#define CONFIG_UART_HOST 1
+
+#include "gpio_signal.h"
+
+#endif /* !__ASSEMBLER__ */
+
+#endif /* __CROS_EC_BOARD_H */
diff --git a/board/max32660-eval/build.mk b/board/max32660-eval/build.mk
new file mode 100644
index 0000000000..a613922cd2
--- /dev/null
+++ b/board/max32660-eval/build.mk
@@ -0,0 +1,12 @@
+# -*- makefile -*-
+# Copyright 2019 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.
+#
+# Board specific files build
+#
+
+# MAX32660 Device
+CHIP:=max32660
+
+board-y=board.o
diff --git a/board/max32660-eval/ec.tasklist b/board/max32660-eval/ec.tasklist
new file mode 100644
index 0000000000..3f546f98ae
--- /dev/null
+++ b/board/max32660-eval/ec.tasklist
@@ -0,0 +1,22 @@
+/* Copyright 2019 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.
+ */
+
+/**
+ * List of enabled tasks in the priority order
+ *
+ * The first one has the lowest priority.
+ *
+ * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and
+ * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries,
+ * where :
+ * 'n' in the name of the task
+ * 'r' in the main routine of the task
+ * 'd' in an opaque parameter passed to the routine at startup
+ * 's' is the stack size in bytes; must be a multiple of 8
+ * TASK_NOTEST(LIGHTBAR, lightbar_task, NULL, TASK_STACK_SIZE) \
+ */
+#define CONFIG_TASK_LIST \
+ TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \
+ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE)
diff --git a/board/max32660-eval/gpio.inc b/board/max32660-eval/gpio.inc
new file mode 100644
index 0000000000..db34c18bed
--- /dev/null
+++ b/board/max32660-eval/gpio.inc
@@ -0,0 +1,18 @@
+/* -*- mode:c -*-
+ *
+ * Copyright 2019 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.
+ */
+
+/* Declare symbolic names for all the GPIOs that we care about.
+ * Note: Those with interrupt handlers must be declared first. */
+
+/*
+ * Signals which aren't implemented on Board but we'll emulate anyway, to
+ * make it more convenient to debug other code.
+ */
+UNIMPLEMENTED(WP) /* Write protect input */
+UNIMPLEMENTED(ENTERING_RW) /* EC entering RW code */
+
+ALTERNATE(PIN_MASK(0, 0x0C00), 2, MODULE_UART, 0) /* Alt 2, P0.10 (UART1_TX), P0.11 (UART1_RX) */