1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2018, 2021 NXP
13 #include <asm/global_data.h>
14 #include <dm/uclass.h>
15 #include <dm/device.h>
16 #include <dm/uclass-internal.h>
17 #include <dm/device-internal.h>
21 #include <asm/arch/sci/sci.h>
22 #include <asm/arch/imx8-pins.h>
23 #include <asm/arch/iomux.h>
24 #include <asm/arch/sys_proto.h>
26 DECLARE_GLOBAL_DATA_PTR;
28 #define GPIO_PAD_CTRL ((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
29 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
30 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
31 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
33 #define USDHC2_SD_PWR IMX_GPIO_NR(4, 19)
34 static iomux_cfg_t usdhc2_sd_pwr[] = {
35 SC_P_USDHC1_RESET_B | MUX_PAD_CTRL(GPIO_PAD_CTRL),
38 void spl_board_init(void)
42 uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(imx8_scu), &dev);
44 uclass_find_first_device(UCLASS_MISC, &dev);
46 for (; dev; uclass_find_next_device(&dev)) {
47 if (device_probe(dev))
57 imx8_iomux_setup_multiple_pads(usdhc2_sd_pwr, ARRAY_SIZE(usdhc2_sd_pwr));
58 gpio_direction_output(USDHC2_SD_PWR, 0);
60 preloader_console_init();
62 puts("Normal Boot\n");
65 void spl_board_prepare_for_boot(void)
67 imx8_power_off_pd_devices(NULL, 0);
70 #ifdef CONFIG_SPL_LOAD_FIT
71 int board_fit_config_name_match(const char *name)
73 /* Just empty function now - can't decide what to choose */
74 debug("%s: %s\n", __func__, name);
80 void board_init_f(ulong dummy)
82 /* Clear global data */
83 memset((void *)gd, 0, sizeof(gd_t));
86 memset(__bss_start, 0, __bss_end - __bss_start);
88 board_init_r(NULL, 0);