]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
6 years agodm: test: Add "/firmware" node scan test
Rajan Vaja [Wed, 19 Sep 2018 10:43:46 +0000 (03:43 -0700)]
dm: test: Add "/firmware" node scan test

Add a test which verifies that all subnodes under "/firmware"
nodes are scanned.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Added 'imply FIRMWARE' to sandbox Kconfig to fix test failures, fixed
ordering of lines in arch/sandbox/dts/test.dts and test/dm/Makefile,
updated #if condition in drivers/firmware/firmware-uclass.c:
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofirmware: Add FIRMWARE config prompt string
Rajan Vaja [Wed, 19 Sep 2018 10:43:43 +0000 (03:43 -0700)]
firmware: Add FIRMWARE config prompt string

There is no prompt string for FIRMWARE config. Without this,
FIRMWARE config cannot be enabled through menuconfing or
config file. Fix this by adding prompt summary.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agosandbox: Add an explanation of the sandbox variants
Simon Glass [Wed, 19 Sep 2018 00:43:28 +0000 (18:43 -0600)]
sandbox: Add an explanation of the sandbox variants

There are quite a few builds of sandbox now. Add information about these
to the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobuildman: Avoid hanging when the config changes
Simon Glass [Tue, 18 Sep 2018 05:55:42 +0000 (23:55 -0600)]
buildman: Avoid hanging when the config changes

Something has changed in the last several month such that when buildman
builds U-Boot incrementally and a new CONFIG option has been added to the
Kconfig, the build hanges waiting for input:

    Test new config (NEW_CONFIG) [N/y/?] (NEW)

Since binamn does not connect the build's stdin to anything this waits on
stdin to the build thread, which never comes. Eventually I suspect all the
threads end up in this state and the build does not progress.

Fix this by passing /dev/null as input to the build. That way, if there is
a new CONFIG, the build will stop (and fail):

    Test new config (NEW_CONFIG) [N/y/?] (NEW)

    Error in reading or end of file.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agoinclude/dm.h: Remove duplicated include directive
Liviu Dudau [Mon, 17 Sep 2018 16:46:07 +0000 (17:46 +0100)]
include/dm.h: Remove duplicated include directive

Remove duplicated inclusion of dm/ofnode.h

Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Drop period at end of commit subject:
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agoinclude/clk.h: Fix the name of the clock uclass in comment
Liviu Dudau [Mon, 17 Sep 2018 16:43:08 +0000 (17:43 +0100)]
include/clk.h: Fix the name of the clock uclass in comment

The comment references a structure name that doesn't exist. Use
the name of the actual uclass.

Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Drop period at end of commit subject:
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: fdtdec_setup_memory_banksize() use livetree
Jens Wiklander [Mon, 20 Aug 2018 09:09:59 +0000 (11:09 +0200)]
fdt: fdtdec_setup_memory_banksize() use livetree

Converts fdtdec_setup_memory_banksize() to use ofnode functions instead.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
6 years agocmd: clk: Add trivial implementation of clock dump for DM
Marek Vasut [Wed, 8 Aug 2018 20:10:44 +0000 (22:10 +0200)]
cmd: clk: Add trivial implementation of clock dump for DM

Add trivial implementation of the clk dump in case DM is enabled.
This implementation just iterates over all the clock registered
with the CLK uclass and prints their rate.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agotest: Add tests for board uclass
Mario Six [Tue, 31 Jul 2018 09:44:13 +0000 (11:44 +0200)]
test: Add tests for board uclass

Add tests for the new board uclass.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agoboard: Add gazerbeam driver
Mario Six [Tue, 31 Jul 2018 09:44:12 +0000 (11:44 +0200)]
board: Add gazerbeam driver

Add a board driver for the upcoming gdsys Gazerbeam board.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agodrivers: Add board uclass
Mario Six [Tue, 31 Jul 2018 09:44:11 +0000 (11:44 +0200)]
drivers: Add board uclass

Since there is no canonical "board device" that can be used in board
files, it is difficult to use DM function for board initialization in
these cases.

Hence, add a uclass that implements a simple "board device", which can
hold devices not suitable anywhere else in the device tree, and is also
able to read encoded information, e.g. hard-wired GPIOs on a GPIO
expander, read-only memory ICs, etc. that carry information about the
hardware.

The devices of this uclass expose methods to read generic data types
(integers, strings, booleans) to encode the information provided by the
hardware.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agotest: Add tests for dev_{enable, disable}_by_path
Mario Six [Tue, 26 Jun 2018 06:46:51 +0000 (08:46 +0200)]
test: Add tests for dev_{enable, disable}_by_path

Add tests for the dev_{enable,disable}_by_path functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agocore: Add dev_{disable,enable}_by_path
Mario Six [Tue, 26 Jun 2018 06:46:50 +0000 (08:46 +0200)]
core: Add dev_{disable,enable}_by_path

We cannot use device structures to disable devices, since getting
them with the API functions would bind and activate the device, which
would fail if the underlying device does not exist.
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agotest: Add tests for DT-manipulation functions
Mario Six [Tue, 26 Jun 2018 06:46:49 +0000 (08:46 +0200)]
test: Add tests for DT-manipulation functions

