public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@gmail.com>
To: Sean Anderson <seanga2@gmail.com>, u-boot@lists.denx.de
Cc: Peng Fan <peng.fan@nxp.com>, Simon Glass <sjg@chromium.org>,
	Jaehoon Chung <jh80.chung@samsung.com>
Subject: Re: [PATCH 3/4] mmc: Import some defines for R1 responses
Date: Fri, 22 Apr 2022 21:03:41 +0900	[thread overview]
Message-ID: <359b6bcd-5bbb-8efc-5e39-1b94add8a2c5@gmail.com> (raw)
In-Reply-To: <20220330165446.438925-4-seanga2@gmail.com>



On 3/31/22 01:54, Sean Anderson wrote:
> This imports defines for R1 responses from include/linux/mmc/mmc.h from
> Linux 5.10.
> 
> Signed-off-by: Sean Anderson <seanga2@gmail.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
> Yes, this is an old version, but it's what I had checked out, and I don't think
> there are any new fields we need to handle :)
> 
>  include/mmc.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 50 insertions(+), 2 deletions(-)
> 
> diff --git a/include/mmc.h b/include/mmc.h
> index 6bdcce881d..7304eee0d4 100644
> --- a/include/mmc.h
> +++ b/include/mmc.h
> @@ -311,8 +311,56 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
>  #define EXT_CSD_WR_DATA_REL_USR		(1 << 0)	/* user data area WR_REL */
>  #define EXT_CSD_WR_DATA_REL_GP(x)	(1 << ((x)+1))	/* GP part (x+1) WR_REL */
>  
> -#define R1_ILLEGAL_COMMAND		(1 << 22)
> -#define R1_APP_CMD			(1 << 5)
> +/*
> +  MMC status in R1, for native mode (SPI bits are different)
> +  Type
> +	e : error bit
> +	s : status bit
> +	r : detected and set for the actual command response
> +	x : detected and set during command execution. the host must poll
> +            the card by sending status command in order to read these bits.
> +  Clear condition
> +	a : according to the card state
> +	b : always related to the previous command. Reception of
> +            a valid command will clear it (with a delay of one command)
> +	c : clear by read
> + */
> +
> +#define R1_OUT_OF_RANGE		(1 << 31)	/* er, c */
> +#define R1_ADDRESS_ERROR	(1 << 30)	/* erx, c */
> +#define R1_BLOCK_LEN_ERROR	(1 << 29)	/* er, c */
> +#define R1_ERASE_SEQ_ERROR      (1 << 28)	/* er, c */
> +#define R1_ERASE_PARAM		(1 << 27)	/* ex, c */
> +#define R1_WP_VIOLATION		(1 << 26)	/* erx, c */
> +#define R1_CARD_IS_LOCKED	(1 << 25)	/* sx, a */
> +#define R1_LOCK_UNLOCK_FAILED	(1 << 24)	/* erx, c */
> +#define R1_COM_CRC_ERROR	(1 << 23)	/* er, b */
> +#define R1_ILLEGAL_COMMAND	(1 << 22)	/* er, b */
> +#define R1_CARD_ECC_FAILED	(1 << 21)	/* ex, c */
> +#define R1_CC_ERROR		(1 << 20)	/* erx, c */
> +#define R1_ERROR		(1 << 19)	/* erx, c */
> +#define R1_UNDERRUN		(1 << 18)	/* ex, c */
> +#define R1_OVERRUN		(1 << 17)	/* ex, c */
> +#define R1_CID_CSD_OVERWRITE	(1 << 16)	/* erx, c, CID/CSD overwrite */
> +#define R1_WP_ERASE_SKIP	(1 << 15)	/* sx, c */
> +#define R1_CARD_ECC_DISABLED	(1 << 14)	/* sx, a */
> +#define R1_ERASE_RESET		(1 << 13)	/* sr, c */
> +#define R1_STATUS(x)            (x & 0xFFF9A000)
> +#define R1_CURRENT_STATE(x)	((x & 0x00001E00) >> 9)	/* sx, b (4 bits) */
> +#define R1_READY_FOR_DATA	(1 << 8)	/* sx, a */
> +#define R1_SWITCH_ERROR		(1 << 7)	/* sx, c */
> +#define R1_EXCEPTION_EVENT	(1 << 6)	/* sr, a */
> +#define R1_APP_CMD		(1 << 5)	/* sr, c */
> +
> +#define R1_STATE_IDLE	0
> +#define R1_STATE_READY	1
> +#define R1_STATE_IDENT	2
> +#define R1_STATE_STBY	3
> +#define R1_STATE_TRAN	4
> +#define R1_STATE_DATA	5
> +#define R1_STATE_RCV	6
> +#define R1_STATE_PRG	7
> +#define R1_STATE_DIS	8
>  
>  #define MMC_RSP_PRESENT (1 << 0)
>  #define MMC_RSP_136	(1 << 1)		/* 136 bit response */

  reply	other threads:[~2022-04-22 12:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 16:54 [PATCH 0/4] mmc: sandbox: Some small fixes Sean Anderson
2022-03-30 16:54 ` [PATCH 1/4] mmc: sandbox: Initialize the status register Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung
2022-04-26  7:56     ` Jaehoon Chung
2022-08-13 15:26       ` Sean Anderson
2022-09-08 11:38         ` Jaehoon Chung
2022-03-30 16:54 ` [PATCH 2/4] mmc: sandbox: Initialize backing buffer Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung
2022-03-30 16:54 ` [PATCH 3/4] mmc: Import some defines for R1 responses Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung [this message]
2022-03-30 16:54 ` [PATCH 4/4] mmc: sandbox: Set the response Sean Anderson
2022-04-22 12:03   ` Jaehoon Chung

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=359b6bcd-5bbb-8efc-5e39-1b94add8a2c5@gmail.com \
    --to=jh80.chung@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=peng.fan@nxp.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --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