summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-09checkpatch: Don't warn about PREFER_IF in headers/DT filesSimon Glass
This warning should only be displayed for C files. Fix it and update the test. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Add tests for the rest of the checkpatch checksSimon Glass
Finish off the tests for our small collection of checkpatch checks. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Decode output from the '--show-types' optionSimon Glass
Collect the 'checkpatch type' from each error, warning and check. Provide this to patman and update the uclass test to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Add a test for the 'possible new uclass' checkSimon Glass
It is quite likely that the number of U-Boot-specific tests in checkpatch.pl will increase over time. We should have tests for these to avoid undefined behaviour and bugs being introduced, which might cause people to ignore the warnings. Add a simple new class that can generate a patch with a single-line addition in it. Use that to add a test for one of the checkpatch checks. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Rename test.py to test_checkpatch.pySimon Glass
These tests check checkpatch.pl operation and can server as our tests for the U-Boot-specific updates to that script. Rename the file and update comments to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09dm: core: Correct comment on uclass_id_foreach_dev()Simon Glass
This parameter should be a struct uclass, not struct udevice. Correct it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
2020-07-09log: uclass_get_name() depends on CONFIG_SPL_DMHeinrich Schuchardt
If CONFIG_SPL_DM=n and CONFIG_SPL_LOG=y a build error occurs: ld.bfd: common/built-in.o: in function `log_get_cat_name': common/log.c:48: undefined reference to `uclass_get_name' make[1]: *** [scripts/Makefile.spl:422: spl/u-boot-spl] Error 1 Call uclass_get_name() only if DM is enabled. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-09sandbox: make RAM size configurableHeinrich Schuchardt
Up to now the RAM size of the sandbox is hard coded as 128 MiB. This does not allow testing the correct handling of addresses outside the 32bit range. 128 MiB is also rather small when tracing functions where the trace is written to RAM. Provide configuration variable CONFIG_SANDBOX_RAM_SIZE_MB to set the RAM size in MiB. It defaults to 128 MiB with a minimum of 64 MiB. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Drop import of test_util in test_utilSimon Glass
This module doesn't need to import itself. It causes problems on very old Python 3 (e.g. 3.4.0). Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Avoid importing gitutil in settingsSimon Glass
Pass this module in so that settings does not need to import it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
2020-07-09patman: Pass in maintainer dirs to avoid and importSimon Glass
Adjust the get_maintainer module to accept a list of directories to search for the script. This avoids needing to import gitutil. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
2020-07-09patman: Use a dict in gitutil to avoid importing seriesSimon Glass
Only a few members of this class are used and only in a test. To avoid importing the module, convert the test to use a dict. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
2020-07-09patman: Avoid circular dependency between command and toolsSimon Glass
This seems to cause problems in some cases. Split the dependency by copying the code to command. Reported-by: Stefan Bosch <stefan_b@posteo.net> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Drop unnecessary import in gitutilSimon Glass
The checkpatch module is not used, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
2020-07-09sandbox: spi: sandbox_sf_state_name() is requiredHeinrich Schuchardt
Compiling drivers/mtd/spi/sandbox.c fails when compiled with CONFIG_LOG=n: In file included from include/common.h:20, from drivers/mtd/spi/sandbox.c:13: drivers/mtd/spi/sandbox.c:295:15: error: format ‘%s’ expects argument of type ‘char *’, but argument 7 has type ‘int’ [-Werror=format=] 295 | log_content(" cmd: transition to %s state\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ 37 | #define pr_fmt(fmt) fmt | ^~~ include/log.h:128:30: note: in expansion of macro ‘log_nop’ 128 | #define log_content(_fmt...) log_nop(LOG_CATEGORY, \ | ^~~~~~~ drivers/mtd/spi/sandbox.c:295:3: note: in expansion of macro ‘log_content’ 295 | log_content(" cmd: transition to %s state\n", | ^~~~~~~~~~~ drivers/mtd/spi/sandbox.c:295:37: note: format string is defined here 295 | log_content(" cmd: transition to %s state\n", | ~^ | | | char * | %d Supply function sandbox_sf_state_name() independent of CONFIG_LOG. Fixes: c3aed5db591e ("sandbox: spi: Add more logging") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-09sandbox: handling out of memoryHeinrich Schuchardt
assert() only works in debug mode. So checking a successful memory allocation should not use assert(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-09Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86Tom Rini
- Add two- and three-argument versions of CONFIG_IS_ENABLED in linux/kconfig.h - Adds a new feature which supports copying modified parts of the frame buffer to the uncached hardware buffer - Enable the copy framebuffer on various x86 targets
2020-07-09Merge tag 'for-v2020.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2cTom Rini
i2c changes for v2020.10 - Add support for I2C controllers found on Octeon II/III and Octeon TX TX2 SoC platforms. - Add I2C controller support for Cortina Access CAxxxx SoCs - new rtc methods, rtc command, and tests - imx_lpi2c: Improve the codes to use private data - stm32f7_i2c.c: Add new compatible "st,stm32mp15-i2c" - stm32f7_i2c.c: Add Fast Mode Plus support - pwm: Add PWM driver for SiFive SoC
2020-07-09Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvellTom Rini
- Armada 38x DDR3 fixes, enhancements (Chris) - Armada 38x UTMI PHY SerDes fix (Chris) - Helios4 update - sync with clearfog (Dennis) - LaCie Kirkwood board rework - enable DM (Simon) - net/mvpp2 memory init fix (Sven)
2020-07-09net: mvpp2: fix second cp110 initializationSven Auhagen
Since the mdio code got upstreamed it is not possible to activate network ports on CP110 Master and Slave. The problem is in mvpp2_base_probe which is called for each CP110 and it initializes the buffer area for descs and rx_buffers. This should only happen once though and the bd space is actually set to 0 after the first run of the function. This leads to an error when the second CP110 tries the initialization again and disables all network ports on this CP110. This patch adds a static variable to check if the buffer area is initialized only once globally. Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09arm: kirkwood: enable DM_ETH for LaCie boardSimon Guinot
This patch enables DM_ETH for the following Kirkwood-based LaCie boards: - d2 Network v2 - Internet Space v2 - 2Big Network v2 - Network Space v2 - Network Space Lite v2 - Network Space Max v2 - Network Space Mini v2 Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09arm: kirkwood: enable DM_USB for LaCie boardSimon Guinot
This patch enables DM_USB and USB_STORAGE for the following Kirkwood-based LaCie boards: - d2 Network v2 - Internet Space v2 - 2Big Network v2 - Network Space v2 - Network Space Lite v2 - Network Space Max v2 Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09arm: kirkwood: switch LaCie boards to sata_mv driverSimon Guinot
This patch switches the SATA driver from mvsata_ide to sata_mv for the following Kirkwood-based LaCie boards: - d2 Network v2 - Internet Space v2 - 2Big Network v2 - Network Space v2 - Network Space Lite v2 - Network Space Max v2 - Network Space Mini v2 Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09arm: kirkwood: convert LaCie boards to DM_SPI_FLASHSimon Guinot
This patch converts the following Kirkwood-based LaCie boards to DM, DM_SPI and DM_SPI_FLASH: - d2 Network v2 - Internet Space v2 - 2Big Network v2 - Network Space v2 - Network Space Lite v2 - Network Space Max v2 - Network Space Mini v2 Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-07-09arm: kirkwood: add DT spi0 alias to LaCie boardsSimon Guinot
The spi0 alias is needed by the environment code to retrieve the SPI flash. This patch adds some -u-boot.dtsi files, providing the spi0 aliases, for all the following Kirkwood-based LaCie boards: - d2 Network v2 - Internet Space v2 - 2Big Network v2 - Network Space v2 - Network Space Lite v2 - Network Space Max v2 - Network Space Mini v2 Note that this -u-boot.dtsi files will be removed as soon as the spi0 aliases will be available in the upstream Linux dtsi files. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-07-09arm: mvebu: helios4: sync helios4 config to clearfog and dts to kernelDennis Gilmore
The helios4 is built on the same microsom as the clearfog, by syncing the config we enable the same featureset that exists in the som on the helios4. The current config does not boot as some of the clearfog changes needed to be made on the helios4 also, generally speaking most changes for the clearfog should also be made on the helios4. Signed-off-by: Dennis Gilmore <dennis@ausil.us> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09arm: mvebu: a38x: Adjust UTMI PHY parametersChris Packham
When running USB compliance tests on our Armada-385 hardware platforms we have seen some eye mask violations. Marvell's internal documentation says: Based on silicon test results, it is recommended to change the impedance calibration threshold setting to 0x6 prior to calibration. Port changes from Marvell's u-boot fork[1] to address this. [1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/a6221551 Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09arm: mvebu: a38x: Fix typoChris Packham
Fix spelling of Alignment. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09mv_ddr: ddr3: Update {min,max}_read_sample calculationChris Packham
Measurements on actual hardware shown that the read ODT is early by 3 clocks. Adjust the calculation to avoid this. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> [upstream https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/22] Signed-off-by: Chris Packham <judge.packham@gmail.com> Tested-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09mv_ddr: ddr3: Use correct bitmask for read sample delayChris Packham
In the Armada 385 functional spec (MV-S109094-00 Rev. C) the read sample delay fields are 5 bits wide. Use the correct bitmask of 0x1f when extracting the value. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> [upstream https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/22] Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-09x86: apl: Re-enable loading of SPLSimon Glass
At present the SPL loader is not included in the TPL image so SPL cannot be loaded. Fix it by including this file for both SPL and TPL. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: c87f9ce2273 ("x86: Don't build some unused objects in TPL") Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09spi: Remove unnecessary #ifdefs in header fileSimon Glass
These prevent use of compile-time checks such as: if (CONFIG_IS_ENABLED(DM_SPI)) since, for example, if CONFIG_SPL_DM_SPI is not enabled then the definitions are not included by spi.h and the C code will not build. The #ifdefs are unnecessary since there are no conflicts with the pre-DM code. In any case we have almost switched over to driver model for SPI. Drop these #ifdefs from spi.h to fix a build warning on chromebook_coral in the following patch. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09bootstage: Fix 'stacked' typoSimon Glass
This should be 'stashed'. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09linux/kconfig.h: create two- and three-argument versions of CONFIG_IS_ENABLEDRasmus Villemoes
This adds a bunch of preprocessor magic to extend the capabilities of CONFIG_IS_ENABLED. The existing semantics of CONFIG_IS_ENABLED(FOO) expanding to a 1 or 0 (depending on build context and the defined-ness or not of the appropriate CONFIG_FOO/CONFIG_SPL_FOO/CONFIG_TPL_FOO) are of course preserved. With this, one is also allowed a two-argument form CONFIG_IS_ENABLED(FOO, (something)) which expands to something precisely when CONFIG_IS_ENABLED(FOO) would expand to 1, and expands to nothing otherwise. It is, in other words, completely equivalent to the three lines #if CONFIG_IS_ENABLED(FOO) something #endif The second argument must be parenthesized in order to allow any tokens, including a trailing comma, to appear - one use case for this is precisely to make it a bit more ergonomic to build an array and only include certain items depending on .config. That should increase both readability and not least "git grep"ability. A third variant is also introduced, CONFIG_IS_ENABLED(FOO, (xxx), (yyy)) which corresponds to #if CONFIG_IS_ENABLED(FOO) xxx #else yyy #endif Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09linux/kconfig.h: remove unused helper macrosRasmus Villemoes
U-Boot does not have loadable modules, and nothing currently uses any of the (CONFIG_)?IS_(BUILTIN|MODULE) macros - only the (CONFIG_)?IS_ENABLED variants are ever used. While I understand the desire to keep this somewhat synchronized with linux, we've already departed by the introduction of the CONFIG_IS_ENABLED extra logic, and deleting these makes the next patch much simpler, since I won't have to duplicate a lot of logic for no real gain (as there are no users). Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09linux/kconfig.h: simplify logic for choosing CONFIG_{SPL_, TPL_, }*Rasmus Villemoes
Instead of using the arg1_or_junk trick to pick between two choices, with a bit of duplication between the branches (and most of the CONFIG_TPL_BUILD case being redundant, as _IS_TPL is known to be defined to 1 in that case), simply define a prefix that we inject between CONFIG_ and the given config symbol. This only requires one level of indirection (to get the _CONFIG_PREFIX macro expanded before the token concatenation takes place), and makes it easy to, say, introduce a CONFIG_HOSTTOOL_ prefix. [I would expect most HOSTTOOL_ symbols to just be def_bool y, but it would allow us to clean up some of the ifdef HOSTCC mess in the sources shared between U-Boot and host tools.] Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09arm: cmd_stm32prog: Fix the CONFIG_IS_ENABLED() usageBin Meng
Add parentheses around CONFIG_IS_ENABLED() in the if statement, to fix potential build failures. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-09x86: minnowmax: Drop screen resolution to 1024x768Simon Glass
This seems like a more reasonable resolution for this board, since it is quite slow. It also allows it to work with a 5" LCD display in my lab. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09minnowmax: Enable the copy framebufferSimon Glass
Update the video driver to support this feature and enable it on minnowmax to speed up the display. With this change, the time taken to print the environment to the display without CONFIG_CONSOLE_SCROLL_LINES is reduced from over 13 seconds to 300ms, at 1280x1024. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09chromebook_link: Enable the copy framebufferSimon Glass
Update the video driver to support this feature and enable it on link. Also remove the multi-line scrolling since normal scrolling is fast enough now. With this change, the time taken to print the environment to the display without CONFIG_CONSOLE_SCROLL_LINES is reduced from about 930ms to 29ms. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09chromebook_samus: Enable the copy framebufferSimon Glass
Update the video driver to support this feature and enable it on samus. Also remove the multi-line scrolling since normal scrolling is fast enough now. With this change, the time taken to print the environment to the display without CONFIG_CONSOLE_SCROLL_LINES is reduced from about 430ms to 12ms. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09x86: video: Support copy framebuffer with probed devicesSimon Glass
For PCI video devices that are not mentioned in the devicetree, U-Boot does not bind a driver before relocation, since PCI is not fully probed at that point. Furthermore it is possible for the video device to be on a secondary bus which is not even scanned. This is fine if the framebuffer is allocated in fixed memory, as it normally is on x86. But when using this as a copy framebuffer, we also need U-Boot to allocate its own cached framebuffer for working in. Since the video driver is never bound before relocation, the framebuffer size is never set and U-Boot does no allocation. Add a new CONFIG option to reserve 16MB of memory for this eventuality. This allows vesa devices to use the copy framebuffer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: Correctly handle multiple framebuffersSimon Glass
At present video_bottom is set to the bottom of each framebuffer when it is allocated. This is not correct, since it should hold the bottom of the entire area available for framebuffers. Fix this by adding a private address in the uclass which keeps track of the next available spot for a framebuffer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09x86: fsp: video: Allocate a frame buffer when neededSimon Glass
When the copy framebuffer is in use, we must also have the standard U-Boot framebuffer available. Update the FSP driver to support this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: pci: Set up the copy framebufferSimon Glass
When using a copy framebuffer we need to tell the video subsystem its address. U-Boot's normally allocated framebuffer is used as the working buffer, but nothing is displayed until it is copied to the copy framebuffer. For this to work the video driver must request that a framebuffer be allocated separately from the hardware framebuffer, so add a check for that. Also add a log category so that logging appears correctly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: sandbox: Add support for the copy framebufferSimon Glass
Enable this feature on sandbox by updating the SDL driver to have two framebuffers. Update the video tests to check that the copy framebuffer is kept in sync. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-07-09video: Add comments to struct sandbox_sdl_platSimon Glass
This struct is not commented but needs it. Also fix the comment in check_vidconsole_output() about the encoding for the rotation value. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2020-07-09video: Update the copy framebuffer when writing bitmapsSimon Glass
Adjust the bitmap code to sync to the copy framebuffer when done. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: Update rotated console to support copy bufferSimon Glass
Update the implementation to keep a track of what it changes in the frame buffer and then tell the copy buffer about it. Use the special vidconsole_memmove() helper so that memmove() operations are also reflected in the copy buffer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-09video: Update truetype console to support copy bufferSimon Glass
Update the implementation to keep a track of what it changes in the frame buffer and then tell the copy buffer about it. Use the special vidconsole_memmove() helper so that memmove() operations are also reflected in the copy buffer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>