diff mbox series

[1/8] sunxi: Fix write to H616 DRAM CR register

Message ID 20221211163213.98540-2-jernej.skrabec@gmail.com
State Superseded
Delegated to: Andre Przywara
Headers show
Series sunxi: Update H616 DRAM driver | expand

Commit Message

Jernej Škrabec Dec. 11, 2022, 4:32 p.m. UTC
Vendor DRAM code actually writes to whole CR register and not just sets
bit 31 in mctl_ctrl_init().

Just to be safe, do that here too.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 arch/arm/mach-sunxi/dram_sun50i_h616.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andre Przywara Jan. 4, 2023, 12:35 a.m. UTC | #1
On Sun, 11 Dec 2022 17:32:06 +0100
Jernej Skrabec <jernej.skrabec@gmail.com> wrote:

> Vendor DRAM code actually writes to whole CR register and not just sets
> bit 31 in mctl_ctrl_init().
> 
> Just to be safe, do that here too.
> 
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Can't really verify this, but it seems to work (TM):

Acked-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>  arch/arm/mach-sunxi/dram_sun50i_h616.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
> index 454c845a0010..039e76224367 100644
> --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
> +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
> @@ -873,7 +873,7 @@ static bool mctl_ctrl_init(struct dram_para *para)
>  	writel(0x06000400, &mctl_ctl->unk_0x3240);
>  	writel(0x06000400, &mctl_ctl->unk_0x4240);
>  
> -	setbits_le32(&mctl_com->cr, BIT(31));
> +	writel(BIT(31), &mctl_com->cr);
>  
>  	mctl_set_addrmap(para);
>
diff mbox series

Patch

diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
index 454c845a0010..039e76224367 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
@@ -873,7 +873,7 @@  static bool mctl_ctrl_init(struct dram_para *para)
 	writel(0x06000400, &mctl_ctl->unk_0x3240);
 	writel(0x06000400, &mctl_ctl->unk_0x4240);
 
-	setbits_le32(&mctl_com->cr, BIT(31));
+	writel(BIT(31), &mctl_com->cr);
 
 	mctl_set_addrmap(para);