mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: set RCA to 2 according to eMMC specification
@ 2023-11-29  8:29 Yann Sionneau
  2023-12-05  7:52 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Yann Sionneau @ 2023-11-29  8:29 UTC (permalink / raw)
  To: barebox; +Cc: Yann Sionneau

According to eMMC Protocol Specification JESD84-B51 Section 7.5

```
The writable 16-bit relative Device address (RCA) register carries the Device
address assigned by the host during the Device identification. This address is
used for the addressed host-Device communication after the Device identification
procedure. The default value of the RCA register is 0x0001. The value 0x0000 is
reserved to set all Devices into the Stand-by State with CMD7.
```

So definetely 0 does not seem to be a good value.
Second, the specification says in
A.6 High-speed e•MMC bus functions / A.6.1 Bus initialization:

```
17. Send CMD3 with a chosen RCA, with value greater than 1
```

And third, I used a VIP (Verification IP) and plugged it to a simulated host
controller chip running Barebox and it said:

```
MGC_EMMC: EMMC_SET_RELATIVE_ADDR_INCORR:152 - Set relative addr should be
greater than 1. address given is = 16'h0001
Refer to the eMMC Protocol Specification JESD84-B51 Section 7.5
```

Note that with an RCA value of 0 or 1, the VIP would print the same error message.

Set RCA to 2 instead of 0 for eMMC/MMC case.

Signed-off-by: Yann Sionneau <ysionneau@kalrayinc.com>
---
 drivers/mci/mci-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 6d0d647377..b9a8580927 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -450,7 +450,7 @@ static int mmc_send_op_cond(struct mci *mci)
 	mci->ocr = cmd.response[0];
 
 	mci->high_capacity = ((mci->ocr & OCR_HCS) == OCR_HCS);
-	mci->rca = 0;
+	mci->rca = 2;
 
 	return 0;
 }
-- 
2.42.0








^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mci: set RCA to 2 according to eMMC specification
  2023-11-29  8:29 [PATCH] mci: set RCA to 2 according to eMMC specification Yann Sionneau
@ 2023-12-05  7:52 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-12-05  7:52 UTC (permalink / raw)
  To: Yann Sionneau; +Cc: barebox

On Wed, Nov 29, 2023 at 09:29:56AM +0100, Yann Sionneau wrote:
> According to eMMC Protocol Specification JESD84-B51 Section 7.5
> 
> ```
> The writable 16-bit relative Device address (RCA) register carries the Device
> address assigned by the host during the Device identification. This address is
> used for the addressed host-Device communication after the Device identification
> procedure. The default value of the RCA register is 0x0001. The value 0x0000 is
> reserved to set all Devices into the Stand-by State with CMD7.
> ```
> 
> So definetely 0 does not seem to be a good value.
> Second, the specification says in
> A.6 High-speed e•MMC bus functions / A.6.1 Bus initialization:
> 
> ```
> 17. Send CMD3 with a chosen RCA, with value greater than 1
> ```
> 
> And third, I used a VIP (Verification IP) and plugged it to a simulated host
> controller chip running Barebox and it said:
> 
> ```
> MGC_EMMC: EMMC_SET_RELATIVE_ADDR_INCORR:152 - Set relative addr should be
> greater than 1. address given is = 16'h0001
> Refer to the eMMC Protocol Specification JESD84-B51 Section 7.5
> ```
> 
> Note that with an RCA value of 0 or 1, the VIP would print the same error message.
> 
> Set RCA to 2 instead of 0 for eMMC/MMC case.
> 
> Signed-off-by: Yann Sionneau <ysionneau@kalrayinc.com>
> ---
>  drivers/mci/mci-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> index 6d0d647377..b9a8580927 100644
> --- a/drivers/mci/mci-core.c
> +++ b/drivers/mci/mci-core.c
> @@ -450,7 +450,7 @@ static int mmc_send_op_cond(struct mci *mci)
>  	mci->ocr = cmd.response[0];
>  
>  	mci->high_capacity = ((mci->ocr & OCR_HCS) == OCR_HCS);
> -	mci->rca = 0;
> +	mci->rca = 2;
>  
>  	return 0;
>  }
> -- 
> 2.42.0
> 
> 
> 
> 
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-05  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29  8:29 [PATCH] mci: set RCA to 2 according to eMMC specification Yann Sionneau
2023-12-05  7:52 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox