blob: 7c6c8550074dbb5e9d7be65b1cccd609f339f4c3 [file] [log] [blame]
stefano babic5e5803e2007-08-30 23:01:49 +02001/*
2 * (C) Copyright 2007
3 * Stefano Babic, DENX Gmbh, sbabic@denx.de
4 *
5 * (C) Copyright 2004
6 * Robert Whaley, Applied Data Systems, Inc. rwhaley@applieddata.net
7 *
8 * (C) Copyright 2002
9 * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
10 *
11 * (C) Copyright 2002
12 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
13 * Marius Groeger <mgroeger@sysgo.de>
14 *
15 * See file CREDITS for list of people who contributed to this
16 * project.
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA
32 */
33
34#include <common.h>
35#include <asm/arch/pxa-regs.h>
36
37DECLARE_GLOBAL_DATA_PTR;
38
39#define RH_A_PSM (1 << 8) /* power switching mode */
40#define RH_A_NPS (1 << 9) /* no power switching */
41
42extern struct serial_device serial_ffuart_device;
43extern struct serial_device serial_btuart_device;
44extern struct serial_device serial_stuart_device;
45
46/* ------------------------------------------------------------------------- */
47
48/*
49 * Miscelaneous platform dependent initialisations
50 */
51
52void usb_board_init(void)
53{
54 UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
55 ~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE);
56
57 UHCHR |= UHCHR_FSBIR;
58
59 while (UHCHR & UHCHR_FSBIR);
60
61 UHCHR &= ~UHCHR_SSE;
62 UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE);
63
64 /* Clear any OTG Pin Hold */
65 if (PSSR & PSSR_OTGPH)
66 PSSR |= PSSR_OTGPH;
67
68 UHCRHDA &= ~(RH_A_NPS);
69 UHCRHDA |= RH_A_PSM;
70
71 /* Set port power control mask bits, only 3 ports. */
72 UHCRHDB |= (0x7<<17);
73}
74
75void usb_board_init_fail(void)
76{
77 return;
78}
79
80void usb_board_stop(void)
81{
82 UHCHR |= UHCHR_FHR;
83 udelay(11);
84 UHCHR &= ~UHCHR_FHR;
85
86 UHCCOMS |= 1;
87 udelay(10);
88
89 CKEN &= ~CKEN10_USBHOST;
90
91 puts("Called USB STOP\n");
92 return;
93}
94
95int board_init (void)
96{
97 /* memory and cpu-speed are setup before relocation */
98 /* so we do _nothing_ here */
99
100 /* arch number of ConXS Board */
101 gd->bd->bi_arch_number = 776;
102
103 /* adress of boot parameters */
104 gd->bd->bi_boot_params = 0xa000003c;
105
106 return 0;
107}
108
109int board_late_init(void)
110{
111#if defined(CONFIG_SERIAL_MULTI)
112 char *console=getenv("boot_console");
113
114 if ((strcmp(console,"serial_btuart") == 0) ||
115 (strcmp(console,"serial_stuart") == 0) ||
116 (strcmp(console,"serial_ffuart") == 0)) {
117 setenv("stdout",console);
118 setenv("stdin", console);
119 setenv("stderr",console);
120 } else {
121 setenv("stdout", "serial");
122 setenv("stdin", "serial");
123 setenv("stderr", "serial");
124 }
125#endif
126 return 0;
127}
128
129struct serial_device *default_serial_console (void)
130{
131 return &serial_ffuart_device;
132}
133
134int dram_init (void)
135{
136 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
137 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
138 gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
139 gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
140 gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
141 gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
142 gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
143 gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
144
145 return 0;
146}