Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 2 | /* |
Andreas Bießmann | 09c2b8f | 2016-05-01 03:46:16 +0200 | [diff] [blame] | 3 | * (C) Copyright 2010 Andreas Bießmann <andreas@biessmann.org> |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 4 | * |
| 5 | * derived from previous work |
| 6 | * |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 7 | * (C) Copyright 2002 |
| 8 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 9 | * Marius Groeger <mgroeger@sysgo.de> |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #include <common.h> |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 13 | #include <netdev.h> |
Simon Glass | c62db35 | 2017-05-31 19:47:48 -0600 | [diff] [blame] | 14 | #include <asm/mach-types.h> |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 15 | #include <asm/arch/hardware.h> |
| 16 | #include <asm/arch/at91_pio.h> |
Andreas Bießmann | 3432a93 | 2011-06-12 01:49:14 +0000 | [diff] [blame] | 17 | #include <asm/arch/at91_common.h> |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 18 | #include <asm/io.h> |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 19 | |
| 20 | DECLARE_GLOBAL_DATA_PTR; |
| 21 | |
| 22 | /* ------------------------------------------------------------------------- */ |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 23 | int board_init(void) |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 24 | { |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 25 | at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE; |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | * Correct IRDA resistor problem |
| 29 | * Set PA23_TXD in Output |
| 30 | */ |
Jens Scharsig | 8073399 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 31 | writel(ATMEL_PMX_AA_TXD2, &pio->pioa.oer); |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 32 | |
| 33 | /* arch number of AT91RM9200EK-Board */ |
| 34 | gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK; |
| 35 | /* adress of boot parameters */ |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 36 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 37 | |
| 38 | return 0; |
| 39 | } |
| 40 | |
Andreas Bießmann | 3432a93 | 2011-06-12 01:49:14 +0000 | [diff] [blame] | 41 | int board_early_init_f(void) |
| 42 | { |
| 43 | at91_seriald_hw_init(); |
| 44 | return 0; |
| 45 | } |
| 46 | |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 47 | int dram_init (void) |
| 48 | { |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 49 | /* dram_init must store complete ramsize in gd->ram_size */ |
Albert ARIBAUD | a55d23c | 2011-07-03 05:55:33 +0000 | [diff] [blame] | 50 | gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, |
Andreas Bießmann | 99fa97e | 2010-10-18 22:58:29 +0200 | [diff] [blame] | 51 | CONFIG_SYS_SDRAM_SIZE); |
Ulf Samuelsson | cb82a53 | 2009-03-27 23:26:43 +0100 | [diff] [blame] | 52 | return 0; |
| 53 | } |
| 54 | |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 55 | #ifdef CONFIG_DRIVER_AT91EMAC |
| 56 | int board_eth_init(bd_t *bis) |
| 57 | { |
Jens Scharsig | 8073399 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 58 | return at91emac_register(bis, (u32) ATMEL_BASE_EMAC); |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 59 | } |
| 60 | #endif |