Add tests for the ofnode_set_enabled, ofnode_write_string, and
ofnode_write_property functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agocore: Add functions to set properties in live-tree
Mario Six [Tue, 26 Jun 2018 06:46:48 +0000 (08:46 +0200)]
core: Add functions to set properties in live-tree

Implement a set of functions to manipulate properties in a live device
tree:

* ofnode_write_prop() to set generic properties of a node
* ofnode_write_string() to set string properties of a node
* ofnode_set_enabled() to either enable or disable a node

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Allow writing a map file when something goes wrong
Simon Glass [Fri, 14 Sep 2018 10:57:36 +0000 (04:57 -0600)]
binman: Allow writing a map file when something goes wrong

When we get a problem like overlapping regions it is sometimes hard to
figure what what is going on. At present we don't write the map file in
this case. However the file does provide useful information.

Catch any packing errors and write a map file (if enabled with -m) to aid
debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support ELF files for U-Boot and SPL
Simon Glass [Fri, 14 Sep 2018 10:57:35 +0000 (04:57 -0600)]
binman: Support ELF files for U-Boot and SPL

For sandbox we want to put ELF files in the image since that is what we
need to execute. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Correct fmap output on x86
Simon Glass [Fri, 14 Sep 2018 10:57:34 +0000 (04:57 -0600)]
binman: Correct fmap output on x86

Normally x86 platforms use the end-at-4gb option. This currently produces
an FMAP with positions which have a large offset. The use of end-at-4gb is
a useful convenience within binman, but we don't really want to export
a map with these offsets.

Fix this by subtracting the 'skip at start' parameter.

Also put the code which convers names to fmap format, for clarity.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Record the parent section of each section
Simon Glass [Fri, 14 Sep 2018 10:57:33 +0000 (04:57 -0600)]
binman: Record the parent section of each section

At present sections have no record of their parent so it is not possible
to traverse up the tree to the root and figure out the position of a
section within the image.

Change the constructor to record this information.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support x86 microcode in TPL
Simon Glass [Fri, 14 Sep 2018 10:57:32 +0000 (04:57 -0600)]
binman: Support x86 microcode in TPL

When TPL is used on x86 we may want to program the microcode (at least for
the first CPU) early in boot. Add support for this by refactoring the
existing code to be more generic.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support hashing entries
Simon Glass [Fri, 14 Sep 2018 10:57:31 +0000 (04:57 -0600)]
binman: Support hashing entries

Sometimesi it us useful to be able to verify the content of entries with
a hash. Add an easy way to do this in binman. The hash information can be
retrieved from the device tree at run time.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Mention section attributes in docs
Simon Glass [Fri, 14 Sep 2018 10:57:30 +0000 (04:57 -0600)]
binman: Mention section attributes in docs

Images and sections have the same attributes, since an image is mostly
just a top-level section. Update the docs to explain this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support expanding entries
Simon Glass [Fri, 14 Sep 2018 10:57:29 +0000 (04:57 -0600)]
binman: Support expanding entries

It is useful to have entries which can grow automatically to fill
available space. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support adding files
Simon Glass [Fri, 14 Sep 2018 10:57:28 +0000 (04:57 -0600)]
binman: Support adding files

In some cases it is useful to add a group of files to the image and be
able to access them at run-time. Of course it is possible to generate
the binman config file with a set of blobs each with a filename. But for
convenience, add an entry type which can do this.

Add required support (for adding nodes and string properties) into the
state module.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Allow zero-size sections
Simon Glass [Fri, 14 Sep 2018 10:57:27 +0000 (04:57 -0600)]
binman: Allow zero-size sections

At present if there is only a zero-size entry in a section this is
reported as an error, e.g.:

   Offset 0x0 (0) is outside the section starting at 0x0 (0)

Adjust the logic in CheckEntries() to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support compressed entries
Simon Glass [Fri, 14 Sep 2018 10:57:26 +0000 (04:57 -0600)]
binman: Support compressed entries

Add support for compressing blob entries. This can help reduce image sizes
for many types of data. It requires that the firmware be able to
decompress the data at run-time.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agopatman: Detect missing tools and report them
Simon Glass [Fri, 14 Sep 2018 10:57:25 +0000 (04:57 -0600)]
patman: Detect missing tools and report them

When tools are needed but not present, at present we just get an error
which can be confusing for the user. Try to be helpful by reporting the
tool as missing and suggesting a possible remedy.

Also update the Run() method to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support updating all device tree files
Simon Glass [Fri, 14 Sep 2018 10:57:24 +0000 (04:57 -0600)]
binman: Support updating all device tree files

Binman currently supports updating the main device tree with things like
the position of each entry. Extend this support to SPL and TPL as well,
since they may need (a subset of) this information.

Also adjust DTB output files to have a .out extension since this seems
clearer than having a .dtb extension with 'out' in the name somwhere.

Also add a few missing comments and update the DT setup code to use
ReadFile and WriteFile().

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Allow control of whether a fake DT is used
Simon Glass [Fri, 14 Sep 2018 10:57:23 +0000 (04:57 -0600)]
binman: Allow control of whether a fake DT is used

