Patchwork [U-Boot] mx6: clock: Only show CSPI clock if CSPI is enabled

login
register
mail settings
Submitter Fabio Estevam
Date Nov. 16, 2012, 11:30 a.m.
Message ID <1353065410-10282-1-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/199546/
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Comments

Fabio Estevam - Nov. 16, 2012, 11:30 a.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

If a board does not enable CSPI, there is no need to show the CSPI clock 
frequency as part of the 'clock' command.

Reported-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/cpu/armv7/mx6/clock.c |    2 ++
 1 file changed, 2 insertions(+)
Dirk Behme - Nov. 16, 2012, 4:54 p.m.
Am 16.11.2012 12:30, schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> If a board does not enable CSPI, there is no need to show the CSPI clock
> frequency as part of the 'clock' command.
>
> Reported-by: Dirk Behme <dirk.behme@gmail.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Dirk Behme <dirk.behme@gmail.com>

Thanks

Dirk

> ---
>   arch/arm/cpu/armv7/mx6/clock.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
> index a01d96f..a50db70 100644
> --- a/arch/arm/cpu/armv7/mx6/clock.c
> +++ b/arch/arm/cpu/armv7/mx6/clock.c
> @@ -404,7 +404,9 @@ int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>   	printf("\n");
>   	printf("IPG        %8d kHz\n", mxc_get_clock(MXC_IPG_CLK) / 1000);
>   	printf("UART       %8d kHz\n", mxc_get_clock(MXC_UART_CLK) / 1000);
> +#ifdef CONFIG_MXC_SPI
>   	printf("CSPI       %8d kHz\n", mxc_get_clock(MXC_CSPI_CLK) / 1000);
> +#endif
>   	printf("AHB        %8d kHz\n", mxc_get_clock(MXC_AHB_CLK) / 1000);
>   	printf("AXI        %8d kHz\n", mxc_get_clock(MXC_AXI_CLK) / 1000);
>   	printf("DDR        %8d kHz\n", mxc_get_clock(MXC_DDR_CLK) / 1000);
>

Patch

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index a01d96f..a50db70 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -404,7 +404,9 @@  int do_mx6_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	printf("\n");
 	printf("IPG        %8d kHz\n", mxc_get_clock(MXC_IPG_CLK) / 1000);
 	printf("UART       %8d kHz\n", mxc_get_clock(MXC_UART_CLK) / 1000);
+#ifdef CONFIG_MXC_SPI
 	printf("CSPI       %8d kHz\n", mxc_get_clock(MXC_CSPI_CLK) / 1000);
+#endif
 	printf("AHB        %8d kHz\n", mxc_get_clock(MXC_AHB_CLK) / 1000);
 	printf("AXI        %8d kHz\n", mxc_get_clock(MXC_AXI_CLK) / 1000);
 	printf("DDR        %8d kHz\n", mxc_get_clock(MXC_DDR_CLK) / 1000);