diff mbox series

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

Message ID 20200219014606.18515-1-kever.yang@rock-chips.com
State Accepted
Commit 4aa33690fc9a225e7e35b5870e4c7378aae46e67
Headers show
Series [1/2] rockchip: elgin-rv1108: Use syscon API to get grf base | expand

Commit Message

Kever Yang Feb. 19, 2020, 1:46 a.m. UTC
Use syscon API to get grf base instead of get from dts.

Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---

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

Comments

Simon Glass Feb. 20, 2020, 3:04 a.m. UTC | #1
On Tue, 18 Feb 2020 at 18:46, Kever Yang <kever.yang at rock-chips.com> wrote:
>
> Use syscon API to get grf base instead of get from dts.
>
> Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
> ---
>
>  board/elgin/elgin_rv1108/elgin_rv1108.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>
Otavio Salvador Feb. 20, 2020, 12:02 p.m. UTC | #2
On Thu, Feb 20, 2020 at 12:05 AM Simon Glass <sjg at chromium.org> wrote:
>
> On Tue, 18 Feb 2020 at 18:46, Kever Yang <kever.yang at rock-chips.com> wrote:
> >
> > Use syscon API to get grf base instead of get from dts.
> >
> > Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
> > ---
> >
> >  board/elgin/elgin_rv1108/elgin_rv1108.c | 7 +++----
> >  1 file changed, 3 insertions(+), 4 deletions(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Acked-by: Otavio Salvador <otavio at ossystems.com.br>
diff mbox series

Patch

diff --git a/board/elgin/elgin_rv1108/elgin_rv1108.c b/board/elgin/elgin_rv1108/elgin_rv1108.c
index 607667ac63..06df25a326 100644
--- a/board/elgin/elgin_rv1108/elgin_rv1108.c
+++ b/board/elgin/elgin_rv1108/elgin_rv1108.c
@@ -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,