Commit Graph

63292 Commits

Author SHA1 Message Date
Simon Glass
b4d00b256e x86: Add a clock driver for Intel devices
So far we have avoided adding a clock driver for Intel devices. But the
Designware I2C driver needs a different clock (133MHz) on Intel devices
than on others (166MHz). Add a simple driver that provides this
information.

This driver can be expanded later as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-02-07 22:41:24 +08:00
Simon Glass
fdec36f248 tegra: i2c: Change driver to use helper function
Now that we have uclass_first_device_drvdata(), use it from the I2C driver
to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-02-07 22:41:24 +08:00
Simon Glass
ae44cafcb3 dm: core: Change syscon to use helper function
Now that we have uclass_first_device_drvdata(), use it from syscon to
reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-02-07 22:41:24 +08:00
Simon Glass
50162348f0 dm: core: Add a function to find a device by drvdata
It is sometimes useful to find a device in a uclass using only its driver
data. The driver data often indicates the 'subtype' of the device, e,g,
via its compatible string.

Add a function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-02-07 22:41:24 +08:00
Simon Glass
3cf0fba4ff dm: core: Allow iterating devices without uclass_get()
At present we have uclass_foreach_dev() which requires that uclass_get()
be called beforehand to find the uclass. This is good if we suspect that
that function might fail, but often we know that the uclass is available.

Add a new helper which does this uclass_get() automatically, so that only
the uclass ID is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-02-07 22:41:24 +08:00
Wolfgang Wallner
2999846c11 x86: Move P2SB from Apollo Lake to a more generic location
The Primary to Sideband Bridge (P2SB) is not specific to Apollo Lake, so
move its driver to a common location within arch/x86.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-02-07 22:41:24 +08:00
Tom Rini
904ea003c1 Pull request for UEFI sub-system for efi-2020-04-rc2
Fix pylint issues in Python based tests.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl47ircACgkQxIHbvCwF
 GsT/fA/9Eg/lmJheOrj9i0zUjhDlaVi8afccMcdXJHc5ejEqX+IgYau+IXImQOcM
 oIJ+BgDEbwbWmsUD3zzQwoE2hfSoZJARaHM59YkYmUFuq+h3/a67JsX9aUTJh7c5
 k9LRPe9YxJBDACIWbVoQaDOAv8Zus9eWHV+YMRPG0lUNgAq4npI08W0WZD6HxTaE
 AYmDeUvbbpaPLG8CBsn7C8Y3TXwAkXq7w4r7JtClNrvyFtX4VJJeLW5/C91902Au
 VYAFLV7ZEtFLXJJv0m/52Li8BgX92Ra4hAmhWJdG7CqiWcB1vxuWoLPOc1jmomPy
 kei1JRDO1KmZXXqcuvbDdlSq5F2ut9iM28Odhr9IfkNKuW8A3twwtF839iyG+viP
 Sj/VwUz91fgnOFAe2ICWoWw+jvdx1F6rXTZNqdOiVaGL5VVcLqwtNiMD+C14pJXr
 6tHWPKYthmW5fiOj/bMNX3C3yKgPsA8eH7nQiDauEW97kXIP1rgxH0NiSY0dihr2
 DvOfxhyzVb6tf0Gajcw1yTeLiiZL1oR23NSwya0EF/hBL+bPt40Y3dM1tF6M4x1A
 Wd2H4XHSZ8pp3lS6qpTc5iMyQRihq4eoe/qQsWu8ALwEhlHXyhnYGKO6DNbGmY5S
 u4m0hYwpTP+EiyhsqC49/kLrmi+MN91uuACEHQMxmEO92lDlAME=
 =Tu0L
 -----END PGP SIGNATURE-----

Merge tag 'efi-2020-04-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc2

Fix pylint issues in Python based tests.
2020-02-06 23:19:27 -05:00
Tom Rini
457faef262 Merge branch 'master' of git://git.denx.de/u-boot-socfpga
- Gen 5 and Watchdog fixes
2020-02-06 23:18:42 -05:00
Anatolij Gustschin
8a6ffeda97 video: enable VIDEO_ANSI and all VIDEO_BBP options
This partially reverts changes by commit 2cc393f32f
("video: make BPP and ANSI configs optional") since it
caused issues with other boards (missing LCD console
output on pinebook, x86 platform or sandbox). Enable
all disabled options again and opt out of not supported
color depth in board defconfigs.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reported-by: Vagrant Cascadian <vagrant@debian.org>
2020-02-06 16:11:47 -05:00
Tom Rini
4244429ff0 configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2020-02-06 13:42:52 -05:00
Simon Glass
21d651fb29 sandbox: Complete migration away from os_malloc()
Now that we can use direct access to the system malloc() in sandbox, drop
the remaining uses of os_malloc().

