platform/kernel/u-boot.git
2 years agofsl_lpuart: add i.MX9 support
Peng Fan [Tue, 26 Jul 2022 08:40:40 +0000 (16:40 +0800)]
fsl_lpuart: add i.MX9 support

i.MX9 shares same register layout as i.MX7ULP, so
add the i.MX9 define here.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: add basic i.MX9 support
Peng Fan [Tue, 26 Jul 2022 08:40:39 +0000 (16:40 +0800)]
imx: add basic i.MX9 support

Add i.MX9 Kconfig and basic files for the new SoC

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: add USB2_BOOT type
Peng Fan [Tue, 26 Jul 2022 08:40:38 +0000 (16:40 +0800)]
imx: add USB2_BOOT type

Add USB2_BOOT type for i.MX8ULP and i.MX9

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: move get_boot_device to common file
Peng Fan [Tue, 26 Jul 2022 08:40:37 +0000 (16:40 +0800)]
imx: move get_boot_device to common file

i.MX8MN/P/ULP supports ROM API, they have almost same get_boot_device
implementation, so move to a common file. And when support i.MX9,
no need to include the other function copy.

Since sys_proto.h is included in imx_romapi.c, there will be build
warning for i.MX8M because wdog_regs not defined, so include imx-regs.h
in i.MX8M sys_proro.h

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: move get_boot_device to common header
Peng Fan [Tue, 26 Jul 2022 08:40:36 +0000 (16:40 +0800)]
imx: move get_boot_device to common header

Most i.MX implements get_boot_device, move it to common header to
simplify code

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: simplify dependency with SPL_BOOTROM_SUPPORT
Peng Fan [Tue, 26 Jul 2022 08:40:35 +0000 (16:40 +0800)]
imx: simplify dependency with SPL_BOOTROM_SUPPORT

For SoCs support ROM API, CONFIG_SPL_BOOTROM_SUPPORT is needed,
so use this macro to guard the code to avoid extend the list.

And drop the guard with structure definition, there is no need.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: spl: Allow iMX7/8/8M to overwrite spl_board_boot_device
Ye Li [Tue, 26 Jul 2022 08:40:34 +0000 (16:40 +0800)]
imx: spl: Allow iMX7/8/8M to overwrite spl_board_boot_device

Move the default mapping of spl_boot_device to weak function of
spl_board_boot_device. So that every board of iMX7/8/8M can overwrite
this function to implement specific mapping.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx: Change USB boot device type
Ye Li [Tue, 26 Jul 2022 08:40:33 +0000 (16:40 +0800)]
imx: Change USB boot device type

The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting from
USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoarm: makefile: cleanup mach-imx usage
Peng Fan [Tue, 26 Jul 2022 08:40:32 +0000 (16:40 +0800)]
arm: makefile: cleanup mach-imx usage

All the SoCs use mach-imx has CONFIG_MACH_IMX selected, so
the macro could be the gate to build arch/arm/mach-imx to simplify
the rules.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agospl: imx8mm: enlarge SPL_MAX_SIZE
Peng Fan [Tue, 26 Jul 2022 08:40:31 +0000 (16:40 +0800)]
spl: imx8mm: enlarge SPL_MAX_SIZE

The CONFIG_SPL_MAX_SIZE could be 0x27000 for i.MX8MM when SPL_TEXT_BASE
set to 0x7E1000.

The DDR firmware max uses 96KB, there is a 4KB padding header before
SPL_TEXT_BASE, so the SPL MAX SIZE is `256KB - 96KB - 4KB`.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoMAINTAINERS: Update file list for ARM Freescale IMX
Martyn Welch [Thu, 21 Jul 2022 13:47:56 +0000 (14:47 +0100)]
MAINTAINERS: Update file list for ARM Freescale IMX

The MAINTAINERS file currently lists files in
arch/arm/include/asm/arch-imx/ being part of the IMX maintainers
purview, however the arch/arm/include/asm/ directory also contains the
directories arch-imx8, arch-imx8m, arch-imx8ulp and arch-imxrt which
would also appear to be relevant to the team. Tweak the entry to cover
these directories so that tools like get_maintainers.pl will suggest
relevant maintainers when making changes just in these directories.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
2 years agoimx: syscounter: support timer_get_boot_us
Jun Nie [Thu, 21 Jul 2022 10:30:05 +0000 (18:30 +0800)]
imx: syscounter: support timer_get_boot_us

With supporting timer_get_boot_us, we can profile boot up time with below
configs and function bootstage_mark_name().

CONFIG_BOOTSTAGE=y
CONFIG_BOOTSTAGE_REPORT=y
CONFIG_CMD_BOOTSTAGE=y

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agopatman: By default don't pass "--no-tree" to checkpatch for linux
Douglas Anderson [Tue, 19 Jul 2022 21:56:27 +0000 (14:56 -0700)]
patman: By default don't pass "--no-tree" to checkpatch for linux

When you pass "--no-tree" to checkpatch it disables some extra checks
that are important for Linux. Specifically I want checks like:

  warning: DT compatible string "boogie,woogie" appears un-documented
  check ./Documentation/devicetree/bindings/

Let's make the default for Linux to _not_ pass --no-tree. We'll have a
config option and command line flag to override.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: fix mis-word in SPL_DM description
Oleksandr Suvorov [Wed, 13 Jul 2022 16:42:49 +0000 (19:42 +0300)]
dm: fix mis-word in SPL_DM description

Replace logically correct word in the description.

Fixes: 91a91ff804d ("dm: Add Kconfig options for driver model SPL support")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodoc: Make a start on docs for fdt command
Simon Glass [Wed, 13 Jul 2022 12:07:00 +0000 (06:07 -0600)]
doc: Make a start on docs for fdt command

Add some information about the 'fdt addr' subcommand, to get things
started.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agofdt: Start a test for the fdt command
Simon Glass [Wed, 13 Jul 2022 12:06:59 +0000 (06:06 -0600)]
fdt: Start a test for the fdt command

