Commit graph

74335 commits

Author SHA1 Message Date
Patrick Delaunay
035d8483ac net: eth-phy: manage subnode mdio0
Bind any subnode with name beginning by mdio, mdio0 for example,
and not only the "mdio" as namei of subnode.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22 22:05:44 +03:00
Patrick Delaunay
880ecb09b9 net: eth-phy: use dev_dbg and log_notice
Replace debug trace and printf to log macros:
- debug() replaced by dev_dbg() when device is available, this macro
indicate the device name since commit ceb70bb870 ("dm: Print device
name in dev_xxx like Linux")
- printf() replaced by log_notice() to allow  dispatch to log backends.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-22 22:05:44 +03:00
Patrick Delaunay
d33982d5bc net: eth-phy: add support of device tree configuration for gpio reset
The gpio reset and the assert or deassert delay are defined in generic
binding of the ethernet phy in Linux:
Documentation/devicetree/bindings/net/ethernet-phy.yaml

  reset-gpios:
    maxItems: 1
    description:
      The GPIO phandle and specifier for the PHY reset signal.

  reset-assert-us:
    description:
      Delay after the reset was asserted in microseconds. If this
      property is missing the delay will be skipped.

  reset-deassert-us:
    description:
      Delay after the reset was deasserted in microseconds. If
      this property is missing the delay will be skipped.

See also U-Boot: doc/device-tree-bindings/net/phy.txt

This patch adds the parsing of this common DT properties in the
u-class "eth_phy_generic", used by default in the associated driver
"eth_phy_generic_drv"

This parsing function eth_phy_of_to_plat can be reused by other
ethernet phy drivers for this uclass UCLASS_ETH_PHY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-22 22:05:28 +03:00
Peter Hoyes
b8da46fda6 net: Use phys_addr_t for SMC net device addresses
Use same type as eth_device->iobase and support addresses greater
than INT_MAX.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2021-07-22 21:55:05 +03:00
Tom Rini
a15fa1ba67 dtoc improvements to show better warnings
minor test build fixes
 sandbox fixes for SDL2 and running TPL
 bloblist resize feature
 binman multithreading
 -----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmD41JkRHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIrea8+wgArpcRqyC2nCYtdDl1q/8mWQabct2rUJVt
 rzIYzgyPgkRBLQjlE8xgEchzAPOuw0YzQnEz3T80wepBPIy53+QYXaqumd9iuhtm
 B1x4r/GumqS4qgn9Pfqxabw2eP8DNbxClc14ExDx3zR1pUwp0DRvnYQV/w+W2RQp
 nWFKDdhdnkxuXApiVc01RF/9I+IygstVl1TUklxlw9EGkdpirczIX5cP2lhW9rsV
 Cm4fPz4V6AphiUQ4RpllossBNVHHlbVyKOtdGWe4CrERH8Zv8tIVRVeHCr0GydPr
 ORhIZTk7hmwTav3Zi4XAQ434UZcRVrJFRkZvv8TpmMhMTVb8+gyZaQ==
 =F/gP
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-21jul21' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

dtoc improvements to show better warnings
minor test build fixes
sandbox fixes for SDL2 and running TPL
bloblist resize feature
binman multithreading
2021-07-22 11:15:52 -04:00
Tom Rini
806734f41b Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
fsl-qoriq: Update mc firmware size, address in LS1088A, LS2088A, LX2
Updates on ls1043aqds, ls1043ardb
Refactor I2C MUX Code on fsl-qoriq platforms.
2021-07-22 08:45:32 -04:00
Tom Rini
f31f5367f4 Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv 2021-07-21 22:46:18 -04:00
Chen Guanqiao
1b098b3e65 dm: core: fix no null pointer detection in ofnode_get_addr_size_index()
Fixed a defect of a null pointer being discovered by Coverity Scan:
   CID 331544:  Null pointer dereferences  (REVERSE_INULL)
   Null-checking "size" suggests that it may be null, but it has already been
   dereferenced on all paths leading to the check.

Signed-off-by: Chen Guanqiao <chenguanqiao@kuaishou.com>
2021-07-21 10:27:35 -06:00
Heinrich Schuchardt
fd25ca3275 sandbox: don't set SA_NODEFER in signal handler
The sandbox can handle signals. Due to a damaged global data pointer
additional exceptions in the signal handler may occur leading to an endless
loop. In this case leave the handling of the secondary exception to the
operating system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
03ebc20de3 binman: Add basic support for debugging performance
One of binman's attributes is that it is extremely fast, at least for a
Python program. Add some simple timing around operations that might take
a while, such as reading an image and compressing it. This should help
to maintain the performance as new features are added.

This is for debugging purposes only.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
c31d0cb68c patman: Use bytearray instead of string
If the process outputs a lot of data on stdout this can be quite slow,
since the bytestring is regenerated each time. Use a bytearray instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
43332d881b binman: Use bytearray instead of string
This is faster if data is being concatenated. Update the section and
collection etypes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
edd4b6ea41 binman: Split node-reading out from constructor in files
The constructor should not read the node information. Move it to the
ReadNode() method instead. This allows this etype to be subclassed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
c69d19c8f8 binman: Support multithreading for building images
Some images may take a while to build, e.g. if they are large and use slow
compression. Support compiling sections in parallel to speed things up.

Signed-off-by: Simon Glass <sjg@chromium.org>
(fixed to use a separate test file to fix flakiness)
2021-07-21 10:27:35 -06:00
Simon Glass
650ead1a4a binman: Put compressed data into separate files
At present compression uses the same temporary file for all invocations.
With multithreading this causes the data to become corrupted. Use a
different filename each time.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
72fa1ad8d9 log: Allow padding of the function name
At present when function names are logged, the output is a little hard to
read since every function is a different length. Add a way to pad the
names so that the log messages line up vertically. This doesn't work if
the function name is very long, but it makes a big difference in most
cases.

Use 20 characters as a default since this covers the vast majority of
functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
96f37b092f blk: Support iteration
It is useful to be able to iterate over block devices. Typically there
are fixed and removable devices. For security reasons it is sometimes
useful to ignore removable devices since they are under user control.

Add iterators which support selecting the block-device type.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
6b165ab2b7 sandbox: mmc: Support fixed MMC devices
Add support for reading devicetree flags for MMC devices. With this we
can distinguish between fixed and removable drives. Note that this
information is only available when the device is probed, not when it is
bound, since it is read in the of_to_plat() method. This could be changed
if needed later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-21 10:27:35 -06:00
Simon Glass
7d84fbb573 spl: Provide more information on boot failure
If SPL fails to boot, try to provide an error code to indicate what is
wrong. For example, if a uclass is missing, this can return -EPFNOSUPPORT
(-96) which provides useful information.

Add a helper for accessing the image-loader name so we can drop the use
of #ifdefs in this code.

Put this feature behind a CONFIG_SHOW_ERRORS option to avoid increasing
the code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:35 -06:00
Simon Glass
1ac9c4cef5 image: Allow @ in node names when not using signatures
If signature verification is not in use we don't need to worry about
the risk of using @ in node names. Update fit_image_verify() to allow
it if the function is not enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
1f618d528e bloblist: Correct condition in bloblist_addrec()
It is possible to add a blob that ends at the end of the bloblist, but at
present this is not supported. Fix it and add a regression test for this
case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
faff554292 bloblist: Tidy up a few API comments
Some comments for struct bloblist_hdr are a bit ambiguous. Update them to
clarify the meaning more precisely. Also document bloblist_get_stats()
properly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
1fe5937549 bloblist: Support resizing a blob
Sometimes a blob needs to expand, e.g. because it needs to hold more log
data. Add support for this. Note that the bloblist must have sufficient
spare space for this to work.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
56dae9ef3c cros_ec: Use standard calls for recovery-request checking
Rather than calling directly into the sandbox SDL code, we can use the
normal U-Boot console handling for this feature. Update the code, to make
it more generic.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
656d744770 cros_ec: Support the full-size vboot context
The v2 format is 64-bytes in size. Support this and drop v1 since it is
not used anymore.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
1e465eb669 cros_ec: Drop cros_ec_entering_mode()
This function is not needed anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
201efb2bb0 cros_ec: Allow reading the battery-charge state
Add a function to read this information from the EC. It is useful for
determining whether the battery has enough charge to boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
ecc1ed912e sandbox: Adjust the bloblist default address
Move this down to provide more space for the bloblist.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
350b1d3b68 sandbox: Use hinting with the display
SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
fcb7e31082 sandbox: Add work-around for SDL2 display
At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.

Also include more error checking just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
f178bebf55 sandbox: Support executables for more phases
The SPL header has a function for obtaining the phase in capital letters,
e.g. 'SPL'. Add one for lower-case also, as used by sandbox.

Use this to generalise the sandbox logic for determining the filename of
the next sandbox executable. This can provide support for VPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
719d286475 test: Avoid a build error with SPL
At present this fails to build chromeos_sandbox due to a rebase error
in dm_test_pre_run(). Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
bf8188e4aa test: Add DM_DMA to be disabled
At present if DM_DMA is disabled on a sandbox build, the build fails.
Make the test conditional.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
f093f8649c test: Allow CONFIG_SPL_LOAD_FIT to be disabled
At present if this is not enabled on a sandbox build, the build fails. Add
a condition to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
504fb66997 dm: Support lzma in the flashmap
Allow lzma compression as well as lz4.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
4bbaa88fad dm: core: Add logging for DM_SEQ_ALIAS
It is sometimes helpful to see which sequence is assigned to a device.
Add debugging info for that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
e3dab846bd dtoc: Update documentation to cover warnings in more detail
When things go wrong it can be confusing to figure out what to change.
Add a few more details to the documentation.

Fix a 'make htmldocs' warning while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-07-21 10:27:34 -06:00
Simon Glass
43ba492670 dtoc: Detect drivers which do not parse correctly
At present if a driver is missing a uclass or compatible stirng, this
is silently ignored. This makes sense in most cases, particularly for
the compatible string, since it is not required except when the driver
is used with of-platdata.

But it is also not very helpful. When there is some sort of problem
with a driver, the missing compatible string (for example) may be the
cause.

Add a warning in this case, showing it only for drivers which are used
by the build.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-07-21 10:27:34 -06:00
Simon Glass
86ff01e890 dtoc: Detect unexpected suffix on .of_match
Some rockchip drivers use a suffix on the of_match line which is not
strictly valid. At present this causes the parsing to fail. Fix this
and offer a warning.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
4f1727a7e3 dtoc: Add a stdout check in test_normalized_name()
This test captures output but does not always check it. Add the missing
code and drop the old comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21 10:27:34 -06:00
Simon Glass
893142aa3b dtoc: Correct the re_compat regular expression
This expects a . before the field name (.e.g '.compatible = ...) but
presently accepts anything at all. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-07-21 10:27:34 -06:00
Simon Glass
1b5fe11d95 dtoc: Allow multiple warnings for a driver
At present we show when a driver is missing but this is not always that
useful. There are various reasons why a driver may appear to be missing,
such as a parse error in the source code or a missing field in the driver
declaration.

Update the implementation to record all warnings for each driver, showing
only those which relate to drivers that are actually used. This avoids
spamming the user with warnings related to a driver for a different board.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-07-21 10:27:34 -06:00
Simon Glass
973fa52416 dtoc: Convert to use ArgumentParser
Use this parser instead of OptionParser, which is deprecated.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-07-21 10:27:33 -06:00
Simon Glass
c7967653da dtoc: Avoid using subscripts on match objects
These are not supported before Python 3.6 so avoid them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-07-21 10:27:33 -06:00
Vincent Chen
219cb17311 board: sifive: unmatched: reset USB hub, PCIe-USB bridge, and ULPI device in SPL
Ensure USB hub, PCIe-USB bridge, and ULPI device to be reset
even if the rebooting is without power-cycling.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-07-21 22:25:15 +08:00
Vincent Chen
d3c96b9b46 board: sifive: unmatched: refine GEMGXL initialized function in SPL
Create a new function spl_reset_device_by_gpio to reset the device
whose reset pin is connected to the GPIO. Then, using this function
to initialize GEMGXL.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-07-21 22:25:15 +08:00
Zong Li
e52b83ab13 board: sifive: drop stuff related to unmatched revision 1
This patch reverts the following commits:
 - 4b4159d0f3 ("riscv: dts: add dts for unmatched rev1")
 - ffe9a394df ("board: sifive: support spl multi-dtb on unmatched board")

We won't plan to support unmatched that the revision below 3 in u-boot,
so they can be dropped because they might be useless.

Changed in v2:
 - rebase codebase to the latest master branch

Signed-off-by: Zong Li <zong.li@sifive.com>
Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-07-21 16:39:57 +08:00
Vitaly Wool
6ba8eeb6f1 riscv: booti: do not force relocation if force_reloc is not set
If force_reloc flag is not set and booti is called for an address
ouside RAM (i. e. QSPI NOR flash), we should honor that and not try
to force relocation in a bogus fashion.

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-07-21 16:38:26 +08:00
Zong Li
66a21be674 board: sifive: remove the command for setting serial number
We wouldn't like to allow user to change the serial number, so remove
the command for changing serial number in EEPROM.

Signed-off-by: Zong Li <zong.li@sifive.com>
Suggested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-07-21 16:38:25 +08:00
Tom Rini
c9204859bb Merge branch 'master' of git://source.denx.de/u-boot-sh
- R-Car3 updates
2021-07-20 19:31:40 -04:00