Commit graph

87761 commits

Author SHA1 Message Date
Nishanth Menon
9e30ebc983 doc: board: ti: j721e: Update with boot flow diagram
Update the bootflow svg diagram instead of the ascii version

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-07-28 11:36:37 +02:00
Nishanth Menon
fd358121bd doc: board: ti: am65x: Update with boot flow diagram
Update the bootflow svg diagram instead of the ascii version

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-07-28 11:36:37 +02:00
Nishanth Menon
68b3baaf3b doc: board: ti: am62x/j7200: Update with common boot flow diagram
Update the bootflow svg diagram and reuse across the platforms as they
are common.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-07-28 11:36:37 +02:00
Nishanth Menon
cce3e7a23d doc: board: ti: Optimize sources references
We have duplication of sources which makes it hard to sustain across the
board, but at the same time, we'd like to ensure readers get specific
information without having to cross refer to different documentation to
get piecemeal information that they need to put together.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-07-28 11:36:37 +02:00
Dan Carpenter
a7eb8aeccb efi_loader: fix uninitialized variable bug in efi_set_load_options()
Check for efi_search_protocol() failure before dereferencing "handler"
to avoid a crash.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2023-07-28 11:36:37 +02:00
Tom Rini
f687c8f7b4 doc: ti: Clarify required file names for K3 platforms
Now that we are using binman in all cases on these platforms, reword
things to be clearer that for filesystem booting we need to use a
specific name for each component.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-07-28 11:36:37 +02:00
Ilias Apalodimas
54edc37a22 efi_loader: make efi_delete_handle() follow the EFI spec
The EFI doesn't allow removal of handles, unless all hosted protocols
are cleanly removed.  Our efi_delete_handle() is a bit intrusive.
Although it does try to delete protocols before removing a handle,
it doesn't care if that fails.  Instead it only returns an error if the
handle is invalid. On top of that none of the callers of that function
check the return code.

So let's rewrite this in a way that fits the EFI spec better.  Instead
of forcing the handle removal, gracefully uninstall all the handle
protocols.  According to the EFI spec when the last protocol is removed
the handle will be deleted.  Also switch all the callers and check the
return code. Some callers can't do anything useful apart from reporting
an error.  The disk related functions on the other hand, can prevent a
medium that is being used by EFI from removal.

The only function that doesn't check the result is efi_delete_image().
But that function needs a bigger rework anyway, so we can clean it up in
the future

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-28 11:36:37 +02:00
Heinrich Schuchardt
8505c0bb5c doc: describe QEMU emulation of block devices
* Add a new page about the emulation of block devices
* Add semihosting to the emulation index page
* Set toc maxdepth to 1 to improve readability

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-28 11:36:37 +02:00
Heinrich Schuchardt
95537bd31c doc: fix typo device_compat/.h
%s/device_compat\/.h/device_compat.h/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-28 11:36:37 +02:00
Heinrich Schuchardt
d0544244b1 efi_loader: simplify dp_fill()
Move the recursive dp_fill(dev->parent) call to a single location.
Determine uclass_id only once.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-28 11:36:37 +02:00
Heinrich Schuchardt
c227ef7c4a efi_loader: device paths for special block devices
The UEFI specification does not provide node types matching UCLASS_BLKMAP,
UCLASS_HOST, UCLASS_VIRTIO block devices.

The current implementation uses VenHw() nodes with uclass specific GUIDs
and a single byte for the device number appended. This leads to unaligned
integers in succeeding device path nodes.

The current implementation fails to create unique device paths for block
devices based on other uclasses like UCLASS_PVBLOCK.

Let's use a VenHw() node with the U-Boot GUID with a length dividable by
four and encoding blkdesc->uclass_id as well as  blkdesc->devnum.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-28 11:36:37 +02:00
Heinrich Schuchardt
771d7cd8c5 doc: update doc/sphinx/requirements.txt
Update the following requirements to their latest version:

* Pygments - syntax highlighting
* pytz     - world timezone definitions
* certifi  - Mozilla's CA bundle

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-28 11:36:37 +02:00
Tom Rini
c98c401dfb Merge https://source.denx.de/u-boot/custodians/u-boot-usb 2023-07-27 10:35:36 -04:00
Richard Habeeb
3aba92c9dd usb: xhci: Fix double free on failure
drivers/core/device.c will call `device_free()` after xhci_register
already frees the private device data. This can cause a crash later
during the boot process, observed on aarch64 RPi4b as a synchronous
exception. All callers of xhci_register use priv_auto, so this won't
lead to memory leaks.

