platform/kernel/u-boot.git
21 months agoTPL: TM2: f_thor: fix wrong size caused by casting s32 to u64
Seung-Woo Kim [Mon, 10 Apr 2017 11:14:02 +0000 (20:14 +0900)]
TPL: TM2: f_thor: fix wrong size caused by casting s32 to u64

Currently, in arm64 environment, thor download for a file more than
2GB size is failed because requested file size is not properly set.
It is because of assignment of a signed value to a bigger unsigned
type for the size of a file. So this patch fixes wrong size casting.
This also fixes to print debug information about the requested file
size with casted variable.

Change-Id: Id0e67035be05b0df346a8bb0ea17b5ba3e40e8f2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
21 months agopackaging: squash patches from upstream to HEAD~10
Seung-Woo Kim [Mon, 14 Nov 2016 07:05:05 +0000 (16:05 +0900)]
packaging: squash patches from upstream to HEAD~10

This patch fixes to squash patches from upstream to HEAD - 10
patches into only one patch. This can reduce too many patch files
in source package.

Change-Id: Ie7bc3ef1ca8fb4406d74f9b7dcffdcdef26b8ca5
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
21 months agousb: xhci: Limit transfer length of a single TD
Dongwoo Lee [Mon, 7 Nov 2016 05:34:15 +0000 (14:34 +0900)]
usb: xhci: Limit transfer length of a single TD

This is workaround solution for timed out error and babble error while
transfering data exceeding 0x3F01FF bytes on xhci host. Actually, this
size equals to value that the maximum number of TRBs per TD times the
maximum size of transfer buffer on TRB. Thus, huge transfer request is
splitted in order to limit the size of data in a single TD.

Even though the single I/O request is splitted into multiple requests,
the transfer speed has affected insignificantly: 22.6 --> 22.3 MiB/s.

Change-Id: I85a17910587b70807f075dd40634a0da817cea2f
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
21 months agoTPL: TM2: image: Support for displaying image when download mode has been enabled
Lukasz Majewski [Thu, 12 May 2016 11:26:52 +0000 (13:26 +0200)]
TPL: TM2: image: Support for displaying image when download mode has been enabled

This hacks relies on sboot to configure display path (decon, dsi, mic,
panel). It only decompress appended image to framebuffer at 0x67000000 and
triggers decon update.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
21 months agoTPL: TM2: f_thor: Allow to download 4GB images
Lukasz Majewski [Thu, 12 May 2016 11:25:43 +0000 (13:25 +0200)]
TPL: TM2: f_thor: Allow to download 4GB images

This commit fixes 2GB file size limit for thor downloader.

The application on host side sends the downloaded file size as 32-bit
unsigned value. But the thor implementation on U-Boot side interpreted
this as signed value. This caused an error for files with size greater
than 2GB.

This commit fixes the data types in code, which allows to send file
of size 4GB.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
[m.szyprowski: ported from tizen.org and fixed 64bit issues]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
21 months agof_thor: allow to download 4GB images
Przemyslaw Marczak [Tue, 10 Nov 2015 11:29:18 +0000 (12:29 +0100)]
f_thor: allow to download 4GB images

This commit fixes 2GB file size limit for thor downloader.

The application on host side sends the downloaded file size as 32-bit
unsigned value. But the thor implementation on U-Boot side interpreted
this as signed value. This caused an error for files with size greater
than 2GB.

This commit fixes the data types in code, which allows to send file
of size 4GB.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agothor:cmd: get the default command arguments from environment
Przemyslaw Marczak [Thu, 12 Jun 2014 08:20:59 +0000 (10:20 +0200)]
thor:cmd: get the default command arguments from environment

This change adds support to getting the default DFU cmd line
arguments from the environment.

DFU and THOR uses the same command line arguments,
so the DFU command environment setup can be used also with THOR.

Change-Id: I2e0984c909147c13191f6d6646d094c9f02c392a
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agosamsung: misc_init_r: insert call to platform_setup()
Przemyslaw Marczak [Thu, 13 Nov 2014 10:40:02 +0000 (11:40 +0100)]
samsung: misc_init_r: insert call to platform_setup()

This change adds call of platform_setup() to check or set active
platform configuration.

Another change is setup environment variable: ${platname},
from board name in set_board_info().

Change-Id: I355736bf40f8fa3697ce0b4546f7702d2e54a0f9
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agolib: tizen: add battery interactive charger screens
Przemyslaw Marczak [Mon, 24 Mar 2014 14:26:10 +0000 (15:26 +0100)]
lib: tizen: add battery interactive charger screens

New images:
- battery frame: 200x380px, 16bpp,
  batery level area in frame: 170x300px
- battery bar: 160x50px, 16bpp, grey and red,
  (for 5 bars in battery frame with 8px interelement gap)
- charge screen; charge screen clean images: 128x120px, 16bpp
- charge screen indicator; vertical and horizontal
  indicator clean images: 8x8px, 16bpp

Library functions:

For battery screen:
- draw_battery_screen()   - draw empty battery frame
- draw_battery_state()    - fill battery frame with charge bars
                            to a given percent
For charge animation:
- draw_charge_screen()    - draw a small phone connected to a cable
                            (under the battery)
- clean_charge_screen()   - cleans above screen
- draw_charge_animation() - display an animation with
                            a point running on a cable
                            (on a charge screen)

For low battery state and no charger connected:
- draw_connect_charger_animation() - draw and clean charge
                                     screen respectively

Library is ready to use gzipped images
but this commit adds only bmp images.

Changes for v2015.10-rc5:
- correct usage of removed typedef 'bmp_image_t'

Change-Id: I25a527b07b809b9105b6d4d8c29aa01e47224134
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agopackaging: Adding .spec file for u-boot project
Chanho Park [Fri, 10 Jan 2014 01:48:52 +0000 (10:48 +0900)]
packaging: Adding .spec file for u-boot project

Change-Id: I5dd90f728a9f0f951afda5634f2509cbb3eccc95
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Jacek Pielaszkiewicz <j.pielaszkie@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
21 months agolib: tizen: thor screen update
Przemyslaw Marczak [Wed, 2 Apr 2014 14:13:59 +0000 (16:13 +0200)]
lib: tizen: thor screen update

Now cable connection message is displayed on thor screen.
When cable is connected then only unneeded lcd console lines are overwritten.

Main changes:
- add new function: draw_thor_connected()
- update function draw_thor_screen()
- usb: gadget: thor:
  - move call to draw_thor_screen(),
  - add call to draw_thor_connected()

