]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
8 years agoARM64: zynqmp: Remove unused ARM_SMC macro
Michal Simek [Fri, 16 Dec 2016 07:57:42 +0000 (08:57 +0100)] 
ARM64: zynqmp: Remove unused ARM_SMC macro

There is no reference in the code anymore. Remove it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: zynq: Remove unused afx targets
Michal Simek [Fri, 16 Dec 2016 07:41:04 +0000 (08:41 +0100)] 
ARM: zynq: Remove unused afx targets

AFX targets are not tested regularly and by moving stuff to Kconfig
these platforms are likely broken. Remove them from the tree.
If there is any request to get them back testing platform needs to be
prepared and images should be validated.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: zynq: Remove unused cse targets
Michal Simek [Fri, 16 Dec 2016 07:39:38 +0000 (08:39 +0100)] 
ARM: zynq: Remove unused cse targets

CSE targets are not tested regularly and by moving stuff to Kconfig
these platforms are likely broken. Remove them from the tree.
If there is any request to get them back testing platform needs to be
prepared and images should be validated.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM64: zynqmp: Disable QSPI for zcu100-revB
Michal Simek [Thu, 15 Dec 2016 12:45:11 +0000 (13:45 +0100)] 
ARM64: zynqmp: Disable QSPI for zcu100-revB

RevB has no QSPI connected that's why remove it from defconfig.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoimage-fit: Fix fit_get_node_from_config semantics
Paul Burton [Tue, 20 Sep 2016 17:17:12 +0000 (18:17 +0100)] 
image-fit: Fix fit_get_node_from_config semantics

Commit bac17b78dace ("image-fit: switch ENOLINK to ENOENT") changed
fit_get_node_from_config to return -ENOENT when a property doesn't
exist, but didn't change any of its callers which check return values.
Notably it didn't change boot_get_ramdisk, which leads to U-Boot failing
to boot FIT images which don't include ramdisks with the following
message:

  Ramdisk image is corrupt or invalid

It also didn't take into account that by returning -ENOENT to denote the
lack of a property we lost the ability to determine from the return
value of fit_get_node_from_config whether it was the property or the
configuration node that was missing, which may potentially lead callers
to accept invalid FIT images.

