]> git.ipfire.org Git - people/ms/u-boot.git/blame - board/dave/B2/B2.c
Net: Clean up LAN91C96 Support
[people/ms/u-boot.git] / board / dave / B2 / B2.c
CommitLineData
5cfbab3d
WD
1/*
2 * (C) Copyright 2004
3 * DAVE Srl
4 * http://www.dave-tech.it
5 * http://www.wawnet.biz
6 * mailto:info@wawnet.biz
7 *
8 * See file CREDITS for list of people who contributed to this
9 * project.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 * MA 02111-1307 USA
25 */
26
27#include <common.h>
1ab70f6f 28#include <netdev.h>
5cfbab3d
WD
29#include <asm/hardware.h>
30
d87080b7
WD
31DECLARE_GLOBAL_DATA_PTR;
32
5cfbab3d
WD
33/*
34 * Miscelaneous platform dependent initialization
35 */
36
37int board_init (void)
38{
5cfbab3d
WD
39 u32 temp;
40
41 /* Configuration Port Control Register*/
42 /* Port A */
43 PCONA = 0x3ff;
44
45 /* Port B */
46 PCONB = 0xff;
47 PDATB = 0xFFFF;
48
49 /* Port C */
50 /*
51 PCONC = 0xff55ff15;
52 PDATC = 0x0;
53 PUPC = 0xffff;
54 */
55
56 /* Port D */
57 /*
58 PCOND = 0xaaaa;
59 PUPD = 0xff;
60 */
61
62 /* Port E */
63 PCONE = 0x0001aaa9;
64 PDATE = 0x0;
65 PUPE = 0xff;
66
67 /* Port F */
68 PCONF = 0x124955;
69 PDATF = 0xff; /* B2-eth_reset tied high level */
70 /*
71 PUPF = 0x1e3;
72 */
73
74 /* Port G */
75 PUPG = 0x1;
76 PCONG = 0x3; /*PG0= EINT0= ETH_INT prepared for linux kernel*/
77
78 INTMSK = 0x03fffeff;
79 INTCON = 0x05;
80
81 /*
53677ef1
WD
82 Configure chip ethernet interrupt as High level
83 Port G EINT 0-7 EINT0 -> CHIP ETHERNET
5cfbab3d
WD
84 */
85 temp = EXTINT;
53677ef1 86 temp &= ~0x7;
5cfbab3d
WD
87 temp |= 0x1; /*LEVEL_HIGH*/
88 EXTINT = temp;
89
90 /*
53677ef1 91 Reset SMSC LAN91C96 chip
5cfbab3d
WD
92 */
93 temp= PCONF;
94 temp |= 0x00000040;
95 PCONF = temp;
96
97 /* Reset high */
98 temp = PDATF;
99 temp |= (1 << 3);
100 PDATF = temp;
101
102 /* Short delay */
103 for (temp=0;temp<10;temp++)
104 {
105 /* NOP */
106 }
107
108 /* Reset low */
109 temp = PDATF;
110 temp &= ~(1 << 3);
111 PDATF = temp;
112
113 /* arch number MACH_TYPE_MBA44B0 */
731215eb 114 gd->bd->bi_arch_number = MACH_TYPE_S3C44B0;
5cfbab3d
WD
115
116 /* location of boot parameters */
117 gd->bd->bi_boot_params = 0x0c000100;
118
119 return 0;
120}
121
122int dram_init (void)
123{
5cfbab3d
WD
124 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
125 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
126
127 return (0);
128}
1ab70f6f
BW
129
130#ifdef CONFIG_CMD_NET
131int board_eth_init(bd_t *bis)
132{
133 int rc = 0;
134#ifdef CONFIG_LAN91C96
135 rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
136#endif
137 return rc;
138}
139#endif