[U-Boot] [PATCH] mmc: sd_sdhi: add support for 32-bit data buffer

Marek Vasut marek.vasut at gmail.com
Wed Nov 15 09:27:59 UTC 2017


On 11/14/2017 03:17 PM, Chris Brandt wrote:
> Hi Marek,
> 
> On Tuesday, November 14, 2017, Marek Vasut wrote:
>> On 11/13/2017 09:51 PM, Chris Brandt wrote:
>>> Some controllers have a 32-bit data buffer register and do not allow
>>> any other access besides 32-bit read/write.
>>>
>>> Signed-off-by: Chris Brandt <chris.brandt at renesas.com>
>>
>> Can you switch to uniphier-sd instead ? I switched Gen3 away from SH
>> SDHI and the uniphier driver is so much better.
> 
> Interesting.
> 
> 
> However...
> 
> Functionally, the SDHI in the RZ/A1 is the same as R-Car.
> 
> But, there is 1 difference: The registers are spaced 16-bits apart where
> the R-Car is 64-bit spaced apart.
> 
> Also, all the RZ/A1 registers are 16-bit, except for the data register 
> (SD_BUF0) which is 32-bit. That's why I had to patch the upstream kernel 
> driver specifically for RZ/A1.
> 
> The uniphier-sd is only setup for 32-bit or 64-bit spacing.
> 
> So, if I can get away with just this simple patch:
> 
> static u32 uniphier_sd_readl(struct uniphier_sd_priv *priv, unsigned int reg)
> {
> 	if (priv->caps & UNIPHIER_SD_CAP_64BIT)
> 		return readl(priv->regbase + (reg << 1));
> 	if (priv->caps & UNIPHIER_SD_CAP_16BIT)
> 		return readl(priv->regbase + (reg >> 1));
> 	else
> 		return readl(priv->regbase + reg);
> }
> 
> Then maybe I can use it.
> 
> I'll try it and see how it goes since I prefer to use the same drivers as R-Car.

Awesome, thanks !

I'd prefer to decommission sh_sdhi driver sometimes soon too btw :)

> Chris
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list