Skip to contentSkip to conversation

rockchip: clean up pinctrl init code

PATCH New Kever Yang 2 participants 6 messages Jul 9, 2019

Subsystems (3)
lore
Share & tools
lore

Kever Yang

author
#0 lore raw

cover rockchip: clean up pinctrl init code

After the common pinctrl driver use the dts node to init per-driver iomux, we are not able to use the legacy interface, clean all related code.

Kever Yang (4):
rockchip: rk3399: remove pinctrl init in spl_board_init
rockchip: rk3188: remove pinctrl init in spl_board_init
rockchip: rk3288: remove pinctrl init in spl_board_init
rockchip: remove redundant pinctrl header including

 arch/arm/mach-rockchip/rk3036-board.c     |  1 -
 arch/arm/mach-rockchip/rk3188-board-spl.c |  1 -
 arch/arm/mach-rockchip/rk3188-board.c     | 31 -----------------------
 arch/arm/mach-rockchip/rk3288-board-spl.c |  1 -
 arch/arm/mach-rockchip/rk3288-board.c     | 27 --------------------
 arch/arm/mach-rockchip/rk3328-board-spl.c |  1 -
 arch/arm/mach-rockchip/rk3399-board-spl.c |  8 ------
 7 files changed, 70 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/4 rockchip: rk3399: remove pinctrl init in spl_board_init

The pinctrl will default init the io while driver is probe with new pinctrl driver.

---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 8 --------
 1 file changed, 8 deletions(-)
arch/arm/mach-rockchip/rk3399-board-spl.c +0 -8
index 890d80025f..2333694caa 100644
@@ -21,7 +21,6 @@
 #include <asm/arch-rockchip/periph.h>
 #include <asm/arch-rockchip/sys_proto.h>
 #include <power/regulator.h>
