Commit Graph

67333 Commits

Author SHA1 Message Date
Baruch Siach
f2d58f3bda cmd: bootz: fix device-tree overlap test
The address of the kernel image is stored in images->ep. zi_start is the
offset of execution entry in the image, which is usually 0 for ARM
zImage.

Fixes boot error when ftd is stored near RAM address 0x0:

ERROR: FDT image overlaps OS image (OS=0x0..0x5fd608)

Fixes: fbde7589ce ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-08-05 08:18:34 -04:00
Fabio Estevam
aaa91a4e4b fit_image: Use calloc() to fix reproducibility issue
Vagrant Cascadian reported that mx6cuboxi target no longer builds
reproducibility on Debian.

One example of builds mismatches:

00096680: 696e 6700 736f 756e 642d 6461 6900 6465  ing.sound-dai.de
-00096690: 7465 6374 2d67 7069 6f73 0000            tect-gpios..
+00096690: 7465 6374 2d67 7069 6f73 0061            tect-gpios.a

This problem happens because all the buffers in fit_image.c are
allocated via malloc(), which does not zero out the allocated buffer.

Using calloc() fixes this unpredictable behaviour as it guarantees
that the allocated buffer are zero initialized.

Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
2020-08-05 08:18:34 -04:00
Brian Moyer
dfd2390dff arm: Add SPL build check to SPL early bss clear
SPL_CLEAR_BSS is called regardless of build type if
CONFIG_SPL_EARLY_BSS is defined. Add a guard for CONFIG_SPL_BUILD
to fix.

Signed-off-by: Brian Moyer <bdm310@gmail.com>
2020-08-04 23:30:02 -04:00
Heinrich Schuchardt
7f89e85631 doc: move Clang documentation to HTML
* Move README.clang to doc/build/clang.rst and reformat as
  reStructeredText.
* Indicate that -ffixed-r9 and -ffixed-x18 are used to reserve registers
  for gd.
* Minor editing.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-04 23:30:02 -04:00
Michal Simek
171fd224ae pinctrl: aspeed: Fix Kconfig entry indentation
Fix Kconfig entry indentation for Aspeed ast2500 pin control driver.

