]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
23 months agoodroid: limit boot memory to lowmem
Joost van Zwieten [Sat, 14 Jan 2023 23:57:30 +0000 (00:57 +0100)]
odroid: limit boot memory to lowmem

In commit 4963f63fe61f ("image: Use gd->ram_base/_size in
env_get_bootm_size()") the size of the available memory for U-Boot to
use when relocating images, and not otherwise constrained, was changed
to include all known memory banks. In the case of this platform however,
all of the memory known to U-Boot is not also part of the Linux kernel
"lowmem" and so we must use CFG_SYS_BOOTMAPSZ to limit where we relocate
images to. We set a conservative limit of 256MB here to mirror the
previous behavior.

Signed-off-by: Joost van Zwieten <joost@diskos.nl>
[trini: Reword the commit messsage]
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoconfigs: enable poweroff command on QEMU ARM platforms
Heinrich Schuchardt [Fri, 13 Jan 2023 19:02:28 +0000 (20:02 +0100)]
configs: enable poweroff command on QEMU ARM platforms

Enable the sysreset based poweroff command. It invokes PSCI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agovbe: Allow probing the VBE bootmeth to fail in OS fixup
Simon Glass [Thu, 12 Jan 2023 23:48:54 +0000 (16:48 -0700)]
vbe: Allow probing the VBE bootmeth to fail in OS fixup

This device is created when there are no bootmeths defined in the device
tree. But it cannot be probed without a device tree node.

For now, ignore a probe failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Karsten Merker <merker@debian.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Fixes: a56f663f0707 ("vbe: Add info about the VBE device to the fwupd node")
Tested-by: Vagrant Cascadian <vagrant@debian.org>
Tested-by: Karsten Merker <merker@debian.org>
23 months agotest: compression: add zstd uncompression test
Brandon Maier [Thu, 12 Jan 2023 16:27:46 +0000 (10:27 -0600)]
test: compression: add zstd uncompression test

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
23 months agolib: zstd: update to latest Linux zstd 1.5.2
Brandon Maier [Thu, 12 Jan 2023 16:27:45 +0000 (10:27 -0600)]
lib: zstd: update to latest Linux zstd 1.5.2

Update the zstd implementation to match Linux zstd 1.5.2 from commit
2aa14b1ab2.

This was motivated by running into decompression corruption issues when
trying to uncompress files compressed with newer versions of zstd. zstd
users also claim significantly improved decompression times with newer
zstd versions which is a side benefit.

Original zstd code was copied from Linux commit 2aa14b1ab2 which is a
custom-built implementation based on zstd 1.3.1. Linux switched to an
implementation that is a copy of the upstream zstd code in Linux commit
e0c1b49f5b, this results in a large code diff. However this should make
future updates easier along with other benefits[1].

This commit is a straight mirror of the Linux zstd code, except to:
- update a few #include that do not translate cleanly
  - linux/swab.h -> asm/byteorder.h
  - linux/limits.h -> linux/kernel.h
  - linux/module.h -> linux/compat.h
- remove assert() from debug.h so it doesn't conflict with u-boot's
  assert()
- strip out the compressor code as was done in the previous u-boot zstd
- update existing zstd users to the new Linux zstd API
- change the #define for MEM_STATIC to use INLINE_KEYWORD for codesize
- add a new KConfig option that sets zstd build options to minify code
  based on zstd's ZSTD_LIB_MINIFY[2].

These changes were tested by booting a zstd 1.5.2 compressed kernel inside a
FIT. And the squashfs changes by loading a file from zstd compressed squashfs
with sqfsload. buildman was used to compile test other boards and check for
binary bloat, as follows:

> $ buildman -b zstd2 --boards dh_imx6,m53menlo,mvebu_espressobin-88f3720,sandbox,sandbox64,stm32mp15_dhcom_basic,stm32mp15_dhcor_basic,turris_mox,turris_omnia -sS
> Summary of 6 commits for 9 boards (8 threads, 1 job per thread)
> 01: Merge branch '2023-01-10-platform-updates'
>        arm:  w+   m53menlo dh_imx6
> 02: lib: zstd: update to latest Linux zstd 1.5.2
>    aarch64: (for 2/2 boards) all -3186.0 rodata +920.0 text -4106.0
>        arm: (for 5/5 boards) all +1254.4 rodata +940.0 text +314.4
>    sandbox: (for 2/2 boards) all -4452.0 data -16.0 rodata +640.0 text -5076.0

[1] https://github.com/torvalds/linux/commit/e0c1b49f5b674cca7b10549c53b3791d0bbc90a8
[2] https://github.com/facebook/zstd/blob/f302ad8811643c428c4e3498e28f53a0578020d3/lib/libzstd.mk#L31

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
[trini: Set ret to -EINVAL for the error of "failed to detect
compressed" to fix warning, drop ZSTD_SRCSIZEHINT_MAX for non-Linux host
tool builds]
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoconfigs: Increase malloc size after relocation
Neha Malcom Francis [Wed, 11 Jan 2023 12:41:23 +0000 (18:11 +0530)]
configs: Increase malloc size after relocation

Current default size of 0x100000 is not capable of getting the FIT
buffer during boot when transitioning to using binman generated boot
images for certain K3 devices, so increase it to 0x400000. Since A72 SPL
is coming after relocation to DDR this should not be an issue for any K3
device, so make it default for all.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
23 months agoconfigs: remove SDL2 dependency in tools-only_defconfig
Heinrich Schuchardt [Wed, 11 Jan 2023 06:43:30 +0000 (07:43 +0100)]
configs: remove SDL2 dependency in tools-only_defconfig

When building tools only there is no point in requiring the SDL2 library.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agofirmware: ti_sci: fix typo in boot authentication message name
Jorge Ramirez-Ortiz [Tue, 10 Jan 2023 17:29:48 +0000 (18:29 +0100)]
firmware: ti_sci: fix typo in boot authentication message name

Fix AUTH_BOOT message identifier (s/IMIAGE/IMAGE)

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Acked-by: Andrew Davis <afd@ti.com>
23 months agotest/py: gpt: add test for the gpt partition type GUID identifier
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:35 +0000 (17:19 +0100)]
test/py: gpt: add test for the gpt partition type GUID identifier

