Commit Graph

55938 Commits

Author SHA1 Message Date
Heinrich Schuchardt
f1465c1597 efi_loader: simplify protocol installation
By using InstallMultipleProtocolInterfaces() the coding for installing
protocol interfaces on the root node can be simplified.

Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
7657ae12f3 efi_loader: export efi_install_multiple_protocol_interfaces
Export function efi_install_multiple_protocol_interfaces() so that we can
call it in others parts of the UEFI subsystem.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
207c5bcce1 efi_selftest: physical and virtual addresses must match
At boottime physical and virtual addresses must match. Add a corresponding
check to the memory unit test.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
9631fa0fd1 efi_loader: update virtual address in efi_mem_carve_out
Handle virtual address in efi_mem_carve_out() function
when a new region is created to avoid issue in EFI memory map.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

At boottime physical and virtual addressed have to be the same.
This allowed to simplify the proposed logic.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Patrick Delaunay
74f5baa28b efi_loader: add protection for block_dev
Check the value of block_dev before to use this pointer.

This patch solves problem for the command "load" when ubifs
is previously mounted: in this case the function
blk_get_device_part_str("ubi 0") don't return error but return
block_dev = NULL and then data abort.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
07805f203b efi_loader: fix setting PlatformLang
The UEFI variables PlatformLang and PlatformLangCodes specify the current
firmware language and the list of all available languages.

Currently their values are hard coded. With the patch a new configuration
variable EFI_PLATFORM_LANG_CODES is provided.

When initializing the UEFI subsystem this configuration variable is used to
initialize PlatformLangCodes. The value of variable PlatformLang is read.
If it is not set, the first language specified in EFI_PLATFORM_LANG_CODES
is used to initialize PlatformLang.

Suggested-by: Takahiro Akashi <takahiro.akashi@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
dc6f3f48c5 efi_loader: the development target should be the EBBR
Two subsets of the UEFI specifications have been defined. The one for
servers is "Server Base Boot Requirements System Software on ARM
Platforms" (SBBR), the one for embedded systems is the "Embedded Base Boot
Requirements (EBBR) Specification". Reaching compliance with thei EBBR is a
more realistic development target than reaching complicance with the SBBR.

Suggested-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Patrick Wildt
60fd8844af efi: fix memory calculation overflow on 32-bit systems
There are Cubox-i machines out there with nearly 4 GiB of RAM.  The
RAM starts at 0x10000000 with a size of 0xf0000000.  Thus the end
of RAM is at 0x100000000.  This overflows a 32-bit integer, which
should be fine since in the EFI memory code the variables used are
all 64-bit with a fixed size.  Unfortunately EFI_PAGE_MASK, which is
used in the EFI memory code to remove the lower bits, is based on
the EFI_PAGE_SIZE macro which, uses 1UL with a shift.  This means
the resulting mask is UL, which is only 32-bit on ARMv7.  Use ULL to
make sure that even on 32-bit platforms we use a 64-bit long mask.
Without this there will be no memory available in the EFI memory map
and bootefi will fail allocating pages.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
bba8165690 arm: print information about loaded UEFI images
If an exception occurs in a UEFI loaded image we need the start address of
the image to determine the relocation offset.

This patch adds the necessary lines after the registers in the crash dump
for armv8. A possible output would be:

UEFI image [0x00000000bffe6000:0x00000000bffe631f] pc=0x138 '/\snp.efi'

With the offset 0x138 we can now find the relevant instruction in the
disassembled 'snp.efi' binary.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
e7ac009b00 efi_loader: move efi_save_gd() call to board_r.c
The first functions of the UEFI sub-system are invoked before reaching the
U-Boot shell, e.g. efi_set_bootdev(), efi_dp_from_name(),
efi_dp_from_file(). We should be able to print out device paths for
debugging purposes here.

When printing device paths via printf("%pD\n", dp) this invokes functions
defined as EFIAPI. So efi_save_gd() must be called beforehand.

So let's move the efi_save_gd() call to function initr_reloc_global_data(()
in board_r.c.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:42 +02:00
Heinrich Schuchardt
2337741fb4 efi_loader: remove stray #define LOG_CATEGORY LOGL_ERR
The statement '#define LOG_CATEGORY LOGL_ERR' makes not sense. LOGL_ERR is
not a LOG_CATEGORY. Remove the statement.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:41 +02:00
Heinrich Schuchardt
084f093301 efi_loader: enable HII protocols by default
As the UEFI shell requires the HII protocols let's enable them by default.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:41 +02:00
Heinrich Schuchardt
8ec7d5d355 efi_loader: assign HII protocols to root node
We should not install the HII protocols on every loaded image. It is
sufficient to install them once on the root node.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12 22:00:41 +02:00
Tom Rini
40a9546c7b Merge branch '2019-04-11-ti-master-imports'
- Improve Keystone 3 SoC support (DMA, TI SCI)
- Improve Keystone 2 SoC support (PHY fixes on various platforms)
- Improve am335x families (new platforms, more boot mode options in SPL
  via DM).
