1 // SPDX-License-Identifier: GPL-2.0+ 2 /* 3 * Copyright (C) 2016 Freescale Semiconductor, Inc. 4 */ 5 6 #include <common.h> 7 #include <init.h> 8 #include <asm/global_data.h> 9 #include <asm/io.h> 10 #include <asm/arch/sys_proto.h> 11 #include <asm/arch/mx7ulp-pins.h> 12 #include <asm/arch/iomux.h> 13 #include <asm/gpio.h> 14 15 DECLARE_GLOBAL_DATA_PTR; 16 17 #define UART_PAD_CTRL (PAD_CTL_PUS_UP) 18 dram_init(void)19int dram_init(void) 20 { 21 gd->ram_size = imx_ddr_size(); 22 23 #ifdef CONFIG_OPTEE_TZDRAM_SIZE 24 gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE; 25 #endif 26 27 return 0; 28 } 29 30 static iomux_cfg_t const lpuart4_pads[] = { 31 MX7ULP_PAD_PTC3__LPUART4_RX | MUX_PAD_CTRL(UART_PAD_CTRL), 32 MX7ULP_PAD_PTC2__LPUART4_TX | MUX_PAD_CTRL(UART_PAD_CTRL), 33 }; 34 setup_iomux_uart(void)35static void setup_iomux_uart(void) 36 { 37 mx7ulp_iomux_setup_multiple_pads(lpuart4_pads, 38 ARRAY_SIZE(lpuart4_pads)); 39 } 40 board_early_init_f(void)41int board_early_init_f(void) 42 { 43 setup_iomux_uart(); 44 45 return 0; 46 } 47 board_init(void)48int board_init(void) 49 { 50 /* address of boot parameters */ 51 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; 52 53 return 0; 54 } 55 56 #ifdef CONFIG_SPL_BUILD 57 #include <spl.h> 58 59 #ifdef CONFIG_SPL_LOAD_FIT board_fit_config_name_match(const char * name)60int board_fit_config_name_match(const char *name) 61 { 62 if (!strcmp(name, "imx7ulp-com")) 63 return 0; 64 65 return -1; 66 } 67 #endif 68 spl_board_init(void)69void spl_board_init(void) 70 { 71 preloader_console_init(); 72 } 73 board_init_f(ulong dummy)74void board_init_f(ulong dummy) 75 { 76 arch_cpu_init(); 77 78 board_early_init_f(); 79 } 80 #endif 81