[U-Boot] [PATCH] cmd: add clear screen 'cls' command

Patrick DELAUNAY patrick.delaunay at st.com
Mon Nov 19 18:09:12 UTC 2018


Hi Anatolij
> From: Anatolij Gustschin <agust at denx.de>
> Sent: samedi 17 novembre 2018 15:30
> 
> Add common clear screen command for configurations CONFIG_DM_VIDEO,
> CONFIG_LCD and CONFIG_CFB_CONSOLE.
> 
> Remove the existing cls command implementation from lcd.c code and activate
> the command for all boards enabling CONFIG_LCD for compatibility reasons.
> 
> Signed-off-by: Anatolij Gustschin <agust at denx.de>
> ---
>  cmd/Kconfig                                   |  7 ++++
>  cmd/Makefile                                  |  1 +
>  cmd/cls.c                                     | 35 +++++++++++++++++++
>  common/lcd.c                                  |  8 -----
>  configs/at91sam9261ek_dataflash_cs0_defconfig |  1 +
> configs/at91sam9261ek_dataflash_cs3_defconfig |  1 +
>  configs/at91sam9261ek_nandflash_defconfig     |  1 +
>  configs/at91sam9263ek_dataflash_cs0_defconfig |  1 +
>  configs/at91sam9263ek_dataflash_defconfig     |  1 +
>  configs/at91sam9263ek_nandflash_defconfig     |  1 +
>  configs/at91sam9263ek_norflash_boot_defconfig |  1 +
>  configs/at91sam9263ek_norflash_defconfig      |  1 +
>  configs/at91sam9g10ek_dataflash_cs0_defconfig |  1 +
> configs/at91sam9g10ek_dataflash_cs3_defconfig |  1 +
>  configs/at91sam9g10ek_nandflash_defconfig     |  1 +
>  configs/at91sam9m10g45ek_mmc_defconfig        |  1 +
>  configs/at91sam9m10g45ek_nandflash_defconfig  |  1 +
>  configs/at91sam9n12ek_mmc_defconfig           |  1 +
>  configs/at91sam9n12ek_nandflash_defconfig     |  1 +
>  configs/at91sam9n12ek_spiflash_defconfig      |  1 +
>  configs/at91sam9rlek_dataflash_defconfig      |  1 +
>  configs/at91sam9rlek_mmc_defconfig            |  1 +
>  configs/at91sam9rlek_nandflash_defconfig      |  1 +
>  configs/brxre1_defconfig                      |  1 +
>  configs/cm_t3517_defconfig                    |  1 +
>  configs/cm_t35_defconfig                      |  1 +
>  configs/peach-pi_defconfig                    |  1 +
>  configs/peach-pit_defconfig                   |  1 +
>  configs/picosam9g45_defconfig                 |  1 +
>  configs/pm9261_defconfig                      |  1 +
>  configs/pm9263_defconfig                      |  1 +
>  configs/snow_defconfig                        |  1 +
>  configs/spring_defconfig                      |  1 +
>  configs/zipitz2_defconfig                     |  1 +
>  34 files changed, 73 insertions(+), 8 deletions(-)  create mode 100644 cmd/cls.c
> 
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index d609f9d1c9..6023867007 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -1372,6 +1372,13 @@ config CMD_CONITRACE
>  	  Enable the 'conitrace' command which displays the codes received
>  	  from the console input as hexadecimal numbers.
> 
> +config CMD_CLS
> +	bool "Enable clear screen command 'cls'"
> +	depends on CFB_CONSOLE || DM_VIDEO || LCD || VIDEO

Just a minor remark, you can also add :

	default y  if !DM_VIDEO

To avoid the defconfig modifications in the patch.
(lcd.o if compiled ifndef CONFIG_DM_VIDEO) / command previously always define in this case)
But you prefer perhaps to have clear CONFIG_CMD configuration in each defconfig.

> +	help
> +	  Enable the 'cls' command which clears the screen contents
> +	  on video frame buffer.
> +
>  config CMD_DISPLAY
>  	bool "Enable the 'display' command, for character displays"
>  	help
> diff --git a/cmd/Makefile b/cmd/Makefile index 12a1330b06..2cb07df3c8
> 100644
> --- a/cmd/Makefile
> +++ b/cmd/Makefile

But Ok for the rest. 
Tested on my board (stm32mp157_ev1 with DM_VIDEO activated)

Regards, Patrick.

Tested-by: Patrick.Delaunay <patrick.delaunay at free.fr>




More information about the U-Boot mailing list