- General DaVinci, OMAP5 fixes.
2019-04-12 12:22:43 -04:00
Faiz Abbas
d2c05f50e1 mmc: omap_hsmmc: Set 3.3V for IO voltage
Pbias voltage should match the IO voltage set for the SD card. With the
latest pbias change to 3.3V, update the capabilities and IO voltages
settings to 3.3V.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:57 -04:00
Faiz Abbas
fddfd9c7b0 ARM: dts: dra71-evm: Correct evm_sd regulator max voltage
Correct vpo_sd_1v8_3v3 regulator max voltage to 3.3V

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Keerthy <j-keerthy@ti.com>
2019-04-12 08:05:56 -04:00
Faiz Abbas
2499a04617 ARM: dts: dra7: Change pbias voltage to 3.3V
As per recent TRM[1], PBIAS cell on dra7 devices supports
3.3v and not 3.0v as documented earlier.

Update PBIAS regulator max voltage and the voltage written
in the driver to reflect this.

[1] http://www.ti.com/lit/pdf/sprui30

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:56 -04:00
Adam Ford
86034a959a ARM: am3517_evm: Add spl_start_uboot for Falcon Mode
When booting the am3517-evm, the following message appears:
SPL: Please implement spl_start_uboot() for your board
SPL: Direct Linux boot not active!

This patch implements spl_start_uboot to clear this message
and allow device to know if it should boot U-Boot or kernel.

Fixes: 1c6b6f383a ("ARM: am3517_evm: Enable Falcon Mode")

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-04-12 08:05:56 -04:00
Tom Rini
9c4b0131d1 ti: keystone2: Move CONFIG_ISW_ENTRY_ADDR to a common place
The ISW_ENTRY_ADDR Kconfig option under mach-omap2 isn't a SoC specific
notion but rather "where is our previous stage loaded in memory?"
option.  Make use of this on ARCH_KEYSTONE rather than SPL_TEXT_BASE for
our HS builds that are not using SPL anyhow.

Cc: Vitaly Andrianov <vitalya@ti.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com?
2019-04-12 08:05:55 -04:00
Faiz Abbas
55f8b70fee board: ti: am335x: Remove non DM_ETH code
With DM_ETH enabled in am335x devices, remove all the unused
non-DM code.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:55 -04:00
Faiz Abbas
7b96a732b4 configs: am335x_evm: Update VCI String
Update VCI string to keep it compatible with legacy test setups.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-04-12 08:05:55 -04:00
Faiz Abbas
4237a6734d configs: am335x_evm: Add Support for SPL_ETH
Add Support for booting from Ethernet.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:55 -04:00
Faiz Abbas
920e334111 configs: am335x_evm: Reduce size of SPL
Make some room in SPL by getting rid of unnecessary configs.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:54 -04:00
Faiz Abbas
0229c9330d board: ti: am335x: Add platdata for cpsw in SPL
The SPL image overflows when cpsw dt nodes are added and SPL_OF_CONTROL
is enabled. Use static platdata instead to save space.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:54 -04:00
Faiz Abbas
8a616cc292 net: ti: cpsw: Enable DM_FLAG_PRE_RELOC
Add DM_FLAG_PRE_RELOC to make the driver probe in SPL.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:54 -04:00
Faiz Abbas
c3b460a516 net: ti: cpsw: Block off ofdata_to_platdata with OF_CONTROL
The ofdata_to_platdata function should not be called if OF_CONTROL is
not enabled because fdtdec_* calls will fail. Block the function with
OF_CONTROL

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:53 -04:00
Faiz Abbas
a58d222df9 net: ti: cpsw-common: Isolate getting syscon address from assigning macid
ti_cm_get_macid() is used to get a syscon node from the dt, read the
efuse address and then assign the macid read from the address. Divide
these two steps into separate functions one of which can be called from
ofdata_to_platdata() while the other can be called from _probe(). This
ensures that platdata can be assigned statically in a board file when
OF_CONTROL is not enabled. Also add a macid_sel_compat in private data
to get information about the macid byte placement.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:53 -04:00
Faiz Abbas
f32a816c26 net: ti: cpsw: Convert cpsw_platform_data to a pointer in cpsw_priv
Convert cpsw_platform_data to a pointer in cpsw_priv. Allocate it
dynamically and assign it as a part of eth_pdata. This helps in
isolating platform data handling and implementing platdata for SPL
in a board file.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:53 -04:00
Faiz Abbas
e50f878c98 net: ti: cpsw: Move cpsw_phy_sel() to _probe()
cpsw_phy_sel() is a configuration step that should not be in
ofdata_to_platdata(). Add phy_sel_compat to the cpsw_platform_data
structure so that it is accessible in _probe. Then move the call of
cpsw_phy_sel() to _probe.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:52 -04:00
Faiz Abbas
3c6add986f net: Add priv_pdata to eth_pdata
Add a priv member for eth_pdata for platform specific platform data.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:52 -04:00
Andreas Dannenberg
3e9b9c1ccd armv7R: K3: am654: Trigger panic on DDR init failures
When initializing DDR from R5 SPL trigger U-Boot's panic facility
rather than simply returning from the board init function as there
is little point continuing code execution. Further, as panic implies
a board reset, so using it might potentially allow to recover from
this error in certain cases such as when the init failure was caused
by a temporary glitch of some sorts.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-04-12 08:05:52 -04:00
Lokesh Vutla
d7ee66af02 configs: am65x_evm_a53: Enable CONFIG_OF_BOARD_SETUP
Enable CONFIG_OF_BOARD_SETUP so that msmc sram dt nodes
are updated correctly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-04-12 08:05:52 -04:00
Lokesh Vutla
5582c03565 board: ti: am65x: Enable fixing up msmc sram node
Create a ft_board_setup() api that gets called as part of
DT fixup before jumping to kernel. In this ft_board_setup()
call fdt_fixup_msmc_ram that update msmc sram node.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-04-12 08:05:51 -04:00
Lokesh Vutla
a9a84480f4 arm: k3: Add support for updating msmc dt node
Certain parts of msmc sram can be used by DMSC or can be
marked as L3 cache. Since the available size can vary, changing
DT every time the size varies might be painful. So, query this
information using TISCI cmd and fixup the DT for kernel.
Fixing up DT does the following:
- Create a sram node if not available
- update the reg property with available size
- update ranges property
- loop through available sub nodes and delete it if:
	- mentioned size is out if available range
	- subnode represents l3 cache or dmsc usage.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-04-12 08:05:51 -04:00
Lokesh Vutla
6ce424a920 arm: k3: Add a wrapper to get tisci handle
Create a wrapper to get the ti sci handle.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-04-12 08:05:51 -04:00
Lokesh Vutla
826eb74015 firmware: Add support for querying msmc memory
DMSC can use certain amount of msmc memory available in the
system. Also certain part of msmc memory can be marked as L3
cache using board config. But users might not know what size
is being used and the remaining available msmc memory. In order
to fix this TISCI protocol provides a messages that can query
the available msmc memory in the system. Add support for this
message.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-04-12 08:05:50 -04:00
Faiz Abbas
097fd51b7a configs: ti_omap5_common: Add NAND environment settings
Now that NAND is supported on DRA71x include various NAND environment
settings

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-04-12 08:05:50 -04:00
Faiz Abbas
8a8f59a0ce configs: dra71x-evm: Add Support for NAND
Add NAND support to dra71x-evm defconfig

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:50 -04:00
Franklin S Cooper Jr
b3b2a9ea3e arm: dra7: Allow NAND to be enabled on DRA71x EVM.
If SW 8 pins 0 and 1 indicate that NAND should be enabled then
the pins pinmux must be reconfigured for NAND mode.

Therefore, enable NAND by reconfiguring the pinmux.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:49 -04:00
Franklin S Cooper Jr
f072aff944 board: ti: dra71: Add pinmux settings for NAND on DRA71x EVM
By default VOUT3 occupies the pins required for NAND. Therefore, create
a seperate entry that can be use to reconfigure these pins to work for
NAND.

On the EVM SWITCH 8 pins 0 and 1 will be used to determine if NAND is
enabled or not. For NAND to be selected pin 0 should be on and pin 1
should be off. Any other combination will assume NAND shouldn't be
enabled.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2019-04-12 08:05:49 -04:00
Adam Ford
f7c1d53605 ARM: davinci: da850evm: Enable SPL_OF_CONTROL without PLATDATA
With the memory mapping giving us some more avialable RAM, this
updates the da850-evm-u-boot.dtsi to include the serial port, SPI
and Flash nodes along with some dependent nodes in the SPL dtb.
This also removes the platform data initialization code for the
serial port and SPI Flash.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-04-12 08:05:49 -04:00
Adam Ford
15b8c75058 davinci: da850evm/omapl138-lcdk: Move BSS to SDRAM because SRAM is full
In order to fully support SPL_OF_CONTROL, we need BSS to be a bit
larger. This patch relocates BSS to SDRAM instead of SRAM which
is similar to how ARMv7 boards (like OMAP2+) do it.

