blob: 3164cc5ac44b618d244f11a574391bfe3947ca1f [file] [log] [blame]
Wolfgang Denk9da240c2005-10-05 00:19:34 +02001/*
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 Denkbc650fa2005-10-05 01:51:29 +020026 * Adapted for KwikByte KB920x board from at91rm9200dk.c: 22APR2005
Wolfgang Denk9da240c2005-10-05 00:19:34 +020027 */
28
29#include <common.h>
30#include <asm/arch/AT91RM9200.h>
Jens Scharsigdab7cb82010-01-23 12:03:45 +010031#include <asm/io.h>
32#include <netdev.h>
33#if defined(CONFIG_DRIVER_ETHER)
Wolfgang Denkbc650fa2005-10-05 01:51:29 +020034#include <at91rm9200_net.h>
35#include <lxt971a.h>
Jens Scharsigdab7cb82010-01-23 12:03:45 +010036#endif
Wolfgang Denk9da240c2005-10-05 00:19:34 +020037
Wolfgang Denk6405a152006-03-31 18:32:53 +020038DECLARE_GLOBAL_DATA_PTR;
39
Wolfgang Denk9da240c2005-10-05 00:19:34 +020040/*
41 * Miscelaneous platform dependent initialisations
42 */
43
44void lowlevel_init(void) {
45 /* Required by assembly functions - do nothing */
46}
47
48int board_init (void)
49{
Wolfgang Denk9da240c2005-10-05 00:19:34 +020050 /* 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
64int dram_init (void)
65{
Wolfgang Denk9da240c2005-10-05 00:19:34 +020066 gd->bd->bi_dram[0].start = PHYS_SDRAM;
67 gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
68 return 0;
69}
Wolfgang Denkbc650fa2005-10-05 01:51:29 +020070
71#ifdef CONFIG_DRIVER_ETHER
Jon Loeliger96892a92007-07-09 18:31:28 -050072#if defined(CONFIG_CMD_NET)
Wolfgang Denkbc650fa2005-10-05 01:51:29 +020073
74unsigned int lxt972_IsPhyConnected (AT91PS_EMAC p_mac);
75UCHAR lxt972_GetLinkSpeed (AT91PS_EMAC p_mac);
76UCHAR lxt972_InitPhy (AT91PS_EMAC p_mac);
77UCHAR 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 */
89void 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 Loeliger96892a92007-07-09 18:31:28 -050097#endif
Wolfgang Denkbc650fa2005-10-05 01:51:29 +020098#endif /* CONFIG_DRIVER_ETHER */
Jens Scharsigdab7cb82010-01-23 12:03:45 +010099
100#ifdef CONFIG_DRIVER_AT91EMAC
101int board_eth_init(bd_t *bis)
102{
103 int rc = 0;
104 rc = at91emac_register(bis, 0);
105 return rc;
106}
107#endif