]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
4 years agoarm64: dts: Make sure that all DTBs are 64bit aligned
Michal Simek [Thu, 19 Aug 2021 09:29:41 +0000 (11:29 +0200)] 
arm64: dts: Make sure that all DTBs are 64bit aligned

Start of DTB should be 64bit aligned that's why also make sure that end is
also 64bit aligned. It is not required but it is nice thing to do.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoMakefile: Align fit-dtb.blob and u-boot.itb by 64bits
Michal Simek [Thu, 19 Aug 2021 09:09:37 +0000 (11:09 +0200)] 
Makefile: Align fit-dtb.blob and u-boot.itb by 64bits

Enabling MULTI_DTB_FIT and DTB_RESELECT can end up with multi DTBs in FIT
image placed and aligned only by 32bits (4bytes). Based on device tree
specification:
"Specifically, the memory reservation block shall be aligned to an 8-byte boundary
and the structure block to a 4-byte boundary."
is 64bit (8bytes) alignment required. That's why make sure that
fit-dtb.blob and u-boot.itb as our primary target images for Xilinx ZynqMP
are all 64bit aligned.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: common: Enabling generic function for DT reselection
Michal Simek [Wed, 11 Aug 2021 12:23:54 +0000 (14:23 +0200)] 
xilinx: common: Enabling generic function for DT reselection

U-Boot support board detection at run time and based on it change DT.
This feature is implemented for SOM Kria platforms which contain two
eeproms which contain information about SOM module and CC (Carrier card).
Full U-Boot starts with minimal DT file defined by
CONFIG_DEFAULT_DEVICE_TREE which is available in multi DTB fit image.
It is using default setup of board_name variable initializaed to
DEVICE_TREE which corresponds to CONFIG_DEFAULT_DEVICE_TREE option.

When DTB_RESELECT is enabled board_detection() is called. Keep it your mind
that this code is called before relocation. board_detection() is calling
xilinx_read_eeprom() which fills board_info (xilinx_board_description)
structure which are parsed in board_name_decode().
Based on DT configuration and amount of nvmemX aliases name of the board is
composed by concatenating CONFIG_SYS_BOARD "-" <board_name> "-rev"
<board_revision> "-" <cc_name> "-rev" <cc_revision>.

If CC is not present or more are available it keeps going.

When board name is composed and returned from board_name_decode() it is
assigned to board_name variable which is used by
board_fit_config_name_match() which is called via fdtdec_setup() when it
goes over config options in multi dtb FIT image.

From practical point of view multi DTB image is key point here which has to
contain configs for detected combinations. Unfortunately as of now they
have to be full DTBs and DTBOs are not supported.

That's why configuration like:
config_X {
description = "zynqmp-board-cc";
fdt = "board", "cc";
};

needs to be squashed together with:
fdtoverlay -o zynqmp-board-cc -i arch/arm/dts/zynqmp-board.dtb \
arch/arm/dts/zynqmp-cc.dtbo

and only one dtb is in fit:
config_X {
description = "zynqmp-board-cc";
fdt = "board-cc";
};

For creating multi DTBs fit image use mkimage -E, e.g.:
mkimage -E -f all.its all.dtb

When DTB_RESELECT is enabled xilinx_read_eeprom() is called before
relocation and it uses calloc for getting a buffer. Because this is dynamic
memory it is not relocated that's why xilinx_read_eeprom() is called again
as the part of board_init(). This second read with calloc buffer placed in
proper position board_late_init_xilinx() can setup u-boot variables as
before.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: Add support for generic board detection
Michal Simek [Fri, 23 Jul 2021 07:59:59 +0000 (09:59 +0200)] 
xilinx: Add support for generic board detection

Add support for changing DT at run time. It is done via board_detection()
which returns platform_id and platform_version which can be used via
board_name_decode() to compose board_local_name string which corresponds
with DT which is should be used.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: common: Free allocated structure
Michal Simek [Fri, 13 Aug 2021 07:17:10 +0000 (09:17 +0200)] 
xilinx: common: Free allocated structure

There is no need to keep fru_content around. Free this space.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: common: Change board_info[] handling
Michal Simek [Thu, 12 Aug 2021 10:30:36 +0000 (12:30 +0200)] 
xilinx: common: Change board_info[] handling

Origin code was allocating only pointers to struct xilinx_board_description
and there was separate allocation for structure self and freeing in case of
failure.
The code is directly allocating space for all structures by one calloc to
simlify logic.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: Use variable for passing board_name
Michal Simek [Fri, 23 Jul 2021 07:55:59 +0000 (09:55 +0200)] 
xilinx: Use variable for passing board_name

Use variable which points to DEVICE_TREE by default. The reason for this
change is to enable DTB_RESELECT and MULTI_DTB_FIT where board detection
can be used for change DTB at run time. That's why there must be reference
in board_fit_config_name_match() via variable instead of hardcoding it
which is sufficient for that use case.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: fru: Replace spaces with \0 in detected name
Michal Simek [Thu, 12 Aug 2021 09:03:49 +0000 (11:03 +0200)] 
xilinx: fru: Replace spaces with \0 in detected name

FRU spec expected \0 for unused symbols but unfortunately a lot of boards
are using spaces instead of \0. That's why after saving it to desc->name
name is checked again and all spaces are converted to \0. This will ensure
that names can be used for string manipulations like concatenation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Create description for generic SC (vpk120-revB)
Michal Simek [Mon, 12 Jul 2021 09:14:41 +0000 (11:14 +0200)] 
arm64: zynqmp: Create description for generic SC (vpk120-revB)

System controllers are pretty much the same on the all boards that's why
use autodetection based on i2c eeprom. This should end up with having only
one BSP for all SCs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: versal: Add eeprom for vpk120-revB
Michal Simek [Mon, 23 Aug 2021 13:16:30 +0000 (15:16 +0200)] 
arm64: versal: Add eeprom for vpk120-revB

RevB board has eeprom on directly on the bus without i2c mux. That's why
multimaster accesses works properly and eeprom can be listed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: versal: Add support for vpk120-revB
Michal Simek [Mon, 16 Aug 2021 08:51:53 +0000 (10:51 +0200)] 
arm64: versal: Add support for vpk120-revB

RevB has different SD level shifter compare to revA. From Versal
perspective description revB should be similar to revA but there are
expected changes in i2c infrastructure which is not described from Versal
point of view yet. Adding revB description as placeholder for other changes
which may come.

From Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
"Input Tap delays for New level shifter(NXP/DIODE) are different from
legacy level shifter tap values.
This patch adds tap delay values for SD3.0 new level shifter.
Default driver supports tap delay values for legacy level shifter
and with this patch mmc driver overwrite them with the new tap values."

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add support for zcu670-revB
Michal Simek [Tue, 10 Aug 2021 06:39:46 +0000 (08:39 +0200)] 
arm64: zynqmp: Add support for zcu670-revB

RevB has different SD level shifter compare to revA. There are couple of
changes between revisions but none of them requires SW alignment.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com> [tap values]
4 years agomtd: spi-nor: Fix write protection error with 1-byte length
T Karthik Reddy [Mon, 16 Aug 2021 06:42:28 +0000 (00:42 -0600)] 
mtd: spi-nor: Fix write protection error with 1-byte length

Incase of write operation at offset 0 and with data length 1, we are
observing write protection error.

sf write 0x400000 0 1
device 0 offset 0x0, size 0x1
offset 0x0 is protected and cannot be written
SF: 1 bytes @ 0x0 Written: ERROR -22

This is happening due to return of incorrect status of locked sectors
due to shifting of length in dual parallel connection.
Resolve this issue by avoiding data shift when data length is 1.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agomtd: spi-nor: Switch micron octal flash to dtr
T Karthik Reddy [Fri, 13 Aug 2021 06:35:36 +0000 (00:35 -0600)] 
mtd: spi-nor: Switch micron octal flash to dtr

Add support to switch micron octal flash to ddr mode by
setting 0xe7 to flash configuration register.
Add octal_ddr_enable() to spi-nor structure to switch to
octal dtr mode.
SPI_XFER_SET_DDR flag is set to spi_slave flags to specify
the ospi driver to enable ospi dtr.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agomtd: spi-nor: Add support for 8_8_8 protocol
T Karthik Reddy [Fri, 13 Aug 2021 06:35:35 +0000 (00:35 -0600)] 
mtd: spi-nor: Add support for 8_8_8 protocol

Use 8_8_8 protocol parameter setting for read & pp operations.
Remove READ_8_8_8 & PP_8_8_8 HWCAPS from ignore masks to use
8_8_8 protocol. Also use read & pp hwcaps mask(which enables
all the caps) instead of using individual hwcaps to set hardware
capability. Set read 8_8_8 proto setting when flash flags set with
SPI_NOR_OCTAL_DTR_READ flag.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agommc: zynq_sdhci: Fix SPL flow issues in mmc driver
Ashok Reddy Soma [Wed, 11 Aug 2021 09:50:51 +0000 (03:50 -0600)] 
mmc: zynq_sdhci: Fix SPL flow issues in mmc driver

Address couple of review comments which are already fixed in mainline.

SPL flow needs zynqmp_mmio way to set tapdelay's. Keep xilinx_pm_request
calls for regular u-boot and use zynqmp_mmio calls for SPL flow and mini
u-boot.

Change Macro's to use BIT() and GENMASK() wherever applicable.

Add WORKAROUND for the Versal card detect stable issue in the comment,
and return -ETIMEDOUT in place of -EIO if the card is not stable.

Print error when set_delay() function returns error.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoxilinx: Enable config to display cpuinfo
T Karthik Reddy [Tue, 10 Aug 2021 12:50:21 +0000 (06:50 -0600)] 
xilinx: Enable config to display cpuinfo

Enable CONFIG_DISPLAY_CPUINFO to display SoC family & revision.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457642.html
State: waiting

4 years agoxilinx: common: Add function to print SoC info
T Karthik Reddy [Tue, 10 Aug 2021 12:50:20 +0000 (06:50 -0600)] 
xilinx: common: Add function to print SoC info

Add print_cpuinfo() to print SoC info like family & revision.
This function depends on CONFIG_DISPLAY_CPUINFO config.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457642.html
State: waiting

4 years agosoc: xilinx: versal: Add soc_xilinx_versal driver
T Karthik Reddy [Tue, 10 Aug 2021 12:50:19 +0000 (06:50 -0600)] 
soc: xilinx: versal: Add soc_xilinx_versal driver

soc_xilinx_versal driver allows identification of family & revision
of versal SoC. This driver is selected by CONFIG_SOC_XILINX_VERSAL.
Probe this driver using platdata U_BOOT_DEVICE structure which is
defined at mach-versal/cpu.c.
Add this config to xilinx_versal_virt_defconfig &
xilinx_versal_mini_ospi_defconfig file to select this driver.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457642.html
State: waiting

4 years agosoc: xilinx: zynqmp: Add soc_xilinx_zynqmp driver
T Karthik Reddy [Tue, 10 Aug 2021 12:50:18 +0000 (06:50 -0600)] 
soc: xilinx: zynqmp: Add soc_xilinx_zynqmp driver

soc_xilinx_zynqmp driver allows identification of family & revision
of zynqmp SoC. This driver is selected by CONFIG_SOC_XILINX_ZYNQMP.
Add this config to xilinx_zynqmp_virt_defconfig file.
Probe this driver using platdata U_BOOT_DEVICE structure which is
specified in mach-zynqmp/cpu.c.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457642.html
State: waiting

4 years agowatchdog: versal: Include header file needed for dev_ functions
Ashok Reddy Soma [Tue, 10 Aug 2021 06:16:12 +0000 (00:16 -0600)] 
watchdog: versal: Include header file needed for dev_ functions

dev_dbg, dev_err and dev_warn seems to be moved to different header file.
Include dm/device_compat.h file to compile properly.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoxilinx: Disable ARCH_FIXUP_FDT_MEMORY
Michal Simek [Fri, 6 Aug 2021 12:09:32 +0000 (14:09 +0200)] 
xilinx: Disable ARCH_FIXUP_FDT_MEMORY

Based on DT spec you can have one memory node which multiple ranges or
multiple nodes.
fdt_fixup_memory_banks() is not implemented in a correct way when multiple
memory nodes are present because all ranges are put it to the first memory
node found. And next memory nodes are kept in DT which ends up in the same
range specification in the same DT.

Here is what it is happening.
Origin DT.
memory@0 {
        device_type = "memory";
        reg = <0x0 0x0 0x0 0x80000000>;
};

memory@800000000 {
        device_type = "memory";
        reg = <0x8 0x00000000 0x0 0x80000000>;
};

After fdt_fixup_memory_banks()

memory@0 {
        device_type = "memory";
        reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
};

memory@800000000 {
        device_type = "memory";
        reg = <0x8 0x00000000 0x0 0x80000000>;
};

As is visible memory@0 node got second range but there is still
memory@800000000 node present and 2G range is listed twice.

The solution can't be that second node is removed because it can be
referenced already that's why it is better for us to disable this option
for now.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457357.html
State: waiting

