summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/include/coreboot_tables.h15
-rw-r--r--payloads/libpayload/include/sysinfo.h1
-rw-r--r--payloads/libpayload/libc/coreboot.c10
3 files changed, 26 insertions, 0 deletions
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index 92e3f26180..705e348666 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -287,6 +287,21 @@ struct cb_macs {
struct mac_address mac_addrs[0];
};
+#define CB_TAG_MMC_INFO 0x0034
+struct cb_mmc_info {
+ uint32_t tag;
+ uint32_t size;
+ /*
+ * Passes the early mmc status to payload to indicate if firmware
+ * successfully sent CMD0, CMD1 to the card or not. In case of
+ * success, the payload can skip the first step of the initialization
+ * sequence which is to send CMD0, and instead start by sending CMD1
+ * as described in Jedec Standard JESD83-B1 section 6.4.3.
+ * passes 1 on success
+ */
+ int32_t 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 7e6e74809d..72059adb91 100644
--- a/payloads/libpayload/include/sysinfo.h
+++ b/payloads/libpayload/include/sysinfo.h
@@ -129,6 +129,7 @@ struct sysinfo_t {
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 3982e47ec2..26a3a48c23 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -102,6 +102,13 @@ static void cb_parse_vbnv(unsigned char *ptr, struct sysinfo_t *info)
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 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
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;