Commit 29bd0e66 authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu Committed by Siva Durga Prasad Paladugu
Browse files

xilinx: zynqmp: Read bootmode register using PM API



Read boot mode register using pm_mmio_read if pmu is
present otherwise access it directly using mmio_read_32().
Signed-off-by: default avatarSiva Durga Prasad Paladugu <sivadur@xilinx.com>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 0b3a4e41
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <platform.h> #include <platform.h>
#include <xlat_tables.h> #include <xlat_tables.h>
#include "../zynqmp_private.h" #include "../zynqmp_private.h"
#include "pm_api_sys.h"
/* /*
* Table of regions to map using the MMU. * Table of regions to map using the MMU.
...@@ -241,7 +242,12 @@ int zynqmp_is_pmu_up(void) ...@@ -241,7 +242,12 @@ int zynqmp_is_pmu_up(void)
unsigned int zynqmp_get_bootmode(void) unsigned int zynqmp_get_bootmode(void)
{ {
uint32_t r = mmio_read_32(CRL_APB_BOOT_MODE_USER); uint32_t r;
if (zynqmp_is_pmu_up())
pm_mmio_read(CRL_APB_BOOT_MODE_USER, &r);
else
r = mmio_read_32(CRL_APB_BOOT_MODE_USER);
return r & CRL_APB_BOOT_MODE_MASK; return r & CRL_APB_BOOT_MODE_MASK;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment