1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
7 #include <fdt_support.h>
10 #include <asm/arch/sys_proto.h>
11 #include <asm/arch/mx7ulp-pins.h>
12 #include <asm/arch/iomux.h>
13 #include <asm/mach-imx/boot_mode.h>
15 DECLARE_GLOBAL_DATA_PTR;
17 #define UART_PAD_CTRL (PAD_CTL_PUS_UP)
21 gd->ram_size = imx_ddr_size();
26 static iomux_cfg_t const lpuart4_pads[] = {
27 MX7ULP_PAD_PTC3__LPUART4_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
28 MX7ULP_PAD_PTC2__LPUART4_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
31 static void setup_iomux_uart(void)
33 mx7ulp_iomux_setup_multiple_pads(lpuart4_pads,
34 ARRAY_SIZE(lpuart4_pads));
37 int board_early_init_f(void)
46 /* address of boot parameters */
47 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
52 #if IS_ENABLED(CONFIG_OF_BOARD_SETUP)
53 int ft_board_setup(void *blob, bd_t *bd)
58 if (get_boot_device() == USB_BOOT) {
59 path = fdt_get_alias(blob, "mmc0");
61 puts("Not found mmc0\n");
65 nodeoff = fdt_path_offset(blob, path);
69 printf("Found usdhc0 node\n");
70 if (fdt_get_property(blob, nodeoff, "vqmmc-supply",
72 rc = fdt_delprop(blob, nodeoff, "vqmmc-supply");
74 puts("Removed vqmmc-supply property\n");
76 rc = fdt_setprop(blob, nodeoff,
78 if (rc == -FDT_ERR_NOSPACE) {
79 rc = fdt_increase_size(blob, 32);
83 printf("Failed to add no-1-8-v property, %d\n", rc);
85 puts("Added no-1-8-v property\n");
88 printf("Failed to remove vqmmc-supply property, %d\n", rc);