blob: 95634ac0044cd00434b10a90598cfb86589458d0 [file] [log] [blame]
wdenk88e72a32003-06-19 23:04:19 +00001/*
2 * (C) 2002 Kyle Harris <kharris@nexus-tech.net>, Nexus Technologies, Inc.
3 * (C) 2002 Marius Groeger <mgroeger@sysgo.de>, Sysgo GmbH
wdenk70764a32003-06-26 22:04:09 +00004 * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
wdenk88e72a32003-06-19 23:04:19 +00005 *
6 * See file CREDITS for list of people who contributed to this
7 * project.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
23 */
24
25#include <common.h>
26#include <asm/arch/pxa-regs.h>
27
28/**
29 * board_init: - setup some data structures
30 *
31 * @return: 0 in case of success
32 */
33
34int board_init (void)
35{
36 DECLARE_GLOBAL_DATA_PTR;
37
38 /* memory and cpu-speed are setup before relocation */
39 /* so we do _nothing_ here */
40
41 gd->bd->bi_arch_number = MACH_TYPE_LOGODL;
42 gd->bd->bi_boot_params = 0x08000100;
43 gd->bd->bi_baudrate = CONFIG_BAUDRATE;
44
45 (*((volatile short*)0x14800000)) = 0xff; /* power on eth0 */
46 (*((volatile short*)0x14000000)) = 0xff; /* power on uart */
47
48 return 0;
49}
50
51
52/**
53 * dram_init: - setup dynamic RAM
54 *
55 * @return: 0 in case of success
56 */
57
58int dram_init (void)
59{
60 DECLARE_GLOBAL_DATA_PTR;
61
62 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
63 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
64
wdenk57b2d802003-06-27 21:31:46 +000065 return 0;
wdenk88e72a32003-06-19 23:04:19 +000066}
67
68
wdenk70764a32003-06-26 22:04:09 +000069/**
wdenk88e72a32003-06-19 23:04:19 +000070 * logodl_set_led: - switch LEDs on or off
71 *
72 * @param led: LED to switch (0,1)
73 * @param state: switch on (1) or off (0)
74 */
75
76void logodl_set_led(int led, int state)
77{
78 switch(led) {
79
wdenk70764a32003-06-26 22:04:09 +000080 case 0:
81 if (state==1) {
wdenk88e72a32003-06-19 23:04:19 +000082 CFG_LED_A_CR = CFG_LED_A_BIT;
83 } else if (state==0) {
84 CFG_LED_A_SR = CFG_LED_A_BIT;
85 }
86 break;
87
wdenk70764a32003-06-26 22:04:09 +000088 case 1:
wdenk88e72a32003-06-19 23:04:19 +000089 if (state==1) {
90 CFG_LED_B_CR = CFG_LED_B_BIT;
91 } else if (state==0) {
92 CFG_LED_B_SR = CFG_LED_B_BIT;
93 }
94 break;
95 }
wdenk70764a32003-06-26 22:04:09 +000096
wdenk88e72a32003-06-19 23:04:19 +000097 return;
98}
99
100
101/**
102 * show_boot_progress: - indicate state of the boot process
103 *
wdenk70764a32003-06-26 22:04:09 +0000104 * @param status: Status number - see README for details.
wdenk88e72a32003-06-19 23:04:19 +0000105 *
wdenk70764a32003-06-26 22:04:09 +0000106 * The LOGOTRONIC does only have 2 LEDs, so we switch them on at the most
wdenk88e72a32003-06-19 23:04:19 +0000107 * important states (1, 5, 15).
108 */
109
110void show_boot_progress (int status)
111{
112 /*
113 switch(status) {
114 case 1: logodl_set_led(0,1); break;
115 case 5: logodl_set_led(1,1); break;
116 case 15: logodl_set_led(2,1); break;
117 }
118 */
119 logodl_set_led(0, (status & 1)==1);
120 logodl_set_led(1, (status & 2)==2);
121
122 return;
123}