aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-03-22dtoc: Support headers needed for driversSimon Glass
Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in drivers, typically with the .data field of struct udevice_id. Since dtoc does not support searching for these, add a way to tell dtoc which header to use. This works as a macro included in the driver definition. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22Makefile: Pass the U-Boot phase to dtocSimon Glass
Pass the U-Boot phase as a parameter so dtoc can use it. At present it is ether "spl" or "tpl". Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Support tracking the phase of U-BootSimon Glass
U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in the build system simply by compiling in one driver or the other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has no way of knowing which code is compiled in for which phase, since it does not inspect Makefiles or dependency graphs. So to make this work for dtoc, we need to be able to explicitly mark drivers with their phase. This is done by adding an empty macro to the driver. Add support for this in dtoc. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Track nodes which are actually usedSimon Glass
Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Process nodes to set up required propertiesSimon Glass
Add logic to assign property values to nodes as required by dtoc. The references allow nodes to refer to each other in C code. The macros used by dtoc are not yet defined in driver model. They will be added along with the actual driver model implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Make use of node propertiesSimon Glass
Now that we have these available, use them instead of recalculating things each time. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Add some extra properties to nodesSimon Glass
It is convenient to attach drivers, etc. to nodes so that we can use the Node object as the main data structure in this module. Add a function which adds the new properties, along with documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Rename sandbox_i2c_test and sandbox_pmic_testSimon Glass
These have '_test' suffixes which are not present on the drivers in the source code. Drop the suffixes to avoid a mismatch when scanning. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Move test files into a test/ directorySimon Glass
It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Support scanning of structs in header filesSimon Glass
Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant header file, to avoid a build error. We need a way for dtoc to scan header files for struct definitions. Then, when it wants to generate code that uses a struct, it can make sure it includes the correct header file, first. Add a parser for struct information, similar to drivers. Keep a dict of the structs that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Support scanning of uclassesSimon Glass
Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Collect priv/plat struct info from driversSimon Glass
In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct <name>)]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Ignore unwanted files when scanning for driversSimon Glass
We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Save scan information across test runsSimon Glass
At present most of the tests scan the U-Boot source tree as part of their run. This information does not change across tests, so we can save time by remembering it. Add a way to set up this information and use it for each test, taking a copy first, so as not to mess up the original. This reduces the run time from about 1.6 seconds to 1.5 seconds on my machine. For code coverage (which cannot run in parallel), it reduces from 33 seconds to 5. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22dtoc: Scan drivers for available informationSimon Glass
At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22sandbox: add FAT to the list of usable env driversHeinrich Schuchardt
Add the FAT environment driver to the priority list. When testing the UEFI sub-system the EFI system partition is formatted with FAT so it is reasonable to store the environment there. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22dm: error handling dev_get_dma_range()Heinrich Schuchardt
goto after return has not effect. Calling of_node_put() in case of some errors and not for others is inconsistent. Fixes: 51bdb50904b ("dm: Introduce xxx_get_dma_range()") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22sandbox: enable cros-ec-keyb in test.dtbHeinrich Schuchardt
Currently keyboard input fails in the GUI window opened by ./u-boot -T -l Add the missing include to test.dts. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22patman: Use less for help file, if availableNicolas Boichat
It's convenient to be able to scroll up in `patman -H`. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22test: print_ut: Fix potential build errorBin Meng
This files uses the macro U_BOOT_CMD which is defined in command.h, but command.h is conditionally included. Fix it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22test: cmd: setexpr: Fix a typoBin Meng
SETEXPR_TEST is for a new setexpr test, not mem. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22mmc: pci: Fix Kconfig dependencyBin Meng
The PCI MMC driver depends on the generic MMC SDHCI driver, otherwise it does not compile. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-03-22tools: fdtgrep: Use unsigned chars for arraysSamuel Dionne-Riel
Otherwise, values over 127 end up prefixed with ffffff. Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22sandbox: allow cross-compiling sandboxHeinrich Schuchardt
UEFI test files like helloworld.efi require an architecture specific PE-COFF header. Currently this does not work for cross compiling. If $CROSS_COMPILE is set, use the first part of the architecture triplet from the variable to choose the PE-COFF header. Now we can cross-compile the sandbox, e.g. make sandbox_defconfig NO_SDL=1 CROSS_COMPILE=/opt/bin/aarch64-linux-gnu- NO_SDL=1 MK_ARCH=aarch64 make Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22patman: Quieten down the alias checkingSimon Glass
When a tag is used in a patch subject (e.g. "tag: rest of message") and it cannot be found as an alias, patman currently reports a fatal error, unless -t is provided, in which case it reports a warning. Experience suggest that the fatal error is not very useful. Instead, default to reporting a warning, with -t tell patman to ignore it altogether. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22patman: Update documentation to match new usageSimon Glass
With the subcommands some of the documentation examples are no-longer correct. Fix all of them, so it is consistent. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-22azure: Use --board flag with sandbox_splSimon Glass
At present there is only one board which uses sandbox SPL. But with sandbox_noinst being added, this is no longer true. Add a --board flag so that we just build one board on azure, as is done in gitlab. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2021-03-20Merge branch '2021-03-20-mediatek-updates' into nextTom Rini
- A number of MediaTek platform updates
2021-03-20tools: mtk_image: add an option to set device header offsetWeijie Gao
This patch adds an option which allows setting the device header offset. This is useful if this tool is used to generate ATF BL2 image of mt7622 for SD cards. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20configs: mt7622: enable debug uart for mt7622_rfb_defconfigWeijie Gao
Enable debug uart for mt7622_rfb_defconfig Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20board: mt7629: enable compression of u-boot to reduce the size of final imageWeijie Gao
This patch makes use of the decompression mechanism implemented for mt7628 previously to reduce the total image size. Binman will be also removed. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20serial: mtk: rewrite the setbrg functionWeijie Gao
Currently the setbrg logic of serial-mtk is messy, and should be rewritten. Also an option is added to make it possible to use highspeed-3 mode for all bauds. The new logic is: 1. If baud clock > 12MHz a) If baud <= 115200, highspeed-0 mode will be used (ns16550 compatible) b) If baud <= 576000, highspeed-2 mode will be used c) any bauds > 576000, highspeed-3 mode will be used 2. If baud clock <= 12MHz Forced highspeed-3 mode a) If baud <= 115200, calculates the divisor using DIV_ROUND_CLOSEST b) any bauds > 115200, the same as 1. c) Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20dts: mt7629: enable JTAG pins by defaultWeijie Gao
The EPHY LEDs belongs to the built-in FE switch of MT7629, which is barely used. These LED pins on reference boards are used as JTAG socket. So it's a good idea to change the default state to JTAG, and this will make it convenience for debugging. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20configs: mt7622: use ARMv8 Generic Timer instead of mtk_timerWeijie Gao
It's better to use the generic timer which is correctly initialized by the ATF. The generic timer has higher resolution than the mtk_timer. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20pinctrl: mt7629: add jtag function and pin groupWeijie Gao
The EPHY LEDs of mt7629 can be used as JTAG. This patch adds the jtag pin group to the pinctrl driver. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20pinctrl: mediatek: do not probe gpio driver if not enabledWeijie Gao
The mtk pinctrl driver is a combination driver with support for both pinctrl and gpio. When this driver is used in SPL, gpio support may not be enabled, and this will result in a compilation error. To fix this, macros are added to make sure gpio related code will only be compiled when gpio support is enabled. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-03-20pinctrl: mediatek: add get_pin_muxing ops for mediatek pinctrlSam Shih
This patch add get_pin_muxing support for mediatek pinctrl drivers Signed-off-by: Sam Shih <sam.shih@mediatek.com>
2021-03-20pinctrl: mediatek: fix wrong assignment in mtk_get_pin_nameSam Shih
This is a bug fix for mtk pinctrl common part. Appearently pins should be used instead of grps in mtk_get_pin_name(). Signed-off-by: Sam Shih <sam.shih@mediatek.com>
2021-03-20board: Add MT8183 pumpkin board supportFabien Parent
Add the MT8183 pumpkin board support. Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20ARM: mediatek: Add MT8183 supportFabien Parent
Add the MT8183 SoC support. Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20configs: mt8516: use bootcmd from config_distro_bootcmd.hFabien Parent
Instead of redefining our own way to boot, let's just use config_distro_bootcmd.h. Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20board: mediatek: mt8516: init USB Ether for pumpkin boardFabien Parent
Init USB Ether if CONFIG_USB_ETHER is enabled. Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20board: mediatek: rename pumpkin board into mt8516Fabien Parent
More than one pumpkin board has been made with different MediaTek SoCs. Rename the pumpkin board to follow the naming convention of all other MediaTek boards and also to not be confusing when other pumpkin boards will be added in follow-up commits. Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-19Merge branch 'next' of git://source.denx.de/u-boot-sh into nextTom Rini
- New platforms and related support
2021-03-16board: silinux: Enable recovery SPL for EK874 boardLad Prabhakar
Enable building SPL for EK874 board which is based on R8A774C0 SoC. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
2021-03-16arm: rmobile: Add Silicon Linux EK874 board supportLad Prabhakar
The EK874 development kit from Silicon Linux is made of CAT874 (the main board) and CAT875 (the sub board that goes on top of CAT874). This patch adds the required board support to boot Si-Linux EK874 board based on R8A774C0 SoC. DTS files apart from r8a774c0-ek874-u-boot.dts and r8a774c0-u-boot.dtsi have been imported from Linux kernel 5.11 commit f40ddce88593 ("Linux 5.11"). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
2021-03-16pinctrl: renesas: Add support for R8A774C0Lad Prabhakar
Renesas RZ/G2E (a.k.a. r8a774c0) is pin compatible with R-Car E3 (a.k.a. r8a77990), however it doesn't have several automotive specific peripherals. This patch hooks R8A774C0 SoC with the pfc driver. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
2021-03-16pinctrl: renesas: pfc-r8a77990: Sync PFC tables with Linux 5.11Lad Prabhakar
Sync the R8A77990 SoC PFC tables with Linux 5.11 , commit f40ddce88593. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
2021-03-16arm: dts: r8a774c0: Resync R8A774C0 SoC DTSI with Linux 5.11Lad Prabhakar
Resync the R8A774C0 SoC DTSI with Linux kernel 5.11 commit f40ddce88593 ("Linux 5.11"). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
2021-03-16arm: rmobile: Add HopeRun HiHope RZ/G2H board supportBiju Das
The HiHope RZ/G2H board from HopeRun consists of main board (HopeRun HiHope RZ/G2H main board) and sub board(HopeRun HiHope RZ/G2H sub board). The HiHope RZ/G2H sub board sits below the HiHope RZ/G2H main board. This patch adds the required board support to boot HopeRun HiHope RZ/G2H board. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>