Commit 2cb5bac9 authored by Soren Brinkmann's avatar Soren Brinkmann
Browse files

zynqmp: Introduce zynqmp_get_bootmode



Provide a function to retrieve the bootmode.
Signed-off-by: default avatarSoren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent e543e79b
...@@ -271,6 +271,13 @@ int zynqmp_is_pmu_up(void) ...@@ -271,6 +271,13 @@ int zynqmp_is_pmu_up(void)
return zynqmp_pmufw_present; return zynqmp_pmufw_present;
} }
unsigned int zynqmp_get_bootmode(void)
{
uint32_t r = mmio_read_32(CRL_APB_BOOT_MODE_USER);
return r & CRL_APB_BOOT_MODE_MASK;
}
void zynqmp_config_setup(void) void zynqmp_config_setup(void)
{ {
zynqmp_discover_pmufw(); zynqmp_discover_pmufw();
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#define CRL_APB_BASE 0xFF5E0000 #define CRL_APB_BASE 0xFF5E0000
#define CRL_APB_RPLL_CTRL (CRL_APB_BASE + 0x30) #define CRL_APB_RPLL_CTRL (CRL_APB_BASE + 0x30)
#define CRL_APB_TIMESTAMP_REF_CTRL (CRL_APB_BASE + 0x128) #define CRL_APB_TIMESTAMP_REF_CTRL (CRL_APB_BASE + 0x128)
#define CRL_APB_BOOT_MODE_USER (CRL_APB_BASE + 0x200)
#define CRL_APB_RESET_CTRL (CRL_APB_BASE + 0x218) #define CRL_APB_RESET_CTRL (CRL_APB_BASE + 0x218)
#define CRL_APB_TIMESTAMP_REF_CTRL_CLKACT_BIT (1 << 24) #define CRL_APB_TIMESTAMP_REF_CTRL_CLKACT_BIT (1 << 24)
...@@ -71,6 +72,9 @@ ...@@ -71,6 +72,9 @@
#define CRL_APB_RESET_CTRL_SOFT_RESET (1 << 4) #define CRL_APB_RESET_CTRL_SOFT_RESET (1 << 4)
#define CRL_APB_BOOT_MODE_MASK (0xf << 0)
#define ZYNQMP_BOOTMODE_JTAG 0
/* system counter registers and bitfields */ /* system counter registers and bitfields */
#define IOU_SCNTRS_BASE 0xFF260000 #define IOU_SCNTRS_BASE 0xFF260000
#define IOU_SCNTRS_CONTROL (IOU_SCNTRS_BASE + 0) #define IOU_SCNTRS_CONTROL (IOU_SCNTRS_BASE + 0)
......
...@@ -38,5 +38,6 @@ void zynqmp_config_setup(void); ...@@ -38,5 +38,6 @@ void zynqmp_config_setup(void);
/* ZynqMP specific functions */ /* ZynqMP specific functions */
unsigned int zynqmp_get_uart_clk(void); unsigned int zynqmp_get_uart_clk(void);
int zynqmp_is_pmu_up(void); int zynqmp_is_pmu_up(void);
unsigned int zynqmp_get_bootmode(void);
#endif /* __ZYNQMP_PRIVATE_H__ */ #endif /* __ZYNQMP_PRIVATE_H__ */
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