other change:
- remove draw_thor_init_screen() function

Changes for v2015.04-rc1:
- Replace <lcd.h> to <lcd_console.h>

Changes for v2015.10-rc5
- correct usage of removed typedef 'bmp_image_t'

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agousb: thor: add screen support
Inha Song [Fri, 11 Oct 2013 08:50:24 +0000 (17:50 +0900)]
usb: thor: add screen support

cmd_thordown.c:
- add libtizen header
- change error handling for thor init
- add call to draw_thor_fail_screen() on error

f_thor.c:
- thor_init(): return -EINTR on ctrl+c or if power key was pressed 3 times
- thor_rx_data(): return -EINTR when pressed ctrl+c on data receiving
- add display simple info screen before cable is not connected
- add display download screen when connection is established
- update download progress bar if data receiving

Change-Id: Ia89ef48c6c2faa5eda5dda5c5b3951e675eec03b
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agolibtizen: add download logo and download progress bar
Przemyslaw Marczak [Fri, 7 Feb 2014 14:03:41 +0000 (15:03 +0100)]
libtizen: add download logo and download progress bar

Added features:
- add screen with exit info if no cable is connected
- download logo with progress bar after after THOR init
- downlaod failure screen on error
- PIT version, U-boot version on download screen
- function for update progess bar when downloading is going on

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inha Song <ideal.song@samsung.com>
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
21 months agocommon: lcd: extend lcd api by function lcd_get_position_cursor()
Lukasz Majewski [Mon, 16 Feb 2015 16:40:25 +0000 (17:40 +0100)]
common: lcd: extend lcd api by function lcd_get_position_cursor()

Changes for v2015.04-rc1:
- Moving lcd console related code to lcd_console.c

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
21 months agogitattributes: Set binary attribute for *.gz and *.png files
Sylwester Nawrocki [Wed, 2 Dec 2020 08:36:29 +0000 (09:36 +0100)]
gitattributes: Set binary attribute for *.gz and *.png files

After commit ("1f35137 Add .gitattributes for line endings") all files
have text attribute set and we need such change to ensure content of
the *.gz and *.png files remains unmodified.

$ git check-attr -a -- *.gz *.png
*.gz: binary: set
*.gz: diff: unset
*.gz: merge: unset
*.gz: text: unset
*.gz: eol: lf
*.png: binary: set
*.png: diff: unset
*.png: merge: unset
*.png: text: unset
*.png: eol: lf

Change-Id: Ie7b1d48761c01c045bdcdae3b0ac66e64af79326
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
21 months agoPrepare v2022.10 v2022.10
Tom Rini [Mon, 3 Oct 2022 19:25:32 +0000 (15:25 -0400)]
Prepare v2022.10

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoimx8mn-ddr4-evk-u-boot: Fix broken boot
Fabio Estevam [Mon, 3 Oct 2022 14:02:03 +0000 (11:02 -0300)]
imx8mn-ddr4-evk-u-boot: Fix broken boot

When the imx8mn.dtsi file was pulled in from Linux, the UARTs
were moved into an spba sub-node which wasn't being included
in the SPL device tree.  This meant the references to the UART
weren't being handled properly and when booting the system would
constantly reboot.  Fix this by adding the spba node to the spl
device tree to restore normal booting.

Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot
board.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")
Signed-off-by: Fabio Estevam <festevam@denx.de>
21 months agoimx8mn-venice-u-boot: Fix broken boot
Fabio Estevam [Mon, 3 Oct 2022 14:01:15 +0000 (11:01 -0300)]
imx8mn-venice-u-boot: Fix broken boot

When the imx8mn.dtsi file was pulled in from Linux, the UARTs
were moved into an spba sub-node which wasn't being included
in the SPL device tree.  This meant the references to the UART
weren't being handled properly and when booting the system would
constantly reboot.  Fix this by adding the spba node to the spl
device tree to restore normal booting.

Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot
board.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")
Signed-off-by: Fabio Estevam <festevam@denx.de>
21 months agoMerge tag 'efi-2022-10-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 30 Sep 2022 12:30:38 +0000 (08:30 -0400)]
Merge tag 'efi-2022-10-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-10-rc6

Documentation:

* doc: improve description of autostart

UEFI:

* prefix test functions with efi_st_ in the LoadImage unit test
* avoid a warning message in efi_initrd_deregister()

21 months agoefi_loader: fix efi_initrd_deregister()
Heinrich Schuchardt [Thu, 29 Sep 2022 23:55:02 +0000 (01:55 +0200)]
efi_loader: fix efi_initrd_deregister()

Don't try to delete a non-existent handle.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
21 months agoefi_selftest: prefix test functions with efi_st_
Heinrich Schuchardt [Thu, 22 Sep 2022 13:16:30 +0000 (15:16 +0200)]
efi_selftest: prefix test functions with efi_st_

An upcoming patch set creates a global function flush(). To make debugging
easier we should not use the same name for a static function.

Rename static functions in the LoadImage() unit test adding an efi_st_
prefix.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
21 months agodoc: improve description of autostart
Heinrich Schuchardt [Sat, 10 Sep 2022 07:16:37 +0000 (09:16 +0200)]
doc: improve description of autostart

Complete the list of commands influenced by the autostart environment
variable.

Make it clearer what values qualifies at 'yes'.

Eventually the list of environment variables is to be alphabetically
sorted. Move autostart up.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoMerge branch '2022-09-29-assorted-fixes'
Tom Rini [Thu, 29 Sep 2022 20:06:19 +0000 (16:06 -0400)]
Merge branch '2022-09-29-assorted-fixes'

- Assorted fixes we want to include before the release.

21 months agoboard_r: Relocate OF_EMBED if NEEDS_MANUAL_RELOC only
Pierre-Clément Tosi [Fri, 9 Sep 2022 20:16:18 +0000 (21:16 +0100)]
board_r: Relocate OF_EMBED if NEEDS_MANUAL_RELOC only

When the embedded device tree is pointed to by the __dtb_dt_*begin
symbols, it seems to be covered by the early relocation code and doesn't
need to be manually patched.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
21 months agopci: Remove duplicate PCI_REGION_IO / "io" line
Pali Rohár [Thu, 15 Sep 2022 13:54:45 +0000 (15:54 +0200)]
pci: Remove duplicate PCI_REGION_IO / "io" line

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agotools: env: Fix missing closedir in ubi_get_volnum_by_name
Miaoqian Lin [Mon, 19 Sep 2022 04:28:09 +0000 (08:28 +0400)]
tools: env: Fix missing closedir in ubi_get_volnum_by_name

