diff options
author | Igor Lantsman | 2020-06-24 14:33:46 +0200 |
---|---|---|
committer | Michal Simek | 2020-08-20 09:49:20 +0200 |
commit | 1b208d59bac12da6f8bd2f7d9e9482fa16340705 (patch) | |
tree | 7572a0c75e39b90a9981100048041060d8e8781a /board/d-link | |
parent | 834de8984241efaa7124358f4aafd2e2cb803b50 (diff) |
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: 91d7e0c47f51 ("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>
Diffstat (limited to 'board/d-link')
0 files changed, 0 insertions, 0 deletions