Add a basic test of the 'fdt addr' command, to kick things off.

This includes a new convenience function to run a command from a printf()
string.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoaddrmap: Support on sandbox
Simon Glass [Wed, 13 Jul 2022 12:06:58 +0000 (06:06 -0600)]
addrmap: Support on sandbox

Update this feature so that it works on sandbox, using a basic identity
mapping. This allows us to run the 'ut addrmap' test.

Also fix up the test to use the correct macros to access the linker
list, so that the 'ut addrmap' command actually works.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Increase default fitImage data section resize step from 1k to 64k
Marek Vasut [Tue, 12 Jul 2022 17:41:29 +0000 (19:41 +0200)]
binman: Increase default fitImage data section resize step from 1k to 64k

Currently the fitImage data area is resized in 1 kiB steps. This works
when bundling smaller images below some 1 MiB, but when bundling large
images into the fitImage, this make binman spend extreme amount of time
and CPU just spinning in pylibfdt FdtSw.check_space() until the size
grows enough for the large image to fit into the data area. Increase
the default step to 64 kiB, which is a reasonable compromise -- the
U-Boot blobs are somewhere in the 64kiB...1MiB range, DT blob are just
short of 64 kiB, and so are the other blobs. This reduces binman runtime
with 32 MiB blob from 2.3 minutes to 5 seconds.

The following can be used to trigger the problem if rand.bin is some 32 MiB.
"
/ {
  itb {
    fit {
      images {
        test {
          compression = "none";
          description = "none";
          type = "flat_dt";

          blob {
            filename = "rand.bin";
            type = "blob-ext";
          };
        };
      };
    };
  };

  configurations {
    binman_configuration: config {
      loadables = "test";
    };
  };
};
"

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolog: force DEBUG when LOG_DEBUG is activated
Patrick Delaunay [Tue, 12 Jul 2022 07:39:49 +0000 (09:39 +0200)]
log: force DEBUG when LOG_DEBUG is activated

When CONFIG_LOG is activated, if LOG_DEBUG is defined in a file and
DEBUG is not defined the trace with debug() macro are not displayed,
because the parameter cond : _DEBUG = 0 is checked in debug_cond().

With this patch the define DEBUG, used to force the trace generated by
debug() macro, is linked with the define LOG_DEBUG, used to force the
trace generated by other macros (log_debug, dev_dbg, pr_debug).

We only need to define LOG_DEBUG in a file to activate all the
traces generated by any U-Boot debug macro, as it is described in
/doc/develop/logging.rst

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agodm: fix logic of lists_bind_fdt()
Heinrich Schuchardt [Mon, 11 Jul 2022 06:25:33 +0000 (08:25 +0200)]
dm: fix logic of lists_bind_fdt()

If parameter drv of lists_bind_fdt() is specified, we shall bind only to
this very driver and to no other.

If the driver drv has an of_match property, we shall only bind to the
driver if it matches the compatible string of the device.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoconfigs: sandbox_defconfig: CONFIG_LOG_MAX_LEVEL=9
Heinrich Schuchardt [Mon, 11 Jul 2022 06:21:32 +0000 (08:21 +0200)]
configs: sandbox_defconfig: CONFIG_LOG_MAX_LEVEL=9

Without setting CONFIG_LOG_MAX_LEVEL to a value above 6 we will not detect
NULL dereferences and other errors in log_debug() calls.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: avoid NULL dereference in lists_bind_fdt()
Heinrich Schuchardt [Mon, 11 Jul 2022 06:21:31 +0000 (08:21 +0200)]
dm: avoid NULL dereference in lists_bind_fdt()

If parameter drv of lists_bind_fdt() is specified, we want to bind to this
specific driver even if its field of_match is NULL.

If entry->of_match is NULL, we should not dereference it in a debug
statement.

