Commit Graph

88393 Commits

Author SHA1 Message Date
Simon Glass
831405f41d bootstd: Support bootmeths which can scan any partition
Some bootmeths support scanning a partition without a filesystem on it.
Add a flag to support this.

This will allow the ChromiumOS bootmeth to find kernel partition, which
are stored in a special format, without a filesystem.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
f55aa4454a part: Add a fallback for part_get_bootable()
This function can be called when partition support is disabled. Add a
static inline to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
d08db02d2d bootstd: Add a test for bootmeth_cros
The ChromiumOS bootmeth has no tests at present. Before adding more
features. add a basic test.

This creates a disk which can be scanned by the bootmeth, so make sure
things work. It is quite rudimentary, since the kernel is faked, the root
disk is missing and there is no cmdline stored.

Enable the bootmeth for snow so it can build the unit test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
2b9adcaca2 bootstd: test: Allow binding and using any mmc device
We currently use mmc4 for tests. Update the function which sets this up
so that it can handle any device.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
c3867e2e98 bootflow: Show an empty filename when there is none
At present 'bootflow list' shows <NULL> for the filename when it is not
present. Show an empty string instead, since that is more user-friendly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
00613bc19a test: Move 1MB.fat32.img and 2MB.ext2.img
These are currently created in the source directory, which is not ideal.
Move them to the persistent-data directory instead. Update the test so
skip validating the filename, since it now includes a full path.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
e2d22f7822 sandbox: Add a way to access persistent test files
Some pytests create files in the persistent-data directory. It is useful
to be able to access these files in C tests. Add a function which can
locate a file given its leaf name, using the environment variable set
up in test/py/conftest.py

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
8d6337e691 uuid: Move function comments to header file
These should be in the header file for easy browsing, not in the source
code. Move them and add a missing Return on one of the functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
c837a1423c dm: core: Correct error handling when event fails
Follow the correct path in device_probe() when and event handler fails.
This avoids getting into a strange state where the device appears to be
activated but is not.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
fbd644e702 part: efi: Add debugging for the signature check
Add a little more debugging for the initial signature check. Drop the
pointless check for NULL. Also set a log category while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
b2b7e6c181 part: Add an accessor for struct disk_partition sys_ind
This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add an accessor. Update the only usage.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
bcd645428c part: Add accessors for struct disk_partition type_uuid
This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add accessors. Update all code to use it.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
c5f1d005f5 part: Add accessors for struct disk_partition uuid
This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add accessors. Update all code to use it.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
ade2316da3 part: Add comments for static functions
Some internal functions could do with a few comments, to explain what they
do. Add these, to make the code easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
060148a371 part: nac: Use desc instead of dev_desc
The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the mac code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
06e293ed7c part: iso: Use desc instead of dev_desc
The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the iso code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
7ed781fb4c part: efi: Use desc instead of dev_desc
The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the efi code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
cfdcd41e5a part: dos: Use desc instead of dev_desc
The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the dos code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
3557e8d223 part: amiga: Use desc instead of dev_desc
The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the amiga code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
5aab05d97e part: Use desc instead of dev_desc
The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the partition code to
just use 'desc', as is done with driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Tom Rini
05763b71d2 Merge branch '2023-08-25-add-persistent-config-editor-via-expo' into next
To quote the author:
So far cedit does not support reading and writing the configuration.
This series add several features related to this:

First, it adds support for using a file on a filesystem. This is in
FDT format and provides enough information to reset the cedit back to
the saved settings.

Second, it adds support for using the U-Boot environment. Since the
environment is generally saved across reboots, this feature provides an
easy way of storing the state on most boards. The variables all have a
'c.' prefix to avoid confusion with other variables.

Finally it adds support for using CMOS RAM. This is commonly used on x86
devices to store BIOS settings. The expo schema provides information on
the register layout.

Some other minor tweaks and improvements are included along the way.
2023-08-25 17:52:59 -04:00
Simon Glass
84b08afcbb expo: doc: Update documentation for persistent settings
Add mention of persistent settings in the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
cfc402db39 expo: cedit: Support reading settings from CMOS RAM
Add a command to read edit settings from CMOS RAM, using the cedit
definition to indicate which registers and bits are used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
eb6c71b562 expo: cedit: Support writing settings to CMOS RAM
Add a command to write cedit settings to CMOS RAM so that it can be
preserved across a reboot. This uses a simple bit-encoding, where each
field has a 'bit position' and a 'bit length' in the schema.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
bcf2b7202e expo: cedit: Support reading settings from environment vars
Add a command to read cedit settings from environment variables so that
they can be restored as part of the environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
fc9c0e0771 expo: cedit: Support writing settings to environment vars
Add a command to write cedit settings to environment variables so that
they can be stored with 'saveenv'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
472317cb12 expo: cedit: Support reading settings from a file
Add a command to read cedit settings from a devicetree file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
2dee81fe5f expo: cedit: Support writing settings to a file
Support writing settings from an expo into a file in FDT format. It
consists of a single node with a two properties for each sceneitem,
one with tag ID chosen by the user and another for its text value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
6e648fa781 expo: Export scene_menuitem_find() for use in internal code
Make this function available to other expo code so we can use it to look
up a menu item.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
d65ccbb601 doc: Expand documentation for the cedit command
Add a little information about each subcommand.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
2045ca5c1f expo: Move cedit theme under bootstd
This is related to standard boot, so put it under the same node. This may
simplify schema upstreaming later.

Mention themes in the documentation while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
c5aacf5ef8 expo: Add documentation for the configuration editor
This is mentioned in passing in the 'cedit' command. Its file format is
described under `expo`. But it would be better if it had its own entry
in the documentation.