Fix this by having fit_get_node_from_config return -EINVAL when the
configuration node isn't found and -ENOENT when the property isn't
found, which seems to make semantic sense. Callers that previously
checked for -ENOLINK are adjusted to check for -ENOENT, which fixes the
breakage introduced by commit bac17b78dace ("image-fit: switch ENOLINK
to ENOENT").

The only other user of the return fit_get_node_from_config return value,
indirectly, is bootm_find_os which already checked for -ENOENT. From a
read-through of the code I suspect it ought to have been checking for
-ENOLINK prior to bac17b78dace ("image-fit: switch ENOLINK to ENOENT")
anyway, which would make it right after this patch, but this would be
good to get verified by someone who knows this x86 code or is able to
test it.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Jonathan Gray <jsg@jsg.id.au>
Cc: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: George McCollister <george.mccollister@gmail.com>
Tested-by: George McCollister <george.mccollister@gmail.com>
8 years agoMerge tag 'v2016.09' into master
Michal Simek [Thu, 15 Dec 2016 12:22:01 +0000 (13:22 +0100)] 
Merge tag 'v2016.09' into master

Prepare v2016.09

- Fix fpga part in spl_mmc (use mmc_get_blk_desc(mmc)
  instead of &mmc->block_dev
- Fix dependencies in defconfig

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM64: zynqmp: Replace board specific with generic memory bank decoding
Nathan Rossi [Sat, 10 Dec 2016 13:20:36 +0000 (23:20 +1000)] 
ARM64: zynqmp: Replace board specific with generic memory bank decoding

The dram_init and dram_init_banksize functions were using a board
specific implementation for decoding the memory banks from the fdt. This
board specific implementation uses a static variable 'tmp' which makes
these functions unsafe for execution from within the board_init_f
context.

This change makes the dram_init* functions use a generic implementation
of decoding and populating memory bank and size data.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Fixes: 8d59d7f63b ("ARM64: zynqmp: Read RAM information from DT")
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM: zynq: Replace board specific with generic memory bank decoding
Nathan Rossi [Thu, 8 Dec 2016 15:47:48 +0000 (01:47 +1000)] 
ARM: zynq: Replace board specific with generic memory bank decoding

The dram_init and dram_init_banksize functions were using a board
specific implementation for decoding the memory banks from the fdt. This
board specific implementation uses a static variable 'tmp' which makes
these functions unsafe for execution from within the board_init_f
context.

This unsafe use of a static variable was causing a specific bug when
using the zynq_zybo configuration, U-Boot would generate the following
error during image load. This was caused due to dram_init overwriting
the relocations for the 'image' variable within the do_bootm function.
Out of coincidence the un-initialized memory has a compression type
which is the same as the value for the relocation type R_ARM_RELATIVE.

   Uncompressing Invalid Image ... Unimplemented compression type 23

It should be noted that this is just one way the issue could surface,
other cases my not be observed in normal boot flow. Depending on the
size of various sections, and location of relocations within __rel_dyn
and the compiler/linker the outcome of this bug can differ greatly.

This change makes the dram_init* functions use a generic implementation
of decoding and populating memory bank and size data.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Fixes: 758f29d0f8 ("ARM: zynq: Support systems with more memory banks")
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agofdt: add memory bank decoding functions for board setup
Nathan Rossi [Thu, 8 Dec 2016 15:47:28 +0000 (01:47 +1000)] 
fdt: add memory bank decoding functions for board setup

Add two functions for use by board implementations to decode the memory
banks of the /memory node so as to populate the global data with
ram_size and board info for memory banks.

The fdtdec_setup_memory_size() function decodes the first memory bank
and sets up the gd->ram_size with the size of the memory bank. This
function should be called from the boards dram_init().

The fdtdec_setup_memory_banksize() function decode the memory banks
(up to the CONFIG_NR_DRAM_BANKS) and populates the base address and size
into the gd->bd->bi_dram array of banks. This function should be called
from the boards dram_init_banksize().

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Michal Simek <monstr@monstr.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agoARM64: zynqmp: List secondary software boot modes
Michal Simek [Wed, 26 Oct 2016 07:24:32 +0000 (09:24 +0200)] 
ARM64: zynqmp: List secondary software boot modes

Using alternative bootmode field to support automatic secondary boot
modes. It is purely software setting where SW modes are using free
bootmode combinations.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agozynqmp: mini: Add mini uboot support for eMMC
Siva Durga Prasad Paladugu [Tue, 13 Dec 2016 14:28:46 +0000 (19:58 +0530)] 
zynqmp: mini: Add mini uboot support for eMMC

Add mini uboot support for eMMc, in which both
sd controllers were enabled, dcc is used for
uart.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agotools: mkimage: Extend mkimage to also include pmufw
Michal Simek [Fri, 21 Oct 2016 10:58:17 +0000 (12:58 +0200)] 
tools: mkimage: Extend mkimage to also include pmufw

This is generated command line when PMUFW_INIT_FILE is setup.

./tools/mkimage -T zynqmpimage -R ./"" -n
./"board/xilinx/zynqmp/pmufw.bin" -d spl/u-boot-spl.bin spl/boot.bin

pmufw has to be in binary format and mkimage is using dynamic
header size generation without using calloc function based on pmufw
size. Boot.bin header is filled with pmufw size and pmufw is copied to
header data section. When header is generated mkimage append
u-boot-spl.bin.

This patch also add pmufw to the u-boot tree with enabling it for zcu100
and zcu102.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
8 years agotools: mkimage: Use fstat instead of stat to avoid malicious hacks
Michal Simek [Tue, 6 Dec 2016 15:38:13 +0000 (16:38 +0100)] 
tools: mkimage: Use fstat instead of stat to avoid malicious hacks

The patch is fixing:
"tools: mkimage: Check if file is regular file"
(sha1: 56c7e8015509312240b1ee15f2ff74510939a45d)
which contains two issues reported by Coverity
Unchecked return value from stat and incorrect calling sequence where
attack can happen between calling stat and fopen.
Using pair in opposite order (fopen and fstat) is fixing this issue
because fstat is using the same file descriptor (FILE *).

Also fixing issue with:
"tools: mkimage: Add support for initialization table for Zynq and
ZynqMP" (sha1: 3b6460809c2a28360029c1c48247648fac4455c9)
where file wasn't checked that it is regular file.

Reported-by: Coverity (CID: 154711, 154712)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agoARM64: zynqmp: Add psu_init_gpl* files for zcu100 revB
Michal Simek [Thu, 1 Dec 2016 14:38:26 +0000 (15:38 +0100)] 
ARM64: zynqmp: Add psu_init_gpl* files for zcu100 revB

Taken from zcu100 HW repo.
"revB: just_ps: PSU init files corresponding to TCL"
(sha1: 2d2753c19b6cc7572faaa7024e7ef79862ce5fbc)

with sleep.h and prog_reg() commented.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zcu100: Correct GT Ref clock source
Nathalie Chan King Choy [Wed, 9 Nov 2016 21:45:06 +0000 (13:45 -0800)] 
ARM64: zcu100: Correct GT Ref clock source

Choose ref clock sources to match ZCU100 schematic.

Signed-off-by: Nathalie Chan King Choy <nathalie@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: psu_init for zcu100 w/ 2016.3_1110
Nathalie Chan King Choy [Mon, 7 Nov 2016 22:24:36 +0000 (14:24 -0800)] 
ARM64: zynqmp: psu_init for zcu100 w/ 2016.3_1110

Created a zcu100 design with just PS block (no PL) using 2016.3_1110, which
is supposed to be the 2016.3 released version.  Added the psu_init_gpl.*
changes, except for those which remove the changes from Michal's commit
having the DDR init "ARM64: zynqmp: Fix ddr init for zcu100"
(sha1: 0973da9e42cfec4146baa09d94d0b9b9d24952f7).

This patch is breaking USB but following up fixes it.

sleep.h and prog_reg() were commented. This should be fixed in v2017.1.

Signed-off-by: Nathalie Chan King Choy <nathalie@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add updated psu_init_gpl* files for zcu102
Michal Simek [Wed, 30 Nov 2016 10:09:56 +0000 (11:09 +0100)] 
ARM64: zynqmp: Add updated psu_init_gpl* files for zcu102

With origin files there was an issue with serdes setting for SCSI.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add support for zcu100-revB board
Michal Simek [Thu, 24 Nov 2016 09:42:43 +0000 (10:42 +0100)] 
ARM64: zynqmp: Add support for zcu100-revB board

Move revA to own configuration to be able to run it and use it.
In this patch there are no psu_init_gpl* files for SPL yet.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Use DTS name for different psu_init_gpl* files in SPL
Michal Simek [Tue, 29 Nov 2016 11:03:51 +0000 (12:03 +0100)] 
ARM64: zynqmp: Use DTS name for different psu_init_gpl* files in SPL

CONFIG_SYS_CONFIG_NAME is not proper config option for different low
level init files because different board revisions requires different
psu_init_gpl* files.

Also at the end of moving drivers to DM all board specific configuration
files should be removed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix secondary bootmode enabling
Michal Simek [Tue, 25 Oct 2016 09:43:02 +0000 (11:43 +0200)] 
ARM64: zynqmp: Fix secondary bootmode enabling

Do not setup use_alt bit which copy alternative boot mode to
boot mode. The reason is that this bit is cleared after POR
but not after any software reset which will cause
that after SW reset bootrom will look for different boot image.

This patch setups alternative boot mode selection (purely SW
handling) and extends code to read this alternative boot mode first and
use it if it is setup.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Enable SPL for zcu106
Michal Simek [Mon, 28 Nov 2016 09:39:00 +0000 (10:39 +0100)] 
ARM64: zynqmp: Enable SPL for zcu106

psu_init* files are taken from early design and sleep.h
and prog_reg() are commented out.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoconfigs: zynqmp: Add support to save env to FAT
Siva Durga Prasad Paladugu [Fri, 18 Nov 2016 04:57:48 +0000 (10:27 +0530)] 
configs: zynqmp: Add support to save env to FAT

Add support to save environment as a file of FAT filesystem
on to SD card. The file will be saved with name uEnv.txt.
This environment will be retrieved during boot.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoconfigs: zynqmp: Increase environment size to 32K
Siva Durga Prasad Paladugu [Fri, 18 Nov 2016 04:57:47 +0000 (10:27 +0530)] 
configs: zynqmp: Increase environment size to 32K

Increase environment size to 32K as the current default
environment itself is greater than 4K.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Remove CONFIG_IDENT_STRING
Michal Simek [Thu, 24 Nov 2016 10:04:33 +0000 (11:04 +0100)] 
ARM64: zynqmp: Remove CONFIG_IDENT_STRING

CONFIG_IDENT_STRING is passed via defconfig already.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix cells format in zcu100
Michal Simek [Thu, 24 Nov 2016 09:53:24 +0000 (10:53 +0100)] 
ARM64: zynqmp: Fix cells format in zcu100

Trivial fixes.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add missing spi in HS connector
Michal Simek [Thu, 24 Nov 2016 09:33:30 +0000 (10:33 +0100)] 
ARM64: zynqmp: Add missing spi in HS connector

Enable spi driver in HS connector.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agotools: mkimage: Check if file is regular file
Michal Simek [Fri, 21 Oct 2016 11:16:13 +0000 (13:16 +0200)] 
tools: mkimage: Check if file is regular file

Current Makefile.spl passes -R parameter which is not empty
and pointing to ./ folder.
"./tools/mkimage -T zynqmpimage -R ./"" -d spl/u-boot-spl.bin
spl/boot.bin"
That's why mkimage is trying to parse ./ file and generate
register init which is wrong.
Check that passed filename is regular file. If not do not work with it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Series-to: u-boot
Series-cc: mike.looijmans@topic.nl

9 years agoARM64: zynqmp: Remove DTC 1.4.2 warnings
Michal Simek [Fri, 11 Nov 2016 12:21:04 +0000 (13:21 +0100)] 
ARM64: zynqmp: Remove DTC 1.4.2 warnings

DTC 1.4.2 reports these warnings:
Warning (unit_address_vs_reg): Node /amba_apu has a reg or ranges
property, but no unit name
Warning (unit_address_vs_reg): Node /amba has a reg or ranges property,
but no unit name
Warning (unit_address_vs_reg): Node /amba/usb@fe200000 has a unit name,
but no reg property
Warning (unit_address_vs_reg): Node /amba/usb@fe300000 has a unit name,
but no reg property
Warning (unit_address_vs_reg): Node
/amba/dma@fd4c0000/dma-video0channel@fd4c0000 has a unit name, but no
reg property
Warning (unit_address_vs_reg): Node
/amba/dma@fd4c0000/dma-video1channel@fd4c0000 has a unit name, but no
reg property
Warning (unit_address_vs_reg): Node
/amba/dma@fd4c0000/dma-video2channel@fd4c0000 has a unit name, but no
reg property
Warning (unit_address_vs_reg): Node
/amba/dma@fd4c0000/dma-graphicschannel@fd4c0000 has a unit name, but no
reg property
Warning (unit_address_vs_reg): Node
/amba/dma@fd4c0000/dma-audio0channel@fd4c0000 has a unit name, but no
reg property
Warning (unit_address_vs_reg): Node
/amba/dma@fd4c0000/dma-audio1channel@fd4c0000 has a unit name, but no
reg property
Warning (unit_address_vs_reg): Node /memory has a reg or ranges
property, but no unit name

This patch is fixing them.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: zynq: Remove DTC 1.4.2 warnings
Michal Simek [Fri, 11 Nov 2016 12:11:37 +0000 (13:11 +0100)] 
ARM: zynq: Remove DTC 1.4.2 warnings

DTC 1.4.2 reports these warnings:
Warning (unit_address_vs_reg): Node /memory has a reg or ranges
property, but no unit name
Warning (unit_address_vs_reg): Node /pmu has a reg or ranges property,
but no unit name
Warning (unit_address_vs_reg): Node /fixedregulator@0 has a unit name,
but no reg property

This patch is fixing them.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: usb1 on zcu100 is not peripheral
Nathalie Chan King Choy [Thu, 24 Nov 2016 02:55:20 +0000 (18:55 -0800)] 
ARM64: zynqmp: usb1 on zcu100 is not peripheral

For the ZCU100 board, usb1 is host and that's specified in dwc3_1.

Signed-off-by: Nathalie Chan King Choy <nathalie@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: zynq: Remove spi-max-frequency
Michal Simek [Mon, 21 Nov 2016 09:43:37 +0000 (10:43 +0100)] 
ARM: zynq: Remove spi-max-frequency

spi-max-frequency for spi bus depends on devices which are
connected to it. Remove this parameter from dtsi file.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: zynq: Sync with Linux kernel
Michal Simek [Mon, 21 Nov 2016 09:43:04 +0000 (10:43 +0100)] 
ARM: zynq: Sync with Linux kernel

Use the same position as is used in Linux kernel.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: dt: zynq: Add labels to cpu nodes to allow overriding OPPs.
Moritz Fischer [Mon, 9 Nov 2015 18:51:51 +0000 (10:51 -0800)] 
ARM: dt: zynq: Add labels to cpu nodes to allow overriding OPPs.

By adding labels to the cpu nodes in the dtsi, a dts that
includes it can change the OPPs by referencing the cpu0
through the label.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Reviewed-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: dts: zynq: replace gpio-key,wakeup with wakeup-source property
Sudeep Holla [Wed, 21 Oct 2015 10:10:16 +0000 (11:10 +0100)] 
ARM: dts: zynq: replace gpio-key,wakeup with wakeup-source property

Though the keyboard driver for GPIO buttons(gpio-keys) will continue to
check for/support the legacy "gpio-key,wakeup" boolean property to
enable gpio buttons as wakeup source, "wakeup-source" is the new
standard binding.

This patch replaces the legacy "gpio-key,wakeup" with the unified
"wakeup-source" property in order to avoid any futher copy-paste
duplication.

Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Sync main dtsi with kernel
Michal Simek [Mon, 21 Nov 2016 09:32:42 +0000 (10:32 +0100)] 
ARM64: zynqmp: Sync main dtsi with kernel

Linux kernel is having one more empty line between
License and dts file. Add it there to be in sync.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add idle state for ZynqMP
Stefan Krsmanovic [Fri, 21 Oct 2016 10:44:56 +0000 (12:44 +0200)] 
ARM64: zynqmp: Add idle state for ZynqMP

Added the idle-states node to describe zynqmp idle states. Only cpu-sleep-0
idle state is added in this patch. References to the idle-states node are
added in all CPU nodes. Time values: entry/exit latencies and min-residency,
needs to be tuned. arm,psci-suspend-param is selected to comply with PSCIv1.0
and Extended StateID format.

Signed-off-by: Stefan Krsmanovic <stefan.krsmanovic@aggios.com>
Acked-by: Will Wong <willw@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: usb1 on zcu100 is used as peripheral
Michal Simek [Tue, 18 Oct 2016 14:18:28 +0000 (16:18 +0200)] 
ARM64: zynqmp: usb1 on zcu100 is used as peripheral

It should be used as peripheral all the time.

Reported-by: Alexey Firago <Alexey_Firago@mentor.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: clk: Add the clock for watchdog
Shubhrajyoti Datta [Fri, 21 Oct 2016 10:42:19 +0000 (16:12 +0530)] 
ARM64: zynqmp: clk: Add the clock for watchdog

The watchdog clock node is missing.
Add the same. This solves the below error.

cdns-wdt fd4d0000.watchdog: input clock not found
cdns-wdt: probe of fd4d0000.watchdog failed with error -2

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agonet: zynq_gem: Use clock driver for ZynqMP
Siva Durga Prasad Paladugu [Tue, 15 Nov 2016 10:45:42 +0000 (16:15 +0530)] 
net: zynq_gem: Use clock driver for ZynqMP

Enable and use the clock driver routine
defined in clock driver toset required
clock appropriately.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoclk: zynqmp: Add clock driver support for zynqmp
Siva Durga Prasad Paladugu [Tue, 15 Nov 2016 10:45:41 +0000 (16:15 +0530)] 
clk: zynqmp: Add clock driver support for zynqmp

Add basic clock driver support for zynqmp which
sets the required clock for GEM controller

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Extend sdboot mode to be able to run commands
Michal Simek [Wed, 9 Nov 2016 13:17:36 +0000 (14:17 +0100)] 
ARM64: zynqmp: Extend sdboot mode to be able to run commands

This change is taken from Zynq which was done by:
"zynq_common: Add uEnv.txt boot environment load support"
(sha1: c7e6af90ef545902daacb0d83e5dc29c722dcf9d)

uenvcmd is variable which stores commands for different platform
initialization in SD boot mode.

Reported-by: Alexey Figaro <Alexey_Firago@mentor.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zcu100: Disable spl dfu
Michal Simek [Fri, 4 Nov 2016 14:02:08 +0000 (15:02 +0100)] 
ARM64: zcu100: Disable spl dfu

Enabling was the part of
"ARM64: zynqmp: Add support for DFU from SPL"
(sha1: 4444cb2c1925addfdad9e81396ecfc8865b6074b)

which is causing that ATF bootflow is not working
and this needs to be debug to find out reason for it.
Disabling SPL DFU for now.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Remove pcie node from zcu106
Michal Simek [Thu, 3 Nov 2016 12:40:49 +0000 (13:40 +0100)] 
ARM64: zynqmp: Remove pcie node from zcu106

PCIe is not enabled on this board.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agonet: use random ethernet address if invalid and not zero
Siva Durga Prasad Paladugu [Wed, 2 Nov 2016 10:41:01 +0000 (16:11 +0530)] 
net: use random ethernet address if invalid and not zero

Use random ethernet address if the ethernet address found
is invalid, not zero and config for random address
is defined.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
9 years agoARM64: zynqmp: Correct the sdhci minimum frequency for ep108
Siva Durga Prasad Paladugu [Tue, 1 Nov 2016 18:19:53 +0000 (23:49 +0530)] 
ARM64: zynqmp: Correct the sdhci minimum frequency for ep108

Correct the sdhci minimum frequency for ep platform.
It should be right shift instead of left shift operand.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agodma: zynqmp: Add clocks for LPDDMA
Kedareswara rao Appana [Fri, 9 Sep 2016 07:06:00 +0000 (12:36 +0530)] 
dma: zynqmp: Add clocks for LPDDMA

Zynqmp DMA driver expects two clocks (main clock and apb clock)
LPDDMA clock cofiguration is missing for the same in the
zynqmp-clk.dtsi file.

This patch updates for the same.

Reported-by: Sai Pavan Boddu <saipava@xilinx.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Remove note about level shifter on zcu102
Michal Simek [Wed, 19 Oct 2016 14:07:58 +0000 (16:07 +0200)] 
ARM64: zynqmp: Remove note about level shifter on zcu102

i2c device is just level shifter. Remove reference from dts.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: zc1751-xm015-dc1: Add phy handles to DisplayPort
Hyun Kwon [Fri, 1 Jul 2016 23:45:24 +0000 (16:45 -0700)] 
ARM64: zynqmp: zc1751-xm015-dc1: Add phy handles to DisplayPort

Add the phy handles to the DisplayPort DT node.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agodevicetree: dwc3: Add LPM transfers support on zcu102 board
Anurag Kumar Vulisha [Wed, 21 Sep 2016 13:37:24 +0000 (19:07 +0530)] 
devicetree: dwc3: Add LPM transfers support on zcu102 board

This patch adds USB 3.0 LPM transfers suuport to zcu102
board by adding snps,usb3_lpm_capable property.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agodevicetree: dwc3: Add LPM support for DC1 board
Anurag Kumar Vulisha [Wed, 21 Sep 2016 13:37:25 +0000 (19:07 +0530)] 
devicetree: dwc3: Add LPM support for DC1 board

This patch adds USBB 3.0 LPM transfers support to DC1 board by
adding usb3_lpm_capable parameter.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agodma: zynqmp: Add clocks for LPDDMA
Kedareswara rao Appana [Fri, 30 Sep 2016 05:04:59 +0000 (10:34 +0530)] 
dma: zynqmp: Add clocks for LPDDMA

Zynqmp DMA driver expects two clocks (main clock and apb clock)
For LPDDMA channels the two clocks are missing in the
Dma node resulting probe failure.

xilinx-zynqmp-dma ffa80000.dma: main clock not found.
xilinx-zynqmp-dma ffa80000.dma: Probing channel failed
xilinx-zynqmp-dma: probe of ffa80000.dma failed with error -2

This patch fixes this issue.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agodma: zynqmp: Add description for LPDDMA channel usage
Kedareswara rao Appana [Fri, 9 Sep 2016 07:06:01 +0000 (12:36 +0530)] 
dma: zynqmp: Add description for LPDDMA channel usage

LPDDMA default allows only secured access.
inorder to enable these dma channels,
one should ensure that it allows non secure access.
This patch updates the same.

Reported-by: Sai Pavan Boddu <saipava@xilinx.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoPCI: Xilinx NWL PCIe: Adding prefetchable memory space to device tree
Bharat Kumar Gogada [Tue, 2 Aug 2016 15:04:13 +0000 (20:34 +0530)] 
PCI: Xilinx NWL PCIe: Adding prefetchable memory space to device tree

Adding prefetchable memory space to pcie device tree node.
Shifting configuration space to 64-bit address space.
Removing pcie device tree node from amba as it requires size-cells=<2>
in order to access 64-bit address space.

Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Use 64bit size cell format for main amba bus
Michal Simek [Thu, 11 Feb 2016 06:19:06 +0000 (07:19 +0100)] 
ARM64: zynqmp: Use 64bit size cell format for main amba bus

Use 64bit size cell for main amba bus instead of 32bit because PCIe
node requires it Change 64bit sizes also for all others IPs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoRevert "ARM64: zynqmp: Add serdes address space dp driver"
Michal Simek [Thu, 20 Oct 2016 08:38:16 +0000 (10:38 +0200)] 
Revert "ARM64: zynqmp: Add serdes address space dp driver"

This reverts commit 786db82bd5bf09cc8f78c8b14445e843d7566b1c.

Since we are using serdes driver , no need of mapping serdes register
space into DP driver.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
Tested-by: Hyun Kwon <hyunk@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: drm: Add DMA index
Hyun Kwon [Fri, 15 Jul 2016 00:42:44 +0000 (17:42 -0700)] 
ARM64: zynqmp: drm: Add DMA index

Each plane can be associated with multiple DMA channels. So add
index for each DMA channel.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Sync gpio node properties
Michal Simek [Thu, 20 Oct 2016 08:26:13 +0000 (10:26 +0200)] 
ARM64: zynqmp: Sync gpio node properties

Keep dtsi in sync with mainline kernel.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoRevert "ARM64: zynqmp: Added broken-tuning property to SD, eMMC nodes"
Michal Simek [Thu, 20 Oct 2016 08:36:05 +0000 (10:36 +0200)] 
Revert "ARM64: zynqmp: Added broken-tuning property to SD, eMMC nodes"

This reverts commit d666ac9ce50fad8b6ee3e5c4e8d7b6d511ddb8c0.

Implemented the new workaround for auto tuning based on
zynqmp compatible string, so removed the 'broken-tuning'
property.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: change sdhci compatible string.
Sai Krishna Potthuri [Tue, 16 Aug 2016 09:11:35 +0000 (14:41 +0530)] 
ARM64: zynqmp: change sdhci compatible string.

This patch changes the compatible string for sdhci node,
adds "xlnx,device_id" and "xlnx,mio_bank" property to sdhci node.

Signed-off-by: Sai Krishna Potthuri <lakshmis@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Remove xlnx,id property
Michal Simek [Tue, 9 Aug 2016 13:06:58 +0000 (15:06 +0200)] 
ARM64: zynqmp: Remove xlnx,id property

Remove unused xlnx,id property because it is not the part of
DT binding.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: pci: Updating device tree as per upstream
Bharat Kumar Gogada [Tue, 19 Jul 2016 15:19:29 +0000 (20:49 +0530)] 
ARM64: zynqmp: pci: Updating device tree as per upstream

Updating required device tree changes as per mainlined driver
from 4.6 kernel.

Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Support for multiple PM IDs assigned to a PM domain
Filip Drazic [Mon, 29 Aug 2016 17:32:59 +0000 (19:32 +0200)] 
ARM64: zynqmp: Support for multiple PM IDs assigned to a PM domain

Previously, it was assumed that there is a 1:1 mapping between
PM ID defined in the platform firmware and a PM domain. However, there
can be a situation where multiple PM IDs belong to a single PM domain
(e.g. PM IDs for GPU and two pixel processors correspond to a single
PM domain).

This patch adds support for assigning more than one PM ID to
a single PM domain.

Updated documentation accordingly.

Assigned pixel processors PM IDs to GPU PM domain.

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: DT: Add PM domains for GPU and PCIE
Filip Drazic [Mon, 29 Aug 2016 17:32:56 +0000 (19:32 +0200)] 
ARM64: zynqmp: DT: Add PM domains for GPU and PCIE

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: DT: Remove unused PM domains for PLL
Filip Drazic [Thu, 25 Aug 2016 16:58:51 +0000 (18:58 +0200)] 
ARM64: zynqmp: DT: Remove unused PM domains for PLL

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: DT: Remove unused DDR PM domain
Filip Drazic [Thu, 25 Aug 2016 16:58:49 +0000 (18:58 +0200)] 
ARM64: zynqmp: DT: Remove unused DDR PM domain

DDR power states are handled by the PM firmware, so this domain is
redundant. Also, since there is no device using this PM domain,
it will be powered off during boot, which is wrong.

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add support for zynqmp fpga manager
Nava kishore Manne [Sat, 20 Aug 2016 18:47:52 +0000 (00:17 +0530)] 
ARM64: zynqmp: Add support for zynqmp fpga manager

Add support for zynqmp fpga manager.

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add cortexa53 edac node
Naga Sureshkumar Relli [Mon, 20 Jun 2016 10:18:30 +0000 (15:48 +0530)] 
ARM64: zynqmp: Add cortexa53 edac node

This patch adds edac node for arm cortexa53 to report
errors on L1 and L2 caches.

Signed-off-by: Naga Sureshkumar Relli <nagasure@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add support for zcu106
Michal Simek [Thu, 20 Oct 2016 07:52:41 +0000 (09:52 +0200)] 
ARM64: zynqmp: Add support for zcu106

Preliminary support for zcu106 which is almost the same as zcu102.
SPL is disabled because of missing hw design.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: zynq: Add support for Zynq 7000S 7007s/7012s/7014s devices
Michal Simek [Tue, 18 Oct 2016 14:10:25 +0000 (16:10 +0200)] 
ARM: zynq: Add support for Zynq 7000S 7007s/7012s/7014s devices

Zynq 7000S (Single A9 core) devices is using different ID code.
This patch adds this new codes and assign them.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Decrease MALLOC size for SPL
Michal Simek [Fri, 14 Oct 2016 12:06:28 +0000 (14:06 +0200)] 
ARM64: zynqmp: Decrease MALLOC size for SPL

Decrease malloc size to 1MB from 256MB. Huge malloc
space is adding huge delay in mem_malloc_init() because
we are enabling CONFIG_SYS_MALLOC_CLEAR_ON_INIT
which clear the whole malloc space.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix ddr init for zcu100
Michal Simek [Fri, 7 Oct 2016 20:13:44 +0000 (13:13 -0700)] 
ARM64: zynqmp: Fix ddr init for zcu100

Use prog_reg_ddr() instead of prog_reg() which has different
shift and mask parameters position. It is caused somewhere between
DDR team and PCW.
Also forbit prog_reg_ddr() inlining which saves 276B.

Also remove variables wdqsl_b2, wdqsl_b3, lcdl_b2, lcdl_b3, calc12, calc13
which were generated in DDR init snipset but they were completely unused
which generated compilation warnings.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix issue with RevA board with CD bit
Michal Simek [Fri, 14 Oct 2016 11:07:56 +0000 (13:07 +0200)] 
ARM64: zynqmp: Fix issue with RevA board with CD bit

Force SD CD bit to be present via bootrom write field.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agospi: zynqmp_qspi: Perform timeout irrespective of processor speed
Siva Durga Prasad Paladugu [Wed, 5 Oct 2016 11:10:16 +0000 (16:40 +0530)] 
spi: zynqmp_qspi: Perform timeout irrespective of processor speed

Perform QSPI timeout irrespective of processor speed. With this
the timeout is set to 100 seconds. This solves issue of timeout
on some boards with different processor speeds

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agospi: spi_flash: Correctly determine the selected bank and lock status
Siva Durga Prasad Paladugu [Wed, 5 Oct 2016 11:10:15 +0000 (16:40 +0530)] 
spi: spi_flash: Correctly determine the selected bank and lock status

Correctly determine the selected bank and flash lock status incase
of dual parallel mode when using generic qspi controller.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agozynqmp: Adjust to new SMC interface to get silicon version
Soren Brinkmann [Thu, 29 Sep 2016 18:44:41 +0000 (11:44 -0700)] 
zynqmp: Adjust to new SMC interface to get silicon version

The new FW interface returns the IDCODE and version register, leaving
extracting bitfields to the caller.

Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agotools: mkimage: Add support for initialization table for Zynq and ZynqMP
Mike Looijmans [Tue, 20 Sep 2016 09:37:24 +0000 (11:37 +0200)] 
tools: mkimage: Add support for initialization table for Zynq and ZynqMP

The Zynq/ZynqMP boot.bin file contains a region for register initialization
data. Filling in proper values in this table can reduce boot time
(e.g. about 50ms faster on QSPI boot) and also reduce the size of
the SPL binary.

The table is a simple text file with register+data on each line. Other
lines are simply skipped. The file can be passed to mkimage using the
"-R" parameter.

It is recommended to add reg init file to board folder.
For example:
CONFIG_BOOT_INIT_FILE="board/xilinx/zynqmp/xilinx_zynqmp_zcu102/reg.int

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Use the same name for atf image everywhere
Michal Simek [Wed, 21 Sep 2016 09:42:58 +0000 (11:42 +0200)] 
ARM64: zynqmp: Use the same name for atf image everywhere

Use atf-uboot.ub image instead of atf.ub.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agospi: spi_flash: Add support for QSPI part MT25QL02G/MT25QU02G
Siva Durga Prasad Paladugu [Wed, 28 Sep 2016 06:08:22 +0000 (11:38 +0530)] 
spi: spi_flash: Add support for QSPI part MT25QL02G/MT25QU02G

Add support for QSPI parts MT25QL02G and MT25QU02G

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add dcc port to dtsi
Michal Simek [Fri, 9 Sep 2016 06:46:39 +0000 (08:46 +0200)] 
ARM64: zynqmp: Add dcc port to dtsi

Add dcc to dtsi for supporting system without serial port.
DCC is enabled by default on ZynqMP.
Adding dcc to zcu100 and zcu102 which were tested.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agotest/py: Add dependency on phylib for mdio command
Michal Simek [Fri, 2 Sep 2016 10:40:26 +0000 (12:40 +0200)] 
test/py: Add dependency on phylib for mdio command

Discover on zcu100 where phylib is not enabled.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agofpga: zynqmp: Fix coding style in fpga driver
Michal Simek [Fri, 2 Sep 2016 07:50:47 +0000 (09:50 +0200)] 
fpga: zynqmp: Fix coding style in fpga driver

Trivial changes.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix coding style
Michal Simek [Fri, 2 Sep 2016 07:49:52 +0000 (09:49 +0200)] 
ARM64: zynqmp: Fix coding style

Fix long lines and checkpatch.pl violations.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Enable fastboot for first SD/MMC/EMMC device
Siva Durga Prasad Paladugu [Thu, 12 May 2016 05:24:41 +0000 (10:54 +0530)] 
ARM64: zynqmp: Enable fastboot for first SD/MMC/EMMC device

DNL numbers are not changed that's why fastboot needs to be called with
-i parameter (Xilinx vendor id).

- Show available devices
sudo fastboot -i 0x03fd devices
xilinx_zynqmp_zcu100 fastboot

- Stop fastboot and go back to U-Boot prompt
sudo fastboot -i 0x03fd continue

- Reboot the board
sudo fastboot -i 0x03fd reboot

- Get internal variables
sudo fastboot -i 0x3fd getvar bootloader-version
bootloader-version: U-Boot 2016.07-00026-g19bd53044817
sudo fastboot -i 0x3fd getvar downloadsize
downloadsize: 0x06000000
sudo fastboot -i 0x3fd getvar version
version: 0.4
(regular variables needs to have fastboot. prefix - there is also
serialno variable which should be define as serial#)

- Format SD/MMC/EMMC card
sudo fastboot -i 0x3fd oem format
- Write images to boot and Linux partition
sudo fastboot -i 0x3fd flash boot sd.img
sudo fastboot -i 0x3fd flash Linux os.img

- Creating sd.img or os.img
$ dd if=/dev/zero of=sd.img bs=1024 count=1024
$ mkfs.vfat sd.img
$ mkdir sd-mount
$ mount -o loop sd.img sd-mount
$ echo foo > sd-mount/bar
$ umount sd-mount

partitions setting should be checked by running gpt command.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Record board name as serial number for DFU/FASTBOOT
Michal Simek [Thu, 1 Sep 2016 09:27:32 +0000 (11:27 +0200)] 
ARM64: zynqmp: Record board name as serial number for DFU/FASTBOOT

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix usb_gadget_handle_interrupt routine
Michal Simek [Thu, 1 Sep 2016 09:16:40 +0000 (11:16 +0200)] 
ARM64: zynqmp: Fix usb_gadget_handle_interrupt routine

Function is defined in g_dnl.h and have different parameter
then it is used. This patch fixes it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Force certain bootmode for SPL
Michal Simek [Tue, 30 Aug 2016 14:17:27 +0000 (16:17 +0200)] 
ARM64: zynqmp: Force certain bootmode for SPL

ZynqMP provides an option to overwrite bootmode setting which
can change SPL behavior.
For example: boot SPL via JTAG and then SPL loads images from SD.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Enable SPI for zcu100
Michal Simek [Thu, 1 Sep 2016 07:45:30 +0000 (09:45 +0200)] 
ARM64: zynqmp: Enable SPI for zcu100

spi is bus 1, qspi is bus 0.

Example:
(Read max3107 ID)
ZynqMP> sspi 1:0.0 16 1f00
00A1
(Write gpio direction out - reg 18 - for all gpio pins)
ZynqMP> sspi 1:0.0 16 980f
0000
(Write value 1 (reg 19) for BT and WIFI (bit 0/bit 1)
ZynqMP> sspi 1:0.0 16 9903
0000

All write commands based on spec have 0x80 + reg address
as the first 8 bits.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agospi: zynq: Use variable to remove u32 to u64 conversions
Michal Simek [Thu, 1 Sep 2016 10:51:27 +0000 (12:51 +0200)] 
spi: zynq: Use variable to remove u32 to u64 conversions

Current code generates warning when it is compiled for arm64:
Warnings:
In file included from drivers/spi/zynq_spi.c:14:0:
drivers/spi/zynq_spi.c: In function ‘zynq_spi_init_hw’:
drivers/spi/zynq_spi.c:95:9: warning: large integer implicitly truncated
to unsigned type [-Woverflow]
  writel(~ZYNQ_SPI_ENR_SPI_EN_MASK, &regs->enr);
         ^
./arch/arm/include/asm/io.h:146:34: note: in definition of macro
‘writel’
 #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v;
})
                                  ^
drivers/spi/zynq_spi.c: In function ‘zynq_spi_release_bus’:
drivers/spi/zynq_spi.c:177:9: warning: large integer implicitly
truncated to unsigned type [-Woverflow]
  writel(~ZYNQ_SPI_ENR_SPI_EN_MASK, &regs->enr);
         ^
./arch/arm/include/asm/io.h:146:34: note: in definition of macro
‘writel’
 #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v;
})
                                  ^
