arm64: versal: Move IOU_SWITCH_DIVISOR0 to Kconfig
authorMichal Simek <michal.simek@xilinx.com>
Mon, 28 Jan 2019 10:12:41 +0000 (11:12 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 14 Feb 2019 13:31:10 +0000 (14:31 +0100)
Move hardcoded IOU_SWITCH_DIVISOR0 to Kconfig to be able to set it up
for different platforms.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/mach-versal/Kconfig
board/xilinx/versal/board.c

index f291800bc9713aed9e030ec765c262ea74d7503e..26d1756371013185a42e546274e21bd5eed81b7c 100644 (file)
@@ -41,6 +41,12 @@ config VERSAL_OF_BOARD_DTB_ADDR
        default 0x1000
        depends on OF_BOARD
 
+config IOU_SWITCH_DIVISOR0
+       hex "IOU switch divisor0"
+       default 0x20
+       help
+         Setup time clock divisor for input clock.
+
 config SYS_MEM_RSVD_FOR_MMU
        bool "Reserve memory for MMU Table"
        help
index fe61125d92a81db7d708ee565e76ec855a0e14c8..90751477b5e1d0aa54ab5a0c1ba6b0ac304a8bb2 100644 (file)
@@ -26,8 +26,11 @@ int board_early_init_r(void)
        if (current_el() != 3)
                return 0;
 
+       debug("iou_switch ctrl div0 %x\n",
+             readl(&crlapb_base->iou_switch_ctrl));
+
        writel(IOU_SWITCH_CTRL_CLKACT_BIT |
-              (0x20 << IOU_SWITCH_CTRL_DIVISOR0_SHIFT),
+              (CONFIG_IOU_SWITCH_DIVISOR0 << IOU_SWITCH_CTRL_DIVISOR0_SHIFT),
               &crlapb_base->iou_switch_ctrl);
 
        /* Global timer init - Program time stamp reference clk */