]> git.dujemihanovic.xyz Git - u-boot.git/commit
sunxi: H6: DRAM: avoid memcpy() on MMIO registers
authorAndre Przywara <andre.przywara@arm.com>
Mon, 15 Jul 2019 01:27:04 +0000 (02:27 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Tue, 16 Jul 2019 11:39:06 +0000 (17:09 +0530)
commit1a1d1df384579e1323c72e8ba888ce45bfc4e781
treed3bbc6ad435e764f3e2eff291eda36947c52616a
parenta9e19b8ff783644f13dbf12d302c588e33da09a5
sunxi: H6: DRAM: avoid memcpy() on MMIO registers

Using memcpy() is, however tempting, not a good idea: It depends on the
specific implementation of memcpy, also lacks barriers. In this
particular case the first registers were written using 64-bit writes,
and the last register using four separate single-byte writes.

Replace the memcpy with a proper loop using the writel() accessor.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
arch/arm/mach-sunxi/dram_sun50i_h6.c