At present a new directory device is created for every access to a
directory. This means that a new device is always created when 'ls' is
used.
Where the directory being accessed matches an existing device, this is
not necessary.
Check that path against existing directories and reuse the device if
possible.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is easier to use an empty string when the root directory is intended.
Adjust the code to drop use of "/" and NULL and just use and empty
string.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than creating a new stream, which gets lost, virtio_fs_dir_open()
should use the existing one. Fix it, so that the fh member is preserved
for future use.
This fixes a problem where the fh value is not preserved, thus causing
a subsequent 'ls' on the same directory to fail.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: #15
Sometimes it is useful to test a commit just on the lab, or even just on
a particular board in the lab. Add support for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Expand the CI documentation to mention the concept tree. Add a reference
to the page from the build page.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is useful to show a boot logo when starting up. Add the BGRT table
after the QEMU-provided tables.
Signed-off-by: Simon Glass <sjg@chromium.org>
Cover-letter:
emulation: Improve ACPI support for qemu-x86_64
When running under QEMU U-Boot obtains its ACPI tables from QEMU, since
it has the require information. This works well in most cases.
QEMU also provides SMBIOS tables, but U-Boot doesn't currently use those
on x86. This creates problems if a VM environment is expecting to see
particular values (e.g. those which it passed to QEMU!) when booting. So
this series switches QEMU on x86 to use those SMBIOS tables.
Finally, there is a facility in EFI for showing a boot logo, via a BGRT
table. QEMU does not provide this itself, so this series augments the
ACPI tables with a new BGRT table containing a suitable logo.
END
QEMU provides a table indicating the checksums to be calculated. U-Boot
already handles this, so we don't need to compute the checksums at the
end. Drop this unnecessary code.
Signed-off-by: Simon Glass <sjg@chromium.org>
EFI has a Boot Graphics Record Table which can be used to show a logo
when booting up and shutting down.
Add support for adding this to the image, using a U-Boot logo which
includes the name, since many people will be unfamiliar with the logo.
Signed-off-by: Simon Glass <sjg@chromium.org>
This rule assumes that any .bmp file relates to the logo. We want to be
able to add a second BMP in some cases, so update the rule to match
a filename ending in '_logo.bmp'
Signed-off-by: Simon Glass <sjg@chromium.org>
While U-Boot can create its own tables, the ones from QEMU should be
used when booting within QEMU. For example, LXD uses some of the fields
to decide whether to start cloud-init or not.
Signed-off-by: Simon Glass <sjg@chromium.org>
For QEMU we want to add new tables to the end of what QEMU provides. Add
a function to find the correct place for a new table.
Add a function to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present acpi_find_table() support locating most of the tables, but
not these two, since they are the pointers to the rest.
When adding new tables, these tables need to be located and updated, so
update acpi_find_table() to allow searching for them.
Signed-off-by: Simon Glass <sjg@chromium.org>
The acpi_table.c file includes ACPI_WRITER() declarations and is only
included in the build if CONFIG_ACPIGEN is enabled.
For QEMU we want to augment the tables provided via qfw, but
CONFIG_ACPIGEN is not enabled.
Move the core functions out to the acpi.c file which is included in all
x86 builds. This allows the QEMU build to make use of these functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
The start of this function determines whether xdst or rdsp is used for
locating tables. Move it into a separate function so that we can use
this logic elsewhere.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update this function to make use of the new support for reading qfw
files, this simplifying it considerably.
Fix up the header order while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than searching for this table, use the existing search function.
Update that to check the header and checksums.
This allows the code to work correctly with boards that have the tables
in a bloblist, such as QEMU.
Signed-off-by: Simon Glass <sjg@chromium.org>
The RSP is not valid unless the checksums are corrrect, so add a test
for this.
Add a few blank lines for readability while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Create a function for this checksumming, since it is not trivial. This
will allow the code to be shared with tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
Enable the virtio-rnd-pci device in QEMU so that fdt_test_chosen() can
operated.
Since overlays are enabled for qemu-x886_64
Signed-off-by: Simon Glass <sjg@chromium.org>
This test skips itself if not running on sandbox, but by that time the
driver model state has already been reset. This can impact other tests.
Change the test so that it is only started on sandbox.
Signed-off-by: Simon Glass <sjg@chromium.org>
There is no guarantee that the RNG device has a sequence number of zero.
Use the first available device instead, by default.
This resolved a failure to find the device with qemu-x86_64 when the
virtio device is used.
Signed-off-by: Simon Glass <sjg@chromium.org>
The existing code reads a single byte into a 32-bit variable. It works
fine but is a bit confusing. There is no need to read only one byte, so
update it to read the whole 32 bits.
Series-to: u-boot
Cover-letter:
emulation: Expand qfw and virtio commands
This series adds various features to the qfw command, mostly targeting
x86-specific features:
- commands to show the E820, ACPI-loader, etc. provided by QMEU
- unit tests for the qfw command
- virtio subcommand to list the devices
The bdinfo command contains some useful printing function which could be
used more generally in U-Boot. This series moves those into the lib/
directory and renames them to be more generic.
Various clean-ups are included, such as documentation for the virtio
fw_cfg selectors.
This series includes some minor test/ fixes noticed when creating this
series.
It also brings in a few qconfig patches which didn't make it into the
main U-Boot tree.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
The current priority of BOOTDEVP_4_SCAN_FAST means that virtio is
scanned after SCSI. But virtio-scsi provides higher performance.
It seems better to regard virtio has an internal device, since it is
paravirtualised and thus fast. Change its bootdev priority to
BOOTDEVP_2_INTERNAL_FAST
Disable the virtio-fs feature on sandbox, since the virtio queue is not
not yet supported by the emulator.
Signed-off-by: Simon Glass <sjg@chromium.org>
U-Boot only supports a subset of the devices supported by QEMU. For
example, U-Boot does not currently support the vsock device.
It is helpful to see what devices are provided by QEMU and whether there
is a driver for it in U-Boot.
Add a new 'virtio list' command to provide this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Even if U-Boot doesn't have a driver for all of the virtio devices
provided by QEMU, it is still useful to see what they are. Fill out the
table of device types and names, so that 'virtio list' lists them all.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a simple command to read a named file into memory.
Skip this test on sandbox for now, as it doesn't support this feature in
its emulation of QEMU.
Signed-off-by: Simon Glass <sjg@chromium.org>
There are a few selectors in a different region which contain what seems
to be arch-specific information. Add a way to display this. So far it
only works on x86.
Signed-off-by: Simon Glass <sjg@chromium.org>
QEMU provides a table containing the ACPI tables and information on how
to relocate them to any suitable memory address. Add a command to show
this information.
Signed-off-by: Simon Glass <sjg@chromium.org>
There are quite a few values provided by QEMU and used by U-Boot, for
which it isn't possible to see the values. Add a new 'qfw dump' command
to support this.
Skip this test on sandbox for now, as it doesn't support this feature in
its emulation of QEMU.
Signed-off-by: Simon Glass <sjg@chromium.org>
There are a few entries missing from this enum. Add them and add
comments for all items, since this doesn't seem to be clearly documented
within QEMU itself.
Signed-off-by: Simon Glass <sjg@chromium.org>
Update the command to show the size and selected file, since this is
useful information at times. Add a heading so it is clear what each
field refers to.
Add a simple test as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
On 64-bit machines we don't always want to show 16 hex digits,
particularly if the value is 32-bit. Add a new function to show a 32-bit
value.
Signed-off-by: Simon Glass <sjg@chromium.org>
The bdinfo command makes use of quite a few functions which show a label
followed by a value, on a single line.
This sort of thing is generally useful outside of bdinfo, so move it to
a generic place. Use 'l' (for label) as the prefix.
The margin is still hard-coded to 12, which seems a reasonable limit for
a label.
Signed-off-by: Simon Glass <sjg@chromium.org>