3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/processor.h>
29 int sysControlDisplay(int digit
, uchar ascii_code
);
30 extern void Plx9030Init(void);
32 /* We have to clear the initial data area here. Couldn't have done it
33 * earlier because DRAM had not been initialized.
35 int board_pre_init(void)
38 /* enable DUAL UART Mode on CPC45 */
39 *(uchar
*)DUART_DCR
|= 0x1; /* set DCM bit */
47 char revision = BOARD_REV;
49 ulong busfreq
= get_bus_freq(0);
54 printf("Revision %d ", revision);
56 printf("Local Bus at %s MHz\n", strmhz(buf
, busfreq
));
61 long int initdram(int board_type
)
64 volatile uchar
* base
= CFG_SDRAM_BASE
;
65 volatile ulong
* addr
;
69 for (i
=0, cnt
=(CFG_MAX_RAM_SIZE
/ sizeof(long)) >> 1; cnt
> 0; cnt
>>= 1) {
71 addr
= (volatile ulong
*)base
+ cnt
;
76 addr
= (volatile ulong
*)base
;
85 for (cnt
= 1; cnt
<= CFG_MAX_RAM_SIZE
/ sizeof(long); cnt
<<= 1) {
86 addr
= (volatile ulong
*)base
+ cnt
;
90 ulong new_bank0_end
= cnt
* sizeof(long) - 1;
91 ulong mear1
= mpc824x_mpc107_getreg(MEAR1
);
92 ulong emear1
= mpc824x_mpc107_getreg(EMEAR1
);
93 mear1
= (mear1
& 0xFFFFFF00) |
94 ((new_bank0_end
& MICR_ADDR_MASK
) >> MICR_ADDR_SHIFT
);
95 emear1
= (emear1
& 0xFFFFFF00) |
96 ((new_bank0_end
& MICR_ADDR_MASK
) >> MICR_EADDR_SHIFT
);
97 mpc824x_mpc107_setreg(MEAR1
, mear1
);
98 mpc824x_mpc107_setreg(EMEAR1
, emear1
);
100 ret
= cnt
* sizeof(long);
105 ret
= CFG_MAX_RAM_SIZE
;
111 * Initialize PCI Devices, report devices found.
113 #ifndef CONFIG_PCI_PNP
115 static struct pci_config_table pci_sandpoint_config_table
[] = {
116 { PCI_ANY_ID
, PCI_ANY_ID
, PCI_ANY_ID
, PCI_ANY_ID
, 0x0f, PCI_ANY_ID
,
117 pci_cfgfunc_config_device
, { PCI_ENET0_IOADDR
,
119 PCI_COMMAND_MEMORY
| PCI_COMMAND_MASTER
}},
125 struct pci_controller hose
= {
126 #ifndef CONFIG_PCI_PNP
127 config_table
: pci_sandpoint_config_table
,
131 void pci_init_board(void)
133 pci_mpc824x_init(&hose
);
135 /* init PCI_to_LOCAL Bus BRIDGE */
138 sysControlDisplay(0,' ');
139 sysControlDisplay(1,'C');
140 sysControlDisplay(2,'P');
141 sysControlDisplay(3,'C');
142 sysControlDisplay(4,' ');
143 sysControlDisplay(5,'4');
144 sysControlDisplay(6,'5');
145 sysControlDisplay(7,' ');
149 /**************************************************************************
151 * sysControlDisplay - controls one of the Alphanum. Display digits.
153 * This routine will write an ASCII character to the display digit requested.
160 int sysControlDisplay
162 int digit
, /* number of digit 0..7 */
163 uchar ascii_code
/* ASCII code */
166 if ((digit
< 0) || (digit
> 7))
169 *((volatile uchar
*)(DISP_CHR_RAM
+ digit
)) = ascii_code
;