diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2010-02-01 21:29:48 +0100 |
---|---|---|
committer | Tom Rix <Tom.Rix@windriver.com> | 2010-02-12 12:31:54 -0600 |
commit | cf3c142ee4be0f077f8b84593f1b24b35d14039e (patch) | |
tree | 7687c04cea8b29ec69a8ef2ebc64864d46a20ab1 /board/edb93xx/edb93xx.c | |
parent | d798e27b14543762f9f5d0561a3430c7f9e2153b (diff) | |
download | u-boot-imx-cf3c142ee4be0f077f8b84593f1b24b35d14039e.zip u-boot-imx-cf3c142ee4be0f077f8b84593f1b24b35d14039e.tar.gz u-boot-imx-cf3c142ee4be0f077f8b84593f1b24b35d14039e.tar.bz2 |
Add support for EDB93xx boards
Added support for the following EDB93xx boards:
EDB9301
EDB9302
EDB9302A
EDB9307
EDB9307A
EDB93012
EDB9315
EDB9315A
Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Diffstat (limited to 'board/edb93xx/edb93xx.c')
-rw-r--r-- | board/edb93xx/edb93xx.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/board/edb93xx/edb93xx.c b/board/edb93xx/edb93xx.c new file mode 100644 index 0000000..4df2246 --- /dev/null +++ b/board/edb93xx/edb93xx.c @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net> + * + * (C) Copyright 2002 2003 + * Network Audio Technologies, Inc. <www.netaudiotech.com> + * Adam Bezanson <bezanson@netaudiotech.com> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <netdev.h> +#include <asm/arch/ep93xx.h> +#include <asm/io.h> + +DECLARE_GLOBAL_DATA_PTR; + +#define MAX_BANK_SIZE 0x04000000 /* 64 MB */ + +static ulong const bank_addr[CONFIG_NR_DRAM_BANKS] = { + PHYS_SDRAM_1, +#ifdef PHYS_SDRAM_2 + PHYS_SDRAM_2, +#endif +#ifdef PHYS_SDRAM_3 + PHYS_SDRAM_3, +#endif +#ifdef PHYS_SDRAM_4 + PHYS_SDRAM_4 +#endif +}; + +int board_init(void) +{ + struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE; + + icache_enable(); + +#ifdef USE_920T_MMU + dcache_enable(); +#endif + + /* + * set UARTBAUD bit to drive UARTs with 14.7456MHz instead of + * 14.7456/2 MHz + */ + uint32_t value = readl(&syscon->pwrcnt); + value |= SYSCON_PWRCNT_UART_BAUD; + writel(value, &syscon->pwrcnt); + + /* Machine number, as defined in linux/arch/arm/tools/mach-types */ + gd->bd->bi_arch_number = CONFIG_MACH_TYPE; + + /* adress of boot parameters */ + gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR; + + /* We have a console */ + gd->have_console = 1; + + return 0; +} + +int board_eth_init(bd_t *bd) +{ + return ep93xx_eth_initialize(0, MAC_BASE); +} + +int dram_init(void) +{ + unsigned int *src, *dst; + int i; + + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { + const ulong bank_size = get_ram_size((long *)bank_addr[i], + MAX_BANK_SIZE); + if (bank_size) { + gd->bd->bi_dram[i].start = bank_addr[i]; + gd->bd->bi_dram[i].size = bank_size; + } + } + + /* copy exception vectors */ + src = (unsigned int *)_armboot_start; + dst = (unsigned int *)PHYS_SDRAM_1; + memcpy(dst, src, 16 * sizeof(unsigned int)); + + return 0; +} |