mmc: Work in UHS modes even if card already switched to UHS
This patch adds support for swicthing to UHS mode even if
the card already switched to UHS modes.
This patch fixes an issue where it is not able to power
cycle the SD card. Due to this once the card is initialized
in UHS-I mode it cannot be reinitialized in UHS-I mode again.
So to solve this issue there are some checks that are made in
place to ensure that the card operates in UHS-I mode even on
reinitialization. This will enable the SD host controller to
run SD at 200MHz in uboot even if the bootloader was running
at 200MHz.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Increase init ram size by 4K such that more
stack space will be available during intialization
as the present stackspace is not sufficient if DEBUG
option is enabled and causes system hang.
Increasing init ram size provides sufficient stack space
during init even if DEBUG enabled and solves the hange
issue.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
The .read_rom_hwaddr net_ops hook does not check the return value, which
is why it was never caught that we are currently returning 0 if the
read_rom_hwaddr function return -ENOSYS and -ENOSYS otherwise.
In this case we can simplify this by just returning the result of the
function.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Tue, 18 Jul 2017 07:32:24 +0000 (09:32 +0200)]
test: py: Fix global variable usage in nand test
This patch fixes these warnings:
items/home/monstr/data/disk/u-boot/test/py/tests/test_nand.py:81:
SyntaxWarning: name 'total_size' is assigned to before global
declaration
global total_size
/home/monstr/data/disk/u-boot/test/py/tests/test_nand.py:90:
SyntaxWarning: name 'nand_detected' is used prior to global declaration
global nand_detected
items/home/monstr/data/disk/u-boot/test/py/tests/test_qspi.py:58:
SyntaxWarning: name 'qspi_detected' is used prior to global declaration
global qspi_detected
Global declaration should be prior usage.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 30 Jun 2017 06:56:20 +0000 (08:56 +0200)]
arm64: zynqmp: Add psu_init for zcu100-revC
RevC has 2GB memory and this is needed for configuration.
There were two warnings which were fixed as the part of this patch.
board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c: In function
‘psu_ddr_phybringup_data’:
board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c:20205:15: warning:
unused variable ‘tmp_regval’ [-Wunused-variable]
unsigned int tmp_regval = 0;
^~~~~~~~~~
At top level:
board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c:20514:13: warning:
‘dpll_prog’ defined but not used [-Wunused-function]
static void dpll_prog(int ddr_pll_fbdiv, int d_lock_dly, int
d_lock_cnt,
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Stefan Agner [Tue, 20 Dec 2016 14:58:45 +0000 (15:58 +0100)]
cmd: fdt: Print error message when fdt application fails
There are lots of reason why a FDT application might fail, the
error code might give an indication. Let the error code translate
in a error string so users can try to understand what went wrong.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Simon Glass <sjg@chromium.org>
David Gibson [Tue, 20 Dec 2016 14:58:44 +0000 (15:58 +0100)]
libfdt: Correct fdt handling of overlays without fixups and base trees without symbols
The fdt_overlay_apply() function purports to support the edge cases where
an overlay has no fixups to be applied, or a base tree which has no
symbols (the latter can only work if the former is also true). However it
gets it wrong in a couple of small ways:
* In the no fixups case, it doesn't fail immediately, but will attempt
fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
offset, which will fail. Instead it should succeed immediately, since
there's nothing to do.
* In the case of no symbols, it again doesn't fail immediately. However
if there is an actual fixup it will fail with an unexpected error,
because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
look up the symbols. We should instead return -FDT_ERR_NOTFOUND
directly.
Both of these errors lead to the code returning misleading error codes in
failing cases.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Simon Glass <sjg@chromium.org>
Michal Simek [Wed, 12 Jul 2017 09:25:49 +0000 (11:25 +0200)]
arm64: zynqmp: Add mini u-boot configuration with mtest
The purpose of this configuration is to run u-boot out of OCM which
memory test enabled. This is used for platform bringup for running DDR
memory test.
This configuration is reusing setting for MINI QSPI.
Also prepare zynqmp-mini folder where psu_init_gpl* should be added if
mini u-boot configuration should configure the whole SoC.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 12 Jul 2017 09:20:58 +0000 (11:20 +0200)]
arm64: zynqmp: Do not unset options which are not used
There is no need to remove memtest start/end. It is used only when mtest
command is enabled which is not the case for existing mini zynqmp
configurations.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynqmp: Remove ifdef around zynqmp mmio read and write rotuines
This patch removes ifdef around mmio read and write rotuines
and make them a single routine by checking the current el.
This patch helps to remove ifdef around invoke_smc as well.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynqmp: Provide a Kconfig option to use specified memory for MMU table
This patch provides a Kconfig option to use specified
memory for MMU table using reserve_mmu platform specific
routine. Here we used TCM space for MMU table.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
spi: zynqmp_qspi: Send dummy cycles separately as per dummy bytes
Add dummy cycles as separte entry in generic fifo by breaking
the cmd+address+dummy into cmd+address as one entry and dummy
as another entry.
As per controller spec, immediate data filled as dummy entry
in generic fifo represent dummy cycles.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
spi: spi_flash: Add dummy bytes info to spi slave structure
This patch adds and fills dummy bytes in spi_slave structure
to inform driver as driver needs to be aware of number of
dummy cycles that need to be sent.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 12 Jul 2017 07:23:21 +0000 (09:23 +0200)]
zynqmp: zcu104: Update dts based on u-boot detection
- update i2c addresses
- irps5401 address assignment can wrong in connection to part assigning
- tca6416 not detected
- update qspi part information
- use qspi as single device
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dts: zynqmp_mini: Add dts files for all mini u-boot qspi configurations
This patch adds dts files for all qspi configurations of ZynqMP mini
u-boot. This lets user to compile the required qspi configuration
image by specifying the DEVICE_TREE=<dts filename> along with make.
This patch renames zynqmp-mini-qspi dts to dtsi so that
it will be used in respective dts files. This also
needs to update defconfig and make files respectively
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dts: zynq_cse: Add dts files for all mini u-boot qspi configurations
This patch adds dts files for all qspi configurations of mini
u-boot. This lets user to compile the required qspi configuration
image by specifying the DEVICE_TREE=<dts filename> along with make.
This patch also renames zynq-cse-qspi dts to dtsi so that
it will be used in respective dts files. This also
needs to update defconfig and make files respectively.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: zynqmp: Add separate boot command for EMMC boot
Set modeboot to 'emmcboot' when booting from EMMC. For now, this command
still runs sdboot underneath so effectively nothing changes for the
default environment, however having a separate modeboot makes it much
easier to use custom boot commands in real life scenarios where actual
differentiation between SD boot and EMMC boot is required.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: zynqmp: Add no-1-8-v property to sdhci node (zcu106)
This patch add no-1-8-v property to sdhci node and this
property helps to avoid going to SD3.0. This is needed
for zcu106 as it seems to be causing an issue on some
boards and hence added this as workaround until it
is rootcaused and fixed.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 28 Jun 2017 13:40:32 +0000 (15:40 +0200)]
arm64: zynqmp: Fix SVD mask for getting chip ID
Mask should start from the first bit - using 0xe is just wrong.
3bits are used that's why 0x7 mask is correct.
This patch is fixing silicon ID code detection. Previous behavior was
that bit0 was completely ignored.
Issue was found on 2eg chip detection.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 25 May 2017 13:08:36 +0000 (15:08 +0200)]
arm64: zynqmp: Enable IIO hwmon sensors
Wire PS ams sensors with hwmon sensors to have quick way how to read
information about chip from sensors tools and others(gkrellm).
Using iio-hwmon is deprecated but still valid option how to do it.
When iio framework is better integrated in standard tools this should be
changed.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 1 Jun 2017 06:11:42 +0000 (08:11 +0200)]
arm64: zynqmp: Remove kim and btwilink from zcu100 revB
kim and btwilink are obsolete drivers and they shouldn't be used.
Record bt_power led via gpio-leds driver to simplify bt
enabling/disabling handling via sysfs which exactly points to certain
gpio which is also allocated for this purpose.
By default enable BT at startup time.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: xilinx_axi: Add axi ethernet support on Zynq and ZynqMP
This patch adds support of axi ethernet for Zynq and ZynqMP
platforms. The endianess conversion is not needed here and
hence io operations are performed using writel and readl
directly for Zynq and ZynqMP.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
net: xilinx_axi: Read dma address using fdtdec_get_addr
Read dma address using fdtdec_get_addr as it checks for
address cells and size cells and reads the adddress
properly. fdtdec_get_int always assume address is of int
size which goes wrong if using it on 64-bit architecture.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Tue, 20 Jun 2017 14:21:14 +0000 (16:21 +0200)]
arm64: zynqmp: Add support for Xilinx zc1232 board
This patch adds support for Xilinx zc1232 board.
The defconfig for compilation is xilinx_zynqmp_zc1232_revA_defconfig
Only QSPI(single) and uarts are wired on this board.
Sata is enabled based on request because it is connected to
Bullseye headers (4-lane GT cable header to SMA cables) where
a SMA-to-SATA adapter can be connected to get sata to work.
Add __maybe_unused attribute to dpll_prog and psu_init_xppu_aper_ram
to avoid compilation warnings.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
mmc: Set buswidth before switching the timing mode
Buswidth should be set before performing timing mode switch
incase of HS200 and hence not required to set buswdith again
after switch to HS200. This patch solves the issue timing
mode switch failure in some scenarios.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
lib: fdtdec: Fill initial ram top with DDR start value from dt
Fill initial ram top with DDR base addr value from DT as not filling
it here always assumes it as zero while calculating relocation
offset and hence lead to failures in somecases. This will assumed
as zero if CONFIG_SYS_SDRAM_BASE is not defined.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
fpga: zynqmp: Add support to use devicekey for encrypted bitstreams
Add support to use devicekey for loading encrypted bitstreams.
Getting keyaddr and size values of 0xFFFFFFFF determines it to
use devicekey(like efuse) and there by update appropriate flag
before invoking smc.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
cmd: fpga: Update loads command help to handle devicekey support
This patch updates the fpga loads command help to handle a case
where user wants to use devicekey for loading encrypted bitstreams
instead of userkey. The key address and size should be sent as
0xFFFFFFFF to let fpga driver to use devicekey.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Fixes the below warning
drivers/net/zynq_gem.c: In function ‘zynq_gem_init’:
drivers/net/zynq_gem.c:463:2: warning: this ‘if’ clause
does not guard... [-Wmisleading-indentation]
if (!priv->emio)
^~
drivers/net/zynq_gem.c:469:3: note: ...this statement,
but the latter is misleadingly indented as if it
is guarded by the ‘if’
if (IS_ERR_VALUE(ret))
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 29 May 2017 07:11:32 +0000 (09:11 +0200)]
ARMv8: Add support for poweroff via PSCI
Add support for calling poweroff in case of psci is wired.
Based on the same solution as is used for reset.
Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Move all logic in to fwcall.c as other ARMs implement poweroff
via PMIC] Signed-off-by: Tom Rini <trini@konsulko.com>
Michal Simek [Thu, 2 Mar 2017 10:02:55 +0000 (11:02 +0100)]
arm64: zynqmp: Add comment about level shifter mode v1
Silicon v1 didn't support SD boot mode with level shifter.
Because system can't boot any error message is not shown
that's why comment is just a record if someone tries to debug it.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
dts: zynqmp: Add maximum-speed property to dwc3 node
Add maximum-speed property to dwc3 node of zcu102 dts
This property needs to defined as per latest USB DM
patches. This fixes the issue of usb on zcu102
board.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 22 May 2017 07:15:33 +0000 (09:15 +0200)]
arm64: Add NOLOAD attribute NOLOAD to .bss sections
Mark explicitly bss sections to not be loaded at
run time.
The similar patch was done in past by:
"Fix linker scripts: add NOLOAD atribute to .bss/.sbss sections"
(sha1: 64134f011254123618798ff77c42ba196b2ec485)
The problem is related to latest toolchain added to Xilinx
v2017.1 design tools where jtag loader is trying to access
ununitialized memory.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This needs to be reverted as we still have to support these
targets for supporting zynq mini u-boot which will be used
for vivado programming.
Removed untested targets cse nand and cse nor.
Along with this below changes are required for cse qspi to
work properly.
1. Use DCC for zynq cse qspi target as this will
be used for programming purpose which may not
have serial hence DCC by default.
2. Remove unnecessary configs for QSPI as defining them
increases size for u-boot to run from OCM.
3. Define init stack pointer for cse qspi to avoid memory
corruption while relocating in OCM.
4. Add missing chosen node for cse qspi.
5. Enable SPL for cse_qspi target
Changes to get SPL working for cse_qspi target
a. BSS needs to be moved to OCM as DDR may not be
present for cse_qspi targets.
b. Provide sym link to ps7_init of zc706.
6. Disable bootdelay via Kconfig
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Tue, 23 May 2017 06:17:38 +0000 (08:17 +0200)]
arm64: zynqmp: Setup MIO34 to be routed to PMUFW
MIO34 is connected to kill signal which shutdown the board.
This change enables calling poweroff from u-boot.
poweroff worked from Linux because pinmuxing driver was changing it
but this change is necessary to be done in psu_init phase too.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 25 May 2017 14:08:43 +0000 (16:08 +0200)]
arm64: zynqmp: Add empty sleep.h file for psu_init* compilation
psu_init* contain sleep.h header which is not present in u-boot.
Instead of keep comment sleep.h in psu_init* it is easier to add empty
file which is included.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq: Kconfig: Add Kconfig option for any DDR specific initialization
Add Kconfig option for ddr init as this might be required
in cases like ddr less systems where we want to skip ddrc
init and this option is useful for it.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 11 May 2017 12:52:57 +0000 (14:52 +0200)]
arm64: zynqmp: Do not use dot in platform defconfig
Python testing framework is not able to handle dot in name.
Different modules needs to be used.
That's why better change name to be aligned without dot in name.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 11 May 2017 11:53:45 +0000 (13:53 +0200)]
test: py: Disable sleep test for qemu targets
Qemu for arm32/arm64 has a problem with time setup.
That's why sleep test is failing. Add boardidentity marker to remove
specific boards from running that test.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Thu, 11 May 2017 11:40:28 +0000 (13:40 +0200)]
test: py: Also support detect capacity which is only one digit
If capacity is without dot "Capacity: 4 GiB" then current algorithm
was not able to detect it. Add or to regular expression to detect
capacity without dot.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Wed, 3 May 2017 14:22:30 +0000 (16:22 +0200)]
arm64: zynqmp: Remove CPU_RELEASE_ADDR macro
CPU_RELEASE_ADDR is used only when CONFIG_ARMV8_MULTIENTRY
is enabled. ZynqMP is running ATF which takes care about this
that's why no need to have this macro.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
nand: zynq: Send address cycles as per onfi parameter page
Send address cycles as per value read from onfi parameter
page for Read and write commands instead of using a
hard coded value. This may vary for different parts and
hence use it from onfi parameter page value.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This patch corrects the mtd initialization. With out this, it
results in wrong zynq_nand_info and nand_chip extraction and
hence failed nand operations. This patch fixes the issue of
nand on zynq boards.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Fix for : Seeing multiple 'INIT: Id "X0" respawning too fast: disabled for 5 minutes' messages and changing dom0_mem.
Some consoles mentioned in inittab are not present on the device. We get
the above message when inittab keeps respawning such a console.
Added SERIAL_CONSOLES_CHECK to meta-xilinx layer, which will check
for available consoles by reading /proc/consoles and remove non
existent consoles. This check removes hvc0 when booted via tftp
since /proc/consoles has xen0 and not hvc0. This patch fixes this
issue by renaming xen0 to hvc0 in /proc/consoles.
Renaming dom0-bootargs console to hvc0 and changing dom0_mem to be
consistant with petalinux configuration for tftp boot.
Signed-off-by: Bhargava Sreekantappa Gayathri <bhargava.sreekantappa-gayathri@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This patch adds support for ondie ecc. As of now
this adds support for micron parts which supports
ondie ecc.
Didnt found any better way to detect ondie ecc
support by a device except sorting out with
manufacture and device id's.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
zynq: Kconfig: Dont enable unnecessary configs by default
Dont enable unnecessary configs by default, instead enable
the required ones through defconfig. This patch moves configs
DM_ETH, DM_MMC, DM_MMC_OPS, BLK, GPIO to defconfigs. This saves
memory for memory constrained boards.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arm64: zynqmp: spl: fix dual SD controller support
When enabling both SDHCI controllers, spl_mmc.c would actually choose
device sdhci0 even if booted from sdhci1 (boot_device). This is because
spl_mmc_get_device_index(boot_device) expects BOOT_DEVICE_MMC2[_2] in
order to return index 1 instead of 0.
The #if defined(...) statement is copied from board/xilinx/zynqmp/zynqmp.c
So the key to properly enabling both controllers as boot sources is
defining both CONFIG_ZYNQ_SDHCI0 and CONFIG_ZYNQ_SDHCI1 in your board's
include/configs/*.h.
Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>