1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#include <common.h>
29#include <netdev.h>
30#include <asm/gpio.h>
31
32DECLARE_GLOBAL_DATA_PTR;
33
34int checkboard(void)
35{
36 printf("Board: ADI BF533 Stamp board\n");
37 printf(" Support: http://blackfin.uclinux.org/\n");
38 return 0;
39}
40
41
42
43
44
45
46void swap_to(int device_id)
47{
48 gpio_request(GPIO_PF0, "eth_flash_swap");
49 gpio_request(GPIO_PF1, "eth_flash_swap");
50 gpio_direction_output(GPIO_PF0, device_id == ETHERNET);
51 gpio_direction_output(GPIO_PF1, 0);
52 SSYNC();
53}
54
55#if defined(CONFIG_MISC_INIT_R)
56
57int misc_init_r(void)
58{
59#ifdef CONFIG_STAMP_CF
60 cf_ide_init();
61#endif
62
63 return 0;
64}
65#endif
66
67#ifdef CONFIG_SHOW_BOOT_PROGRESS
68
69#define STATUS_LED_OFF 0
70#define STATUS_LED_ON 1
71
72static int gpio_setup;
73
74static void stamp_led_set(int LED1, int LED2, int LED3)
75{
76 if (!gpio_setup) {
77 gpio_request(GPIO_PF2, "boot_progress");
78 gpio_request(GPIO_PF3, "boot_progress");
79 gpio_request(GPIO_PF4, "boot_progress");
80 gpio_direction_output(GPIO_PF2, LED1);
81 gpio_direction_output(GPIO_PF3, LED2);
82 gpio_direction_output(GPIO_PF4, LED3);
83 gpio_setup = 1;
84 } else {
85 gpio_set_value(GPIO_PF2, LED1);
86 gpio_set_value(GPIO_PF3, LED2);
87 gpio_set_value(GPIO_PF4, LED3);
88 }
89}
90
91void show_boot_progress(int status)
92{
93 switch (status) {
94 case 1:
95 stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_ON);
96 break;
97 case 2:
98 stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_OFF);
99 break;
100 case 3:
101 stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_ON);
102 break;
103 case 4:
104 stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_OFF);
105 break;
106 case 5:
107 case 6:
108 stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_ON);
109 break;
110 case 7:
111 case 8:
112 stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_OFF);
113 break;
114 case 9:
115 case 10:
116 case 11:
117 case 12:
118 case 13:
119 case 14:
120 case 15:
121 stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_OFF);
122 break;
123 default:
124 stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_ON);
125 break;
126 }
127}
128#endif
129
130#ifdef CONFIG_SMC91111
131int board_eth_init(bd_t *bis)
132{
133 return smc91111_initialize(0, CONFIG_SMC91111_BASE);
134}
135#endif
136