2 * Copyright 2015 - 2016 Xilinx, Inc.
4 * Michal Simek <michal.simek@xilinx.com>
6 * SPDX-License-Identifier: GPL-2.0+
10 #include <debug_uart.h>
15 #include <asm/arch/hardware.h>
16 #include <asm/arch/sys_proto.h>
18 void board_init_f(ulong dummy
)
23 #ifdef CONFIG_DEBUG_UART
24 /* Uart debug for sure */
26 puts("Debug uart enabled\n"); /* or printch() */
28 /* Delay is required for clocks to be propagated */
32 memset(__bss_start
, 0, __bss_end
- __bss_start
);
34 /* No need to call timer init - it is empty for ZynqMP */
35 board_init_r(NULL
, 0);
38 static void ps_mode_reset(ulong mode
)
40 writel(mode
<< ZYNQMP_CRL_APB_BOOT_PIN_CTRL_OUT_EN_SHIFT
,
41 &crlapb_base
->boot_pin_ctrl
);
43 writel(mode
<< ZYNQMP_CRL_APB_BOOT_PIN_CTRL_OUT_VAL_SHIFT
|
44 mode
<< ZYNQMP_CRL_APB_BOOT_PIN_CTRL_OUT_EN_SHIFT
,
45 &crlapb_base
->boot_pin_ctrl
);
49 * Set default PS_MODE1 which is used for USB ULPI phy reset
50 * Also other resets can be connected to this certain pin
53 # define MODE_RESET PS_MODE1
56 #ifdef CONFIG_SPL_BOARD_INIT
57 void spl_board_init(void)
59 preloader_console_init();
60 ps_mode_reset(MODE_RESET
);
65 u32
spl_boot_device(void)
70 #if defined(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE_ENABLED)
71 /* Change default boot mode at run-time */
72 writel(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE
<< BOOT_MODE_ALT_SHIFT
,
73 &crlapb_base
->boot_mode
);
76 reg
= readl(&crlapb_base
->boot_mode
);
77 if (reg
>> BOOT_MODE_ALT_SHIFT
)
78 reg
>>= BOOT_MODE_ALT_SHIFT
;
80 bootmode
= reg
& BOOT_MODES_MASK
;
84 return BOOT_DEVICE_RAM
;
85 #ifdef CONFIG_SPL_MMC_SUPPORT
87 case SD1_LSHFT_MODE
: /* not working on silicon v1 */
88 /* if both controllers enabled, then these two are the second controller */
89 #if defined(CONFIG_ZYNQ_SDHCI0) && defined(CONFIG_ZYNQ_SDHCI1)
90 return BOOT_DEVICE_MMC2
;
91 /* else, fall through, the one SDHCI controller that is enabled is number 1 */
95 return BOOT_DEVICE_MMC1
;
97 #ifdef CONFIG_SPL_DFU_SUPPORT
99 return BOOT_DEVICE_DFU
;
101 #ifdef CONFIG_SPL_SATA_SUPPORT
103 return BOOT_DEVICE_SATA
;
105 #ifdef CONFIG_SPL_SPI_SUPPORT
106 case QSPI_MODE_24BIT
:
107 case QSPI_MODE_32BIT
:
108 return BOOT_DEVICE_SPI
;
111 printf("Invalid Boot Mode:0x%x\n", bootmode
);
118 #ifdef CONFIG_SPL_OS_BOOT
119 int spl_start_uboot(void)
127 #ifdef CONFIG_SPL_LOAD_FIT
128 int board_fit_config_name_match(const char *name
)
130 /* Just empty function now - can't decide what to choose */
131 debug("%s: %s\n", __func__
, name
);