Fixes: d3e773613b6d ("dm: core: Use U-Boot logging instead of pr_debug()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest: fix log tests
Heinrich Schuchardt [Mon, 11 Jul 2022 06:21:30 +0000 (08:21 +0200)]
test: fix log tests

Consider CONFIG_LOG_MAX_LEVEL and gd->default_log_level in

* do_log_test_helpers()
* log_test_dropped()
* log_test_level_deny()

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: avoid NULL dereference in add_item()
Heinrich Schuchardt [Sun, 10 Jul 2022 13:40:22 +0000 (15:40 +0200)]
dm: avoid NULL dereference in add_item()

acpi_add_other_item() passes dev = NULL. Instead of dev->name write the
string "other" to the debug log:

    ACPI: Writing ACPI tables at 1fd3000
    0base: writing table '<NULL>'
    * other: Added type 3, 0000000011fd4000, size 240
    1facs: writing table 'FACS'
    * other: Added type 3, 0000000011fd4240, size 40
    5csrt: writing table 'CSRT'
    * other: Added type 3, 0000000011fd4280, size 30

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agospi: zynq_qspi: Fix programming qspi speed
Ashok Reddy Soma [Fri, 15 Jul 2022 14:01:19 +0000 (19:31 +0530)]
spi: zynq_qspi: Fix programming qspi speed

When programming qspi flash speed we need to check the requested flash
speed not to exceed the spi max frequency. In the current implementation
we are checking qspi ref clk instead. This commit fixes the issue by
checking the requested speed and programs the specified max frequency.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657893679-20039-5-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agospi: zynq_qspi: Add support for zynq_qspi_mem_exec_op
Ashok Reddy Soma [Fri, 15 Jul 2022 14:01:18 +0000 (19:31 +0530)]
spi: zynq_qspi: Add support for zynq_qspi_mem_exec_op

Add support_ops function zynq_qspi_mem_exec_op to check controller
supported operations by spi-mem framework. Current default support ops
function does not allow dummy buswidth no more than 1, unless we are
using buswidth is 4 for TX.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657893679-20039-4-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agospi: zynq_qspi: Use dummy buswidth in dummy byte calculation
T Karthik Reddy [Fri, 15 Jul 2022 14:01:17 +0000 (19:31 +0530)]
spi: zynq_qspi: Use dummy buswidth in dummy byte calculation

Fix dummy bytes calculation incase of valid dummy bytes when dummy
buswidth is > 1. Current dummy bytes calculation does not provide
correct dummy values for dummy buswidth > 1.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657893679-20039-3-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agospi: zynq_qspi: Add child pre probe function
Siva Durga Prasad Paladugu [Fri, 15 Jul 2022 14:01:16 +0000 (19:31 +0530)]
spi: zynq_qspi: Add child pre probe function

Add child pre probe function in the driver. Update max_hz of priv from
spi_slave structure.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657893679-20039-2-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agospi: xilinx_spi: Add support ops to axi qspi driver
T Karthik Reddy [Sat, 16 Jul 2022 06:58:47 +0000 (12:28 +0530)]
spi: xilinx_spi: Add support ops to axi qspi driver

Add support_ops function to check controller supported operations by
spi-mem framework. Current default support ops function does not allow
dummy buswidth no more than 1, unless we are using buswidth is 4 for TX.
In order to support dummy buswidth > 1 by spi-nor framework we are adding
explicit support_ops to check controller supported operations.

Fix dummy bytes calculation incase of valid dummy bytes when dummy
buswidth is > 1. Current dummy bytes calculation does not provide
correct dummy values for dummy buswidth > 1.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657954727-31972-3-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agospi: xilinx_spi: Add support for spi memory operations
T Karthik Reddy [Sat, 16 Jul 2022 06:58:46 +0000 (12:28 +0530)]
spi: xilinx_spi: Add support for spi memory operations

Add support for spi memory operations for xilinx AXI qspi driver.
This provides an high-level interface to execute SPI memory
operations by the controller.

Remove existing spi transfer based implementation and use
spi memory based exec_op() implementation for qspi IO operations.

Simplified existing startup_block implementation.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1657954727-31972-2-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: zynqmp: support loading encrypted bitfiles
Adrian Fiergolski [Fri, 22 Jul 2022 14:16:14 +0000 (17:16 +0300)]
fpga: zynqmp: support loading encrypted bitfiles

Add supporting new compatible string "u-boot,zynqmp-fpga-enc" to
handle loading encrypted bitfiles.

This feature requires encrypted FSBL, as according to UG1085:
"The CSU automatically locks out the AES key, stored in either BBRAM
 or eFUSEs, as a key source to the AES engine if the FSBL is not
 encrypted. This prevents using the BBRAM or eFUSE as the key source
 to the AES engine during run-time applications."

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-14-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: zynqmp: support loading authenticated images
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:13 +0000 (17:16 +0300)]
fpga: zynqmp: support loading authenticated images

Add supporting new compatible string "u-boot,zynqmp-fpga-ddrauth" to
handle loading authenticated images (DDR).

Based on solution by Jorge Ramirez-Ortiz <jorge@foundries.io>

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Link: https://lore.kernel.org/r/20220722141614.297383-13-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: zynqmp: add bitstream compatible checking
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:12 +0000 (17:16 +0300)]
fpga: zynqmp: add bitstream compatible checking

Check whether the FPGA ZynqMP driver supports the given bitstream
image type.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-12-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: zynqmp: reduce zynqmppl_load() code
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:11 +0000 (17:16 +0300)]
fpga: zynqmp: reduce zynqmppl_load() code

Reduce the function code by calling xilinx_pm_request() once only.
Use the same variable bsize_req to store either bstream size in bytes
or an address of bstream size according to a type required by the
firmware version. Remove obsolete debug().

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-11-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: xilinx: pass compatible flags to load() callback
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:10 +0000 (17:16 +0300)]
fpga: xilinx: pass compatible flags to load() callback

These flags may be used to check whether an FPGA driver is able to
load a particular FPGA bitstream image.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-10-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agospl: fit: pass real compatible flags to fpga_load()
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:09 +0000 (17:16 +0300)]
spl: fit: pass real compatible flags to fpga_load()

Convert taken FPGA image "compatible" string to a binary compatible
flag and pass it to an FPGA driver.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-9-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: add fpga_compatible2flag
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:08 +0000 (17:16 +0300)]
fpga: add fpga_compatible2flag

Add a "compatible" string to binary flag converter, which uses
a callback str2flag() of given FPGA driver if available.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-8-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: pass compatible flags to fpga_load()
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:07 +0000 (17:16 +0300)]
fpga: pass compatible flags to fpga_load()

These flags may be used to check whether an FPGA driver is able to
load a particular FPGA bitstream image.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-7-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: xilinx: pass compatible flags to xilinx_load()
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:06 +0000 (17:16 +0300)]
fpga: xilinx: pass compatible flags to xilinx_load()

This flag is used to check whether a Xilinx FPGA driver is able to
load a particular FPGA bitstream image.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-6-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: zynqmp: add str2flags call
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:05 +0000 (17:16 +0300)]
fpga: zynqmp: add str2flags call

Add a call to convert FPGA "compatible" string to a binary flag.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-5-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: xilinx: add bitstream flags to driver desc
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:04 +0000 (17:16 +0300)]
fpga: xilinx: add bitstream flags to driver desc

Store a set of supported bitstream types in xilinx_desc structure.
It will be used to determine whether an FPGA image is able to be
loaded with a given driver.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-4-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: xilinx: add missed identifier names
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:03 +0000 (17:16 +0300)]
fpga: xilinx: add missed identifier names

Function definition arguments should also have identifier names.
Add missed ones to struct xilinx_fpga_op callbacks, unifying code.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-3-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoconfigs: imx8mm-cl-iot-gate: enable extension command
Ying-Chun Liu (PaulLiu) [Wed, 25 May 2022 09:30:08 +0000 (17:30 +0800)]
configs: imx8mm-cl-iot-gate: enable extension command

