Wolfgang Denk | 99b0d28 | 2005-10-05 00:19:34 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 4 | * Marius Groeger <mgroeger@sysgo.de> |
| 5 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | /* |
Wolfgang Denk | 080bdb7 | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 26 | * Adapted for KwikByte KB920x board from at91rm9200dk.c: 22APR2005 |
Wolfgang Denk | 99b0d28 | 2005-10-05 00:19:34 +0200 | [diff] [blame] | 27 | */ |
| 28 | |
| 29 | #include <common.h> |
| 30 | #include <asm/arch/AT91RM9200.h> |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 31 | #include <asm/io.h> |
| 32 | #include <netdev.h> |
| 33 | #if defined(CONFIG_DRIVER_ETHER) |
Wolfgang Denk | 080bdb7 | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 34 | #include <at91rm9200_net.h> |
| 35 | #include <lxt971a.h> |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 36 | #endif |
Wolfgang Denk | 99b0d28 | 2005-10-05 00:19:34 +0200 | [diff] [blame] | 37 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 38 | DECLARE_GLOBAL_DATA_PTR; |
| 39 | |
Wolfgang Denk | 99b0d28 | 2005-10-05 00:19:34 +0200 | [diff] [blame] | 40 | /* |
| 41 | * Miscelaneous platform dependent initialisations |
| 42 | */ |
| 43 | |
| 44 | void lowlevel_init(void) { |
| 45 | /* Required by assembly functions - do nothing */ |
| 46 | } |
| 47 | |
| 48 | int board_init (void) |
| 49 | { |
Wolfgang Denk | 99b0d28 | 2005-10-05 00:19:34 +0200 | [diff] [blame] | 50 | /* Enable Ctrlc */ |
| 51 | console_init_f (); |
| 52 | |
| 53 | /* memory and cpu-speed are setup before relocation */ |
| 54 | /* so we do _nothing_ here */ |
| 55 | |
| 56 | gd->bd->bi_arch_number = MACH_TYPE_KB9200; |
| 57 | |
| 58 | /* adress of boot parameters */ |
| 59 | gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; |
| 60 | |
| 61 | return 0; |
| 62 | } |
| 63 | |
| 64 | int dram_init (void) |
| 65 | { |
Wolfgang Denk | 99b0d28 | 2005-10-05 00:19:34 +0200 | [diff] [blame] | 66 | gd->bd->bi_dram[0].start = PHYS_SDRAM; |
| 67 | gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; |
| 68 | return 0; |
| 69 | } |
Wolfgang Denk | 080bdb7 | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 70 | |
| 71 | #ifdef CONFIG_DRIVER_ETHER |
Jon Loeliger | c508a4c | 2007-07-09 18:31:28 -0500 | [diff] [blame] | 72 | #if defined(CONFIG_CMD_NET) |
Wolfgang Denk | 080bdb7 | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 73 | |
| 74 | unsigned int lxt972_IsPhyConnected (AT91PS_EMAC p_mac); |
| 75 | UCHAR lxt972_GetLinkSpeed (AT91PS_EMAC p_mac); |
| 76 | UCHAR lxt972_InitPhy (AT91PS_EMAC p_mac); |
| 77 | UCHAR lxt972_AutoNegotiate (AT91PS_EMAC p_mac, int *status); |
| 78 | |
| 79 | /* |
| 80 | * Name: |
| 81 | * at91rm9200_GetPhyInterface |
| 82 | * Description: |
| 83 | * Initialise the interface functions to the PHY |
| 84 | * Arguments: |
| 85 | * None |
| 86 | * Return value: |
| 87 | * None |
| 88 | */ |
| 89 | void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops) |
| 90 | { |
| 91 | p_phyops->Init = lxt972_InitPhy; |
| 92 | p_phyops->IsPhyConnected = lxt972_IsPhyConnected; |
| 93 | p_phyops->GetLinkSpeed = lxt972_GetLinkSpeed; |
| 94 | p_phyops->AutoNegotiate = lxt972_AutoNegotiate; |
| 95 | } |
| 96 | |
Jon Loeliger | c508a4c | 2007-07-09 18:31:28 -0500 | [diff] [blame] | 97 | #endif |
Wolfgang Denk | 080bdb7 | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 98 | #endif /* CONFIG_DRIVER_ETHER */ |
Jens Scharsig | c041e9d | 2010-01-23 12:03:45 +0100 | [diff] [blame] | 99 | |
| 100 | #ifdef CONFIG_DRIVER_AT91EMAC |
| 101 | int board_eth_init(bd_t *bis) |
| 102 | { |
| 103 | int rc = 0; |
| 104 | rc = at91emac_register(bis, 0); |
| 105 | return rc; |
| 106 | } |
| 107 | #endif |