diff mbox series

[U-Boot,3/3] pico-imx7d: polish uart clock id definition

Message ID 1563262978-6855-4-git-send-email-jun.nie@linaro.org
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series Support distro boot in pico-imx7d BL33 case | expand

Commit Message

Jun Nie July 16, 2019, 7:42 a.m. UTC
Polish uart clock id definition. Default IMX7 UART ID is UART1
as original parameter in imx_get_uartclk().

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 arch/arm/include/asm/arch-mx7/clock.h | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

Comments

Stefano Babic Oct. 13, 2019, 1:35 p.m. UTC | #1
Hi Jun,

I am just trying to check if some patch was silently lost, I found yours:

On 16/07/19 09:42, Jun Nie wrote:
> Polish uart clock id definition. Default IMX7 UART ID is UART1
> as original parameter in imx_get_uartclk().
> 
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  arch/arm/include/asm/arch-mx7/clock.h | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx7/clock.h b/arch/arm/include/asm/arch-mx7/clock.h
> index 1d07fde..a8e6097 100644
> --- a/arch/arm/include/asm/arch-mx7/clock.h
> +++ b/arch/arm/include/asm/arch-mx7/clock.h
> @@ -175,23 +175,7 @@ enum clk_root_index {
>  	CLK_ROOT_MAX,
>  };
>  
> -#if (CONFIG_CONS_INDEX == 0)
> -#define UART_CLK_ROOT UART1_CLK_ROOT
> -#elif (CONFIG_CONS_INDEX == 1)
> -#define UART_CLK_ROOT UART2_CLK_ROOT
> -#elif (CONFIG_CONS_INDEX == 2)
> -#define UART_CLK_ROOT UART3_CLK_ROOT
> -#elif (CONFIG_CONS_INDEX == 3)
> -#define UART_CLK_ROOT UART4_CLK_ROOT
> -#elif (CONFIG_CONS_INDEX == 4)
> -#define UART_CLK_ROOT UART5_CLK_ROOT
> -#elif (CONFIG_CONS_INDEX == 5)
> -#define UART_CLK_ROOT UART6_CLK_ROOT
> -#elif (CONFIG_CONS_INDEX == 6)
> -#define UART_CLK_ROOT UART7_CLK_ROOT
> -#else
> -#error "Invalid IMX UART ID for serial console is defined"
> -#endif
> +#define UART_CLK_ROOT (UART1_CLK_ROOT + CONFIG_CONS_INDEX)
>  
>  struct clk_root_setting {
>  	enum clk_root_index root;
> 

It looks ok but CONFIG_CONS_INDEX *must* be set, else it breaks boards.
Patch breaks at least the colibri boards.

Best regards,
Stefano
Jun Nie Oct. 16, 2019, 2:57 p.m. UTC | #2
Stefano Babic <sbabic@denx.de> 于2019年10月13日周日 下午9:35写道:
>
> Hi Jun,
>
> I am just trying to check if some patch was silently lost, I found yours:
>
> On 16/07/19 09:42, Jun Nie wrote:
> > Polish uart clock id definition. Default IMX7 UART ID is UART1
> > as original parameter in imx_get_uartclk().
> >
> > Signed-off-by: Jun Nie <jun.nie@linaro.org>
> > ---
> >  arch/arm/include/asm/arch-mx7/clock.h | 18 +-----------------
> >  1 file changed, 1 insertion(+), 17 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/arch-mx7/clock.h b/arch/arm/include/asm/arch-mx7/clock.h
> > index 1d07fde..a8e6097 100644
> > --- a/arch/arm/include/asm/arch-mx7/clock.h
> > +++ b/arch/arm/include/asm/arch-mx7/clock.h
> > @@ -175,23 +175,7 @@ enum clk_root_index {
> >       CLK_ROOT_MAX,
> >  };
> >
> > -#if (CONFIG_CONS_INDEX == 0)
> > -#define UART_CLK_ROOT UART1_CLK_ROOT
> > -#elif (CONFIG_CONS_INDEX == 1)
> > -#define UART_CLK_ROOT UART2_CLK_ROOT
> > -#elif (CONFIG_CONS_INDEX == 2)
> > -#define UART_CLK_ROOT UART3_CLK_ROOT
> > -#elif (CONFIG_CONS_INDEX == 3)
> > -#define UART_CLK_ROOT UART4_CLK_ROOT
> > -#elif (CONFIG_CONS_INDEX == 4)
> > -#define UART_CLK_ROOT UART5_CLK_ROOT
> > -#elif (CONFIG_CONS_INDEX == 5)
> > -#define UART_CLK_ROOT UART6_CLK_ROOT
> > -#elif (CONFIG_CONS_INDEX == 6)
> > -#define UART_CLK_ROOT UART7_CLK_ROOT
> > -#else
> > -#error "Invalid IMX UART ID for serial console is defined"
> > -#endif
> > +#define UART_CLK_ROOT (UART1_CLK_ROOT + CONFIG_CONS_INDEX)
> >
> >  struct clk_root_setting {
> >       enum clk_root_index root;
> >
>
> It looks ok but CONFIG_CONS_INDEX *must* be set, else it breaks boards.
> Patch breaks at least the colibri boards.
>
> Best regards,
> Stefano

Thanks for finding the bug! I will test more boards in next round.
This patch is an independent optimization patch to other patches. So I
will sumit next version later.

Regards,
Jun
Stefano Babic Oct. 17, 2019, 1:46 p.m. UTC | #3
On 16/10/19 16:57, Jun Nie wrote:
> Stefano Babic <sbabic@denx.de> 于2019年10月13日周日 下午9:35写道:
>>
>> Hi Jun,
>>
>> I am just trying to check if some patch was silently lost, I found yours:
>>
>> On 16/07/19 09:42, Jun Nie wrote:
>>> Polish uart clock id definition. Default IMX7 UART ID is UART1
>>> as original parameter in imx_get_uartclk().
>>>
>>> Signed-off-by: Jun Nie <jun.nie@linaro.org>
>>> ---
>>>  arch/arm/include/asm/arch-mx7/clock.h | 18 +-----------------
>>>  1 file changed, 1 insertion(+), 17 deletions(-)
>>>
>>> diff --git a/arch/arm/include/asm/arch-mx7/clock.h b/arch/arm/include/asm/arch-mx7/clock.h
>>> index 1d07fde..a8e6097 100644
>>> --- a/arch/arm/include/asm/arch-mx7/clock.h
>>> +++ b/arch/arm/include/asm/arch-mx7/clock.h
>>> @@ -175,23 +175,7 @@ enum clk_root_index {
>>>       CLK_ROOT_MAX,
>>>  };
>>>
>>> -#if (CONFIG_CONS_INDEX == 0)
>>> -#define UART_CLK_ROOT UART1_CLK_ROOT
>>> -#elif (CONFIG_CONS_INDEX == 1)
>>> -#define UART_CLK_ROOT UART2_CLK_ROOT
>>> -#elif (CONFIG_CONS_INDEX == 2)
>>> -#define UART_CLK_ROOT UART3_CLK_ROOT
>>> -#elif (CONFIG_CONS_INDEX == 3)
>>> -#define UART_CLK_ROOT UART4_CLK_ROOT
>>> -#elif (CONFIG_CONS_INDEX == 4)
>>> -#define UART_CLK_ROOT UART5_CLK_ROOT
>>> -#elif (CONFIG_CONS_INDEX == 5)
>>> -#define UART_CLK_ROOT UART6_CLK_ROOT
>>> -#elif (CONFIG_CONS_INDEX == 6)
>>> -#define UART_CLK_ROOT UART7_CLK_ROOT
>>> -#else
>>> -#error "Invalid IMX UART ID for serial console is defined"
>>> -#endif
>>> +#define UART_CLK_ROOT (UART1_CLK_ROOT + CONFIG_CONS_INDEX)
>>>
>>>  struct clk_root_setting {
>>>       enum clk_root_index root;
>>>
>>
>> It looks ok but CONFIG_CONS_INDEX *must* be set, else it breaks boards.
>> Patch breaks at least the colibri boards.
>>
>> Best regards,
>> Stefano
> 
> Thanks for finding the bug! I will test more boards in next round.
> This patch is an independent optimization patch to other patches. So I
> will sumit next version later.

Ok, thanks !

Regards,
Stefano

> 
> Regards,
> Jun
>
diff mbox series

Patch

diff --git a/arch/arm/include/asm/arch-mx7/clock.h b/arch/arm/include/asm/arch-mx7/clock.h
index 1d07fde..a8e6097 100644
--- a/arch/arm/include/asm/arch-mx7/clock.h
+++ b/arch/arm/include/asm/arch-mx7/clock.h
@@ -175,23 +175,7 @@  enum clk_root_index {
 	CLK_ROOT_MAX,
 };
 
-#if (CONFIG_CONS_INDEX == 0)
-#define UART_CLK_ROOT UART1_CLK_ROOT
-#elif (CONFIG_CONS_INDEX == 1)
-#define UART_CLK_ROOT UART2_CLK_ROOT
-#elif (CONFIG_CONS_INDEX == 2)
-#define UART_CLK_ROOT UART3_CLK_ROOT
-#elif (CONFIG_CONS_INDEX == 3)
-#define UART_CLK_ROOT UART4_CLK_ROOT
-#elif (CONFIG_CONS_INDEX == 4)
-#define UART_CLK_ROOT UART5_CLK_ROOT
-#elif (CONFIG_CONS_INDEX == 5)
-#define UART_CLK_ROOT UART6_CLK_ROOT
-#elif (CONFIG_CONS_INDEX == 6)
-#define UART_CLK_ROOT UART7_CLK_ROOT
-#else
-#error "Invalid IMX UART ID for serial console is defined"
-#endif
+#define UART_CLK_ROOT (UART1_CLK_ROOT + CONFIG_CONS_INDEX)
 
 struct clk_root_setting {
 	enum clk_root_index root;