2b61b2d8e59c821e87a5a7576a06dcfce99b5893
[platform/kernel/u-boot.git] / board / smdk2400 / smdk2400.c
1 /*
2  * (C) Copyright 2002
3  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4  * Marius Groeger <mgroeger@sysgo.de>
5  *
6  * (C) Copyright 2002
7  * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
8  *
9  * See file CREDITS for list of people who contributed to this
10  * project.
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License as
14  * published by the Free Software Foundation; either version 2 of
15  * the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25  * MA 02111-1307 USA
26  */
27
28 #include <common.h>
29 #include <s3c2400.h>
30
31 /* ------------------------------------------------------------------------- */
32
33 #ifdef CONFIG_MODEM_SUPPORT
34 static int key_pressed(void);
35 int mdm_init (bd_t *);
36 extern void disable_putc(void);
37 extern void enable_putc(void);
38 extern int hwflow_onoff(int);
39 extern int do_mdm_init; /* defined in common/main.c */
40 #endif /* CONFIG_MODEM_SUPPORT */
41
42 /*
43  * Miscellaneous platform dependent initialisations
44  */
45
46 int board_init (void)
47 {
48         DECLARE_GLOBAL_DATA_PTR;
49
50         /* memory and cpu-speed are setup before relocation */
51         /* change the clock to be 50 MHz 1:1:1 */
52         rMPLLCON = 0x5c042;
53         rCLKDIVN = 0;
54         /* set up the I/O ports */
55         rPACON = 0x3ffff;
56         rPBCON = 0xaaaaaaaa;
57         rPBUP = 0xffff;
58         rPECON = 0x0;
59         rPEUP = 0x0;
60 #ifdef CONFIG_HWFLOW
61         /*CTS[0] RTS[0] INPUT INPUT TXD[0] INPUT RXD[0] */
62         /*   10,   10,   00,   00,    10,   00,    10 */
63         rPFCON=0xa22;
64         /* Disable pull-up on Rx, Tx, CTS and RTS pins */
65         rPFUP=0x35;
66 #else
67         /*INPUT INPUT INPUT INPUT TXD[0] INPUT RXD[0] */
68         /*   00,   00,   00,   00,    10,   00,    10 */
69         rPFCON = 0x22;
70         /* Disable pull-up on Rx and Tx pins */
71         rPFUP = 0x5;
72 #endif  /* CONFIG_HWFLOW */
73         rPGCON = 0x0;
74         rPGUP = 0x0;
75         rOPENCR = 0x0;
76
77         /* arch number of SAMSUNG-Board to MACH_TYPE_SMDK2400 */
78         gd->bd->bi_arch_number = 145;
79
80         /* adress of boot parameters */
81         gd->bd->bi_boot_params = 0x0C000100;
82
83 #ifdef CONFIG_MODEM_SUPPORT
84         if (key_pressed()) {
85                 disable_putc(); /* modem doesn't understand banner etc */
86                 do_mdm_init = 1;
87         }
88 #endif  /* CONFIG_MODEM_SUPPORT */
89
90         return 0;
91 }
92
93 int dram_init (void)
94 {
95         DECLARE_GLOBAL_DATA_PTR;
96
97         gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
98         gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
99
100         return 0;
101 }
102
103 #ifdef CONFIG_MODEM_SUPPORT
104 static int key_pressed(void)
105 {
106         int rc;
107         if (1) {        /* check for button push here, now just return 1 */
108                 rc = 1;
109         }
110
111         return rc;
112 }
113 #endif  /* CONFIG_MODEM_SUPPORT */