diff mbox series

[U-Boot,v2,4/9] ARM: rockchip: Remove the pinctrl request at rk3288-board-spl

Message ID 20190102125105.25734-5-david.wu@rock-chips.com
State Accepted
Commit 08c817c39908f9d120df1e4c90ddad4a11fc3891
Delegated to: Philipp Tomsich
Headers show
Series Add common pinctrl driver support for rockchip | expand

Commit Message

David Wu Jan. 2, 2019, 12:51 p.m. UTC
If we use the new pinctrl driver, the pinctrl setup will be done
by device probe. Remove the pinctrl setup at rk3288-board-spl.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

Changes in v2: None

 arch/arm/mach-rockchip/rk3288-board-spl.c | 79 -----------------------
 1 file changed, 79 deletions(-)

Comments

Kever Yang Jan. 22, 2019, 9:12 a.m. UTC | #1
On 01/02/2019 08:51 PM, David Wu wrote:
> If we use the new pinctrl driver, the pinctrl setup will be done
> by device probe. Remove the pinctrl setup at rk3288-board-spl.
>
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>
> Changes in v2: None
>
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 79 -----------------------
>  1 file changed, 79 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
> index abd62e520f..9463b255e1 100644
> --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
> @@ -77,45 +77,6 @@ fallback:
>  	return BOOT_DEVICE_MMC1;
>  }
>  
> -#ifdef CONFIG_SPL_MMC_SUPPORT
> -static int configure_emmc(struct udevice *pinctrl)
> -{
> -#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY)
> -
> -	struct gpio_desc desc;
> -	int ret;
> -
> -	pinctrl_request_noflags(pinctrl, PERIPH_ID_EMMC);
> -
> -	/*
> -	 * TODO(sjg@chromium.org): Pick this up from device tree or perhaps
> -	 * use the EMMC_PWREN setting.
> -	 */
> -	ret = dm_gpio_lookup_name("D9", &desc);
> -	if (ret) {
> -		debug("gpio ret=%d\n", ret);
> -		return ret;
> -	}
> -	ret = dm_gpio_request(&desc, "emmc_pwren");
> -	if (ret) {
> -		debug("gpio_request ret=%d\n", ret);
> -		return ret;
> -	}
> -	ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
> -	if (ret) {
> -		debug("gpio dir ret=%d\n", ret);
> -		return ret;
> -	}
> -	ret = dm_gpio_set_value(&desc, 1);
> -	if (ret) {
> -		debug("gpio value ret=%d\n", ret);
> -		return ret;
> -	}
> -#endif
> -	return 0;
> -}
> -#endif
> -
>  #if !defined(CONFIG_SPL_OF_PLATDATA)
>  static int phycore_init(void)
>  {
> @@ -144,7 +105,6 @@ static int phycore_init(void)
>  
>  void board_init_f(ulong dummy)
>  {
> -	struct udevice *pinctrl;
>  	struct udevice *dev;
>  	int ret;
>  
> @@ -183,12 +143,6 @@ void board_init_f(ulong dummy)
>  		return;
>  	}
>  
> -	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
> -	if (ret) {
> -		debug("Pinctrl init failed: %d\n", ret);
> -		return;
> -	}
> -
>  #if !defined(CONFIG_SPL_OF_PLATDATA)
>  	if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
>  		ret = phycore_init();
> @@ -239,52 +193,19 @@ static int setup_led(void)
>  
>  void spl_board_init(void)
>  {
> -	struct udevice *pinctrl;
>  	int ret;
>  
>  	ret = setup_led();
> -
>  	if (ret) {
>  		debug("LED ret=%d\n", ret);
>  		hang();
>  	}
>  
> -	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
> -	if (ret) {
> -		debug("%s: Cannot find pinctrl device\n", __func__);
> -		goto err;
> -	}
> -
> -#ifdef CONFIG_SPL_MMC_SUPPORT
> -	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
> -	if (ret) {
> -		debug("%s: Failed to set up SD card\n", __func__);
> -		goto err;
> -	}
> -	ret = configure_emmc(pinctrl);
> -	if (ret) {
> -		debug("%s: Failed to set up eMMC\n", __func__);
> -		goto err;
> -	}
> -#endif
> -
> -	/* Enable debug UART */
> -	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
> -	if (ret) {
> -		debug("%s: Failed to set up console UART\n", __func__);
> -		goto err;
> -	}
> -
>  	preloader_console_init();
>  #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
>  	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
>  #endif
>  	return;
> -err:
> -	printf("spl_board_init: Error %d\n", ret);
> -
> -	/* No way to report error here */
> -	hang();
>  }
>  
>  #ifdef CONFIG_SPL_OS_BOOT
Philipp Tomsich Jan. 31, 2019, 10:15 a.m. UTC | #2
> If we use the new pinctrl driver, the pinctrl setup will be done
> by device probe. Remove the pinctrl setup at rk3288-board-spl.
> 
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 79 -----------------------
>  1 file changed, 79 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich Jan. 31, 2019, 9:12 p.m. UTC | #3
> If we use the new pinctrl driver, the pinctrl setup will be done
> by device probe. Remove the pinctrl setup at rk3288-board-spl.
> 
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 79 -----------------------
>  1 file changed, 79 deletions(-)
> 

Applied to u-boot-rockchip, thanks!
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index abd62e520f..9463b255e1 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -77,45 +77,6 @@  fallback:
 	return BOOT_DEVICE_MMC1;
 }
 
