diff options
author | Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> | 2017-12-07 15:05:30 +0530 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2017-12-18 09:32:07 +0100 |
commit | ec60a279ec6138d9d9f8e73b12625e0052ec4793 (patch) | |
tree | d7b4c3cadb681822ffff440deae07a11cd20afc9 | |
parent | 6d0cbbd5967b42100253e4d8ceff610d1edf3897 (diff) | |
download | u-boot-ec60a279ec6138d9d9f8e73b12625e0052ec4793.tar.gz |
arm64: zynqmp: Access timestamp_ref_ctrl register only if running in el3
Access the timestamp ref ctrl register only if runinng
at el3 level otherwise just return. This change fixes
the issue when CRL APB is marked as secure and accessing
when not in el3 causes exception.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 44af49782cc..c198a4d9206 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -277,10 +277,13 @@ int board_early_init_r(void) { u32 val; + if (current_el() != 3) + return 0; + val = readl(&crlapb_base->timestamp_ref_ctrl); val &= ZYNQMP_CRL_APB_TIMESTAMP_REF_CTRL_CLKACT; - if (current_el() == 3 && !val) { + if (!val) { val = readl(&crlapb_base->timestamp_ref_ctrl); val |= ZYNQMP_CRL_APB_TIMESTAMP_REF_CTRL_CLKACT; writel(val, &crlapb_base->timestamp_ref_ctrl); |