Signed-off-by: Richard Habeeb <richard.habeeb@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-27 03:59:38 +02:00
Tom Rini
197aa22e65 Merge branch 'master' of git://git.denx.de/u-boot-coldfire
- Watchdog updates, and more MAINTAINERS entries
2023-07-25 17:37:39 -04:00
Tom Rini
dc05fe5120 Revert "travis-ci: Add m68k M5208EVBE machine"
This commit was not intended for this tree but rather
u-boot-test-scripts (where it is applied).

This reverts commit f04ef0a7a0.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-07-25 17:37:18 -04:00
Angelo Dureghello
59dee11b17 MAINTAINERS: add myself as mcf_wdt.c maintainer
Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
Changes for v2:
- none
Changes for v3:
- none
2023-07-25 23:21:42 +02:00
Angelo Dureghello
838a6a7201 configs: m68k: add watchdog driver
Add config options for mcf_wdt driver.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
Changes for v2:
- none
Changes for v3:
- none
2023-07-25 23:21:42 +02:00
Angelo Dureghello
67d39af665 m68k: dts: add watchdog node
Add watchdog node for the implemented mcf_wdt driver.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
Changes for v2:
- remove unnecessary big-endian property
Changes for v3:
- none
2023-07-25 23:21:42 +02:00
Angelo Dureghello
dc3a89b8c6 m68k: move watchdog functions in mcf_wdt driver
Move watchdog functions inside a separate watchdog driver.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
Changes for v2:
- none
Changes for v3:
- none
2023-07-25 23:21:42 +02:00
Angelo Dureghello
9b8bc514a0 drivers: watchdog: add mcf watchdog support
This watchdog driver applies to the following
mcf families:

- mcf52x2 (5271 5275 5282)
- mcf532x (5329 5373)
- mcf523x (5235)

Cpu's not listed for each family does not have WDT module.

Note, after some attempts testing by qemu on 5208 i
finally abandoned, watchdog seems not implemented properly.

The driver has been tested in a real M5282EVM.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
Changes for v2:
- remove unnecessary hardcoded timeouts
- remove unnecessary hw_watchdog_xxx stuff
- rewrite wdog module reg calculation
- using IS_ENABLED() where possible
Changes for v3:
- remove hardcoded 4s test
2023-07-25 23:21:42 +02:00
Angelo Dureghello
74c521912a board: m68k add missing maintainer
Add myself as a maintainer for orphaned boards.
All these boards are covered by buildman m68k test.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
2023-07-25 23:21:42 +02:00
Tom Rini
ff296acc35 Prepare v2023.10-rc1
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-07-25 17:19:54 -04:00
Tom Rini
9455dc322c configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-07-25 17:00:57 -04:00
Tom Rini
544dfc3c88 Merge branch '2023-07-25-assorted-general-updates'
- A number of MAINTAINER file updates, assorted driver/platform fixes,
  performance improvements for sparse file writes, and 64bit time_t.
2023-07-25 16:55:59 -04:00
Andrew Davis
fa59771039 MAINTAINERS: Take maintainership of TI KeyStone2 support
Add arch/arm/mach-keystone/ into K2 board directory MAINTAINERS file.

Convert current entries into regex match style.

Assign maintainership to myself.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-07-25 13:29:00 -04:00
Marek Vasut
779e38a5f5 Makefile: Use sort shortopts
POSIX does not defined longopts for sort, use shortops
for even more compatibility.

Fixes: cc5a490cf4 ("Makefile: Sort u-boot-initial-env output")
Reported-by: Milan P. Stanić <mps@arvanta.net>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Tested-by: Milan P. Stanić <mps@arvanta.net>
2023-07-25 12:44:47 -04:00
Tom Rini
fdfbd70da6 MAINTAINERS: Add some missing directories or files
In a few cases we have MAINTAINERS entries that are missing obvious
paths or files. Typically this means a board directory that did not list
itself, but in a few cases we have a Kconfig file or similar.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
b99476e71a MAINTAINERS: Deal with '+' in paths
The listed paths are allowed to contain wildcards.  This includes the
'+' character which we have as a literal part of the path in a few
cases. Escape the '+' here so that files are matched.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
5f1720f282 MAINTAINERS: Fix path typos and similar
We have a number of cases where the in-tree path of files and where
they presumably were when the first version of a patch were posted
differ slightly.  Correct these to point at where the files are now.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
f23f1b5307 MAINTAINERS: Add a number of "common" directories
A number of platforms have "common" directories that are in turn not
listed by the board MAINTAINERS file.  Add these directories in many
cases.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
bded724104 xes: Remove leftover code
The platforms here have been removed, but the common code directory was
forgotten.  Clean up.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
4835e86cba arm: Remove leftover MAINTAINERS files
These platforms have been removed, but the MAINTAINERS file was missed,
clean up.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
1f2e4027fa arm: Remove more remnants of bcmcygnus
Remove some leftover files from the bcmcygnus platform.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
5005dfbfdf MAINTAINERS: Re-order CAAM section
This file is in alphabetical order, move CAAM up to where it should be.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
d38ed5b68c sunxi: Add MAINTAINERS entry for Lctech Pi F1C200s
This defconfig was added without a MAINTAINERS entry, add one.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
2b506407c8 rockchip: Add MAINTAINERS entry for Radxa Rock 4C+
This defconfig was added without a MAINTAINERS entry, add one.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
e5478bef26 MAINTAINERS: Add some missing defconfig files to existing entries
We have a few places where defconfigs were added (or renamed) and not
included in their previously listed MAINTAINERS entry, correct this.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by:  Adam Ford <aford173@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Tom Rini
aaf929a55f MAINTAINERS: Correct minor mistakes on some file listings
There are a few entries where minor mistakes mean that we don't match up
with obviously expected files, correct those.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:47 -04:00
Heinrich Schuchardt
8faeb1d722 part: eliminate part_get_info_by_name_type()
Since commit 56670d6fb8 ("disk: part: use common api to lookup part
driver") part_get_info_by_name_type() ignores the part_type parameter
used to restrict the partition table type.

omap_mmc_get_part_size() and part_get_info_by_name() are the only
consumers.

omap_mmc_get_part_size() calls with part_type = PART_TYPE_EFI because at
the time of implementation a speed up could be gained by passing the
partition table type. After 5 years experience without this restriction
it looks safe to keep it that way.

part_get_info_by_name() uses PART_TYPE_ALL.

Move the logic of part_get_info_by_name_type() to part_get_info_by_name()
and replace the function in omap_mmc_get_part_size().

Fixes: 56670d6fb8 ("disk: part: use common api to lookup part driver")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-25 12:44:46 -04:00
Tom Rini
d45f6c13f5 .mailmap: Correct entries for Masahiro Yamada
His entries had the correct email address listed last rather than first,
correct this.

Fixes: 4fa4227cdd (".mailmap: Record all address for main U-Boot contributor")
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Michal Simek <michal.simek@amd.com>
2023-07-25 12:44:46 -04:00
Heinrich Schuchardt
17335a81c5 common: define time_t as 64bit
To avoid the year 2038 problem time_t must be 64bit on all architectures.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-25 12:44:46 -04:00
Michal Simek
b378fdd1ff fwu: Show number of attempts in Trial State
It is not visible anywhere in Trial State if this is the first, second, etc
attempt that's why show a message to be aware about status.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
2023-07-25 12:44:46 -04:00
Michal Simek
395ab12b5f fwu: mtd: Fix dfu_alt_info generation for 2 images per bank
Code rewrites the last char of size with adding &. It is visible from
dfu_alt_info print before this patch:

Make dfu_alt_info: 'mtd nor0=bank0 raw 2320000 80000;bank1 raw 27a0000
8000&mtd nor0=bank0 raw 23a0000 4000000;bank1 raw 2820000 4000000'

And after it:
Make dfu_alt_info: 'mtd nor0=bank0 raw 2320000 80000;bank1 raw 27a0000
80000&mtd nor0=bank0 raw 23a0000 4000000;bank1 raw 2820000 4000000'

Size for bank0 and bank1 must be the same because it is the same image.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
2023-07-25 12:44:46 -04:00
Michal Simek
a6dd927f5b fwu: Allow code to properly decode trial state
Current code after capsule update (mtd write) is not changing active_index
in mdata to previous_active_index.
On the reboot this is shown but showing message
"Boot idx 1 is not matching active idx 0, changing active_idx"
which is changing active_idx and writing mdata to flash.

But when this message is visible it is not checking which state that images
are. If they have acceptance bit setup to yes everything is fine and valid
images are booted (doesn't mean the latest one).
But if acceptance bit is no and images are in trial state in_trial variable
is never setup. Which means that from new flashed image stable image can be
rewritten because in_trial is not setup properly.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
2023-07-25 12:44:46 -04:00
Chris Packham
d6c0d7087f drivers: rtc: max313xx: provide read8/write8
In some designs the MAX313xx RTC may need calibration to cope with
oscillator inaccuracies. Provide read8/write8 ops so that the registers
can be accessed. Because the driver covers a range of MAX313xx variants
no attempt is made to ensure the register is valid.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-07-25 12:44:46 -04:00
Mattijs Korpershoek
b1aade87ca lib: sparse: allocate FASTBOOT_MAX_BLK_WRITE instead of small number
Commit 62649165cb ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
fixed cache alignment for systems with a D-CACHE.

However it introduced some performance regressions [1] on system
flashing huge images, such as Android.

On AM62x SK EVM, we also observe such performance penalty:
Sending sparse 'super' 1/2 (768793 KB)             OKAY [ 23.954s]
Writing 'super'                                    OKAY [ 75.926s]
Sending sparse 'super' 2/2 (629819 KB)             OKAY [ 19.641s]
Writing 'super'                                    OKAY [ 62.849s]
Finished. Total time: 182.474s

The reason for this is that we use an arbitrary small buffer
(info->blksz * 100) for transferring.

Fix it by using a bigger buffer (info->blksz * FASTBOOT_MAX_BLK_WRITE)
as suggested in the original's patch review [2].

With this patch, performance impact is mitigated:
Sending sparse 'super' 1/2 (768793 KB)             OKAY [ 23.912s]
Writing 'super'                                    OKAY [ 15.780s]
Sending sparse 'super' 2/2 (629819 KB)             OKAY [ 19.581s]
Writing 'super'                                    OKAY [ 17.192s]
Finished. Total time: 76.569s

[1] https://lore.kernel.org/r/20221118121323.4009193-1-gary.bisson@boundarydevices.com
[2] https://lore.kernel.org/r/all/43e4c17c-4483-ec8e-f843-9b4c5569bd18@seco.com/

Fixes: 62649165cb ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-07-25 12:44:46 -04:00
Philippe Reynes
8fd6e64c95 drivers: led: bcm6858: do not use null label to find the top
This driver considers that a node with an empty label is the top.
But the led class has changed, if a label is not provided for a led,
the label is filed with the node name. So we update this driver
to use a wrapper to manage the top led node.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2023-07-25 12:44:46 -04:00
Nishanth Menon
2a8ebad6ef mailbox: k3-sec-proxy: Fill non-message tx data fields with 0x0
Sec proxy data buffer is 60 bytes with the last of the registers
indicating transmission completion. This however poses a bit of a
challenge.

The backing memory for sec_proxy is regular memory, and all sec proxy
does is to trigger a burst of all 60 bytes of data over to the target
thread backing ring accelerator. It doesn't do a memory scrub when
it moves data out in the burst. When we transmit multiple messages,
remnants of previous message is also transmitted which results in
some random data being set in TISCI fields of messages that have been
expanded forward.

The entire concept of backward compatibility hinges on the fact that
the unused message fields remain 0x0 allowing for 0x0 value to be
specially considered when backward compatibility of message extension
is done.

So, instead of just writing the completion register, we continue
to fill the message buffer up with 0x0 (note: for partial message
involving completion, we already do this).

This allows us to scale and introduce ABI changes back also work with
other boot stages that may have left data in the internal memory.

While at this, drop the unused accessor function.

Fixes: f9aa41023b ("mailbox: Introduce K3 Secure Proxy Driver")
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-07-25 12:44:46 -04:00
Simon Glass
ad1c9b26a8 buildman: Specify the output directory in tests
The default output directory is generally '../' in tests so we end up
trying to create '../.bm-work'. This does not work with azure, so update
these tests to use the temporary directory instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-25 11:39:38 -04:00