This patch is using one variable to do conversion via u32 variable.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Add support for DFU from SPL
Michal Simek [Fri, 19 Aug 2016 12:14:52 +0000 (14:14 +0200)] 
ARM64: zynqmp: Add support for DFU from SPL

SPL needs to have bigger stack size because of USB.
Simple malloc needs to be disabled because dfu code requires different
allocation functions. There is no space in OCM that's why random place
in DDR is used.

BOOTD must be disabled because it is causing compilation error.

All variables are disabled and used only variables valid for DFU because
they are simple huge. Including automatic variables added by
CONFIG_ENV_VARS_UBOOT_CONFIG.
Hardcode addresses for u-boot, atf, kernel and dtb
just for SPL DFU code.

Enable SPL DFU for zcu100.
Create new usb_dfu_spl variable just to run Linux kernel loaded in SPL.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM: Add new BOOT_DEVICE_DFU boot mode
Michal Simek [Tue, 30 Aug 2016 13:38:57 +0000 (15:38 +0200)] 
ARM: Add new BOOT_DEVICE_DFU boot mode

This enum is needed when SPL_DFU is enabled.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agocmd: dfu: Add error handling for board_usb_init
Michal Simek [Tue, 30 Aug 2016 13:16:51 +0000 (15:16 +0200)] 
cmd: dfu: Add error handling for board_usb_init

