summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commonlib/include/commonlib/coreboot_tables.h15
-rw-r--r--src/lib/coreboot_table.c19
2 files changed, 34 insertions, 0 deletions
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index 198ad27b87..99ab21c724 100644
--- a/src/commonlib/include/commonlib/coreboot_tables.h
+++ b/src/commonlib/include/commonlib/coreboot_tables.h
@@ -385,6 +385,21 @@ struct mac_address {
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;
+ /*
+ * 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;
+};
+
struct lb_macs {
uint32_t tag;
uint32_t size;
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index 6e44f5d3d5..14cd030202 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -321,6 +321,22 @@ static void lb_sku_id(struct lb_header *header)
printk(BIOS_INFO, "SKU ID: %d\n", sid);
}
+static void lb_mmc_info(struct lb_header *header)
+{
+ struct lb_mmc_info *rec;
+ int32_t *ms_cbmem;
+
+ ms_cbmem = cbmem_find(CBMEM_ID_MMC_STATUS);
+ if (!ms_cbmem)
+ return;
+
+ rec = (struct lb_mmc_info *)lb_new_record(header);
+
+ rec->tag = LB_TAG_MMC_INFO;
+ rec->size = sizeof(*rec);
+ rec->early_cmd1_status = *ms_cbmem;
+}
+
static void add_cbmem_pointers(struct lb_header *header)
{
/*
@@ -559,6 +575,9 @@ static uintptr_t write_coreboot_table(uintptr_t rom_table_end)
lb_ram_code(head);
lb_sku_id(head);
+ /* Pass mmc early init status */
+ lb_mmc_info(head);
+
/* Add SPI flash description if available */
if (CONFIG(BOOT_DEVICE_SPI_FLASH))
lb_spi_flash(head);