For imx8mm-cl-iot-gate we can use extension command to scan
extension boards attached on the mainboard. We enable the
extension command by default for users to detect the extension
boards.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
2 years agoconfigs: imx8mp_venice: remove unnecessary FEC_QUIRK_ENET_MAC
Tim Harvey [Fri, 20 May 2022 15:17:29 +0000 (08:17 -0700)]
configs: imx8mp_venice: remove unnecessary FEC_QUIRK_ENET_MAC

FEC_QUIRK_ENET_MAC is defined in the imx-regs.h include file and thus
does not need to be defined in the various board config includes.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agofpga: add option for loading FPGA secure bitstreams
Oleksandr Suvorov [Fri, 22 Jul 2022 14:16:02 +0000 (17:16 +0300)]
fpga: add option for loading FPGA secure bitstreams

It allows using this feature without enabling the "fpga loads"
command.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Co-developed-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-2-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: Convert SYS_FPGA_PROG_FEEDBACK to Kconfig
Alexander Dahl [Thu, 21 Jul 2022 13:31:22 +0000 (15:31 +0200)]
fpga: Convert SYS_FPGA_PROG_FEEDBACK to Kconfig

This converts the following to Kconfig: SYS_FPGA_PROG_FEEDBACK

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Link: https://lore.kernel.org/r/20220721133122.32428-3-ada@thorsis.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agofpga: Convert SYS_FPGA_CHECK_CTRLC to Kconfig
Alexander Dahl [Thu, 21 Jul 2022 13:31:21 +0000 (15:31 +0200)]
fpga: Convert SYS_FPGA_CHECK_CTRLC to Kconfig

