Commit Graph

69078 Commits

Author SHA1 Message Date
T Karthik Reddy
0af9de9a90 arm64: zynqmp: Add support for SHA3 command
This patch adds support for SHA3 command. It takes data blob
as input and generates 48 bytes sha3 hash value.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
T Karthik Reddy
650d02ae77 arm64: zynqmp: Add support for RSA command
This patch adds support for RSA command, performs RSA encrypt &
RSA decrypt on data blob of key size.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Siva Durga Prasad Paladugu
8e4e914652 arm64: zynqmp: Add support for encryption and decryption on data blob
This patch adds support for encryption and decryption on a given data
blob using different key sources such as userkey(KUP), device key and
PUF key. Inorder to support this a new zynqmp command(zynqmp aes) has
been introduced.

Command:
zynqmp aes srcaddr ivaddr len aesop keysrc dstaddr [keyaddr]\n"
	Encrypts or decrypts blob of data at src address and puts it\n"
	back to dstaddr using key and iv at keyaddr and ivaddr\n"
	respectively. keysrc values specifies from which source key\n"
	has to be used, it can be User/Device/PUF key. A value of 0\n"
	for KUP(user key),1 for DeviceKey and 2 for PUF key. The\n"
	aesop value would specify the operationwhich can be 0 for\n"
	decrypt and 1 for encrypt(1) operation\n";

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Michal Simek
248fabc3ce arm64: zynqmp: Get rid of iommus/power-domains properties for SPL DT
SPL DT contains only nodes which are contain u-boot,dm-pre-reloc property.
iommu node is not this case that's why when DT is read DTC reports some
warnings.

$ dtc -I dtb -O dts dts/dt-spl.dtb >/dev/null
<stdout>: Warning (iommus_property): /amba/spi@ff0f0000:iommus: Could not get phandle node for (cell 0)
<stdout>: Warning (iommus_property): /amba/mmc@ff160000:iommus: Could not get phandle node for (cell 0)
<stdout>: Warning (iommus_property): /amba/mmc@ff170000:iommus: Could not get phandle node for (cell 0)

SPL also has an option to remove some DT properties which are useless for
SPL to make DT even smaller.
Default DT properties are pinctrl-0 pinctrl-names interrupt-parent
interrupts which are already removed.
The patch extends this list with iommus to get rid of above warnings.
Also power-domains unused properties can be removed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Michal Simek
b15412f9a0 arm64: zynqmp: Enable cache command
Sometimes it is very useful to be able disable/enable cache that's why
enable commands for it by default.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Michal Simek
e928406695 arm64: zynqmp: Enable FPGA loading from SPL
fpga bitstream needs to be listed in config node in FIT image. Only tested
option is bitstream in BIN format.
Enabling this feature increase code size by almost 4k.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Michal Simek
0d76b71d93 arm64: zynqmp: Get rid of simple_itoa and replace it by snprintf
simple_itoa() is implemented only for !CONFIG_USE_TINY_PRINTF. Tiny printf
is normally used by SPL that's code which uses simple_itoa() has missing
reference. That's why refactor code by using on snprintf() instead of
strncpy()/strncat() combination. This change also descrease code size by
saving 24B based on buildman.