4 years agoarm64: zynqmp: Fix header alignment on kv260 boards
Michal Simek [Fri, 6 Aug 2021 09:12:29 +0000 (11:12 +0200)] 
arm64: zynqmp: Fix header alignment on kv260 boards

Fix header alignemnt.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457345.html
State: waiting

4 years agoarm64: zynqmp: Fix node name for ds35/36 leds
Michal Simek [Fri, 6 Aug 2021 09:12:56 +0000 (11:12 +0200)] 
arm64: zynqmp: Fix node name for ds35/36 leds

By dt-binding specs led nodes should have -led suffix that's why add it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-August/457344.html
State: waiting

4 years agoARM: zynq: Replace 'io-standard' with 'power-source' property
Sai Krishna Potthuri [Fri, 6 Aug 2021 07:41:46 +0000 (01:41 -0600)] 
ARM: zynq: Replace 'io-standard' with 'power-source' property

Replace 'io-standard' property with 'power-source' property in all
zynq dts files to be in sync with Zynq Pinctrl driver.

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
4 years agoarm64: versal: Do not enable SD HS mode for vck190/vmk180
Michal Simek [Thu, 5 Aug 2021 13:50:29 +0000 (15:50 +0200)] 
arm64: versal: Do not enable SD HS mode for vck190/vmk180

Current SD level shifter is EOL and needs to be replaced by another part.
Boards with it are going to production soon without any infrastructure for
recongition if this is old/new board. Till this is done do not use HS mode
and limit maximum frequence till 19MHz.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agotest/py/tests: Add a TFTP put test
Love Kumar [Thu, 5 Aug 2021 11:22:43 +0000 (05:22 -0600)] 
test/py/tests: Add a TFTP put test

This patch adds a test case for tftpput command, for uploading files to
a server.

Signed-off-by: Love Kumar <love.kumar@xilinx.com>
4 years agoarm64: zynqmp: Update comment style sm-k26
Michal Simek [Thu, 5 Aug 2021 06:28:46 +0000 (08:28 +0200)] 
arm64: zynqmp: Update comment style sm-k26

Trivial style patch.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agofirmware: xilinx: Use explicit values for all enum values
Michal Simek [Fri, 30 Jul 2021 05:59:29 +0000 (07:59 +0200)] 
firmware: xilinx: Use explicit values for all enum values

Based on discussion at
https://lore.kernel.org/r/20200318125003.GA2727094@kroah.com we got
recommendation to use explicit values for all enum values.
The patch is following this recommendation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/daeb67ded45d8a8f6a96717d1fb9c84439dd2ae8.1612361627.git.michal.simek@xilinx.com
4 years agommc: zynq_sdhci: Replace mmc->dev->seq with deviceid
Ashok Reddy Soma [Wed, 28 Jul 2021 11:48:41 +0000 (05:48 -0600)] 
mmc: zynq_sdhci: Replace mmc->dev->seq with deviceid

It is incorrect to use mmc->dev->seq to identify SD0 or SD1.
We are already reading "device_id" from DT to identify whether it is SD0
or SD1. It is stored in priv->deviceid.

Replace mmc->dev->seq with priv->deviceid and get node_id as per that.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agomtd: spi-nor: Add support for Winbond w25h02jv flash
T Karthik Reddy [Tue, 27 Jul 2021 14:35:11 +0000 (08:35 -0600)] 
mtd: spi-nor: Add support for Winbond w25h02jv flash

Add support for Winbond w25h02jv flash with 64KBytes
sector size. This flash has 4-dies of 64MBytes each.
Set SPI_NOR_MULTI_DIE flag as this flash needs split reads.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
4 years agospi: mtd: Use split reads if multi-die flag is set
T Karthik Reddy [Tue, 27 Jul 2021 14:35:10 +0000 (08:35 -0600)] 
spi: mtd: Use split reads if multi-die flag is set

Some flash devices have multiple dies in it & has die cross over
issue. When SPI_NOR_MULTI_DIE flag is set in flash id table use
it to enable split reads to avoid above issue. Define SPI_NOR_MULTI_DIE
new flag to flash id flags. Remove SPI_FLASH_SPLIT_READ config and
related code from the zynq and zynqmp qspi drivers as it is redundant.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoarm64: versal: Modify cpm node interrupt-map
Bharat Kumar Gogada [Mon, 26 Jul 2021 08:53:00 +0000 (14:23 +0530)] 
arm64: versal: Modify cpm node interrupt-map

CPM root port driver doesn't use pci_irqd_intx_xlate method
to translate INTx numbers, it expects the device tree node to
provide required mapping.
Modifying interrupt-map property to provide driver with
required hwirq range to be mapped for INTx interrupts.

Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
4 years agonet: xilinx: axi_mrmac: Backport from upstream code
Ashok Reddy Soma [Wed, 14 Jul 2021 14:24:30 +0000 (08:24 -0600)] 
net: xilinx: axi_mrmac: Backport from upstream code

In this patch backport MRMAC driver from upstream code with comments
addressed from mainline.

Below things are addressed in this patch.
 - Changed all static allocations to dynamic and freed them.
 - Used setbits_le32 and clrbits_le32 wherever applicable
 - All return's are changed to proper error codes instead of 1 or -1
 - Changed return type of isrxready() from int to bool
 - Changed all printf's to log_warning, and debug to log_debug
 - Added function headers with desciption
 - Changed all capital hex numbers to small hex numbers

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agommc: zynq_sdhci: Use set_control_reg from sdhci.c
Ashok Reddy Soma [Wed, 14 Jul 2021 10:27:25 +0000 (04:27 -0600)] 
mmc: zynq_sdhci: Use set_control_reg from sdhci.c

Since set_control_reg is available in sdhci.c, use it and remove
arasan_sdhci_set_control_reg().

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agommc: sdhci: Add helper functions for UHS modes
Faiz Abbas [Wed, 14 Jul 2021 10:27:24 +0000 (04:27 -0600)] 
mmc: sdhci: Add helper functions for UHS modes

Add a set_voltage() function which handles the switch from 3.3V to 1.8V
for SD card UHS modes.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
State: upstream (43392b550e56b52274398763329f35d54109d291)

4 years agommc: sdhci: Fix rebase issues in set_ios
Ashok Reddy Soma [Wed, 14 Jul 2021 10:27:23 +0000 (04:27 -0600)] 
mmc: sdhci: Fix rebase issues in set_ios

There are couple issues in set_ios function which are introduced when
xlnx code is rebased to mainline U-Boot version 2021.1 with
'commit 880b655d660e ("mmc: zynq_sdhci: Fix UHS 1.8v switching with 5ms
delay")'

