platform/kernel/u-boot.git
2 years agorockchip: clk: add clocks to px30_clk_enable
Chris Morgan [Fri, 25 Mar 2022 17:09:22 +0000 (12:09 -0500)]
rockchip: clk: add clocks to px30_clk_enable

Add the HCLK_OTG, HCLK_SFC, and SCLK_SFC clocks to px30_clk_enable.
Without this change U-Boot reports an error of "Enable
clock-controller@ff2b0000 failed" on boot when using the SFC or USB in
U-Boot.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agospi: rockchip_sfc: Add missing include for dm/device_compat.h
Chris Morgan [Fri, 25 Mar 2022 15:40:35 +0000 (10:40 -0500)]
spi: rockchip_sfc: Add missing include for dm/device_compat.h

Add missing include for dm/device_compat.h. Without this include the
SFC driver fails to compile because dev_err and dev_dbg are not
defined.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoadc: rockchip-saradc: add support for getting reference voltage value
Peter Cai [Fri, 4 Feb 2022 20:16:06 +0000 (15:16 -0500)]
adc: rockchip-saradc: add support for getting reference voltage value

Mirroring commit 97ab802aa36f ("adc: meson-saradc: add support for
getting reference voltage value") for meson-saradc, this adds support
for getting the "vref-supply" regulator and register it as the ADC's
reference voltage regulator, so clients can translate sampled ADC values
to voltage.

Signed-off-by: Peter Cai <peter@typeblog.net>
Reviewed-by: John Keeping <john@metanate.com>
Tested-by: John Keeping <john@metanate.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agommc: rockchip_sdhci: Correct error checking
Haolin Li [Tue, 22 Mar 2022 12:58:02 +0000 (05:58 -0700)]
mmc: rockchip_sdhci: Correct error checking

A pointer can not be negative. Use macro IS_ERR_OR_NULL() for checking.

Signed-off-by: Haolin Li <li.haolin@qq.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoMerge tag 'efi-2022-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 15 Apr 2022 18:29:52 +0000 (14:29 -0400)]
Merge tag 'efi-2022-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-07-rc1-2

Documentation:

* Describe env command

UEFI

* simplify Unicode string functions
* clean up the usage of GUIDs for capsule updates

2 years agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-net
Tom Rini [Fri, 15 Apr 2022 12:09:52 +0000 (08:09 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-net

- DM9000 DM support
- tftp server bug fix
- mdio ofnode support functions
- Various phy fixes and improvements.

[trini: Fixup merge conflicts in drivers/net/phy/ethernet_id.c
drivers/net/phy/phy.c include/phy.h]

2 years agoCI: Print out unmigrated symbols when failing
Tom Rini [Mon, 11 Apr 2022 17:20:00 +0000 (13:20 -0400)]
CI: Print out unmigrated symbols when failing

To make addressing the problem of migrated symbols being present in
board config header files, update the CI test to them print what symbols
are causing it to fail.  Also report all failures in the tree, rather
than stopping at the first failing file.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-04-14-assorted-updates'
Tom Rini [Fri, 15 Apr 2022 12:04:16 +0000 (08:04 -0400)]
Merge branch '2022-04-14-assorted-updates'

- Apple M1 Ultra support, TI power domain fix, atsha204a big endian
  support, LED cleanups and support for default-state, increase malloc
  pool on sandbox, ubifs bugfix, further serial cleanup / semihost
  support, fix a few cases around enabling/disabling FS support in SPL,
  clean up duplication of table_compute_checksum()

2 years agoefi_loader: simplify efi_serialize_load_option()
Heinrich Schuchardt [Sat, 2 Apr 2022 09:47:01 +0000 (11:47 +0200)]
efi_loader: simplify efi_serialize_load_option()

Use u16_strsize().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: EFI_HII_STRING_PROTOCOL.GetString()
Heinrich Schuchardt [Sat, 2 Apr 2022 09:47:00 +0000 (11:47 +0200)]
efi_loader: EFI_HII_STRING_PROTOCOL.GetString()

Use u16_strsize().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agolib: simplify u16_strdup()
Heinrich Schuchardt [Sat, 2 Apr 2022 09:46:59 +0000 (11:46 +0200)]
lib: simplify u16_strdup()

Use u16_strsize() instead of duplicating it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agolib: convert u16_strlen() into a macro
Heinrich Schuchardt [Sat, 2 Apr 2022 09:46:58 +0000 (11:46 +0200)]
lib: convert u16_strlen() into a macro

The function u16_strlen() can be implemented as call to u16_strnlen().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: man-page for the env command
Patrick Delaunay [Thu, 14 Apr 2022 17:07:05 +0000 (19:07 +0200)]
doc: man-page for the env command

Describe the env command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agodoc: uefi: Update the capsule update related documentation
Sughosh Ganu [Fri, 15 Apr 2022 05:59:41 +0000 (11:29 +0530)]
doc: uefi: Update the capsule update related documentation

Update the capsule update functionality related documentation to
refect the additional definitions that need to be made per platform
for supporting the capsule update feature.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2 years agomkeficapsule: Remove raw and FIT GUID types
Sughosh Ganu [Fri, 15 Apr 2022 05:59:40 +0000 (11:29 +0530)]
mkeficapsule: Remove raw and FIT GUID types

While building a capsule, the GUID value of that specific image is to
be passed through the --guid command option to the mkeficapsule
tool instead of using one of --raw or --fit options, where the GUID
value passed through the command line option is the image GUID.

This renders the EFI_FIRMWARE_IMAGE_TYPE_UBOOT_FIT_GUID and
EFI_FIRMWARE_IMAGE_TYPE_UBOOT_RAW_GUID values superfluous. Remove the
--raw and --fit command line options as well. Also modify the
mkeficapsule man page to reflect this change.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agoFMP: Remove GUIDs for FIT and raw images
Sughosh Ganu [Fri, 15 Apr 2022 05:59:39 +0000 (11:29 +0530)]
FMP: Remove GUIDs for FIT and raw images

The capsule update code has been modified for getting the image GUID
values from the platform code. With this, each image now has a unique
GUID value. With this change, there is no longer a need for defining
GUIDs for FIT and raw images. Remove these GUID values.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agotest: capsule: Modify the capsule tests to use GUID values for sandbox
Sughosh Ganu [Fri, 15 Apr 2022 05:59:38 +0000 (11:29 +0530)]
test: capsule: Modify the capsule tests to use GUID values for sandbox

The current UEFI capsule updation code uses two GUID values, one for
FIT images, and one for raw images across platforms. This logic is
being changed to have GUID values per image, per platform. Change the
tests for the capsule update code to reflect this change. The GUID
values now used are the ones specific to the sandbox platform -- one
for the u-boot image, and another for the u-boot environment image.

Install the FMP instance for raw images on the sandbox variant for
testing the capsule update code. Install the FMP instance for the FIT
images on the sandbox64 and sandbox_flattree variant for testing
capsule update for FIT images. This is being done by splitting the
capsule update script for FIT and raw images.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agoefi: Define set_dfu_alt_info() for boards with UEFI capsule update enabled
Sughosh Ganu [Fri, 15 Apr 2022 05:59:37 +0000 (11:29 +0530)]
efi: Define set_dfu_alt_info() for boards with UEFI capsule update enabled

Currently, there are a bunch of boards which enable the UEFI capsule
update feature. The actual update of the firmware images is done
through the dfu framework which uses the dfu_alt_info environment
variable for getting information on the update, like device, partition
number/address etc. The dfu framework allows the variable to be set
through the set_dfu_alt_info function defined by the platform, or if
the function is not defined, it gets the variable from the
environment. Using the value set in the environment is not very
robust, since the variable can be modified from the u-boot command
line and this can cause an incorrect update.

To prevent this from happening, define the set_dfu_alt_info function
when the capsule update feature is enabled. A weak function is defined
which sets the dfu_alt_info environment variable by getting the string
for the variable from the platform.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2 years agocapsule: Put a check for image index before the update
Sughosh Ganu [Fri, 15 Apr 2022 05:59:36 +0000 (11:29 +0530)]
capsule: Put a check for image index before the update

The current capsule update code compares the image GUID value in the
capsule header with the image GUID value obtained from the
GetImageInfo function of the Firmware Management Protocol(FMP). This
comparison is done to ascertain if the FMP's SetImage function can be
called for the update. Make this checking more robust by comparing the
image_index value passed through the capsule with that returned by the
FMP's GetImageInfo function. This protects against the scenario of the
firmware being updated in a wrong partition/location on the storage
device if an incorrect value has been passed through the capsule,
since the image_index is used to determine the location of the update
on the storage device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agocapsule: FMP: Populate the image descriptor array from platform data
Sughosh Ganu [Fri, 15 Apr 2022 05:59:35 +0000 (11:29 +0530)]
capsule: FMP: Populate the image descriptor array from platform data

Currently, the image descriptor array that has been passed to the
GetImageInfo function of the Firmware Management Protocol(FMP) gets
populated through the data stored with the dfu framework. The
dfu data is not restricted to contain information only of the images
updatable through the capsule update mechanism, but it also contains
information on other images. The image descriptor array is also parsed
by the ESRT generation code, and thus the ESRT table contains entries
for other images that are not being handled by the FMP for the capsule
updates. Fix this by populating the image descriptor array from the
structure initialised in the board file.

The other issue fixed is assignment of a separate GUID for all images
in the image descriptor array. The UEFI specification mandates that
all entries in the ESRT table should have a unique GUID value as part
of the FwClass member of the EFI_SYSTEM_RESOURCE_ENTRY. Currently, all
images are assigned a single GUID value, either an FIT GUID or a raw
image GUID. This is fixed by obtaining the GUID values from the
efi_fw_images array defined per platform.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2 years agocapsule: board: Add information needed for capsule updates
Sughosh Ganu [Fri, 15 Apr 2022 05:59:34 +0000 (11:29 +0530)]
capsule: board: Add information needed for capsule updates

Add a structure which defines the information that is needed for
executing capsule updates on a platform. Some information in the
structure like the dfu string is used for making the update process
more robust while some information like the per platform image GUIDs
is used for fixing issues. Initialise this structure in the board
file, and use the information for the capsule updates.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agofs: Allow to compile CMD_UBIFS when SPL is enabled
Pali Rohár [Tue, 5 Apr 2022 13:49:24 +0000 (15:49 +0200)]
fs: Allow to compile CMD_UBIFS when SPL is enabled

Currently there is no UBIFS support in SPL. But macro CONFIG_CMD_UBIFS is
defined also when building SPL. when both CMD_UBIFS and SPL are enabled
then build process throw compile error.

Fix check for ubifs code in fstypes[] to allow compiling CMD_UBIFS only in
proper U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agofs: Allow to compile FS_FAT only for proper U-Boot
Pali Rohár [Tue, 5 Apr 2022 13:48:32 +0000 (15:48 +0200)]
fs: Allow to compile FS_FAT only for proper U-Boot

CONFIG_SPL_FS_FAT cannot be disabled when CONFIG_FS_FAT is enabled. Fix it.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoRemove duplication of table_compute_checksum function
Tom Rini [Mon, 4 Apr 2022 18:43:51 +0000 (14:43 -0400)]
Remove duplication of table_compute_checksum function

It seems like there was some merge error when first cleaning up and
sharing this function.  We have both an inline version of the function
in include/tables_csum.h and a non-inline version in lib/tables_csum.c.
Rework things so that we only have the non-inline version (due to number
of calls, we should not inline this).

Fixes: 1befb38b8682 ("x86: Move table csum into separate file")
Fixes: 2b445e4d3194 ("x86: Move table csum into separate header")
Cc: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoserial: smh: Implement puts for DM
Sean Anderson [Mon, 4 Apr 2022 18:18:00 +0000 (14:18 -0400)]
serial: smh: Implement puts for DM

This adds an implementation of puts for DM. The implementation is not as
clean as for the non-DM puts because we have to handle non-nul-terminated
string. We also handle short writes (though these are probably very
unusual).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2 years agotest: serial: Add test for putc/puts
Sean Anderson [Mon, 4 Apr 2022 18:17:59 +0000 (14:17 -0400)]
test: serial: Add test for putc/puts

This adds a test to ensure that puts is equivalent to putc called in a
loop. We don't verify the contents of the message to avoid having to
record console output a second time (though that could be added in the
future). The globals are initialized to non-zero values to avoid a
warning; in particular, the character count is off-by-one (but we always
make relative measurements).

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoserial: sandbox: Implement puts
Sean Anderson [Mon, 4 Apr 2022 18:17:58 +0000 (14:17 -0400)]
serial: sandbox: Implement puts

This implements puts for sandbox. It is fairly straightforward, except
that we break out the shared color printing functionality into its own
function.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoserial: Fix _serial_puts using \n\r instead of \r\n
Sean Anderson [Mon, 4 Apr 2022 18:17:57 +0000 (14:17 -0400)]
serial: Fix _serial_puts using \n\r instead of \r\n

A string like "test\n" would be broken up into the following sequence of
prints by _serial_puts:

puts("test\n")
putc('\r')

Although functionally this is the same as \r\n, it is not the standard
sequence and caused tests to fail. Fix this by excluding the '\n' from
the initial print. The above string will now be broken up like

puts("test")
puts("\r\n")

Since we may now need to call ops->puts twice (with the associated retry
logic), break that part of the function off into a helper.

Fixes: 7a76347189 ("serial: dm: Add support for puts")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2 years agocmd: ubi.c: skip part command if right partition is already attached
Alexandre Besnard [Mon, 4 Apr 2022 15:50:14 +0000 (17:50 +0200)]
cmd: ubi.c: skip part command if right partition is already attached

Attaching a UBI partition may take a while, since scanning the memory is
required.
It thus makes sense to avoid a detach/scan/attach cycle when the right
partition is already attached, and let the calling process call 'detach'
beforehand if it needs it.

This commit checks for the currently attached UBI partition, and skips
reattaching if not needed, showing an information.

Signed-off-by: Alexandre Besnard <alexandre.besnard@softathome.com>
2 years agoled: Configure LED default-state on boot
Marek Vasut [Sun, 3 Apr 2022 23:23:27 +0000 (01:23 +0200)]
led: Configure LED default-state on boot

In case the DT LED subnode contains "default-state" property set to
either "on" or "off", probe the LED driver and configure the LED state
automatically.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
[trini: Update the relevant test now that we have support]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoled: gpio: Drop duplicate OF "label" property parsing
Marek Vasut [Sun, 3 Apr 2022 23:18:07 +0000 (01:18 +0200)]
led: gpio: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
2 years agoled: pwm: Drop duplicate OF "label" property parsing
Tom Rini [Thu, 14 Apr 2022 14:14:22 +0000 (10:14 -0400)]
led: pwm: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoled: bcm6753: Drop duplicate OF "label" property parsing
Tom Rini [Thu, 14 Apr 2022 14:13:53 +0000 (10:13 -0400)]
led: bcm6753: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoled: cortina: Drop duplicate OF "label" property parsing
Marek Vasut [Sun, 3 Apr 2022 23:18:06 +0000 (01:18 +0200)]
led: cortina: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
2 years agoled: bcm6858: Drop duplicate OF "label" property parsing
Marek Vasut [Sun, 3 Apr 2022 23:18:05 +0000 (01:18 +0200)]
led: bcm6858: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
2 years agoled: bcm6358: Drop duplicate OF "label" property parsing
Marek Vasut [Sun, 3 Apr 2022 23:18:04 +0000 (01:18 +0200)]
led: bcm6358: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
2 years agoled: bcm6328: Drop duplicate OF "label" property parsing
Marek Vasut [Sun, 3 Apr 2022 23:18:03 +0000 (01:18 +0200)]
led: bcm6328: Drop duplicate OF "label" property parsing

The OF "label" property parsing is now handled in LED core,
drop the duplicate implementation from this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
2 years agoled: Move OF "label" property parsing to core
Marek Vasut [Sun, 3 Apr 2022 23:18:02 +0000 (01:18 +0200)]
led: Move OF "label" property parsing to core

Every driver in drivers/led/ currently does some form of "label" OF
property parsing in its bind() callback. Move this label parsing to
LED core, since this "label" OF property is a generic property. This
permits code deduplication in subseuqent patches.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Philippe Reynes <philippe.reynes@softathome.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Steven Lawrance <steven.lawrance@softathome.com>
2 years agomisc: atsha204a: Fix big endian support
Pali Rohár [Sat, 2 Apr 2022 22:36:34 +0000 (00:36 +0200)]
misc: atsha204a: Fix big endian support

Callers of function atsha204a_crc16() expect to return value in host cpu
endianity. So remove cpu_to_le16() conversion.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agopower: domain: ti: Extend use of PTCMD and PTSTAT registers for high PDs
Dave Gerlach [Sat, 2 Apr 2022 01:02:48 +0000 (20:02 -0500)]
power: domain: ti: Extend use of PTCMD and PTSTAT registers for high PDs

It is possible for power domain IDs to be great than 31. If this
happens, the PTCMD and PTSTAT registers must overflow into adjacent
corresponding PTCMD_H and PTSTAT_H registers for each. Update the driver
to account for this.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2 years agoarm: apple: Add M1 Ultra support
Janne Grunau [Tue, 29 Mar 2022 11:29:35 +0000 (13:29 +0200)]
arm: apple: Add M1 Ultra support

The M1 Ultra consists of two M1 Max dies. The second die's I/O is at
a consistent offset of 0x2000000000.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2 years agosandbox: Increase default SYS_MALLOC_LEN
Tom Rini [Thu, 14 Apr 2022 15:34:47 +0000 (11:34 -0400)]
sandbox: Increase default SYS_MALLOC_LEN

Increase the malloc pool on sandbox in order to avoid spurious errors
such as:
___________________ test_ut[ut_dm_dm_test_video_comp_bmp32] ____________________
test/py/tests/test_ut.py:43: in test_ut
    assert output.endswith('Failures: 0')
E   AssertionError: assert False
E    +  where False = <built-in method endswith of str object at 0x7f5de85efb20>('Failures: 0')
E    +    where <built-in method endswith of str object at 0x7f5de85efb20> = 'Test: dm_test_video_comp_bmp32: video.c\r\r\nSDL renderer does not exist\r\r\ntest/dm/video.c:86, compress_frame_buff..._test_video_comp_bmp32(): 2024 == compress_frame_buffer(uts, dev): Expected 0x7e8 (2024), got 0x1 (1)\r\r\nFailures: 2'.endswith

Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Wed, 13 Apr 2022 13:14:57 +0000 (09:14 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: net: dm9000: Move new Kconfig option to board configs
Marek Vasut [Wed, 13 Apr 2022 02:15:39 +0000 (04:15 +0200)]
configs: net: dm9000: Move new Kconfig option to board configs

Drop legacy #define CONFIG_DRIVER_DM9000 from board include/configs/
and enable the same in Kconfig configs/ .

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Add Kconfig entry
Marek Vasut [Wed, 13 Apr 2022 02:15:38 +0000 (04:15 +0200)]
net: dm9000: Add Kconfig entry

Add Kconfig entry for the DM9000 MAC.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Add DM support
Marek Vasut [Wed, 13 Apr 2022 02:15:37 +0000 (04:15 +0200)]
net: dm9000: Add DM support

Add support for U-Boot DM and DT probing.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Receive one packet per recv call
Marek Vasut [Wed, 13 Apr 2022 02:15:36 +0000 (04:15 +0200)]
net: dm9000: Receive one packet per recv call

Instead of reading out the entire FIFO and possibly overwriting U-Boot
memory, read out one packet per recv call, pass it to U-Boot network
stack, and repeat.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Split non-DM specific bits from common code
Marek Vasut [Wed, 13 Apr 2022 02:15:35 +0000 (04:15 +0200)]
net: dm9000: Split non-DM specific bits from common code

Split network handling functions into non-DM specific parts and
common code in preparation for conversion to DM.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Pass private data around for IO
Marek Vasut [Wed, 13 Apr 2022 02:15:34 +0000 (04:15 +0200)]
net: dm9000: Pass private data around for IO

Pass private data into IO accessors and use the base addresses of
IO and DATA window from the private data instead of using the hard
coded macros DM9000_IO/DM9000_DATA. Currently both the DM9000_IO
and DM9000_DATA are assigned to the respecive private data fields
for the non-DM case backward compatibility.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Drop dm9000.h and staticize SROM access
Marek Vasut [Wed, 13 Apr 2022 02:15:33 +0000 (04:15 +0200)]
net: dm9000: Drop dm9000.h and staticize SROM access

Dispose of dm9000.h because none of the function prototypes declared in
it are called anywhere in the codebase. Staticize dm9000_read_srom_word()
because it is now called only from within the dm9000 driver. Drop
dm9000_write_srom_word() because it is no longer used.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Drop static device private data
Marek Vasut [Wed, 13 Apr 2022 02:15:32 +0000 (04:15 +0200)]
net: dm9000: Drop static device private data

Allocate driver private data dynamically in its init function and drop
the static driver private data variable. Pass the dynamic private data
throughout the driver. This is done in preparation for DM conversion.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Rename board_info to dm9000_priv
Marek Vasut [Wed, 13 Apr 2022 02:15:31 +0000 (04:15 +0200)]
net: dm9000: Rename board_info to dm9000_priv

Rename board_info structure to dm9000_priv to make it clear what this
structure really contains, the driver private data. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Reorder and staticize
Marek Vasut [Wed, 13 Apr 2022 02:15:30 +0000 (04:15 +0200)]
net: dm9000: Reorder and staticize

Reorder the driver functions to get rid of forward declarations.
Staticize whatever is possible. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Checkpatch cleanup
Marek Vasut [Wed, 13 Apr 2022 02:15:29 +0000 (04:15 +0200)]
net: dm9000: Checkpatch cleanup

Fix checkpatch errors and warnings. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Drop volatiles
Marek Vasut [Wed, 13 Apr 2022 02:15:28 +0000 (04:15 +0200)]
net: dm9000: Drop volatiles

Remove volatile keyword usage from arrays, they are not really volatile
in any way, so this keyword is misused here. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Turn DM9000_DMP_PACKET() into a function
Marek Vasut [Wed, 13 Apr 2022 02:15:27 +0000 (04:15 +0200)]
net: dm9000: Turn DM9000_DMP_PACKET() into a function

Rework DM9000_DMP_PACKET() into dm9000_dump_packet() function,
this brings better type checking. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Drop unused dump_regs()
Marek Vasut [Wed, 13 Apr 2022 02:15:26 +0000 (04:15 +0200)]
net: dm9000: Drop unused dump_regs()

Drop unused function dump_regs() because it is unused.
No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Make RxLen and RxStatus lowercase
Marek Vasut [Wed, 13 Apr 2022 02:15:25 +0000 (04:15 +0200)]
net: dm9000: Make RxLen and RxStatus lowercase

Rename variables to lowercase to be consistent with coding style.
No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Replace DM9000_DBG() with debug()
Marek Vasut [Wed, 13 Apr 2022 02:15:24 +0000 (04:15 +0200)]
net: dm9000: Replace DM9000_DBG() with debug()

Use standard debug() macro to print debug messages instead of
reinventing driver-specific macro again. No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: dm9000: Make accessor names lowercase
Marek Vasut [Wed, 13 Apr 2022 02:15:23 +0000 (04:15 +0200)]
net: dm9000: Make accessor names lowercase

Make accessor names lowercase to be consistent with coding style.
No functional change.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2 years agodriver: net: ti: keystone_net: Change priv member type
Marek Behún [Mon, 11 Apr 2022 19:20:55 +0000 (21:20 +0200)]
driver: net: ti: keystone_net: Change priv member type

Change type of private struct member mdio_base from void * to
phys_addr_t. This allows us to drop 2 casts.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agodriver: net: ti: keystone_net: Convert to ofnode functions
Marek Behún [Mon, 11 Apr 2022 19:20:54 +0000 (21:20 +0200)]
driver: net: ti: keystone_net: Convert to ofnode functions

Convert fdt parsing functions to ofnode parsing functions.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agodriver: net: ti: keystone_net: Deduplicate code
Marek Behún [Mon, 11 Apr 2022 19:20:53 +0000 (21:20 +0200)]
driver: net: ti: keystone_net: Deduplicate code

Deduplicate common code in ks2_eth_bind_slaves().

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoMerge tag 'u-boot-imx-20220413' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Wed, 13 Apr 2022 12:00:11 +0000 (08:00 -0400)]
Merge tag 'u-boot-imx-20220413' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220413

i.MX patches for 2022.07

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/11710

2 years agoboard: gateworks: venice: add imx8mm-gw7903 support
Tim Harvey [Fri, 18 Feb 2022 23:19:33 +0000 (15:19 -0800)]
board: gateworks: venice: add imx8mm-gw7903 support

The GW7903 is based on the i.MX 8M Mini SoC featuring:
 - LPDDR4 DRAM
 - eMMC FLASH
 - microSD socket with voltage select support
 - Gateworks System Controller
 - M.2 A-E Socket with USB2.0 and PCIe
 - MiniPCIe Socket with PCIe, USB2.0, and SIM
 - IMX8M FEC
 - RS232/RS485/RS422 serial transceiver
 - LIS2DE12 3-axis accelerometer
 - front panel LED's
 - off-board isolated digital I/O
 - Wide range DC power input
 - 802.3at PoE
 - PMIC

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoclk: imx8mp: Fix 24M and 32k clock
Marek Vasut [Tue, 12 Apr 2022 22:41:10 +0000 (00:41 +0200)]
clk: imx8mp: Fix 24M and 32k clock

Fix registration of 24M and 32k clock, those got applied or rebased
incorrectly, so fill in the correct code.

Fixes: 7a2c3be95a5 ("clk: imx8mp: Fill in DWC3 USB, USB PHY, HSIOMIX clock")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
2 years agowarp7: Remove duplicated "mmc dev" command
Fabio Estevam [Tue, 12 Apr 2022 10:38:59 +0000 (07:38 -0300)]
warp7: Remove duplicated "mmc dev" command

The "mmc dev ${mmcdev}" command is done twice.

Remove one ocurrence to avoid the duplication.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx: Get rid of only i.MX8M SMCCC arch call
Marek Vasut [Tue, 12 Apr 2022 22:40:26 +0000 (00:40 +0200)]
ARM: imx: Get rid of only i.MX8M SMCCC arch call

This is the only place where i.MX8M code does SMCCC call, remove it.
The output has little value as it prints some part of commit ID, and
worse, if there is no SMC handler installed, the code outright hangs
or crashes the system.

By removing this one instance of SMCCC call, U-Boot no longer depends
on SMC handlers and can boot without hanging in any case. If there is
a need to dump this commit ID, use CMD_SMC instead and do 'smc' call
from U-Boot shell or scripts instead of hard-coding SMCCC dependency
into architecture code. This particular code can be replaced by:
 => smc 0xc2000003 0 0 0 0 0 0

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoARM: imx: Enable instruction cache early on on i.MX8M
Marek Vasut [Tue, 12 Apr 2022 22:41:52 +0000 (00:41 +0200)]
ARM: imx: Enable instruction cache early on on i.MX8M

Enable instruction cache early on to speed up the boot process on i.MX8M.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoclk: imx8mp: Add ECSPI clocks
Elmar Albert [Wed, 6 Apr 2022 11:39:50 +0000 (13:39 +0200)]
clk: imx8mp: Add ECSPI clocks

Add clock tables required for bing up ECSPI interfaces

Signed-off-by: Elmar Albert <ealbert@data-modul.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: uboot-imx <uboot-imx@nxp.com>
Signed-off-by: Elmar Albert <ealbert@data-modul.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agonet: tftp: fix tftp server initialization
Arjan Minzinga Zijlstra [Thu, 31 Mar 2022 08:03:16 +0000 (08:03 +0000)]
net: tftp: fix tftp server initialization

Some globals where not properly initialized causing timeouts
as data packets where not immediately acknowledged.

Fixes: cc6b87ecaa96 ("net: tftp: Add client support for RFC 7440")
Signed-off-by: Arjan Minzinga Zijlstra <arjan.minzingazijlstra@fox-it.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoinclude: configs: *imx8*: remove IMX_FEC_BASE
Heiko Thiery [Fri, 18 Feb 2022 20:48:42 +0000 (21:48 +0100)]
include: configs: *imx8*: remove IMX_FEC_BASE

The IMX_FEC_BASE value is not used when CONFIG_DM_ETH is configured. So this
value can be removed.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-By: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agokontron-pitx-imx8m: change environment address variables
Heiko Thiery [Wed, 16 Feb 2022 12:25:15 +0000 (13:25 +0100)]
kontron-pitx-imx8m: change environment address variables

Currently the space between kernel_addr_r and the fdt_addr_r is only 32MB.
To have enought space to load kernel images bigger than 32MB change the
variables to a feasible value.

The new environment variables layout is based on the scheme from
"include/configs/ti_armv7_common.h".

The CONFIG_SYS_LOAD_ADDR value is set to 0x42000000. With that we have
the same value as for the kernel_addr_r.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2 years agoARM: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board
Marek Vasut [Fri, 8 Apr 2022 00:15:01 +0000 (02:15 +0200)]
ARM: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board

Add new board based on the Toradex Verdin iMX8M Mini SoM, the MX8Menlo.
The board is a compatible replacement for i.MX53 M53Menlo and features
USB, multiple UARTs, ethernet, LEDs, SD and eMMC.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoboard: freescale: imxrt10..-evk: Fix missing include of serial.h
Jesse Taube [Thu, 17 Mar 2022 18:33:21 +0000 (14:33 -0400)]
board: freescale: imxrt10..-evk: Fix missing include of serial.h

If FALCON mode is enabled we have a missing include in spl_start_uboot.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoARM: dts: imxrt10..-evk: Linux moved pins-imxrt1020 to dts
Jesse Taube [Thu, 17 Mar 2022 18:33:20 +0000 (14:33 -0400)]
ARM: dts: imxrt10..-evk: Linux moved pins-imxrt1020 to dts

The Linux kernel moved dt-bindings/pinctrl/pins-imxrt to the device tree
This patch move it in U-Boot as well.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoconfigs/*imxrt10*: SYS_MALLOC_LEN is too large
Jesse Taube [Thu, 17 Mar 2022 18:33:19 +0000 (14:33 -0400)]
configs/*imxrt10*: SYS_MALLOC_LEN is too large

1M of heap is more than internal ram making booting without SDRAM not
possible now it is 256k

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agoclk: imxrt: Use dts for anatop base address
Jesse Taube [Thu, 17 Mar 2022 18:33:18 +0000 (14:33 -0400)]
clk: imxrt: Use dts for anatop base address

In Linux IMX and IMXRT use the device tree to hold the anatop address.
The anatop is used in clock drivers as it controls the internal PLLs
This will move the macro from asm/arch-imxrt to the device tree.
This presumably should also be done with the other IMX boards as well.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
2 years agommc: fsl_esdhc_imx: Add i.MX8MP compatible string
Marek Vasut [Thu, 10 Mar 2022 20:27:04 +0000 (21:27 +0100)]
mmc: fsl_esdhc_imx: Add i.MX8MP compatible string

Add compatible string for i.MX8MP, which permits i.MX8MP to use
HS400ES mode, just like all the other i.MX8M.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Haibo Chen <haibo.chen@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoARM: imx: romapi: Repair FlexSPI NOR boot offset
Marek Vasut [Wed, 9 Mar 2022 16:09:45 +0000 (17:09 +0100)]
ARM: imx: romapi: Repair FlexSPI NOR boot offset

The FlexSPI NOR boot offset does not require any special handling,
the image_offset is correct in either case (0x1000 for FlexSPI NOR
and 0x8000 for SD/eMMC) and the offset of u-boot.itb from the start
of flash.bin is always 0x58000 on MX8MN/MX8MP, which matches the
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 - 0x8000 in case
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300, which is always the
case on MX8MN/MX8MP.

The CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is really overloaded in
case of the MX8MN/MX8MP, but fixing that needs additional plumbing.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoARM: dts: imx: Add flexspi node to i.MX8MP
Marek Vasut [Wed, 9 Mar 2022 03:19:34 +0000 (04:19 +0100)]
ARM: dts: imx: Add flexspi node to i.MX8MP

Add flexspi DT node matching Linux kernel as of commit
d7cd74466651e ("arm64: dts: imx8mp: Reorder flexspi clock-names entry")

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agospi: nxp_fspi: Add i.MX8MP compatible string
Marek Vasut [Wed, 9 Mar 2022 03:18:57 +0000 (04:18 +0100)]
spi: nxp_fspi: Add i.MX8MP compatible string

The i.MX8M Mini and i.MX8M Plus flexspi IPs are compatible with one
another, however the linux kernel DT uses separate compatible string
for each SoC. Add the missing i.MX8MP compatible into this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: gateworks venice: add support for GPY111 phy
Tim Harvey [Tue, 8 Mar 2022 18:47:44 +0000 (10:47 -0800)]
board: gateworks venice: add support for GPY111 phy

The TI DP83867 phy has been replaced with the MaxLinear GPY111 phy due
to part availability.

Add support for it by adding LED config and dt-prop based internal delay
config tx-delay/rx-delay per PHY ID.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: venice: add spl_board_loader_name
Tim Harvey [Tue, 8 Mar 2022 18:45:39 +0000 (10:45 -0800)]
board: venice: add spl_board_loader_name

Implement spl_board_loader_name to provide more meaningful device names
vs MMC1 and MMC2.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8m{m,n}-venice-gw7902: add GSC ADC rail for VDD_5P0
Tim Harvey [Tue, 8 Mar 2022 18:44:43 +0000 (10:44 -0800)]
imx8m{m,n}-venice-gw7902: add GSC ADC rail for VDD_5P0

The GW7902-C revision adds an ADC for the VDD_5P0 voltage rail.
Add register definitions for it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx8m{m,n}_venice: update boot_net script to load fdt
Tim Harvey [Fri, 18 Feb 2022 23:20:17 +0000 (15:20 -0800)]
imx8m{m,n}_venice: update boot_net script to load fdt

Update the 'boot_net' script to load the fdt with the kernel.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: renesas: reduce rcar3_salvator-x image size
Heinrich Schuchardt [Mon, 11 Apr 2022 09:45:29 +0000 (11:45 +0200)]
ARM: renesas: reduce rcar3_salvator-x image size

rcar3_salvator-x u-boot.img is very close to the 0x100000 size limit.

Enable linked time optimization (LTO).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoARM: dts: imx: Add support for Data Modul i.MX8M Mini eDM SBC
Marek Vasut [Tue, 12 Apr 2022 15:26:01 +0000 (17:26 +0200)]
ARM: dts: imx: Add support for Data Modul i.MX8M Mini eDM SBC

Add support for Data Modul i.MX8M Mini eDM SBC board. This is an
evaluation board for various custom display units. Currently
supported are serial console, ethernet, eMMC, SD, SPI NOR,
USB host and USB OTG.

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2 years agoimx8mm-cl-iot-gate: Add redundand environment support
Fabio Estevam [Tue, 12 Apr 2022 16:05:39 +0000 (13:05 -0300)]
imx8mm-cl-iot-gate: Add redundand environment support

Add redundand environment support as it is required
by SWUpdate.

While at it, also adjust the CONFIG_ENV_OFFSET to a more appropriate
larger offset as done on other i.MX8M defconfigs.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mm-cl-iot-gate: Retrieve the serial number from EEPROM
Fabio Estevam [Tue, 12 Apr 2022 16:05:38 +0000 (13:05 -0300)]
imx8mm-cl-iot-gate: Retrieve the serial number from EEPROM

The serial number is located at offset 0x14 of the EEPROM
under i2c0 bus at address 0x54.

To print the serial number in Linux:

SERNUM=$(cat /proc/device-tree/serial-number)
echo $SERNUM

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mm-cl-iot-gate: Retrieve the MAC address from EEPROM
Fabio Estevam [Tue, 12 Apr 2022 16:05:37 +0000 (13:05 -0300)]
imx8mm-cl-iot-gate: Retrieve the MAC address from EEPROM

Currently the eth0 MAC address is randomly assigned.

Retrieve the MAC address from EEPROM.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mm-cl-iot-gate: Retrieve the DDR type from EEPROM
Fabio Estevam [Tue, 12 Apr 2022 16:05:36 +0000 (13:05 -0300)]
imx8mm-cl-iot-gate: Retrieve the DDR type from EEPROM

Currently, the DDR type is retrieved by iteracting inside an array
of possible DDR types.

This may take saveral attempts, which slows the overall U-Boot process
and does not provide a good user experience:

U-Boot SPL 2021.07 (Feb 28 2022 - 06:39:32 +0000)
DDRINFO: Cfg attempt: [ 1/6 ]
DDRINFO(M): mr5-8 [ 0xff000010 ]
DDRINFO(T): mr5-8 [ 0x5000010 ]
resetting ...

U-Boot SPL 2021.07 (Feb 28 2022 - 06:39:32 +0000)
DDRINFO: Cfg attempt: [ 2/6 ]
DDRINFO(M): mr5-8 [ 0xff000010 ]
DDRINFO(T): mr5-8 [ 0x1061010 ]
resetting ...

U-Boot SPL 2021.07 (Feb 28 2022 - 06:39:32 +0000)
DDRINFO: Cfg attempt: [ 3/6 ]
DDRINFO(M): mr5-8 [ 0xff000010 ]
DDRINFO(T): mr5-8 [ 0xff000010 ]
Normal Boot
WDT:   Not starting
Trying to boot from MMC2
NOTICE:  BL31: v2.5(release):v2.5
NOTICE:  BL31: Built : 07:12:44, Jan 24 2022

Improve the boot time by retrieving the correct DDR information from
the EEPROM:

U-Boot SPL 2022.04-rc4-00045-g6d02bc40d58c (Mar 19 2022 - 08:22:29 -0300)
DDRINFO(D): Kingston 4096G
DDRINFO(M): mr5-8 [ 0xff000010 ]
DDRINFO(E): mr5-8 [ 0xff000010 ]
Normal Boot
WDT:   Started watchdog@30280000 with servicing (60s timeout)
Trying to boot from MMC2
NOTICE:  BL31: v2.5(release):v2.5
NOTICE:  BL31: Built : 22:28:11, Mar 15 2022

Based on the original code from Compulab's U-Boot.

Tested on a imx8mm-cl-iot-gate board populated with 4GB of RAM.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8mm-cl-iot-gate: Add SPL EEPROM support
Fabio Estevam [Tue, 12 Apr 2022 16:05:35 +0000 (13:05 -0300)]
imx8mm-cl-iot-gate: Add SPL EEPROM support

imx8mm-cl-iot-gate supports multiple DDR sizes and models.

The DDR type can be retrieved from the EEPROM, so add SPL code
that can be used to get the DDR information.

Based on the original code from Compulab's U-Boot.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agobsh: imx8mn-smm-s2/pro: Add iMX8MN BSH SMM S2 boards
Ariel D'Alessandro [Tue, 12 Apr 2022 13:31:38 +0000 (10:31 -0300)]
bsh: imx8mn-smm-s2/pro: Add iMX8MN BSH SMM S2 boards

Introduce BSH SystemMaster (SMM) S2 board family, which consists of:
iMX8MN SMM S2 and iMX8MN SMM S2 PRO boards.

Add support for iMX8MN BSH SMM S2 board:

- 256 MiB DDR3 RAM
- 512MiB Nand
- USBOTG1 peripheral - fastboot.
- 100Mbit Ethernet

Add support for iMX8MN BSH SMM S2 PRO board:

- 512 MiB DDR3 RAM
- 8 GiB eMMC
- USBOTG1 peripheral - fastboot.
- 100Mbit Ethernet

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agonet: phy: nxp-tja11xx: Add NXP TJA11xx PHY driver
Michael Trimarchi [Tue, 12 Apr 2022 13:31:37 +0000 (10:31 -0300)]
net: phy: nxp-tja11xx: Add NXP TJA11xx PHY driver

Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special
BroadRReach 100BaseT1 PHYs used in automotive.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agonet: phy: Add phy_modify() accessor
Ariel D'Alessandro [Tue, 12 Apr 2022 13:31:36 +0000 (10:31 -0300)]
net: phy: Add phy_modify() accessor

Add read-modify-write unlocked accessor for accessing a PHY register.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoiopoll: Extend read_poll_timeout macro to support variable parameters
Ariel D'Alessandro [Tue, 12 Apr 2022 13:31:35 +0000 (10:31 -0300)]
iopoll: Extend read_poll_timeout macro to support variable parameters

This macro currently supports only one parameter. Based on Linux iopoll,
let's extend read_poll_timeout common API to allow multiple variable
parameters.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2 years agophy: nxp-c45-tja11xx: Rename functions to be c45 tja11xx specific
Ariel D'Alessandro [Tue, 12 Apr 2022 13:31:34 +0000 (10:31 -0300)]
phy: nxp-c45-tja11xx: Rename functions to be c45 tja11xx specific

This driver supports NXP C45 TJA11XX PHYs, but there're also other NXP
TJA11XX PHYs. Let's rename functions in this driver to be c45 variant
specific, so further drivers can be introduced adding support for NXP
TJA11XX PHYs.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
2 years agoimx8m: add init_nand_clk
Michael Trimarchi [Tue, 12 Apr 2022 13:31:33 +0000 (10:31 -0300)]
imx8m: add init_nand_clk

Add init_nand_clk to enable gpmi nand clock. Since i.MX8M not use CCF,
so we still use legacy mode to configure the clock.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 years agoimx8m: add regs used by GPMI
Michael Trimarchi [Tue, 12 Apr 2022 13:31:32 +0000 (10:31 -0300)]
imx8m: add regs used by GPMI

Add regs used by GPMI

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>