aarch64: (for 1/1 boards) all -22.0 rodata +2.0 text -24.0
         xilinx_zynqmp_virt: all -22 rodata +2 text -24
            u-boot: add: 0/0, grow: 0/-1 bytes: 0/-24 (-24)
              function                                   old     new   delta
              board_init                                 520     496     -24

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Michal Simek
f08d0c51b5 mailbox: zynqmp: Extend timeout for getting observation bit
In case of fpga loading (which can be huge) 100ms is not enough. That's why
extend timeout 10 times to wait maximum 1s to get ACK back.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Michal Simek
5690128f70 firmware: zynqmp: Swap addr_hi/low when PM_FPGA_LOAD is called
Don't know reason but in regular flow addr_hi/low are swapped in ATF. It
means when fpga load is done from EL3 there is a need to swap it for PMUFW
to load bitstream.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-27 08:13:31 +01:00
Ashok Reddy Soma
5d5984c70e config: versal: Update mini u-boot timer clock to 100Mhz
Mini u-boot timer clock is not updated when u-boot is migrated from
emulator to silicon. Due to this slower clock of 2.72Mhz, delay() functions
are not working accurately. Update CONFIG_COUNTER_FREQUENCY to 100Mhz.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
Ashok Reddy Soma
90f06e9d20 arm64: versal: Update mini u-boot eMMC node parameters
Mini u-boot eMMC dt parameters are not in sync with full u-boot dt.

Frequency for eMMC is fixed to 25Mhz. Due to this, mmc multi-block write
commands are failing. Increase frequency to 200Mhz to fix this issue.

Add bus-width = <8>, non-removable and disable-wp properties to the node
as this is eMMC.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:13:31 +01:00
T Karthik Reddy
44d2be8d6a microblaze: Add support for distro boot
Add distro boot support for microblaze and enable jtag, qspi,
dhcp, pxe boot targets for distro boot.
Enable DISTRO_DEFAULTS config in microblaze defconfig and also
enable support for spi xilinx driver & spi vendors to access
spi flash by distro boot.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
T Karthik Reddy
ed0842d6c5 microblaze: Setup distro boot env variables at run time
Setup all the distro boot related environment variables at
run time. Add BOOT_SCRIPT_OFFSET config to microblaze board
Kconfig.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
T Karthik Reddy
d6242edcce microblaze: board: Check return value whlie saving env variables
Check and print warning if run time env variables are not saved.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
T Karthik Reddy
581d6a6da7 microblaze: trivial code fixes
Set proper indentation for env variables in microblaze header file.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
T Karthik Reddy
78efd7847c microblaze: Enable spi for microblaze
Enable SPI drivers and driver model for microblaze.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
e1303b2bc1 spi: xilinx_spi: Remove unused variable
Remove unused variable:
drivers/spi/xilinx_spi.c: In function 'xilinx_spi_xfer':
drivers/spi/xilinx_spi.c:254:18: warning: unused variable 'timeout' [-Wunused-variable]
  254 |  u32 reg, count, timeout;
      |                  ^~~~~~~

