summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMichal Simek <[email protected]>2026-06-23 14:53:33 +0200
committerMichal Simek <[email protected]>2026-07-08 08:55:51 +0200
commitd885e802ce8722a4dae77255b7aa16ccaf7976d8 (patch)
tree5cc26398df406e9ceacca1b441ea79e03d7060c2 /board
parentae8f2474fe6aad8dc3cbc0f940bf8643611bc7b7 (diff)
arm64: versal-net: Move board_early_init_r clock setup to mach code
board_early_init_r() programmed the IOU switch clock and the system timestamp counter directly with readl()/writel() in board code. This is SoC register setup rather than board policy, and the same block is duplicated across the Xilinx SoCs. Move it into versal_net_timer_setup() in arch/arm/mach-versal-net so the board hook only keeps the EL3 guard and calls the helper. Signed-off-by: Michal Simek <[email protected]> Link: https://patch.msgid.link/10dd9f35d03be0402ce13475f20b2cd3761189a6.1782219202.git.michal.simek@amd.com
Diffstat (limited to 'board')
-rw-r--r--board/xilinx/versal-net/board.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c
index 65b2a451ad7..a40039a1dc8 100644
--- a/board/xilinx/versal-net/board.c
+++ b/board/xilinx/versal-net/board.c
@@ -148,46 +148,10 @@ int board_early_init_f(void)
int board_early_init_r(void)
{
- u32 val;
-
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 |
- (CONFIG_IOU_SWITCH_DIVISOR0 << IOU_SWITCH_CTRL_DIVISOR0_SHIFT),
- &crlapb_base->iou_switch_ctrl);
-
- /* Global timer init - Program time stamp reference clk */
- val = readl(&crlapb_base->timestamp_ref_ctrl);
- val |= CRL_APB_TIMESTAMP_REF_CTRL_CLKACT_BIT;
- writel(val, &crlapb_base->timestamp_ref_ctrl);
-
- debug("ref ctrl 0x%x\n",
- readl(&crlapb_base->timestamp_ref_ctrl));
-
- /* Clear reset of timestamp reg */
- writel(0, &crlapb_base->rst_timestamp);
-
- /*
- * Program freq register in System counter and
- * enable system counter.
- */
- writel(CONFIG_COUNTER_FREQUENCY,
- &iou_scntr_secure->base_frequency_id_register);
-
- debug("counter val 0x%x\n",
- readl(&iou_scntr_secure->base_frequency_id_register));
-
- writel(IOU_SCNTRS_CONTROL_EN,
- &iou_scntr_secure->counter_control_register);
-
- debug("scntrs control 0x%x\n",
- readl(&iou_scntr_secure->counter_control_register));
- debug("timer 0x%llx\n", get_ticks());
- debug("timer 0x%llx\n", get_ticks());
+ versal_net_timer_setup();
return 0;
}