Add sandbox test for the gpt partition type command, the test uses the
persistent data test_gpt_disk_image.bin to check that the first
partition type GUID that identifies the type of the partition has the
"Linux filesystem data" type ( 0FC63DAF-8483-4772-8E79-3D69D8477DE4 ).

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
23 months agocmd: part: Add partition-related type command
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:34 +0000 (17:19 +0100)]
cmd: part: Add partition-related type command

This implements the following command:

    part type mmc 0:1
      -> print partition type UUID
    part type mmc 0:1 uuid
      -> set environment variable to partition type UUID

"part type" can be useful when writing a bootcmd which searches for a
specific partition type to enable automatic discovery of partitions and
their intended usage or mount point.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix when CONFIG_PARTITION_TYPE_GUID is disabled and have the
command check for "types" before "type"]
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agodoc/README.gpt: Fix typo 'a optionnal'
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:33 +0000 (17:19 +0100)]
doc/README.gpt: Fix typo 'a optionnal'

Change the string 'a optionnal' to 'an optional'.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agodoc: man-page for the part command
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:32 +0000 (17:19 +0100)]
doc: man-page for the part command

Provide a man-page for the part command.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
23 months agoARM: configs: npcm7xx: add full function for nuvoton npcm750
Jim Liu [Tue, 10 Jan 2023 03:04:12 +0000 (11:04 +0800)]
ARM: configs: npcm7xx: add full function for nuvoton npcm750

Add add full function config for nuvoton npcm750

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
23 months agotest: compression: use sizeof() instead of magic numbers
Brandon Maier [Mon, 9 Jan 2023 18:42:58 +0000 (12:42 -0600)]
test: compression: use sizeof() instead of magic numbers

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
23 months agomusb-new: omap2430: fix compiling in DM_USB_GADGET config
Andreas Kemnade [Mon, 9 Jan 2023 07:13:31 +0000 (08:13 +0100)]
musb-new: omap2430: fix compiling in DM_USB_GADGET config

Add the separate IRQ handling function and change the registration.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
23 months agomusb-new: omap2430: no host data access in gadget mode
Andreas Kemnade [Mon, 9 Jan 2023 07:13:30 +0000 (08:13 +0100)]
musb-new: omap2430: no host data access in gadget mode

Avoid accessing structures (usb_bus_priv) only present when musb is
in host mode.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
23 months agoevent: Correct dependencies on the EVENT framework
Tom Rini [Mon, 16 Jan 2023 20:46:49 +0000 (15:46 -0500)]
event: Correct dependencies on the EVENT framework

The event framework is just that, a framework. Enabling it by itself
does nothing, so we shouldn't ask the user about it. Reword (and correct
typos) around this the option and help text. This also applies to
DM_EVENT and EVENT_DYNAMIC. Only EVENT_DEBUG and CMD_EVENT should be
visible to the user to select, when EVENT is selected.

With this, it's time to address the larger problems. When functionality
uses events, typically via EVENT_SPY, the appropriate framework then
must be select'd and NOT imply'd. As the functionality will cease to
work (and so, platforms will fail to boot) this is non-optional and
where select is appropriate. Audit the current users of EVENT_SPY to
have a more fine-grained approach to select'ing the framework where
used. Also ensure the current users of event_register and also select
EVENT_DYNAMIC.

Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reported-by: Oliver Graute <Oliver.Graute@kococonnector.com>
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Fixes: 42fdcebf859f ("event: Convert misc_init_f() to use events")
Fixes: c5ef2025579e ("dm: fix DM_EVENT dependencies")
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
23 months agox86: Fix saying arch_cpu_init_dm in debug/docs
Tom Rini [Sat, 14 Jan 2023 20:49:35 +0000 (15:49 -0500)]
x86: Fix saying arch_cpu_init_dm in debug/docs

The function arch_cpu_init_dm was renamed to fsp_setup_pinctrl in these
cases, so rename debug / docs to match.

Cc: Simon Glass <sjg@chromium.org>
Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agocmd: event: Remove additional event description
Michal Simek [Tue, 17 Jan 2023 10:44:45 +0000 (11:44 +0100)]
cmd: event: Remove additional event description

