blob: 7fce75ade9dda65d1693036b520be8bdbed8bf06 [file] [log] [blame]
Fabio Estevamebc8fcc2019-12-09 10:43:03 -03001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2016 Freescale Semiconductor, Inc.
4 */
5
6#include <common.h>
Simon Glass97589732020-05-10 11:40:02 -06007#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06008#include <asm/global_data.h>
Fabio Estevamebc8fcc2019-12-09 10:43:03 -03009#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
15DECLARE_GLOBAL_DATA_PTR;
16
17#define UART_PAD_CTRL (PAD_CTL_PUS_UP)
18
19int dram_init(void)
20{
21 gd->ram_size = imx_ddr_size();
22
Ricardo Salveti5f371cc2021-08-25 18:47:18 +030023#ifdef CONFIG_OPTEE_TZDRAM_SIZE
24 gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE;
25#endif
26
Fabio Estevamebc8fcc2019-12-09 10:43:03 -030027 return 0;
28}
29
30static 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
35static void setup_iomux_uart(void)
36{
37 mx7ulp_iomux_setup_multiple_pads(lpuart4_pads,
38 ARRAY_SIZE(lpuart4_pads));
39}
40
41int board_early_init_f(void)
42{
43 setup_iomux_uart();
44
45 return 0;
46}
47
48int board_init(void)
49{
50 /* address of boot parameters */
51 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
52
53 return 0;
54}