After commit 8cca60a2cbf2 ("Kconfig: Remove some symbols from the
whitelist") downstream builds failed for boards setting this in
include/configs/…

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Link: https://lore.kernel.org/r/20220721133122.32428-2-ada@thorsis.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoarm64: versal: Enable power domain driver and its dependencies
Ashok Reddy Soma [Fri, 22 Jul 2022 08:46:58 +0000 (02:46 -0600)]
arm64: versal: Enable power domain driver and its dependencies

Enable power domain driver to configure pmufw config object and request
node for all the IP's that are enabled in DT.

This driver depends on mailbox and IPI driver, hence enable them as well.
Add ARCH_VERSAL in the depends on of mailbox Kconfig to compile for
Versal platforms.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220722084658.30995-6-ashok.reddy.soma@xilinx.com
2 years agomailbox: zynqmp: Move struct zynqmp_ipi_msg from sys_proto.h
Ashok Reddy Soma [Fri, 22 Jul 2022 08:46:57 +0000 (02:46 -0600)]
mailbox: zynqmp: Move struct zynqmp_ipi_msg from sys_proto.h

Mailbox driver might be need for Versal and other future platforms.
To remove the dependency, move struct zynqmp_ipi_msg to
zynqmp_firmware.h so that mailbox driver compiles for other platforms
easily.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220722084658.30995-5-ashok.reddy.soma@xilinx.com
2 years agoarm64: zynqmp: Enable power domain driver
Ashok Reddy Soma [Fri, 22 Jul 2022 08:46:56 +0000 (02:46 -0600)]
arm64: zynqmp: Enable power domain driver

Enable power domain driver to configure pmufw config object and request
node for all the IP's that are enabled in DT.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220722084658.30995-4-ashok.reddy.soma@xilinx.com
2 years agofirmware: zynqmp: Load config overlay for core0 to pmufw
Ashok Reddy Soma [Fri, 22 Jul 2022 08:46:55 +0000 (02:46 -0600)]
firmware: zynqmp: Load config overlay for core0 to pmufw

Try loading pmufw config overlay for core0, if it doesn't return any
error it means pmufw is accepting nodes for other IP's. Otherwise dont
try to load config object for any other IP, just return from
zynqmp_pmufw_node function.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220722084658.30995-3-ashok.reddy.soma@xilinx.com
2 years agofirmware: zynqmp: Change prototype of zynqmp_pmufw_load_config_object()
Ashok Reddy Soma [Fri, 22 Jul 2022 08:46:54 +0000 (02:46 -0600)]
firmware: zynqmp: Change prototype of zynqmp_pmufw_load_config_object()

zynqmp_pmufw_load_config_object() has some error cases and it is better
to return those errors. Change prototype of this function to return
errors.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220722084658.30995-2-ashok.reddy.soma@xilinx.com
2 years agoarm64: zynqmp: Enable reset driver
Ashok Reddy Soma [Wed, 20 Jul 2022 09:59:59 +0000 (03:59 -0600)]
arm64: zynqmp: Enable reset driver

Enable reset driver for ZynqMP platforms. This will enable us to reset
the IP's using generic reset_assert and reset_deassert calls.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220720095959.29610-4-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoarm64: versal: Enable reset driver for versal
Michal Simek [Wed, 20 Jul 2022 09:59:58 +0000 (03:59 -0600)]
arm64: versal: Enable reset driver for versal

Add CONFIG_DM_RESET and CONFIG_RESET_ZYNQMP configs in versal default
configuration to enable support for reset driver for versal
platform.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: T Karthik Reddy <t.karthik.reddy@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220720095959.29610-3-ashok.reddy.soma@xilinx.com
2 years agoreset: zynqmp: Add reset driver support for versal
T Karthik Reddy [Wed, 20 Jul 2022 09:59:57 +0000 (03:59 -0600)]
reset: zynqmp: Add reset driver support for versal

Add support for versal platform by adding "xlnx,versal-reset"
compatible string in zynqmp-reset driver. Reset numbering schema
for versal is not same as zynqmp, so nr_reset and reset_id are
set to zero. In case of assert/dessert, required device reset id
is sent from respective driver through struct reset_ctl.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220720095959.29610-2-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoxilinx: common: Use strlcpy instead of strncpy
Michal Simek [Thu, 21 Jul 2022 14:19:18 +0000 (16:19 +0200)]
xilinx: common: Use strlcpy instead of strncpy

It is recommendation done by checkpatch to all the time have \0 terminated
strings.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c7bfab50c40f6213f1b347b5e4674e382e83cb94.1658413156.git.michal.simek@amd.com
2 years agoxilinx: Wire uuid reading from FRU
Michal Simek [Thu, 21 Jul 2022 14:19:17 +0000 (16:19 +0200)]
xilinx: Wire uuid reading from FRU

UUID is already recorded when FRU is parsed but it is not copied to local
structures and exported to variable that's why simply add it.
Data is saved in binary format but there must be conversion to string for
exporting it to variable and string should be in uuid format too.

One way how to use it directly is to setup pxeuuid based on it. For
example via preboot with "setenv pxeuuid ${board_uuid}"

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1dfa4b4220a508abc05351da2119880811b77612.1658413156.git.michal.simek@amd.com
2 years agoserial: zynq: Use DIV_ROUND_CLOSEST() to calcurate divider value
Kunihiko Hayashi [Wed, 13 Jul 2022 01:38:59 +0000 (10:38 +0900)]
serial: zynq: Use DIV_ROUND_CLOSEST() to calcurate divider value

Since the calulation of "bgen" is rounded down, using a higher
baudrate will result in a larger difference from the actual
baudrate. Should use DIV_ROUND_CLOSEST() like the Linux driver.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/1657676339-6055-1-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agotools: relocate-rela: Define all macros for e_machine and reloc types
Michal Simek [Fri, 8 Jul 2022 06:15:06 +0000 (08:15 +0200)]
tools: relocate-rela: Define all macros for e_machine and reloc types

With some old toolchain not all values should be available that's why
better to define all of them to avoid compilation issues.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e2a66854c5506100eb82b5b33cec7f0b5fca1008.1657260903.git.michal.simek@amd.com
2 years agotools: relocate-rela: Remove guard around R_AARCH64_RELATIVE
Michal Simek [Fri, 8 Jul 2022 06:15:05 +0000 (08:15 +0200)]
tools: relocate-rela: Remove guard around R_AARCH64_RELATIVE

In code you can find out this fragment:
 19 #ifndef R_AARCH64_RELATIVE
 20 #define R_AARCH64_RELATIVE      1027
 21 #endif

which means that R_AARCH64_RELATIVE is defined all the time that's why
ifdef is not needed.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0d40a09ab6edcd88ba3059f7a0b63a819b71256a.1657260903.git.michal.simek@amd.com
2 years agodt-bindings: versal: Add versal reset IDs
Michal Simek [Thu, 7 Jul 2022 11:10:53 +0000 (13:10 +0200)]
dt-bindings: versal: Add versal reset IDs

The same file is already the part of Linux kernel that's why add it also to
u-boot to be able to use it in source code and DT files.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1c3bc464536a9bf64a2e8bfe18a938c9cb490620.1657192249.git.michal.simek@amd.com
2 years agoxilinx: Remove duplicate PMIO_NODE_ID_BASE macro
Michal Simek [Thu, 7 Jul 2022 11:06:16 +0000 (13:06 +0200)]
xilinx: Remove duplicate PMIO_NODE_ID_BASE macro

PMIO_NODE_ID_BASE is defined twice that's why remove one instance.

Fixes: 248fe9f302df ("spi: cadence_qspi: Enable apb linear mode for apb read & write operations")
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ce9a601bb99418aa20272d046c74678829d942cc.1657191974.git.michal.simek@amd.com
2 years agotest/py: Run simple dm commands without checking
Michal Simek [Thu, 7 Jul 2022 10:59:42 +0000 (12:59 +0200)]
test/py: Run simple dm commands without checking

Just to make sure that dm commands can operate.
This was the problem on Microblaze in past without fixing manual
relocation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/e6c4b8b44445c16cee84436627642ccc9886f507.1657191580.git.michal.simek@amd.com
2 years agopy: tests: Bind should run only on sandbox
Michal Simek [Thu, 7 Jul 2022 10:52:26 +0000 (12:52 +0200)]
py: tests: Bind should run only on sandbox

Disable test to run on any other platform than sandbox.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/786bfdfda7dee4494e39c3fff699970ecd623116.1657191142.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Disable LMB for mini configurations
Michal Simek [Thu, 7 Jul 2022 08:45:38 +0000 (10:45 +0200)]
arm64: zynqmp: Disable LMB for mini configurations

There is no need to have LMB enabled that's why save some space by
disabling it.

   aarch64: (for 8/8 boards) all -1168.5 rodata -105.5 text -1063.0
            xilinx_zynqmp_mini: all -2013 rodata -185 text -1828
            xilinx_zynqmp_mini_qspi: all -2013 rodata -185 text -1828
            xilinx_zynqmp_mini_emmc0: all -2661 rodata -237 text -2424
            xilinx_zynqmp_mini_emmc1: all -2661 rodata -237 text -2424

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f735d7691f4e7a7958d985b22c40aeb26e37a404.1657183534.git.michal.simek@amd.com
2 years agozynqmp: Run board_get_usable_ram_top() only on main U-Boot
Ashok Reddy Soma [Thu, 7 Jul 2022 08:45:37 +0000 (10:45 +0200)]
zynqmp: Run board_get_usable_ram_top() only on main U-Boot

With commit ce39ee28ec31 ("zynqmp: Do not place u-boot to reserved memory
location"), the function board_get_usable_ram_top() is allocating
MMU_SECTION_SIZE of about 2MB using lmb_alloc(). But we dont have this
much memory in case of mini U-Boot.

Keep these functions which use lmb under CONFIG_LMB so that they are
compiled and used only when LMB is enabled.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/75e52def75f573e554a6b177a78504c128cb0c4a.1657183534.git.michal.simek@amd.com
2 years agolmb: Fix lmb property's defination under struct lmb
Ashok Reddy Soma [Thu, 7 Jul 2022 08:45:36 +0000 (10:45 +0200)]
lmb: Fix lmb property's defination under struct lmb

Under struct lmb {} the lmb property's should be defined only if
CONFIG_LMB_MEMORY_REGIONS is defined.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c24a2b1d6f5db4eb65393f6a77fae129b30b6233.1657183534.git.michal.simek@amd.com
2 years agoarm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED
Michal Simek [Thu, 7 Jul 2022 08:47:16 +0000 (10:47 +0200)]
arm: riscv: Remove additional ifdef from code guarded by CONFIG_IS_ENABLED

CONFIG_OF_LIBFDT is used twice for guarding the same code. It is enough to
do it once that's why remove additional ifdefs from arm and risc-v code.

Fixes: 0c303f9a6628 ("image: Drop IMAGE_ENABLE_OF_LIBFDT")
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/r/f8e3ff9124195cbd957874de9a65ef79760ef5e7.1657183634.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Enable SLG gpo driver by default
Michal Simek [Mon, 4 Jul 2022 14:09:00 +0000 (16:09 +0200)]
arm64: zynqmp: Enable SLG gpo driver by default

This device is used on SOM CCs that's why enable it by default.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ebbfc0c883ca7d4f70c75d8d3655aaa6a81d77be.1656943737.git.michal.simek@amd.com
2 years agoxilinx: zynqmp: Do not use 0 as spl bss start address
Stefan Herbrechtsmeier [Thu, 14 Jul 2022 13:47:33 +0000 (15:47 +0200)]
xilinx: zynqmp: Do not use 0 as spl bss start address

Do not use 0 as address for memory because of the special meaning for
pointers (null pointer). Change the spl bss start address to the second
page.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20220714134733.7487-1-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agotools: relocate-rela: Fix ELF decoding on big-endian hosts
Samuel Holland [Fri, 15 Jul 2022 06:40:25 +0000 (01:40 -0500)]
tools: relocate-rela: Fix ELF decoding on big-endian hosts

The new ELF decoding logic assumed that the target binary has the same
endianness as the host, which broke building ARM64 firmware binaries on
big-endian machines.

This commit fixes the ELF64 decoding to be host-endianness-neutral, and
applies the same changes to the ELF32 decoding. It does not fix the
microblaze-specific dynamic symbol decoding.

It also corrects the functions used for byte swapping in rela_elf64()
and rela_elf32(). The result is the same, but semantically the code is
converting bytes read from a foreign-endianness file to host byte order.

Fixes: 4c9e2d643460 ("tools: relocate-rela: Read rela start/end directly from ELF")
Fixes: a1405d9cfedb ("tools: relocate-rela: Check that relocation works only for EM_AARCH64")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220715064026.54551-1-samuel@sholland.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agommc: zynq_sdhci: Fix timing macros for MMC High speed
Ashok Reddy Soma [Mon, 27 Jun 2022 08:52:45 +0000 (14:22 +0530)]
mmc: zynq_sdhci: Fix timing macros for MMC High speed

Timing macro's are wrong for MMC_HS_52 and MMC_DDR_52. Fix it with
correct values of MMC_TIMING_MMC_HS and MMC_TIMING_MMC_DDR52 respectively.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1656319965-12124-1-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoarm64: zynqmp: Used fixed-partitions for QSPI in k26
Michal Simek [Wed, 29 Jun 2022 09:13:14 +0000 (11:13 +0200)]
arm64: zynqmp: Used fixed-partitions for QSPI in k26

Using fixed partitions is recommended way how to describe QSPI. Also add
label for qspi flash memory to be able to reference it in future.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a84f7ce8d6472fce66539ba29d31fbaae511d94b.1655732762.git.michal.simek@amd.com
2 years agoxilinx: Remove the legacy property "#stream-id-cells"
Ayan Kumar Halder [Wed, 22 Jun 2022 08:26:57 +0000 (10:26 +0200)]
xilinx: Remove the legacy property "#stream-id-cells"

"#stream-id-cells" was being used with "mmu-masters" for Xen specific
device trees.
With Xen commit 2278d2cbb0b7c1b48b298c6c4c6a7de2271ac928 (Link below)
Xen is able to support smmu bindings in both formats ie :
1. Using iommus (linux format)
2. Using mmu-masters (legacy format).

Thus, "#stream-id-cells" which was used for the legacy format, can be
removed as Xen can use smmu bindings in linux format.

Link: https://www.mail-archive.com/xen-devel@lists.xenproject.org/msg101649.html
Signed-off-by: Ayan Kumar Halder <ayankuma@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1e062acb233dee47cd7dd2429cb482132617cbc8.1655886415.git.michal.simek@amd.com
2 years agoPrepare v2022.10-rc1
Tom Rini [Tue, 26 Jul 2022 00:31:12 +0000 (20:31 -0400)]
Prepare v2022.10-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 25 Jul 2022 21:19:18 +0000 (17:19 -0400)]
configs: Resync with savedefconfig

Resync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-07-25-assorted-platform-updates'
Tom Rini [Mon, 25 Jul 2022 20:40:43 +0000 (16:40 -0400)]
Merge branch '2022-07-25-assorted-platform-updates'

- Assorted TI, Apple, Snapdragon and Xen updates.

2 years agodrivers: xen: unmap Enlighten page before jumping to Linux
Dmytro Firsov [Tue, 19 Jul 2022 14:55:28 +0000 (14:55 +0000)]
drivers: xen: unmap Enlighten page before jumping to Linux

This commit fixes issue with usage of Xen hypervisor shared info page.
Previously U-boot did not unmap it at the end of OS boot process. Xen
did not prevent guest from this. So, it worked, but caused wierd
issues - one memory page, that was returned by memalign in U-boot
for Enlighten mapping was not unmaped by Xen (shared_info values was
not removed from there) and returned to allocator. During the Linux
boot, it uses shared_info page as regular RAM page, which leads to
hypervisor shared info corruption.

So, to fix this issue, as discussed on the xen-devel mailing list, the
code should:
   1) Unmap the page
   2) Populate the area with memory using XENMEM_populate_physmap