Fixes: 0c0de58f7b ("spi: xilinx_spi: Modify transfer logic xilinx_spi_xfer() function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
b9ac6c0820 arm64: zynqmp: Enable EMMC boot
Enable EMMC boot commands to be able to change EMMC setup.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
bbe086a950 arm64: zynqmp: Add missing support for 9cg version
9cg version was supported before code refactoring. The patch is adding it
back.

Fixes: fa793165da ("xilinx: zynqmp: refactor silicon name function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Alexandre GRIVEAUX
bd897a0789 ARM: zynq: Add Z-turn board V5
Adding Z-turn board V5 to resolve the change between:

"Z-TURNBOARD_schematic.pdf" schematics state version 1 to 4 has Atheros AR8035
"Z-Turn_Board_sch_V15_20160303.pdf" schematics state version 5 has Micrel KSZ9031

At this time the S25FL128SAGNFI003 doesn't work because of bug:

*** Warning - spi_flash_probe_bus_cs() failed, using default environment

zynq-zturn was checked on V5 board, same error.

Maybe Z-turn board have the same problem (board with W25Q128BVFIG).

Signed-off-by: Alexandre GRIVEAUX <agriveaux@deutnet.info>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
0d4e6a2d3b doc: board: xilinx: Add documentation for ZynqMP R5
Add missing documentation for Xilinx ZynqMP R5 configuration with steps how
to run it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
bbda59ed41 doc: board: xilinx: Add documentation for ZynqMP
Add missing documentation for Xilinx ZynqMP configuration with steps how
to configure it and run it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
4286f32a4e doc: board: xilinx: Update links to DT binding docs
Several drivers have been added without updating documentation.
And also some dt bindings have been moved to yaml.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
2bf4f763e6 doc: board: xilinx: zynq.rst: Update zynq documentation
- Correct location of BSP code
- Remove TODO which is done already

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:36 +01:00
Michal Simek
79d4204f72 MAINTAINERS: Record documentation for Xilinx platforms
Add fragment to cover documenation for Xilinx platforms.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-27 08:01:36 +01:00
Ovidiu Panait
f5d8b1a1f9 microblaze: start.S: Use board_init_f_alloc/init in early init
Implement early init by calling generic board_init_f_alloc_reserve and
board_init_f_init_reserve functions:
* drop SYS_MALLOC_F_LEN related code, as allocation and gd->malloc_base
  assignment are taken care of by the generic functions
* drop _gd logic

Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-10-27 08:01:36 +01:00
Ovidiu Panait
627085eacf microblaze: start.S: Factor out exception setup code to __setup_exceptions
Currently, the exceptions setup code is duplicated in pre-relocation and
post-relocation init. Factor out this code to __setup_exceptions asm
routine to get rid of the duplication.

__setup_exceptions is called with a relocation offset parameter (r5)
which is set to zero for pre-reloc init and gd->reloc_off for post-reloc
exception setup.

Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-10-27 08:01:33 +01:00
Tom Rini
43428c6915 - disable CONFIG_VIDEO to remove DM conversion warnings
for boards: at91sam9, eb_cpu5282, ls1021aqds, ls1021atwr,
    mx23evk, mx6sxsabresd, mx7dsabresd, nokia_rx51, picosam9g45,
    sansa_fuze_plus, xfi3
 -----BEGIN PGP SIGNATURE-----
 
 iGwEABECACwWIQSC4hxrSoIUVfFO0kRM6ATMmsalXAUCX5cuIw4cYWd1c3RAZGVu
 eC5kZQAKCRBM6ATMmsalXPOIAJ9sRuY+hFpuYN1fFmc6UzMl0wr5RwCdH0eqlEAm
 8Qj5ITU7YhVIINeRVeE=
 =VNIK
 -----END PGP SIGNATURE-----

Merge tag 'video-for-2021.01-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

 - disable CONFIG_VIDEO to remove DM conversion warnings
   for boards: at91sam9, eb_cpu5282, ls1021aqds, ls1021atwr,
   mx23evk, mx6sxsabresd, mx7dsabresd, nokia_rx51, picosam9g45,
   sansa_fuze_plus, xfi3
2020-10-26 17:27:38 -04:00
Anatolij Gustschin
9dec5a0ea1 nokia_rx51: disable obsolete VIDEO config
Disable VIDEO config to fix DM_VIDEO conversion
deadline warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2020-10-26 20:55:51 +01:00
Anatolij Gustschin
8c9940d5ec eb_cpu5282: fix CONFIG_DM_VIDEO build warnings
Remove CONFIG_VIDEO dependency to fix board removal warnings.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Jens Scharsig <esw@bus-elektronik.de>
2020-10-26 20:55:29 +01:00
Anatolij Gustschin
2310620960 sansa_fuze_plus: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
2020-10-26 20:55:03 +01:00
Anatolij Gustschin
8ea854a5cc xfi3: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
2020-10-26 20:54:47 +01:00
Anatolij Gustschin
beea0057d3 mx23evk: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Otavio Salvador <otavio@ossystems.com.br>
2020-10-26 20:54:37 +01:00
Anatolij Gustschin
33923e7270 at91sam9n12ek: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.
Boards should convert to DM_VIDEO if they need video console
support.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
2020-10-26 20:54:14 +01:00
Anatolij Gustschin
d1a2a1dc9e at91sam9: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2020-10-26 20:53:53 +01:00
Anatolij Gustschin
12a3e60469 picosam9g45: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Erik van Luijk <evanluijk@interact.nl>
2020-10-26 20:53:41 +01:00
Anatolij Gustschin
d63443a542 ls1021atwr: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2020-10-26 20:53:31 +01:00
Anatolij Gustschin
dac62ffd83 ls1021aqds: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Alison Wang <alison.wang@nxp.com>
2020-10-26 20:53:22 +01:00
Anatolij Gustschin
7490609bc5 imx: mx7dsabresd: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2020-10-26 20:53:09 +01:00
Anatolij Gustschin
e1c35c938d imx: mx6sxsabresd: disable obsolete VIDEO config
DM_VIDEO conversion deadline has passed, disable VIDEO config.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2020-10-26 20:52:58 +01:00
Tom Rini
54908d9ae1 Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
- No need to check before free in kendryte clk.
- Only enable OF_BOARD_FIXUP if U-Boot is configured for S-Mode.
- Reduce k210 dts DMA block size
- Move timers into drivers/timer
- Correct fu540 dts reg size of clint node
2020-10-26 08:25:37 -04:00
Pragnesh Patel
7257455e7c riscv: fu540: dts: Correct reg size of clint node
Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-10-26 10:01:37 +08:00
Sean Anderson
47d7e3b5eb riscv: Move timer portions of SiFive CLINT to drivers/timer
Half of this driver is a DM-based timer driver, and half is RISC-V-specific
IPI code. Move the timer portions in with the other timer drivers. The
KConfig is not moved, since it also enables IPIs. It could also be split
into two configs, but no boards use the timer but not the IPI atm, so I
haven't split it.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-10-26 10:01:28 +08:00
Sean Anderson
7dbebebb79 timer: Add _TIMER suffix to Andes PLMT Kconfig
This matches the naming scheme of other timer drivers.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-10-26 10:01:28 +08:00
Sean Anderson
79b135f1f9 riscv: Move Andes PLMT driver to drivers/timer
This is a regular timer driver, and should live with the other timer
drivers.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-10-26 10:01:28 +08:00
Sean Anderson
963911e9e1 riscv: k210: Reduce DMA block size
Although the max DMA size supported by the hardware register is 22 bits (or
4M), the Linux driver for this device only supports transfers of up to 2M.
On a device with 8M total memory, I don't think it will make too much of a
difference.

Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-10-26 09:27:24 +08:00
Sean Anderson
32cef69da0 riscv: Only enable OF_BOARD_FIXUP for S-Mode
It is unsafe to enable OF_BOARD_FIXUP only based on OF_SEPARATE.
OF_SEPARATE may indicate that the user wishes U-Boot to use a different
device tree than one obtained via OF_PRIOR_STAGE. However, OF_SEPARATE may
also indicate that the device tree which would be obtained via
OF_PRIOR_STAGE is invalid, nonexistant, or otherwise unusable. In this
latter case, enabling OF_BOARD_FIXUP will result in corruption of the
device tree. To remedy this, only enable OF_BOARD_FIXUP if U-Boot is
configured for S-Mode.

Fixes: 1c17e55594
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
2020-10-26 09:27:19 +08:00
Heinrich Schuchardt
8bb7496ef9 clk: kendryte: no need to check argument of free()
free() checks if its argument is NULL. No need to check it twice.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2020-10-26 09:27:13 +08:00
Tom Rini
c99e87f828 Merge branch '2020-10-23-misc-changes'
Highlights:
- Fix a problem with the bootm overlap tests
- Remove duplicated code in fatwrite
- Cleanup our current "misc" command code and add a new one for misc
  class devices.
- Various GPIO fixes
2020-10-24 10:49:28 -04:00
Peng Fan
16cc5ad0b4 power: regulator: add dummy helper
Add dummy helper to enabling the header could be included when
DM REGULATOR not enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2020-10-23 16:38:33 -04:00