Mainline 'commit f12341a95295 ("mmc: sdhci: Fix HISPD bit handling")' is
pulled partially when rebased to 2021.1. Fix it by adding back missing
HISPD bit setting code.

Remove extra line which writes back to sdhc host control register.

set_control_reg call got duplicated after rebase, remove it.

Since, voltage setting function (set_control_reg) is moved to the
beginning of the function, no need to return if the set_ios is called
with clock disable, so remove return.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agommc: zynq_sdhci: Change variable deviceid to node_id
Ashok Reddy Soma [Wed, 14 Jul 2021 10:27:22 +0000 (04:27 -0600)] 
mmc: zynq_sdhci: Change variable deviceid to node_id

Change deviceid to node_id in arasan_zynqmp_dll_reset() and also in
tapdelay related static inline functions to reflect proper name and
for consistency.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agommc: zynq_sdhci: Move setting tapdelay code to driver
Ashok Reddy Soma [Wed, 14 Jul 2021 10:27:21 +0000 (04:27 -0600)] 
mmc: zynq_sdhci: Move setting tapdelay code to driver

tap_delays.c just has calls to xilinx_pm_request() for setting tapdelays.
Simply move these calls to zynq_sdhci.c and make them static inline.
Similarly zynqmp_tap_delay.h also has call to xilinx_pm_request() for
dll reset. Do the same for this file as well.

Remove tap_delays.c and zynqmp_tap_delay.h files.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoarm64: zynqmp: Move USB3 PHY properties from DWC3 node to USB node
Manish Narani [Wed, 14 Jul 2021 12:17:19 +0000 (06:17 -0600)] 
arm64: zynqmp: Move USB3 PHY properties from DWC3 node to USB node

Move the PHY properties from DWC3 node to USB node in ZynqMP DTs as here
the USB3 PHY used is PSGTR, which is connected to Xilinx USB core. This
PHY initialization should be handled from Xilinx USB core as the
prerequisite register configurations are done here only.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
4 years agoxilinx: Define kernel_comp_addr_r,kernel_comp_size env variables
Raju Kumar Pothuraju [Mon, 12 Jul 2021 14:49:04 +0000 (20:19 +0530)] 
xilinx: Define kernel_comp_addr_r,kernel_comp_size env variables

Add kernel_comp_addr_r, kernel_comp_size env variables for zynqmp and
versal to be able to use the compressed kernel Image(.gz,.bz2,.lzma,.lzo)
using booti command.

Signed-off-by: Raju Kumar Pothuraju <raju.kumar-pothuraju@xilinx.com>
4 years agommc: zynq_sdhci: Use pm_node id instead of device sequence id
T Karthik Reddy [Mon, 12 Jul 2021 11:29:43 +0000 (05:29 -0600)] 
mmc: zynq_sdhci: Use pm_node id instead of device sequence id

When programming tapdelays & resetting dll, we are using device
sequence id, which is not programming tapelays & dll reset.
So use pm_node id instead of device sequence id to fix above issue.
Also use u8 instead of u32 for node_id variable as we have pm_node
ids less than 128.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agotest/py/tests: Add a test for the time command
Love Kumar [Mon, 12 Jul 2021 04:05:41 +0000 (22:05 -0600)] 
test/py/tests: Add a test for the time command

This test executes "time <sleep cmd>", and validate that it gives the
approximately the correct amount of command execution time.

Signed-off-by: Love Kumar <love.kumar@xilinx.com>
4 years agoarm64: zynqmp: Remove gpio from aliases list
Michal Simek [Mon, 12 Jul 2021 08:56:33 +0000 (10:56 +0200)] 
arm64: zynqmp: Remove gpio from aliases list

It is not recommended to have aliases for gpio. In past it was used in
Linux for assigning numbers via sysfs which is deprecated and libgpiod
should be used instead.
In U-Boot this number is used for seq number but gpio offset are not
counted from this number. That's why having these aliases only for seq
number is not needed. As is done in Linux it is the best to use full gpio
name instead of sequence number which depends on sequence in binding.

The same changes was done by commit d458db3ce900 ("arm64: zynqmp: Remove
gpio from aliases list").

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add label for more VPK120 GPIO lines
Saeed Nowshadi [Thu, 8 Jul 2021 00:40:29 +0000 (17:40 -0700)] 
arm64: zynqmp: Add label for more VPK120 GPIO lines

GPIO lines from banks 43 & 44 of ZU4 need label so they could be found
and referenced by libgpiod utilities.

Signed-off-by: Saeed Nowshadi <saeed.nowshadi@xilinx.com>
4 years agoarm64: zynqmp: Add fclk bindings for VPK120 clocks
Saeed Nowshadi [Fri, 2 Jul 2021 23:23:54 +0000 (16:23 -0700)] 
arm64: zynqmp: Add fclk bindings for VPK120 clocks

Add Xilinx fclk bindings for clocks on VPK120 board so they could be
referenced through sysfs interface.

Signed-off-by: Saeed Nowshadi <saeed.nowshadi@xilinx.com>
4 years agoarm64: dts: zynqmp: Enable USB2.0 for zc1751-xm016-dc2
Piyush Mehta [Sat, 3 Jul 2021 05:10:30 +0000 (10:40 +0530)] 
arm64: dts: zynqmp: Enable USB2.0 for zc1751-xm016-dc2

The board zynqmp-zc1751-xm016-dc2 support only USB2.0.
This patch removes USB3.0 DT configuration for DC2 board.

Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
4 years agoarm64: zynqmp: Use new compatible strings for DP snd pcm
Dylan Yip [Thu, 1 Jul 2021 17:51:37 +0000 (10:51 -0700)] 
arm64: zynqmp: Use new compatible strings for DP snd pcm

To remove a stack trace when removing and reprobing the DP snd pcm,
use the new DP pcm compatible strings to allow the driver to create
standardized names for each DP snd pcm.

Signed-off-by: Dylan Yip <dylan.yip@xilinx.com>
Acked-by: Varunkumar Allagadapa <varunkumar.allagadapa@xilinx.com>
Acked-by: Jianqiang Chen <jianqiang.chen@xilinx.com>
4 years agoxilinx: Add jedec compatible string for QSPI (Zynq/ZynqMP)
Raju Kumar Pothuraju [Thu, 1 Jul 2021 08:45:11 +0000 (14:15 +0530)] 
xilinx: Add jedec compatible string for QSPI (Zynq/ZynqMP)

Add missing "jedec, spi-nor" compatible string for QSPI flash node.
Spi-nor framework uses this compatiblity string to probe &
initilize flash. With missing compatibility string we are observing
below error:

Zynq> sf probe 0 0 0
 jedec_spi_nor spi_flash@0:0: unrecognized JEDEC id bytes:
00, 00, 00  Failed to initialize SPI flash at 0:0 (error -2)

Signed-off-by: Raju Kumar Pothuraju <raju.kumar-pothuraju@xilinx.com>
4 years agomtd: spi-nor: Fix read SFDP data in dual parallel mode
Lars-Peter Clausen [Fri, 18 Jun 2021 15:39:04 +0000 (17:39 +0200)] 
mtd: spi-nor: Fix read SFDP data in dual parallel mode

Reading the SFDP data is broken in two ways in dual parallel mode in the
current implementation.

1) It reads the data interleaved from both chips, which results in data
that can not be parsed. Since both chips have to be identical for dual
parallel mode the SFDP data will also be identical. So only read the data
from one of the chips.

