Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 1 | /* |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 2 | * (C) Copyright 2010 Andreas Bießmann <andreas.devel@gmail.com> |
| 3 | * |
| 4 | * derived from previous work |
| 5 | * |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 6 | * (C) Copyright 2002 |
| 7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 8 | * Marius Groeger <mgroeger@sysgo.de> |
| 9 | * |
| 10 | * See file CREDITS for list of people who contributed to this |
| 11 | * project. |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU General Public License as |
| 15 | * published by the Free Software Foundation; either version 2 of |
| 16 | * the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This program is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | * GNU General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with this program; if not, write to the Free Software |
| 25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 26 | * MA 02111-1307 USA |
| 27 | */ |
| 28 | |
| 29 | #include <common.h> |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 30 | #include <netdev.h> |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 31 | #include <asm/arch/hardware.h> |
| 32 | #include <asm/arch/at91_pio.h> |
| 33 | #include <asm/arch/at91_pmc.h> |
Andreas Bießmann | 3432a93 | 2011-06-12 01:49:14 +0000 | [diff] [blame] | 34 | #include <asm/arch/at91_common.h> |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 35 | #include <asm/io.h> |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 36 | |
| 37 | DECLARE_GLOBAL_DATA_PTR; |
| 38 | |
| 39 | /* ------------------------------------------------------------------------- */ |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 40 | int board_init(void) |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 41 | { |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 42 | at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE; |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 43 | |
| 44 | /* |
| 45 | * Correct IRDA resistor problem |
| 46 | * Set PA23_TXD in Output |
| 47 | */ |
Jens Scharsig | 8073399 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 48 | writel(ATMEL_PMX_AA_TXD2, &pio->pioa.oer); |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 49 | |
| 50 | /* arch number of AT91RM9200EK-Board */ |
| 51 | gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK; |
| 52 | /* adress of boot parameters */ |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 53 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 54 | |
| 55 | return 0; |
| 56 | } |
| 57 | |
Andreas Bießmann | 3432a93 | 2011-06-12 01:49:14 +0000 | [diff] [blame] | 58 | int board_early_init_f(void) |
| 59 | { |
| 60 | at91_seriald_hw_init(); |
| 61 | return 0; |
| 62 | } |
| 63 | |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 64 | int dram_init (void) |
| 65 | { |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 66 | /* dram_init must store complete ramsize in gd->ram_size */ |
Albert ARIBAUD | a55d23c | 2011-07-03 05:55:33 +0000 | [diff] [blame] | 67 | gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 68 | CONFIG_SYS_SDRAM_SIZE); |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 69 | return 0; |
| 70 | } |
| 71 | |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 72 | #ifdef CONFIG_DRIVER_AT91EMAC |
| 73 | int board_eth_init(bd_t *bis) |
| 74 | { |
Jens Scharsig | 8073399 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 75 | return at91emac_register(bis, (u32) ATMEL_BASE_EMAC); |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 76 | } |
| 77 | #endif |