Commit Graph

57724 Commits

Author SHA1 Message Date
Thierry Reding
836a56e729 ARM: tegra: Workaround UDC boot issues only if necessary
Resetting the USB device controller on boot is only necessary if the SoC
actually has a UDC controller and U-Boot enables support for it. All the
Tegra boards support UDC via the ChipIdea UDC driver, so make the UDC on
boot workaround depend on the ChipIdea UDC driver.

This prevents a crash on Tegra186 which does not have the ChipIdea UDC.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:34 -07:00
Thierry Reding
f9ec2ec850 ARM: tegra: Support TZ-only access to PMC
Some devices may restrict access to the PMC to TrustZone software only.
Non-TZ software can detect this and use SMC calls to the firmware that
runs in the TrustZone to perform accesses to PMC registers.

Note that this also fixes reset_cpu() and the enterrcm command on
Tegra186 where they were previously trying to access the PMC at a wrong
physical address.

Based on work by Kalyani Chidambaram <kalyanic@nvidia.com> and Tom
Warren <twarren@nvidia.com>.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:34 -07:00
Thierry Reding
147fac6aef ARM: tegra: Allow boards to override boot target devices
Boards may not support all the boot target devices in the default list
for Tegra devices. Allow a board to override the list and default to the
standard list only if the board hasn't specified one itself.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:34 -07:00
Thierry Reding
8f60d18f94 ARM: tegra: Fix save_boot_params() prototype
The save_boot_params() function takes as its first four arguments the
first four registers. On 32-bit ARM these are r0, r1, r2 and r3, all of
which are 32 bits wide. However, on 64-bit ARM thene registers are x0,
x1, x2 and x3, all of which are 64 bits wide. In order to allow reusing
the save_boot_params() implementation on 64-bit ARM, change it to take
unsigned long parameters rather than the fixed size 32-bit integers.
This ensures that the correct values are passed.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
e19143b5eb ARM: tegra: Guard powergate code with a Kconfig symbol
Powergate code is not relevant on all Tegra SoC generations, so guard it
with a Kconfig symbol that can be selected by the generations that need
it.

This is in preparation for unifying Tegra186 code with the code used on
older generations.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
07ea02bc2d ARM: tegra: Guard pin controller code with a Kconfig symbol
Pin controller code is not relevant on all Tegra SoC generations, so
guard it with a Kconfig symbol that can be selected by the generations
that need it.

This is in preparation for unifying Tegra186 code with the code used on
older generations.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
1a869c703d ARM: tegra: Guard memory controller code with a Kconfig symbol
Memory controller code is not relevant on all Tegra SoC generations, so
guard it with a Kconfig symbol that can be selected by the generations
that need it.

This is in preparation for unifying Tegra186 code with the code used on
older generations.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
9e57819294 ARM: tegra: Guard GP pad control code with a Kconfig symbol
The GP pad control code is not relevant on all Tegra SoC generations, so
guard it with a Kconfig symbol that can be selected by the generations
that need it.

This is in preparation for unifying Tegra186 code with the code used on
older generations.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
b64e0b9231 ARM: tegra: Guard clock code with a Kconfig symbol
Clock code is not relevant on all Tegra SoC generations, so guard it
with a Kconfig symbol that can be selected by the generations that need
it.

