From: Zhang Haijun <b42677@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7 V5] mmc: Add some usefull macro definition
Date: Mon, 6 Jan 2014 11:09:23 +0800 [thread overview]
Message-ID: <52CA1E63.1080504@freescale.com> (raw)
In-Reply-To: <1388391658-28560-1-git-send-email-haijun.zhang@freescale.com>
Hi, Panto
Could you help review this patch set?
Best Regards,
-- Haijun
On 12/30/2013 04:20 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.zhang@freescale.com>
> ---
> changes for V5:
> - Add some comments for definitions
>
> include/mmc.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/include/mmc.h b/include/mmc.h
> index cb558da..607e28b 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 0x60000000
>
> +/*
> + * 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 (1<<0)
> +#define CCC_STREAM_READ (1<<1)
> +#define CCC_BLOCK_READ (1<<2)
> +#define CCC_STREAM_WRITE (1<<3)
> +#define CCC_BLOCK_WRITE (1<<4)
> +#define CCC_ERASE (1<<5)
> +#define CCC_WRITE_PROT (1<<6)
> +#define CCC_LOCK_CARD (1<<7)
> +#define CCC_APP_SPEC (1<<8)
> +#define CCC_IO_MODE (1<<9)
> +#define CCC_SWITCH (1<<10)
> +
> +#define MMC_ERASE_ARG 0x00000000
> +#define MMC_SECURE_ERASE_ARG 0x80000000
> +#define MMC_TRIM_ARG 0x00000001
> +#define MMC_DISCARD_ARG 0x00000003
> +
> #define SECURE_ERASE 0x80000000
>
> #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_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_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 */
>
> +/* SEC_FEATURE_SUPPORT[231] Field definitions */
> +#define EXT_CSD_SEC_ER_EN (1<<0)
> +#define EXT_CSD_SEC_BD_BLK_EN (1<<2)
> +#define EXT_CSD_SEC_GB_CL_EN (1<<4)
> +#define EXT_CSD_SEC_SANITIZE (1<<6) /* v4.5 later */
> +
> #define EXT_CSD_BOOT_ACK_ENABLE (1 << 6)
> #define EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3)
> #define EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0)
> @@ -187,7 +231,6 @@
> #define EXT_CSD_BOOT_PART_NUM(x) (x << 3)
> #define EXT_CSD_PARTITION_ACCESS(x) (x << 0)
>
> -
> #define R1_ILLEGAL_COMMAND (1 << 22)
> #define R1_APP_CMD (1 << 5)
>
> @@ -268,10 +311,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;
next prev parent reply other threads:[~2014-01-06 3:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 8:20 [U-Boot] [PATCH 1/7 V5] mmc: Add some usefull macro definition Haijun Zhang
2013-12-30 8:20 ` [U-Boot] [PATCH 2/7 V5] mmc: Get secure erase information from card Haijun Zhang
2014-01-09 11:09 ` Pantelis Antoniou
2014-01-10 3:49 ` Zhang Haijun
2013-12-30 8:20 ` [U-Boot] [PATCH 3/7 V5] mmc: Enhance erase handling procedure Haijun Zhang
2013-12-30 8:20 ` [U-Boot] [PATCH 4/7 V5] mmc: Update the handling of returned erase block Haijun Zhang
2013-12-30 8:20 ` [U-Boot] [PATCH 5/7 V5] mmc: Enhance mmcinfo command Haijun Zhang
2013-12-30 8:20 ` [U-Boot] [PATCH 6/7 V5] Powerpc/esdhc: Add esdhc host version define Haijun Zhang
2013-12-30 8:20 ` [U-Boot] [PATCH 7/7 V5] powerpc/esdhc: Update esdhc command execution process Haijun Zhang
2014-01-09 11:08 ` Pantelis Antoniou
2014-01-10 3:54 ` Zhang Haijun
2014-01-06 3:09 ` Zhang Haijun [this message]
2014-02-24 1:18 ` [U-Boot] [PATCH 1/7 V5] mmc: Add some usefull macro definition Zhang Haijun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52CA1E63.1080504@freescale.com \
--to=b42677@freescale.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.