Fixes: 4f0e44e466 ("aspeed: AST2500 Pinctrl Driver")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-04 23:30:02 -04:00
Michal Simek
36766d39e8 Makefile.lib: Build all DTS with -@ if OF_LIBFDT_OVERLAY is enabled
The commit 47818e23a2 ("Makefile.lib: include /__symbols__ in dtb if
SPL_LOAD_FIT_APPLY_OVERLAY is enabled") enables DT building as overlays
based on symbols which depends on SPL. But there is already an option to
apply overlays in full U-Boot too.
And there are platforms which are not using SPL and there is no option to
build DTs with -@ parameter.
That's why change dependency on OF_LIBFDT_OVERLAY which is already symbol
which is selected when SPL_LOAD_FIT_APPLY_OVERLAY is enabled but also
adding support for platforms which don't enable SPL and want to work with
overlays on U-Boot prompt.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-04 23:30:02 -04:00
Michal Simek
a965f4dfb5 dt-bindings: Sync include/dt-bindings/phy/phy.h from Linux
Add 4 new phy types which are present in Linux kernel.
DP and SGMII types are used on Xilinx ZynqMP devices.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-04 23:30:02 -04:00
Stephen Warren
2d8e102cd2 fixdep: fix coding style in previous fix
Remove a double space introduced by my previous fixdep fix.

Fixes: 76ae74d348 ("fixdep: fix CONFIG_IS_ENABLED etc. handling")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2020-08-04 23:30:02 -04:00
Yan Liu
c9db1a103c test/py: Add test support for three stage boot
Current pytest only support upto 2 stage boot;
Some boards like TI K3 am6/J7 boards use 3 stage
boot. This patch adds u_boot_spl2 to be able to
handle the 3-stage boot case. User needs to set
"env__spl2_skipped" in u_boot_boardenv config
file to use this support. By default it is set
to TRUE.

Signed-off-by: Yan Liu <yan-liu@ti.com>
Signed-off-by: Yan Liu <yan-liu@ti.com>
2020-08-04 23:30:02 -04:00
Jonas Smedegaard
44758771ee arm: move CONFIG_PREBOOT="usb start" to KConfig
This commit moves CONFIG_PREBOOT="usb start" to common/KConfig
for all boards also declaring USB_KEYBOARD.

Besides simplifying defconfig files, this also enables support for
board-specific CONFIG_PREBOOT for sunxi boards:
commit 37304aaf60 ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to
Kconfig") intended to support CONFIG_PREBOOT, but
include/configs/sunxi-common.h hardcodes preboot as part of internally
defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific
CONFIG_PREBOOT.

Signed-off-by: Jonas Smedegaard <dr@jones.dk>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Series-Cc: Jagan Teki <jagan@amarulasolutions.com>
Series-Cc: Lukasz Majewski <lukma@denx.de>
Series-Cc: Andre Przywara <andre.przywara@arm.com>
2020-08-04 23:30:02 -04:00
Marek Szyprowski
def7a5c00f net: ping: reset stored IP address
Reset the stored ping IP address before entering a netloop with different
protocol to ensure that it won't be interrupted by the received
correct ICMP_ECHO_REPLY packet.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2020-08-04 23:30:02 -04:00
Patrick Delaunay
a08f2f7b94 net: dwc_eth_qos: add Kconfig option to select supported configuration
Add configuration flag to select the supported dwc driver configuration:
- CONFIG_DWC_ETH_QOS_TEGRA186
- CONFIG_DWC_ETH_QOS_IMX
- CONFIG_DWC_ETH_QOS_STM32

See Linux driver ethernet/stmicro/stmmac and associated glue layers
for other configuration examples.

This patch removes the not-selected compatibles and lets the linker remove
the unused functions to reduce the size of the driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-08-04 23:30:02 -04:00
Tero Kristo
9996cea75f lmb/bdinfo: dump lmb info via bdinfo
Dump lmb status from the bdinfo command. This is useful for seeing the
reserved memory regions from the u-boot cmdline.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-08-04 23:30:02 -04:00
Ramon Fried
cc6b87ecaa net: tftp: Add client support for RFC 7440
Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2020-08-04 23:30:02 -04:00
Yann Gautier
5cc7df7eba psci: put psci_method in .data section if EFI_LOADER is not enabled
Move the variable psci_method in .data section when EFI is not
activated and the psci driver safely access it before relocation.

Without this patch the variable is located in .bss section
and the psci probe requested before relocation corrupts the device
tree (probe is requested by board_f.c::print_resetinfo()).

When EFI_LOADER is activated, this variable in already located in the
.data.efi_runtime section by __efi_runtime_data.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-08-04 23:30:02 -04:00
Doyle, Patrick
06fc4573b9 Fix corner case in bad block table handling.
In the unlikely event that both blocks 10 and 11 are marked as bad (on a
32 bit machine), then the process of marking block 10 as bad stomps on
cached entry for block 11.  There are (of course) other examples.

Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
2020-08-04 23:30:02 -04:00
John Chau
4a4830cf91 cmd: add clone command
This patch adds a feature for block device cloning similar to dd
command, this should be useful for boot-strapping a device where
usb gadget or networking is not available. For instance one can
clone a factory image into a blank emmc from an external sd card.

Signed-off-by: John Chau <john@harmon.hk>
2020-08-04 23:29:59 -04:00
Jason Wessel
5b3ddb17ba fs/fat/fat.c: Do not perform zero block reads if there are no blocks left
While using u-boot with qemu's virtio driver I stumbled across a
problem reading files less than sector size.  On the real hardware the
block reader seems ok with reading zero blocks, and while we could fix
the virtio host side of qemu to deal with a zero block read instead of
crashing, the u-boot fat driver should not be doing zero block reads
in the first place.  If you ask hardware to read zero blocks you are
just going to get zero data.  There may also be other hardware that
responds similarly to the virtio interface so this is worth fixing.

Without the patch I get the following and have to restart qemu because
it dies.
---------------------------------
=> fatls virtio 0:1
       30   cmdline.txt
=> fatload virtio 0:1 ${loadaddr} cmdline.txt
qemu-system-aarch64: virtio: zero sized buffers are not allowed
---------------------------------

With the patch I get the expected results.
---------------------------------
=> fatls virtio 0:1
       30   cmdline.txt
=> fatload virtio 0:1 ${loadaddr} cmdline.txt
30 bytes read in 11 ms (2 KiB/s)
=> md.b ${loadaddr} 0x1E
40080000: 64 77 63 5f 6f 74 67 2e 6c 70 6d 5f 65 6e 61 62    dwc_otg.lpm_enab
40080010: 6c 65 3d 30 20 72 6f 6f 74 77 61 69 74 0a          le=0 rootwait.

---------------------------------

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2020-08-04 17:53:58 -04:00
Tom Rini
f1c0b7cd4b For 2020.10
-----------
 
 - fixes for Toradex board
 - fix warnings from previous PR
 - HAB: reset instead of panic after failure
 - new board:  MYiR Tech MYS-6ULX
 - mx6cuboxi: use OF_PLATDATA
 - further changes for DM
 
 Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/714513163
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQS2TmnA27QKhpKSZe309WXkmmjvpgUCXykjtQ8cc2JhYmljQGRl
 bnguZGUACgkQ9PVl5Jpo76a1WQCcD+objdS+90mDdT0yTpW3jHS4YiwAn2V2rTTo
 4hKj5yxRg3cvb/pBAmbQ
 =TyRs
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-imx-20200804' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

For 2020.10
-----------

- fixes for Toradex board
- fix warnings from previous PR
- HAB: reset instead of panic after failure
- new board:  MYiR Tech MYS-6ULX
- mx6cuboxi: use OF_PLATDATA
- further changes for DM

Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/714513163
2020-08-04 11:11:02 -04:00
Tom Rini
993b59f045 - fix tbs2910 vidconsole environment
- fix ipuv3 framebuffer output on i.MX6Q/D
 -----BEGIN PGP SIGNATURE-----
 
 iGwEABECACwWIQSC4hxrSoIUVfFO0kRM6ATMmsalXAUCXyiEbA4cYWd1c3RAZGVu
 eC5kZQAKCRBM6ATMmsalXIf5AJ9LhO51aC7B5iuE930e6vaCEyd8kQCfbI9Tbk/I
 obk2ZAvG9NXNRtfuw80=
 =GGt4
 -----END PGP SIGNATURE-----

Merge tag 'fixes-for-2020.10-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

- Fix tbs2910 vidconsole environment
- Fix ipuv3 framebuffer output on i.MX6Q/D
2020-08-04 11:07:55 -04:00
Tom Rini
4d23857abd Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
- add DM based reset driver for SiFive SoC's.
2020-08-04 11:07:38 -04:00
Tom Rini
bb3694d5b1 - doc: fix qemu-mips build instructions
- MIPS: add GPIO, CLK and SPI drivers for Octeon MIPS64
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiQkHUH+J02LLC9InKPlOlyTyXBgFAl8oYscACgkQKPlOlyTy
 XBhMSxAAtCdGKSU1cBLvLhoHi9zHfJ9fXKwrSTikSWJ5SotinY8ICdR95PDDChnv
 BL5FH1TYMi6cwLxoT7XuOzSjUvYFx+y7drT5Cj78Udzfw3J0OF2mVhJTLkV0adnK
 beT6srAgM/Sli19ewXquWqzE/s9fSwjjNfZH43ySxDb3S35llYcBaoOIZ+o1EUO5
 So8Vvi31W5H6MpxioTGGH9CJLHU7Xa6hCeLg/h6P1AUAyyQICFMraFfG6nt90k5k
 2z0Lc7D5I5JQi074nAChSo/D91p75Z5pLYx+h3MFWjwafr5QddqjZ/hL+gixubWg
 yW0QX4TA92X1p/wXioYleTldLbbhz23OvjYJyfvmEsNIvTuAj/opi+Im5Lg0T0TT
 QJPNenxKwnURfYwI2woSk6xFBZqMgZ5eo1FacTUebRCkkW/YTKpcOn7K2pNzQfJn
 c/rKo9/rJVyb+1X/EglUEJ07ARUWRTq8dgOYbGe25qqTjYlwES4xd4AQrqQaYpkF
 OGzMGezzw5HejtqMa1x01VsPQZgcKTTS3gmnLYkfs8j7WD0+f5V2Ba9gnrblSXeR
 Vwfc8yWU0fIYW7I4kX9hsugqEqUOlXeUJ1yylNdeenBn6Hvs4Ros5GgNco1n8lhi
 lcEy/DzAcVw5cAZafeR0ZIMj2r3hTs4jW+TUFKEuuNW9W+KV2ZI=
 =Kv/C
 -----END PGP SIGNATURE-----

Merge tag 'mips-pull-2020-08-03' of https://gitlab.denx.de/u-boot/custodians/u-boot-mips

- doc: fix qemu-mips build instructions
- MIPS: add GPIO, CLK and SPI drivers for Octeon MIPS64
2020-08-04 11:07:16 -04:00
Tom Rini
d6faedca76 Merge branch '2020-08-01-misc-cleanups'
- Further cleanup of common.h and dm.h usage in headers
2020-08-03 22:20:22 -04:00
Simon Glass
23552ba142 checkpatch: Don't allow common.h and dm.h in headers
These headers should not be included in other header files. Add a
checkpatch rule and test for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
4620d46bf0 patman: Fix up the test comments
Many of the tests have the same comment and two have the same name. Fix
this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
a0558aca55 dm: core: Guard against including dm.h in header files
Header files generally should not include header files just for a struct,
since forward declarations work just as well and reduce overhead.

Add a warning for dm.h being included, since this has crept into U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
41ba040e16 net: Drop duplicate include of dm.h in pcnet.c
This file includes the header twice. Drop the second one.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
f125e3cc12 net: Drop dm.h header file in eth_phy.h
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
fb989e0c6c clk: Drop dm.h header file in clk-provider.h
This header file should not be included in other header files. Remove it
and use a forward declaration and un-inlining of dev_get_clk_ptr()
instead.

Fix up the kendryte header files to avoid build errors.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2020-08-03 22:19:54 -04:00
Simon Glass
161786259c usb: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Also move the inline function out into a C file. We should not include C
code in headers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
98eb4ce592 ufs: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Also drop asm/io.h

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
4a953b1f7e nand: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
c273da0765 adc: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Drop the common.h inclusion also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
dcd7c906d0 mscc: Drop dm.h header file
This header file should not be included in other header files. Remove it
from each one and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
153f269ebe mediatek: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
51a4a857b3 pci: Drop dm.h inclusion from header file
The layerscape header should not include dm.h so remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
dece7747e9 liebherr: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
0eddd24e89 ti: am654: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
8b69e629dc spi: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
4426632dc8 mmc: Drop duplicate dm.h inclusion
We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
ad2f4ac39b power: Tidy up inclusion of regulator_common.h
This file should not include common.h and dm.h so remove them. Also move
the inclusion of this file to after the normal includes.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2020-08-03 22:19:54 -04:00
Simon Glass
e1e10f29f9 efi: Tidy up header includes
Two files relies on efi_driver.h to include common.h and dm.h which is
incorrect. The former should always be included in a non-host C file and
the latter should be included if driver model is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
411e9eb88c w1: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
055efe5690 thermal: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
a00867b47a sf: Drop dm.h header file from spi_flash.h
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
2a64ada78c net: Drop dm.h header file from phy.h
This header file should not be included in other header files. Remove it
and use other headers and C inclusions instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
c2848cc2c3 fs: fs-loader: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
0e1fad4382 dm: core: Drop header files from dm/test.h
These header file should not be included in other header files. Remove
them and add to each individual file. Add test/test.h to test/ui.h since
that is a reasonable place.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
82a7697b5a dm: core: Drop dm.h header file from dm-demo.h
This header file should not be included in other header files. Remove it
and add it to the cmd file instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Simon Glass
54234592df mtd: spi: Drop SPI_XFER_MMAP*
These two defines are no-longer supported. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00