diff options
author | Peng Fan <van.freenix@gmail.com> | 2016-09-01 11:13:38 +0800 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2016-10-18 15:34:02 +0800 |
commit | be950ab9d0625ae1a23c7a5e03dde8e5a676ea80 (patch) | |
tree | fbca2e9b5349521ca5601c2bbc934f1087d393ac /include | |
parent | 5ad998cbb8698052315d29bffaa4e264ebe4aad4 (diff) | |
download | u-boot-imx-be950ab9d0625ae1a23c7a5e03dde8e5a676ea80.zip u-boot-imx-be950ab9d0625ae1a23c7a5e03dde8e5a676ea80.tar.gz u-boot-imx-be950ab9d0625ae1a23c7a5e03dde8e5a676ea80.tar.bz2 |
mmc: sd: extracting erase related information from sd status
Add function to read SD_STATUS information.
According to the information, get erase_timeout/erase_size/erase_offset.
Add a structure sd_ssr to include the erase related information.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Eric Nelson <eric@nelint.com>
Cc: Stephen Warren <swarren@nvidia.com>
(cherry picked from commit 3697e5992f89c923aca17d7d9174739da28cb3cd)
Diffstat (limited to 'include')
-rw-r--r-- | include/mmc.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h index d652c14..55e9924 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -11,6 +11,7 @@ #define _MMC_H_ #include <linux/list.h> +#include <linux/sizes.h> #include <linux/compiler.h> #include <part.h> @@ -107,6 +108,7 @@ #define SD_CMD_SWITCH_UHS18V 11 #define SD_CMD_APP_SET_BUS_WIDTH 6 +#define SD_CMD_APP_SD_STATUS 13 #define SD_CMD_ERASE_WR_BLK_START 32 #define SD_CMD_ERASE_WR_BLK_END 33 #define SD_CMD_APP_SEND_OP_COND 41 @@ -342,6 +344,12 @@ struct mmc_config { unsigned char part_type; }; +struct sd_ssr { + unsigned int au; /* In sectors */ + unsigned int erase_timeout; /* In milliseconds */ + unsigned int erase_offset; /* In milliseconds */ +}; + /* TODO struct mmc should be in mmc_private but it's hard to fix right now */ struct mmc { struct list_head link; @@ -369,6 +377,7 @@ struct mmc { uint write_bl_len; uint erase_grp_size; /* in 512-byte sectors */ uint hc_wp_grp_size; /* in 512-byte sectors */ + struct sd_ssr ssr; /* SD status register */ u64 capacity; u64 capacity_user; u64 capacity_boot; |