2 * (C) Copyright 2014 - 2015 Xilinx, Inc.
3 * Michal Simek <michal.simek@xilinx.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/hardware.h>
11 #include <asm/arch/sys_proto.h>
14 DECLARE_GLOBAL_DATA_PTR;
21 int board_early_init_r(void)
25 val = readl(&crlapb_base->timestamp_ref_ctrl);
26 val |= ZYNQMP_CRL_APB_TIMESTAMP_REF_CTRL_CLKACT;
27 writel(val, &crlapb_base->timestamp_ref_ctrl);
29 /* Program freq register in System counter and enable system counter */
30 writel(gd->cpu_clk, &iou_scntr->base_frequency_id_register);
31 writel(ZYNQMP_IOU_SCNTR_COUNTER_CONTROL_REGISTER_HDBG |
32 ZYNQMP_IOU_SCNTR_COUNTER_CONTROL_REGISTER_EN,
33 &iou_scntr->counter_control_register);
40 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
50 void reset_cpu(ulong addr)
55 int board_mmc_init(bd_t *bd)
59 #if defined(CONFIG_ZYNQ_SDHCI)
60 # if defined(CONFIG_ZYNQ_SDHCI0)
61 ret = zynq_sdhci_init(ZYNQ_SDHCI_BASEADDR0);
63 # if defined(CONFIG_ZYNQ_SDHCI1)
64 ret |= zynq_sdhci_init(ZYNQ_SDHCI_BASEADDR1);
72 int board_late_init(void)
77 reg = readl(&crlapb_base->boot_mode);
78 bootmode = reg & BOOT_MODES_MASK;
82 setenv("modeboot", "sdboot");
85 printf("Invalid Boot Mode:0x%x\n", bootmode);