We use a fake device tree in tests most of the time since tests don't
normally care about the actual data. For example, for U-Boot proper we use
U_BOOT_DTB_DATA which is just a four-character string. This makes testing
the image output against an expected value very easy.

However in some cases, such as when the test wants to check that the DT
output containing particular nodes, we do actually need the real DT. Add
support for this, along with a command-line option to select 'test mode'.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Obtain the list of device trees from the config
Simon Glass [Fri, 14 Sep 2018 10:57:22 +0000 (04:57 -0600)]
binman: Obtain the list of device trees from the config

We always have a device tree for U-Boot proper. But we may also have one
for SPL and TPL. Add a new Entry method to find out what DTs an entry
has, and use that list when updating DTs.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Centralise device-tree updates within binman
Simon Glass [Fri, 14 Sep 2018 10:57:21 +0000 (04:57 -0600)]
binman: Centralise device-tree updates within binman

At present we have a few calls to device-tree functions in binman and plan
to add more as we add new entry types which need to report their results.

It makes sense to put this code in a central place so that we can make
sure all device trees are updated. At present we only have U-Boot proper,
but plan to add SPL and TPL too.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Move state logic into the state module
Simon Glass [Fri, 14 Sep 2018 10:57:20 +0000 (04:57 -0600)]
binman: Move state logic into the state module

Rather than reaching into this module from control, move the code that
needs this info into state.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Move state information into a new module
Simon Glass [Fri, 14 Sep 2018 10:57:19 +0000 (04:57 -0600)]
binman: Move state information into a new module

At present the control module has state information in it, since it is the
primary user of this. But it is a bit odd to have entries and other
modules importing control to obtain this information.

It seems better to have a dedicated state module, which control can use as
well. Create a new module using code from control and update other modules
to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Add an entry method for getting the default filename
Simon Glass [Fri, 14 Sep 2018 10:57:18 +0000 (04:57 -0600)]
binman: Add an entry method for getting the default filename

Various entry implementations provide a way to obtain the default filename
for an entry. But at present there is no base-class implementation for
this function. Add one so that the API is defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodtoc: Add a way to create an Fdt object from a data block
Simon Glass [Fri, 14 Sep 2018 10:57:17 +0000 (04:57 -0600)]
dtoc: Add a way to create an Fdt object from a data block

Support creating an Fdt object without having to write the data to a file
first.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodtoc: Add methods for adding and updating properties
Simon Glass [Fri, 14 Sep 2018 10:57:16 +0000 (04:57 -0600)]
dtoc: Add methods for adding and updating properties

Add a few more functions which allow creating and modifying property
values. If only we could do this so easily in the real world.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodtoc: Support adding new nodes
Simon Glass [Fri, 14 Sep 2018 10:57:15 +0000 (04:57 -0600)]
dtoc: Support adding new nodes

Add a way to add new nodes and sync them back to the blob.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodtoc: Fixed endianness in Prop.GetEmpty()
Simon Glass [Fri, 14 Sep 2018 10:57:14 +0000 (04:57 -0600)]
dtoc: Fixed endianness in Prop.GetEmpty()

This should be big endian, since that is what device tree uses. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agodtoc: Allow syncing of the device tree back to a file
Simon Glass [Fri, 14 Sep 2018 10:57:13 +0000 (04:57 -0600)]
dtoc: Allow syncing of the device tree back to a file

At present we require the caller to manually update the device tree using
individual calls to libfdt functions. This is not ideal. It would be
better if we could make changes using the Python structure and then call a
Sync() function to write them back.

Add this feature to the Fdt class. Update binman and the tests to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Support building a selection of images
Simon Glass [Fri, 14 Sep 2018 10:57:12 +0000 (04:57 -0600)]
binman: Support building a selection of images

Sometimes it is useful to build only a subset of the images provided by
the binman configuration. Add a -i option for this. It can be given
multiple times to build several images. If the option is not given, all
images are built.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Tidy up the vblock entry
Simon Glass [Fri, 14 Sep 2018 10:57:11 +0000 (04:57 -0600)]
binman: Tidy up the vblock entry

At present if there are two vblock entries an image their contents are
written to the same file in the output directory. This prevents checking
the contents of each separately.

Fix this by adding part of the entry path to the filename, and add some
missing comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Add x86 support for starting TPL
Simon Glass [Fri, 14 Sep 2018 10:57:10 +0000 (04:57 -0600)]
binman: Add x86 support for starting TPL

Sometimes we want to include TPL for x86 platforms, such as when we want
to select between different SPL images (e.g. for Chrome OS verified boot).
Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Generate an error when text is not provided
Simon Glass [Fri, 14 Sep 2018 10:57:09 +0000 (04:57 -0600)]
binman: Generate an error when text is not provided

When the value of a text entry is not provided an execption is generated
talking about a None type. This is confusing. Add a more explanatory error
and a test for this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Allow 'fill' entry to have a size of 0
Simon Glass [Fri, 14 Sep 2018 10:57:08 +0000 (04:57 -0600)]
binman: Allow 'fill' entry to have a size of 0