2) The page, erase and chip size are not update to reflect that they should
be twice as large in dual parallel mode. Fix this by moving the update of
those parameter after running the SFDP detection rather than doing it
before.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agomtd: spi-nor: Fix dual parallel mode
Lars-Peter Clausen [Fri, 18 Jun 2021 15:39:03 +0000 (17:39 +0200)] 
mtd: spi-nor: Fix dual parallel mode

In the current implementation dual parallel mode only works for limited
corner cases, but is mostly broken.

For example
 * Erase will only erase one of the chips leaving every second byte
   non-erased
 * Lock/unlock only works if a read is done before it, otherwise it will
   timeout
 * Using bank/extended address mode (CONFIG_SPI_FLASH_BAR) fails in
   `sf probe` with a timeout

This is primarily due to incorrect setting of the striped access. Some
commands that should set it don't set it, while others that do set it
shouldn't set it.

To fix this make sure that the SPI_XFER_STRIPE flag gets set in
spi_nor_init() when operating in dual parallel mode. This means the flag is
always set before issuing any commands that need it.

And then in addition use a list of opcodes for which to disable striped
access (e.g. erase).

This is similar to what the Linux driver does to support dual parallel
mode.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoarm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y
Kunihiko Hayashi [Tue, 15 Jun 2021 06:33:02 +0000 (15:33 +0900)] 
arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y

If both POSITION_INDEPENDENT and SYS_RELOC_GD_ENV_ADDR are enabled,
wherever original env is placed anywhere, it should be relocated to
the right address.

Relocation offset gd->reloc_off is calculated with SYS_TEXT_BASE in
setup_reloc() and env address gd->env_addr is relocated by the offset in
initr_reloc_global_data().

gd->env_addr
  = (orig env) + gd->reloc_off
  = (orig env) + (gd->relocaddr - SYS_TEXT_BASE)

However, SYS_TEXT_BASE isn't always runtime base address when
POSITION_INDEPENDENT is enabled. So the relocated env_addr might point to
wrong address. For example, if SYS_TEXT_BASE is zero, gd->env_addr is
out of memory location and memory exception will occur.

There is a difference between linked address such as SYS_TEXT_BASE and
runtime base address. In _main, the difference is calculated as
"run-vs-link" offset. The env_addr should also be added to the offset
to fix the address.

gd->env_addr
  = (orig env) + ("run-vs-link" offset)   + gd->reloc_off
  = (orig env) + (SYS_TEXT_BASE - _start) + (gd->relocaddr - SYS_TEXT_BASE)
  = (orig env) + (gd->relocaddr - _start)

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
Link: https://lists.denx.de/pipermail/u-boot/2021-June/452135.html
State: upstream (534f0fbd65203871c2b054096422a5d0f3346cb1)

4 years agoxilinx: versal: Enable Xilinx AXI MRMAC
Ashok Reddy Soma [Mon, 21 Jun 2021 14:53:21 +0000 (08:53 -0600)] 
xilinx: versal: Enable Xilinx AXI MRMAC

Enable Xilinx AXI MRMAC for Versal platforms.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agonet: xilinx: axi_mrmac: Add MRMAC driver
Ashok Reddy Soma [Mon, 21 Jun 2021 14:53:20 +0000 (08:53 -0600)] 
net: xilinx: axi_mrmac: Add MRMAC driver

Add support for xilinx multirate(MRMAC) ethernet driver.
This driver uses multichannel DMA(MCDMA) for data transfers of MRMAC.
Added support for 4 ports of MRMAC for speeds 10G and 25G.
MCDMA supports upto 16 channels but in this driver we have setup only
one channel which is enough.

Tested 10G and 25G on all 4 ports.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agonet: ethtool: Add ethernet speed macros for higher speeds
Ashok Reddy Soma [Thu, 17 Jun 2021 12:20:57 +0000 (06:20 -0600)] 
net: ethtool: Add ethernet speed macros for higher speeds

Add speed macro's for higher ethernet speeds to be used in u-boot
networking drivers. Added Macros for speeds 14G, 20G, 25G, 40G, 50G,
56G, 100G and 200G inline with linux.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoarm64: dts: zynqmp: Add psgtr and phy entry for USB and SATA node
Piyush Mehta [Mon, 21 Jun 2021 04:41:27 +0000 (10:11 +0530)] 
arm64: dts: zynqmp: Add psgtr and phy entry for USB and SATA node

This patch adds psgtr clocks and phy entry for USB0, USB1 and SATA node for
zc1751-xm017-dc3 board.

Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
Link: https://lists.denx.de/pipermail/u-boot/2021-June/452498.html
State: waiting

4 years agonet: xilinx: axi_emac: Add support for 10G/25G AXI ethernet
Ashok Reddy Soma [Wed, 16 Jun 2021 06:20:31 +0000 (00:20 -0600)] 
net: xilinx: axi_emac: Add support for 10G/25G AXI ethernet

Add support for 10G/25G (XXV) high speed ethernet. This Makes use of
the exiting AXI DMA, similar to 1G.

Signed-off-by: Alessandro Temil <atemil@waymo.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agonet: xilinx: axi_emac: Cleanup ofdata_to_platdata
Ashok Reddy Soma [Wed, 16 Jun 2021 06:20:30 +0000 (00:20 -0600)] 
net: xilinx: axi_emac: Cleanup ofdata_to_platdata

There are lot of accesses to priv data in ofdata_to_platdata, which is
incorrect. Create a platform data structure and use it in
ofdata_to_platdata, then copy all platform data to priv data in probe.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoarm64: zynqmp: Sync with upstream Linux/U-Boot
Michal Simek [Mon, 14 Jun 2021 13:14:26 +0000 (15:14 +0200)] 
arm64: zynqmp: Sync with upstream Linux/U-Boot