Add a new 'cedit' entry with a few details about this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
d5737b3f6a expo: Tidy up the expo.py tool and usage
Tidy up this tool a little:

- define which arguments are needed
- split the enum values out into a header file
- warn if no enum values are found
- display the dtc error if something goes wrong
- avoid a Python traceback on error

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
8d0f890a0b expo: Add a function to prepare a cedit
Split out the code which prepares the cedit for use, so we can call it
from a test.

Add a log category while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
f80ebb2fe1 expo: Move cedit test into its own file and tidy
Move this test out so it can have its own file. Rename the test to use
a cedit_ prefix.

This allows us to drop the check for CONFIG_CMD_CEDIT in the test.

Also we don't need driver model objects for this test, so drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
040b04685e expo: Split out cedit into its own header
Before adding more functions to this interface, create a new header for
the configuration editor.

Fix up the expo header guard while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
431b21fd40 expo: Refactor menu_build() to return the object created
The caller reads the ID but menu_build() does this again. Add the ID as
a parameter to avoid this. Return the object created so that the caller
can adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
f2eb6ad50a expo: Provide a way to iterate through all scene objects
For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
34ecba1f76 abuf: Allow incrementing the size
Provide a convenience function to increment the size of the abuf.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
633b3dc755 expo: Make scene_obj_find() take a const scene
This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Tom Rini
7c6b18fb54 Merge branch '2023-08-24-enable-more-features-in-qemu-arm' into next
To quote the author:
Now that the driver for the Bochs VGA card emulated by QEMU is no longer
limited to x86 architectures, this series enables it on arm and arm64 virtual
machines to provide a graphical interface. In line with that series this also
enables console buffering and USB keyboard.

Tested with the Debian 12 installer using GRUB EFI:

  $ tools/buildman/buildman -o build/qemu_arm64 --boards=qemu_arm64 -w
  $ cd build/qemu_arm64
  $ curl -L -o debian.img \
      https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-12.0.0-arm64-netinst.iso
  $ qemu-system-aarch64 \
      -machine virt -cpu cortex-a53 -m 4G -smp 4 \
      -bios u-boot.bin \
      -serial stdio -device VGA \
      -nic user,model=virtio-net-pci \
      -device virtio-rng-pci \
      -device qemu-xhci,id=xhci -device usb-kbd -device usb-tablet \
      -drive if=virtio,file=debian.img,format=raw,readonly=on,media=cdrom

And with one using extlinux.conf:

    $ [...]
    $ curl -L -o head.img.gz \
        https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/gtk/firmware.none.img.gz
    $ curl -L -o partition.img.gz \
        https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/gtk/partition.img.gz
    $ zcat head.img.gz partition.img.gz >debian.img
    $ [...]

Both can get to a graphical installer just fine, in addition to U-Boot
video console showing up in a GTK window.
2023-08-24 17:42:48 -04:00
Alper Nebi Yasak
8def269365 doc: qemu: arm: Add a section on booting Linux distros
Add an example qemu-system-aarch64 command that can make U-Boot on QEMU
boot into the Debian Installer, along with resulting console messages
from U-Boot, based on the existing documentation section for the x86
version.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-08-24 16:47:25 -04:00
Alper Nebi Yasak
05e2fa7931 arm: qemu: Enable usb keyboard as an input device
Commit 02be57caf7 ("riscv: qemu: Enable usb keyboard as an input
device") adds PCI xHCI support to QEMU RISC-V virtual machines and
enables using a USB keyboard as one of the input devices. Similarly,
enable those for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
2023-08-24 16:47:25 -04:00
Alper Nebi Yasak
120f540a71 arm: qemu: Enable PRE_CONSOLE_BUFFER
Commit 608b80b5b8 ("riscv: qemu: Enable PRE_CONSOLE_BUFFER") enables
buffering console messages for QEMU RISC-V virtual machines so those
printed before the video console is available will still show up on the
display. Similarly, enable it for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
2023-08-24 16:47:05 -04:00
Alper Nebi Yasak
4d6641d5db arm: qemu: Enable Bochs video support
Commit 716161663e ("riscv: qemu: Enable Bochs video support") enables
a video console for QEMU RISC-V virtual machines using an emulated Bochs
VGA card. Similarly, enable it for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
2023-08-24 16:47:05 -04:00
Tom Rini
6de1a3eb80 Merge branch '2023-08-24-further-ufs-updates' into next
- Cleanup and improve the UFS subsystem slightly, in preparation for
  supporting more platforms.
2023-08-24 15:39:55 -04:00
Marek Vasut
c5b3e5cd3d ufs: Implement cache management
Add function to flush and invalidate cache over request and response
queue entries, and perform flush and optional invalidate over block
layer data that are passed into the UFS layer. This makes it possible
to use UFS with caches enabled.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24 13:47:44 -04:00
Marek Vasut
12675cb100 ufs: Use utp_transfer_req_desc pointer in ufshcd_get_tr_ocs
Use utp_transfer_req_desc pointer to reference to utrdl queue
instead of referencing the queue directly. This makes the code
more consistent. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24 13:47:43 -04:00
Marek Vasut
7f26fcbea8 ufs: Pass hba pointer to ufshcd_prepare_req_desc_hdr()
Pass the hba pointer itself to ufshcd_prepare_req_desc_hdr()
instead of duplicating utp_transfer_req_desc access at each
call site. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24 13:47:43 -04:00
Marek Vasut
2ff810ae5e ufs: Handle UFS 3.0 controllers
Extend the version check to handle UFS 3.0 controllers as well.
Tested on R-Car S4 UFS 3.0 controller.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24 13:47:43 -04:00