aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-01-07dm: devres: Convert to use loggingSimon Glass2-2/+5
At present when CONFIG_DEBUG_DEVRES is enabled, U-Boot prints log messages to the console with every devres allocation/free event. This causes most tests to fail since the console output is not as expected. In particular this prevents us from adding a device to sandbox which uses devres in its bind method. Move devres over to use U-Boot's logging feature instead, and add a new category for devres. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07test: Add functions to find the amount of allocated memorySimon Glass2-0/+30
The malloc() implementations provides a way of finding out the approximate amount of memory that is allocated. Add helper functions to make it easier to access this and see changes over time. This is useful for tests that want to check if memory has been allocated or freed. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: devres: Create a new devres header fileSimon Glass2-254/+270
At present these functions are lumped in with the core device functions. They have their own #ifdef to control their availability, so it seems better to split them out. Move them into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Add a new flag to track platform dataSimon Glass3-1/+7
We want to avoid allocating platform data twice. This could happen if device_probe() is called after device_ofdata_to_platdata() for the same device. Add a flag to track whether device_ofdata_to_platdata() has been called on a device. Check the flag to make sure it doesn't happen twice, and clear the flag when the data is freed. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Export a new function to read platdataSimon Glass2-2/+43
Add a new internal function, device_ofdata_to_platdata() to handle allocating private space associated with each device and reading the platform data from the device tree. Call this new function from device_probe(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Add a comment for DM_FLAG_OF_PLATDATASimon Glass1-0/+1
This flag is missing a comment. Add one. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Allocate parent data separate from probing parentSimon Glass1-8/+11
At present the parent is probed before the child's ofdata_to_platdata() method is called. Adjust the logic slightly so that probing parents is not done until afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Move ofdata_to_platdata() call earlierSimon Glass1-7/+7
This method is supposed to extract platform data from the device tree. It should be done before the device itself is probed. Move it earlier in the device_probe() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Don't clear active flag twice when probe() failsSimon Glass1-3/+1
Remove this duplicated code, since the 'fail' label does this immediately. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07aspeed: ast2500: Read clock ofdata in the correct methodSimon Glass1-2/+2
At present the clock driver reads its ofdata in the probe() method. This is not correct although it is often harmless. However in this case it causes a problem, something like this: - ast_get_scu() is called (from somewhere) to get the SCI address - this probes the clock - first sets up ofdata (which does nothing at present) - DM marks clock device as active - DM calls pinctrl - pinctrl probes and calls ast_get_scu() in ast2500_pinctrl_probe() - ast_get_scu() probes the clock, but sees it already marked as probed - ast_get_scu() accesses the clock's private data, with scu as NULL - DM calls clock probe function ast2500_clk_probe() which reads scu By putting the read of scu into the correct method, scu is read as part of ofdata setup, and everything is OK. Note: This problem did not matter until now since DM always probed all parents before reading a child's ofdata. The fact that pinctrl is a child of clock seems to trigger this strange bug. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Cédric Le Goater <clg@kaod.org>
2020-01-07pci: Print a warning if the bus is accessed before probingSimon Glass1-0/+13
It is not possible to access a device on a PCI bus that has not yet been probed, since the bus number is not known. Add a warning to catch this error. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07x86: apl: Avoid accessing the PCI bus before it is probedSimon Glass2-11/+29
The PCI bus is not actually probed by the time the ofdata_to_platdata() method is called since that happens in the uclass's post_probe() method. Update the PMC and P2SB drivers to access the bus in its probe() method. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07usb: Drop use of BUG_ON() and WARN_ON()Simon Glass4-1/+13
These macros use __FILE__ which inserts the full path of the object file into U-Boot, thus increasing file size. Drop these usages. An older version of this patch was submitted here: http://patchwork.ozlabs.org/patch/1205784/ Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07dm: core: Use assert_noisy() in devresSimon Glass1-3/+3
Use this macros instead of the linux ones, as the output is smaller. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07common: Add a noisy assert()Simon Glass1-0/+14
Some U-Boot code uses BUG_ON() and WARN_ON() macros. These use __FILE__ which can include quite a large path, depending on how U-Boot is built. The existing assert() is only checked if DEBUG is enabled. Add a new one which is always checked, and prints a (smaller) error in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-07Merge tag 'u-boot-imx-20200107' of ↵Tom Rini207-3247/+13920
https://gitlab.denx.de/u-boot/custodians/u-boot-imx New for 2020.04 --------------- - New boards Embedded Artists COM board Xea Board - Switch to DM: Aristainetos boards Toradex colibri (DM_ETH) iCubox GE bx50v3 mx7dsabre (DM_ETH) cx9020 - New features: Bootaux with elf files Default SYS_THUMB_BUILD for i.MX6/7 - Fixes: DHCOM i.MX6 PDK Engicam i.MX8M tools (imx8m_image) Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/633679664
2020-01-07Merge tag 'u-boot-atmel-2020.04-a' of ↵Tom Rini8-2/+184
https://gitlab.denx.de/u-boot/custodians/u-boot-atmel First set of u-boot-atmel features for 2020.04 cycle This feature set is a patch series from Tudor Ambarus which includes parsing of the spi flash SFDP parser for SST flashes, and using those tables to retrieve unique saved per device MAC address. This is then used as base mac address on the SAMA5D2 Wireless SOM EK board.
2020-01-07ARM: mxs: spl_boot.c: make early_delay more robustRasmus Villemoes1-5/+2
It's true that booting normally doesn't take long enough for the register to roll (which actually happens in a little over an hour, not just a few seconds). However, the counter starts at power-on, and if the board is held in reset to be booted over USB, one actually risks hitting wrap-around during boot, which can both result in too short delays (if the "st += delay" calculation makes st small) and theoretically also unbound delays (if st ends up being UINT_MAX and one just misses sampling digctl_microseconds at that point). It doesn't take more code to DTRT, and once bitten, twice shy. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-01-07ARM: dts: imx6qdl-icore-1.5: Remove duplicate phy reset methodsMichael Trimarchi1-2/+0
Engicam i.CoreM6 1.5 Quad/Dual MIPI dtsi is reusing fec node from Engicam i.CoreM6 dtsi but have sampe copy of phy-reset-gpio and phy-mode properties. So, drop this phy reset methods from imx6qdl-icore-1.5 dsti file. Cc: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-07ARM: dts: imx6q-icore-mipi: Use 1.5 version of i.Core MX6DLJagan Teki1-1/+1
The EDIMM STARTER KIT i.Core 1.5 MIPI Evaluation is based on the 1.5 version of the i.Core MX6 cpu module. The 1.5 version differs from the original one for a few details, including the ethernet PHY interface clock provider. With this commit, the ethernet interface works properly: SMSC LAN8710/LAN8720 2188000.ethernet-1:00: attached PHY driver While before using the 1.5 version, ethernet failed to startup do to un-clocked PHY interface: fec 2188000.ethernet eth0: could not attach to PHY Similar fix has merged for i.Core MX6Q but missed to update for DL. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-07ARM: dts: icorem6: Sync engicam device trees from v5.4Jagan Teki11-245/+688
Sync Engicam device tree file from v5.4 linux-next. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-07configs: imx6-engicam: Drop fec phy address and modeMichael Trimarchi1-11/+0
Now all the fec related phy properties are now accessible via dts. So drop the explicit config items from common config file, imx6-engicam.h Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-07board: engicam: Fix the ethernet clock initializationMichael Trimarchi1-0/+29
According to the SOM and reference board the clock can be taken from the external pin or provided from ENET_REF_CLK. Add a new function that make the proper set according the board type. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-07board: engicam: Cleanup fdt file and board mappingMichael Trimarchi1-11/+56
Make easy to map fdt file to board in order to use this information later to apply specific change to specific board combination. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-01-07arm: mxs: be more careful when enabling gpmi_clkRasmus Villemoes1-1/+4
The data sheet says that the DIV field cannot change while the CLKGATE bit is set or modified. So do it a little more carefully, by first clearing the bit, waiting for that to appear, then setting the DIV field. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-01-07arm: mxs: fix comments in arch_cpu_init to match the codeRasmus Villemoes1-2/+2
The comment says to clear the bypass bit, but in fact it sets it, thus selecting ref_xtal. And the next line of code does not set the divider to 12, but to (the reset value of) 1. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-01-07arm: mxs: fix register definitions for clkctrl_gpmi and clkctrl_sspXRasmus Villemoes2-7/+14
I tried clearing a bit by writing to hw_clkctrl_gpmi_clr, then busy-waiting for it to actually clear. My board hung. The data sheet agrees, these registers do not have _set, _clr, _tog, so fix up the definitions. git grep -E 'clkctrl_(gpmi|ssp[0-9])_' says that nobody uses those non-existing ops registers. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-01-07imx8mm_evk: Adjust the environment for booting a mainline kernelFabio Estevam2-5/+4
Adjust the environment for booting a mainline kernel by default. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-01-07mach-imx: nandbcb: improve cmd helpIgor Opaniuk1-3/+6
Add info about supported i.MX7, improve details the usage of bcbonly subcommand. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07mx6slevk: Fix the pmic_get() parameter in the DM caseFabio Estevam1-1/+1
When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address, so fix it accordingly. Reported-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-01-07mx6sllevk: Fix the pmic_get() parameter in the DM caseFabio Estevam1-1/+1
When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address, so fix it accordingly. Reported-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-01-07mx7dsabresd: Fix the pmic_get() parameter in the DM caseFabio Estevam1-1/+1
When pmic_get() is used with DM the first parameter must be the complete node name plus the unit address, so fix it accordingly. Reported-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-01-07ddr: imx8m: Return error values from LPDDR4 trainingFrieder Schrempf4-11/+23
In cases when the same SPL should run on boards with i.MX8MM, that differ in DDR configuration, it is necessary to try different parameters and check if the training done by the firmware suceeds or not. Therefore we return the DDR training/initialization success to the upper layer in order to be able to retry with different settings if necessary. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2020-01-07tools: imx8m_image: Change source path for DDR firmware to build dirFrieder Schrempf3-23/+17
The DDR firmware binaries are not part of the U-Boot source code, so we should look for them in the build directory, where they need to be copied to before building U-Boot. The ATF binary is already fetched from the build directory, but the README files for the i.MX8M EVKs claim that it needs to be copied to the source directory (which is still true for in-tree builds, but not in general). Therefore we also fix the READMEs to use the build directory as the correct location for all additional binary files. Sined-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2020-01-07arm: imx: Default to SYS_THUMB_BUILD for i.MX6/7Tom Rini1-1/+3
In the case of i.MX6 and i.MX7 family SoCs it is safe (from an errata point of view) to use thumb2 by default to save space. Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2020-01-07mach-imx: bootaux: elf firmware supportIgor Opaniuk3-5/+126
Currently imx-specific bootaux command doesn't support ELF format firmware for Cortex-M4 core. This patches introduces a PoC implementation of handling elf firmware (load_elf_image_phdr() was copy-pasted from elf.c just for PoC). ELF64 binaries isn't supported yet. This has the advantage that the user does not need to know to which address the binary has been linked to. However, in order to handle and load the elf sections to the right address, we need to translate the Cortex-M4 core memory addresses to primary/host CPU memory addresses (Cortex A7/A9 cores). This allows to boot firmwares from any location with just using bootaux, e.g.: > tftp ${loadaddr} hello_world.elf && bootaux ${loadaddr} Similar translation table can be found in the Linux remoteproc driver [1]. [1] https://elixir.bootlin.com/linux/latest/source/drivers/remoteproc/imx_rproc.c Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07colibri_imx7: migrate to DM_ETHIgor Opaniuk4-55/+6
Migrate to DM_ETH and remove hardcoded pinmux configuration. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07ARM: dts: imx7: imx7_colibri: introduce fec nodeIgor Opaniuk3-0/+120
Sync DTS with the mainline Linux and introduce fec node and regulator configuration for rn5t567 PMU. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07apalis_imx6: migrate to DM_ETHIgor Opaniuk3-57/+3
Migrate to DM_ETH and remove hardcoded pinmux configuration. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07ARM: dts: imx6_apalis: introduce fec nodeIgor Opaniuk1-0/+22
Sync DTS with the mainline Linux and introduce fec node. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07colibri_imx6: migrate to DM_ETHIgor Opaniuk3-63/+7
Migrate to DM_ETH and remove hardcoded pinmux configuration. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07ARM: dts: imx6_colibri: introduce fec nodeIgor Opaniuk1-0/+20
Sync DTS with the mainline Linux and introduce fec node. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-01-07MAINTAINERS: change colibri_imx6/imx6ull/t30/vf maintainersIgor Opaniuk4-4/+4
Take over maintainership for colibri_imx6/imx6ull/t30/vf modules. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2020-01-07MAINTAINERS: change apalis_imx6/colibri_imx6 maintainersIgor Opaniuk2-2/+2
Take over maintainership for apalis_imx6 and colibri_imx6 modules. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-01-07mx7dsabre: Remove warning about DM_SPI_FLASHJoris Offouga1-3/+0
This defconfig doesn't need it. Signed-off-by: Joris Offouga <offougajoris@gmail.com>
2020-01-07mx7dsabre: Convert to distroboot supportJoris Offouga3-86/+25
Signed-off-by: Joris Offouga <offougajoris@gmail.com>
2020-01-07mx7dsabre: Enable DM_ETHJoris Offouga6-283/+589
Also sync device tree with v5.5-rc1 Signed-off-by: Joris Offouga <offougajoris@gmail.com>
2020-01-07mx7ulp: Add support for Embedded Artists COM boardFabio Estevam10-1/+470
The Embedded Artists COM board is based on NXP i.MX7ULP. It has a BD70528 PMIC from Rohm with discrete DCDC powering option and improved current observability (compared to the existing NXP i.MX7ULP EVK). Add the initial support for the board. Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-01-07colibri_vf: add update_uboot wrapperIgor Opaniuk1-0/+5
Add universal update_uboot wrapper that helps to update U-Boot image on internal storage. Usage example: > tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx > run update_uboot Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2020-01-07colibri-imx6ull: add update_uboot wrapperIgor Opaniuk1-0/+7
Add universal update_uboot wrapper that helps to update U-Boot image on internal storage. Usage example: > tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx > run update_uboot Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>