summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-02-15 15:05:35 -0800
committerRandall Spangler <rspangler@chromium.org>2012-02-15 15:12:03 -0800
commit6101cebb6a7b0d0aadf3df98e98284b60946c419 (patch)
tree783e01e66a0f38875db5de873cd07aeba1953930 /include
parentc160dae1d45ea1a02e17b5de75e75a396b160627 (diff)
downloadchrome-ec-6101cebb6a7b0d0aadf3df98e98284b60946c419.tar.gz
Reduce LPC command parameters to 128 bytes; add LPC memory-mapped space
This will allow more efficient access to EC-provided data (temperature, fan, battery) by the main processor. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7857 TEST='ectool hello' from link main processor should still work Change-Id: I2dc683f3441b34de9fb4debf772e386b9fdcfa82
Diffstat (limited to 'include')
-rw-r--r--include/lpc.h6
-rw-r--r--include/lpc_commands.h15
2 files changed, 14 insertions, 7 deletions
diff --git a/include/lpc.h b/include/lpc.h
index d87d9bab7c..69968dba99 100644
--- a/include/lpc.h
+++ b/include/lpc.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 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.
*/
@@ -27,6 +27,10 @@ int lpc_init(void);
* commands, 1 for usermode-originated commands. */
uint8_t *lpc_get_host_range(int slot);
+/* Returns a pointer to the memory-mapped buffer. This buffer is writable at
+ * any time, and the host can read it at any time. */
+uint8_t *lpc_get_memmap_range(void);
+
/* Sends a response to a host command. The bottom 4 bits of <status>
* are sent in the status byte. <slot> is 0 for kernel-originated
* commands, 1 for usermode-originated commands. */
diff --git a/include/lpc_commands.h b/include/lpc_commands.h
index 151256cde5..16936cf043 100644
--- a/include/lpc_commands.h
+++ b/include/lpc_commands.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 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.
*/
@@ -24,15 +24,18 @@
#define EC_LPC_ADDR_KERNEL_PARAM 0x800
#define EC_LPC_ADDR_USER_DATA 0x200
#define EC_LPC_ADDR_USER_CMD 0x204
-#define EC_LPC_ADDR_USER_PARAM 0x900
-#define EC_LPC_PARAM_SIZE 256 /* Size of param areas in bytes */
+#define EC_LPC_ADDR_USER_PARAM 0x880
+#define EC_LPC_PARAM_SIZE 128 /* Size of each param area in bytes */
+
+#define EC_LPC_ADDR_MEMMAP 0x900
+#define EC_LPC_MEMMAP_SIZE 256
/* LPC command status byte masks */
/* EC is busy processing a command. This covers both bit 0x04, which
* is the busy-bit, and 0x02, which is the bit which indicates the
* host has written a byte but the EC hasn't picked it up yet. */
#define EC_LPC_BUSY_MASK 0x06
-#define EC_LPC_STATUS_MASK 0xF0 /* Mask for status codes in status byte */
+#define EC_LPC_STATUS_MASK 0xf0 /* Mask for status codes in status byte */
#define EC_LPC_GET_STATUS(x) (((x) & EC_LPC_STATUS_MASK) >> 4)
/* LPC command response codes */
@@ -55,7 +58,7 @@ enum lpc_status {
* busy, because the reboot command is processed at interrupt
* level. Note that when the EC reboots, the host will reboot too, so
* there is no response to this command. */
-#define EC_LPC_COMMAND_REBOOT 0xD1 /* Think "die" */
+#define EC_LPC_COMMAND_REBOOT 0xd1 /* Think "die" */
/* Hello. This is a simple command to test the EC is responsive to
@@ -100,7 +103,7 @@ struct lpc_response_read_test {
/* Flash commands */
/* Maximum bytes that can be read/written in a single command */
-#define EC_LPC_FLASH_SIZE_MAX 128
+#define EC_LPC_FLASH_SIZE_MAX 64
/* Get flash info */
#define EC_LPC_COMMAND_FLASH_INFO 0x10