diff mbox series

ARM: uniphier: remove NAND reset code

Message ID 20200710133127.327120-1-yamada.masahiro@socionext.com
State Accepted
Commit 5785950369cd68d4409bf4d0e34d4b1894e5d0e9
Headers show
Series ARM: uniphier: remove NAND reset code | expand

Commit Message

Masahiro Yamada July 10, 2020, 1:31 p.m. UTC
Now that commit fceee65c878c ("mtd: nand: raw: denali: Assert reset
before deassert") added the reset assertion, this code in the board
file is unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 arch/arm/mach-uniphier/Makefile     |  1 -
 arch/arm/mach-uniphier/board_init.c |  4 ---
 arch/arm/mach-uniphier/init.h       |  7 -----
 arch/arm/mach-uniphier/nand-reset.c | 43 -----------------------------
 4 files changed, 55 deletions(-)
 delete mode 100644 arch/arm/mach-uniphier/nand-reset.c

Comments

Masahiro Yamada July 11, 2020, 2:12 p.m. UTC | #1
On Fri, Jul 10, 2020 at 10:32 PM Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
>
> Now that commit fceee65c878c ("mtd: nand: raw: denali: Assert reset
> before deassert") added the reset assertion, this code in the board
> file is unneeded.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---

Applied to u-boot-uniphier.


>  arch/arm/mach-uniphier/Makefile     |  1 -
>  arch/arm/mach-uniphier/board_init.c |  4 ---
>  arch/arm/mach-uniphier/init.h       |  7 -----
>  arch/arm/mach-uniphier/nand-reset.c | 43 -----------------------------
>  4 files changed, 55 deletions(-)
>  delete mode 100644 arch/arm/mach-uniphier/nand-reset.c
>
> diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
> index e7eba75eed..38b6d904f4 100644
> --- a/arch/arm/mach-uniphier/Makefile
> +++ b/arch/arm/mach-uniphier/Makefile
> @@ -22,7 +22,6 @@ endif
>  obj-$(CONFIG_MICRO_SUPPORT_CARD) += micro-support-card.o
>  obj-y += pinctrl-glue.o
>  obj-$(CONFIG_MMC) += mmc-first-dev.o
> -obj-$(CONFIG_NAND_DENALI) += nand-reset.o
>  obj-y += fdt-fixup.o
>
>  endif
> diff --git a/arch/arm/mach-uniphier/board_init.c b/arch/arm/mach-uniphier/board_init.c
> index 39df91982c..528074f547 100644
> --- a/arch/arm/mach-uniphier/board_init.c
> +++ b/arch/arm/mach-uniphier/board_init.c
> @@ -125,10 +125,6 @@ int board_init(void)
>         if (initdata->misc_init)
>                 initdata->misc_init();
>
> -       led_puts("U3");
> -
> -       uniphier_nand_reset_assert();
> -
>         led_puts("Uboo");
>
>         return 0;
> diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
> index a20cafdfad..dd978c0208 100644
> --- a/arch/arm/mach-uniphier/init.h
> +++ b/arch/arm/mach-uniphier/init.h
> @@ -75,13 +75,6 @@ int uniphier_have_internal_stm(void);
>  int uniphier_boot_from_backend(void);
>  int uniphier_pin_init(const char *pinconfig_name);
>
> -#ifdef CONFIG_NAND_DENALI
> -void uniphier_nand_reset_assert(void);
> -#else
> -static inline void uniphier_nand_reset_assert(void)
> -{
> -}
> -#endif
>  #ifdef CONFIG_ARM64
>  void uniphier_mem_map_init(unsigned long dram_base, unsigned long dram_size);
>  #else
> diff --git a/arch/arm/mach-uniphier/nand-reset.c b/arch/arm/mach-uniphier/nand-reset.c
> deleted file mode 100644
> index 11cadaabd8..0000000000
> --- a/arch/arm/mach-uniphier/nand-reset.c
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0 or later
> -/*
> - * Copyright (C) 2020 Socionext Inc.
> - *   Author: Masahiro Yamada <yamada.masahiro at socionext.com>
> - */
> -
> -#include <linux/errno.h>
> -#include <dm.h>
> -#include <dm/uclass-internal.h>
> -#include <reset.h>
> -
> -#include "init.h"
> -
> -/*
> - * Assert the Denali NAND controller reset if found.
> - *
> - * On LD4, the bootstrap process starts running after power-on reset regardless
> - * of the boot mode, here the pin-mux is not necessarily set up for NAND, then
> - * the controller is stuck. Assert the controller reset here, and should be
> - * deasserted in the driver after the pin-mux is correctly handled. For other
> - * SoCs, the bootstrap runs only when the boot mode selects ONFi, but it is yet
> - * effective when the boot swap is on. So, the reset should be asserted anyway.
> - */
> -void uniphier_nand_reset_assert(void)
> -{
> -       struct udevice *dev;
> -       struct reset_ctl_bulk resets;
> -       int ret;
> -
> -       ret = uclass_find_first_device(UCLASS_MTD, &dev);
> -       if (ret || !dev)
> -               return;
> -
> -       /* make sure this is the Denali NAND controller */
> -       if (strcmp(dev->driver->name, "denali-nand-dt"))
> -               return;
> -
> -       ret = reset_get_bulk(dev, &resets);
> -       if (ret)
> -               return;
> -
> -       reset_assert_bulk(&resets);
> -}
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index e7eba75eed..38b6d904f4 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -22,7 +22,6 @@  endif
 obj-$(CONFIG_MICRO_SUPPORT_CARD) += micro-support-card.o
 obj-y += pinctrl-glue.o
 obj-$(CONFIG_MMC) += mmc-first-dev.o
-obj-$(CONFIG_NAND_DENALI) += nand-reset.o
 obj-y += fdt-fixup.o
 
 endif
diff --git a/arch/arm/mach-uniphier/board_init.c b/arch/arm/mach-uniphier/board_init.c
index 39df91982c..528074f547 100644
--- a/arch/arm/mach-uniphier/board_init.c
+++ b/arch/arm/mach-uniphier/board_init.c
@@ -125,10 +125,6 @@  int board_init(void)
 	if (initdata->misc_init)
 		initdata->misc_init();
 
-	led_puts("U3");
-
-	uniphier_nand_reset_assert();
-
 	led_puts("Uboo");
 
 	return 0;
diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index a20cafdfad..dd978c0208 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -75,13 +75,6 @@  int uniphier_have_internal_stm(void);
 int uniphier_boot_from_backend(void);
 int uniphier_pin_init(const char *pinconfig_name);
 
-#ifdef CONFIG_NAND_DENALI
-void uniphier_nand_reset_assert(void);
-#else
-static inline void uniphier_nand_reset_assert(void)
-{
-}
-#endif
 #ifdef CONFIG_ARM64
 void uniphier_mem_map_init(unsigned long dram_base, unsigned long dram_size);
 #else
diff --git a/arch/arm/mach-uniphier/nand-reset.c b/arch/arm/mach-uniphier/nand-reset.c
deleted file mode 100644
index 11cadaabd8..0000000000
--- a/arch/arm/mach-uniphier/nand-reset.c
+++ /dev/null
@@ -1,43 +0,0 @@ 
-// SPDX-License-Identifier: GPL-2.0 or later
-/*
- * Copyright (C) 2020 Socionext Inc.
- *   Author: Masahiro Yamada <yamada.masahiro at socionext.com>
- */
-
-#include <linux/errno.h>
-#include <dm.h>
-#include <dm/uclass-internal.h>
-#include <reset.h>
-
-#include "init.h"
-
-/*
- * Assert the Denali NAND controller reset if found.
- *
- * On LD4, the bootstrap process starts running after power-on reset regardless
- * of the boot mode, here the pin-mux is not necessarily set up for NAND, then
- * the controller is stuck. Assert the controller reset here, and should be
- * deasserted in the driver after the pin-mux is correctly handled. For other
- * SoCs, the bootstrap runs only when the boot mode selects ONFi, but it is yet
- * effective when the boot swap is on. So, the reset should be asserted anyway.
- */
-void uniphier_nand_reset_assert(void)
-{
-	struct udevice *dev;
-	struct reset_ctl_bulk resets;
-	int ret;
-
-	ret = uclass_find_first_device(UCLASS_MTD, &dev);
-	if (ret || !dev)
-		return;
-
-	/* make sure this is the Denali NAND controller */
-	if (strcmp(dev->driver->name, "denali-nand-dt"))
-		return;
-
-	ret = reset_get_bulk(dev, &resets);
-	if (ret)
-		return;
-
-	reset_assert_bulk(&resets);
-}