Bora Guvendik has uploaded this change for review. ( https://review.coreboot.org/25464
Change subject: coreboot_tables: pass the early_mmc_wake_hw status to payload ......................................................................
coreboot_tables: pass the early_mmc_wake_hw status to payload
Pass the return value from early_mmc_wake_hw() to the payload.
Change-Id: Ia4c57d05433c3966118c3642913d7017958cce55 Signed-off-by: Bora Guvendik bora.guvendik@intel.com --- M payloads/libpayload/include/coreboot_tables.h M payloads/libpayload/include/sysinfo.h M payloads/libpayload/libc/coreboot.c M src/commonlib/include/commonlib/coreboot_tables.h M src/lib/coreboot_table.c 5 files changed, 44 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/25464/1
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index 6b6d1b4..aabd0a9 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -287,6 +287,13 @@ struct mac_address mac_addrs[0]; };
+#define CB_TAG_MMC_INFO 0x0034 +struct cb_mmc_info { + uint32_t tag; + uint32_t size; + int early_cmd1_status; +}; + #define CB_TAG_SERIALNO 0x002a #define CB_MAX_SERIALNO_LENGTH 32
diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h index f221a15..75affd1 100644 --- a/payloads/libpayload/include/sysinfo.h +++ b/payloads/libpayload/include/sysinfo.h @@ -129,6 +129,7 @@ uint64_t mtc_start; uint32_t mtc_size; void *chromeos_vpd; + int mmc_early_wake_status; };
extern struct sysinfo_t lib_sysinfo; diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index d831b96..4d0c3ef 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -94,6 +94,13 @@ info->vbnv_size = vbnv->range_size; }
+static void cb_parse_mmc_info(unsigned char *ptr, struct sysinfo_t *info) +{ + struct cb_mmc_info *mmc_info = (struct cb_mmc_info *)ptr; + + info->mmc_early_wake_status = mmc_info->early_cmd1_status; +} + static void cb_parse_gpios(unsigned char *ptr, struct sysinfo_t *info) { int i; @@ -399,6 +406,9 @@ case CB_TAG_SPI_FLASH: cb_parse_spi_flash(ptr, info); break; + case CB_TAG_MMC_INFO: + cb_parse_mmc_info(ptr, info); + break; case CB_TAG_MTC: cb_parse_mtc(ptr, info); break; diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index f411ff2..d6254b6 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -384,6 +384,13 @@ uint8_t pad[2]; /* Pad it to 8 bytes to keep it simple. */ };
+#define LB_TAG_MMC_INFO 0x0034 +struct lb_mmc_info { + uint32_t tag; + uint32_t size; + int early_cmd1_status; +}; + struct lb_macs { uint32_t tag; uint32_t size; diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index d03b771..8e05aa2 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -47,6 +47,7 @@ #include <cpu/x86/mtrr.h> #endif #include <commonlib/helpers.h> +#include <intelblocks/early_mmc.h>
static struct lb_header *lb_table_init(unsigned long addr) { @@ -328,6 +329,21 @@ printk(BIOS_INFO, "SKU ID: %d\n", sid); }
+static void lb_mmc_info(struct lb_header *header) +{ + struct lb_mmc_info *rec; + + rec = (struct lb_mmc_info *)lb_new_record(header); + + rec->tag = LB_TAG_MMC_INFO; + rec->size = sizeof(*rec); +#if IS_ENABLED(CONFIG_SOC_INTEL_COMMON_EARLY_MMC_WAKE) + rec->early_cmd1_status = get_early_mmc_wake_status(); +#else + rec->early_cmd1_status = -1; // pass it as an error +#endif +} + static void add_cbmem_pointers(struct lb_header *header) { /* @@ -567,6 +583,9 @@ lb_ram_code(head); lb_sku_id(head);
+ /* Pass mmc early init status */ + lb_mmc_info(head); + /* Add SPI flash description if available */ if (IS_ENABLED(CONFIG_BOOT_DEVICE_SPI_FLASH)) lb_spi_flash(head);