blob: 2c47063e95e7661b916c00a37ecf9a03be51d239 [file] [log] [blame]
wdenkd8a555f2002-09-14 19:10:04 +00001/*
2 * (C) Copyright 2002
3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
5 *
6 * (C) Copyright 2002
Detlev Zundel792a09e2009-05-13 10:54:10 +02007 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
wdenkd8a555f2002-09-14 19:10:04 +00008 *
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>
Ben Warrenb1c0eaa2009-08-25 13:09:37 -070029#include <netdev.h>
wdenkd8a555f2002-09-14 19:10:04 +000030#include <s3c2400.h>
31
Wolfgang Denkd87080b2006-03-31 18:32:53 +020032DECLARE_GLOBAL_DATA_PTR;
wdenkd8a555f2002-09-14 19:10:04 +000033
34#ifdef CONFIG_MODEM_SUPPORT
35static int key_pressed(void);
36int mdm_init (bd_t *);
37extern void disable_putc(void);
38extern void enable_putc(void);
39extern int hwflow_onoff(int);
40extern int do_mdm_init; /* defined in common/main.c */
41#endif /* CONFIG_MODEM_SUPPORT */
42
43/*
44 * Miscellaneous platform dependent initialisations
45 */
46
47int board_init (void)
48{
wdenk48b42612003-06-19 23:01:32 +000049 S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();
50 S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
wdenkd8a555f2002-09-14 19:10:04 +000051
52 /* memory and cpu-speed are setup before relocation */
53 /* change the clock to be 50 MHz 1:1:1 */
wdenk48b42612003-06-19 23:01:32 +000054 clk_power->MPLLCON = 0x5c042;
55 clk_power->CLKDIVN = 0;
wdenkd8a555f2002-09-14 19:10:04 +000056 /* set up the I/O ports */
wdenk48b42612003-06-19 23:01:32 +000057 gpio->PACON = 0x3ffff;
58 gpio->PBCON = 0xaaaaaaaa;
59 gpio->PBUP = 0xffff;
60 gpio->PECON = 0x0;
61 gpio->PEUP = 0x0;
wdenkd8a555f2002-09-14 19:10:04 +000062#ifdef CONFIG_HWFLOW
63 /*CTS[0] RTS[0] INPUT INPUT TXD[0] INPUT RXD[0] */
64 /* 10, 10, 00, 00, 10, 00, 10 */
wdenk48b42612003-06-19 23:01:32 +000065 gpio->PFCON=0xa22;
wdenkd8a555f2002-09-14 19:10:04 +000066 /* Disable pull-up on Rx, Tx, CTS and RTS pins */
wdenk48b42612003-06-19 23:01:32 +000067 gpio->PFUP=0x35;
wdenkd8a555f2002-09-14 19:10:04 +000068#else
69 /*INPUT INPUT INPUT INPUT TXD[0] INPUT RXD[0] */
70 /* 00, 00, 00, 00, 10, 00, 10 */
wdenk48b42612003-06-19 23:01:32 +000071 gpio->PFCON = 0x22;
wdenkd8a555f2002-09-14 19:10:04 +000072 /* Disable pull-up on Rx and Tx pins */
wdenk48b42612003-06-19 23:01:32 +000073 gpio->PFUP = 0x5;
wdenkd8a555f2002-09-14 19:10:04 +000074#endif /* CONFIG_HWFLOW */
wdenk48b42612003-06-19 23:01:32 +000075 gpio->PGCON = 0x0;
76 gpio->PGUP = 0x0;
77 gpio->OPENCR = 0x0;
wdenkd8a555f2002-09-14 19:10:04 +000078
79 /* arch number of SAMSUNG-Board to MACH_TYPE_SMDK2400 */
wdenk731215e2004-10-10 18:41:04 +000080 gd->bd->bi_arch_number = MACH_TYPE_SMDK2400;
wdenkd8a555f2002-09-14 19:10:04 +000081
82 /* adress of boot parameters */
83 gd->bd->bi_boot_params = 0x0C000100;
84
85#ifdef CONFIG_MODEM_SUPPORT
86 if (key_pressed()) {
87 disable_putc(); /* modem doesn't understand banner etc */
88 do_mdm_init = 1;
89 }
90#endif /* CONFIG_MODEM_SUPPORT */
91
92 return 0;
93}
94
95int dram_init (void)
96{
wdenkd8a555f2002-09-14 19:10:04 +000097 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
104static 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 */
Ben Warrenb1c0eaa2009-08-25 13:09:37 -0700114
115#ifdef CONFIG_CMD_NET
116int board_eth_init(bd_t *bis)
117{
118 int rc = 0;
119#ifdef CONFIG_CS8900
120 rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
121#endif
122 return rc;
123}
124#endif