summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini2020-02-1128-286/+556
|\ | | | | | | | | | | | | sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions
| * dm: core: Drop the inclusion of linux/compat.h in dm.hSimon Glass2020-02-053-1/+4
| | | | | | | | | | | | | | 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-053-71/+87
| | | | | | | | | | | | | | | | | | | | | | | | 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-052-2/+4
| | | | | | | | | | | | | | | | | | | | 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>
| * sound: Add a new stop_play() methodSimon Glass2020-02-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | 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: Drop os_realloc()Simon Glass2020-02-051-21/+1
| | | | | | | | | | | | Due to recent changes this function is no-longer used. Drop it. 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-051-1/+1
| | | | | | | | | | | | | | At present architectures can override strdup() but not strndup(). Use the same option for both. 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>
| * mtd: Rename free() to rfree()Simon Glass2020-02-051-2/+2
| | | | | | | | | | | | | | | | 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-051-2/+2
| | | | | | | | | | | | | | | | 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-051-2/+2
| | | | | | | | | | | | | | | | 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-051-1/+1
| | | | | | | | | | | | | | | | 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-051-2/+2
| | | | | | | | | | | | | | | | 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-051-2/+2
| | | | | | | | | | | | | | | | | | 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-051-2/+2
| | | | | | | | | | | | | | | | 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>
| * cmd: Add command to dump drivers and compatible stringsSean Anderson2020-02-051-0/+3
| | | | | | | | | | | | | | | | | | 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>
| * 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>
| * test: Add a way to check each line of console outputSimon Glass2020-02-052-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * console: Add a function to read a line of the output / eofSimon Glass2020-02-051-0/+19
| | | | | | | | | | | | | | | | | | | | | | 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>
| * bloblist: Tidy up a few comments and code-style nitsSimon Glass2020-02-051-1/+2
| | | | | | | | | | | | | | 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-051-0/+13
| | | | | | | | | | | | | | 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>
| * dm: core: Add a way to iterate through children, probing eachSimon Glass2020-02-051-0/+39
| | | | | | | | | | | | | | | | It is sometimes useful to process all children, making sure they are probed first. Add functions to help with this and a macro to make it more convenient. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add a way to read platdata for all child devicesSimon Glass2020-02-052-1/+44
| | | | | | | | | | | | | | | | | | When generating ACPI tables we need to make sure that all devices have read their platform data, so that they can generate the tables correctly. Rather than adding this code in ACPI, create a core function to handle it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add ofnode_get_chosen_prop()Simon Glass2020-02-051-0/+12
| | | | | | | | | | | | | | Add a function to read a property from the chosen node, providing access to its length. Update ofnode_get_chosen_string() to make use of it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add ofnode_read_prop()Simon Glass2020-02-051-1/+12
| | | | | | | | | | | | | | | | | | Add a new function to read a property that supports reading the length as well. Reimplement ofnode_read_string() using it and fix its comment. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Rename ofnode_get_chosen_prop()Simon Glass2020-02-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This function is actually intended to read a string rather than a property. All of its current callers use it that way. Also there is no way to return the length of the property from this function. Rename it to better indicate its purpose, using ofnode_read as the prefix since this matches most other functions. Also add some tests which are missing for these functions. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Update comment for ofnode_get_chosen_node()Simon Glass2020-02-051-3/+6
| | | | | | | | | | | | | | The current comment is a big vague and misleading. Rewrite it to state precisely what the function does. Signed-off-by: Simon Glass <sjg@chromium.org>
| * test: Add underscore prefix to macro parametersSimon Glass2020-02-051-22/+22
| | | | | | | | | | | | | | If a test happens to use the same variable as the macro parameter the macro does not work as intended. Add an underscore to guard against this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Use const device for the dev_read_...() interfaceSimon Glass2020-02-051-97/+108
| | | | | | | | | | | | | | These functions do not modify the device so should use a const pointer to it. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Use const device for the devfdt...() interfaceSimon Glass2020-02-051-13/+13
| | | | | | | | | | | | | | These functions do not modify the device so should use a const pointer to it. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: pci: Update a few more interfaces for const udevice *Simon Glass2020-02-052-9/+9
| | | | | | | | | | | | Tidy up a few places where const * should be used. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: pci: Update the PCI read_config() method to const dev *Simon Glass2020-02-051-10/+12
| | | | | | | | | | | | | | At present this method uses a non-const udevice pointer, but the call should not modify the device. Use a const pointer. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Use const where possible in device.hSimon Glass2020-02-052-16/+18
| | | | | | | | | | | | | | Update this header file to use const devices where possible, to permit callers to also use const. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86Tom Rini2020-02-105-0/+217
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move P2SB from Apollo Lake to a more generic location - Add a function to find a device by drvdata in DM core - Enhancement of DM IRQ uclass driver - Add a clock driver for Intel devices - Add support for ACPI general-purpose events - Add a TPM driver for H1/Cr50 - Enable TPM on Google Chromebook Coral
| * | tpm: Add more TPM2 definitionsSimon Glass2020-02-071-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add definitions for access and status. Need to drop the mixed case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * | dm: irq: Add support for requesting interruptsSimon Glass2020-02-071-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present driver model supports the IRQ uclass but there is no way to request a particular interrupt for a driver. Add a mechanism, similar to clock and reset, to read the interrupts required by a device from the device tree and to request those interrupts. U-Boot itself does not have interrupt-driven handlers, so just provide a means to read and clear an interrupt. This can be useful to handle peripherals which must use an interrupt to determine when data is available, for example. Bring over the basic binding file as well, from Linux v5.4. Note that the older binding is not supported in U-Boot; the newer 'special form' must be used. Add a simple test of the new functionality. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
| * | dm: irq: Add support for interrupt controller typesSimon Glass2020-02-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There can be different types of interrupt controllers in a system and some drivers may need to distinguish between these. In general this can be handled using the device tree by adding the interrupt information to device nodes. However on x86 devices we have interrupt controllers which are not tied to any particular device and not really used in U-Boot. These still need to be inited, so a convenient method is to give each controller a type and allow a particular controller type to be probed. Add support for this in sandbox along with a test. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: remove the new bland line at EOF of test/dm/irq.c] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| * | x86: Add a clock driver for Intel devicesSimon Glass2020-02-071-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | dm: core: Add a function to find a device by drvdataSimon Glass2020-02-072-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | dm: core: Allow iterating devices without uclass_get()Simon Glass2020-02-071-0/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | 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>
* | board: ge: bx50v3, imx53ppd: configure CONFIG_SYS_BOOTMAPSZIan Ray2020-02-092-2/+4
| | | | | | | | | | | | Configure `CONFIG_SYS_BOOTMAPSZ' per guidance on u-boot@lists.denx.de. Signed-off-by: Ian Ray <ian.ray@ge.com>
* | board: ge: bx50v3, mx53ppd: fix firstboot detectionRobert Beckett2020-02-092-4/+3
| | | | | | | | | | | | | | | | | | Use `test' command to test for file existence instead of relying on the old functionality of the `ext2load' command (which now reports an error when attempting to load a zero length file). Signed-off-by: Robert Beckett <bob.beckett@collabora.com> Signed-off-by: Ian Ray <ian.ray@ge.com>
* | board: ge: mx53ppd: use DM for uartIan Ray2020-02-091-8/+1
| | | | | | | | | | | | | | | | Drop PPD_UART_PAD_CTRL since it matches defaults. Enable DM serial and MXC uart. Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* | board: ge: bx50v3: use DM for uartRobert Beckett2020-02-091-8/+2
| | | | | | | | | | | | | | Remove legacy uart pad and iomux code Enable DM serial and mxc uart Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* | board: ge: mx53ppd: Use DM for ethernetRobert Beckett2020-02-091-8/+0
| | | | | | | | | | | | | | | | Remove legacy iomux setup for fec. Enable phylib and DM fec. Use Kconfig for enabling fec. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* | board: ge: bx50v3: Enable DM PWM for backlightRobert Beckett2020-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | Add backlight and panel devicetree definitions Use UCLASS_PANEL to enable backlight via display enable handler Remove old explicit gpio code for handling backlight Use cls command to initiate display in HW agnostic manner Enable DM regulator and pwm Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* | board: ge: mx53ppd: enable DM_VIDEOIan Ray2020-02-091-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Enable DM_VIDEO for mx53ppd. Enable DM_REGULATOR_FIXED and DM_PWM for the backlight. Remove unused MX53PPD_LCD_POWER. Remove old (incorrect) setup_iomux_lcd. Enable backlight via display enable handler. Use cls command to initiate display in HW agnostic manner. Modify `failbootcmd' to use lcdputs. Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* | board: ge: mx53ppd: add i2c eeprom bootcount storageRobert Beckett2020-02-091-3/+1
| | | | | | | | | | | | | | | | | | Add bootcount node, linking to i2c eeprom "bootcount" partitions for storage. Enable i2c eeprom bootcount backend storage. Enable bootcount command and use it for failbootcmd. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
* | board: ge: bx50v3: add i2c eeprom bootcount storageRobert Beckett2020-02-091-3/+1
| | | | | | | | | | | | | | | | | | Add bootcount node, linking to i2c eeprom "bootcount" partitions for storage. Enable i2c eeprom bootcount backend storage. Enable bootcount command and use it for failbootcmd. Signed-off-by: Robert Beckett <bob.beckett@collabora.com>