All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Yan <andyshrk@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 08/10] rockchip: rk3368: move board_debug_uart_init() to rk3368.c
Date: Mon, 29 Apr 2019 17:22:28 +0800	[thread overview]
Message-ID: <CANbgqASQX0NKnOLc0+7oVSVtJBENb3VmY+dJvtrot1h2e=AT7Q@mail.gmail.com> (raw)
In-Reply-To: <20190329010907.11006-9-kever.yang@rock-chips.com>

Kever Yang <kever.yang@rock-chips.com> 于2019年3月29日周五 上午9:12写道:

> Move the function to soc file so
> that we can find all the soc/board setting in soc file and
> use a common board file later for all rockchip SoCs.
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  arch/arm/mach-rockchip/rk3368-board-spl.c |  8 ------
>  arch/arm/mach-rockchip/rk3368-board-tpl.c | 33 +----------------------
>  arch/arm/mach-rockchip/rk3368/rk3368.c    | 31 +++++++++++++++++++++
>  3 files changed, 32 insertions(+), 40 deletions(-)
>
>
Tested-by: Andy Yan <andy.yan@rock-chips.com>


> diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c
> b/arch/arm/mach-rockchip/rk3368-board-spl.c
> index 9dea4ed994..b055ed4aee 100644
> --- a/arch/arm/mach-rockchip/rk3368-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3368-board-spl.c
> @@ -9,17 +9,9 @@
>  #include <ram.h>
>  #include <spl.h>
>  #include <asm/io.h>
> -#include <asm/arch-rockchip/cru_rk3368.h>
> -#include <asm/arch-rockchip/grf_rk3368.h>
> -#include <asm/arch-rockchip/hardware.h>
>  #include <asm/arch-rockchip/periph.h>
> -#include <asm/arch-rockchip/timer.h>
>  #include <dm/pinctrl.h>
>
> -void board_debug_uart_init(void)
> -{
> -}
> -
>  void board_init_f(ulong dummy)
>  {
>         struct udevice *pinctrl;
> diff --git a/arch/arm/mach-rockchip/rk3368-board-tpl.c
> b/arch/arm/mach-rockchip/rk3368-board-tpl.c
> index 373f009414..dc65a021c8 100644
> --- a/arch/arm/mach-rockchip/rk3368-board-tpl.c
> +++ b/arch/arm/mach-rockchip/rk3368-board-tpl.c
> @@ -13,7 +13,6 @@
>  #include <asm/arch-rockchip/bootrom.h>
>  #include <asm/arch-rockchip/clock.h>
>  #include <asm/arch-rockchip/cru_rk3368.h>
> -#include <asm/arch-rockchip/grf_rk3368.h>
>  #include <asm/arch-rockchip/hardware.h>
>  #include <asm/arch-rockchip/timer.h>
>
> @@ -79,42 +78,12 @@ static void sgrf_init(void)
>         rk_clrreg(&cru->softrst_con[4], DMA2_SRST_REQ);
>  }
>
> -void board_debug_uart_init(void)
> -{
> -       /*
> -        * N.B.: This is called before the device-model has been
> -        *       initialised. For this reason, we can not access
> -        *       the GRF address range using the syscon API.
> -        */
> -       struct rk3368_grf * const grf =
> -               (struct rk3368_grf * const)0xff770000;
> -
> -       enum {
> -               GPIO2D1_MASK            = GENMASK(3, 2),
> -               GPIO2D1_GPIO            = 0,
> -               GPIO2D1_UART0_SOUT      = (1 << 2),
> -
> -               GPIO2D0_MASK            = GENMASK(1, 0),
> -               GPIO2D0_GPIO            = 0,
> -               GPIO2D0_UART0_SIN       = (1 << 0),
> -       };
> -
> -#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE ==
> 0xff180000)
> -       /* Enable early UART0 on the RK3368 */
> -       rk_clrsetreg(&grf->gpio2d_iomux,
> -                    GPIO2D0_MASK, GPIO2D0_UART0_SIN);
> -       rk_clrsetreg(&grf->gpio2d_iomux,
> -                    GPIO2D1_MASK, GPIO2D1_UART0_SOUT);
> -#endif
> -}
> -
>  void board_init_f(ulong dummy)
>  {
>         struct udevice *dev;
>         int ret;
>
> -#define EARLY_UART
> -#ifdef EARLY_UART
> +#ifdef CONFIG_DEBUG_UART
>         /*
>          * Debug UART can be used from here if required:
>          *
> diff --git a/arch/arm/mach-rockchip/rk3368/rk3368.c
> b/arch/arm/mach-rockchip/rk3368/rk3368.c
> index 197f0c485a..1ed06c5352 100644
> --- a/arch/arm/mach-rockchip/rk3368/rk3368.c
> +++ b/arch/arm/mach-rockchip/rk3368/rk3368.c
> @@ -96,3 +96,34 @@ int arch_early_init_r(void)
>         return mcu_init();
>  }
>  #endif
> +
> +#ifdef CONFIG_DEBUG_UART_BOARD_INIT
> +void board_debug_uart_init(void)
> +{
> +       /*
> +        * N.B.: This is called before the device-model has been
> +        *       initialised. For this reason, we can not access
> +        *       the GRF address range using the syscon API.
> +        */
> +#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE ==
> 0xff180000)
> +       struct rk3368_grf * const grf =
> +               (struct rk3368_grf * const)0xff770000;
> +
> +       enum {
> +               GPIO2D1_MASK            = GENMASK(3, 2),
> +               GPIO2D1_GPIO            = 0,
> +               GPIO2D1_UART0_SOUT      = (1 << 2),
> +
> +               GPIO2D0_MASK            = GENMASK(1, 0),
> +               GPIO2D0_GPIO            = 0,
> +               GPIO2D0_UART0_SIN       = (1 << 0),
> +       };
> +
> +       /* Enable early UART0 on the RK3368 */
> +       rk_clrsetreg(&grf->gpio2d_iomux,
> +                    GPIO2D0_MASK, GPIO2D0_UART0_SIN);
> +       rk_clrsetreg(&grf->gpio2d_iomux,
> +                    GPIO2D1_MASK, GPIO2D1_UART0_SOUT);
> +#endif
> +}
> +#endif
> --
> 2.20.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>

  parent reply	other threads:[~2019-04-29  9:22 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  1:08 [U-Boot] [PATCH v2 00/10] rockchip: enable board_debug_uart_init for all soc Kever Yang
2019-03-29  1:08 ` [U-Boot] [PATCH v2 01/10] rockchip: enable DEBUG_UART_BOARD_INIT by default Kever Yang
2019-04-28 20:27   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:08 ` [U-Boot] [PATCH v2 02/10] rockchip; kylin-rk3036: enabl DEBUG UART Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 03/10] rockchip: rk3036: add board_debug_uart_init() Kever Yang
2019-03-29 10:10   ` Jack Mitchell
2019-03-29 11:03     ` Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 04/10] rockchip: rk3188: " Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 05/10] rockchip: rk322x: move board_debug_uart_init() to rk322x.c Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 06/10] rockchip: rk3288: use grf structure to access soc_con2 Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 07/10] rockchip: rk3288: add board_debug_uart_init() Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 08/10] rockchip: rk3368: move board_debug_uart_init() to rk3368.c Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-04-29  9:22   ` Andy Yan [this message]
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 09/10] rockchip: rk3399: use grf structure to access reg Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-04-29  9:23   ` Andy Yan
2019-05-01 13:06   ` Philipp Tomsich
2019-03-29  1:09 ` [U-Boot] [PATCH v2 10/10] rockchip: rk3399: add board_debug_uart_init() Kever Yang
2019-03-29 10:12   ` Jack Mitchell
2019-03-29 11:01     ` Kever Yang
2019-04-28 20:28   ` Philipp Tomsich
2019-05-01 13:06   ` Philipp Tomsich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANbgqASQX0NKnOLc0+7oVSVtJBENb3VmY+dJvtrot1h2e=AT7Q@mail.gmail.com' \
    --to=andyshrk@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.