-#ifdef CONFIG_SPL_MMC_SUPPORT
-static int configure_emmc(struct udevice *pinctrl)
-{
-#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY)
-
-	struct gpio_desc desc;
-	int ret;
-
-	pinctrl_request_noflags(pinctrl, PERIPH_ID_EMMC);
-
-	/*
-	 * TODO(sjg@chromium.org): Pick this up from device tree or perhaps
-	 * use the EMMC_PWREN setting.
-	 */
-	ret = dm_gpio_lookup_name("D9", &desc);
-	if (ret) {
-		debug("gpio ret=%d\n", ret);
-		return ret;
-	}
-	ret = dm_gpio_request(&desc, "emmc_pwren");
-	if (ret) {
-		debug("gpio_request ret=%d\n", ret);
-		return ret;
-	}
-	ret = dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT);
-	if (ret) {
-		debug("gpio dir ret=%d\n", ret);
-		return ret;
-	}
-	ret = dm_gpio_set_value(&desc, 1);
-	if (ret) {
-		debug("gpio value ret=%d\n", ret);
-		return ret;
-	}
-#endif
-	return 0;
-}
-#endif
-
 #if !defined(CONFIG_SPL_OF_PLATDATA)
 static int phycore_init(void)
 {
@@ -144,7 +105,6 @@  static int phycore_init(void)
 
 void board_init_f(ulong dummy)
 {
-	struct udevice *pinctrl;
 	struct udevice *dev;
 	int ret;
 
@@ -183,12 +143,6 @@  void board_init_f(ulong dummy)
 		return;
 	}
 
-	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-	if (ret) {
-		debug("Pinctrl init failed: %d\n", ret);
-		return;
-	}
-
 #if !defined(CONFIG_SPL_OF_PLATDATA)
 	if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
 		ret = phycore_init();
@@ -239,52 +193,19 @@  static int setup_led(void)
 
 void spl_board_init(void)
 {
-	struct udevice *pinctrl;
 	int ret;
 
 	ret = setup_led();
-
 	if (ret) {
 		debug("LED ret=%d\n", ret);
 		hang();
 	}
 
-	ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-	if (ret) {
-		debug("%s: Cannot find pinctrl device\n", __func__);
-		goto err;
-	}
-
-#ifdef CONFIG_SPL_MMC_SUPPORT
-	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_SDCARD);
-	if (ret) {
-		debug("%s: Failed to set up SD card\n", __func__);
-		goto err;
-	}
-	ret = configure_emmc(pinctrl);
-	if (ret) {
-		debug("%s: Failed to set up eMMC\n", __func__);
-		goto err;
-	}
-#endif
-
-	/* Enable debug UART */
-	ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-	if (ret) {
-		debug("%s: Failed to set up console UART\n", __func__);
-		goto err;
-	}
-
 	preloader_console_init();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
 	back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
 	return;
-err:
-	printf("spl_board_init: Error %d\n", ret);
-
-	/* No way to report error here */
-	hang();
 }
 
 #ifdef CONFIG_SPL_OS_BOOT