public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7 V4] mmc: Add some usefull macro definition
Date: Fri, 27 Dec 2013 20:29:42 +0900	[thread overview]
Message-ID: <52BD64A6.1030705@samsung.com> (raw)
In-Reply-To: <1386663654-14498-1-git-send-email-haijun.zhang@freescale.com>

Hi, Haijun.

On 12/10/2013 05:20 PM, Haijun Zhang wrote:
> From: Haijun Zhang <Haijun.Zhang@freescale.com>
> 
> 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 V4:
>         - no changes
> changes for V3:
>         - No changes
> 
>  include/mmc.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 49 insertions(+), 1 deletion(-)
> 
> diff --git a/include/mmc.h b/include/mmc.h
> index cb558da..08f0f3e 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 */
>  
> +/* EXT_CSD[231] */

If you want to add the comment for EXT_CSD[231],
I think good like this.
/* SEC_FEATURE_SUPPORT[231] Field definitions */

Best Regards,
Jaehoon Chung

> +#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;
> 

  parent reply	other threads:[~2013-12-27 11:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-10  8:20 [U-Boot] [PATCH 1/7 V4] mmc: Add some usefull macro definition Haijun Zhang
2013-12-10  8:20 ` [U-Boot] [PATCH 2/7 V4] mmc: Get secure erase information from card Haijun Zhang
2013-12-10  8:20 ` [U-Boot] [PATCH 3/7 V4] mmc: Enhance erase handling procedure Haijun Zhang
2013-12-10  8:20 ` [U-Boot] [PATCH 4/7 V4] mmc: Update the handling of returned erase block Haijun Zhang
2013-12-10  8:20 ` [U-Boot] [PATCH 5/7 V4] mmc: Enhance mmcinfo command Haijun Zhang
2013-12-10  8:20 ` [U-Boot] [PATCH 6/7 V4] Powerpc/esdhc: Add esdhc host version define Haijun Zhang
2013-12-10  8:20 ` [U-Boot] [PATCH 7/7 V4] powerpc/esdhc: Update esdhc command execution process Haijun Zhang
2013-12-16  1:54 ` [U-Boot] [PATCH 1/7 V4] mmc: Add some usefull macro definition Haijun.Zhang at freescale.com
2013-12-27 11:29 ` Jaehoon Chung [this message]
2013-12-30  4:03   ` Zhang Haijun
2014-01-06  3:07 ` 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=52BD64A6.1030705@samsung.com \
    --to=jh80.chung@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox