]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
2 years agoarm: bcmbca: add bcm6878 SoC support
William Zhang [Mon, 1 Aug 2022 18:39:23 +0000 (11:39 -0700)]
arm: bcmbca: add bcm6878 SoC support

BCM6878 is an ARM A7 based PON Broadband SoC. It is part of the BCA
(Broadband Carrier Access origin) chipset family so it's added under
ARCH_BCMBCA platform. This initial support includes a bare-bone
implementation and dts with CPU subsystem, memory and ARM PL011
uart.

This SoC is supported in the linux-next git repository so the dts and
dtsi files are copied from linux with minor fix-up that needs to be
upstreamed to linux as well.

The u-boot image can be loaded from flash or network to the entry point
address in the memory and boot from there.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
2 years agoarm: bcmbca: add bcm6846 SoC support
William Zhang [Mon, 1 Aug 2022 18:39:22 +0000 (11:39 -0700)]
arm: bcmbca: add bcm6846 SoC support

BCM6846 is an ARM A7 based PON Broadband SoC. It is part of the BCA
(Broadband Carrier Access origin) chipset family so it's added under
ARCH_BCMBCA platform. This initial support includes a bare-bone
implementation and dts with CPU subsystem, memory and Broadcom uart.

This SoC is supported in the linux-next git repository so the dts and
dtsi files are copied from linux with minor fix-up that needs to be
upstreamed to linux as well.

The u-boot image can be loaded from flash or network to the entry point
address in the memory and boot from there.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
2 years agoarm: bcmbca: add bcm63178 SoC support
William Zhang [Mon, 1 Aug 2022 18:39:21 +0000 (11:39 -0700)]
arm: bcmbca: add bcm63178 SoC support

BCM63178 is an ARM A7 based DSL Broadband SoC. It is part of the BCA
(Broadband Carrier Access origin) chipset family so it's added under
ARCH_BCMBCA platform. This initial support includes a bare-bone
implementation and dts with CPU subsystem, memory and ARM PL011 uart.

This SoC is supported in the linux-next git repository so the dts and
dtsi files are copied from linux with minor fix-up that needs to be
upstreamed to linux as well.

The u-boot image can be loaded from flash or network to the entry
point address in the memory and boot from there.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
2 years agobuildman: Handle the MAINTAINERS 'N' tag
Simon Glass [Tue, 11 Oct 2022 14:15:37 +0000 (08:15 -0600)]
buildman: Handle the MAINTAINERS 'N' tag

This is needed for some soon-to-be-applied patches. Scan the configs/
directory to see if any of the files match.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com>
Suggested-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'video-20221030' of https://source.denx.de/u-boot/custodians/u-boot-video
Tom Rini [Sun, 30 Oct 2022 21:16:35 +0000 (17:16 -0400)]
Merge tag 'video-20221030' of https://source.denx.de/u-boot/custodians/u-boot-video

 - fix [hv]sync active vs back porch in dw_mipi_dsi
 - simplefb rotation support
 - support splash as raw image from MMC
 - enhancements to Truetype console (multiple fonts and sizes)
 - drop old LCD support

2 years agovideo: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO
Simon Glass [Tue, 18 Oct 2022 13:46:31 +0000 (07:46 -0600)]
video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO

Now that all the old code is gone, rename this option. Driver model
migration is now complete.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopci: Drop test for DM_VIDEO
Simon Glass [Tue, 18 Oct 2022 13:58:16 +0000 (07:58 -0600)]
pci: Drop test for DM_VIDEO

This is not needed anymore, since there is no other option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Make all video options depend on DM_VIDEO
Simon Glass [Tue, 18 Oct 2022 13:35:17 +0000 (07:35 -0600)]
video: Make all video options depend on DM_VIDEO

Rather than sprinkly this file with 'depends' statements, make all options
depend on DM_VIDEO.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop SPLASHIMAGE_CALLBACK
Simon Glass [Tue, 18 Oct 2022 13:30:25 +0000 (07:30 -0600)]
video: Drop SPLASHIMAGE_CALLBACK

This is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop common LCD implementation
Simon Glass [Sun, 16 Oct 2022 21:25:26 +0000 (15:25 -0600)]
video: Drop common LCD implementation

This code is no-longer used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop use of the lcd header file
Simon Glass [Tue, 18 Oct 2022 13:10:26 +0000 (07:10 -0600)]
video: Drop use of the lcd header file

This file is being removed so drop remaining references to it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_LCD
Simon Glass [Tue, 18 Oct 2022 13:19:42 +0000 (07:19 -0600)]
video: Drop CONFIG_LCD

This option is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_VIDEO
Simon Glass [Tue, 18 Oct 2022 13:24:15 +0000 (07:24 -0600)]
video: Drop CONFIG_VIDEO

This option is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_VIDEO
Simon Glass [Tue, 18 Oct 2022 13:20:56 +0000 (07:20 -0600)]
video: Drop CONFIG_VIDEO

This option is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop LCD_BPP
Simon Glass [Tue, 18 Oct 2022 12:55:49 +0000 (06:55 -0600)]
video: Drop LCD_BPP

This is used by the old LCD implementation which is to be removed.
Drop it and LCD_OUTPUT_BPP also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agofdt: Drop support for LCD fixup in simplefb
Simon Glass [Tue, 18 Oct 2022 12:54:26 +0000 (06:54 -0600)]
fdt: Drop support for LCD fixup in simplefb

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop remaining references to CONFIG_LCD
Simon Glass [Sun, 16 Oct 2022 21:59:22 +0000 (15:59 -0600)]
video: Drop remaining references to CONFIG_LCD

These rely on the old LCD implementation which is to be removed. Drop it
all.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoefi: Drop old LCD code
Simon Glass [Sun, 16 Oct 2022 21:58:34 +0000 (15:58 -0600)]
efi: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop the
existing #ifdef and convert it to C code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: cmd: Drop old LCD code
Simon Glass [Sun, 16 Oct 2022 21:57:41 +0000 (15:57 -0600)]
video: cmd: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoBuR: ronetix: siemens: Drop old LCD code
Simon Glass [Sun, 16 Oct 2022 21:56:56 +0000 (15:56 -0600)]
BuR: ronetix: siemens: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotegra: Drop old LCD code
Simon Glass [Tue, 18 Oct 2022 12:10:04 +0000 (06:10 -0600)]
tegra: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agocompulab: Drop old LCD code
Simon Glass [Sun, 16 Oct 2022 21:56:14 +0000 (15:56 -0600)]
compulab: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agonexell: Drop old LCD code
Simon Glass [Sun, 16 Oct 2022 21:55:16 +0000 (15:55 -0600)]
nexell: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: samsung: Drop old LCD code
Simon Glass [Sun, 16 Oct 2022 21:54:35 +0000 (15:54 -0600)]
video: samsung: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop atmel LCD code
Simon Glass [Sun, 16 Oct 2022 21:53:35 +0000 (15:53 -0600)]
video: Drop atmel LCD code

This has not been migrated to DM_VIDEO since 2019. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotreewide: Stop enabling CONFIG_LCD
Simon Glass [Sun, 16 Oct 2022 21:52:26 +0000 (15:52 -0600)]
treewide: Stop enabling CONFIG_LCD

This option is not used anymore since the LCD implementation is being
removed. Stop enabling it on various boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: atmel: Drop CONFIG_LCD_IN_PSRAM
Simon Glass [Sun, 16 Oct 2022 21:49:00 +0000 (15:49 -0600)]
video: atmel: Drop CONFIG_LCD_IN_PSRAM

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop ld9040 driver
Simon Glass [Sun, 16 Oct 2022 21:46:15 +0000 (15:46 -0600)]
video: Drop ld9040 driver

This is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: atmel: Drop pre-DM parts of video driver
Simon Glass [Sun, 16 Oct 2022 21:38:01 +0000 (15:38 -0600)]
video: atmel: Drop pre-DM parts of video driver

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_AM335X_LCD
Simon Glass [Sun, 16 Oct 2022 21:31:47 +0000 (15:31 -0600)]
video: Drop CONFIG_AM335X_LCD

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoBuR: Drop old LCD code
Simon Glass [Tue, 18 Oct 2022 12:13:24 +0000 (06:13 -0600)]
BuR: Drop old LCD code

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop VCXK video controller
Simon Glass [Sun, 16 Oct 2022 21:26:52 +0000 (15:26 -0600)]
video: Drop VCXK video controller

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoDrop CONFIG_LCD_LOGO
Simon Glass [Sun, 16 Oct 2022 21:19:04 +0000 (15:19 -0600)]
Drop CONFIG_LCD_LOGO

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoapi: Drop LCD implementation
Simon Glass [Sun, 16 Oct 2022 21:16:43 +0000 (15:16 -0600)]
api: Drop LCD implementation

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Move bmp_display() prototype to video.h
Simon Glass [Tue, 18 Oct 2022 13:41:14 +0000 (07:41 -0600)]
video: Move bmp_display() prototype to video.h

The lcd.h header is about to be deleted, so move this prototype.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_LCD_INFO
Simon Glass [Sun, 16 Oct 2022 21:11:32 +0000 (15:11 -0600)]
video: Drop CONFIG_LCD_INFO

This option is not used anymore since the LCD implementation is being
removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_LCD_INFO_BELOW_LOGO
Simon Glass [Sun, 16 Oct 2022 21:08:59 +0000 (15:08 -0600)]
video: Drop CONFIG_LCD_INFO_BELOW_LOGO

This option is not used anymore since the LCD implementation is being
removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_LCD_MENU
Simon Glass [Sun, 16 Oct 2022 21:06:52 +0000 (15:06 -0600)]
video: Drop CONFIG_LCD_MENU

This relies on the old LCD implementation which is to be removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Drop CONFIG_LCD_ALIGNMENT
Simon Glass [Sun, 16 Oct 2022 21:02:58 +0000 (15:02 -0600)]
video: Drop CONFIG_LCD_ALIGNMENT

This option is not needed now that the LCD implementation is being
removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: lcd: Drop console rotation
Simon Glass [Sun, 16 Oct 2022 21:00:37 +0000 (15:00 -0600)]
video: lcd: Drop console rotation

This option is not used in U-Boot anymore. Drop it option and the
associated implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoConvert CONFIG_VIDEO_LOGO_MAX_SIZE to Kconfig
Simon Glass [Tue, 18 Oct 2022 12:49:18 +0000 (06:49 -0600)]
Convert CONFIG_VIDEO_LOGO_MAX_SIZE to Kconfig

This converts the following to Kconfig:
   CONFIG_VIDEO_LOGO_MAX_SIZE

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE
Simon Glass [Tue, 18 Oct 2022 12:46:08 +0000 (06:46 -0600)]
video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE

This option should not have the SYS_ in it. Drop it so it fits in with the
other video options.

Also simplify the alignment code in gunzip_bmp(), since malloc() always
returns a 32-bit-aligned pointer.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoConvert CONFIG_HIDE_LOGO_VERSION to Kconfig
Simon Glass [Tue, 18 Oct 2022 12:30:56 +0000 (06:30 -0600)]
Convert CONFIG_HIDE_LOGO_VERSION to Kconfig

This converts the following to Kconfig:
   CONFIG_HIDE_LOGO_VERSION

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Split SPLASH_SCREEN_ALIGN from bmp command
Simon Glass [Tue, 18 Oct 2022 12:24:16 +0000 (06:24 -0600)]
video: Split SPLASH_SCREEN_ALIGN from bmp command

The bmp command already has a way to centre the image. Using this CONFIG
option to also centre it makes it impossible to control where images are
placed on the screen. Drop the extra check.

Simplify the Kconfig file we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agosplash: get devpart from environment variable
Julien Masson [Mon, 17 Oct 2022 08:33:22 +0000 (10:33 +0200)]
splash: get devpart from environment variable

By default several types of splash locations are supported and the
user can select one of them through environment var (splashsource).

However the devpart is still hardcoded and we cannot change it from
the environment.

This patch add the support of "splashdevpart" which allow the user to
set the devpart though this environment variable.

Example: image located in splashscreen partition (MMC as raw)
```
splashsource=mmc_raw
splashdevpart=0#splashscreen
```

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosplash: support raw image from MMC
Julien Masson [Mon, 17 Oct 2022 08:33:21 +0000 (10:33 +0200)]
splash: support raw image from MMC

The user has now the choice to specify the splash location in the MMC
as a raw storage.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add a way to get the default font height
Simon Glass [Thu, 6 Oct 2022 14:36:18 +0000 (08:36 -0600)]
video: Add a way to get the default font height

This is not as simple as it seems. Add a function to provide it so that
the upcoming menu feature can space lines out correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add a function to get the dimensions of a BMP image
Simon Glass [Thu, 6 Oct 2022 14:36:17 +0000 (08:36 -0600)]
video: Add a function to get the dimensions of a BMP image

This is useful for some other users, so break this out into a function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add commands to list and change fonts
Simon Glass [Thu, 6 Oct 2022 14:36:16 +0000 (08:36 -0600)]
video: Add commands to list and change fonts

Add a new 'font' command which allows the fonts to be listed as well as
selecting a different font and size.

Allow the test to run on sandbox, where multiple font/size combinations
are supported, as well as sandbox_flattree, where they are not.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Enable the cls command by default
Simon Glass [Thu, 6 Oct 2022 14:36:15 +0000 (08:36 -0600)]
video: Enable the cls command by default

This is enabled for LCD but not for VIDEO. Enable it since it is useful
to be able to clear the screen and adds very little code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add a way to change the font name and size
Simon Glass [Thu, 6 Oct 2022 14:36:14 +0000 (08:36 -0600)]
video: Add a way to change the font name and size

It is useful to be able to support multiple fonts. Add a function to
handle this as well as one to list the available fonts.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add a function to select the truetype metrics
Simon Glass [Thu, 6 Oct 2022 14:36:13 +0000 (08:36 -0600)]
video: Add a function to select the truetype metrics

Move this code into a function so we can call it later when we want to
change the font.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Record the truetype font name
Simon Glass [Thu, 6 Oct 2022 14:36:12 +0000 (08:36 -0600)]
video: Record the truetype font name

Add this to the metrics so we can later adjust the font size without
changing the font itself.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Refactor to allow more than one font size
Simon Glass [Thu, 6 Oct 2022 14:36:11 +0000 (08:36 -0600)]
video: Refactor to allow more than one font size

At present the truetype console supports only a single font and size. It
is useful to be able to support different combinations. As a first step,
move the metrics into there own structure and allow having multiple
metrics.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Tidy up the check for valid fonts
Simon Glass [Thu, 6 Oct 2022 14:36:10 +0000 (08:36 -0600)]
video: Tidy up the check for valid fonts

Put this check into a function so we can use it elsewhere. Also drop the
macros which do the same thing but are not actually used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add function to obtain the U-Boot logo
Simon Glass [Thu, 6 Oct 2022 14:36:09 +0000 (08:36 -0600)]
video: Add function to obtain the U-Boot logo

It is useful to show the logo from other code, coming in a later feature.
Add a function to obtain it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Allow filling the display with a colour
Simon Glass [Thu, 6 Oct 2022 14:36:08 +0000 (08:36 -0600)]
video: Allow filling the display with a colour

Generalise the video_clear() function to allow filling with a different
colour.

Tidy up the comments while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Move and rename DM_HX8238D option
Simon Glass [Thu, 6 Oct 2022 14:36:07 +0000 (08:36 -0600)]
video: Move and rename DM_HX8238D option

This is actually a panel, not a video device. Rename the option, move it
into the right place and make it depend on PANEL.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Move the console commands to cmd/
Simon Glass [Thu, 6 Oct 2022 14:36:06 +0000 (08:36 -0600)]
video: Move the console commands to cmd/

Move these commands and the implementation to the cmd/ directory, which is
where most commands are kept.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
[agust: keep vidconsole_position_cursor() in vidconsole uclass]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2 years agovideo: Use vidconsole_put_string() to write a string
Simon Glass [Thu, 6 Oct 2022 14:36:05 +0000 (08:36 -0600)]
video: Use vidconsole_put_string() to write a string

Use the existing function rather that duplicating the code. Also fix up
the missing error handling.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Provide a function to set the cursor position
Simon Glass [Thu, 6 Oct 2022 14:36:04 +0000 (08:36 -0600)]
video: Provide a function to set the cursor position

Add an exported function which allows the cursor position to be set to
pixel granularity. Make use of this in the existing code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Move console colours to the video uclass
Simon Glass [Thu, 6 Oct 2022 14:36:03 +0000 (08:36 -0600)]
video: Move console colours to the video uclass

At present these are attached to vidconsole which means that the video
uclass requires that a console is enabled. This is not the intention.
The colours are a reasonable way of indexing common colours in any case,
so move them to the video uclass instead.

Rename vid_console_color() to video_index_to_colour() now that it is more
generic. Also fix the inconsistent spelling in these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agovideo: simplefb: add rotation support
Takumi Sueda [Tue, 13 Sep 2022 09:32:42 +0000 (18:32 +0900)]
video: simplefb: add rotation support

It introduces the way to rotate the screen for boards with rotated screen.

