2 * U-boot - main board file
4 * Copyright (c) 2005-2008 Analog Devices Inc.
6 * (C) Copyright 2000-2004
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 * See file CREDITS for list of people who contributed to this
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.
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.
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., 51 Franklin St, Fifth Floor, Boston,
31 #include "bf533-stamp.h"
33 DECLARE_GLOBAL_DATA_PTR;
37 printf("Board: ADI BF533 Stamp board\n");
38 printf(" Support: http://blackfin.uclinux.org/\n");
42 /* PF0 and PF1 are used to switch between the ethernet and flash:
47 void swap_to(int device_id)
49 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF1 | PF0);
51 bfin_write_FIO_FLAG_C(PF1);
52 if (device_id == ETHERNET)
53 bfin_write_FIO_FLAG_S(PF0);
54 else if (device_id == FLASH)
55 bfin_write_FIO_FLAG_C(PF0);
57 printf("Unknown device to switch\n");
61 #if defined(CONFIG_MISC_INIT_R)
62 /* miscellaneous platform dependent initialisations */
65 #ifdef CONFIG_STAMP_CF
73 #ifdef CONFIG_SHOW_BOOT_PROGRESS
75 #define STATUS_LED_OFF 0
76 #define STATUS_LED_ON 1
78 static void stamp_led_set(int LED1, int LED2, int LED3)
80 bfin_write_FIO_INEN(bfin_read_FIO_INEN() & ~(PF2 | PF3 | PF4));
81 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (PF2 | PF3 | PF4));
83 if (LED1 == STATUS_LED_OFF)
87 if (LED2 == STATUS_LED_OFF)
91 if (LED3 == STATUS_LED_OFF)
98 void show_boot_progress(int status)
102 stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_ON);
105 stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_OFF);
108 stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_ON);
111 stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_OFF);
115 stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_ON);
119 stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_OFF);
128 stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_OFF);
131 stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_ON);
137 #ifdef CONFIG_STATUS_LED
138 #include <status_led.h>
140 static void set_led(int pf, int state)
143 case STATUS_LED_OFF: bfin_write_FIO_FLAG_S(pf); break;
144 case STATUS_LED_BLINKING: bfin_write_FIO_FLAG_T(pf); break;
145 case STATUS_LED_ON: bfin_write_FIO_FLAG_C(pf); break;
149 static void set_leds(led_id_t mask, int state)
151 if (mask & 0x1) set_led(PF2, state);
152 if (mask & 0x2) set_led(PF3, state);
153 if (mask & 0x4) set_led(PF4, state);
156 void __led_init(led_id_t mask, int state)
158 bfin_write_FIO_INEN(bfin_read_FIO_INEN() & ~(PF2 | PF3 | PF4));
159 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (PF2 | PF3 | PF4));
162 void __led_set(led_id_t mask, int state)
164 set_leds(mask, state);
167 void __led_toggle(led_id_t mask)
169 set_leds(mask, STATUS_LED_BLINKING);
174 #ifdef CONFIG_SMC91111
175 int board_eth_init(bd_t *bis)
177 return smc91111_initialize(0, CONFIG_SMC91111_BASE);