summaryrefslogtreecommitdiff
path: root/include/mmc.h
diff options
context:
space:
mode:
authorPierre Aubert <p.aubert@staubli.com>2014-04-24 10:30:06 +0200
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-05-23 11:52:51 +0300
commit91fdabc67aebc2468ad362c02449f215e0971c68 (patch)
tree7039888b03cdb2bc518e68ac5415ccda7bf3ac12 /include/mmc.h
parent6b2221b008e0ea66de5befab38515e1a38c74d4f (diff)
downloadu-boot-imx-91fdabc67aebc2468ad362c02449f215e0971c68.zip
u-boot-imx-91fdabc67aebc2468ad362c02449f215e0971c68.tar.gz
u-boot-imx-91fdabc67aebc2468ad362c02449f215e0971c68.tar.bz2
eMMC: add support for operations in RPMB partition
This patch adds functions for read, write and authentication key programming for the Replay Protected Memory Block partition in the eMMC. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Pierre Aubert <p.aubert@staubli.com>
Diffstat (limited to 'include/mmc.h')
-rw-r--r--include/mmc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/mmc.h b/include/mmc.h
index 9143efe..a3a100b 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -71,6 +71,7 @@
#define MMC_CMD_SET_BLOCKLEN 16
#define MMC_CMD_READ_SINGLE_BLOCK 17
#define MMC_CMD_READ_MULTIPLE_BLOCK 18
+#define MMC_CMD_SET_BLOCK_COUNT 23
#define MMC_CMD_WRITE_SINGLE_BLOCK 24
#define MMC_CMD_WRITE_MULTIPLE_BLOCK 25
#define MMC_CMD_ERASE_GROUP_START 35
@@ -227,6 +228,7 @@
* boot partitions (2), general purpose partitions (4) in MMC v4.4.
*/
#define MMC_NUM_BOOT_PARTITION 2
+#define MMC_PART_RPMB 3 /* RPMB partition number */
struct mmc_cid {
unsigned long psn;
@@ -338,7 +340,13 @@ int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode);
/* Function to modify the RST_n_FUNCTION field of EXT_CSD */
int mmc_set_rst_n_function(struct mmc *mmc, u8 enable);
-
+/* Functions to read / write the RPMB partition */
+int mmc_rpmb_set_key(struct mmc *mmc, void *key);
+int mmc_rpmb_get_counter(struct mmc *mmc, unsigned long *counter);
+int mmc_rpmb_read(struct mmc *mmc, void *addr, unsigned short blk,
+ unsigned short cnt, unsigned char *key);
+int mmc_rpmb_write(struct mmc *mmc, void *addr, unsigned short blk,
+ unsigned short cnt, unsigned char *key);
/**
* Start device initialization and return immediately; it does not block on
* polling OCR (operation condition register) status. Then you should call