Trivial sync up. Line is longer but still inside current char limit.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add missing zcu670 to the OF_LIST
Michal Simek [Mon, 14 Jun 2021 13:27:12 +0000 (15:27 +0200)] 
arm64: zynqmp: Add missing zcu670 to the OF_LIST

Just list this board in OF_LIST that DT is added to u-boot.its/itb file.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Remove unused snps,enable-hibernation flag
Michal Simek [Mon, 14 Jun 2021 13:12:27 +0000 (15:12 +0200)] 
arm64: zynqmp: Remove unused snps,enable-hibernation flag

This property is used only in gadget mode and there were some upstreaming
commnents about disabling it. Also this property is commented in usb0 but
not in usb1. That's why remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Sync dpdma location with other boards on dc1
Michal Simek [Mon, 14 Jun 2021 13:02:55 +0000 (15:02 +0200)] 
arm64: zynqmp: Sync dpdma location with other boards on dc1

All DTSes should use the same order for dpdma and dpsub nodes.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Update year in copyright
Michal Simek [Mon, 14 Jun 2021 12:53:52 +0000 (14:53 +0200)] 
arm64: zynqmp: Update year in copyright

The same year is used in mainline u-boot that's why sync it up.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Remove additional newlines from k26 and zcu100
Michal Simek [Mon, 14 Jun 2021 13:01:31 +0000 (15:01 +0200)] 
arm64: zynqmp: Remove additional newlines from k26 and zcu100

No need for these lines found while upstreaming.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Remove revA compatibility string from kv260 revB/1
Michal Simek [Thu, 10 Jun 2021 16:52:14 +0000 (18:52 +0200)] 
arm64: zynqmp: Remove revA compatibility string from kv260 revB/1

kv260-revB is different compare to revA (usbhub is wired via i2c) that's
why remove revA compatible string.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoRevert "arm64: zynqmp: Make SMMU a separate node outside amba"
Michal Simek [Mon, 14 Jun 2021 13:16:21 +0000 (15:16 +0200)] 
Revert "arm64: zynqmp: Make SMMU a separate node outside amba"

This reverts commit 2c3f2141f576e1c8f03d94082d44f5edff69b415.

Also disable status and change smmu to iommu based on Linux upstreaming

https://lore.kernel.org/r/20200629081744.13916-1-krzk@kernel.org
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Remove si5328 and si5382 nodes
Michal Simek [Thu, 3 Jun 2021 09:58:08 +0000 (11:58 +0200)] 
arm64: zynqmp: Remove si5328 and si5382 nodes

There are no drivers for these devices that's why remove that nodes
completely. This change is done based on Linux kernel.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/20210308115437.2232847-1-quanyang.wang@windriver.com
4 years agoarm64: zynqmp: Sync dp port location on zc1751 dc4
Michal Simek [Tue, 1 Jun 2021 14:42:02 +0000 (16:42 +0200)] 
arm64: zynqmp: Sync dp port location on zc1751 dc4

Historically dpdma and dpsub are placed at the end of files. Move nodes
there for easier comparison among dts files.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Use overlay sugar syntax for Kria SOM
Michal Simek [Thu, 10 Jun 2021 15:59:46 +0000 (17:59 +0200)] 
arm64: zynqmp: Use overlay sugar syntax for Kria SOM

dtc supports new sugar syntax which is easier compare to previous one
that's why also covert overlays for SOM to it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agozynqmp: Remove u-boot,dm-pre-reloc for uart instances
Michal Simek [Mon, 31 May 2021 12:41:23 +0000 (14:41 +0200)] 
zynqmp: Remove u-boot,dm-pre-reloc for uart instances

Uarts already have u-boot,dm-pre-reloc via zynqmp.dtsi that's why there is
no need to have them in platform DT files too.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Enable USB3.0 for dc2/dc3
Michal Simek [Fri, 11 Jun 2021 06:52:25 +0000 (08:52 +0200)] 
arm64: zynqmp: Enable USB3.0 for dc2/dc3

Both boards are usb3.0 capable. dc3 was also missing enabling dwc3* nodes.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Series-to: uboot
Cover-letter:
arm64: zynqmp: Update USB and Kria DTs
Hi,

this series contain updates for Kria SOM kv260 CCs. Also update usb
description.

Thanks,
Michal
END

4 years agoarm64: zynqmp: Remove can aliases from zc1751
Michal Simek [Thu, 3 Jun 2021 10:32:18 +0000 (12:32 +0200)] 
arm64: zynqmp: Remove can aliases from zc1751

Networking subsystem is not using aliases that's why remove them for CAN
devices. There is also no any other Xilinx ZynqMP DT file with them.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Remove additional header from zc1232 DT
Michal Simek [Mon, 31 May 2021 15:44:51 +0000 (17:44 +0200)] 
arm64: zynqmp: Remove additional header from zc1232 DT

Remove unused phy.h from zc1232 DTS.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Sync psgtr location on zcu100/zcu106
Michal Simek [Tue, 1 Jun 2021 14:42:50 +0000 (16:42 +0200)] 
arm64: zynqmp: Sync psgtr location on zcu100/zcu106

psgtr node should be below pinctrl for easier comparion among dts files.
That's why move that nodes to different location.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Sync psgtr location on zcu104/zcu111/zc1751-dc1
Michal Simek [Thu, 3 Jun 2021 13:18:04 +0000 (15:18 +0200)] 
arm64: zynqmp: Sync psgtr location on zcu104/zcu111/zc1751-dc1

psgtr node should be below pinctrl for easier comparion among dts files.
That's why move that nodes to different location.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Add maximum-speed property for dwc3 nodes
Michal Simek [Mon, 31 May 2021 15:51:58 +0000 (17:51 +0200)] 
arm64: zynqmp: Add maximum-speed property for dwc3 nodes

dwc3 can be used only for higher speeds than super-speed that's why
explicitly set it up.
This is also aligned with other ZynqMP dts files.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: Convert xlnx,eeprom property to nvmem alias
Michal Simek [Thu, 3 Jun 2021 09:46:50 +0000 (11:46 +0200)] 
xilinx: Convert xlnx,eeprom property to nvmem alias

Convert all boards to use nvmem alias instead of xlnx,eeprom. The change is
done based on discussion in the link below.

Link: https://lore.kernel.org/r/CAL_JsqLMDqpkyg-Q7mUfw-XH67-v068Q6e9wTq2UOoN=0-_coQ@mail.gmail.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Remove gpio from aliases list
Michal Simek [Thu, 3 Jun 2021 08:47:04 +0000 (10:47 +0200)] 
arm64: zynqmp: Remove gpio from aliases list

It is not recommended to have aliases for gpio. In past it was used in
Linux for assigning numbers via sysfs which is deprecated and libgpiod
should be used instead.
In U-Boot this number is used for seq number but gpio offset are not
counted from this number. That's why having these aliases only for seq
number is not needed. As is done in Linux it is the best to use full gpio
name instead of sequence number which depends on sequence in binding.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agospi: zynqmp_gqspi: Fix issue of reading more than 32bits length
Ashok Reddy Soma [Thu, 20 May 2021 08:04:04 +0000 (02:04 -0600)] 
spi: zynqmp_gqspi: Fix issue of reading more than 32bits length

As the flash sizes are increasing day by day, QSPI in dual-parallel mode
can have devices of size > 512MB. In qspi driver we are trying to read
all the data at once using DMA.

The DMA descriptor destination size is only 29bits long.

QSPIDMA_DST_SIZE 0xFF0F0804

BITS:  1:0 Reserved to keep word alignment
BITS: 28:2 Number of 4-byte words the DMA will transfer
BITS: 31:29 Reserved: Returns 0 when read, writes ignored

So we can only transfer data of 0x1FFFFFF0(512MB minus 4bytes) bytes.
Anything above will overflow this register and will ignore higher bits
above 29 bits.

Change the DMA functionality if the requested size is greater than or
equal to 512MB to read 256MB chunks.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agospi: zynqmp_gqspi: Remove xfer from zynqmp_qspi_ops
Ashok Reddy Soma [Thu, 20 May 2021 08:04:03 +0000 (02:04 -0600)] 
spi: zynqmp_gqspi: Remove xfer from zynqmp_qspi_ops

In zynqmp_qspi_ops mem_ops is added, so all the trasfers tx and rx
happen through this function. So we dont need this xfer anymore.
Remove it.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoarm64: dts: zynqmp: rtc: Update rtc calibration value
Srinivas Neeli [Mon, 8 Mar 2021 08:35:19 +0000 (14:05 +0530)] 
arm64: dts: zynqmp: rtc: Update rtc calibration value

As per the design specification
"The 16-bit Seconds Calibration Value represents the number of
 Oscillator Ticks that are required to measure the largest time
 period that is less than or equal to 1 second.
 For an oscillator that is 32.768 KHz, this value will be 0x7FFF."

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
State: pending

4 years agoarm64: zynqmp: Remove unused property from SD/USB
Michal Simek [Thu, 3 Jun 2021 11:46:27 +0000 (13:46 +0200)] 
arm64: zynqmp: Remove unused property from SD/USB

Linux kernel is not using these properties that's why they can be removed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoxilinx: Enable GUID partitions and EFI variable commands
Michal Simek [Thu, 1 Apr 2021 10:35:42 +0000 (12:35 +0200)] 
xilinx: Enable GUID partitions and EFI variable commands

For work with EFI it is good to have GUID partitions enabled and also
option to work with UEFI variables. That's why enable both.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
State: upstream (84befd408c1e3ad2d7b410adaf58fe4d397cb7b6)

4 years agoarm64: versal: zynqmp: Add support for VPXA2785
Michal Simek [Tue, 26 Jan 2021 14:59:59 +0000 (15:59 +0100)] 
arm64: versal: zynqmp: Add support for VPXA2785

VPXA2785(vp-x-a2785-00) is evaluation board which contains two PCIe-Edge
fingers, one for PCIe-B(gen5x8) and one for CPM(dual gen5x8, gen5x16).
Each of the ports can operate in endpoint or root port mode. This allows
the single card to be used for both root port, endpoint, and switch modes.

The board is designed in the similar manner as others Versal boards. It
means board also have ZynqMP Zu4 System Controller which is described in a
separate file.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: versal: zynqmp: Add support for vpk120
Michal Simek [Tue, 19 Jan 2021 14:00:45 +0000 (15:00 +0100)] 
arm64: versal: zynqmp: Add support for vpk120

Add support for Versal premium evaluation board vpk120.
Board contains two systems. The primary is Versal VP1202 ACAP device and
the secondary is ZynqMP zu4 which acts as system controller.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: zynq: Fix OCM mapping to be aligned with binding on zc702
Michal Simek [Thu, 26 Nov 2020 13:25:03 +0000 (14:25 +0100)] 
ARM: zynq: Fix OCM mapping to be aligned with binding on zc702

