2 * Freescale i.MX28 Boot setup
4 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
5 * on behalf of DENX Software Engineering GmbH
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include <asm/arch/iomux-mx28.h>
30 #include <asm/arch/imx-regs.h>
31 #include <asm/arch/sys_proto.h>
33 #include "mx28_init.h"
36 * This delay function is intended to be used only in early stage of boot, where
37 * clock are not set up yet. The timer used here is reset on every boot and
38 * takes a few seconds to roll. The boot doesn't take that long, so to keep the
39 * code simple, it doesn't take rolling into consideration.
41 #define HW_DIGCTRL_MICROSECONDS 0x8001c0c0
42 void early_delay(int delay)
44 uint32_t st = readl(HW_DIGCTRL_MICROSECONDS);
46 while (st > readl(HW_DIGCTRL_MICROSECONDS))
50 void mx28_common_spl_init(const iomux_cfg_t *iomux_setup,
51 const unsigned int iomux_size)
53 struct mx28_spl_data *data = (struct mx28_spl_data *)
54 ((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf);
56 mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
60 data->mem_dram_size = mx28_mem_get_size();
62 mx28_power_wait_pswitch();
65 /* Support aparatus */
66 inline void board_init_f(unsigned long bootflag)
72 inline void board_init_r(gd_t *id, ulong dest_addr)
78 void serial_putc(const char c) {}
79 void serial_puts(const char *s) {}
80 void hang(void) __attribute__ ((noreturn));