The first name is taken from command name that's why shouldn't be listed in
help. The similar change was also done by commit a84d3b6c5634 ("cmd: pwm:
Remove additional pwm description").
Also remove additional spaces in help message.

Before:
event event list   - list event spies

After:
event list   - list event spies

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months ago.mailmap: update e-mail address for Eugen Hristev
Eugen Hristev [Wed, 18 Jan 2023 15:54:44 +0000 (17:54 +0200)]
.mailmap: update e-mail address for Eugen Hristev

Update e-mail address.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
23 months agoMerge branch '2022-01-16-bootstd-updates'
Tom Rini [Tue, 17 Jan 2023 13:55:40 +0000 (08:55 -0500)]
Merge branch '2022-01-16-bootstd-updates'

To quote the author:
So far standard boot lacks a boot menu, although it is possible to create
a rudimentary one using the existing 'bootmenu' command.

Even then, this text-based menu offer only basic functionality and does
not take full advantage of the displays which are common on many devices.

This series provides a 'bootflow menu' command which allows the user to
select from the available bootflows. An attempt is made to show the name
of the available operating systems, by reading more information into the
bootflow. A logo can be read also, where supported, so that this can be
presented to the user when an option is highlighted.

Full use is made of TrueType fonts, if enabled. For cases where only a
serial console is available, it falls back to a simple text-based menu.

All of this is implementing using a new 'expo' construct, a collection of
scenes (like menu screens) which can be navigated by the user to view
information and select options. This is fairly general and should be able
to cope with a wider array of use cases, with less hacking of the menu
code, such as is currently needed for CMD_BOOTEFI_BOOTMGR.

Of course it would be possible to enhance the existing menu rather than
creating a new setup. Instead it seems better to make the existing menu
use expo, if code space permits. It avoids the event-loop problem and
should be more extensible, given its loosely coupled components and use of
IDs instead of pointers. Further motivation is provided in the
documentation.

For now the CLI keypress-decoding code is split out to be used by the new
menu. The key codes defined by menu.h are reused also.

This is of course just a starting point. Some ideas for future work are
included in the documentation.

23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 17 Jan 2023 13:10:56 +0000 (08:10 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- kirkwood: Convert to DM Serial for various Kirkwood boards (Tony)
- orion-timer: Fix problem in early_init_done() (Stefan)

23 months agoarm: kirkwood: Convert to DM Serial for various Kirkwood boards
Tony Dinh [Fri, 30 Dec 2022 05:45:57 +0000 (21:45 -0800)]
arm: kirkwood: Convert to DM Serial for various Kirkwood boards

For Kirkwood boards, it is necessary to have early malloc in DRAM area
when Driver Model for Serial is enabled. Please see Michael's patch here:
https://lore.kernel.org/u-boot/20220817193809.1059688-20-michael@walle.cc/

This patch enables the early malloc in DRAM for all Kirkwood boards.
Note that this will work for boards that have either non-DM serial
and DM_SERIAL. Also, add the CONFIG_KIRKWOOD_COMMON option to enable
DM_SERIAL as a common option for boards that have been tested.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
23 months agotimer: orion-timer: Fix problem in early_init_done()
Stefan Roese [Mon, 16 Jan 2023 08:01:48 +0000 (09:01 +0100)]
timer: orion-timer: Fix problem in early_init_done()

It was noticed that Clearfog is currently broken with this newly
introduced early_init_done() function. Apparently the timer is enabled
here when U-Boot is run but not configured - at least not correctly.
Resulting in a hangup in the timer reading functions.

To fix this, also read the value of the reload register and check it's
value with the one written to by U-Boot. Only if this matches, the
init has already been done.

Fixes: 5387b093cb79 ("timer: orion-timer: Fix problem with early static variable")
Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Pali Rohár <pali@kernel.org>
Cc: Martin Rowe <martin.p.rowe@gmail.com>
Cc: Tony Dinh <mibodhi@gmail.com>
Cc: Pali Rohár <pali@kernel.org>
Cc: Michael Walle <michael@walle.cc>
23 months agoMerge tag 'u-boot-rockchip-20230117' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 17 Jan 2023 01:58:37 +0000 (20:58 -0500)]
Merge tag 'u-boot-rockchip-20230117' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add support for rv1126 soc and rv1126 neu2 io board;
- Add support for rk3399 pine64 pinephone pro board;
- dts sync from linux for rk3399 and px30;
- Add support for PX30 Ringneck SoM board;

23 months agoexpo: Add documentation
Simon Glass [Fri, 6 Jan 2023 14:52:43 +0000 (08:52 -0600)]
expo: Add documentation

Add some documentation for the expo feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agobootstd: Support setting a theme for the menu
Simon Glass [Fri, 6 Jan 2023 14:52:42 +0000 (08:52 -0600)]
bootstd: Support setting a theme for the menu

Allow a theme to be set. For now this is very simple, just a default font
size to use for all elements.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agobootstd: Add a test for the bootstd menu
Simon Glass [Fri, 6 Jan 2023 14:52:41 +0000 (08:52 -0600)]
bootstd: Add a test for the bootstd menu

Add a test which checks that two operating systems can be displayed in a
menu, allowing one to be selected.

Enable a few things on snow so that the unit tests build.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agobootstd: Support creating a boot menu
Simon Glass [Fri, 6 Jan 2023 14:52:40 +0000 (08:52 -0600)]
bootstd: Support creating a boot menu

Create an expo to handle the boot menu. For now this is quite simple, with
just a header, some menu items and a pointer to show the current one.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agoexpo: Add basic tests
Simon Glass [Fri, 6 Jan 2023 14:52:39 +0000 (08:52 -0600)]
expo: Add basic tests

Add some tests for the expo, including setting up and rendering an expo.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agoexpo: Add support for scene menus
Simon Glass [Fri, 6 Jan 2023 14:52:38 +0000 (08:52 -0600)]
expo: Add support for scene menus

A menu is a key part of the expo design. It consists of a number of items
which the user can select from.

Add the initial implementation of this.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agoexpo: Add support for scenes
Simon Glass [Fri, 6 Jan 2023 14:52:37 +0000 (08:52 -0600)]
expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agoexpo: Add basic implementation
Simon Glass [Fri, 6 Jan 2023 14:52:36 +0000 (08:52 -0600)]
expo: Add basic implementation

An expo is a way of presenting and collecting information from the
user. It consists of a collection of 'scenes' of which only one is
presented at a time. An expo is typically used to show a boot menu
and allow settings to be changed.

One created, the same expo can be automatically presented in graphical
form using a vidconsole, or in text form on a serial console.

Add an initial implementation of the expo itself. Supports for scenes
and objects is provided later.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agomenu: Factor out menu-keypress decoding
Simon Glass [Fri, 6 Jan 2023 14:52:35 +0000 (08:52 -0600)]
menu: Factor out menu-keypress decoding

Move this code into a separate function so that it can be used in the new
VBE menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agobootstd: Allow reading a logo for the OS
Simon Glass [Fri, 6 Jan 2023 14:52:34 +0000 (08:52 -0600)]
bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agobootstd: Read the Operating System name for distro/scripts
Simon Glass [Fri, 6 Jan 2023 14:52:33 +0000 (08:52 -0600)]
bootstd: Read the Operating System name for distro/scripts

Add the concept of an OS name to the bootflow. This typically includes the
OS name, version and kernel version.

Implement this for the distro and script bootmeths so that it works with
Armbian and older version of Fedora.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agovideo: Add font functions to the vidconsole API
Simon Glass [Fri, 6 Jan 2023 14:52:32 +0000 (08:52 -0600)]
video: Add font functions to the vidconsole API

Support for fonts currently depends on the type of vidconsole in use. Add
two new methods to enumerate fonts and to set the font.

Fix a few other method comments while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agovideo: Fix unchnaged typo
Simon Glass [Fri, 6 Jan 2023 14:52:31 +0000 (08:52 -0600)]
video: Fix unchnaged typo

Fix this typo in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
23 months agovideo: truetype: Rename the metrics function
Simon Glass [Fri, 6 Jan 2023 14:52:30 +0000 (08:52 -0600)]
video: truetype: Rename the metrics function

This should really have a 'truetype' prefix. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agovideo: Enable VIDEO_ANSI by default only with EFI
Simon Glass [Fri, 6 Jan 2023 14:52:29 +0000 (08:52 -0600)]
video: Enable VIDEO_ANSI by default only with EFI

This is not generally needed unless EFI_LOADER is used. Adjust the default
setting to reduce the size of the U-Boot build.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agoimage: Move common image code to image_board and command
Simon Glass [Fri, 6 Jan 2023 14:52:28 +0000 (08:52 -0600)]
image: Move common image code to image_board and command

We should use the cmd/ directory for commands rather than for common code
used elsewhere in U-Boot. Move the common 'source' code into
image-board.c to achieve this.

The image_source_script() function needs to call run_command_list()  so
seems to belong better in the command library. Move and rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agoimage: Add a function to find a script in an image
Simon Glass [Fri, 6 Jan 2023 14:52:27 +0000 (08:52 -0600)]
image: Add a function to find a script in an image

Split this functionality out of the 'source' command so it can be used
from another place. For now leave it where it is, but a future patch will
move it out of cmd/

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agomenu: Make use of CLI character processing
Simon Glass [Fri, 6 Jan 2023 14:52:26 +0000 (08:52 -0600)]
menu: Make use of CLI character processing

Avoid duplicating some of the escape-sequence processing here and use the
CLI function instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agomenu: Use a switch statement
Simon Glass [Fri, 6 Jan 2023 14:52:25 +0000 (08:52 -0600)]
menu: Use a switch statement

Convert the long line of if() statements to a switch() since this makes
better use of the C language.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agomenu: Update bootmenu_loop() to return the code
Simon Glass [Fri, 6 Jan 2023 14:52:24 +0000 (08:52 -0600)]
menu: Update bootmenu_loop() to return the code

Use the return value to save having to pass around a pointer. This also
resolves any ambiguity about what *key contains when the function is
called.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agomenu: Update bootmenu_autoboot_loop() to return the code
Simon Glass [Fri, 6 Jan 2023 14:52:23 +0000 (08:52 -0600)]
menu: Update bootmenu_autoboot_loop() to return the code

Use the return value to save having to pass around a pointer. This also
resolves any ambiguity about what *key contains when the function is
called.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agomenu: Rename KEY_... to BKEY_...
Simon Glass [Fri, 6 Jan 2023 14:52:22 +0000 (08:52 -0600)]
menu: Rename KEY_... to BKEY_...

This enum values conflict with linux/input.h so rename them.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agobootmenu: Add a few comments
Simon Glass [Fri, 6 Jan 2023 14:52:21 +0000 (08:52 -0600)]
bootmenu: Add a few comments

The behaviour of these two functions is completely undocumented. Add some
notes so the poor, suffering dev can figure out what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agocli: Move readline character-processing to a state machine
Simon Glass [Fri, 6 Jan 2023 14:52:20 +0000 (08:52 -0600)]
cli: Move readline character-processing to a state machine

The current cread_line() function is very long. It handles the escape
processing inline. The menu command does similar processing but at the
character level, so there is some duplication.

Split the character processing into a new function cli_ch_process() which
processes individual characters and returns the resulting input character,
taking account of escape sequences. It requires the caller to set up and
maintain its state.

Update cread_line() to use this new function.

The only intended functional change is that an invalid escape sequence
does not add invalid/control characters into the input buffer, but instead
discards these.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agosandbox: Enable mmc command and legacy images
Simon Glass [Fri, 6 Jan 2023 14:52:19 +0000 (08:52 -0600)]
sandbox: Enable mmc command and legacy images

The mmc command is useful for testing mmc disk images in sandbox, so
enable it. We also need to enable legacy images so that we can run tests
which use them.

Disable it for a few avb tests since MMC is not implemented there yet.

Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agorockchip: add support for PX30 Ringneck SoM on Haikou Devkit
Quentin Schulz [Mon, 9 Jan 2023 10:36:45 +0000 (11:36 +0100)]
rockchip: add support for PX30 Ringneck SoM on Haikou Devkit

The PX30-µQ7 (Ringneck) is a system-on-module featuring the Rockchip
PX30 in a micro Qseven-compatible form-factor.

PX30-µQ7 features:
        * CPU: quad-core Cortex-A35
        * DRAM: 2GB dual-channel
        * eMMC: onboard eMMC
        * SD/MMC
        * TI DP83825I 10/100Mbps PHY
        * USB:
                * USB2.0 dual role port
                * 3x USB2.0 host via onboard USB2.0 hub
        * Display: MIPI-DSI
        * Camera: MIPI-CSI
        * onboard 2.4GHz WiFi + Bluetooth module
        * Companion Controller: on-board additional microcontroller
  (STM32 Cortex-M0 or ATtiny):
                * RTC
                * fan controller
                * CAN (only STM32)

The non-U-Boot DTS files are imported from Linux v6.2-rc2.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
23 months agoarm64: dts: rockchip: sync px30 DTSI with Linux kernel v6.1
Quentin Schulz [Mon, 9 Jan 2023 10:36:44 +0000 (11:36 +0100)]
arm64: dts: rockchip: sync px30 DTSI with Linux kernel v6.1

Sync the px30 dtsi from Linux kernel v6.1.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
23 months agorockchip: px30: insert u-boot, spl-boot-device into U-Boot device tree
Quentin Schulz [Mon, 9 Jan 2023 10:36:43 +0000 (11:36 +0100)]
rockchip: px30: insert u-boot, spl-boot-device into U-Boot device tree

It is possible to boot U-Boot proper from a different storage medium
than the one used by the BOOTROM to load the SPL. This information is
stored in the u-boot,spl-boot-device Device Tree property and is
accessible from U-Boot proper so that it has knowledge at runtime where
it was loaded from.

Let's add support for this feature for px30.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
23 months agorockchip: px30: list possible SPL boot devices
Quentin Schulz [Mon, 9 Jan 2023 10:36:42 +0000 (11:36 +0100)]
rockchip: px30: list possible SPL boot devices

BOOTROM sets a bit in a CPU register so that the software can know from
where the first stage bootloader was booted. One use case for this is to
specify the default loading medium for U-Boot proper to match the one
used by the BOOTROM to load the SPL (same-as-spl in
u-boot,spl-boot-order).

Let's create the mapping between BOOTROM value and Device Tree node
names for MMC devices.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
23 months agorockchip: px30: fix CFG_IRAM_BASE
Quentin Schulz [Mon, 9 Jan 2023 10:36:41 +0000 (11:36 +0100)]
rockchip: px30: fix CFG_IRAM_BASE

The IRAM on PX30 (or Int_MEM in datasheet) starts at 0xff0e0000 and not
0xff020000 as rightfully stated in the FIXME comment.

Let's fix it so that BROM_BOOTSOURCE_ID_ADDR points to the correct
address for PX30.

Fixes: 46281a76bee3 ("rockchip: add core px30 headers")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
23 months agorockchip: px30: fix possibly unused grf and cru variables
Quentin Schulz [Mon, 9 Jan 2023 10:36:40 +0000 (11:36 +0100)]
rockchip: px30: fix possibly unused grf and cru variables

The grf and cru are only used when no UART base is provided by the user
(defaults to UART2) or for UART1, UART3 and UART5 to be used for the
debug UART. Therefore, let's surround those variable definitions with
the proper checks.

This wasn't an issue before support for UART0 was added, because all
cases were using cru and grf. UART0 only uses pmucru so there's a need
to not define those variables anymore.

Fixes: d0af506625ff ("rockchip: px30: support debug uart on UART0")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: Add initial support for the PINE64 Pinephone Pro
Peter Robinson [Sat, 31 Dec 2022 09:24:00 +0000 (09:24 +0000)]
rockchip: Add initial support for the PINE64 Pinephone Pro

The Pinephone Pro is another device by PINE64. It's closely related
to the Pinebook Pro of which this initial support is derived from.

Specification:
- A variant of the Rockchip RK3399
- A 6 inch 720*1440 DSI display
- Front and rear cameras
- Type-C interface with alt mode display (DP 1.2) and PD charging
- 4GB LPDDR4 RAM
- 128GB eMMC
- mSD card slot
- An AP6255 module for 802.11ac WiFi and Bluetooth 5
- Quectel EG25-G 4G/LTE modem

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agoarm64: dts: rk3399: Add upstream Pinephone Pro dts
Peter Robinson [Sat, 31 Dec 2022 09:23:59 +0000 (09:23 +0000)]
arm64: dts: rk3399: Add upstream Pinephone Pro dts

Initial support for the PinePhone Pro has now landed upstream in
Linux 6.1 RC1 so sync the dts from 6.2-rc1 for initial support.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
23 months agoboard: rockchip: Add Edgeble Neu2 IO Board
Jagan Teki [Wed, 14 Dec 2022 17:51:11 +0000 (23:21 +0530)]
board: rockchip: Add Edgeble Neu2 IO Board

Neural Compute Module 2(Neu2) IO board is an industrial form factor
IO board from Edgeble AI.

General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansion

Neu2 needs to mount on top of this IO board in order to create complete
Edgeble Neural Compute Module 2(Neu2) IO platform.

Add support for it.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
23 months agoARM: dts: rockchip: Add rv1126-u-boot.dtsi
Jagan Teki [Wed, 14 Dec 2022 17:51:10 +0000 (23:21 +0530)]
ARM: dts: rockchip: Add rv1126-u-boot.dtsi

Add u-boot,dm-spl and u-boot,dm-pre-reloc related properties
for Rockchip RV1126 SoC.

Both eMMC and SD boot are tested in Edgeble Neu2 SoM.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2) IO
Jagan Teki [Wed, 14 Dec 2022 17:51:09 +0000 (23:21 +0530)]
ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2) IO