board_usb_init() can failed and error should be handled properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Heiko Schocher<hs@denx.de>
9 years agocmd: dfu: Add error handling for failed registration
Sanchayan Maity [Mon, 8 Aug 2016 11:26:17 +0000 (16:56 +0530)] 
cmd: dfu: Add error handling for failed registration

Without this, if g_dnl_register() fails, DFU code continues on
blindly and crashes. This fix makes it simply print an error
message instead.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
[l.majewski@samsung.com - some manual tweaks needed]

9 years agodra7x: boot: add dfu bootmode support
B, Ravi [Thu, 28 Jul 2016 12:09:17 +0000 (17:39 +0530)] 
dra7x: boot: add dfu bootmode support

This patch enables the DFU boot mode support
for dra7x platform.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agospl: dfu: adding dfu support functions for SPL-DFU
B, Ravi [Thu, 28 Jul 2016 12:09:16 +0000 (17:39 +0530)] 
spl: dfu: adding dfu support functions for SPL-DFU

Adding support functions to run dfu spl commands.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agocommon: dfu: saperate the dfu common functionality
B, Ravi [Thu, 28 Jul 2016 12:09:15 +0000 (17:39 +0530)] 
common: dfu: saperate the dfu common functionality

The cmd_dfu functionality is been used by both SPL and
u-boot, saperating the core dfu functionality moving
it to common/dfu.c.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agospl: dfu: add dfu support in SPL
B, Ravi [Thu, 28 Jul 2016 12:09:14 +0000 (17:39 +0530)] 
spl: dfu: add dfu support in SPL

