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 #include <common.h>
26 #include <exports.h>
27 #include <netdev.h>
28 #include <asm/arch/AT91RM9200.h>
29 #include <asm/io.h>
30 #if defined(CONFIG_DRIVER_ETHER)
31 #include <at91rm9200_net.h>
32 #include <dm9161.h>
33 #endif
34 
35 DECLARE_GLOBAL_DATA_PTR;
36 
37 /* ------------------------------------------------------------------------- */
38 /*
39  * Miscelaneous platform dependent initialisations
40  */
41 
42 int board_init (void)
43 {
44 	/* Enable Ctrlc */
45 	console_init_f ();
46 
47 	/*
48 	 * Correct IRDA resistor problem
49 	 * Set PA23_TXD in Output
50 	 */
51 	writel(AT91C_PA23_TXD2, ((AT91PS_PIO) AT91C_BASE_PIOA)->PIO_OER);
52 
53 	/*
54 	 * memory and cpu-speed are setup before relocation
55 	 * so we do _nothing_ here
56 	 */
57 
58 	/* arch number of AT91RM9200EK-Board */
59 	gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK;
60 	/* adress of boot parameters */
61 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
62 
63 	return 0;
64 }
65 
66 int dram_init (void)
67 {
68 	gd->bd->bi_dram[0].start = PHYS_SDRAM;
69 	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
70 	return 0;
71 }
72 
73 #if defined(CONFIG_DRIVER_ETHER) && defined(CONFIG_CMD_NET)
74 /*
75  * Name:
76  *	at91rm9200_GetPhyInterface
77  * Description:
78  *	Initialise the interface functions to the PHY
79  * Arguments:
80  *	None
81  * Return value:
82  *	None
83  */
84 void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
85 {
86 	p_phyops->Init = dm9161_InitPhy;
87 	p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
88 	p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
89 	p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
90 }
91 #endif
92 
93 #ifdef CONFIG_DRIVER_AT91EMAC
94 int board_eth_init(bd_t *bis)
95 {
96 	int rc = 0;
97 	rc = at91emac_register(bis, 0);
98 	return rc;
99 }
100 #endif
101