Neural Compute Module 2(Neu2) IO board is an industrial form factor
evaluation board from Edgeble AI.

General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansion

Neu2 needs to mount on top of this IO board in order to create complete
Edgeble Neural Compute Module 2(Neu2) IO platform.

Add support for it.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
23 months agoARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2)
Jagan Teki [Wed, 14 Dec 2022 17:51:08 +0000 (23:21 +0530)]
ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2)

Neural Compute Module 2(Neu2) is a 96boards SoM-CB compute module
based on Rockchip RV1126 from Edgeble AI.

General features:
- Rockchip RV1126
- 2/4GB LPDDR4
- 8/16/32GB eMMC
- 2x MIPI CSI2 FPC connector
- Fn-link 8223A-SR WiFi/BT

Industrial grade (-40 °C to +85 °C) version of the same class of module
called Neu2k powered with Rockchip RV1126K.

Neu2 needs to mount on top of Edgeble IO boards for creating complete
platform solutions.

Add support for it.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
23 months agorockchip: mkimage: Add rv1126 support
Jagan Teki [Wed, 14 Dec 2022 17:51:07 +0000 (23:21 +0530)]
rockchip: mkimage: Add rv1126 support

Add support for rv1126 package header in mkimage tool.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarm: rockchip: rv1126: Set dram area unsecure for SPL
Jagan Teki [Wed, 14 Dec 2022 17:51:06 +0000 (23:21 +0530)]
arm: rockchip: rv1126: Set dram area unsecure for SPL