The function calls opendir() but missing the corresponding
closedir() before exit the function.
Add missing closedir() to fix it.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
21 months agoboard: ti: common: board_detect: Fix EEPROM read quirk for AM6 style data
Nishanth Menon [Wed, 21 Sep 2022 13:38:42 +0000 (08:38 -0500)]
board: ti: common: board_detect: Fix EEPROM read quirk for AM6 style data

The situation is similar to commit bf6376642fe8 ("board: ti: common:
board_detect: Fix EEPROM read quirk"). This is seen on a variant of
eeproms seen on some BeagleBone-AI64 which now has a mix of both 1 byte
addressing and 2 byte addressing eeproms.

Unlike the am335x (ti_i2c_eeprom_am_get) and dra7
(ti_i2c_eeprom_dra7_get) which use constant data structure which allows
us to do a complete read of the data, the
am6(ti_i2c_eeprom_am6_get) eeprom parse operation is dynamic.

This removes the option of being able to read the complete eeprom data
in one single shot.

Fortunately, on the I2C bus, we do see the following behavior: In 1
byte mode, if we attempt to read the first header data yet again, the
misbehaving 2 byte addressing device acts in constant addressing mode
which results in the header not matching up and follow on attempt at 2
byte addressing scheme grabs the correct data.

This costs us an extra ~3 milliseconds, which is a minor penalty
compared to the consistent image support we need to have.

Reported-by: Jason Kridner <jkridner@beagleboard.org>
Fixes: a58147c2dbbf ("board: ti: common: board_detect: Do 1byte address checks first.")
Signed-off-by: Nishanth Menon <nm@ti.com>
21 months agovexpress64: also consider DTB pointer in x1
Andre Przywara [Wed, 21 Sep 2022 17:09:46 +0000 (18:09 +0100)]
vexpress64: also consider DTB pointer in x1

Commit c0fce929564f("vexpress64: fvp: enable OF_CONTROL") added code to
consider a potential DTB address being passed in the x0 register, or
revert to the built-in DTB otherwise.
The former case was used when using the boot-wrapper, to which we sell
U-Boot as a Linux kernel. The latter was meant for TF-A, for which we
couldn't find an easy way to use the DTB it uses itself. We have some
quirk to filter for a valid DTB, as TF-A happens to pass a pointer to
some special devicetree blob in x0 as well.

Now the TF-A case is broken, when enabling proper emulation of secure
memory (-C bp.secure_memory=1). TF-A carves out some memory at the top
of the first DRAM bank for its own purposes, and configures the
TrustZone DRAM controller to make this region secure-only. U-Boot will
then hang when it tries to relocate itself exactly to the end of DRAM.
TF-A announces this by carving out that region of the /memory node, in
the DT it passes on to BL33 in x1, but we miss that so far.

Instead of repeating this carveout in our DT copy, let's try to look for
a DTB at the address x1 points to as well. This will let U-Boot pick up
the DTB provided by TF-A, which has the correct carveout in place,
avoiding the hang.
While we are at it, make the detection more robust: the length test (is
the DT larger than 256 bytes?) is too fragile, in fact the TF-A port for
a new FVP model already exceeds this. So we test x1 first, consider 0
an invalid address, and also require a /memory node to detect a valid DTB.

And for the records:
Some asking around revealed what is really going on with TF-A and that
ominous DTB pointer in x0: TF-A expects EDK-2 as its non-secure payload
(BL33), and there apparently was some long-standing ad-hoc boot protocol
defined just between the two: x0 would carry the MPIDR register value of
the boot CPU, and the hardware DTB address would be stored in x1.
Now the MPIDR of CPU 0 is typically 0, plus bit 31 set, which is defined
as RES1 in the ARMv7 and ARMv8 architectures. This gives 0x80000000,
which is the same value as the address of the beginning of DRAM (2GB).
And coincidentally TF-A put some DTB structure exactly there, for its
own purposes (passing it between stages). So U-Boot was trying to use
this DTB, which requires the quirk to check for its validity.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Peter Hoyes <peter.hoyes@arm.com>
21 months agofs: btrfs: remove the usage of undeclared fs_mutex variable
Pankaj Raghav [Wed, 28 Sep 2022 15:23:01 +0000 (17:23 +0200)]
fs: btrfs: remove the usage of undeclared fs_mutex variable

This line probably got in by mistake as there is no fs_mutex member in
the btrfs_fs_info struct.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
21 months agoconfigs: rockchip: Drop TPL_MAX_SIZE definition
Michael Trimarchi [Sat, 24 Sep 2022 13:36:24 +0000 (15:36 +0200)]
configs: rockchip: Drop TPL_MAX_SIZE definition

The max size is defined at architectural level. On the same commit
I have checked mostly all the other architecture and look like they are

Fixes: commit ca8a329a1b7f ("Convert CONFIG_SPL_PAD_TO et al to Kconfig")
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
21 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Tue, 27 Sep 2022 15:05:37 +0000 (11:05 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog

- autoboot: make sure watchdog device(s) are handled with keyed
  autoboot (Rasmus)
- gpio_wdt: use __udelay() to avoid recursion (Rasmus)
- watchdog: max6370: use __udelay() to avoid recursion (Pali)

21 months agoautoboot: make sure watchdog device(s) are handled with keyed autoboot
Rasmus Villemoes [Tue, 27 Sep 2022 09:54:02 +0000 (11:54 +0200)]
autoboot: make sure watchdog device(s) are handled with keyed autoboot

Currently, AUTOBOOT_KEYED and its variant AUTOBOOT_ENCRYPTION are
broken when one has an external always-running watchdog device with a
timeout shorter than the configured boot delay (in my case, I have a
gpio-wdt one with a timeout of 1 second), because we fail to call
WATCHDOG_RESET() in the loops where we wait for the bootdelay to
elapse.

This is done implicitly in the !AUTOBOOT_KEYED case,
i.e. abortboot_single_key(), because that loop contains a
udelay(10000), and udelay() does a WATCHDOG_RESET().

To fix this, simply add similar udelay() calls in the other loops.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agowatchdog: max6370: use __udelay() to avoid recursion
Pali Rohár [Tue, 27 Sep 2022 10:19:19 +0000 (12:19 +0200)]
watchdog: max6370: use __udelay() to avoid recursion

The udelay() function in lib/time.c contains a WATCHDOG_RESET()
call. So use __udelay() in max6370_wdt.c to prevent recursion.

Fixes: 0a095fc53b15 ("watchdog: Add MAX6370 watchdog timer driver")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agowatchdog: gpio_wdt: use __udelay() to avoid recursion
Rasmus Villemoes [Tue, 27 Sep 2022 07:45:44 +0000 (09:45 +0200)]
watchdog: gpio_wdt: use __udelay() to avoid recursion

The udelay() function in lib/time.c contains a WATCHDOG_RESET()
call. The only reason this doesn't lead to a catastrophic infinite
recursion is due to the rate-limiting in wdt-uclass.c:

if (time_after_eq(now, priv->next_reset)) {
priv->next_reset = now + priv->reset_period;
wdt_reset(dev);
}

But this would fall apart if ->next_reset was updated after calling the
device's reset method.

This is needlessly fragile, and it's easy enough to avoid that
recursion in the first place by just using __udelay() directly.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 26 Sep 2022 12:30:17 +0000 (08:30 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- gpio: turris_omnia_mcu: Fix registering gpios (Pali)

21 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Mon, 26 Sep 2022 12:29:42 +0000 (08:29 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- DWC2 gadget EP fix, nuvoton NPCM7xx ehci/ohci driver

21 months agogpio: turris_omnia_mcu: Fix registering gpios
Pali Rohár [Thu, 22 Sep 2022 11:25:13 +0000 (13:25 +0200)]
gpio: turris_omnia_mcu: Fix registering gpios

Currently all GPIOs supported by CMD_EXT_CONTROL/CMD_GET_EXT_CONTROL_STATUS
commands (last 16 GPIOs) are available only when FEAT_PERIPH_MCU feature
bit is set. So do not register these GPIOs by U-Boot driver when this
feature bit is not set, so U-Boot 'gpio' command would see only GPIOs which
really exists.

Fixes: 5e4d24ccc115 ("gpio: Add Turris Omnia MCU driver")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoFix out of bound access of ep array.
Alison Huffman [Thu, 22 Sep 2022 04:01:32 +0000 (04:01 +0000)]
Fix out of bound access of ep array.

When processing USB_REQ_CLEAR_FEATURE, USB_REQ_SET_FEATURE, and
USB_REQ_GET_STATUS packets in dwc2_ep0_setup an out of bounds access
can occur. This is caused by the wIndex field of the usb control packet
being used as an index into an array whose size is DWC2_MAX_ENDPOINTS (4).

Signed-off-by: Alison Huffman <alisn@google.com>
21 months agousb: host: nuvoton: Add nuvoton NPCM7xx ehci/ohci driver
Jim Liu [Tue, 21 Jun 2022 09:09:02 +0000 (17:09 +0800)]
usb: host: nuvoton: Add nuvoton NPCM7xx ehci/ohci driver

Add nuvoton BMC NPCM750 ehci/ohci driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
21 months agoMerge tag 'u-boot-imx-20220922' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Thu, 22 Sep 2022 14:29:29 +0000 (10:29 -0400)]
Merge tag 'u-boot-imx-20220922' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220922
-------------------

Fixes for 2022.10

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

21 months agokontron-sl-mx8mm: Let CONFIG_SPL_FIT_IMAGE_TINY be selected
Fabio Estevam [Wed, 24 Aug 2022 01:09:34 +0000 (22:09 -0300)]
kontron-sl-mx8mm: Let CONFIG_SPL_FIT_IMAGE_TINY be selected

When CONFIG_IMX_HAB is selected the 'hab_status' command reports several
error events, indicating that the BootROM failed to authenticate the SPL.

After inspecting the content of the memory location that corresponds to
the DTB load address, the content did not match with the DTB binary,
showing that some kind of memory corruption/overlap occurred.

Letting the CONFIG_SPL_FIT_IMAGE_TINY option to be selected causes the
DTB to be properly placed into RAM and no more overlap occurs.

With this change, the 'hab_status' command returns no more error events,
which indicates that the BootROM succeeded to authenticate the SPL.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
21 months agomx8m: csf.sh: Fix the calculation of fit_block_size
Fabio Estevam [Sat, 13 Aug 2022 12:03:10 +0000 (09:03 -0300)]
mx8m: csf.sh: Fix the calculation of fit_block_size

When running the script to sign SPL/U-Boot on a kontron-sl-mx8mm board,
the fit_block_size was calculated as 0x1000 instead of 0x1020.

Add an extra parenthesis pair to fix it.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
21 months agoMerge tag 'dm-pull-21sep22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Wed, 21 Sep 2022 12:22:11 +0000 (08:22 -0400)]
Merge tag 'dm-pull-21sep22' of https://source.denx.de/u-boot/custodians/u-boot-dm

Fix futility bintool to run on newer distros
Apply a lost patch

21 months agobinman: Get futility by building it
Simon Glass [Sat, 17 Sep 2022 15:01:19 +0000 (09:01 -0600)]
binman: Get futility by building it

A binary download is not great, since it depends on libraries being
present in the system. Build futility from source instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
21 months agocmd: fdt: Add support for reading stringlist property values
Marek Vasut [Fri, 8 Jul 2022 21:50:43 +0000 (23:50 +0200)]
cmd: fdt: Add support for reading stringlist property values

The fdt command currently handles stringlists as strings in 'fdt get value'
subcommand. Since strings in FDT stringlists are separated by '\0', only
the first value gets inserted into the environment variable passed to the
'fdt get value' command.

Example, consider the following DT snippet:

/ { compatible = "foo", "bar" };

The following command only reports the first string in stringlist:
=> fdt get value var / compatible ; print var
foo

It is not possible to assign list of null-terminated strings into U-Boot
environment variable. Add optional 'index' parameter to the subcommand
'fdt get value <var> <path> <prop> [<index>]' which lets user specify which
string within the stringlist should be assigned into the 'var' variable.
The default value of 'index' is 0 in case it is not present. This way the
'fdt' command API does not change and existing scripts are not broken.

The following command now reports the Nth string in stringlist, counting
from zero:
=> fdt get value var / compatible 1 ; print var
bar

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
21 months agoARM: imx: Deduplicate i.MX8M SNVS LPGPR unlock
Marek Vasut [Mon, 19 Sep 2022 19:37:07 +0000 (21:37 +0200)]
ARM: imx: Deduplicate i.MX8M SNVS LPGPR unlock

Pull this LPGPR unlock into common code, since it is used in multiple
systems already.

Signed-off-by: Marek Vasut <marex@denx.de>
21 months agoarm: dts: imx8mm-venice-gw7901: add dsa phy handles to u-boot dtsi
Tim Harvey [Fri, 9 Sep 2022 21:42:38 +0000 (14:42 -0700)]
arm: dts: imx8mm-venice-gw7901: add dsa phy handles to u-boot dtsi

The upstream Linux DSA drivers do not require phy-handle nodes in
the DSA ports yet the U-Boot DSA drivers do. Add a phy-handle and
the mdio nodes to the u-boot.dtsi file so that future dts file
syncrhonization between Linux and U-Boot don't break networking.

Fixes: 24a7a3c1c042 ("imx8mm: synchronise device tree with linux")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
21 months agoarm: dts: imx8mp-venice-gw74xx: add dsa phy handles to u-boot dtsi
Tim Harvey [Fri, 9 Sep 2022 21:42:11 +0000 (14:42 -0700)]
arm: dts: imx8mp-venice-gw74xx: add dsa phy handles to u-boot dtsi

The upstream Linux DSA drivers do not require phy-handle nodes in
the DSA ports yet the U-Boot DSA drivers do. Add a phy-handle and
the mdio nodes to the u-boot.dtsi file so that future dts file
syncrhonization between Linux and U-Boot don't break networking.

Fixes: e0caa84ca685 ("imx8mp: synchronise device tree with linux")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
22 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Mon, 19 Sep 2022 20:49:18 +0000 (16:49 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- Fix a typo and remove an unused driver

22 months agoPrepare v2022.10-rc5
Tom Rini [Mon, 19 Sep 2022 16:17:04 +0000 (12:17 -0400)]
Prepare v2022.10-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
22 months agousb: gadget: designware-udc: Drop the driver
Marek Vasut [Tue, 23 Aug 2022 17:06:50 +0000 (19:06 +0200)]
usb: gadget: designware-udc: Drop the driver

This driver is not used by any system and is long unmaintained, drop it.
There is a DWC2 OTG driver which is maintained, see CONFIG_USB_GADGET_DWC2_OTG .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
22 months agousb: Kconfig: Fix typo in SPL_DM_USB text
Fabio Estevam [Sat, 17 Sep 2022 23:28:29 +0000 (20:28 -0300)]
usb: Kconfig: Fix typo in SPL_DM_USB text

Change a typo in "USB host mode".

Signed-off-by: Fabio Estevam <festevam@denx.de>
22 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 19 Sep 2022 15:22:26 +0000 (11:22 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
22 months agoimx8m*_venice_defconfig: fix default bootcmd
Tim Harvey [Thu, 8 Sep 2022 16:11:13 +0000 (09:11 -0700)]
imx8m*_venice_defconfig: fix default bootcmd

commit 970bf8603b87 ("Convert CONFIG_USE_BOOTCOMMAND et al to Kconfig")
had an unintended side effect of resulting in a bootcmd env var change
for boards like venice that did not have CONFIG_USE_BOOTCOMMAND defined
and relied on it being defaulted in include/config_distro_bootcmd.h.
Following that patch it instead got defaulted in tools/env/fw_env_private.h

Fix this by enabling CONFIG_USE_BOOTCOMMAND for venice.

Fixes: commit 970bf8603b87 ("Convert CONFIG_USE_BOOTCOMMAND et al to Kconfig")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
22 months agoMerge tag 'u-boot-imx-20220919' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 19 Sep 2022 12:38:32 +0000 (08:38 -0400)]
Merge tag 'u-boot-imx-20220919' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220919
-------------------

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

- Fix imx8mn-beacon-kit-u-boot
- Merged Purism
- imxrt1170 (already merged in u-boot-imx)
- Fixes in crypto FSL
- Toradex : fixes Verdin
- Serial Driver: fixes when not used as console
- DH Boards : fixes + USB
- Fix CONFIG_SYS_MALLOC_F_LEN (Kconfig)
- Add imx6ulz_smm_m2

22 months agopowerpc: mpc85xx: Fix incorrect application of patch
Marek Behún [Mon, 19 Sep 2022 09:32:08 +0000 (11:32 +0200)]
powerpc: mpc85xx: Fix incorrect application of patch

I messed up application of patch 5a428e751044 ("mmc: fsl_esdhc_spl: Add
support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS"). I took it from
a work-in-progress branch where I changed usage of
  CONFIG_SDCARD to CONFIG_SD_BOOT
and refactored
  SYS_MPC85XX_NO_RESETVEC
mess.

But these changes aren't in master yet. Fix the wrong usage of these
macros.

Fixes: 5a428e751044 ("mmc: fsl_esdhc_spl: Add support for builds without
CONFIG_SYS_MMC_U_BOOT_OFFS")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Pali Rohár <pali@kernel.org>
22 months agobsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2 boards
Michael Trimarchi [Sun, 18 Sep 2022 15:09:53 +0000 (17:09 +0200)]
bsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2 boards

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

Add support for imx6ulz BSH SMM M2 board:

- 128 MiB DDR3 RAM
- 256MiB Nand
- USBOTG1 peripheral - fastboot.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoARM: imx: Update Data Modul i.MX8M Mini eDM SBC DRAM timing
Marek Vasut [Tue, 30 Aug 2022 12:34:26 +0000 (14:34 +0200)]
ARM: imx: Update Data Modul i.MX8M Mini eDM SBC DRAM timing

Adjust the DRAM timing settings for this board per ones provided
by hardware department. The change is applied to the LPDDR4 MR11
register CA ODT configuration, from RZQ/6 to RZQ/3, which fixes
stability issues on subset of boards. The DDR PHY PIE block has
been updated accordingly.

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>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoARM: imx: Enable SPL GPIO hog on i.MX8M Plus DHCOM
Marek Vasut [Fri, 26 Aug 2022 21:16:27 +0000 (23:16 +0200)]
ARM: imx: Enable SPL GPIO hog on i.MX8M Plus DHCOM

Enable GPIO hog support in SPL to match the GPIO hog support in U-Boot proper.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoverdin-imx8mm: various config additions and improvements
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:03 +0000 (15:06 +0200)]
verdin-imx8mm: various config additions and improvements

- integrate bootcount using SNVS_LP general purpose register LPGPR0
- enable link-time optimisation
- explicitly set a boot delay of one second
- enable CRC32 and MD5
- enable command for low-level access to data in a partition
- enable time commands
- enable PMIC commands
- improve ETHPRIME configuration
- enable eMMC HS400 functionality
- enable fixed PHY and MDIO driver model
- remove stale PFUZE100 PMIC driver
- enable thermal management unit driver
- enable more USB host functionality
- enable hexdump

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
22 months agoKconfig: enlarge CONFIG_SYS_MALLOC_F_LEN
Peng Fan [Thu, 15 Sep 2022 01:38:18 +0000 (09:38 +0800)]
Kconfig: enlarge CONFIG_SYS_MALLOC_F_LEN

"alloc space exhausted" happens in very early stage, which could be seen
with DEBUG_UART options enabled and leeds to an non-functional board.

kontron_pitx_imx8m:
CONFIG_DEBUG_UART_BASE=0x30880000   # for serial3
CONFIG_DEBUG_UART_CLOCK=24000000

imx8mqevk:
CONFIG_DEBUG_UART_BASE=0x30860000      # for uart1
CONFIG_DEBUG_UART_CLOCK=24000000

It is because CONFIG_SYS_MALLOC_F_LEN is too small and still leave
CONFIG_SPL_SYS_MALLOC_F_LEN as 0x2000.

Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com>
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoserial: mxc: have putc use the TXFIFO
Johannes Schneider [Tue, 6 Sep 2022 12:15:04 +0000 (14:15 +0200)]
serial: mxc: have putc use the TXFIFO

only waiting for TXEMPTY leads to corrupted messages going over the
wire - which is fixed by making use of the FIFO

this change is following the linux kernel uart driver
(drivers/tty/serial/imx.c), which also checks UTS_TXFULL
instead of UTS_TXEMPTY

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoserial: mxc: enable the RX pipeline
Johannes Schneider [Tue, 6 Sep 2022 12:15:03 +0000 (14:15 +0200)]
serial: mxc: enable the RX pipeline

on imx8(mm) the RXDMUXSEL needs to be set for data going over the wire
(as observable on a connected 'scope) to actually make it into the
RXFIFO

the reference manual is not overly clear about this, and only
mentiones that "UCR3_RXDMUXSEL should always be set." - and since the
CR3 register reverts to its reset values after setting the baudrate,
setting this bit is done during '_mxc_serial_setbgr'

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoMAINTAINERS: imx: Add an entry for the serial driver
Fabio Estevam [Mon, 5 Sep 2022 10:57:00 +0000 (07:57 -0300)]
MAINTAINERS: imx: Add an entry for the serial driver

Currently, when running ./scripts/get_maintainer.pl on serial_mxc.c
no i.MX maintainer is returned.

Fix it by adding an entry for this driver.

Reported-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
22 months agoboard: purism: add the Purism Librem5 phone
Angus Ainslie [Thu, 25 Aug 2022 13:46:02 +0000 (06:46 -0700)]
board: purism: add the Purism Librem5 phone

Initial commit of Librem5 u-boot and SPL

Signed-off-by: Angus Ainslie <angus@akkea.ca>
Co-developed-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoverdin-imx8mp: do not save environment when it's nowhere
Denys Drozdov [Tue, 23 Aug 2022 11:05:49 +0000 (13:05 +0200)]
verdin-imx8mp: do not save environment when it's nowhere

This code part is broken, remove it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
22 months agoverdin-imx8mm: do not save environment when it's nowhere
Denys Drozdov [Tue, 23 Aug 2022 11:05:48 +0000 (13:05 +0200)]
verdin-imx8mm: do not save environment when it's nowhere

This code part is broken, remove it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
22 months agoverdin-imx8mm: improve and extend boot devices
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:02 +0000 (15:06 +0200)]
verdin-imx8mm: improve and extend boot devices

- Annotate boot devices available in spl_board_boot_device().
- Drop SD3_BOOT/MMC3_BOOT not available for boot on Verdin iMX8M Mini.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
22 months agoverdin-imx8mm: prepare for optional job ring driver model
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:01 +0000 (15:06 +0200)]
verdin-imx8mm: prepare for optional job ring driver model

Prepare for optional job ring driver model. Sec may be initialized based
on the job ring information processed from the device tree.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
22 months agoverdin-imx8mm: verdin-imx8mp: update env memory layout
Marcel Ziswiler [Mon, 22 Aug 2022 13:06:00 +0000 (15:06 +0200)]
verdin-imx8mm: verdin-imx8mp: update env memory layout

Update the distro config env memory layout for the Verdin iMX8M Mini and
Verdin iMX8M Plus:

- loadaddr=0x48280000 allows for 128.5MB area for uncompressing (ie FIT
  images, kernel_comp_addr_r, kernel_comp_size)
- fdt_addr_r = loadaddr + 127.5MB : allows for 127.5MB kernel
- scriptaddr = fdt_addr_r + 512KB : allows for 512KB fdt
- ramdisk_addr_r = scriptaddr + 512KB : allows for 512KB script

Memory layout taken from commit fd5c7173ade4
("imx8m{m,n}_venice: update env memory layout") but moved loadaddr by an
additional 0.5MB to avoid "Moving Image from 0x48200000 to 0x48280000"
during booti plus actually defining kernel_comp_size to make booti work.

Note that for our regular BSP Layers and Reference Images for Yocto
Project an updated distro boot script is required (see
meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot).

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
22 months agoARM: imx: Update DDR frequency on i.MX8M Plus DHCOM
Marek Vasut [Fri, 19 Aug 2022 11:02:53 +0000 (13:02 +0200)]
ARM: imx: Update DDR frequency on i.MX8M Plus DHCOM

Commit 99c7cc58e12 ("ddr: imx: Add i.MX9 DDR controller driver")
contains an inobvious side-effect which renders all systems using
DRAM controller at 3732 MT/s unbootable. The change is located in
ddrphy_init_set_dfi_clk(), where the switch case statement entry
3732 changed to entry 3733, so any board with DDR calibration data
for 3732 MT/s operations needs to be updated to 3733 MT/s to match
the change.

Since there is currently only one such board, update the board instead
of handling both 3732 and 3733 options in the driver. It is likely the
NXP MX8MP RPA update will follow and use the later value too.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
22 months agoimx8m: ddrphy_utils: Remove unused file
Marek Vasut [Fri, 19 Aug 2022 11:02:23 +0000 (13:02 +0200)]
imx8m: ddrphy_utils: Remove unused file

The ddrphy_utils.c is now deduplicated in drivers/ddr/imx/phy/ddrphy_utils.c ,
this drivers/ddr/imx/imx8m/ddrphy_utils.c is a remnant from when the
deduplication was implemented and was not removed. Remove it as it is
unused.

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>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
22 months agoARM: imx: dh-imx6: Increase SF erase area for u-boot update
Marek Vasut [Fri, 12 Aug 2022 20:59:10 +0000 (22:59 +0200)]
ARM: imx: dh-imx6: Increase SF erase area for u-boot update

Erase the entire U-Boot area during U-Boot update instead of just
a subset of it. This way, in case u-boot-with-spl.imx grows, the
sf write won't write over non-erased part of the SPI NOR.

Signed-off-by: Marek Vasut <marex@denx.de>
22 months agoARM: dts: imx: Fix I2C5 GPIO assignment on i.MX8M Plus DHCOM
Marek Vasut [Fri, 12 Aug 2022 20:41:55 +0000 (22:41 +0200)]
ARM: dts: imx: Fix I2C5 GPIO assignment on i.MX8M Plus DHCOM

Fix copy-paste error of the I2C5 bus recovery GPIO assignment,
the I2C5 GPIOs are on gpio3 instead of gpio5.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoARM: dts: imx: Adjust ECSPI1 pinmux on i.MX8M Plus DHCOM
Marek Vasut [Fri, 12 Aug 2022 20:41:54 +0000 (22:41 +0200)]
ARM: dts: imx: Adjust ECSPI1 pinmux on i.MX8M Plus DHCOM

The ECSPI1 is on I2C1/I2C2 pins of the SoC, update the pinmux accordingly.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoARM: dts: imx: Rename imx8mp-dhcom{-pdk2,}-boot.dtsi
Marek Vasut [Fri, 12 Aug 2022 20:41:53 +0000 (22:41 +0200)]
ARM: dts: imx: Rename imx8mp-dhcom{-pdk2,}-boot.dtsi

Rename imx8mp-dhcom-pdk2-u-boot.dtsi to imx8mp-dhcom-u-boot.dtsi, since
this file is shared by PDK2, PicoITX and DRC02. No functional change.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoARM: dts: imx: Add SoM compatible to i.MX8M Plus DHCOM PDK2
Marek Vasut [Fri, 12 Aug 2022 20:41:52 +0000 (22:41 +0200)]
ARM: dts: imx: Add SoM compatible to i.MX8M Plus DHCOM PDK2

Add SoM compatible string into i.MX8MP DHCOM PDK2 compatible strings.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoARM: dts: imx: Drop Atheros PHY header from i.MX8M Plus DHCOM PDK2
Marek Vasut [Fri, 12 Aug 2022 20:41:51 +0000 (22:41 +0200)]
ARM: dts: imx: Drop Atheros PHY header from i.MX8M Plus DHCOM PDK2

This PHY is not used on PDK2, the header was added due to copy-paste
error, drop it.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoARM: dts: imx: Add HW variant details to i.MX8M Plus DHCOM PDK2
Marek Vasut [Fri, 12 Aug 2022 20:41:50 +0000 (22:41 +0200)]
ARM: dts: imx: Add HW variant details to i.MX8M Plus DHCOM PDK2

Add information about which exact SoM variant is used on which PDK2 variant.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoARM: imx: Enable USB ethernet on i.MX8M Plus DHCOM
Marek Vasut [Fri, 12 Aug 2022 20:41:49 +0000 (22:41 +0200)]
ARM: imx: Enable USB ethernet on i.MX8M Plus DHCOM

Enable both USB CDC ethernet and USB host ethernet on i.MX8M Plus DHCOM.
This is useful for bringing up systems without ethernet plug, but with
either USB host or gadget plug.

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>
Cc: uboot-imx <uboot-imx@nxp.com>
22 months agoboard: gateworks: venice: add fixup for GW73xx-C+
Tim Harvey [Thu, 11 Aug 2022 18:55:38 +0000 (11:55 -0700)]
board: gateworks: venice: add fixup for GW73xx-C+

The GW73xx-C revision and onward replaced the 5-port PCIe switch with a
4-port (dropping PCIe to one of the miniPCIe sockets) due to part
availability. This moved the PCI bus of the GbE eth1 device. Use a fixup
to adjust the dt accordingly so that local-mac-address assigned from dt
works on new revision boards.

While we are at it, rename 'blob' to 'fdt' for clarity.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
22 months agoarm: dts: imx8mn-beacon-kit-u-boot: Fix broken booting
Adam Ford [Sun, 31 Jul 2022 17:16:10 +0000 (12:16 -0500)]
arm: dts: imx8mn-beacon-kit-u-boot: Fix broken booting

When the imx8mm.dtsi file was pulled in from Linux, the UARTs
were moved into an spba sub-node which wasn't being included
in the SPL device tree.  This meant the references to the UART
weren't being handled properly and when booting the system would
constantly reboot.  Fix this by adding the spba node to the spl
device tree to restore normal booting.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")
Signed-off-by: Adam Ford <aford173@gmail.com>
22 months agocrypto/fsl: fsl_hash: Fix crash in flush dcache
Gaurav Jain [Fri, 29 Jul 2022 10:02:23 +0000 (15:32 +0530)]
crypto/fsl: fsl_hash: Fix crash in flush dcache

wrong end address passed to flush_dcache_range.
modified the flush_dache logic for scatter list elements.

Fixes: 1919f58a8f (crypto/fsl: fsl_hash: Fix dcache issue in caam_hash_finish)
Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
22 months agoimx: romapi: fix spurious ampersand in address print
Marcel Ziswiler [Wed, 20 Jul 2022 07:27:55 +0000 (09:27 +0200)]
imx: romapi: fix spurious ampersand in address print

Fix spurious ampersand in address print e.g.

Find img info 0x&480331a0, size 855

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>"
22 months agodoc: imx: habv4: Add Secure Boot guide for i.MX8M SPL targets
Marek Vasut [Tue, 12 Jul 2022 15:04:52 +0000 (17:04 +0200)]
doc: imx: habv4: Add Secure Boot guide for i.MX8M SPL targets

Add HABv4 documentation extension for SPL targets covering the
following topics:

- How to sign an securely boot an flash.bin container image.
- How to extend the root of trust for additional boot images.
- Add SPL and fitImage CSF examples.
- Add signature generation script example.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Ye Li <ye.li@nxp.com>
22 months agoARM: imxrt1170_defconfig: Add i.MXRT1170 defconfig
Jesse Taube [Tue, 26 Jul 2022 05:43:46 +0000 (01:43 -0400)]
ARM: imxrt1170_defconfig: Add i.MXRT1170 defconfig

Add a base defconfig for the i.MXRT1170

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoRAM: Add changes for i.MXRT11xx series
Jesse Taube [Tue, 26 Jul 2022 05:43:44 +0000 (01:43 -0400)]
RAM: Add changes for i.MXRT11xx series

The i.MXRT11 series has different offsets for IOCR_MUX, it also can
address 64MiB of SDRAM so add a macro for that.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoclk: imx: Add initial support for i.MXRT1170 clock driver
Jesse Taube [Tue, 26 Jul 2022 05:43:43 +0000 (01:43 -0400)]
clk: imx: Add initial support for i.MXRT1170 clock driver

Add clock driver support for i.MXRT1170.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoclk: imx: Add i.MXRT11xx pllv3 variant
Jesse Taube [Tue, 26 Jul 2022 05:43:42 +0000 (01:43 -0400)]
clk: imx: Add i.MXRT11xx pllv3 variant

The i.MXRT11 series has two new pll types but are variants of existing.
This patch adds the ability to read one of the pll types' frequency
as it can't be changed unlike the generic pll it also has the
division factors swapped.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agodt-bindings: imx: Add clock binding for i.MXRT1170
Jesse Taube [Tue, 26 Jul 2022 05:43:41 +0000 (01:43 -0400)]
dt-bindings: imx: Add clock binding for i.MXRT1170

Add the clock binding doc for i.MXRT1170.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoARM: dts: imx: add i.MXRT1170-EVK support
Jesse Taube [Tue, 26 Jul 2022 05:43:45 +0000 (01:43 -0400)]
ARM: dts: imx: add i.MXRT1170-EVK support

The NXP i.MXRT1170 Evaluation Kit (EVK) provides a platform for rapid
evaluation of the i.MXRT, which features NXP's implementation of the Arm
Cortex-M7 and Cortex-M4 core.

The EVK provides 64 MB SDRAM, Micro SD card socket,
USB 2.0 OTG.

This patch aims to support the preliminary booting up features
as follows:
GPIO
LPUART
SD/MMC
SDRAM

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoARM: dts: imxrt11170-pinfunc: Add pinctrl binding header
Jesse Taube [Tue, 26 Jul 2022 05:43:40 +0000 (01:43 -0400)]
ARM: dts: imxrt11170-pinfunc: Add pinctrl binding header

Add binding header for i.MXRT1170 pinctrl device tree.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoimx: imxrt1170-evk: Add support for the NXP i.MXRT1170-EVK
Jesse Taube [Tue, 26 Jul 2022 05:43:39 +0000 (01:43 -0400)]
imx: imxrt1170-evk: Add support for the NXP i.MXRT1170-EVK

This commit adds board support for i.MXRT1170-EVK from NXP. This board
is an evaluation kit provided by NXP for i.MXRT117x processor family.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
22 months agoMerge branch 'mpc85xx-for-v2022.10-rc5' of https://source.denx.de/u-boot/custodians...
Tom Rini [Sun, 18 Sep 2022 15:41:08 +0000 (11:41 -0400)]
Merge branch 'mpc85xx-for-v2022.10-rc5' of https://source.denx.de/u-boot/custodians/u-boot-mpc85xx

22 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Sun, 18 Sep 2022 12:27:23 +0000 (08:27 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: turris_omnia: Fix setting switch CONFIG pins on new board
  design (Marek)
- orion-timer: Use timer_conv_64() to fix timer wrap around (Stefan)

22 months agotimer: orion-timer: Use timer_conv_64() to fix timer wrap around
Stefan Roese [Thu, 15 Sep 2022 14:20:36 +0000 (16:20 +0200)]
timer: orion-timer: Use timer_conv_64() to fix timer wrap around

While testing on some Kirkwood platforms it was noticed that the timer
did not function correctly all the time. The driver did not correctly
handle 32bit timer value wrap arounds. Using the timer_conv_64()
conversion function fixes this issue.

Fixes: e9e73d78a8fb ("timer: add orion-timer support")
Suggested-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
22 months agoarm: mvebu: turris_omnia: Fix setting switch CONFIG pins on new board design
Marek Behún [Tue, 13 Sep 2022 16:10:28 +0000 (18:10 +0200)]
arm: mvebu: turris_omnia: Fix setting switch CONFIG pins on new board design

It seems that waiting only 10 ms after releasing LAN switch from reset
is not enough for the strapping pins to latch the requested values.
P6_MODE[0] is latched to 0 instead of 1.

Increasing the delay to 50 ms fixes this issue.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
22 months agommc: fsl_esdhc_spl: Add support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS
Pali Rohár [Fri, 5 Aug 2022 20:09:41 +0000 (22:09 +0200)]
mmc: fsl_esdhc_spl: Add support for builds without CONFIG_SYS_MMC_U_BOOT_OFFS

When fixed offset via CONFIG_SYS_MMC_U_BOOT_OFFS is not specified then
expects that U-Boot proper is placed immediately after SPL without any
additional padding.

This allows to generate smaller SPL+U-Boot final binary as it is not
required to specify fixed offset to U-Boot proper at SPL compile time.

In this case offset to U-Boot proper is calculated at SPL compile time in
linker script.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Marek Behún <kabel@kernel.org>
22 months agopowerpc: mpc85xx: Fix loading U-Boot proper from SD card in SPL
Pali Rohár [Fri, 5 Aug 2022 20:09:40 +0000 (22:09 +0200)]
powerpc: mpc85xx: Fix loading U-Boot proper from SD card in SPL

Change 8-byte alignment of SPL binary to just 4-byte alignment as objcopy
trims trailing zero bytes when converting ELF file to RAW binary.

This is same fix for SPL linker script as was done fix for U-Boot linker
script in commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE
support").

It is required for the patch "mmc: fsl_esdhc_spl: Add support for builds
without CONFIG_SYS_MMC_U_BOOT_OFFS" which triggered this issue in SPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
22 months agommc: fsl_esdhc_spl: Add support for loading proper U-Boot from unaligned location
Pali Rohár [Fri, 5 Aug 2022 20:09:39 +0000 (22:09 +0200)]
mmc: fsl_esdhc_spl: Add support for loading proper U-Boot from unaligned location

This allows to concatenate SPL and proper U-Boot without extra alignment.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Marek Behún <kabel@kernel.org>