This is in preparation for unifying Tegra186 code with the code used on
older generations.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
e9c58f2bb8 ARM: tegra: Use common header for PMU declarations
There's no need to replicate the pmu.h header file for every Tegra SoC
generation. Use a single header that is shared across generations.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
bf468e5e1a ARM: tegra: Remove disp1 clock initialization on Tegra210
pll_c is not a valid parent for the disp1 clock, so trying to set it
will fail. Given that display is not used in U-Boot, remove the init
table entry so that disp1 will keep its default parent (clk_m).

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:33 -07:00
Thierry Reding
bca7910b7d ARM: tegra: Fix mux type for disp1 and disp2 clocks on Tegra210
On Tegra210 the parents for the disp1 and disp2 clocks are slightly
different from earlier chips. Only pll_p, pll_d_out0, pll_d2_out0 and
clk_m are valid parents (technically pll_d_out is as well, but U-Boot
doesn't know anything about it). Fix up the type name and the mux
definition.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:32 -07:00
Thierry Reding
0c4e2658e8 lib: Implement strndup()
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:32 -07:00
Thierry Reding
ebf30e8451 fdtdec: Add fdtdec_set_ethernet_mac_address()
This function can be used to set the local MAC address for the default
Ethernet interface in its device tree node. The default interface is
identified by the "ethernet" alias.

One case where this is useful is for devices that store their MAC
address in a custom location. Once extracted, board code can store the
MAC address in U-Boot's control DTB so that it will automatically be
used by the Ethernet uclass.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2019-06-05 09:16:32 -07:00
Heiko Schocher
ea41b15617 cmd/led: check subcommand "list" instead "l"
current implementation for checking if "led list"
command is called checks only if "l" is passed to the
led command. This prevents switching leds with name
which starts also with a "l". So check for passing
"list".

While at it, also fix a typo in led command usage.

Signed-off-by: Heiko Schocher <hs@denx.de>
2019-06-05 12:14:02 -04:00
Jean-Jacques Hiblot
c5646270d1 board: am335x/mux: configure the pins for 8-bit data transfer on MMC1
This is required for proper operation of the 8-bit data transfers.
This fixes transient errors seen on BeagleBone Black.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2019-06-05 12:14:02 -04:00
Holger Brunck
072d1528fa board/km: update maintainer e-mail
Signed-off-by: Holger Brunck <holger.brunck@ch.abb.com>
2019-06-05 12:14:02 -04:00
Bartosz Golaszewski
1f12208c6a arm: davinci: remove leftover assembly
There are no more users of lowlevel_init.S. Remove the file.

Suggested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-06-05 12:14:02 -04:00
David Lechner
18517ab8a1 configs/legoev3: define CONFIG_SKIP_LOWLEVEL_INIT
This adds a define for CONFIG_SKIP_LOWLEVEL_INIT in the legoev3 config.
On the EV3, U-Boot is loaded into RAM by another bootloader, so we
don't need the lowlevel init in U-Boot.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-06-05 12:14:02 -04:00
Adam Ford
4fde31e482 ARM: da850evm: Fix reading MAC from SPI
The MAC address is located at at the last 64K of SPI Flash, and
it's 6 bytes long.  This patch corrects both the length and
starting byte of the MAC address.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-06-05 12:14:02 -04:00
Adam Ford
33ac2b560b arm: omap3: Manually initialize GPIO if OF_CONTROL doesn't
The commong initialization code manually initializes the GPIO
even when OF_CONTROL does it, so we can reduce the code size a
bit by not doing it manually when we have device tree support.

Using the omap3_logic board (dm3730), the sizes shrunk:

Before:

   text	   data	    bss	    dec	    hex	filename
 561066	  28596	 116880	 706542	  ac7ee	u-boot
  55245	   1605	   1888	  58738	   e572	spl/u-boot-spl

After
  text	   data	    bss	    dec	    hex	filename
 560898	  28548	 116872	 706318	  ac70e	u-boot
  55121	   1557	   1888	  58566	   e4c6	spl/u-boot-spl

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-06-05 12:14:02 -04:00
Adam Ford
e3b7ff2476 ARM: DTS: imx6q-logicpd: Resync with Linux 5.1
Resync imx6q-logicpd with Kernel 5.1.5

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-06-05 12:14:02 -04:00
Adam Ford
b4d070fb5a ARM: davinci: Remove ipam390 linker script from Kconfig
With ipam390 support removed in we can remove the reference to the
linker script since that case will never be true.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-06-05 12:14:02 -04:00
Sekhar Nori
2a766db938 ARM: davinci: SPL: fix BSS initialization
U-Boot README recommends initializing SDRAM in board_init_f(). DA850
was doing it as part of board_init_r() (through call to spl_board_init()
which calls arch_cpu_init() which calls da850_ddr_setup())

This worked fine till commit 15b8c75058 ("davinci:
da850evm/omapl138-lcdk: Move BSS to SDRAM because SRAM is full") moved
BSS to SDRAM.

Functions like mmc_initialize() called in board_init_r() assume BSS is
available. Since SDRAM was not initialized when arch/arm/lib/crt0.S tried
to initialize BSS to 0, BSS is not initialized correctly.

Fix this by simply calling arch_cpu_init() from board_init_f(). Also move
preloader_console_init() there to help debug issues with board_init_r().

With this spl_board_init() is no longer needed, we remove it.

Tested using MMC/SD boot on OMAP-L138 LCDK board.

Tested-by: Adam Ford <aford173@gmail.com> #da850evm
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Tested-by: Peter Howard <phoward@gme.net.au> #omapl138_lcdk
2019-06-05 12:14:02 -04:00
Sekhar Nori
4fddaf2b7d ARM: davinci: omal138_lcdk: fix MMC boot breakage due to driver model conversion
commit 21af33ed03 ("ARM: davinci: omapl138_lcdk: Enable DM_MMC")
wanted to enable DM_MMC only for U-Boot and not for SPL.

But CONFIG_DM_MMC is defined for SPL build too. Because of this
MMC device was not getting registered for SPL causing MMC/SD
boot breakage.

Instead use CONFIG_IS_ENABLED(DM_MMC) which will remain false until
CONFIG_SPL_DM_MMC is defined.

Tested-by: Adam Ford <aford173@gmail.com> #da850evm
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Tested-by: Peter Howard <phoward@gme.net.au> #omapl138_lcdk
2019-06-05 12:13:46 -04:00
Hannes Schmelzer
7a56c930e2 board/BuR/common: fix detection for PSC/STM resetcontroller
Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-06-05 12:13:46 -04:00
Tom Rini
6d93d245c1 Merge git://git.denx.de/u-boot-riscv
- Support Microchip MPFS Icicle board.
- Enable e1000 and nvme support for qemu.
- Enable PCI host ECAM generic driver for qemu.
- Increase the environment size to 128kB for qemu.
2019-06-05 10:07:31 -04:00
Maxime Jourdan
f944b15966 video: meson: hdmi-supply regulator should be optional
Some boards don't have such a regulator, and don't need one to enable
HDMI display. Make it optional, fixing hdmi display for those boards.

Also surround the regulator code with a config check on DM_REGULATOR.

Reported-by: Mohammad Rasim <mohammad.rasim96@gmail.com>
Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Mohammad Rasim <mohammad.rasim96@gmail.com>
2019-06-05 10:51:46 +02:00
Padmarao Begari
39494822e3 riscv: Add Microchip MPFS Icicle board support
This patch adds Microchip MPFS Icicle board support.
For now, NS16550 serial driver is only enabled.
The Microchip MPFS Icicle defconfig by default builds
U-Boot for M-Mode with SMP support.

Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2019-06-05 13:19:24 +08:00
Bin Meng
e64db0d92e riscv: qemu: Enable e1000 and nvme support
Since we have added the PCI support to the 'virt' target, enable
e1000 and NVME as alternate network and storage devices for these
virtio based devices.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Tested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2019-06-05 13:19:15 +08:00
Bin Meng
cd6b6199ea riscv: qemu: Enable PCI host ECAM generic driver
QEMU 4.0.0 'virt' target integrates a generic ECAM PCI host.
Enable the driver for it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Tested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2019-06-05 13:19:15 +08:00
Karsten Merker
eacf07e631 riscv: increase the environment size for the qemu-riscv platform to 128kB
The existing default size of 4kB is too small as the default environment
has already nearly that size and defining a single additional environment
variable can exceed the available space.

Signed-off-by: Karsten Merker <merker@debian.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-06-05 13:19:08 +08:00
AKASHI Takahiro
4b27a76132 cmd: env: add -nv option for UEFI non-volatile variable
With this option, -nv, at "setenv -e" command, a variable will be defined
as non-volatile.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 23:56:14 +02:00
AKASHI Takahiro
f658c2e190 cmd: efidebug: make some boot variables non-volatile
Boot####, BootOrder and BootNext should be non-volatile.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 23:56:14 +02:00
AKASHI Takahiro
366161cf97 efi_loader: bootmgr: make BootNext non-volatile
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 23:56:14 +02:00
AKASHI Takahiro
cee2cbc731 efi_loader: variable: support non-volatile attribute
The attribute, EFI_VARIABLE_NON_VOLATILE, should be encoded as "nv" flag
in U-Boot variable if specified.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 23:56:14 +02:00
Igor Opaniuk
ffe8a92b4b colibri_imx7_emmc: enable DM_VIDEO
Enable DM_VIDEO for Colibri iMX7 eMMC version.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:29:50 +02:00
Igor Opaniuk
a589107d4f ARM: dts: colibri_imx7: Add lcdif node
Extend lcdif DT node with proper display-timings for mxsfb driver.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:29:26 +02:00
Igor Opaniuk
8c1df09f07 video: mxsfb: add DM_VIDEO support
Extend the driver to build with DM_VIDEO enabled. DTS files
must additionally include 'u-boot,dm-pre-reloc' property in
soc and child nodes to enable driver binding to mxsfb device.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:25:54 +02:00
Igor Opaniuk
9a67205228 video: mxsfb: refactor video_hw_init()
Refactor video_hw_init() function, and introduce an independent function
for the common procedure of initialization.

Currently video_hw_init() is only in charge of parsing configuration from
env("videomode") and filling struct GraphicPanel, and new
mxs_probe_common() does hw specific initialization (invocation of
mxs_lcd_init() etc.)

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:22:59 +02:00
Igor Opaniuk
23816322d5 video: mxsfb: reorder includes
Follow alphabetical order of includes, which simplifies detecting duplicate
includes etc.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:22:19 +02:00
Igor Opaniuk
dcd91a61bf video: mxsfb: change mxs_lcd_init signature
Provide directly framebuffer address instead of pointer to
GraphicDevice struct, which will let to re-use this function in
DM_VIDEO configurations.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:21:57 +02:00
Igor Opaniuk
42e6e8f348 colibri imx6/t20: enable CONFIG_SYS_WHITE_ON_BLACK
Enable CONFIG_SYS_WHITE_ON_BLACK by default for DM_VIDEO enabled
configurations, where env("splashimage") is used for showing Toradex
boot logo.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:21:28 +02:00
Igor Opaniuk
5eb83c0ac1 splash: display splash in DM_VIDEO configurations
Currently for CONFIG_DM_VIDEO=y setting splashimage env variable doesn't
have any effect. Introduce a common function for both dm-video/lcd stacks,
that checks env("splashimage") and invokes bmp_display() accordingly.
For additional details please check discussion [1].

[1] https://lists.denx.de/pipermail/u-boot/2019-May/371002.html

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-06-04 23:20:43 +02:00
Heinrich Schuchardt
e80474ad39 efi_loader: notify memory map changes
When the memory map is changed signal events of the
EFI_EVENT_GROUP_MEMORY_MAP_CHANGE event group.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 22:09:38 +02:00
AKASHI Takahiro
8190b4a3e0 cmd: env: print a message when setting UEFI variable failed
Error message will alert a user that setting/deleting a variable failed.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 22:09:26 +02:00
AKASHI Takahiro
94e6e55053 efi_loader: bootmgr: print a message when loading from BootNext failed
If a user defines BootNext but not BootOrder and loading from BootNext
fails, you will see only a message like this:
	BootOrder not defined

This may confuse a user. Adding an error message will be helpful.

An example output looks like this:

=> efidebug boot add 0001 label1 scsi 0:1 "\path1\file1.efi" "--option foo"
=> efidebug boot add 0002 label2 scsi 0:1 "\path2\file2.efi" "--option bar"
=> efidebug boot add 0003 label3 scsi 0:1 "\path3\file3.efi" "--option no"
=> efidebug boot order 0001 0002
=> efidebug boot next 0003
=> bootefi bootmgr
Loading from Boot0003 'label3' failed
Loading from BootNext failed, falling back to BootOrder
Loading from Boot0001 'label1' failed
Loading from Boot0002 'label2' failed
EFI boot manager: Cannot load any image

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Adjust messages.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 22:09:26 +02:00
Heinrich Schuchardt
120ff7ba68 efi_loader: close protocols in UnloadImage()
When UnloadImage() is called all protocols opened by the image have to be
closed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 22:09:26 +02:00
Heinrich Schuchardt
25e6fb5e93 efi_loader: fix EnableCursor()
The EnableCursor() service of the simple text output protocol must update
the the CursorVisible field of the output mode.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 22:09:26 +02:00
Heinrich Schuchardt
22f23db428 efi_loader: check timer events in Stall()
During a call to Stall() we should periodically check for timer events.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-06-04 22:09:26 +02:00