]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3399: use grf structure to access reg
authorKever Yang <kever.yang@rock-chips.com>
Fri, 29 Mar 2019 01:09:06 +0000 (09:09 +0800)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Wed, 1 May 2019 07:40:58 +0000 (09:40 +0200)
Prefer to use structure to access register if we could.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
arch/arm/mach-rockchip/rk3399/rk3399.c

index a0af096efd34da8f97a704590b2bda55cae27363..612ebdfe7299b74b9b365b29c19d3279d4292b6d 100644 (file)
@@ -7,11 +7,13 @@
 #include <spl_gpio.h>
 #include <asm/armv8/mmu.h>
 #include <asm/io.h>
+#include <asm/arch-rockchip/grf_rk3399.h>
 #include <asm/arch-rockchip/hardware.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 #define GRF_EMMCCORE_CON11 0xff77f02c
+#define GRF_BASE       0xff770000
 
 static struct mm_region rk3399_mem_map[] = {
        {
@@ -49,9 +51,10 @@ int dram_init_banksize(void)
 int arch_cpu_init(void)
 {
        /* We do some SoC one time setting here. */
+       struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
 
        /* Emmc clock generator: disable the clock multipilier */
-       rk_clrreg(GRF_EMMCCORE_CON11, 0x0ff);
+       rk_clrreg(&grf->emmccore_con[11], 0x0ff);
 
        return 0;
 }