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>
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>
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>
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>
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.
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>
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>
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.
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>
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>
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>
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>
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).
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.
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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
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
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>;
};
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>
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.
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.
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>
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>
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.
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
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.
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.
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.
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.
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.
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>
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>
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.
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)
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.
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.
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().
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.
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.
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.
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.