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: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
0b3a4e414b
commit
29bd0e6688
|
@ -10,6 +10,7 @@
|
|||
#include <platform.h>
|
||||
#include <xlat_tables.h>
|
||||
#include "../zynqmp_private.h"
|
||||
#include "pm_api_sys.h"
|
||||
|
||||
/*
|
||||
* Table of regions to map using the MMU.
|
||||
|
@ -241,7 +242,12 @@ int zynqmp_is_pmu_up(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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue