]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
3 years agoversal: Return ENVL_NOWHERE instead of ENVL_UNKNOWN
T Karthik Reddy [Wed, 24 Nov 2021 10:18:55 +0000 (03:18 -0700)] 
versal: Return ENVL_NOWHERE instead of ENVL_UNKNOWN

The system fails to boot without any environment location, so return
ENVL_NOWHERE when there's nowhere to store the environment instead
of ENVL_UNKNOWN.

The same change was also done by commit 50918d0df5cb ("xilinx: Return
ENVL_NOWHERE instead of ENVL_UNKNOWN") for zynq and zynqmp.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agozynqmp: gpio: Add support for zynqmp gpio modepin driver
T Karthik Reddy [Thu, 21 Oct 2021 09:04:06 +0000 (03:04 -0600)] 
zynqmp: gpio: Add support for zynqmp gpio modepin driver

ZynqMP modepin driver has capability to get/set/check status of modepin
gpios. These modepins are accessed using xilinx firmware. In modepin
register, [3:0] bits set direction, [7:4] bits read IO, [11:8] bits
set/clear IO.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agomtd: spi-nor: Fix SST flash erase issue
T Karthik Reddy [Tue, 9 Nov 2021 12:19:59 +0000 (05:19 -0700)] 
mtd: spi-nor: Fix SST flash erase issue

SST flashes has multi size erase blocks like 8K, 32K and 64K bytes. We
cannot perform a 64KB sector erase on all the blocks, So use 4k sector
erase command to perform an erase operation.
We could enable SPI_FLASH_USE_4K_SECTORS config to use 4K sector erase.
But it will impact erase operation time on all large memory flashes.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agomtd: spi-nor: Fix SST flash protection unlock issue
T Karthik Reddy [Tue, 9 Nov 2021 12:19:58 +0000 (05:19 -0700)] 
mtd: spi-nor: Fix SST flash protection unlock issue

In current implementation WBPR is being written without setting write
enable latch. So fix this issue by setting write enable latch before
accessing WBPR. Also wait till the Write In Progress(WIP) bit is set.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agousb: dwc3: Update REFCLK_FLADJ for frame length adjustment
Ashok Reddy Soma [Wed, 10 Nov 2021 13:58:00 +0000 (06:58 -0700)] 
usb: dwc3: Update REFCLK_FLADJ for frame length adjustment

Remove unwanted condition check for frame length adjustment.

For ZynqMP / Versal the ref clk is set to 20Mhz frequency and it is always
recommended. For 20Mhz frequency the refclk_fladj value should be 0, so
clear bits 21:8 in GFLADJ register.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoarm64: zynqmp: Set qspi tx-buswidth to 4
Amit Kumar Mahapatra [Thu, 11 Nov 2021 13:42:48 +0000 (19:12 +0530)] 
arm64: zynqmp: Set qspi tx-buswidth to 4

In all the ZynqMP & Versal boards dts files tx-buswidth is by default
set to 1. Due to this the framework only issues 1-1-1 write commands to
the GQSPI driver. But the GQSPI controller is capable of handling 1-4-4
write commands, so updated the tx-buswidth to 4 in ZynqMP & Versal boards
dts files. This would enable the spi-nor framework to issue 1-4-4 write
commands instead of 1-1-1. This will increase the tx data transfer rate,
as now the tx data will be transferred on four lines instead on single line.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
3 years agousb: dwc3: Add support to reset usb ULPI phy
T Karthik Reddy [Tue, 2 Nov 2021 11:46:28 +0000 (05:46 -0600)] 
usb: dwc3: Add support to reset usb ULPI phy

When usb PHY initialization is done, the PHY need to be reset. In
dwc3-generic driver we are requesting for corresponding modepin gpio
and toggle it to reset the PHY using modepin gpio driver.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agoxilinx: versal: Fix sdhci node name as per DT
T Karthik Reddy [Tue, 2 Nov 2021 13:06:38 +0000 (07:06 -0600)] 
xilinx: versal: Fix sdhci node name as per DT

Fix the sdhci node name in versal board file as per the name in
device tree and also check for sdhci node as part of backward
compatibility.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agoarm64: versal: Setup spi0 alias to ospi instead of qspi
Michal Simek [Mon, 1 Nov 2021 07:52:38 +0000 (08:52 +0100)] 
arm64: versal: Setup spi0 alias to ospi instead of qspi

OSPI is main memory that's why set it up to 0 alias.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Use reset-gpios instead of reset-gpio in usb node
Michal Simek [Fri, 29 Oct 2021 10:38:00 +0000 (12:38 +0200)] 
arm64: zynqmp: Use reset-gpios instead of reset-gpio in usb node

reset-gpios should be used instead of reset-gpio.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: fix polarity of reset-gpio in zynqmp.dtsi
Piyush Mehta [Thu, 28 Oct 2021 09:52:32 +0000 (15:22 +0530)] 
arm64: zynqmp: fix polarity of reset-gpio in zynqmp.dtsi

This patch updates the polarity of the reset-gpio pin in usb0, and gpio
header file added.

Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
3 years agoarm64: zynqmp: Fix clock reference clock for sc-revB
Michal Simek [Mon, 18 Oct 2021 06:18:38 +0000 (08:18 +0200)] 
arm64: zynqmp: Fix clock reference clock for sc-revB

USB reference clock is at input 2 not 1.

Reported-by: Seth Miers <sethm@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: versal: Align with the latest yaml spec
Michal Simek [Thu, 14 Oct 2021 10:22:16 +0000 (12:22 +0200)] 
xilinx: versal: Align with the latest yaml spec

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: kr260: Add reset support for usb2244
Piyush Mehta [Tue, 5 Oct 2021 13:04:19 +0000 (18:34 +0530)] 
arm64: zynqmp: kr260: Add reset support for usb2244

The USB hub also has a USB-SD controller (usb2244) connected to port 0.
Added i2c expander gpio reset for USB-SD controller (usb2244).

Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
3 years agoarm64: versal: Add PMC I2C node
Sandeep Gundlupet Raju [Sun, 3 Oct 2021 15:37:09 +0000 (09:37 -0600)] 
arm64: versal: Add PMC I2C node

This patch adds node for PMC I2C.

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@xilinx.com>
3 years agodt-bindings: versal: Add new PM_DEV_I2C_PMC macro
Sandeep Gundlupet Raju [Sun, 3 Oct 2021 15:37:08 +0000 (09:37 -0600)] 
dt-bindings: versal: Add new PM_DEV_I2C_PMC macro

Add new macro for PMC I2C power domain.

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@xilinx.com>
3 years agoRevert "zynq: cfi: Fix nor issue for Zynq"
Michal Simek [Tue, 17 Aug 2021 14:11:50 +0000 (16:11 +0200)] 
Revert "zynq: cfi: Fix nor issue for Zynq"

This reverts commit 4bdea3b8b7ec13f6fdb8030b0d069ab7dd147b2b.

The only board which we are testing is zc770-xm012 where this patch is
used. Based on schematics it is M29EW device which is manufactured by
Numonyx 0x89 (Linux kernel is saying Intel).

Device on this board is detected as:
manufacturer is 2
manufacturer id is 0xff
device id is 0xff
device id2 is 0x0
cfi version is 0x3133
size_ratio 1 port 16 bits chip 8 bits

As is visible maufacturer is 2 which is any known one that's why this patch
was forcing max_buf_write_size to 8 likely because of reasons described by
commit c502321c4a1b ("mtd: cfi_flash: Write buffer size adjustment for
M29EW Numonyx devices").

When query data is dump it is visible at offset 0x1a there is already 0x08
which means that max_buf_write_size is correctly setup and this workaround
is not needed anymore.

max_buf_write_size offset 1a /* for offset information */
00 : 51 52 59 02 00 40 00 00 00 00 00 27 36 85 95 05  QRY..@.....'6...
10 : 09 08 0f 03 02 03 03 18 02 00 08 00 01 7f 00 00  ................
20 : 02 00 00 00 00 00 00 00 00 00 00 00 00 b4 f3 3f  ...............?

Just for summary parallel flash on zc770-xm012 is likely incorrectly
detected but max_buf_write_size is setup already to 8 which was the reason
for this patch and there is no need to have this workaround in our tree
because value is setup correctly already.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: Return ENVL_NOWHERE instead of ENVL_UNKNOWN
Mike Looijmans [Fri, 2 Jul 2021 08:28:36 +0000 (10:28 +0200)] 
xilinx: Return ENVL_NOWHERE instead of ENVL_UNKNOWN

The system refuses to boot without any environment, so return ENVL_NOWHERE when
there's nowhere to store the environment instead of ENVL_UNKNOWN.

This fixes that the board won't boot from eMMC when CONFIG_ENV_IS_IN_FAT is not
defined, for example. Similar for other combinations.

Fixes: 1025bd098aa8 "xilinx: zynqmp: Add support for saving variables"
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoARM: zynq: Remove undocumented DT properties for nand/nor/smcc
Michal Simek [Wed, 15 Sep 2021 14:20:27 +0000 (16:20 +0200)] 
ARM: zynq: Remove undocumented DT properties for nand/nor/smcc

These properties are not listed in dt-bindings and also not used by the
driver itself in U-Boot and Linux. That's why remove them completely.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Sync locations of ams/dpsub/dpdma for zcu100
Michal Simek [Wed, 15 Sep 2021 14:38:03 +0000 (16:38 +0200)] 
arm64: zynqmp: Sync locations of ams/dpsub/dpdma for zcu100

Just sync locations of DT node for easier comparison among others.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Define all eeproms for SC on vck190
Michal Simek [Mon, 6 Sep 2021 13:49:48 +0000 (15:49 +0200)] 
arm64: zynqmp: Define all eeproms for SC on vck190

There are multiple eeproms on vck190 that's why list all of them.
FMC eeproms are present only when fmcs are plugged.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: versal: Add device tree node for BBRAM and volatile user keys
Harsha [Tue, 5 Oct 2021 11:21:06 +0000 (16:51 +0530)] 
arm64: versal: Add device tree node for BBRAM and volatile user keys

This patch adds the device tree node for BBRAM and volatile user keys.

Signed-off-by: Harsha <harsha.harsha@xilinx.com>
3 years agodwc3: versal: Move GFLADJ adjustment logic to dwc3-generic-host
Ashok Reddy Soma [Fri, 24 Sep 2021 08:31:20 +0000 (02:31 -0600)] 
dwc3: versal: Move GFLADJ adjustment logic to dwc3-generic-host

USB host driver moved to use "dwc3-generic-host" from old "xhci-dwc3" as
per commit b575e909168c ("usb: dwc3-generic: add a new host driver that
uses the dwc3 core").

Move frame length adjustment functionality of GFLADJ which was added with
commit 6e51fd18863d ("dwc3: versal: Correct the logic for GFLADJ
adjustment") to new "dwc3-generic-host" driver.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agoarm64: versal: Modify CAN interrupt sensitive to level
Srinivas Neeli [Tue, 21 Sep 2021 09:55:07 +0000 (15:25 +0530)] 
arm64: versal: Modify CAN interrupt sensitive to level

CAN controller generates a level-sensitive system interrupt.
So updating sensitive field with level.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
3 years agommc: zynq_sdhci: Add xilinx_pm_request weak function
T Karthik Reddy [Tue, 21 Sep 2021 12:02:28 +0000 (06:02 -0600)] 
mmc: zynq_sdhci: Add xilinx_pm_request weak function

Mini emmc does not use any pmufw and ZYNQMP_FIRMWARE is disabled.
xilinx_pm_request() will not be compiled and causes undefined reference to
`xilinx_pm_request' error. So add a weak function in zynq_sdhci.c file.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoRevert "arm64: zynqmp: Add zynqmp firmware specific DT nodes"
T Karthik Reddy [Tue, 21 Sep 2021 12:02:27 +0000 (06:02 -0600)] 
Revert "arm64: zynqmp: Add zynqmp firmware specific DT nodes"

This reverts commit cebe32de39f7272630b6dfba26c30b147aac3c6d.

As zynqmp mini emmc does not rely on firmware, remove firmware related
device tree modes from zynqmp mini emmc dts files.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoRevert "arm64: xilinx: Set CONFIG_ZYNQMP_FIRMWARE config for mini emmc"
T Karthik Reddy [Tue, 21 Sep 2021 12:02:26 +0000 (06:02 -0600)] 
Revert "arm64: xilinx: Set CONFIG_ZYNQMP_FIRMWARE config for mini emmc"

This reverts commit 90fef1865d5ee81190b1f3ac555f3ca7c007ba0d.

Disable CONFIG_ZYNQMP_FIRMWARE config from zynqmp & versal mini emmc
defconfig files, as mini emmc does not use any firmware.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agowatchdog: versal: Add support for expire now
Ashok Reddy Soma [Thu, 16 Sep 2021 10:27:30 +0000 (04:27 -0600)] 
watchdog: versal: Add support for expire now

Wdt expire command makes the wdt to count least possible ticks(1)
and expires immediately. Add expire_now option to the xlnx_wwdt_ops
and implement it by calling xlnx_wwdt_start() with minimum possible
count(1).

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agowatchdog: versal: Add support for basic window watchdog
Ashok Reddy Soma [Thu, 16 Sep 2021 10:27:29 +0000 (04:27 -0600)] 
watchdog: versal: Add support for basic window watchdog

Existing driver uses generic watchdog mode which generates a signal to
PLM firmware, but the signal cannot be used to reset the system.

Change driver to use window watchdog basic mode. This window watchdog mode
generates a signal to PLM firmware which decides what action to take upon
expiry of watchdog.

Timeout value for xlnx_wwdt_start will come in milli seconds from wdt
framework. Make changes to load count value accordingly.

Add checks before loading the timer for min and max possible values.

Fix authour email id of Ashok Reddy Soma to long email id.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoclk: versal: Enable only GATE type clocks
T Karthik Reddy [Thu, 16 Sep 2021 10:27:28 +0000 (04:27 -0600)] 
clk: versal: Enable only GATE type clocks

Clocks should be enabled or disabled only if they are of GATE type
clocks. If they are not of GATE type clocks, don't touch them.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoarm64: zynqmp: In sck-kr DTS fix PHY addresses for GEM0 and GEM1
Radhey Shyam Pandey [Tue, 14 Sep 2021 05:47:08 +0000 (05:47 +0000)] 
arm64: zynqmp: In sck-kr DTS fix PHY addresses for GEM0 and GEM1

Inline with sck-kr rev-a schematic, set GEM0 phy address to 0x4
and GEM1 phy address to 0x8.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
3 years agoxilinx: zynqmp: Set modeboot env variable in eMMC bootmode
Ashok Reddy Soma [Mon, 13 Sep 2021 07:18:07 +0000 (01:18 -0600)] 
xilinx: zynqmp: Set modeboot env variable in eMMC bootmode

Set environment variable modeboot to "emmcboot" in case of eMMC boot
mode.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agomtd: spi-nor: Resolve read issue with odd offset at die boundary
T Karthik Reddy [Thu, 9 Sep 2021 10:47:11 +0000 (04:47 -0600)] 
mtd: spi-nor: Resolve read issue with odd offset at die boundary

In dual parallel mode, in case of odd offset. we read data from even
offset instead of odd offset by decrementing odd offset by 1.
In case of flash with multiple dies, a read operation at odd offset at
the end of the boundary, we perform 2 read operations in this case.
First read operation would read 2 bytes(from even offset) from die-1
and copy one byte data to buffer and read remaining data from die-2 and
copy to buffer.
In the first read operation we are incrementing data buffer offset by 2
instead of 1 after copying the one odd byte to the buffer. Due to this the
next read operation data is being shifted by 1 in data buffer. Avoid this
issue by incrementing data buffer by only 1 byte in case of odd offset at
die boundary and also clear the "is_ofst_odd" variable to 0 once odd byte
case is handled.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
3 years agoarm64: zynqmp: Add device tree properties for nand flash
Amit Kumar Mahapatra [Mon, 6 Sep 2021 19:08:22 +0000 (13:08 -0600)] 
arm64: zynqmp: Add device tree properties for nand flash

Add ecc strength & ecc step size properties for nand flash devices,
when operating in software-ecc mode.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
3 years agospi: zynqmp_gqspi: Fix write issue at low frequencies
Ashok Reddy Soma [Mon, 6 Sep 2021 05:17:32 +0000 (23:17 -0600)] 
spi: zynqmp_gqspi: Fix write issue at low frequencies

With automode and current implementation we are seeing write issues at
low frequencies below 15Mhz. Make below changes to fix the issue.

1. Switch genfifo start mode to manual start mode from auto start
2. Remove dummy genfifo entry in zynqmp_qspi_chipselect() which was
   incorrectly added in the past
3. Enable and poll for Gen_FIFO_Empty interrupt status in place of
   Gen_FIFO_not_full. Since manual mode is enabled write to genfifo first
   and then wait for the Gen_FIFO_Empty interrupt status.
4. Enable and poll for TX_FIFO_Empty after Tx data is filled in FIFO in
   zynqmp_qspi_fill_tx_fifo(). Remove genfifo manual start before txfifo
   fill.

Note: Adding this patch in a state which was intensively tested. There is
likely no need to enable interrupts. But this chagne will be done in a
separate patch.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agomtd: spi-nor: Remove SPI_FLASH_STMICRO #if defined directive
T Karthik Reddy [Mon, 30 Aug 2021 10:29:34 +0000 (04:29 -0600)] 
mtd: spi-nor: Remove SPI_FLASH_STMICRO #if defined directive

Resolve compilation error when building with zynq_cse_nor & zynq_cse_nand
defconfig files. Below error is due to undefined SPI_FLASH_STMICRO config
and micron_octal_ddr_enable() not being compiled.

drivers/mtd/spi/spi-nor-core.c:2717:27: error: 'micron_octal_ddr_enable'
undeclared (first use in this function)
2717 |   nor->octal_ddr_enable = micron_octal_ddr_enable;

So remove the SPI_FLASH_STMICRO #if defined directive to compile
micron_octal_ddr_enable() with above defined defconfig files.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
3 years agoarm64: zynqmp: Add support for kr260 revA board
Michal Simek [Fri, 6 Aug 2021 14:10:36 +0000 (16:10 +0200)] 
arm64: zynqmp: Add support for kr260 revA board

Board is using kv260 design for couple of parts defined by spec like i2c
eeproms, ina260, uart, etc.

Board has 4 gems. One gem connected via PS SGMII(GT), another PS RGMII(MIO)
and 2 via EMIO. First two shares the same MIO lines for PHYs. PL based one
have separate EMIO lines via PL.

Also two USB 3.0 with usb hubs are present. USB phys and USB hubs should
have separate reset line. The first usb0 hub also has USB-SD controller
(usb2244) connected to port 0.

To test compatibility with k26 you can run:
fdtoverlay -o /tmp/output.dtb -i arch/arm/dts/zynqmp-sm-k26-revA.dtb \
arch/arm/dts/zynqmp-sck-kr-g-revA.dtbo

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoxilinx: zynqmp: Generate different u-boot.itb for MULTI_DTB_FIT
Michal Simek [Thu, 19 Aug 2021 10:02:57 +0000 (12:02 +0200)] 
xilinx: zynqmp: Generate different u-boot.itb for MULTI_DTB_FIT

When MULTI_DTB_FIT is enabled fit-dtb.blob fit image is created which
contain all DTBs listed by CONFIG_OF_LIST. And with DTB_RELESELECT there is
a need to handle it as one file with DTBs in it not as separate DTBs in
u-boot.its/itb.
That's why extend mkimage_fit_atf.sh to generate u-boot.itb correctly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agoarm64: zynqmp: Add support for 64bit addresses in its
Michal Simek [Mon, 7 Jun 2021 10:37:32 +0000 (12:37 +0200)] 
arm64: zynqmp: Add support for 64bit addresses in its

Xilinx ZynqMP supports also addresses above 4GB (32bit) that's why also
generate u-boot.its with 64bit load/entry addresses to also support
different configurations.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 years agozynqmp: Generate u-boot.its also with TEE dynamically
Michal Simek [Mon, 31 May 2021 09:13:45 +0000 (11:13 +0200)] 
zynqmp: Generate u-boot.its also with TEE dynamically

The first change is to trying to find out TF-A load address based on
reading elf file. Expectation is that bl31.bin is in the same folder as
bl31.elf. It brings new flexibility to place TF-A to any address (DDR
included).

And also enable TEE generation also with TEE configuration.
Expecation is the same as above that tee.bin and tee.elf are in the same
folder.

User has to just define link to BL31/BL32 binary files and the rest should
be handled by the script.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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]
3 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>
3 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>
3 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>
3 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>
3 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

3 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

3 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

3 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

3 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>
3 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

3 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

3 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

3 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>
3 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>
3 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>