Skip to contentSkip to conversation

rockchip: elgin-rv1108: Use syscon API to get grf base

PATCH New Kever Yang 3 participants 5 messages Feb 19, 2020 – Feb 20, 2020 Arm Rockchip

lore
Share & tools
lore

Kever Yang

author
#0 lore raw

PATCH 1/2 rockchip: elgin-rv1108: Use syscon API to get grf base

Use syscon API to get grf base instead of get from dts.

---

 board/elgin/elgin_rv1108/elgin_rv1108.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
board/elgin/elgin_rv1108/elgin_rv1108.c +3 -4
index 607667ac63..06df25a326 100644
@@ -5,8 +5,9 @@
  */
 
 #include <common.h>
+#include <syscon.h>
 #include <asm/io.h>
-#include <fdtdec.h>
+#include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/grf_rv1108.h>
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/gpio.h>
@@ -15,7 +16,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int mach_cpu_init(void)
 {
-	int node;
 	struct rv1108_grf *grf;
 	enum {
 		GPIO3C3_SHIFT           = 6,
@@ -35,8 +35,7 @@ int mach_cpu_init(void)
 		GPIO2D1_UART2_SIN_M0,
 	};
 
-	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf");
-	grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
+	grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
 
 	/* Elgin board use UART2 m0 for debug*/
 	rk_clrsetreg(&grf->gpio2d_iomux,
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/2 rockchip: evb-rv1108: Use syscon API to get grf base

Use syscon API to get grf base instead of get from dts.

---

 board/rockchip/evb_rv1108/evb_rv1108.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
board/rockchip/evb_rv1108/evb_rv1108.c +3 -4
index 733f29376e..5d622c3737 100644
@@ -5,8 +5,9 @@
  */
 
 #include <common.h>
+#include <syscon.h>
 #include <asm/io.h>
-#include <fdtdec.h>
+#include <asm/arch-rockchip/clock.h>
 #include <asm/arch-rockchip/grf_rv1108.h>
 #include <asm/arch-rockchip/hardware.h>
 
@@ -14,7 +15,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int mach_cpu_init(void)
 {
-	int node;
 	struct rv1108_grf *grf;
 	enum {
 		GPIO3C3_SHIFT           = 6,
@@ -34,8 +34,7 @@ int mach_cpu_init(void)
 		GPIO2D1_UART2_SIN_M0,
 	};
 
-	node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf");
-	grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
+	grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
 
 	/*evb board use UART2 m0 for debug*/
 	rk_clrsetreg(&grf->gpio2d_iomux,
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 rockchip: evb-rv1108: Use syscon API to get grf base

Quoted 8 lines · Kever Yang

Use syscon API to get grf base instead of get from dts.

---

 board/rockchip/evb_rv1108/evb_rv1108.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

You might consider putting this code in a BOARD driver.

#4 lore raw

PATCH 1/2 rockchip: elgin-rv1108: Use syscon API to get grf base

Quoted 5 lines · Simon Glass
Quoted 3 lines · Kever Yang

Use syscon API to get grf base instead of get from dts.

Quoted 7 lines
Quoted 5 lines

---

 board/elgin/elgin_rv1108/elgin_rv1108.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750