Signed-off-by: Takumi Sueda <puhitaku@gmail.com>
2 years agovideo: dw_mipi_dsi: fix [hv]sync active vs back porch
John Keeping [Wed, 7 Sep 2022 11:06:32 +0000 (12:06 +0100)]
video: dw_mipi_dsi: fix [hv]sync active vs back porch

The wrong fields are pulled out of the timings here so the values
programmed into the DSI_VID_HSA_LINES/DSI_VID_HBP_LINES and
DSI_VID_VSA_LINES/DSI_VID_VBP_LINES registers are swapped.

Use the right fields so that the correct values are programmed.

Fixes: d4f7ea83fc ("video: add MIPI DSI host controller bridge")
Signed-off-by: John Keeping <john@metanate.com>
2 years agoMerge tag 'dm-pull-29oct22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sat, 29 Oct 2022 22:51:22 +0000 (18:51 -0400)]
Merge tag 'dm-pull-29oct22' of https://source.denx.de/u-boot/custodians/u-boot-dm

Fix pylibfdt warnings and use setuptools to build
Various minor changes to core dm and sandbox

2 years agodm: core: Do not stop uclass iteration on error
Michal Suchanek [Wed, 12 Oct 2022 19:58:09 +0000 (21:58 +0200)]
dm: core: Do not stop uclass iteration on error

When probing a device fails NULL pointer is returned, and following
devices in uclass list cannot be iterated. Skip to next device on error
instead.

With that the only condition under which these simple iteration
functions return error is when the dm is not initialized at uclass_get
time. This is not all that interesting, change return type to void.

Fixes: 6494d708bf ("dm: Add base driver model support")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: treewide: Do not use the return value of simple uclass iterator
Michal Suchanek [Wed, 12 Oct 2022 19:58:08 +0000 (21:58 +0200)]
dm: treewide: Do not use the return value of simple uclass iterator

uclass_first_device/uclass_next_device return value will be removed,
don't use it.

With the current implementation dev is equivalent to !ret. It is
redundant to check both, ret check can be replaced with dev check, and
ret check inside the iteration is dead code.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Add note about device_probe idempotence
Michal Suchanek [Tue, 27 Sep 2022 21:25:08 +0000 (23:25 +0200)]
dm: core: Add note about device_probe idempotence

device_probe returns early when the device is already activated.
Add a note to the documentation that it can be used on already activated
devices.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2 years agodm: core: Document return value of device bind functions
Michal Suchanek [Tue, 27 Sep 2022 21:24:36 +0000 (23:24 +0200)]
dm: core: Document return value of device bind functions

These functions use device_bind_with_driver_data internally, copy the
return value description.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2 years agodm: core: Switch uclass_*_device_err to use uclass_*_device_check
Michal Suchanek [Sun, 25 Sep 2022 11:08:16 +0000 (13:08 +0200)]
dm: core: Switch uclass_*_device_err to use uclass_*_device_check

Clarify documentation, fix a few more cases that could be broken by the
change.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2 years agofdt: Move to setuptools
Simon Glass [Sun, 31 Jul 2022 02:57:11 +0000 (20:57 -0600)]
fdt: Move to setuptools

The distutils package is deprecated. The upstream libfdt repo uses
setuptools for building the pylibfdt module, so bring in that code,
suitably modified for U-Boot. Also bring in the README.

The modifications include setting the version correctly, making use of
the environment variables provided by the Makefile and various tweaks
to the directories.

Note that the version omits the minus character at the start of
EXTRAVERSION, since this creates a warning. The build is really just used
within U-Boot itself, so it doesn't matter too much if the version matches
upstream, or exactly matches U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agothermal: sandbox: Enable thermal uclass for sandbox64 variant
Sughosh Ganu [Tue, 18 Oct 2022 08:47:25 +0000 (14:17 +0530)]
thermal: sandbox: Enable thermal uclass for sandbox64 variant

The sandbox64 variant is currently building the sandbox thermal driver
but not the corresponding uclass driver. This results in the sandbox64
variant not booting with the test device tree. Enable building the
thermal uclass for the sandbox64 variant as well.

Also enable the temperature command to allow the test to be run on the
sandbox64 variant.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Add support for symlinking images
Neha Malcom Francis [Mon, 17 Oct 2022 11:06:25 +0000 (16:36 +0530)]
binman: Add support for symlinking images

