summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "gitlab: Disable SDL when building sandbox"WIP/11Feb2020Tom Rini2020-02-111-3/+2
| | | | This reverts commit af800722eb718bec51c5943cfb69231acf15178f.
* Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini2020-02-11697-754/+2772
|\ | | | | | | | | | | | | sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions
| * sandbox: Complete migration away from os_malloc()Simon Glass2020-02-051-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Drop the inclusion of linux/compat.h in dm.hSimon Glass2020-02-056-2/+7
| | | | | | | | | | | | | | 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>
| * dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-05460-77/+593
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Require users of devres to include the headerSimon Glass2020-02-05242-5/+275
| | | | | | | | | | | | | | | | | | | | 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>
| * sandbox: Support changing the LCD colour depthSimon Glass2020-02-053-6/+9
| | | | | | | | | | | | | | | | | | | | 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>
| * sandbox: sdl: Add an option to double the screen sizeSimon Glass2020-02-055-6/+36
| | | | | | | | | | | | | | | | | | 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>
| * sandbox: sdl: Move to use SDL2Simon Glass2020-02-054-127/+158
| | | | | | | | | | | | | | | | | | | | 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>
| * gitlab: Disable SDL when building sandboxSimon Glass2020-02-051-2/+3
| | | | | | | | | | | | | | 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>
| * sandbox: sdl: Support waiting for audio to completeWIP/bisectSimon Glass2020-02-051-2/+13
| | | | | | | | | | | | | | | | | | 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>
| * sandbox: sdl: Improve error handlingSimon Glass2020-02-051-5/+9
| | | | | | | | | | | | | | A few errors are not checked. Fix these and use my preferred spelling for init. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Add comments to the sdl structSimon Glass2020-02-051-1/+16
| | | | | | | | | | | | Add comments for each struct member. Drop frequency since it is not used. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: sound: Handle errors better in sound_beep()Simon Glass2020-02-051-1/+4
| | | | | | | | | | | | | | 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>
| * sound: Add a new stop_play() methodSimon Glass2020-02-055-1/+51
| | | | | | | | | | | | | | | | | | | | | | 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>
| * sandbox: Add a new header for the system malloc()Simon Glass2020-02-053-11/+38
| | | | | | | | | | | | | | | | 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>
| * sandbox: Ensure that long-options array is terminatedSimon Glass2020-02-051-1/+2
| | | | | | | | | | | | | | 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>
| * sandbox: Drop os_realloc()Simon Glass2020-02-052-44/+1
| | | | | | | | | | | | Due to recent changes this function is no-longer used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Drop use of special os_malloc() where possibleSimon Glass2020-02-052-15/+15
| | | | | | | | | | | | | | | | | | | | | | 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>
| * sandbox: Rename strdup() functionsSimon Glass2020-02-051-0/+5
| | | | | | | | | | | | | | | | | | | | 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>
| * string: Allow arch override of strndup() alsoSimon Glass2020-02-052-2/+2
| | | | | | | | | | | | | | At present architectures can override strdup() but not strndup(). Use the same option for both. Signed-off-by: Simon Glass <sjg@chromium.org>
| * exports: Add the malloc.h headerSimon Glass2020-02-051-0/+1
| | | | | | | | | | | | | | This file should include the malloc.h header since it references malloc(). Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Use a prefix for all allocation functionsSimon Glass2020-02-051-2/+22
| | | | | | | | | | | | | | | | | | | | | | 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>
| * sandbox: Rename 'free' variableSimon Glass2020-02-051-3/+3
| | | | | | | | | | | | | | This name conflicts with our desire to #define free() to something else on sandbox. Rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * mtd: Rename free() to rfree()Simon Glass2020-02-058-10/+10
| | | | | | | | | | | | | | | | 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>
| * dma: Rename free() to rfree()Simon Glass2020-02-054-8/+8
| | | | | | | | | | | | | | | | 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>
| * clk: Rename free() to rfree()Simon Glass2020-02-055-7/+7
| | | | | | | | | | | | | | | | 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>
| * gpio: Rename free() to rfree()Simon Glass2020-02-053-6/+6
| | | | | | | | | | | | | | | | 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>
| * reset: Rename free() to rfree()Simon Glass2020-02-0519-20/+20
| | | | | | | | | | | | | | | | 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>
| * power-domain: Rename free() to rfree()Simon Glass2020-02-0512-13/+13
| | | | | | | | | | | | | | | | | | 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>
| * mailbox: Rename free() to rfree()Simon Glass2020-02-056-8/+8
| | | | | | | | | | | | | | | | 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>
| * video: sandbox: Enable all colour depthsSimon Glass2020-02-055-5/+3
| | | | | | | | | | | | | | | | 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>
| * video: Support truetype fonts on a 32-bit displaySimon Glass2020-02-051-0/+21
| | | | | | | | | | | | | | | | 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>
| * sandbox: Sort the help optionsSimon Glass2020-02-051-1/+45
| | | | | | | | | | | | | | | | 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>
| * doc: dm: debugging: Fix the steps for activating debugFabio Estevam2020-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dtc: add ability to make nodes conditional on them being referencedMaxime Ripard2020-02-055-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * cmd: Add command to dump drivers and compatible stringsSean Anderson2020-02-053-1/+33
| | | | | | | | | | | | | | | | | | 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>
| * buildman: Enable buildman on aarch64 hostsMatthias Brugger2020-02-051-0/+2
| | | | | | | | | | | | | | | | | | 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>
| * tpm2: ftpm: A driver for firmware TPM running inside TEEThirupathaiah Annapureddy2020-02-054-0/+292
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * cli: Make the sandbox board_run_command the defaultSean Anderson2020-02-052-7/+7
| | | | | | | | | | | | | | | | 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>
| * cmd: tpm: add a subcommand devicePhilippe Reynes2020-02-054-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * tpm: add a helper to iterate on all tpm devicesPhilippe Reynes2020-02-051-0/+3
| | | | | | | | | | | | | | | | 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>
| * image: fdt: check "status" of "/reserved-memory" subnodesThirupathaiah Annapureddy2020-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | boot_fdt_add_mem_rsv_regions() scans the subnodes of "/reserved-memory" and adds them to reserved lmb regions. Currently this scanning does not take into "status" property. Even if the subnode is disabled, it gets added to the reserved lmb regions. This patch checks the "status" property before adding it to reserved lmb regions. Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
| * test: Add a way to check each line of console outputSimon Glass2020-02-053-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | When writing tests to check the output from commands it is useful to be able to check the output line by line using an assertion. Add helper macros to support this and to check that there is no unexpected trailing data. Also some commands produce a dump using print_buffer(). Add a way to check that the correct number of bytes are dumped (ignoring the actual contents). Signed-off-by: Simon Glass <sjg@chromium.org>
| * test: Enable console recording in testsSimon Glass2020-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | At present we reset the console buffer before each test but do not actually set the recording flag. Without this, the output is not recorded. Update the code to set the flag before the test and clear it afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
| * console: Add a function to read a line of the output / eofSimon Glass2020-02-052-0/+30
| | | | | | | | | | | | | | | | | | | | | | When recording the console output for testing it is useful to be able to read the output a line at a time to check that the output is correct. Also we need to check that we get to the end of the output. Add a console function to return the next line and another to see how must data is left. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: pmic: Correct i2c pmic emulator platdata methodSimon Glass2020-02-051-3/+13
| | | | | | | | | | | | | | | | | | | | This currently reads the uclass's private data in the ofdata_to_platdata method which is not allowed, since the uclass has not read it from the device tree. This happens in the probe method. Fix it by adding a probe() method and moving the code there. Signed-off-by: Simon Glass <sjg@chromium.org>
| * bloblist: Zero records when addingSimon Glass2020-02-053-4/+30
| | | | | | | | | | | | | | | | | | It is convenient for bloblist to zero out the contents of a records when it is added. This saves the callers having to do it. Update the API accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
| * bloblist: Tidy up a few comments and code-style nitsSimon Glass2020-02-052-4/+4
| | | | | | | | | | | | | | Add a messing error code to bloblist_new() and tidy up the line length in bloblist_addrec(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * bloblist: Add a new function to add or check sizeSimon Glass2020-02-053-1/+65
| | | | | | | | | | | | | | A common check is to see if a blob is present, create it if not and make sure that the size is large enough. Add a function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>