aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-20treewide: remove (phys_addr_t) casts from devfdt_get_addr()Masahiro Yamada
This cast is unneeded. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-07-20treewide: convert (void *)devfdt_get_addr() to dev_read_addr_ptr()Masahiro Yamada
Use the _ptr suffixed variant instead of casting. Also, convert it to dev_read_addr_ptr(), which is safe to CONFIG_OF_LIVE. One curious part is an error check like follows in drivers/watchdog/omap_wdt.c: priv->regs = (struct wd_timer *)devfdt_get_addr(dev); if (!priv->regs) return -EINVAL; devfdt_get_addr() returns FDT_ADDR_T_NONE (i.e. -1) on error. So, this code does not catch any error in DT parsing. dev_read_addr_ptr() returns NULL on error, so this error check will work. I generated this commit by the following command: $ find . -name .git -prune -o -name '*.[ch]' -type f -print | \ xargs sed -i -e 's/([^*)]*\*)devfdt_get_addr(/dev_read_addr_ptr(/' I manually fixed drivers/usb/host/ehci-mx6.c Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-07-20fdt_support: skip MTD node with "disabled" in fdt_fixup_mtdparts()Masahiro Yamada
Currently, fdt_fixup_mtdparts() only checks the compatible property. It is pointless to fix up the disabled node. Skip the node if it has the property: status = "disabled" Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20fdt_support: call mtdparts_init() after finding MTD node to fix upMasahiro Yamada
Platform code can call fdt_fixup_mtdparts() in order to hand U-Boot's MTD partitions over to the Linux device tree. Currently, fdt_fixup_mtdparts() calls mtdparts_init() in its entry. If no target MTD device is found, an error message like follows is displayed: Device nand0 not found! This occurs when the same code (e.g. arch/arm/mach-uniphier/fdt-fixup.c) is shared among several boards, but not all of them support an MTD device. Parse the DT first, then call mtdparts_init() only when the target MTD node is found. Yet, you still need to call mtdparts_init() before device_find(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20test/dm: check if devices existHeinrich Schuchardt
Running 'ut dm' on the sandbox without -D or -d results in segmentation faults due to NULL pointer dereferences. Check that device pointers are non-NULL before using them. Use ut_assertnonnull() for pointers instead of ut_assert(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-07-20arm: mach-k3: Use SOC driver for device identificationDave Gerlach
Make use of UCLASS_SOC to find device family and revision for print_cpuinfo. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20configs: j721e_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3Dave Gerlach
Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 so the TI K3 SoC driver can be used for SoC detection. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20configs: am65x_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3Dave Gerlach
Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 so the TI K3 SoC driver can be used for SoC detection. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20arm: dts: k3-j721e-mcu-wakeup: Introduce chipid nodeDave Gerlach
Introduce a chipid node to provide a UCLASS_SOC driver to identify TI K3 SoCs. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20arm: dts: k3-am65-wakeup: Introduce chipid nodeDave Gerlach
Introduce a chipid node to provide a UCLASS_SOC driver to identify TI K3 SoCs. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20dm: soc: Introduce soc_ti_k3 driver for TI K3 SoCsDave Gerlach
Introduce an soc_ti_k3_driver that allows identification and selection of SoC specific data based on the JTAG ID register for device identification, as described for AM65x[0] and J721E[1] devices. [0] http://www.ti.com/lit/ug/spruid7e/spruid7e.pdf [1] http://www.ti.com/lit/ug/spruil1a/spruil1a.pdf Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20test: Add tests for SOC uclassDave Gerlach
Add a sandbox SOC driver, and some tests for the SOC uclass. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20dm: soc: Introduce UCLASS_SOC for SOC ID and attribute matchingDave Gerlach
Introduce UCLASS_SOC to be used for SOC identification and attribute matching based on the SoC ID info. This allows drivers to be provided for SoCs to retrieve SoC identifying information and also for matching device attributes for selecting SoC specific data. This is useful for other device drivers that may need different parameters or quirks enabled depending on the specific device variant in use. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
2020-07-20doc: Add new doc for soc ID driver modelDave Gerlach
Add a new documentation file for UCLASS_SOC and its usage to describe the SoC Device ID framework that allows SoC identification and device data matching. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20fdt_support: add static to fdt_node_set_part_info()Masahiro Yamada
This function is only called from fdt_fixup_mtdpart() in the same file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: When no tracking branch is provided, tell the userNicolas Boichat
The user can either count the number of patches, or provide a tracking branch. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Make sure sendemail.suppresscc is (un)set correctlyNicolas Boichat
Setting sendemail.suppresscc to all or cccmd leads to --cc-cmd parameter being ignored, and emails going either nowhere, or just to the To: line maintainer. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20Revert "lib: fdt: Split fdtdec_setup_mem_size_base()"Michal Simek
This reverts commit 3ebe09d09a407f93022d945a205c5318239eb3f6. There is no user of this split function that's why remove it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20Revert "lib: fdt: Split fdtdec_setup_memory_banksize()"Michal Simek
This reverts commit 118f4d4559a4386fa87a1e2509e84a1986b24a34. There is no user of this split function that's why remove it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20ARM: rmobile: Switch back to fdtdec_setup_memory/banksize_fdt()Michal Simek
The commit 361377dbdbc9 ("ARM: rmobile: Merge prior-stage firmware DT fragment into U-Boot DT on Gen3") reverted changes introduced by commit 175f5027345c ("ARM: renesas: Configure DRAM size from ATF DT fragment") that's why there is no reason to use functions with _fdt() suffix because parameter is gd->fdt_blob as is already for functions without _fdt() suffix. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20Add information for skipped commit optionsPatrick Delaunay
The unsupported Commit-xxx option are silently skipped and removed as 're_remove=Commit-\w*', this patch adds warning message in this case to detect misspelled issue for the 2 supported options: Commit-notes: Commit-changes: For example: the final 's' is missing (Commit-note:) NB: no issue for Series-xxx option as only the supported options are accepted (see valid_series in series.py) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20lib: libfdt: fdt_region: avoid NULL pointer accessPhilippe Reynes
The function fdt_find_regions look in the exclude list for each property, even if the name is NULL. It could happen if the fit image is corrupted. On sandbox, it generates a segfault. To avoid this issue, if the name of a property is NULL, we report an error and avoid looking in the exclude list. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Detect unexpected ENDPatrick Delaunay
Detect unexpected 'END' line when a section is not detected. This patch detect issue when tag name for section start is misspelled, for example 'Commit-note:' for 'Commit-notes:' Commit-note: .... END Then 'Commit-note:' is removed silently by re_remove = "Commit-\w*:" but 'END' is kept in commit message. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20cpu: Convert the methods to use a const udevice *Simon Glass
These functions should not modify the device. Convert them to const so that callers don't need to cast if they have a const udevice *. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Add support for generating a FITSimon Glass
FIT (Flat Image Tree) is the main image format used by U-Boot. In some cases scripts are used to create FITs within the U-Boot build system. This is not ideal for various reasons: - Each architecture has its own slightly different script - There are no tests - Some are written in shell, some in Python To help address this, add support for FIT generation to binman. This works by putting the FIT source directly in the binman definition, with the ability to adjust parameters, etc. The contents of each FIT image come from sub-entries of the image, as is normal with binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20dtoc: Allow adding variable-sized data to a dtbSimon Glass
Add a method for adding a property containing arbitrary bytes. Make sure that the tree can expand as needed in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20mkimage: Allow updating the FIT timestampSimon Glass
Normally the FIT timestamp is created the first time mkimage is run on a FIT, when converting the source .its to the binary .fit file. This corresponds to using the -f flag. But if the original input to mkimage is a binary file (already compiled) then the timestamp is assumed to have been set previously. Add a -t flag to allow setting the timestamp in this case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Allow zero-length entries to overlapSimon Glass
Some binary blobs unfortunately obtain their position in the image from other binary blobs, such as Intel's 'descriptor'. In this case we cannot rely on packing to work. It is not possible to produce a valid image in any case, due to the missing blobs. Allow zero-length overlaps so that this does not cause any problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Allow missing Intel blobsSimon Glass
Update the Intel blob entries to support missing binaries. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Detect when valid images are not producedSimon Glass
When external blobs are missing, show a message indicating that the images are not functional. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Update errors and warnings to use stderrSimon Glass
When warnings and errors are produced by tools they should be written to stderr. Update the tout implementation to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Allow external binaries to be missingSimon Glass
Sometimes it is useful to build an image even though external binaries are not present. This allows the build system to continue to function without these files, albeit not producing valid images. U-Boot does with with ATF (ARM Trusted Firmware) today. Add a new flag to binman to request this behaviour. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Convert existing binary blobs to blob_extSimon Glass
Many of the existing blobs rely on external binaries which may not be available. Move them over to use blob_ext to indicate this. Unfortunately cros-ec-rw cannot use this class because it inherits another. So set the 'external' value for that class. While we are here, drop the import of Entry since it is not used (and pylint3 complains). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Add an etype for external binary blobsSimon Glass
It is useful to be able to distinguish between ordinary blobs such as u-boot.bin and external blobs that cannot be build by the U-Boot build system. If the external blobs are not available for some reason, then we know that a value image cannot be built. Introduce a new 'blob-ext' entry type for that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Use super() instead of specifying parent typeSimon Glass
It is easier and less error-prone to use super() when the parent type is needed. Update binman to remove the type names. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Re-enable concurrent testsSimon Glass
With the change to absolute imports the concurrent tests feature unfortunately broke. Fix it. We cannot easy add a warning, since the output messes up tests which check the output. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Adjust pylibfdt for incremental buildSimon Glass
If the pylibfdt shared-object file is detected, then Python assumes that the libfdt.py file exists also. Sometimes when an incremental build aborts, the shared-object file is built but the libfdt.py is not. The only way out at this point is to use 'make mkproper', or similar. Fix this by removing the .so file before it is built. This seems to make Python rebuild everything. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Fix a few typos in the entry docsSimon Glass
Some typos have been fixed in the generated entry docs but the code was not updated. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Add support for calling mkimageSimon Glass
As a first step to integrating mkimage into binman, add a new entry type that feeds data into mkimage for processing and incorporates that output into the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Set a default toolpathSimon Glass
When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Specify the toolpath when running test coverageSimon Glass
At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Correct the search patch for pylibfdtSimon Glass
Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: cbfs: Fix IFWI typoSimon Glass
This comment references the wrong thing. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Output errors to stderrSimon Glass
At present binman outputs errors to stdout which means that fails are effectively silent when printed by buildman, for example. Fix this by outputing errors to stderr. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20.gitignore: Ignore Python 3 cache directoriesSimon Glass
These can appear when moving between branches that have different tools in the tree. Ignore them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20dm: core Fix long line in device_bind_common()Simon Glass
Fix an over-length line in this function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20patman: Add a -D option to enable debuggingSimon Glass
Most users don't want to see traceback errors. Add an option to enable them for debugging. Disable them by default. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Support collecting response tags in PatchstreamSimon Glass
Collect response tags such as 'Reviewed-by' while parsing the stream. This allows us to see what tags are present. Add a new 'Fixes' tag also, since this is now quite common. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Allow disabling 'bright' mode with Print outputSimon Glass
At present all text is marked bright, which makes it stand out on the terminal. Add a way to disable that, as is done with the Color class. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Add a 'test' subcommandSimon Glass
At present we use --test to indicate that tests should be run. It is better to use a subcommand for list, like binman. Change it and adjust the existing code to fit under a 'send' subcommand, the default. Give this subcommand the same default arguments as the others. Signed-off-by: Simon Glass <sjg@chromium.org>