Adding support to symlink an image packaged using binman.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: typo Fictionnal
Heinrich Schuchardt [Sun, 16 Oct 2022 20:17:46 +0000 (22:17 +0200)]
sandbox: typo Fictionnal

%s/Fictionnal/Fictional/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotests: Build correct sandbox configuration on 32bit
Michal Suchanek [Fri, 14 Oct 2022 20:52:33 +0000 (22:52 +0200)]
tests: Build correct sandbox configuration on 32bit

Currently sandbox configuration defautls to 64bit and there is no
automation for building 32bit sandbox on 32bit hosts.

Use _LP64 macro as heuristic for detecting 64bit targets.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: tpl: Add fdt address translation support in TPL
William Zhang [Fri, 14 Oct 2022 18:04:55 +0000 (11:04 -0700)]
dm: tpl: Add fdt address translation support in TPL

This is needed in the platforms that use "ranges" node property for
address translation in their dts for TPL.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolibfdt: Fix build with python 3.10
Michal Suchanek [Thu, 13 Oct 2022 20:43:41 +0000 (22:43 +0200)]
libfdt: Fix build with python 3.10

Python 3.10 requires defining PY_SSIZE_T_CLEAN. This will be fixed in
swig 4.10 but it is not clear when it will be released. There was a
warning since python 3.8.

Link: https://github.com/swig/swig/pull/2277
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolibfdt: Fix invalid version warning
Michal Suchanek [Thu, 13 Oct 2022 20:39:51 +0000 (22:39 +0200)]
libfdt: Fix invalid version warning

python does not like the u-boot- prefix in the version, drop it.

/usr/lib/python3.10/site-packages/setuptools/dist.py:544: UserWarning:
The version specified ('u-boot-2022.10') is an invalid version, this may
not work as expected with newer versions of setuptools, pip, and PyPI.
Please see PEP 440 for more details.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest: Drop unwanted option in event_dump.py
Simon Glass [Sun, 9 Oct 2022 03:33:22 +0000 (21:33 -0600)]
test: Drop unwanted option in event_dump.py

This option is not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Drop the path when checking event-list filenames
Simon Glass [Sun, 9 Oct 2022 03:33:21 +0000 (21:33 -0600)]
event: Drop the path when checking event-list filenames

This path does not seem to be present in clang-14 for some reason. Relax
the regular expression so that the test works, at least for non-LTO.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Fix lists_bind_fdt() using non-existent of_match
Simon Glass [Sun, 9 Oct 2022 03:33:20 +0000 (21:33 -0600)]
dm: core: Fix lists_bind_fdt() using non-existent of_match

The call to device_bind_with_driver_data() passes id->data but if
the entry has no of_match then the id has not been set by the selected
driver.

Normally this passes unnoticed since a previous driver likely had an
of_match value, so the id is set to that. Of course it is not correct
to pass the id->data from a different driver.

With clang-14 the driver ordering is such that the id is never actually
set in the 'bind /usb@1 usb_ether' line in test_bind_unbind_with_node()
thus causing a crash.

Fix this by passing 0 if the of_match for a driver does not exist.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agogpio-uclass: fix gpio lookup by label
Rasmus Villemoes [Mon, 3 Oct 2022 09:02:45 +0000 (11:02 +0200)]
gpio-uclass: fix gpio lookup by label

Matching anything that just happens to have the sought-for label as a
prefix is wrong. For example, if the board designer has designated 10
lines for debug purposes, named "debug1" through "debug10", and we are
looking up "debug1", if debug10 happens to be met first during the
iteration we'd wrongly return that.

In theory, this can break existing users that could rely on this
quirk, but OTOH keeping the current broken semantics can cause a lot
of grief for people hitting this in the future and not understanding
why they don't find the line they expect. Considering how few in-tree
defconfigs currently set DM_GPIO_LOOKUP_LABEL (ignoring sandbox, only
four "real" boards), let's fix it before the use becomes more
widespread.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agox86: provide typedef jmp_buf
Heinrich Schuchardt [Sat, 1 Oct 2022 13:00:22 +0000 (15:00 +0200)]
x86: provide typedef jmp_buf

The jmp_buf type is required by the C99 specification.
Defining it for x86 fixes building the longjmp unit test.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agox86: fix longjmp() implementation
Heinrich Schuchardt [Sat, 1 Oct 2022 13:00:21 +0000 (15:00 +0200)]
x86: fix longjmp() implementation