The check for this should be for None, not 0. Fix it and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agobinman: Move 'special properties' docs to README.entries
Simon Glass [Fri, 14 Sep 2018 10:57:07 +0000 (04:57 -0600)]
binman: Move 'special properties' docs to README.entries

This information should be in the entry it relates to, not in the main
README. Move it.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdt: Add Python support for adding/removing nodes
Simon Glass [Fri, 14 Sep 2018 10:57:06 +0000 (04:57 -0600)]
fdt: Add Python support for adding/removing nodes

Pull this support from these upstream commits:

   bfbfab0 pylibfdt: Add a means to add and delete notes
   9005f41 pylibfdt: Allow delprop() to return errors

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agoMerge tag 'xilinx-for-v2018.11' of git://git.denx.de/u-boot-microblaze
Tom Rini [Thu, 27 Sep 2018 12:29:10 +0000 (08:29 -0400)]
Merge tag 'xilinx-for-v2018.11' of git://git.denx.de/u-boot-microblaze

Xilinx changes for v2018.11

- Handle BOARD_LATE_INIT via Kconfig

SPL:
- Enable GZIP for all partitions types(not only for kernel)

ZynqMP:
- Rearrange pmufw version handling
- Support newer PMUFW with improved fpga load sequence

Zynq:
- Cleanup config file
- Simplify zybo config by enabling option via Kconfig

net:
- Fix gems max-speed property reading
- Enable support for fixed-link phys

6 years agonet: zynq_gem: Add support for fixed-link phy
Michal Simek [Thu, 20 Sep 2018 07:42:27 +0000 (09:42 +0200)]
net: zynq_gem: Add support for fixed-link phy

Based on dt-specs fixed-link doesn't require phy-handle to be used.
Fix driver to only read phy related setting when phy-handle is found.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
6 years agoMerge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Tom Rini [Wed, 26 Sep 2018 19:14:02 +0000 (15:14 -0400)]
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-09-26

A lot of goodness in this release. We're *very* close to running the
UEFI Shell and SCT natively. The only missing piece are HII protocols.

  - FAT write support (needed for SCT)
  - improved FAT directory support (needed for SCT)
  - RTC support with QEMU -M virt
  - Sandbox support (run UEFI binaries in Linux - yay)
  - Proper UTF-16 support
  - EFI_UNICODE_COLLATION_PROTOCOL support (for UEFI Shell)
  - EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL support (for UEFI Shell)
  - Fix window size determination
  - Fix Tegra by explicitly unmapping RAM
  - Clean up handle entanglement
  - Lots of generic code cleanup

[trini: Fixup merge conflict in include/configs/qemu-arm.h]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agosandbox: Fix set_working_fdt_addr users
Alexander Graf [Wed, 26 Sep 2018 12:07:41 +0000 (14:07 +0200)]
sandbox: Fix set_working_fdt_addr users

When running sandbox with the new pointer sanitization we just recently
introduced, we're running into a case with FIT images where we end up
interpreting pointers as addresses.

What happened is that most callers of set_working_fdt_addr() simply
convert pointers into addresses without taking into account that they
might be 2 separate address spaces. Fix the callers up to map their
pointers into addresses.

This makes sandbox tests pass for me again.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoarm: zynq: zybo: migrate CONFIG_DISPLAY to defconfig
Luis Araneda [Thu, 13 Sep 2018 04:02:07 +0000 (01:02 -0300)]
arm: zynq: zybo: migrate CONFIG_DISPLAY to defconfig

Only add CONFIG_DISPLAY to defconfig because CONFIG_I2C_EDID
is automatically selected by CONFIG_DISPLAY

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agonet: zynq_gem: Fix reading of max-speed property
Siva Durga Prasad Paladugu [Tue, 4 Sep 2018 13:38:53 +0000 (19:08 +0530)]
net: zynq_gem: Fix reading of max-speed property

max-speed property is part of phynode and it has to be
read using ofnode_read_u32_default(). This fixes the issue
of incorrect max-speed read from DT.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agospl: fit: Enable GZIP compression also for no kernel partitions
Michal Simek [Tue, 24 Jul 2018 13:05:00 +0000 (15:05 +0200)]
spl: fit: Enable GZIP compression also for no kernel partitions

There is no reason to limit gzip usage only for OS_BOOT and kernel image
type.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Tested-by: York Sun <york.sun@nxp.com>
6 years agofpga: zynqmp: Modify PL bitstream loading sequence
Siva Durga Prasad Paladugu [Tue, 21 Aug 2018 10:14:50 +0000 (15:44 +0530)]
fpga: zynqmp: Modify PL bitstream loading sequence

This patch modifies PL bitstream loading sequence as per
latest Xilfpga which supports all variants of bitstream images
generated from vivado and from bootgen. With this new change in
Xilfpga, uboot doesn't need to validate and swap bitstream as it will
be taken care inside Xilfpga. ZynqMP PL driver now checks for supporting
PMUFW version before skipping the validation and swap sequence as there
can be old PMUFW which doesn't supports this feature. In this case, driver
uses old way of PL bitstream loading sequence.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Return pmufw version for zynqmp_pmufw_version()
Siva Durga Prasad Paladugu [Tue, 21 Aug 2018 10:14:49 +0000 (15:44 +0530)]
arm64: zynqmp: Return pmufw version for zynqmp_pmufw_version()

