Re: [U-Boot] [PATCH 1/7] mmc: Add some usefull macro definition
Dear Haijun, On 11/05/2013 03:23 PM, Haijun Zhang wrote: Add command class define. Add mmc erase and secure erase define. Add secure erase and trim support bit define. Signed-off-by: Haijun Zhang haijun.zh...@freescale.com --- include/mmc.h | 49 + 1 file changed, 49 insertions(+) diff --git a/include/mmc.h b/include/mmc.h index cb558da..26fab07 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -53,6 +53,7 @@ #define COMM_ERR -18 /* Communications Error */ #define TIMEOUT -19 #define IN_PROGRESS -20 /* operation is in progress */ +#define NOT_SUPPORT -21 /* Operation is not support */ #define MMC_CMD_GO_IDLE_STATE0 #define MMC_CMD_SEND_OP_COND 1 @@ -105,6 +106,39 @@ #define OCR_VOLTAGE_MASK 0x007FFF80 #define OCR_ACCESS_MODE 0x6000 +/* + * Card Command Classes (CCC) + * + * (0) Basic protocol functions (CMD0,1,2,3,4,7,9,10,12,13,15) + * (and for SPI, CMD58,59) + * (1) Stream read commands (CMD11) + * (2) Block read commands (CMD16,17,18) + * (3) Stream write commands (CMD20) + * (4) Block write commands (CMD16,24,25,26,27) + * (5) Ability to erase blocks (CMD32,33,34,35,36,37,38,39) + * (6) Able to write protect blocks (CMD28,29,30) + * (7) Able to lock down card (CMD16,CMD42) + * (8) Application specific (CMD55,56,57,ACMD*) + * (9) I/O mode (CMD5,39,40,52,53) + * (10) High speed switch (CMD6,34,35,36,37,50) + */ +#define CCC_BASIC(10) +#define CCC_STREAM_READ (11) +#define CCC_BLOCK_READ (12) +#define CCC_STREAM_WRITE (13) +#define CCC_BLOCK_WRITE (14) +#define CCC_ERASE(15) +#define CCC_WRITE_PROT (16) +#define CCC_LOCK_CARD(17) +#define CCC_APP_SPEC (18) +#define CCC_IO_MODE (19) +#define CCC_SWITCH (110) + +#define MMC_ERASE_ARG 0x +#define MMC_SECURE_ERASE_ARG0x8000 +#define MMC_TRIM_ARG0x0001 +#define MMC_DISCARD_ARG 0x0003 + #define SECURE_ERASE 0x8000 #define MMC_STATUS_MASK (~0x0206BF7F) @@ -160,8 +194,12 @@ #define EXT_CSD_CARD_TYPE196 /* RO */ #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ +#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ +#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ #define EXT_CSD_HC_ERASE_GRP_SIZE224 /* RO */ #define EXT_CSD_BOOT_MULT226 /* RO */ +#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ +#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ /* * EXT_CSD field definitions @@ -178,6 +216,12 @@ #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ +#define EXT_CSD_SEC_ER_EN(10) Where is this bit defined? +#define EXT_CSD_SEC_BD_BLK_EN(12) +#define EXT_CSD_SEC_GB_CL_EN (14) +#define EXT_CSD_SEC_SANITIZE (16) /* v4.5 only */ Which version do you refer? SEC_SANITIZE is only supported v4.5? then v4.51 or v5.0? I think that Comment need to modify. /* Since v4.5 */ + + remove the empty line. Best Regards, Jaehoon Chung #define EXT_CSD_BOOT_ACK_ENABLE (1 6) #define EXT_CSD_BOOT_PARTITION_ENABLE(1 3) #define EXT_CSD_PARTITION_ACCESS_ENABLE (1 0) @@ -268,10 +312,15 @@ struct mmc { ushort rca; char part_config; char part_num; + ushort cmdclass; uint tran_speed; uint read_bl_len; uint write_bl_len; uint erase_grp_size; + uint erase_timeout_mult; + char sec_feature_support; + uint sec_erase_mult; + uint sec_erase_timeout; u64 capacity; u64 capacity_user; u64 capacity_boot; ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/7] mmc: Add some usefull macro definition
Hi, Jaehoon ? 2013/11/8 9:15, Jaehoon Chung ??: Dear Haijun, On 11/05/2013 03:23 PM, Haijun Zhang wrote: Add command class define. Add mmc erase and secure erase define. Add secure erase and trim support bit define. Signed-off-by: Haijun Zhang haijun.zh...@freescale.com --- include/mmc.h | 49 + 1 file changed, 49 insertions(+) diff --git a/include/mmc.h b/include/mmc.h index cb558da..26fab07 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -53,6 +53,7 @@ #define COMM_ERR -18 /* Communications Error */ #define TIMEOUT -19 #define IN_PROGRESS -20 /* operation is in progress */ +#define NOT_SUPPORT-21 /* Operation is not support */ #define MMC_CMD_GO_IDLE_STATE 0 #define MMC_CMD_SEND_OP_COND 1 @@ -105,6 +106,39 @@ #define OCR_VOLTAGE_MASK 0x007FFF80 #define OCR_ACCESS_MODE 0x6000 +/* + * Card Command Classes (CCC) + * + * (0) Basic protocol functions (CMD0,1,2,3,4,7,9,10,12,13,15) + * (and for SPI, CMD58,59) + * (1) Stream read commands (CMD11) + * (2) Block read commands (CMD16,17,18) + * (3) Stream write commands (CMD20) + * (4) Block write commands (CMD16,24,25,26,27) + * (5) Ability to erase blocks (CMD32,33,34,35,36,37,38,39) + * (6) Able to write protect blocks (CMD28,29,30) + * (7) Able to lock down card (CMD16,CMD42) + * (8) Application specific (CMD55,56,57,ACMD*) + * (9) I/O mode (CMD5,39,40,52,53) + * (10) High speed switch (CMD6,34,35,36,37,50) + */ +#define CCC_BASIC (10) +#define CCC_STREAM_READ(11) +#define CCC_BLOCK_READ (12) +#define CCC_STREAM_WRITE (13) +#define CCC_BLOCK_WRITE(14) +#define CCC_ERASE (15) +#define CCC_WRITE_PROT (16) +#define CCC_LOCK_CARD (17) +#define CCC_APP_SPEC (18) +#define CCC_IO_MODE(19) +#define CCC_SWITCH (110) + +#define MMC_ERASE_ARG 0x +#define MMC_SECURE_ERASE_ARG0x8000 +#define MMC_TRIM_ARG0x0001 +#define MMC_DISCARD_ARG 0x0003 + #define SECURE_ERASE 0x8000 #define MMC_STATUS_MASK (~0x0206BF7F) @@ -160,8 +194,12 @@ #define EXT_CSD_CARD_TYPE 196 /* RO */ #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ #define EXT_CSD_HC_WP_GRP_SIZE221 /* RO */ +#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ +#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ #define EXT_CSD_BOOT_MULT 226 /* RO */ +#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ +#define EXT_CSD_SEC_FEATURE_SUPPORT231 /* RO */ /* * EXT_CSD field definitions @@ -178,6 +216,12 @@ #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ +#define EXT_CSD_SEC_ER_EN (10) Where is this bit defined? EXT_CSD[231] bit 0 (eMMC 4.41 and eMMC4.5 or later?) +#define EXT_CSD_SEC_BD_BLK_EN (12) +#define EXT_CSD_SEC_GB_CL_EN (14) +#define EXT_CSD_SEC_SANITIZE (16)/* v4.5 only */ Which version do you refer? SEC_SANITIZE is only supported v4.5? then v4.51 or v5.0? I think that Comment need to modify. /* Since v4.5 */ Thanks, I change it. + + remove the empty line. Thanks. Best Regards, Jaehoon Chung #define EXT_CSD_BOOT_ACK_ENABLE (1 6) #define EXT_CSD_BOOT_PARTITION_ENABLE (1 3) #define EXT_CSD_PARTITION_ACCESS_ENABLE (1 0) @@ -268,10 +312,15 @@ struct mmc { ushort rca; char part_config; char part_num; + ushort cmdclass; uint tran_speed; uint read_bl_len; uint write_bl_len; uint erase_grp_size; + uint erase_timeout_mult; + char sec_feature_support; + uint sec_erase_mult; + uint sec_erase_timeout; u64 capacity; u64 capacity_user; u64 capacity_boot; -- Thanks Regards Haijun. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/7] mmc: Add some usefull macro definition
Add command class define. Add mmc erase and secure erase define. Add secure erase and trim support bit define. Signed-off-by: Haijun Zhang haijun.zh...@freescale.com --- include/mmc.h | 49 + 1 file changed, 49 insertions(+) diff --git a/include/mmc.h b/include/mmc.h index cb558da..26fab07 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -53,6 +53,7 @@ #define COMM_ERR -18 /* Communications Error */ #define TIMEOUT-19 #define IN_PROGRESS-20 /* operation is in progress */ +#define NOT_SUPPORT-21 /* Operation is not support */ #define MMC_CMD_GO_IDLE_STATE 0 #define MMC_CMD_SEND_OP_COND 1 @@ -105,6 +106,39 @@ #define OCR_VOLTAGE_MASK 0x007FFF80 #define OCR_ACCESS_MODE0x6000 +/* + * Card Command Classes (CCC) + * + * (0) Basic protocol functions (CMD0,1,2,3,4,7,9,10,12,13,15) + * (and for SPI, CMD58,59) + * (1) Stream read commands (CMD11) + * (2) Block read commands (CMD16,17,18) + * (3) Stream write commands (CMD20) + * (4) Block write commands (CMD16,24,25,26,27) + * (5) Ability to erase blocks (CMD32,33,34,35,36,37,38,39) + * (6) Able to write protect blocks (CMD28,29,30) + * (7) Able to lock down card (CMD16,CMD42) + * (8) Application specific (CMD55,56,57,ACMD*) + * (9) I/O mode (CMD5,39,40,52,53) + * (10) High speed switch (CMD6,34,35,36,37,50) + */ +#define CCC_BASIC (10) +#define CCC_STREAM_READ(11) +#define CCC_BLOCK_READ (12) +#define CCC_STREAM_WRITE (13) +#define CCC_BLOCK_WRITE(14) +#define CCC_ERASE (15) +#define CCC_WRITE_PROT (16) +#define CCC_LOCK_CARD (17) +#define CCC_APP_SPEC (18) +#define CCC_IO_MODE(19) +#define CCC_SWITCH (110) + +#define MMC_ERASE_ARG 0x +#define MMC_SECURE_ERASE_ARG0x8000 +#define MMC_TRIM_ARG0x0001 +#define MMC_DISCARD_ARG 0x0003 + #define SECURE_ERASE 0x8000 #define MMC_STATUS_MASK(~0x0206BF7F) @@ -160,8 +194,12 @@ #define EXT_CSD_CARD_TYPE 196 /* RO */ #define EXT_CSD_SEC_CNT212 /* RO, 4 bytes */ #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ +#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ +#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ #define EXT_CSD_BOOT_MULT 226 /* RO */ +#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ +#define EXT_CSD_SEC_FEATURE_SUPPORT231 /* RO */ /* * EXT_CSD field definitions @@ -178,6 +216,12 @@ #define EXT_CSD_BUS_WIDTH_41 /* Card is in 4 bit mode */ #define EXT_CSD_BUS_WIDTH_82 /* Card is in 8 bit mode */ +#define EXT_CSD_SEC_ER_EN (10) +#define EXT_CSD_SEC_BD_BLK_EN (12) +#define EXT_CSD_SEC_GB_CL_EN (14) +#define EXT_CSD_SEC_SANITIZE (16) /* v4.5 only */ + + #define EXT_CSD_BOOT_ACK_ENABLE(1 6) #define EXT_CSD_BOOT_PARTITION_ENABLE (1 3) #define EXT_CSD_PARTITION_ACCESS_ENABLE(1 0) @@ -268,10 +312,15 @@ struct mmc { ushort rca; char part_config; char part_num; + ushort cmdclass; uint tran_speed; uint read_bl_len; uint write_bl_len; uint erase_grp_size; + uint erase_timeout_mult; + char sec_feature_support; + uint sec_erase_mult; + uint sec_erase_timeout; u64 capacity; u64 capacity_user; u64 capacity_boot; -- 1.8.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot