summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2011-12-07 18:58:43 +0000
committerVincent Palatin <vpalatin@chromium.org>2011-12-07 19:10:02 +0000
commite24fa592d2a215d8ae67917c1d89e68cdf847a03 (patch)
tree47fbe4c55e7f4089cad7d619eded337da3bae999 /board
parent6396911897e4cd40f52636d710cee2865acf15e3 (diff)
downloadchrome-ec-e24fa592d2a215d8ae67917c1d89e68cdf847a03.tar.gz
Initial sources import 3/3
source files mainly done by Vincent. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Change-Id: Ic2d1becd400c9b4b4a14d4a243af1bdf77d9c1e2
Diffstat (limited to 'board')
-rw-r--r--board/bds/board.c63
-rw-r--r--board/bds/build.mk7
-rw-r--r--board/bds/ec.tasklist21
-rw-r--r--board/link/board.c18
-rw-r--r--board/link/build.mk7
-rw-r--r--board/link/ec.tasklist20
6 files changed, 136 insertions, 0 deletions
diff --git a/board/bds/board.c b/board/bds/board.c
new file mode 100644
index 0000000000..88d528bf51
--- /dev/null
+++ b/board/bds/board.c
@@ -0,0 +1,63 @@
+/* Stellaris EKB-LM4F-EAC pins multiplexing */
+
+#include "board.h"
+#include "registers.h"
+#include "util.h"
+
+void configure_board(void)
+{
+ /* Enable all of the GPIO modules : GPIOA to GPIOQ */
+ LM4_SYSTEM_RCGCGPIO = 0x7fff;
+
+ /* GPIOA muxing :
+ * pins 0/1 : UART0 = function 1
+ * pins 2/3/4/5 : SSI0 = function 2
+ * pin 6 : GPIO = function 0 (SD card CS -- open drain)
+ * pin 7 : GPIO = function 0 (user LED)
+ */
+ LM4_GPIO_PCTL(A) = 0x00222211;
+ LM4_GPIO_AFSEL(A) = 0x3f;
+ LM4_GPIO_DEN(A) = 0xff;
+ LM4_GPIO_PDR(A) = 0x00;
+ LM4_GPIO_PUR(A) = 0x3c;
+ LM4_GPIO_DIR(A) = 0xc0;
+ LM4_GPIO_ODR(A) = 0x40;
+ LM4_GPIO_DR2R(A) = 0xc3;
+ LM4_GPIO_DR8R(A) = 0x3c;
+ LM4_GPIO_DATA_BITS(A, 0x100) = 0x40;
+ LM4_GPIO_DATA_BITS(A, 0x200) = 0;
+
+ /* GPIOB muxing
+ * pin 0 : GPIO = function 0 (USB ID)
+ * pin 1 : USB digital (VBus sense)
+ */
+ LM4_GPIO_DEN(B) |= 0x01;
+ LM4_GPIO_AFSEL(B)|= 0x01;
+
+ /* GPIOC muxing
+ * pins 0/1/2/3 : JTAG (default config)
+ * pin 4 : GPIO = function 0 (OLED +15v power enable)
+ * pin 6 : USB digital (USB power enable)
+ * pin 7 : USB digital (USB current overflow)
+ */
+ LM4_GPIO_PCTL(C) = 0x88001111;
+ LM4_GPIO_AFSEL(C) = 0xcf;
+ LM4_GPIO_DEN(C) = 0xdf;
+ LM4_GPIO_DIR(C) = 0x10;
+ LM4_GPIO_DATA_BITS(C, 0x40) = 0;
+
+ /* GPIOD muxing
+ * pins 0/1/2/3/4 : GPIO = function 0 (buttons up,down,left,right,select)
+ * pin 5 : GPIO = function 0 (OLED d/Cn)
+ * pin 6 : GPIO = function 0 (OLED reset)
+ */
+ LM4_GPIO_DEN(D) = 0x7f;
+ LM4_GPIO_DIR(D) = 0x60;
+ LM4_GPIO_PUR(D) = 0x1f;
+
+ /* GPIOE muxing
+ * pin 3 : Analog function : AIN0 ADC (potentiometer)
+ * pin 6/7: USB analog
+ */
+ LM4_GPIO_AMSEL(E) = 0x8;
+}
diff --git a/board/bds/build.mk b/board/bds/build.mk
new file mode 100644
index 0000000000..94a6a3e3ac
--- /dev/null
+++ b/board/bds/build.mk
@@ -0,0 +1,7 @@
+#
+# Board specific files build
+
+# the IC is TI Stellaris LM4
+CHIP:=lm4
+
+board-objs=board.o
diff --git a/board/bds/ec.tasklist b/board/bds/ec.tasklist
new file mode 100644
index 0000000000..8ad338a873
--- /dev/null
+++ b/board/bds/ec.tasklist
@@ -0,0 +1,21 @@
+/* Copyright (c) 2011 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(n, r, d) 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
+ */
+#define CONFIG_TASK_LIST \
+ TASK(BLINK, UserLedBlink, NULL) \
+ TASK(KEYSCAN, keyboard_scan_task, NULL) \
+ TASK(CONSOLE, console_task, NULL) \
+ TASK(HOSTCMD, host_command_task, NULL) \
+ TASK(I8042CMD, i8042_command_task, NULL)
diff --git a/board/link/board.c b/board/link/board.c
new file mode 100644
index 0000000000..7b1ceb77e7
--- /dev/null
+++ b/board/link/board.c
@@ -0,0 +1,18 @@
+/* EC for Link mainboard pins multiplexing */
+
+#include "board.h"
+#include "registers.h"
+#include "util.h"
+
+void configure_board(void)
+{
+ /* Enable all of the GPIO modules : GPIOA to GPIOQ */
+ LM4_SYSTEM_RCGCGPIO = 0x7fff;
+
+ /* GPIOA muxing :
+ * pins 0/1 : UART0 = function 1
+ */
+ LM4_GPIO_PCTL(A) = 0x00000011;
+ LM4_GPIO_AFSEL(A) = 0x03;
+ LM4_GPIO_DEN(A) = 0x03;
+}
diff --git a/board/link/build.mk b/board/link/build.mk
new file mode 100644
index 0000000000..94a6a3e3ac
--- /dev/null
+++ b/board/link/build.mk
@@ -0,0 +1,7 @@
+#
+# Board specific files build
+
+# the IC is TI Stellaris LM4
+CHIP:=lm4
+
+board-objs=board.o
diff --git a/board/link/ec.tasklist b/board/link/ec.tasklist
new file mode 100644
index 0000000000..40af15fcbc
--- /dev/null
+++ b/board/link/ec.tasklist
@@ -0,0 +1,20 @@
+/* Copyright (c) 2011 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(n, r, d) 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
+ */
+#define CONFIG_TASK_LIST \
+ TASK(BLINK, UserLedBlink, NULL) \
+ TASK(CONSOLE, console_task, NULL) \
+ TASK(HOSTCMD, host_command_task, NULL) \
+ TASK(I8042CMD, i8042_command_task, NULL)