This patch adds page unmapping via XENMEM_remove_from_physmap, fills
hole in address space where page was mapped via XENMEM_populate_physmap
and return this address to memory allocator for freeing.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
Reviewed-by: Anastasiia Lukianenko <vicooodin@gmail.com>
2 years agoarm: Remove unused references to CONFIG_SOC_DM*
Tom Rini [Mon, 18 Jul 2022 15:33:39 +0000 (11:33 -0400)]
arm: Remove unused references to CONFIG_SOC_DM*

There are no references to CONFIG_SOC_DM355 / CONFIG_SOC_DM365 /
CONFIG_SOC_DM644X / CONFIG_SOC_DM646X and the files these Makefile lines
reference have already been dropped.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agospl: Use SPL_TEXT_BASE instead of ISW_ENTRY_ADDR
Andrew Davis [Fri, 15 Jul 2022 17:31:48 +0000 (12:31 -0500)]
spl: Use SPL_TEXT_BASE instead of ISW_ENTRY_ADDR

The ISW_ENTRY_ADDR symbol was used for OMAP devices in place of
SPL_TEXT_BASE. Keystone2 HS devices were not using it right either.
Remove ISW_ENTRY_ADDR and use SPL_TEXT_BASE directly.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: k3: config.mk: Read software revision information from file on HS
Andrew Davis [Fri, 15 Jul 2022 16:38:54 +0000 (11:38 -0500)]
arm: k3: config.mk: Read software revision information from file on HS

