aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/i2c/ww_ring/ww_ring_programs.h
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-03-17 15:15:42 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-04-22 19:55:34 +0200
commit5fa5f99d4744dfd5ddd62fa591c3b9cb28a2a8e6 (patch)
tree87d40240279d5f366f5aad9794d20d2e91d088e9 /src/drivers/i2c/ww_ring/ww_ring_programs.h
parent4e0de324ebf9c0586695901aed19b2d4545cf0c6 (diff)
i2c/ww_ring: define display pattern programs
Add compiled lp55231 code snippets to allow display certain patterns when booting the device with the recovery button pressed. As soon as the press is detected, the low intensify solid white pattern is enabled. Holding recovery button long enough causes the device transition between the wipeout requested and recovery requested states, with the appropriate changes in the displayed pattern. The patch also includes the source code for the LED controller as well as instructions on how to compile and modify the code to result in different colors, intensities, blink periods and duty cycles. BRANCH=storm BUG=chrome-os-partner:36059 TEST=reboot an SP5 device with the LED ring attached, keep the recovery button pressed, observe the changes in the LED display pattern while the device progresses through the boot sequence. Change-Id: Ic7d45fc7c313b6d21119d4ae6adaeb4f46f7d181 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 0fd6a5c0067d705197816629f41640a931d2f7cd Original-Change-Id: Ib5cc5188c2eeedbba128101bf4092a0b9a74e155 Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/260670 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9870 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/drivers/i2c/ww_ring/ww_ring_programs.h')
-rw-r--r--src/drivers/i2c/ww_ring/ww_ring_programs.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/drivers/i2c/ww_ring/ww_ring_programs.h b/src/drivers/i2c/ww_ring/ww_ring_programs.h
new file mode 100644
index 0000000000..9f4b928941
--- /dev/null
+++ b/src/drivers/i2c/ww_ring/ww_ring_programs.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2015 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/*
+ * This is a driver for the Whirlwind LED ring, which is equipped with two LED
+ * microcontrollers TI LP55231 (http://www.ti.com/product/lp55231), each of
+ * them driving three multicolor LEDs.
+ *
+ * The only connection between the ring and the main board is an i2c bus.
+ *
+ * This driver imitates a depthcharge display device. On initialization the
+ * driver sets up the controllers to prepare them to accept programs to run.
+ *
+ * When a certain vboot state needs to be indicated, the program for that
+ * state is loaded into the controllers, resulting in the state appropriate
+ * LED behavior.
+ */
+
+#ifndef __THIRD_PARTY_COREBOOT_SRC_DRIVERS_I2C_WW_RING_WW_RING_PROGRAMS_H__
+#define __THIRD_PARTY_COREBOOT_SRC_DRIVERS_I2C_WW_RING_WW_RING_PROGRAMS_H__
+
+#include <stdint.h>
+#include "drivers/i2c/ww_ring/ww_ring.h"
+
+/* There are threee independent engines/cores in the controller. */
+#define LP55231_NUM_OF_ENGINES 3
+
+/* Number of lp55321 controllers on the ring */
+#define WW_RING_NUM_LED_CONTROLLERS 2
+
+/*
+ * Structure to describe an lp55231 program: pointer to the text of the
+ * program, its size and load address (load addr + size sould not exceed
+ * LP55231_MAX_PROG_SIZE), and start addresses for all of the three
+ * engines.
+ */
+typedef struct {
+ const uint8_t *program_text;
+ uint8_t program_size;
+ uint8_t load_addr;
+ uint8_t engine_start_addr[LP55231_NUM_OF_ENGINES];
+} TiLp55231Program;
+
+/* A structure to bind controller programs to a vboot state. */
+typedef struct {
+ enum display_pattern led_pattern;
+ const TiLp55231Program *programs[WW_RING_NUM_LED_CONTROLLERS];
+} WwRingStateProg;
+
+extern const WwRingStateProg wwr_state_programs[];
+
+#endif