[U-Boot] [PATCH v2 09/10] rockchip: rk3399: use grf structure to access reg
Kever Yang
kever.yang at rock-chips.com
Fri Mar 29 01:09:06 UTC 2019
Prefer to use structure to access register if we could.
Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---
arch/arm/mach-rockchip/rk3399/rk3399.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 7567a4f584..b76ba4ed32 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -6,11 +6,13 @@
#include <common.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[] = {
{
@@ -48,9 +50,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;
}
--
2.20.1
More information about the U-Boot
mailing list