Read the swrv.txt file from the TI Security Development Tools when
TI_SECURE_DEVICE is enabled. This allows us to set our software
revision in one place and have it used by all the tools that create
TI x509 boot certificates.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agok3_gen_x509_cert: Make SWRV configurable for anti-rollback protection
Yogesh Siraswar [Fri, 15 Jul 2022 16:38:53 +0000 (11:38 -0500)]
k3_gen_x509_cert: Make SWRV configurable for anti-rollback protection

The x509 certificate SWRV is currently hard-coded to 0. This need to be
updated to 1 for j721e 1.1, j7200 and am64x. It is don't care for other
k3 devices.

Added new config K3_X509_SWRV to k3. Default is set to 1.

Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
Reviewed-by: Dave Gerlach <d-gerlach@ti.com>
2 years agoarm: mach-k3: Remove ROM firewalls on GP devices
Andrew Davis [Fri, 15 Jul 2022 16:21:27 +0000 (11:21 -0500)]
arm: mach-k3: Remove ROM firewalls on GP devices

This isn't strictly needed as these firewalls should all be disabled on
GP, but it also doesn't hurt, so do this unconditionally to remove this
use of CONFIG_TI_SECURE_DEVICE.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agodefconfigs: j721e_hs_evm: Sync HS and non-HS defconfigs
Andrew Davis [Fri, 15 Jul 2022 16:19:41 +0000 (11:19 -0500)]
defconfigs: j721e_hs_evm: Sync HS and non-HS defconfigs

Additions have been made to the non-HS defconfig without the same
being made to the HS defconfig, sync them.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agodefconfigs: am57xx_hs_evm: Sync HS and non-HS defconfigs
Andrew Davis [Fri, 15 Jul 2022 16:19:39 +0000 (11:19 -0500)]
defconfigs: am57xx_hs_evm: Sync HS and non-HS defconfigs

Sync new additions to non-HS defconfig with HS defconfig.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agodefconfigs: Add a config for AM43xx HS EVM with QSPI Boot support
Andrew Davis [Fri, 15 Jul 2022 15:58:49 +0000 (10:58 -0500)]
defconfigs: Add a config for AM43xx HS EVM with QSPI Boot support

On AM43xx HS devices, QSPI boot is XIP and we use a single stage
bootloader. Add a defconfig for this.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agoarm: mach-k3: Rename SOC_K3_AM6 to SOC_K3_AM654
Andrew Davis [Fri, 15 Jul 2022 15:25:27 +0000 (10:25 -0500)]
arm: mach-k3: Rename SOC_K3_AM6 to SOC_K3_AM654

The first AM6x device was the AM654x, but being the first we named it
just AM6, since more devices have come out with this same prefix we
should switch it to the normal convention of using the full name of the
first compatibility device the series. This makes what device we are
talking about more clear and matches all the K3 devices added since.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: mach-k3: Only build init files for SPL
Andrew Davis [Fri, 15 Jul 2022 15:25:26 +0000 (10:25 -0500)]
arm: mach-k3: Only build init files for SPL

The content of these files are only used in SPL builds. The contents are
already ifdef for the same, remove that and only include the whole file
in the build when building for SPL.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: dts: db410c/db820c: Fix SPMI addresses
Stephan Gerhold [Wed, 13 Jul 2022 19:17:11 +0000 (21:17 +0200)]
arm: dts: db410c/db820c: Fix SPMI addresses

The Qualcomm device trees in U-Boot are currently not consistent with
the upstream DTs used in the Linux kernel. While some bindings are
similar to the official specification in the Linux kernel, several
nodes have subtle differences, e.g. the "compatible"s or the exact
specification of memory registers.

This means that some of the Qualcomm-related U-Boot drivers are not
compatible with the Linux DT (and vice versa).

The SPMI node is one such example: the "core" region starts at
0x0200f000 in the upstream Linux MSM8916 DT, but in U-Boot it starts at
0x0200f800. The end result is normally the same, since the Linux SPMI
driver simply adds the 0x800 internally.

