This patch unifies the use of config options in v2 to all start with CONFIG_
[coreboot.git] / src / mainboard / motorola / sandpoint / init.c
1 /*
2  * Copyright (C) 2003, Greg Watson <gwatson@lanl.gov>
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20  * MA 02110-1301 USA
21  */
22
23 /*
24  * Do very early board initialization:
25  *
26  * - Configure External Bus (EBC)
27  * - Setup Flash
28  * - Setup NVRTC
29  * - Setup Board Control and Status Registers (BCSR)
30  * - Enable UART0 for debugging
31  */
32
33 #include <ppc_asm.tmpl>
34 #include <ppc.h>
35 #include <arch/io.h>
36 #include <printk.h>
37 #include <uart8250.h>
38
39 void pnp_output(char address, char data)
40 {
41         outb(address, CONFIG_PNP_CFGADDR);
42         outb(data, CONFIG_PNP_CFGDATA);
43 }
44
45 void
46 board_init(void)
47 {
48         /*
49          * Enable UART0
50          *
51          * NOTE: this configuration assumes that the PCI/ISA IO
52          * address space is properly configured by default on board
53          * reset. While this seems to be the case with the X3, it may not
54          * always work.
55          */
56         pnp_output(0x07, 6); /* LD 6 = UART0 */
57         pnp_output(0x30, 0); /* Dectivate */
58         pnp_output(0x60, CONFIG_TTYS0_BASE >> 8); /* IO Base */
59         pnp_output(0x61, CONFIG_TTYS0_BASE & 0xFF); /* IO Base */
60         pnp_output(0x30, 1); /* Activate */
61         uart8250_init(CONFIG_TTYS0_BASE, 115200/CONFIG_TTYS0_BAUD, CONFIG_TTYS0_LCS);
62 }
63
64 void
65 board_init2(void)
66 {
67         printk_info("Sandpoint initialized...\n");
68 }