u-boot/board/xilinx
Igor Lantsman 1b208d59ba arm64: zynqmp: Fix set_fdtfile() not to break u-boots DTB
Origin function was calling strsep which replaced delimiter ',' by a null
byte ('\0'). Operation was done directly on FDT which ends up with the
following behavior:

ZynqMP>  printenv fdtfile
fdtfile=xilinx/zynqmp.dtb
ZynqMP> fdt addr $fdtcontroladdr
ZynqMP> fdt print / compatible
compatible = "xlnx", "zynqmp"

As is visible fdtfile was correctly composed but a null byte caused that
xlnx was separated from zynqmp.
This hasn't been spotted because in all Xilinx DTs there are at least 3
compatible string and only the first one was affected by this issue.
But for systems which only had one compatible string "xlnx,zynqmp" it was
causing an issue when U-Boot's DT was used by Linux kernel.

The patch removes strsep calling and strchr is called instead which just
locate the first char after deliminator ',' (variable called "name").
And using this pointer in fdtfile composing.

Fixes: 91d7e0c47f ("arm64: zynqmp: Create fdtfile from compatible string")
Reported-by: Igor Lantsman <igor.lantsman@opsys-tech.com>
Signed-off-by: Igor Lantsman <igor.lantsman@opsys-tech.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-08-20 09:49:20 +02:00
..
bootscripts xilinx: Add sd boot command script for reference 2019-10-08 09:11:13 +02:00
common xilinx: Setup bootm variables 2020-08-20 09:46:55 +02:00
microblaze-generic common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
versal common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
zynq fpga: zynqpl: Add zynq aes load & loadp commands 2020-06-24 13:07:58 +02:00
zynqmp arm64: zynqmp: Fix set_fdtfile() not to break u-boots DTB 2020-08-20 09:49:20 +02:00
zynqmp_r5 common: Drop init.h from common header 2020-05-18 17:33:33 -04:00
Kconfig arm64: zynqmp: Add support for OF_SEPARATE with board DTB 2020-01-14 09:05:53 +01:00