All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/9] pico-imx7d: Correct uart clock root
Date: Wed, 24 Apr 2019 05:15:35 +0000	[thread overview]
Message-ID: <AM0PR04MB4481E06A80264E124E62BD8A883C0@AM0PR04MB4481.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1556078372-26851-5-git-send-email-jun.nie@linaro.org>


> Subject: [PATCH v3 4/9] pico-imx7d: Correct uart clock root
> 
> Correct uart clock root ID. Incorrect ID may result the clock is gated because
> rate value 0 is returned in
> imx_get_uartclk()

Yes. hardcoding to UART1_ROOT_CLK in imx_get_uartclk is not good.
But actually init_clk_uart configures all the uart with same root clk,
so it should work as expected.

Regards,
Peng.

> 
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  arch/arm/include/asm/arch-mx7/clock.h | 18 ++++++++++++++++++
>  arch/arm/mach-imx/Kconfig             |  7 +++++++
>  arch/arm/mach-imx/mx7/clock.c         |  2 +-
>  3 files changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx7/clock.h
> b/arch/arm/include/asm/arch-mx7/clock.h
> index f56564e..dc91111 100644
> --- a/arch/arm/include/asm/arch-mx7/clock.h
> +++ b/arch/arm/include/asm/arch-mx7/clock.h
> @@ -175,6 +175,24 @@ enum clk_root_index {
>  	CLK_ROOT_MAX,
>  };
> 
> +#if (CONFIG_IMX_CONSOLE_UART_ID == 1)
> +#define UART_CLK_ROOT UART1_CLK_ROOT
> +#elif (CONFIG_IMX_CONSOLE_UART_ID == 2) #define UART_CLK_ROOT
> +UART2_CLK_ROOT #elif (CONFIG_IMX_CONSOLE_UART_ID == 3) #define
> +UART_CLK_ROOT UART3_CLK_ROOT #elif
> (CONFIG_IMX_CONSOLE_UART_ID == 4)
> +#define UART_CLK_ROOT UART4_CLK_ROOT #elif
> (CONFIG_IMX_CONSOLE_UART_ID
> +== 5) #define UART_CLK_ROOT UART5_CLK_ROOT #elif
> +(CONFIG_IMX_CONSOLE_UART_ID == 6) #define UART_CLK_ROOT
> UART6_CLK_ROOT
> +#elif (CONFIG_IMX_CONSOLE_UART_ID == 7) #define UART_CLK_ROOT
> +UART7_CLK_ROOT #else #error "Invalid IMX UART ID for serial console is
> +defined"
> +#endif
> +
>  struct clk_root_setting {
>  	enum clk_root_index root;
>  	u32 setting;
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index
> ec09ef2..7c5db30 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -27,6 +27,13 @@ config IMX_BOOTAUX
>  	help
>  	  bootaux [addr] to boot auxiliary core.
> 
> +config IMX_CONSOLE_UART_ID
> +	int "UART ID for console"
> +	default 1
> +	depends on ARCH_MX7
> +	help
> +	  Specify the UART ID that's for serial console.
> +
>  config USE_IMXIMG_PLUGIN
>  	bool "Use imximage plugin code"
>  	depends on ARCH_MX7 || ARCH_MX6
> diff --git a/arch/arm/mach-imx/mx7/clock.c
> b/arch/arm/mach-imx/mx7/clock.c index 8cda71c..e364b16 100644
> --- a/arch/arm/mach-imx/mx7/clock.c
> +++ b/arch/arm/mach-imx/mx7/clock.c
> @@ -53,7 +53,7 @@ static u32 get_ipg_clk(void)
> 
>  u32 imx_get_uartclk(void)
>  {
> -	return get_root_clk(UART1_CLK_ROOT);
> +	return get_root_clk(UART_CLK_ROOT);
>  }
> 
>  u32 imx_get_fecclk(void)
> --
> 2.7.4

  reply	other threads:[~2019-04-24  5:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24  3:59 [U-Boot] [PATCH v3 0/9] pico-imx7d: Add support for BL33 case Jun Nie
2019-04-24  3:59 ` [U-Boot] [PATCH v3 1/9] Revert "pico-imx7d: Add LCD support" Jun Nie
2019-04-24 10:30   ` Fabio Estevam
2019-04-25  2:53     ` Jun Nie
2019-04-25  3:27       ` Fabio Estevam
2019-04-25  7:24         ` Jun Nie
2019-04-24 10:41   ` Stefano Babic
2019-04-24  3:59 ` [U-Boot] [PATCH v3 2/9] mx7_common: Share configs to skip low level init Jun Nie
2019-04-24  3:59 ` [U-Boot] [PATCH v3 3/9] imx: mx7: Add empty arch_cpu_init if skipped Jun Nie
2019-04-24  5:11   ` Peng Fan
2019-04-25 15:28     ` Jun Nie
2019-04-24  3:59 ` [U-Boot] [PATCH v3 4/9] pico-imx7d: Correct uart clock root Jun Nie
2019-04-24  5:15   ` Peng Fan [this message]
2019-04-24  6:25     ` Jun Nie
2019-04-24 10:32   ` Fabio Estevam
2019-04-25 15:29     ` Jun Nie
2019-04-24  3:59 ` [U-Boot] [PATCH v3 5/9] pico-imx7d: Reserve region of memory to OPTEE Jun Nie
2019-04-24  5:17   ` Peng Fan
2019-04-24  3:59 ` [U-Boot] [PATCH v3 6/9] pico-imx7d: Add boot option for verified boot Jun Nie
2019-04-24  3:59 ` [U-Boot] [PATCH v3 7/9] pico-imx7d: Add device tree for pico-imx7d Jun Nie
2019-04-24  5:19   ` Peng Fan
2019-04-24 10:31   ` Fabio Estevam
2019-04-25  2:56     ` Jun Nie
2019-04-25  7:18       ` Stefano Babic
2019-04-25  7:31         ` Jun Nie
2019-04-25  8:53           ` Stefano Babic
2019-04-24  3:59 ` [U-Boot] [PATCH v3 8/9] pico-imx7d: Add bl33 config Jun Nie
2019-04-24  3:59 ` [U-Boot] [PATCH v3 9/9] pico-imx7d: README: Add BL33 usage case Jun Nie

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=AM0PR04MB4481E06A80264E124E62BD8A883C0@AM0PR04MB4481.eurprd04.prod.outlook.com \
    --to=peng.fan@nxp.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.