blob: 8aff8f1ae23f9159fd362151ede7e6ee0ae8de70 [file] [log] [blame]
wdenkbf9e3b32004-02-12 00:47:09 +00001/*
2 * (C) Copyright 2003
3 * Josef Baumgartner <josef.baumgartner@telex.de>
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
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.
12 *
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.
17 *
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,
21 * MA 02111-1307 USA
22 */
23
24#include <common.h>
25#include <watchdog.h>
26
27#ifdef CONFIG_M5272
28#include <asm/m5272.h>
29#include <asm/immap_5272.h>
30#endif
31
32#ifdef CONFIG_M5282
33#include <asm/m5282.h>
34#include <asm/immap_5282.h>
35#endif
36
37#ifdef CONFIG_M5272
38/*
39 * Breath some life into the CPU...
40 *
41 * Set up the memory map,
42 * initialize a bunch of registers,
43 * initialize the UPM's
44 */
45void cpu_init_f (void)
46{
47 /* if we come from RAM we assume the CPU is
48 * already initialized.
49 */
50#ifndef CONFIG_MONITOR_IS_IN_RAM
51 volatile immap_t *regp = (immap_t *)CFG_MBAR;
52
53 volatile unsigned char *mbar;
54 mbar = (volatile unsigned char *) CFG_MBAR;
55
56 regp->sysctrl_reg.sc_scr = CFG_SCR;
57 regp->sysctrl_reg.sc_spr = CFG_SPR;
58
59 /* Setup Ports: */
60 regp->gpio_reg.gpio_pacnt = CFG_PACNT;
61 regp->gpio_reg.gpio_paddr = CFG_PADDR;
62 regp->gpio_reg.gpio_padat = CFG_PADAT;
63 regp->gpio_reg.gpio_pbcnt = CFG_PBCNT;
64 regp->gpio_reg.gpio_pbddr = CFG_PBDDR;
65 regp->gpio_reg.gpio_pbdat = CFG_PBDAT;
66 regp->gpio_reg.gpio_pdcnt = CFG_PDCNT;
67
68 /* Memory Controller: */
69 regp->csctrl_reg.cs_br0 = CFG_BR0_PRELIM;
70 regp->csctrl_reg.cs_or0 = CFG_OR0_PRELIM;
71
72#if (defined(CFG_OR1_PRELIM) && defined(CFG_BR1_PRELIM))
73 regp->csctrl_reg.cs_br1 = CFG_BR1_PRELIM;
74 regp->csctrl_reg.cs_or1 = CFG_OR1_PRELIM;
75#endif
76
77#if defined(CFG_OR2_PRELIM) && defined(CFG_BR2_PRELIM)
78 regp->csctrl_reg.cs_br2 = CFG_BR2_PRELIM;
79 regp->csctrl_reg.cs_or2 = CFG_OR2_PRELIM;
80#endif
81
82#if defined(CFG_OR3_PRELIM) && defined(CFG_BR3_PRELIM)
83 regp->csctrl_reg.cs_br3 = CFG_BR3_PRELIM;
84 regp->csctrl_reg.cs_or3 = CFG_OR3_PRELIM;
85#endif
86
87#if defined(CFG_OR4_PRELIM) && defined(CFG_BR4_PRELIM)
88 regp->csctrl_reg.cs_br4 = CFG_BR4_PRELIM;
89 regp->csctrl_reg.cs_or4 = CFG_OR4_PRELIM;
90#endif
91
92#if defined(CFG_OR5_PRELIM) && defined(CFG_BR5_PRELIM)
93 regp->csctrl_reg.cs_br5 = CFG_BR5_PRELIM;
94 regp->csctrl_reg.cs_or5 = CFG_OR5_PRELIM;
95#endif
96
97#if defined(CFG_OR6_PRELIM) && defined(CFG_BR6_PRELIM)
98 regp->csctrl_reg.cs_br6 = CFG_BR6_PRELIM;
99 regp->csctrl_reg.cs_or6 = CFG_OR6_PRELIM;
100#endif
101
102#if defined(CFG_OR7_PRELIM) && defined(CFG_BR7_PRELIM)
103 regp->csctrl_reg.cs_br7 = CFG_BR7_PRELIM;
104 regp->csctrl_reg.cs_or7 = CFG_OR7_PRELIM;
105#endif
106
107#endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
108
109 /* enable instruction cache now */
110 icache_enable();
111
112}
113
114/*
115 * initialize higher level parts of CPU like timers
116 */
117int cpu_init_r (void)
118{
119 return (0);
120}
121#endif /* #ifdef CONFIG_M5272 */
122
123
124#ifdef CONFIG_M5282
125/*
126 * Breath some life into the CPU...
127 *
128 * Set up the memory map,
129 * initialize a bunch of registers,
130 * initialize the UPM's
131 */
132void cpu_init_f (void)
133{
134
135}
136
137/*
138 * initialize higher level parts of CPU like timers
139 */
140int cpu_init_r (void)
141{
142 return (0);
143}
144#endif