update R_PIO GPIO block enable (H3/H5)

Move the previous "R_PIO enable" change to initial board gpio_init (from clock_init)
This commit is contained in:
5kft 2018-08-04 12:57:39 +00:00 committed by 5kft
parent c721510e6e
commit c3f02be362
2 changed files with 24 additions and 17 deletions

View file

@ -1,17 +0,0 @@
diff --git a/arch/arm/mach-sunxi/clock_sun6i.c b/arch/arm/mach-sunxi/clock_sun6i.c
index 6bfda31..59d556f 100644
--- a/arch/arm/mach-sunxi/clock_sun6i.c
+++ b/arch/arm/mach-sunxi/clock_sun6i.c
@@ -76,6 +76,12 @@ void clock_init_sec(void)
PRCM_SEC_SWITCH_APB0_CLK_NONSEC |
PRCM_SEC_SWITCH_PLL_CFG_NONSEC |
PRCM_SEC_SWITCH_PWR_GATE_NONSEC);
+
+#if defined(CONFIG_SPL_BUILD) && (CONFIG_CONS_INDEX < 5)
+ /* enable R_PIO access within the SPL */
+ prcm_apb0_enable(PRCM_APB0_GATE_PIO);
+#endif
+
#endif
}

View file

@ -0,0 +1,24 @@
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 7ac8360..0484e7a 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -23,6 +23,7 @@
#include <asm/arch/timer.h>
#include <asm/arch/tzpc.h>
#include <asm/arch/mmc.h>
+#include <asm/arch/prcm.h>
#include <linux/compiler.h>
@@ -65,6 +66,11 @@ struct mm_region *mem_map = sunxi_mem_map;
static int gpio_init(void)
{
+#if defined(CONFIG_MACH_SUNXI_H3_H5)
+ /* enable R_PIO GPIO access */
+ prcm_apb0_enable(PRCM_APB0_GATE_PIO);
+#endif
+
#if CONFIG_CONS_INDEX == 1 && defined(CONFIG_UART0_PORT_F)
#if defined(CONFIG_MACH_SUN4I) || \
defined(CONFIG_MACH_SUN7I) || \