The Linux commit f69629919942 ("dt-bindings: sram: Convert SRAM bindings to
json-schema") converted binding to yaml and some missing required
properties started to be reported. Align binding based on it.

The patch is fixing these warnings:
.../zynq-zc702.dt.yaml: sram@fffc0000: '#address-cells' is a required property
.../zynq-zc702.dt.yaml: sram@fffc0000: '#size-cells' is a required property
.../zynq-zc702.dt.yaml: sram@fffc0000: 'ranges' is a required property
>From schema: .../Documentation/devicetree/bindings/sram/sram.yaml

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/87c02786ccd8d7827827a9d95a8737bb300caeb0.1606397101.git.michal.simek@xilinx.com
Link: https://lists.denx.de/pipermail/u-boot/2021-May/450885.html
State: waiting

4 years agoARM: zynq: Convert at25 binding to new description on zc770-xm013
Michal Simek [Thu, 26 Nov 2020 13:25:04 +0000 (14:25 +0100)] 
ARM: zynq: Convert at25 binding to new description on zc770-xm013

The Linux commit f8f79fa6bb25 ("dt-bindings: at25: convert the binding
document to yaml") converted binding to yaml and 3 deprecated properties
pop up.

The patch is fixing these warnings:
.../zynq-zc770-xm013.dt.yaml: eeprom@2: 'pagesize' is a required property
.../zynq-zc770-xm013.dt.yaml: eeprom@2: 'size' is a required property
.../zynq-zc770-xm013.dt.yaml: eeprom@2: 'address-width' is a required property
>From schema: .../Documentation/devicetree/bindings/eeprom/at25.yaml

by converting them to new binding.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/be2c1125d98386033e182012eb08986924707a76.1606397101.git.michal.simek@xilinx.com
Link: https://lists.denx.de/pipermail/u-boot/2021-May/450886.html
State: waiting

4 years agoarm64: dts: zynqmp: Update psgtr clocks index for boards
Piyush Mehta [Tue, 25 May 2021 12:38:30 +0000 (18:08 +0530)] 
arm64: dts: zynqmp: Update psgtr clocks index for boards

Update the psgtr clock indexing for zynqmp boards zcu208,zcu216 and zcu111.

Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
4 years agommc: zynq_sdhci: wait till sd card detect state is stable
T Karthik Reddy [Tue, 18 May 2021 14:28:02 +0000 (08:28 -0600)] 
mmc: zynq_sdhci: wait till sd card detect state is stable

As per SD spec when SD host controller is reset, it takes 1000msec
to detect the card state. In case, if we enable the sd bus voltage &
card detect state is not stable, then host controller will disable
the sd bus voltage.

In case of warm/subsystem reboot, due to unstable card detect state
host controller is disabling the sd bus voltage to sd card causing
sd card timeout error. So we wait for a maximum of 1000msec to get
the card detect state stable before we enable the sd bus voltage.

This current fix is workaround for now, this needs to be analysed
further. Zynqmp platform should behave the same as Versal, but we
did not encounter this issue as of now. So we are fixing it for
Versal only.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
4 years agoarm64: dts: versal: Add interrupt parent properties to versal firmware DT node
Abhyuday Godhasara [Fri, 14 May 2021 10:07:13 +0000 (03:07 -0700)] 
arm64: dts: versal: Add interrupt parent properties to versal firmware DT node

Event Management driver in Linux require interrupt parent property from
DT node of versal firmware.

So Add interrupt parent properties into DT node of versal firmware.

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
4 years agoxilinx: zynqmp: Add support for 67dr silicon
T Karthik Reddy [Thu, 13 May 2021 13:13:25 +0000 (07:13 -0600)] 
xilinx: zynqmp: Add support for 67dr silicon

Add zynqmp 67dr silicon to zynqmp device id table.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
4 years agoarm64: zynqmp: Enable EFI secure boot
Michal Simek [Thu, 13 May 2021 11:58:58 +0000 (13:58 +0200)] 
arm64: zynqmp: Enable EFI secure boot

Enabling EFI secure boot which is required for EBBR specification.
Enabling this will fix
"RT.SetVariable - Create one Time Base Auth Variable, the expect return
status should be EFI_SUCCESS"

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoefi_loader: support EFI_LOAD_FILE_PROTOCOL
Heinrich Schuchardt [Sun, 6 Dec 2020 12:00:15 +0000 (13:00 +0100)] 
efi_loader: support EFI_LOAD_FILE_PROTOCOL

Support loading images via the EFI_LOAD_FILE_PROTOCOL and
EFI_LOAD_FILE2_PROTOCOL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
State: upstream (3da0b28582004981d6ca6866130d2835c3cbf0d0)

4 years agoefi_loader: carve out efi_load_image_from_file()
Heinrich Schuchardt [Sun, 6 Dec 2020 09:47:57 +0000 (10:47 +0100)] 
efi_loader: carve out efi_load_image_from_file()

efi_load_image_from_file() should read via either of:

* EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
* EFI_LOAD_FILE_PROTOCOL
* EFI_LOAD_FILE2_PROTOCOL

To make the code readable carve out a function to load the image via the
file system protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
State: upstream (0e074d12393ba14536f8a103b28c75f74b7c5896)

4 years agoefi_loader: pass boot_policy to efi_load_image_from_path
Heinrich Schuchardt [Fri, 4 Dec 2020 08:27:41 +0000 (09:27 +0100)] 
efi_loader: pass boot_policy to efi_load_image_from_path

Implementing support for loading images via the EFI_LOAD_FILE_PROTOCOL
requires the boot policy as input for efi_load_image_from_path().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
State: upstream (6e8c28cf523257acba5d6ccb4328253595640931)

4 years agoefi_loader: move EFI_LOAD_FILE2_PROTOCOL_GUID
Heinrich Schuchardt [Fri, 4 Dec 2020 02:33:41 +0000 (03:33 +0100)] 
efi_loader: move EFI_LOAD_FILE2_PROTOCOL_GUID

The EFI_LOAD_FILE_PROTOCOL_GUID and EFI_LOAD_FILE2_PROTOCOL_GUID are needed
to complement the implementation of the LoadFile() boot service.

Remove a duplicate declaration of a variable for the
EFI_LOAD_FILE2_PROTOCOL_GUID.
Move the remaining declaration to efi_boottime.c.
Add a variable for the EFI_LOAD_FILE_PROTOCOL_GUID.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
State: upstream (b6f11098c9a619f480582b26edd26c5b195c69f4)

4 years agoefi_loader: resequence functions in efi_boottime.c
Heinrich Schuchardt [Fri, 4 Dec 2020 02:02:03 +0000 (03:02 +0100)] 
efi_loader: resequence functions in efi_boottime.c

For implementing support for the EFI_LOAD_FILE_PROTOCOL in the LoadImage()
service we will have to call the LocateDevicePath() service. To avoid a
forward declaration resequence the functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
State: upstream (0e9d2d7bc25bd3114e8f6ff0d18cdf9ee675909c)

4 years agoxilinx: versal: Enable CONFIG_POSITION_INDEPENDENT
T Karthik Reddy [Wed, 12 May 2021 05:39:16 +0000 (23:39 -0600)] 
xilinx: versal: Enable CONFIG_POSITION_INDEPENDENT

U-Boot expects to be linked to a specific hard-coded address and to
be loaded to and run from that address. CONFIG_POSITION_INDEPENDENT
config lifts that restriction & allowing the code to be loaded to
and executed from almost any address.

As we enabled CONFIG_POSITION_INDEPENDENT, CONFIG_INIT_SP_RELATIVE
is enabled by default, where it will set the early stack pointer at
runtime by adding an offset value to &_bss_start. The offset value
is taken from SYS_INIT_SP_BSS_OFFSET.

SYS_INIT_SP_BSS_OFFSET offset should be large enough so that the
early malloc region, global data (gd), and early stack should fit.
With commit d8fabcc424bd ("arm64: versal: Increase SYS_MALLOC_F_LEN")
SYS_MALLOC_F_LEN is increased from 32KB to 1MB, so we need to
accommodate this space with SYS_INIT_SP_BSS_OFFSET. Hence increasing
SYS_INIT_SP_BSS_OFFSET to 1.5MB.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
4 years agoxilinx: zynqmp: Enable DM_RTC/emul driver/cmd date/gettime and efi settime
Michal Simek [Wed, 12 May 2021 08:03:44 +0000 (10:03 +0200)] 
xilinx: zynqmp: Enable DM_RTC/emul driver/cmd date/gettime and efi settime

Right now U-Boot is not aware about date/time that's why enable it by
default also with EFI runtime service for setting time.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoarm64: zynqmp: Enable gpio driver for zcu1275/zcu1285
Michal Simek [Tue, 11 May 2021 11:59:01 +0000 (13:59 +0200)] 
arm64: zynqmp: Enable gpio driver for zcu1275/zcu1285

Enable gpio driver on these boards. GPIOs can be used on any board.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>