The only one remaining now is for the RAM buffer, which we do want to be
at a known address, so this is intended.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 21:48:23 -07:00
Simon Glass
f217651575 dm: core: Drop the inclusion of linux/compat.h in dm.h
Most files don't need this header and it pulls in quite of lots of stuff,
malloc() in particular. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 21:48:22 -07:00
Simon Glass
336d4615f8 dm: core: Create a new header file for 'compat' features
At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.

Move the compatibility features into a separate header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
61b29b8268 dm: core: Require users of devres to include the header
At present devres.h is included in all files that include dm.h but few
make use of it. Also this pulls in linux/compat which adds several more
headers. Drop the automatic inclusion and require files to include devres
themselves. This provides a good indication of which files use devres.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-05 19:33:46 -07:00
Simon Glass
a466db5adb sandbox: Support changing the LCD colour depth
Add a new device-tree property to control the colour depth. At present we
support 16bpp and 32bpp.

While we are here, update the code to use livetree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-05 19:33:46 -07:00
Simon Glass
6be88c7282 sandbox: sdl: Add an option to double the screen size
On high-DPI displays U-Boot's LCD window can look very small. Add a
-K flag to expand it to make things easier to read, while still using
the existing resolution internally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-05 19:33:46 -07:00
Simon Glass
96d0cd4604 sandbox: sdl: Move to use SDL2
Sandbox currently uses SDL1.2. SDL2 has been around for quite a while and
is widely supported. It has a number of useful features. It seems
appropriate to move sandbox over.

Update the code to use SDL2 instead of SDL1.2.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
af800722eb gitlab: Disable SDL when building sandbox
I am not sure how to add libsdl2-dev to the gitlab image, so disable
building sandbox with SDL for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
ac7b730201 sandbox: sdl: Support waiting for audio to complete
At present when audio stops, any in-progress output is cut off. Fix this
by waiting for output to finish.

Also use booleans for the boolean variables.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
5f736f8eca sandbox: sdl: Improve error handling
A few errors are not checked. Fix these and use my preferred spelling for
init.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
c127f191a8 sandbox: Add comments to the sdl struct
Add comments for each struct member. Drop frequency since it is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
02662480a8 sandbox: sound: Handle errors better in sound_beep()
At present an error does not stop the sound-output loop. This is incorrect
since nothing can be gained by trying to continue. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
3062cd17af sound: Add a new stop_play() method
At present there is no positive indication that U-Boot has finished
sending sound data. This means that it is not possible to power down an
audio codec, for example. Add a new method that is called once all sound
data has been sent.

Add a new method for this, called when the sound_play() call is done.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
3ff6fe5fab sandbox: Add a new header for the system malloc()
Some files use U-Boot headers but still need to access the system
malloc(). Allow this by creating a new asm/malloc.h which can be used so
long as U-Boot's malloc.h has not been included.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
1c8c47ec80 sandbox: Ensure that long-options array is terminated
The last member of this array is supposed to be all zeroes according to
the getopt_long() man page. Fix the function to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
89cdb0b583 sandbox: Drop os_realloc()
Due to recent changes this function is no-longer used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
0db1b4305a sandbox: Drop use of special os_malloc() where possible
Some sandbox files are not built with U-Boot headers, so with the renamed
malloc functions there is now no need to use the special os_... allocation
functions to access the system routines. Instead we can just call them
directly.

Update the affected files accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
f72bdc60b2 sandbox: Rename strdup() functions
These functions include calls to a memory-allocation routine and so need
to use the system routine when called from a library.

To preserve access to these functions for libraries that need it, such as
SDL, rename these functions within U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
1ea1c7d80f string: Allow arch override of strndup() also
At present architectures can override strdup() but not strndup(). Use
the same option for both.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
1f6510c4cf exports: Add the malloc.h header
This file should include the malloc.h header since it references malloc().
Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
cfda60f99a sandbox: Use a prefix for all allocation functions
In order to allow use of both U-Boot's malloc() and the C library's
version, set a prefix for the allocation functions so that they can
co-exist.