Modify the zynqmp_pmufw_version() routine to return PMUFW version so
that it can be reused wherever required. Get PMUFW version from PMU
only once at bootup and later just return stored value.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Move PM version related macros to .h
Siva Durga Prasad Paladugu [Tue, 21 Aug 2018 10:14:48 +0000 (15:44 +0530)]
arm64: zynqmp: Move PM version related macros to .h

This patch moves the PM version related macros to .h file so that
they can be reused in other files.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm: zynq: Remove useless comments from config file
Michal Simek [Wed, 15 Aug 2018 10:48:52 +0000 (12:48 +0200)]
arm: zynq: Remove useless comments from config file

Moving options to Kconfig some comments are useless now.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoarm64: zynqmp: Handle CONFIG_BOARD_LATE_INIT via Kconfig
Michal Simek [Mon, 20 Aug 2018 06:24:14 +0000 (08:24 +0200)]
arm64: zynqmp: Handle CONFIG_BOARD_LATE_INIT via Kconfig

Disable BOARD_LATE_INIT via Kconfig.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoconfig.mk: Remove duplicated -fno-strict-aliasing
Bin Meng [Mon, 17 Sep 2018 05:35:29 +0000 (22:35 -0700)]
config.mk: Remove duplicated -fno-strict-aliasing

Now that we already disable the "strict-aliasing" globally, remove
the duplicates in the nds32/riscv/x86 arch-specific Makefiles.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoMakefile: Use -fno-strict-aliasing globally
Bin Meng [Mon, 17 Sep 2018 05:35:28 +0000 (22:35 -0700)]
Makefile: Use -fno-strict-aliasing globally

The -fstrict-aliasing option is implicitly enabled at levels -O2,
-O3, -Os by GCC. This option allows the compiler to assume the
strictest aliasing rules applicable to the language being compiled.
For example, the practice of reading from a different union member
than the one most recently written to (called "type-punning") is
common. In this case, "type-punning" only works if the memory is
accessed through the union type, but might not work by taking the
address, casting the resulting pointer and dereferencing the result,
which is an undefined behavior per the "strict aliasing rules".

GCC's -Wstrict-aliasing (included in -Wall) option does not catch
all cases, but does attempt to catch the more common pitfalls. So
there are cases that GCC does not report but the codes are violating
the "strict aliasing rules".

Given lots of codes that may be written to rely on "type-punning",
and Linux kernel disables it by -fno-strict-aliasing globally, since
U-Boot currently does this on nds32/riscv/x86 builds only, extend
this for all architecture builds.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoserial: omap: Add support for AM654 uart controller
Lokesh Vutla [Fri, 14 Sep 2018 14:13:35 +0000 (19:43 +0530)]
serial: omap: Add support for AM654 uart controller

AM654 uses a UART controller that is compatible (partially) with
existing OMAP UART, Introduce a compatible for adding support
for this controller.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
6 years agoconfigs: Drop CONFIG_SYS_SCSI_MAXDEVICE
Tuomas Tynkkynen [Wed, 12 Sep 2018 22:28:57 +0000 (01:28 +0300)]
configs: Drop CONFIG_SYS_SCSI_MAXDEVICE

This option has never been used for anything. Drop it.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoata: Drop CONFIG_SYS_SCSI_MAX_* from boards using DM_SCSI
Tuomas Tynkkynen [Wed, 12 Sep 2018 22:28:56 +0000 (01:28 +0300)]
ata: Drop CONFIG_SYS_SCSI_MAX_* from boards using DM_SCSI

These options are not used or necessary when device model is being used
for SCSI. Just drop them.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoata: ahci: Don't cap AHCI port count under CONFIG_DM_SCSI
Tuomas Tynkkynen [Wed, 12 Sep 2018 22:28:55 +0000 (01:28 +0300)]
ata: ahci: Don't cap AHCI port count under CONFIG_DM_SCSI

When using device model this sort of hardcoded limits aren't used or
necessary.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoata: ahci: Loop over the actual number of ports, not the maximum
Tuomas Tynkkynen [Wed, 12 Sep 2018 22:28:54 +0000 (01:28 +0300)]
ata: ahci: Loop over the actual number of ports, not the maximum

The loop in ahci_start_ports() is looping over the maximum number of
SCSI devices in the system, which can be larger than the amount of ports
a particular AHCI controller has. The extra looping isn't directly
harmful because the link_port_map bitmap won't have the bit set for a
nonexistent port, but it is wasteful. Replace the loop limit with the
port count of the AHCI controller instead.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoxtensa: use asm-generic/atomic.h
Chris Packham [Sat, 8 Sep 2018 09:39:07 +0000 (21:39 +1200)]
xtensa: use asm-generic/atomic.h

Make use of asm-generic/atomic.h.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
6 years agomips: use asm-generic/atomic.h
Chris Packham [Sat, 8 Sep 2018 09:39:06 +0000 (21:39 +1200)]
mips: use asm-generic/atomic.h