-#include <dm/pinctrl.h>
 
 void board_return_to_bootrom(void)
 {
@@ -133,7 +132,6 @@ void secure_timer_init(void)
 
 void board_init_f(ulong dummy)
 {
-	struct udevice *pinctrl;
 	struct udevice *dev;
 	struct rk3399_pmusgrf_regs *sgrf;
 	struct rk3399_grf_regs *grf;
@@ -192,12 +190,6 @@ void board_init_f(ulong dummy)
 
 	secure_timer_init();
 
-	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-	if (ret) {
-		pr_err("Pinctrl init failed: %d\n", ret);
-		return;
-	}
-
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret) {
 		pr_err("DRAM init failed: %d\n", ret);
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/4 rockchip: rk3188: remove pinctrl init in spl_board_init

In reply to Kever Yang

The pinctrl will default init the io while driver is probe with new pinctrl driver.

---

 arch/arm/mach-rockchip/rk3188-board-spl.c |  1 -
 arch/arm/mach-rockchip/rk3188-board.c     | 31 -----------------------
 2 files changed, 32 deletions(-)
arch/arm/mach-rockchip/rk3188-board-spl.c +0 -1
index 77b9b36d35..84c2a5756f 100644
@@ -23,7 +23,6 @@
 #include <asm/arch-rockchip/pmu_rk3188.h>
 #include <asm/arch-rockchip/sdram.h>
 #include <asm/arch-rockchip/timer.h>
-#include <dm/pinctrl.h>
 #include <dm/root.h>
 #include <dm/test.h>
 #include <dm/util.h>
arch/arm/mach-rockchip/rk3188-board.c +0 -31
index 80d8c4241e..94fd6c01eb 100644
@@ -15,7 +15,6 @@
 #include <asm/arch-rockchip/periph.h>
 #include <asm/arch-rockchip/pmu_rk3288.h>
 #include <asm/arch-rockchip/boot_mode.h>
-#include <dm/pinctrl.h>
 
 __weak int rk_board_late_init(void)
 {
@@ -42,37 +41,7 @@ int board_late_init(void)
 
 int board_init(void)
 {
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-	struct udevice *pinctrl;
-	int ret;
-
-	/*
-	 * We need to implement sdcard iomux here for the further
-	 * initialization, otherwise, it'll hit sdcard command sending
-	 * timeout exception.
-	 */
-	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-	if (ret) {
-		debug("%s: Cannot find pinctrl device\n", __func__);
-		goto err;
-	}
-	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-	if (ret) {
-		debug("%s: Failed to set up SD card\n", __func__);
-		goto err;
-	}
-
 	return 0;
-err:
-	printf("board_init: Error %d\n", ret);
-
-	/* No way to report error here */
-	hang();
-
-	return -1;
-#else
-	return 0;
-#endif
 }
 
 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 3/4 rockchip: rk3288: remove pinctrl init in spl_board_init

In reply to Kever Yang

The pinctrl will default init the io while driver is probe with new pinctrl driver.

---

 arch/arm/mach-rockchip/rk3288-board-spl.c |  1 -
 arch/arm/mach-rockchip/rk3288-board.c     | 27 -----------------------
 2 files changed, 28 deletions(-)
arch/arm/mach-rockchip/rk3288-board-spl.c +0 -1
index d8d215db8a..b7fab63acf 100644
@@ -23,7 +23,6 @@
 #include <asm/arch-rockchip/sdram_common.h>
 #include <asm/arch-rockchip/sys_proto.h>
 #include <asm/arch-rockchip/timer.h>
-#include <dm/pinctrl.h>
 #include <dm/root.h>
 #include <dm/test.h>
 #include <dm/util.h>
arch/arm/mach-rockchip/rk3288-board.c +0 -27
index e2de5b2fdd..a250d50387 100644
@@ -16,7 +16,6 @@
 #include <asm/arch-rockchip/qos_rk3288.h>
 #include <asm/arch-rockchip/boot_mode.h>
 #include <asm/gpio.h>
-#include <dm/pinctrl.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 #include <power/regulator.h>
 
@@ -145,33 +144,7 @@ static int veyron_init(void)
 int board_init(void)
 {
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-	struct udevice *pinctrl;
-	int ret;
-
-	/*
-	 * We need to implement sdcard iomux here for the further
-	 * initlization, otherwise, it'll hit sdcard command sending
-	 * timeout exception.
-	 */
-	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-	if (ret) {
-		debug("%s: Cannot find pinctrl device\n", __func__);
-		goto err;
-	}
-	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-	if (ret) {
-		debug("%s: Failed to set up SD card\n", __func__);
-		goto err;
-	}
-
 	return 0;
-err:
-	printf("board_init: Error %d\n", ret);
-
-	/* No way to report error here */
-	hang();
-
-	return -1;
 #else
 	int ret;
 
Signature · 1 line
2.17.1
author
#4 lore raw

PATCH 4/4 rockchip: remove redundant pinctrl header including

In reply to Kever Yang

No code is using this header file, remove it.

---

 arch/arm/mach-rockchip/rk3036-board.c     | 1 -
 arch/arm/mach-rockchip/rk3328-board-spl.c | 1 -
 2 files changed, 2 deletions(-)
arch/arm/mach-rockchip/rk3036-board.c +0 -1
index e6ea0e9a6a..c594c4d61c 100644
@@ -14,7 +14,6 @@
 #include <asm/arch-rockchip/grf_rk3036.h>
 #include <asm/arch-rockchip/boot_mode.h>
 #include <asm/arch-rockchip/sdram_rk3036.h>
-#include <dm/pinctrl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-rockchip/rk3328-board-spl.c +0 -1
index 7f49d056a0..f24fd89e3f 100644
@@ -7,7 +7,6 @@
 #include <common.h>
 #include <debug_uart.h>
 #include <dm.h>
-#include <dm/pinctrl.h>
 #include <ram.h>
 #include <spl.h>
 #include <asm/io.h>
Signature · 1 line
2.17.1
#5 lore raw

PATCH 4/4 rockchip: remove redundant pinctrl header including

Quoted 5 lines · Kever Yang

No code is using this header file, remove it.

You are not removing the header file, but are simply not including it.

Thanks,
Phil.