2009-08-10 22:32:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Sascha Hauer, Pengutronix
|
|
|
|
* Copyright (C) 2008,2009 Eric Jarrige <jorasse@users.sourceforge.net>
|
|
|
|
* Copyright (C) 2009 Ilya Yanok <yanok@emcraft.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2009-08-10 22:32:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch/imx-regs.h>
|
2012-08-25 05:30:34 +00:00
|
|
|
#include <asm/gpio.h>
|
2009-08-10 22:32:09 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2011-10-13 05:34:59 +00:00
|
|
|
int board_init(void)
|
2009-08-10 22:32:09 +00:00
|
|
|
{
|
2010-03-05 06:36:33 +00:00
|
|
|
#if defined(CONFIG_SYS_NAND_LARGEPAGE)
|
|
|
|
struct system_control_regs *sc_regs =
|
|
|
|
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
|
|
|
|
#endif
|
2009-08-10 22:32:09 +00:00
|
|
|
|
|
|
|
gd->bd->bi_arch_number = MACH_TYPE_IMX27LITE;
|
|
|
|
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
|
|
|
|
|
|
|
|
#ifdef CONFIG_MXC_UART
|
2011-07-01 07:15:52 +00:00
|
|
|
mx27_uart1_init_pins();
|
2009-08-10 22:32:09 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FEC_MXC
|
|
|
|
mx27_fec_init_pins();
|
|
|
|
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
|
2012-08-25 05:30:34 +00:00
|
|
|
gpio_set_value(GPIO_PORTC | 31, 1);
|
2009-08-10 22:32:09 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_MXC_MMC
|
2010-03-05 06:36:33 +00:00
|
|
|
#if defined(CONFIG_MAGNESIUM)
|
|
|
|
mx27_sd1_init_pins();
|
|
|
|
#else
|
2009-08-10 22:32:09 +00:00
|
|
|
mx27_sd2_init_pins();
|
|
|
|
#endif
|
2010-03-05 06:36:33 +00:00
|
|
|
#endif
|
2009-08-10 22:32:09 +00:00
|
|
|
|
2010-03-05 06:36:33 +00:00
|
|
|
#if defined(CONFIG_SYS_NAND_LARGEPAGE)
|
|
|
|
/*
|
|
|
|
* set in FMCR NF_FMS Bit(5) to 1
|
|
|
|
* (NAND Flash with 2 Kbyte page size)
|
|
|
|
*/
|
|
|
|
writel(readl(&sc_regs->fmcr) | (1 << 5), &sc_regs->fmcr);
|
|
|
|
#endif
|
2009-08-10 22:32:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-10-13 05:34:59 +00:00
|
|
|
int dram_init(void)
|
2009-08-10 22:32:09 +00:00
|
|
|
{
|
2010-09-17 11:10:42 +00:00
|
|
|
/* dram_init must store complete ramsize in gd->ram_size */
|
2011-07-03 05:55:33 +00:00
|
|
|
gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
|
2010-09-17 11:10:42 +00:00
|
|
|
PHYS_SDRAM_1_SIZE);
|
|
|
|
return 0;
|
|
|
|
}
|
2009-08-10 22:32:09 +00:00
|
|
|
|
2010-09-17 11:10:42 +00:00
|
|
|
void dram_init_banksize(void)
|
|
|
|
{
|
|
|
|
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
|
2011-07-03 05:55:33 +00:00
|
|
|
gd->bd->bi_dram[0].size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
|
2009-08-10 22:32:09 +00:00
|
|
|
PHYS_SDRAM_1_SIZE);
|
|
|
|
#if CONFIG_NR_DRAM_BANKS > 1
|
|
|
|
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
|
2011-07-03 05:55:33 +00:00
|
|
|
gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2,
|
2009-08-10 22:32:09 +00:00
|
|
|
PHYS_SDRAM_2_SIZE);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int checkboard(void)
|
|
|
|
{
|
2011-10-13 05:34:59 +00:00
|
|
|
puts("Board: ");
|
2010-03-05 06:36:33 +00:00
|
|
|
puts(CONFIG_BOARDNAME);
|
2009-08-10 22:32:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|