Make use of asm-generic/atomic.h.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
6 years agoARM: use asm-generic/atomic.h
Chris Packham [Sat, 8 Sep 2018 09:39:05 +0000 (21:39 +1200)]
ARM: use asm-generic/atomic.h

Make use of asm-generic/atomic.h retaining the smp_mb_... definitions.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoAdd include/asm-generic/atomic.h
Chris Packham [Sat, 8 Sep 2018 09:39:04 +0000 (21:39 +1200)]
Add include/asm-generic/atomic.h

The arm, xtensa and mips version of atomic.h were already very similar
(the mips one was a copy of xtensa). Combine these implementations
together to produce a generic atomic.h that can be included by these
architectures (and any others that need it in future).

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agocmd: add conitrace command
Heinrich Schuchardt [Fri, 7 Sep 2018 17:43:11 +0000 (19:43 +0200)]
cmd: add conitrace command

The 'conitrace' command prints the codes received from the console input as
hexadecimal numbers.

This developer utility is useful for testing the handling of special keys
by keyboard drivers.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agommc: omap_hsmmc: Fix pbias for omap3_logic to enable CD pin
Adam Ford [Wed, 5 Sep 2018 09:11:08 +0000 (04:11 -0500)]
mmc: omap_hsmmc: Fix pbias for omap3_logic to enable CD pin

The MMC card detect pin is connected to gpio127 on omap3_logic.
When setting up the pbias register for MMC, let's also enable
gpio_127 for the card detect.  As part of the package deal,
gpio_126 and gpio_129 are also enabled.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agodm: Update README.txt to clarify device tree usage
Tom Rini [Fri, 31 Aug 2018 15:59:11 +0000 (11:59 -0400)]
dm: Update README.txt to clarify device tree usage

In the section about Device Trees add a paragraph at the end that
clarifies how we decide of a tree is valid or not.  We say that all
bindings must either be in the specification (link provided) or in our
device-tree-bindings directory.  We say that most of these come from the
Linux Kernel and as such some design decisions are made for us already,
but that in most cases we wish to retain compatibility.

Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoarm: spear: fix enabling of SSP2 clock
Quentin Schulz [Fri, 31 Aug 2018 14:28:31 +0000 (16:28 +0200)]
arm: spear: fix enabling of SSP2 clock

The SSP2 clock is at bit 6 in the register, so the value is 0x40 unlike
the current 0x70 which enables the clock of UART2, SSP1 and SSP2.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Acked-by: Stefan Roese <sr@denx.de>
6 years agoarm: spear: enable SSP1, 2 and 3 clocks when SPI controller driver is built
Quentin Schulz [Fri, 31 Aug 2018 14:28:30 +0000 (16:28 +0200)]
arm: spear: enable SSP1, 2 and 3 clocks when SPI controller driver is built

SPI controllers SSP1, 2 and 3 require to enable their respective clocks.
Let's enable them only when the SPI controller driver is built.

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
6 years agospi: add support for ARM PL022 SPI controller
Quentin Schulz [Fri, 31 Aug 2018 14:28:29 +0000 (16:28 +0200)]
spi: add support for ARM PL022 SPI controller

This adds support for the ARM PL022 SPI controller for the standard
variant (0x00041022) which has a 16bit wide and 8 locations deep TX/RX
FIFO.

A few parts were borrowed from the Linux kernel driver.

Cc: Armando Visconti <armando.visconti@st.com>
Cc: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
6 years agoconfigs: am335x_evm: enable OF_BOARD_SETUP
Sekhar Nori [Thu, 23 Aug 2018 11:41:31 +0000 (17:11 +0530)]
configs: am335x_evm: enable OF_BOARD_SETUP

Enable CONFIG_OF_BOARD_SETUP as it is needed for Beaglebone
black to overwrite the Ethernet phy address present in DT
in case the phy latches on to a different address.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoboard: ti: am335x: add support to fixup phy address
Sekhar Nori [Thu, 23 Aug 2018 11:41:30 +0000 (17:11 +0530)]
board: ti: am335x: add support to fixup phy address

On beaglebone black, it can so happen that PHY address
is not latched correctly on reset and board boots with
PHY responding to a different address than that
programmed in device-tree. For example, see this report:

https://groups.google.com/d/msg/beagleboard/9mctrG26Mc8/1FuI_i5KW10J

Workaround this by fixing up device-tree passed to kernel
by using the PHY address detected in hardware.

Beaglebone itself uses only one ethernet port and its DT
currently uses phy_id (obsoleted). But the function has
been written to handle multiple ports and phy_id as well
as phy-handle to make the function more generically useful.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agodrivers: net: cpsw: add support to update phy address
Sekhar Nori [Thu, 23 Aug 2018 11:41:29 +0000 (17:11 +0530)]
drivers: net: cpsw: add support to update phy address

On some boards using TI CPSW, it may be possible that
PHY address was not latched correctly, and the actual
address that the phy responds on is different from that
set in device-tree. For example, see this problem report
on beaglebone black:

https://groups.google.com/d/msg/beagleboard/9mctrG26Mc8/1FuI_i5KW10J