However, commit f5a2d6b4b03a ("spmi: msm: add arbiter version 5
support") imported this behavior into the U-Boot driver, without
adjusting the DB410c/DB820c device trees. This means that the 0x800
offset is now added twice, breaking all SPMI read/write operations:

  Failed to find PMIC pon node. Check device tree
  Failed to find pm8916_gpios@c000 node.
  USB init failed: -6
  starting USB...
  Bus ehci@78d9000: Failed to find pm8916_gpios@c000 node.
  probe failed, error -6
  No working controllers found

While the mistake is strictly speaking in the spmi-msm driver, fix the
issue by making the SPMI nodes in the DB410c/DB820c consistent with the
upstream Linux DT instead.

Ideally we should even go a step further by fixing the remaining uses
of custom bindings in the U-Boot drivers and moving to using the Linux
DTs as-is. This would likely avoid such mistakes in the future and
would also make the porting process much easier.

Cc: Dzmitry Sankouski <dsankouski@gmail.com>
Fixes: f5a2d6b4b03a ("spmi: msm: add arbiter version 5 support")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
2 years agoboard: ti: am65x: Do not disable SA2UL in DT
Andrew Davis [Wed, 13 Jul 2022 16:12:48 +0000 (11:12 -0500)]
board: ti: am65x: Do not disable SA2UL in DT

This is no longer needed as the SA2UL can now be shared with Linux.
Leave the SA2UL DT node enabled.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarmv8: mach-k3: correct define checking for AM625/AM642 memory maps
Matt Ranostay [Wed, 13 Jul 2022 11:49:36 +0000 (04:49 -0700)]
armv8: mach-k3: correct define checking for AM625/AM642 memory maps

Using CONFIG_IS_ENABLED breaks accessing memory map structure when
doing a A53 SPL build for AM625 and AM642 platforms. This is due to
'abc if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y''
in which there is no CONFIG_SPL_SOC_K3_AM625/CONFIG_SPL_SOC_K3_AM642
defined in the configuration.

For the A53 SPL builds on these platform to access the memory mapping
which it will need for enabling the mmu/cache it must use #if defined(X)
checks and not CONFIG_IS_ENABLED.

Cc: Suman Anna <s-anna@ti.com>
Cc: Neha Francis <n-francis@ti.com>
Signed-off-by: Matt Ranostay <mranostay@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: dts: mt7622: remove default pinctrl of uart0
Weijie Gao [Wed, 13 Jul 2022 03:16:39 +0000 (11:16 +0800)]
arm: dts: mt7622: remove default pinctrl of uart0

Currently u-boot running on mt7622 will print an warning log at beginning:
> serial_mtk serial@11002000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

It turns out that the pinctrl uclass can't work properly in board_f stage.

Since the uart0 is the default UART device used by bootrom, and will be
initialized in both bootrom and tf-a bl2. It's ok not to setup pinctrl for
uart0 in u-boot.

This patch removes the default pinctrl of uart0 to suppress the unwanted
warning.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoarm: dts: k3-am64-ddr fix typo causing DDR4 register corruption
Anand Gadiyar [Wed, 13 Jul 2022 00:59:04 +0000 (19:59 -0500)]
arm: dts: k3-am64-ddr fix typo causing DDR4 register corruption

The entry for DDRSS_PI_321_DATA was accidentally repeated leading to the
last few PI registers being incorrectly programmed.

Fix this.

Reported-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoboard: qualcomm: Add support for QCS404 EVB
Sumit Garg [Tue, 12 Jul 2022 07:12:12 +0000 (12:42 +0530)]
board: qualcomm: Add support for QCS404 EVB

Add support for Qualcomm QCS404 SoC based evaluation board.

Features:
- Qualcomm Snapdragon QCS404 SoC
- 1GiB RAM
- 8GiB eMMC, uSD slot

U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
For detailed build and boot instructions, refer to
doc/board/qualcomm/qcs404.rst.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2 years agoclocks: qcom: Add clock driver for QCS404 SoC
Sumit Garg [Tue, 12 Jul 2022 07:12:11 +0000 (12:42 +0530)]
clocks: qcom: Add clock driver for QCS404 SoC

Currently this clock driver initializes clocks for UART and eMMC. Along
with this import "qcom,gcc-qcs404.h" header from Linux mainline to
support DT bindings.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2 years agopinctrl: qcom: Add pinctrl driver for QCS404 SoC
Sumit Garg [Tue, 12 Jul 2022 07:12:10 +0000 (12:42 +0530)]
pinctrl: qcom: Add pinctrl driver for QCS404 SoC

Currently this pinctrl driver only supports BLSP UART2 specific pin
configuration.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agommc: msm_sdhci: Add SDCC version 5.0.0 support
Sumit Garg [Tue, 12 Jul 2022 07:12:09 +0000 (12:42 +0530)]
mmc: msm_sdhci: Add SDCC version 5.0.0 support

For SDCC version 5.0.0, MCI registers are removed from SDCC interface
and some registers are moved to HC. So add support to use the new
compatible string "qcom,sdhci-msm-v5". Based on this new msm variant,
pick the relevant variant data and use it to detect MCI presence thereby
configuring register read/write to msm specific registers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoboard: qualcomm: Add support for dragonboard845c
Sumit Garg [Tue, 12 Jul 2022 07:12:08 +0000 (12:42 +0530)]
board: qualcomm: Add support for dragonboard845c

Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
platform. This board complies with 96Boards Open Platform Specifications.

Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS drive

U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agouart: sdm845: Fix debug UART pinmux
Sumit Garg [Tue, 12 Jul 2022 07:12:07 +0000 (12:42 +0530)]
uart: sdm845: Fix debug UART pinmux

Configure debug UART pins as function: "qup9" rather than being regular
gpios. It fixes a hang seen during pinmux setting.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoclocks: sdm845: Import qcom,gcc-sdm845.h
Sumit Garg [Tue, 12 Jul 2022 07:12:06 +0000 (12:42 +0530)]
clocks: sdm845: Import qcom,gcc-sdm845.h

Rather than using magic numbers as clock ids for peripherals import
qcom,gcc-sdm845.h from Linux to be used standard macros for clock ids.
So start using corresponding clk-id macro for debug UART.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>