Unsecure the dram area so that MMC, USB, and SFC controllers
can able to read data from dram.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarm: rockchip: Add RV1126 arch core support
Jagan Teki [Wed, 14 Dec 2022 17:51:05 +0000 (23:21 +0530)]
arm: rockchip: Add RV1126 arch core support

Rockchip RV1126 is a high-performance vision processor SoC
for IPC/CVR, especially for AI related application.

Add arch core support for it.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I22fde40ec375e3c6aba39808abf252edc45d4b04

23 months agoARM: dts: rockchip: Add Rockchip RV1126 SoC
Jagan Teki [Wed, 14 Dec 2022 17:51:04 +0000 (23:21 +0530)]
ARM: dts: rockchip: Add Rockchip RV1126 SoC

RV1126 is a high-performance vision processor SoC for IPC/CVR,
especially for AI related application.

It is based on quad-core ARM Cortex-A7 32-bit core which integrates
NEON and FPU. There is a 32KB I-cache and 32KB D-cache for each core
and 512KB unified L2 cache. It has build-in NPU supports INT8/INT16
hybrid operation and computing power is up to 2.0TOPs.

This patch add basic core dtsi support.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
23 months agoARM: dts: rockchip: Add Rockchip RV1126 pinctrl
Jagan Teki [Wed, 14 Dec 2022 17:51:03 +0000 (23:21 +0530)]
ARM: dts: rockchip: Add Rockchip RV1126 pinctrl

Add pinctrl definitions for Rockchip RV1126.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarm: rockchip: Add grf header for rv1126
Jagan Teki [Wed, 14 Dec 2022 17:51:02 +0000 (23:21 +0530)]
arm: rockchip: Add grf header for rv1126

Add GRF header for Rockchip RV1126.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agodt-bindings: power: Add power-domain header for rv1126
Jagan Teki [Wed, 14 Dec 2022 17:51:01 +0000 (23:21 +0530)]
dt-bindings: power: Add power-domain header for rv1126

Add power-domain header for RV1126 SoC from description in TRM.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoclk: rockchip: Add rv1126 clk support
Jagan Teki [Wed, 14 Dec 2022 17:51:00 +0000 (23:21 +0530)]
clk: rockchip: Add rv1126 clk support

Add clock driver support for Rockchip RV1126 SoC.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agodt-bindings: clk: Add dt-binding header for RV1126
Jagan Teki [Wed, 14 Dec 2022 17:50:59 +0000 (23:20 +0530)]
dt-bindings: clk: Add dt-binding header for RV1126

Add the dt-bindings header for the Rockchip RV1126, that gets shared
between the clock controller and the clock references in the dts.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarch: rockchip: Add cru header for rv1126
Jagan Teki [Wed, 14 Dec 2022 17:50:58 +0000 (23:20 +0530)]
arch: rockchip: Add cru header for rv1126

Add clock and reset unit header include for rv1126.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agopinctrl: rockchip: Add rv1126 support
Jagan Teki [Wed, 14 Dec 2022 17:50:57 +0000 (23:20 +0530)]
pinctrl: rockchip: Add rv1126 support

Add pinctrl driver for Rockchip RV1126.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agopinctrl: rockchip: Add pinctrl route types
Jagan Teki [Wed, 14 Dec 2022 17:50:56 +0000 (23:20 +0530)]
pinctrl: rockchip: Add pinctrl route types

Some pins in rockchip are routed via Top GRF and PMU GRF
instead of direct regmap.

Add support to handle all these routing paths so that the
SoC pinctrl drivers will use them accordingly.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Add rv1126 lpddr4 support
Jagan Teki [Wed, 14 Dec 2022 17:50:55 +0000 (23:20 +0530)]
ram: rockchip: Add rv1126 lpddr4 support