Add support to check for this condition and use the
detected phy address when its safe to do so.

Also, add a public API that exposes the phy address of
a given slave. This can be used to update device-tree that
is passed to Linux kernel.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agoconfigs: sama5d27_som1_ek: Add defconfig for ENV/boot from uSD
Codrin Ciubotariu [Tue, 21 Aug 2018 12:46:07 +0000 (15:46 +0300)]
configs: sama5d27_som1_ek: Add defconfig for ENV/boot from uSD

This adds a defconfig for sama5d27_som1_ek board to get environment from
uSD. The defconfig is made from sama5d27_som1_ek_mmc_defconfig, with
'bootcmd' and 'bootargs' changed to kernel, device-tree and rootfs from
uSD. The environment is expected to be found in uSD's FAT partition.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
6 years agoconfigs: sama5d27_som1_ek: Set CONFIG_BOOTARGS using Kconfig
Codrin Ciubotariu [Tue, 21 Aug 2018 12:46:06 +0000 (15:46 +0300)]
configs: sama5d27_som1_ek: Set CONFIG_BOOTARGS using Kconfig

CONFIG_BOOTARGS can be set using Kconfig, so we no longer need it
in the config files.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
6 years agoconfigs: sama5d27_som1_ek: Remove unnecessary FAT_ENV_xxx macros
Codrin Ciubotariu [Tue, 21 Aug 2018 12:46:05 +0000 (15:46 +0300)]
configs: sama5d27_som1_ek: Remove unnecessary FAT_ENV_xxx macros

FAT_ENV_xxx options can now be set using Kconfig, so we no longer
need them in the config files.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
6 years agoconfigs: sama5d2_xplained: Add defconfig for ENV/boot from eMMC
Codrin Ciubotariu [Tue, 21 Aug 2018 09:52:22 +0000 (12:52 +0300)]
configs: sama5d2_xplained: Add defconfig for ENV/boot from eMMC

This adds a defconfig for sama5d2_xplained board to get environment from
eMMC. The defconfig is made from sama5d2_xplained_mmc_defconfig, with
'bootcmd' and 'bootargs' changed to kernel, device-tree and rootfs from
eMMC. The environment is expected to be found in eMMC's FAT
partition.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
6 years agospl: Weed out CONFIG_SYS_TEXT_BASE usage
Marek Vasut [Tue, 14 Aug 2018 09:27:02 +0000 (11:27 +0200)]
spl: Weed out CONFIG_SYS_TEXT_BASE usage

The SPL loaders assume that the CONFIG_SYS_TEXT_BASE memory location
is available and can be corrupted by loading ie. uImage or fitImage
headers there. Sometimes it could be beneficial to load the headers
elsewhere, ie. if CONFIG_SYS_TEXT_BASE is not yet writable while we
still want to parse the image headers in some local onchip memory to
ie. extract firmware from that image.

Add the possibility to override the location where the headers get
loaded by introducing new function, spl_get_load_buffer() which takes
two arguments -- offset from the CONFIG_SYS_TEXT_BASE and size of the
data that are to be loaded there -- and returns a valid buffer address
or hangs the system. The default behavior is the same as before, add
the offset to CONFIG_SYS_TEXT_BASE and return that address. User can
override the weak spl_get_load_buffer() function though.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
6 years agoboard: st: stm32mp1: Add usb gadget support
Patrice Chotard [Fri, 10 Aug 2018 15:12:14 +0000 (17:12 +0200)]
board: st: stm32mp1: Add usb gadget support

Enable USB gadget support using DWC2 driver
Populate board_usb_init() to initialize clocks,
phy, reset and data needed for DWC2 IP.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoconfigs: stm32mp15: Enable USB relative flags
Patrice Chotard [Fri, 10 Aug 2018 15:12:13 +0000 (17:12 +0200)]
configs: stm32mp15: Enable USB relative flags

Enable config USB relative flags in order to enable USB
EHCI, DWC2 gadget, download and mass_storage support.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: stm32mp1: Add EHCI support for stm32mp157c-ev1 board
Patrice Chotard [Fri, 10 Aug 2018 15:12:12 +0000 (17:12 +0200)]
ARM: dts: stm32mp1: Add EHCI support for stm32mp157c-ev1 board

Add DT nodes to enable EHCI support

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: stm32mp1: Add usb gadget support for stm32mp157c-ev1 board
Patrice Chotard [Fri, 10 Aug 2018 15:12:11 +0000 (17:12 +0200)]
ARM: dts: stm32mp1: Add usb gadget support for stm32mp157c-ev1 board

Add DT nodes to enable DWC2 gadget support

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoefi_loader: refactor efi_setup_loaded_image()
Heinrich Schuchardt [Sun, 23 Sep 2018 15:21:51 +0000 (17:21 +0200)]
efi_loader: refactor efi_setup_loaded_image()

Create the handle of loaded images and the EFI_LOADED_IMAGE_PROTOCOL
inside efi_setup_loaded_image(). Do not use local variables.

Currently we expect the loaded image handle to point to the loaded image
protocol. Additionally we have appended private fields to the protocol.

