From 006e73b9cafde9287912c4699091f3b1f07d3f97 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 27 Feb 2014 13:26:01 -0700 Subject: cros_ec: Add a function for reading a flash map entry A flash map describes the layout of flash memory in terms of offsets and sizes for each region. Add a function to read a flash map entry from the device tree. Reviewed-by: Che-Liang Chiou Signed-off-by: Simon Glass --- include/fdtdec.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/fdtdec.h') diff --git a/include/fdtdec.h b/include/fdtdec.h index 19bab79448..aa695df317 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -530,4 +530,22 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int node, */ int fdtdec_decode_region(const void *blob, int node, const char *prop_name, void **ptrp, size_t *size); + +/* A flash map entry, containing an offset and length */ +struct fmap_entry { + uint32_t offset; + uint32_t length; +}; + +/** + * Read a flash entry from the fdt + * + * @param blob FDT blob + * @param node Offset of node to read + * @param name Name of node being read + * @param entry Place to put offset and size of this node + * @return 0 if ok, -ve on error + */ +int fdtdec_read_fmap_entry(const void *blob, int node, const char *name, + struct fmap_entry *entry); #endif -- cgit v1.2.1 From df93d90aea85deff0b19ece43ba6f379c7c4d9cc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 27 Feb 2014 13:26:12 -0700 Subject: cros_ec: sandbox: Add Chrome OS EC emulation Add a simple emulation of the Chrome OS EC for sandbox, so that it can perform various EC tasks such as keyboard handling. Reviewed-by: Vadim Bendebury Signed-off-by: Simon Glass --- include/fdtdec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/fdtdec.h') diff --git a/include/fdtdec.h b/include/fdtdec.h index aa695df317..bcd2ee5f9c 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -88,6 +88,7 @@ enum fdt_compat_id { COMPAT_INFINEON_SLB9635_TPM, /* Infineon SLB9635 TPM */ COMPAT_INFINEON_SLB9645_TPM, /* Infineon SLB9645 TPM */ COMPAT_SAMSUNG_EXYNOS5_I2C, /* Exynos5 High Speed I2C Controller */ + COMPAT_SANDBOX_HOST_EMULATION, /* Sandbox emulation of a function */ COMPAT_COUNT, }; -- cgit v1.2.1 From 7d95f2a329c964b54cf505503a61e8fd4f12e2a3 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 27 Feb 2014 13:26:19 -0700 Subject: sandbox: Add LCD driver Add a simple LCD driver which uses SDL to display the image. We update the image regularly, while still providing for reasonable performance. Adjust the common lcd code to support sandbox. For command-line runs we do not want the LCD to be displayed, so add a --show_lcd option to enable it. Tested-by: Che-Liang Chiou Signed-off-by: Simon Glass --- include/fdtdec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/fdtdec.h') diff --git a/include/fdtdec.h b/include/fdtdec.h index bcd2ee5f9c..6e859ce64c 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -89,6 +89,7 @@ enum fdt_compat_id { COMPAT_INFINEON_SLB9645_TPM, /* Infineon SLB9645 TPM */ COMPAT_SAMSUNG_EXYNOS5_I2C, /* Exynos5 High Speed I2C Controller */ COMPAT_SANDBOX_HOST_EMULATION, /* Sandbox emulation of a function */ + COMPAT_SANDBOX_LCD_SDL, /* Sandbox LCD emulation with SDL */ COMPAT_COUNT, }; -- cgit v1.2.1