Add LPDDR4 detection timings and support for RV1126.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: rv1126: Control ddr init prints via DEBUG
Jagan Teki [Wed, 14 Dec 2022 17:50:54 +0000 (23:20 +0530)]
ram: rockchip: rv1126: Control ddr init prints via DEBUG

Control the ddr init print messages via RAM_ROCKCHIP_DEBUG
instead of printing by default.

This gives an option to configs to enable these prints or
not.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Add rv1126 ddr driver support
Jagan Teki [Wed, 14 Dec 2022 17:50:53 +0000 (23:20 +0530)]
ram: rockchip: Add rv1126 ddr driver support

Add DDR driver for Rockchip RV1126 SoC.

Signed-off-by: YouMin Chen <cym@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Add rv1126 ddr loader params
Jagan Teki [Wed, 14 Dec 2022 17:50:52 +0000 (23:20 +0530)]
ram: rockchip: Add rv1126 ddr loader params

Add DDR loader parameters for Rockchip RV1126 SoC.

Signed-off-by: YouMin Chen <cym@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Add rv1126 ddr3 support
Jagan Teki [Wed, 14 Dec 2022 17:50:51 +0000 (23:20 +0530)]
ram: rockchip: Add rv1126 ddr3 support

Add DDR3 detection timings for Rockchip RV1126 SoC.

Signed-off-by: YouMin Chen <cym@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Update ddr pctl regs for px30
Jagan Teki [Wed, 14 Dec 2022 17:50:50 +0000 (23:20 +0530)]
ram: rockchip: Update ddr pctl regs for px30

Add full ddr pctl registers and bit masks for px30.

Signed-off-by: YouMin Chen <cym@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Compute ddr capacity based on grf split
Jagan Teki [Wed, 14 Dec 2022 17:50:49 +0000 (23:20 +0530)]
ram: rockchip: Compute ddr capacity based on grf split

DDR chip capacity is computed based on GRF split in some
Rockchip SoC's like PX30 and RV1126.

Add split argument in ddr print info so-that the respective
ddr driver will pass the grf split.

Signed-off-by: YouMin Chen <cym@rock-chips.com>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: rockchip: Add common ddr type configs
Jagan Teki [Wed, 14 Dec 2022 17:50:48 +0000 (23:20 +0530)]
ram: rockchip: Add common ddr type configs

We have common ddr types in rockchip or in general. So use
the common ddr type names instead of per Rockchip SoC to
avoid confusion.

The respective ddr type names will use on the associated
ddr SoC driver as these drivers are built per SoC at a time.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoram: Mark ram-uclass depend on TPL_DM or SPL_DM
Jagan Teki [Wed, 14 Dec 2022 17:50:47 +0000 (23:20 +0530)]
ram: Mark ram-uclass depend on TPL_DM or SPL_DM

ram-uclass is building irrespective of whether TPL_DM
or SPL_DM is enabled. So control the ram uclass build
based on TPL/SPL_DM.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoconfigs: roc-pc-rk3399: Enable rockchip efuse support
Christopher Obbard [Wed, 23 Nov 2022 13:59:02 +0000 (13:59 +0000)]
configs: roc-pc-rk3399: Enable rockchip efuse support

Enable efuse support which allows reading of the cpuid#, serial#
and also generates a unique mac address from the board's serial.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: mkimage: make RC4 key const
John Keeping [Fri, 18 Nov 2022 16:13:18 +0000 (16:13 +0000)]
rockchip: mkimage: make RC4 key const

This is read-only data, so mark it as such.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorc4: mark key as const
John Keeping [Fri, 18 Nov 2022 16:13:17 +0000 (16:13 +0000)]
rc4: mark key as const

Key data is never written so the parameter can be const, which allows
putting fixed keys in .rodata.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: puma-rk3399: sync DTS with Linux kernel next-20221114
Quentin Schulz [Tue, 15 Nov 2022 14:46:23 +0000 (15:46 +0100)]
rockchip: puma-rk3399: sync DTS with Linux kernel next-20221114

This synchronizes the Device Trees related to Puma RK3399 SoM with Linux
kernel next-20221114 to include two important changes pertaining to
eMMC and SD card instability.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: clk: add watchdog clock to px30_clk_enable
Quentin Schulz [Mon, 14 Nov 2022 10:33:46 +0000 (11:33 +0100)]
rockchip: clk: add watchdog clock to px30_clk_enable

Add the PCLK_WDT_NS clock to px30_clk_enable so that the watchdog driver
can probe since it wants to enable this clock.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: px30: make watchdog and tsadc trigger a first global reset
Quentin Schulz [Fri, 11 Nov 2022 11:25:48 +0000 (12:25 +0100)]
rockchip: px30: make watchdog and tsadc trigger a first global reset

By default, the PX30 is configured for watchdog and tsadc to trigger a
second global reset which is a more permissive reset than first global
reset.

From TRM part 1 "2.3 System Reset Solution":
glb_srstn_1 will reset the all logic, and
glb_srstn_2 will reset the all logic except GRF, SGRF and all GPIOs.