With the patch the handle points to a loaded image object and the private
fields are added here. This matches how we handle the net and the gop
object.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoarm: qemu-arm: enable RTC (PL031) by default
AKASHI Takahiro [Fri, 14 Sep 2018 08:06:54 +0000 (17:06 +0900)]
arm: qemu-arm: enable RTC (PL031) by default

Virtual machine provided by qemu-arm has a ARM PL031 Real Time Clock
device. With this patch, the driver is enabled by default.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agortc: pl031: convert the driver to driver model
AKASHI Takahiro [Fri, 14 Sep 2018 08:06:53 +0000 (17:06 +0900)]
rtc: pl031: convert the driver to driver model

With this patch, PL031 driver is converted to driver-model-compliant
driver. In addition, CONFIG_SYS_RTC_PL031_BASE is no longer valid.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: Fix loaded_image handle passing from EL3
Alexander Graf [Sun, 23 Sep 2018 14:23:56 +0000 (16:23 +0200)]
efi_loader: Fix loaded_image handle passing from EL3

When running in EL3 mode on AArch64, we have to first drop to EL2
to execute a UEFI payload. When dropping down, the arguments to
the entry point have to stay identical to the ones for normal entry
though.

In commit ea54ad59286 ("efi_loader: pass handle of loaded image")
we incorrectly changed that logic and had the el3 entry path diverge.
Fix it up by syncing it back to what it's supposed to be.

Fixes: ea54ad59286 ("efi_loader: pass handle of loaded image")
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
6 years agoefi_loader: Disable efi selftest on sandbox for now
Alexander Graf [Sun, 23 Sep 2018 13:21:09 +0000 (15:21 +0200)]
efi_loader: Disable efi selftest on sandbox for now

The EFI selftest does not succeed on Sandbox yet. The network support
seems to need some love to actually make our current tests succeed.

So let's disable running the selftest on sandbox for now until "make
tests" just works. Then we can have more amazing CI than ever.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: remove efi_exit_caches()
Heinrich Schuchardt [Sun, 23 Sep 2018 12:33:47 +0000 (14:33 +0200)]
efi_loader: remove efi_exit_caches()

Since GRUB patch d0c070179d4d ("arm/efi: Switch to arm64 linux loader",
2018-07-09) we do not need a workaround for GRUB on 32bit ARM anymore.

So let's eliminate function efi_exit_caches().

This will require Linux distributions to update grub-efi-arm to the GRUB
git HEAD (a tag containing the aforementioned GRUB patch is not available
yet).

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agodm: video: check bounds for column and row
Heinrich Schuchardt [Wed, 19 Sep 2018 17:15:14 +0000 (19:15 +0200)]
dm: video: check bounds for column and row

CSI H can be used to position the cursor. The calling application may
specify a location that is beyond the limits of the screen. This may
lead to an illegal memory access.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: remove redundant statement
Heinrich Schuchardt [Thu, 20 Sep 2018 17:57:54 +0000 (19:57 +0200)]
efi_loader: remove redundant statement

ascii2unicode() always ends the u16 string with '\0'.
Remove redundant assignment.

Add description for efi_str_to_u16() and ascii2unicode().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: create root node
Heinrich Schuchardt [Thu, 20 Sep 2018 19:58:23 +0000 (21:58 +0200)]
efi_loader: create root node

Currently we assign a lot of protocols to loaded images though
these protocols are not related to them. Instead they should be
installed on a separate handle. Via the device path it is the
parent to the devices like the network adapter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: avoid out of bound access in efi_get_variable()
Heinrich Schuchardt [Sun, 23 Sep 2018 02:08:09 +0000 (04:08 +0200)]
efi_loader: avoid out of bound access in efi_get_variable()

In efi_get_variable() a string is longer than the allocated space which
results in overwriting the linked list of malloc().

The prefixes used for variables are 41 characters long, e.g.
efi_67029eb5-0af2-f6b1-da53-fcb566dd1ce6_

Change PREFIX_LEN to 41.

Fixes: faff21556748 ("efi_loader: remove limit on variable length")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_selftest: test qemu-arm(64)_defconfig
Heinrich Schuchardt [Sun, 23 Sep 2018 02:25:12 +0000 (04:25 +0200)]
efi_selftest: test qemu-arm(64)_defconfig

We should run the EFI selftest on both a 32bit and a 64bit ARM platform on
Travis to catch possible errors.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_driver: convert function descriptions to Sphinx style
Heinrich Schuchardt [Tue, 18 Sep 2018 16:52:46 +0000 (18:52 +0200)]
efi_driver: convert function descriptions to Sphinx style

Convert the function descriptions to Sphinx style.
efi_driver_init() is cCalled by efi_init_obj_list().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: query serial console size reliably
Heinrich Schuchardt [Sat, 15 Sep 2018 21:52:07 +0000 (23:52 +0200)]
efi_loader: query serial console size reliably

Not all terminals understand CSI [18t for querying the console size.
We should adhere to escape sequences documented in the console_codes
manpage and the ECMA-48 standard.

So here we follow a different approach. We position the cursor to the
bottom right and query its position. Before leaving the function we
restore the original cursor position.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>