This is only done for sandbox. For other archs everything remains the
same.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
cf23c7c1dd sandbox: Rename 'free' variable
This name conflicts with our desire to #define free() to something else on
sandbox. Rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
8d38a8459b mtd: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
aae9588223 dma: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
fb8c0d595f clk: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
093152f275 gpio: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
94474b25c3 reset: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
4f51188e47 power-domain: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-05 19:33:46 -07:00
Simon Glass
cc92c3cc68 mailbox: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Simon Glass
3b85ce8ec3 video: sandbox: Enable all colour depths
For sandbox we want to have the maximum possible build coverage, so enable
all colour depths for video.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-05 19:33:46 -07:00
Simon Glass
51973ccc41 video: Support truetype fonts on a 32-bit display
At present only a 16bpp display is supported for Truetype fonts. Add
support for 32bpp also since this is quite common.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-02-05 19:33:46 -07:00
Simon Glass
4209be3eae sandbox: Sort the help options
At present options are presented in essentially random order. It is easier
to browse them if they are sorted into alphabetical order. Adjust the
help function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Fabio Estevam
1d6a0c9503 doc: dm: debugging: Fix the steps for activating debug
Following the recommendation of adding '#define DEBUG' at the top
of drivers/core/lists.c does not cause the debug messages to be
shown. Change it to '#define LOG_DEBUG' instead, which actually
makes it work as per doc/README.log.

While at it, provide the full path to lists.c to in order to make
the instructions clearer.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Maxime Ripard
5ed2dc5623 dtc: add ability to make nodes conditional on them being referenced
This is needed when importing mainline DTs into U-Boot, as some started
using this /omit-if-no-ref/ tag, so won't compile with U-Boot's current
dtc copy. This is just a cherry-pick of the patch introducing this
feature.
Original commit message from Maxime:
------------------
A number of platforms have a need to reduce the number of DT nodes,
mostly because of two similar constraints: the size of the DT blob, and
the time it takes to parse it.

As the DT is used in more and more SoCs, and by more projects, some
constraints start to appear in bootloaders running from SRAM with an
order of magnitude of 10kB. A typical DT is in the same order of
magnitude, so any effort to reduce the blob size is welcome in such an
environment.

Some platforms also want to reach very fast boot time, and the time it
takes to parse a typical DT starts to be noticeable.

Both of these issues can be mitigated by reducing the number of nodes in
the DT. The biggest provider of nodes is usually the pin controller and
its subnodes, usually one for each valid pin configuration in a given
SoC.

Obviously, a single, fixed, set of these nodes will be used by a given
board, so we can introduce a node property that will tell the DT
compiler to drop the nodes when they are not referenced in the tree, and
as such wouldn't be useful in the targetted system.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Sean Anderson
7b9d60fc1f cmd: Add command to dump drivers and compatible strings
This adds a subcommand to dm to dump out what drivers are installed, and their
compatible strings. I have found this useful in ensuring that I have the correct
drivers compiled, and that I have put in the correct compatible strings.

Signed-off-by Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Matthias Brugger
2f7c53cbd3 buildman: Enable buildman on aarch64 hosts
At kernel.org aarch64 toolchains are published in folder
arm64. Fix the URL for that case, so that we can fetch
toolchains on aarch64 machines.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-05 19:33:46 -07:00
Thirupathaiah Annapureddy
8d73be7a8e tpm2: ftpm: A driver for firmware TPM running inside TEE
Add a driver for a firmware TPM running inside TEE.

Documentation of the firmware TPM:
https://www.microsoft.com/en-us/research/publication/ftpm-software-implementation-tpm-chip/

Implementation of the firmware TPM:
https://github.com/Microsoft/ms-tpm-20-ref/tree/master/Samples/ARM32-FirmwareTPM

Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
2020-02-05 19:33:46 -07:00
Sean Anderson
19464f4feb cli: Make the sandbox board_run_command the default
If CONFIG_CMDLINE=n, common/cli.c calls board_run_command. This fails to
link on most architectures. However, the sandbox architecture has an
implementation which we can use.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-02-05 19:33:46 -07:00
Philippe Reynes
3780e2d08e cmd: tpm: add a subcommand device
The command tpm (and tpm2) search the tpm and use it.
On sandbox, there are two tpm (tpm 1.x and tpm 2.0).
So the command tpm and tpm2 are always executed with
the first tpm (tpm 1.x), and the command tpm2 always
fails.

This add a subcommand device to command tpm and
command tpm2. Then the command tpm and tpm2 use
the device selected with the subcommand device.

To be compatible with previous behaviour, if the
subcommand device is not used before a tpm (or tpm2)
command, the device 0 is selected.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2020-02-05 19:33:46 -07:00
Philippe Reynes
bb3f47eb78 tpm: add a helper to iterate on all tpm devices
This add a helper for_each_tpm_device that run
through all the tpm (1.x and 2.0) devices.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2020-02-05 19:33:46 -07:00