Traditionally the DFU support is available only
as part 2nd stage boot loader(u-boot) and DFU
is not supported in SPL.

The SPL-DFU feature is useful for boards which
does not have MMC/SD, ethernet boot mechanism
to boot the board and only has USB inteface.

This patch add DFU support in SPL with RAM
memory device support to load and execute u-boot.
And then leverage full functionality DFU in
u-boot to flash boot inital binary images to
factory or bare-metal boards to memory devices
like SPI, eMMC, MMC/SD card using USB interface.

This SPL-DFU support can be enabled through
Menuconfig->Boot Images->Enable SPL-DFU support

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 years agoARM64: zynqmp: Move BSS location to the beginning of ram
Michal Simek [Tue, 30 Aug 2016 12:58:46 +0000 (14:58 +0200)] 
ARM64: zynqmp: Move BSS location to the beginning of ram

With SPL_DFU support memory layout needs to be cleanup
that's why move bss to the start of memory.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoARM64: zynqmp: Fix kernel location to fit with Image entry point
Michal Simek [Tue, 30 Aug 2016 10:42:05 +0000 (12:42 +0200)] 
ARM64: zynqmp: Fix kernel location to fit with Image entry point

This fix is required for getting dfu up and running.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agoqspi: zynqmp: Restrict baud rate value to max value
Siva Durga Prasad Paladugu [Wed, 14 Sep 2016 06:37:14 +0000 (12:07 +0530)] 
qspi: zynqmp: Restrict baud rate value to max value

Restrict baud rate disvisor value to max possible
baud rate value. This fixes the baud rate value overflow
condition which results in programming the incorrect baud
rate divisor value.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
9 years agozynqmp: Add support for SD1 with level shifters bootmode
Siva Durga Prasad Paladugu [Wed, 21 Sep 2016 06:15:05 +0000 (11:45 +0530)] 
zynqmp: Add support for SD1 with level shifters bootmode

Add support for SD1 with level shifters bootmode.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>