Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 1 | /* |
Andreas Bießmann | 65c6567 | 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 | 07f9b4e | 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 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 10 | * SPDX-License-Identifier: GPL-2.0+ |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include <common.h> |
Jens Scharsig | dab7cb8 | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 14 | #include <netdev.h> |
Andreas Bießmann | 65c6567 | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 15 | #include <asm/arch/hardware.h> |
| 16 | #include <asm/arch/at91_pio.h> |
| 17 | #include <asm/arch/at91_pmc.h> |
Andreas Bießmann | f9d3f91 | 2011-06-12 01:49:14 +0000 | [diff] [blame] | 18 | #include <asm/arch/at91_common.h> |
Jens Scharsig | dab7cb8 | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 19 | #include <asm/io.h> |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 20 | |
| 21 | DECLARE_GLOBAL_DATA_PTR; |
| 22 | |
| 23 | /* ------------------------------------------------------------------------- */ |
Andreas Bießmann | 65c6567 | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 24 | int board_init(void) |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 25 | { |
Andreas Bießmann | 65c6567 | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 26 | at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE; |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 27 | |
| 28 | /* |
| 29 | * Correct IRDA resistor problem |
| 30 | * Set PA23_TXD in Output |
| 31 | */ |
Jens Scharsig | 58aa563 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 32 | writel(ATMEL_PMX_AA_TXD2, &pio->pioa.oer); |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 33 | |
| 34 | /* arch number of AT91RM9200EK-Board */ |
| 35 | gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK; |
| 36 | /* adress of boot parameters */ |
Andreas Bießmann | 65c6567 | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 37 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 38 | |
| 39 | return 0; |
| 40 | } |
| 41 | |
Andreas Bießmann | f9d3f91 | 2011-06-12 01:49:14 +0000 | [diff] [blame] | 42 | int board_early_init_f(void) |
| 43 | { |
| 44 | at91_seriald_hw_init(); |
| 45 | return 0; |
| 46 | } |
| 47 | |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 48 | int dram_init (void) |
| 49 | { |
Andreas Bießmann | 65c6567 | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 50 | /* dram_init must store complete ramsize in gd->ram_size */ |
Albert ARIBAUD | a960673 | 2011-07-03 05:55:33 +0000 | [diff] [blame] | 51 | gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, |
Andreas Bießmann | 65c6567 | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 52 | CONFIG_SYS_SDRAM_SIZE); |
Ulf Samuelsson | 07f9b4e | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 53 | return 0; |
| 54 | } |
Jens Scharsig | dab7cb8 | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 55 | |
| 56 | #ifdef CONFIG_DRIVER_AT91EMAC |
| 57 | int board_eth_init(bd_t *bis) |
| 58 | { |
Jens Scharsig | 58aa563 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 59 | return at91emac_register(bis, (u32) ATMEL_BASE_EMAC); |
Jens Scharsig | dab7cb8 | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 60 | } |
| 61 | #endif |