This means two new variables are required:
CONFIG_SPL_BSS_START_ADDR  set to DAVINCI_DDR_EMIF_DATA_BASE
CONFIG_SPL_BSS_MAX_SIZE is set to 0x1080000 which is 1 byte
before the location where U-Boot will load.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-04-12 08:05:49 -04:00
Sjoerd Simons
4512380420 am335x, guardian: Add support for the bosch guardian board
Add support for the Bosch Guardian board.

CPU  : AM335X-GP rev 2.1
Model: Bosch AM335x Guardian
I2C:   ready
DRAM:  256 MiB
NAND:  512 MiB
MMC:   OMAP SD/MMC: 0

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Felix Brack <fb@ltec.ch>
2019-04-12 08:05:48 -04:00
Martyn Welch
f2fae512f2 env: Don't check CONFIG_ENV_OFFSET_REDUND for SPL build
When booting using an SPL on am335x, if we want to support booting with
the boot ROM loader via USB (which uses RNDIS, making bootp and tftp
calls) we need to enable gadget eth in the SPL to load the main U-Boot
image. To enable CONFIG_SPL_ETH_SUPPORT, we must enable
CONFIG_SPL_ENV_SUPPORT as the environment is used by the eth support, but
we don't actually need to have environment variables saved in the SPL
environment. We do however have environment variables saved in the main
U-Boot image and enable CONFIG_ENV_OFFSET_REDUND (we are storing in raw
NAND). In such instances, even with the build config enabling both
CONFIG_CMD_SAVEENV and CONFIG_CMD_NAND, these options aren't set when
building the SPL, but CONFIG_ENV_OFFSET_REDUND still is.

Don't check this configuration option for SPL builds to enable the above
configuration.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-04-12 08:05:48 -04:00
Sjoerd Simons
f50939647c Add support for the MT41K128M16JT125K memory modules
Add configuration for the MT41K128M16JT125K memory modules as used on the
Bosch Guardian device.

Based on a patch by:
    Govindaraji Sivanantham <Govindaraji.Sivanantham@in.bosch.com>

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
[checkpatch.pl cleanup by Martyn Welch]
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
2019-04-12 08:05:48 -04:00
Vignesh R
ddb65acf04 am57xx_evm_defconfig: Enable configs to support QSPI boot
AM57xx IDK EVMs can boot out of QSPI. Enable configs to support QSPI
boot. Also enable configs for updating QSPI boot images over DFU.

Tested on AM572x IDK EVM.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-04-12 08:05:47 -04:00
Murali Karicheri
32d858fc4f ARM: dts: k2g-ice: add dt node for netcp
This patch adds dt node for DP83867 phy used on K2G ICE board and
also enable netcp device nodes for the board.

EVM hardware spec recommends to add 0.25 nsec delay in the tx
direction and 2.25 nsec delay in the rx direction for internal
delay in the clock path to be on the safer side.

The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode
1. Unfortunately, the phy data manual disallows this. Add
ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to
enable workaround suggested for this incorrect strap setting. This
ensures proper operation of this PHY.

The dts bindings are kept in sync with that from 4.14.y linux
kernel. This required the pinmux device related bindings to be
commented out to allow for compilation.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-04-12 08:05:47 -04:00
Murali Karicheri
d8f492379b k2g: config enable ti phy dp83867 for k2g
Enable ti phy dp83867 for k2g

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-04-12 08:05:47 -04:00
Murali Karicheri
b186f4b1a2 ARM: dts: k2g-evm: remove unused phy-mode property from phy node
This patch removes the unused phy-mode property from the phy dt node. On
K2G, currently link-interface determines if phy is used or not and is
already set to use rgmii. So this is not needed. Besides phy-mode should
be added to slave interface configuration of the cpsw driver, not in the
phy node.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-04-12 08:05:46 -04:00
Murali Karicheri
f748ec9d32 ARM: k2g: add a workaround to reset the phy
This patch adds a workaround to reset the phy one time during boot
using GPIO0 pin 10 to make sure, the Phy latches the configuration
from the input pins correctly.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-04-12 08:05:46 -04:00