If longjmp(jmp_buf env, int val) is called with val = 0, the setjmp()
macro must return 1.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: pci: Fix doc typo first -> next
Michal Suchanek [Tue, 27 Sep 2022 21:25:24 +0000 (23:25 +0200)]
dm: pci: Fix doc typo first -> next

pci_find_first_device description says it can be used for iteration with
itself but it should really be with pci_find_next_device

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2 years agofdt_support: cosmetic: remove fdt_fixup_nor_flash_size prototype
Patrick Delaunay [Tue, 27 Sep 2022 08:18:05 +0000 (10:18 +0200)]
fdt_support: cosmetic: remove fdt_fixup_nor_flash_size prototype

Remove prototype for the removed function fdt_fixup_nor_flash_size.
This patch has no impact as the function is never used.

Fixes: 98f705c9cefd ("powerpc: remove 4xx support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: doc: Fix serial howto u-boot,dm-pre-reloc typo
Michal Suchanek [Sun, 25 Sep 2022 13:28:47 +0000 (15:28 +0200)]
dm: doc: Fix serial howto u-boot,dm-pre-reloc typo

In a couple of places the document says u-boot,pre-reloc but all
examples show u-boot,dm-pre-reloc, use the latter consistently.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolib: fix buggy strcmp and strncmp
Rasmus Villemoes [Wed, 5 Oct 2022 09:09:25 +0000 (11:09 +0200)]
lib: fix buggy strcmp and strncmp

There are two problems with both strcmp and strncmp:

(1) The C standard is clear that the contents should be compared as
"unsigned char":

  The sign of a nonzero value returned by the comparison functions
  memcmp, strcmp, and strncmp is determined by the sign of the
  difference between the values of the first pair of characters (both
  interpreted as unsigned char) that differ in the objects being
  compared.

(2) The difference between two char (or unsigned char) values can
range from -255 to +255; so that's (due to integer promotion) the
range of values we could get in the *cs-*ct expressions, but when that
is then shoe-horned into an 8-bit quantity the sign may of course
change.

The impact is somewhat limited by the way these functions
are used in practice:

- Most of the time, one is only interested in equality (or for
  strncmp, "starts with"), and the existing functions do correctly
  return 0 if and only if the strings are equal [for strncmp, up to
  the given bound].

- Also most of the time, the strings being compared only consist of
  ASCII characters, i.e. have values in the range [0, 127], and in
  that case it doesn't matter if they are interpreted as signed or
  unsigned char, and the possible difference range is bounded to
  [-127, 127] which does fit the signed char.

For size, one could implement strcmp() in terms of strncmp() - just
make it "return strncmp(a, b, (size_t)-1);". However, performance of
strcmp() does matter somewhat, since it is used all over when parsing
and matching DT nodes and properties, so let's find some other place
to save those ~30 bytes.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agoMerge branch '2022-10-26-assorted-fixes-and-updates'
Tom Rini [Wed, 26 Oct 2022 19:24:59 +0000 (15:24 -0400)]
Merge branch '2022-10-26-assorted-fixes-and-updates'

- Reduce memory usage in SPL in some cases, clarify some standalone API
  license issues, fix a Kconfig dependency, pin to a specific version of
  python setuptools for now, fix a signing problem in mkimage and add a
  memory uclass.

2 years agomemory: Add TI GPMC driver
Roger Quadros [Thu, 20 Oct 2022 13:30:49 +0000 (16:30 +0300)]
memory: Add TI GPMC driver

The GPMC is a unified memory controller dedicated for interfacing
with external memory devices like
 - Asynchronous SRAM-like memories and ASICs
 - Asynchronous, synchronous, and page mode burst NOR flash
 - NAND flash
 - Pseudo-SRAM devices

This driver will take care of setting up the GPMC based on
the settings specified in the Device tree and then
probe its children.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2 years agodt/bindings: memory: Add bindings for TI GPMC driver
Roger Quadros [Thu, 20 Oct 2022 13:30:48 +0000 (16:30 +0300)]
dt/bindings: memory: Add bindings for TI GPMC driver

GPMC stands for General Purpose Memory Controller and it is
present on many Texas Instruments SoCs.

It supports a number of Asynchronous and Synchronous interfaces
and has various settings to configure the bus interface.

The DT bindings define all the various GPMC settings.

As the GPMC supports multiple devices on the bus, each
device is represented as a child and the respective
GPMC settings are situated there. (see ti,gpmc-child.yaml)

These binding docs are picked up from the Linux kernel.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
2 years agoscripts: Makefile.spl: Enable memory drivers to be built for SPL
Roger Quadros [Thu, 20 Oct 2022 13:30:47 +0000 (16:30 +0300)]
scripts: Makefile.spl: Enable memory drivers to be built for SPL

Introduce CONFIG_SPL_MEMORY to allow Memory drivers to
be built for SPL.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: memory: Introduce new uclass
Roger Quadros [Thu, 20 Oct 2022 13:30:46 +0000 (16:30 +0300)]
dm: memory: Introduce new uclass

Introduce UCLASS_MEMORY for future Memory Controller
device drivers.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest: Move to a working version of setuptools
Simon Glass [Sat, 22 Oct 2022 01:30:43 +0000 (19:30 -0600)]
test: Move to a working version of setuptools

The version used on Ubuntu 2022.04 produces a number of warnings:

/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116:
   PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version
   and will not be supported in a future release

Same with: 0.1.43ubuntu1 11.4.1ubuntu1 2.22.1ubuntu1 1.1build1

According to [1] this is a bug in setuptools. Employ the workaround for
now.

[1] https://askubuntu.com/questions/1406952/what-is-the-meaning-of-this-
pkgresourcesdeprecationwarning-warning-from-pipenv

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexamples: hello_world: Drop inclusion of common header
Paul Barker [Thu, 5 May 2022 15:32:41 +0000 (15:32 +0000)]
examples: hello_world: Drop inclusion of common header

The "common.h" header is not covered by the licensing exception for
standalone applications. Let's drop inclusion of this header from the
hello_world example to prove that a standalone app can be built without
it.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoLicenses: Clarify exceptions for standalone apps
Paul Barker [Thu, 5 May 2022 15:32:40 +0000 (15:32 +0000)]
Licenses: Clarify exceptions for standalone apps

On 2010-01-27, an email [1] was sent to the mailing list by Wolfgang
Denk which clarified the intended licensing exceptions for standalone
applications. As the "export.h" header and the "stubs.c" source files
are required to implement a standalone application, the intention was
that these files be covered by the licensing exception. This is made
clear in the following quotes from that email:

"exports.h" should be added to the "allowed" file list; there should
be no need to include "common.h". Eventually this needs fixing.
Patches are welcome.

"examples/standalone/stubs.c" should be added to the "allowed" file
list (the ppc_*jmp.S files are LGPLed).

There should be no doubts - the intention is clear, the current state
may need improvement. Help (read: patches) welcome.

[1]: https://lists.denx.de/pipermail/u-boot/2010-January/067174.html

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
2 years agocrypto: hash: sw: fix Kconfig dependencies
Benjamin Bara [Wed, 29 Jun 2022 10:27:34 +0000 (12:27 +0200)]
crypto: hash: sw: fix Kconfig dependencies

Fix SHA512 config name and add missing SHA384 config.

Signed-off-by: Benjamin Bara <Benjamin.Bara@skidata.com>
2 years agospl: spl_legacy: Fix NAND boot on OMAP3 BeagleBoard
Roger Quadros [Thu, 29 Sep 2022 10:11:28 +0000 (13:11 +0300)]
spl: spl_legacy: Fix NAND boot on OMAP3 BeagleBoard

OMAP3 BeagleBoard NAND boot hangs when spl_load_legacy_img() tries
to read the header into 'struct hdr' which is allocated on the
stack.

As the header has already been read once before by spl_nand.c,
we can avoid the extra header allocation and read here by
simply passing around the pointer to the header.

This fixes NAND boot on OMAP3 BeagleBoard.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
2 years agomkimage: fit: Fix signing of configs with external data
Sean Anderson [Thu, 20 Oct 2022 19:41:10 +0000 (15:41 -0400)]
mkimage: fit: Fix signing of configs with external data

Just like we exclude data-size, data-position, and data-offset from
fit_config_check_sig, we must exclude them while signing as well.

While we're at it, use the FIT_DATA_* defines for fit_config_check_sig
as welll.

Fixes: 8edecd3110e ("fit: Fix verification of images with external data")
Fixes: c522949a29d ("rsa: sig: fix config signature check for fit with padding")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-pmic
Tom Rini [Wed, 26 Oct 2022 11:46:48 +0000 (07:46 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-pmic