diff options
author | Michal Simek <michal.simek@xilinx.com> | 2020-08-20 10:54:45 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2020-09-23 10:31:40 +0200 |
commit | 4d9bc795ae180b53fd561f06f0307282c00895b4 (patch) | |
tree | 33749fce8026b78ce0234506143fd44433fdb4c7 /board | |
parent | ced4d46626b06298d19e61279f49bf5158c5e2a6 (diff) | |
download | u-boot-4d9bc795ae180b53fd561f06f0307282c00895b4.zip u-boot-4d9bc795ae180b53fd561f06f0307282c00895b4.tar.gz u-boot-4d9bc795ae180b53fd561f06f0307282c00895b4.tar.bz2 |
xilinx: zynqmp: Get zynqmp_get_bootmode() out of CONFIG_BOARD_LATE_INIT
This function will be also used by different code.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index fd36312..4392448 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -434,6 +434,24 @@ void reset_cpu(ulong addr) { } +static u8 __maybe_unused zynqmp_get_bootmode(void) +{ + u8 bootmode; + u32 reg = 0; + int ret; + + ret = zynqmp_mmio_read((ulong)&crlapb_base->boot_mode, ®); + if (ret) + return -EINVAL; + + if (reg >> BOOT_MODE_ALT_SHIFT) + reg >>= BOOT_MODE_ALT_SHIFT; + + bootmode = reg & BOOT_MODES_MASK; + + return bootmode; +} + #if defined(CONFIG_BOARD_LATE_INIT) static const struct { u32 bit; @@ -517,24 +535,6 @@ static int set_fdtfile(void) return 0; } -static u8 zynqmp_get_bootmode(void) -{ - u8 bootmode; - u32 reg = 0; - int ret; - - ret = zynqmp_mmio_read((ulong)&crlapb_base->boot_mode, ®); - if (ret) - return -EINVAL; - - if (reg >> BOOT_MODE_ALT_SHIFT) - reg >>= BOOT_MODE_ALT_SHIFT; - - bootmode = reg & BOOT_MODES_MASK; - - return bootmode; -} - int board_late_init(void) { u8 bootmode; |