This enforces that the watchdog and tsadc trigger glb_srstn_1 as
similarly done for RK3399 in U-Boot (in SDRAM driver for some reason?),
TF-A and Coreboot.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 15 Jan 2023 15:31:17 +0000 (10:31 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sh

23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sun, 15 Jan 2023 15:31:00 +0000 (10:31 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

23 months agousb: gadget: dwc2_udc_otg: implement pullup()
Mattijs Korpershoek [Wed, 11 Jan 2023 08:19:27 +0000 (09:19 +0100)]
usb: gadget: dwc2_udc_otg: implement pullup()

Pullup is used by the usb framework in order to do software-controlled
usb_gadget_connect() and usb_gadget_disconnect().

Implement pullup() for dwc2 using the SOFT_DISCONNECT bit in the dctl
register:
* when pullup is on, clear SOFT_DISCONNECT
* when pullup is off, set SOFT_DISCONNECT

This is especially useful when a gadget disconnection is initiated but
no board_usb_cleanup() is called.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
23 months agousb: gadget: fastboot: detach usb just before rebooting
Dario Binacchi [Sat, 7 Jan 2023 16:48:07 +0000 (17:48 +0100)]
usb: gadget: fastboot: detach usb just before rebooting

The patch fixes the following error when updating a BSH SMM S2 board:
3:72>Start Cmd:FB[-t 8000]: ucmd nand write ${loadaddr} nanddtb ${filesize}
3:72>Okay (0.023s)
3:72>Start Cmd:FB: reboot
3:72>Fail Bulk(R):LIBUSB_ERROR_IO(0s)

The "fastboot reboot" command detaches the USB when it still needs to be
used. So let's detach the USB just before the reset.

CC: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Fixes: 5f7e01e9d5d800 ("usb: gadget: fastboot: detach usb on reboot commands")
Suggested-by: Michael Trimarchi <michael@amarulasolutions.com>
Co-developed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agousb: hub: allow to increase HUB_DEBOUNCE_TIMEOUT
Patrick Delaunay [Fri, 9 Sep 2022 09:45:23 +0000 (11:45 +0200)]
usb: hub: allow to increase HUB_DEBOUNCE_TIMEOUT

Add a new CONFIG_USB_HUB_DEBOUNCE_TIMEOUT to increase the
HUB_DEBOUNCE_TIMEOUT value, for example to 2s because some usb device
needs around 1.5s or more to make the hub port status to be
connected steadily after being powered off and powered on.

This 2s value is aligned with Linux driver and avoids to configure
"usb_pgood_delay" as a workaround for connection timeout on
some USB device; normally the env variable "usb_pgood_delay" is used
to delay the first query after power ON and thus the device answer,
but this variable not used to increase the connection timeout delay.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
23 months agoconfigs: r8a77980: Condor: Enable MMC support by default
Andrey Dolnikov [Thu, 22 Dec 2022 21:18:25 +0000 (22:18 +0100)]
configs: r8a77980: Condor: Enable MMC support by default

This enables MMC support, which is available
on Condor board, by default.

Signed-off-by: Andrey Dolnikov <andrey.dolnikov@cogentembedded.com>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
23 months agoARM: renesas: condor: switch eMMC bus to 1V8
Hai Pham [Thu, 22 Dec 2022 21:18:01 +0000 (22:18 +0100)]
ARM: renesas: condor: switch eMMC bus to 1V8

The eMMC card has two supplies, VCC and VCCQ. The VCC supplies the NAND
array and the VCCQ supplies the bus. On Condor, the VCC is connected to
3.3V rail, while the VCCQ is connected to 1.8V rail. Adjust the pinmux
to match the bus, which is always operating in 1.8V mode.

Based on Linux commit 69efe4bbeda50745 ("arm64: dts: renesas: condor:
Switch eMMC bus to 1V8") from Wolfram Sang

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
23 months agoARM: dts: renesas: condor: Enable SPI NOR fast-read
Marek Vasut [Thu, 22 Dec 2022 21:17:20 +0000 (22:17 +0100)]
ARM: dts: renesas: condor: Enable SPI NOR fast-read

This board requires SPI NOR fast-read, otherwise the SPI NOR
access returns corrupted data. Enable the fast-read explicitly
in DT as it has been disabled in the MTD subsystem by commit
d008190920 ("mtd: spi-nor: Mask out fast read if not requested in DT")

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agoARM: renesas: ulcb: Set CONFIG_TEXT_BASE=0x0 on R-Car Gen3 ULCB
Marek Vasut [Thu, 22 Dec 2022 21:06:46 +0000 (22:06 +0100)]
ARM: renesas: ulcb: Set CONFIG_TEXT_BASE=0x0 on R-Car Gen3 ULCB

Since R-Car Gen3 already enables position independent build, also set
CONFIG_TEXT_BASE=0x0 to finalize the switch. This is possible since
534f0fbd65 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y")
fixed current env_get_char() crash with CONFIG_TEXT_BASE=0x0 .

This change permits us to start U-Boot from any location in DRAM instead
of specific TEXT_BASE.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agoARM: renesas: condor: Set CONFIG_TEXT_BASE=0x0 on R-Car Gen3 Condor
Marek Vasut [Thu, 22 Dec 2022 21:07:08 +0000 (22:07 +0100)]
ARM: renesas: condor: Set CONFIG_TEXT_BASE=0x0 on R-Car Gen3 Condor

Since R-Car Gen3 already enables position independent build, also set
CONFIG_TEXT_BASE=0x0 to finalize the switch. This is possible since
534f0fbd65 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y")
fixed current env_get_char() crash with CONFIG_TEXT_BASE=0x0 .

This change permits us to start U-Boot from any location in DRAM instead
of specific TEXT_BASE.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agoARM: renesas: Enable LTO on R-Car3 Falcon
Marek Vasut [Thu, 22 Dec 2022 21:13:15 +0000 (22:13 +0100)]
ARM: renesas: Enable LTO on R-Car3 Falcon

Enable LTO (link time optimization) to improve optimization
and reduce code size by cca. 30 kiB.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>