]> git.ipfire.org Git - people/ms/u-boot.git/blame - board/bf533-stamp/bf533-stamp.c
board: freescale: ls1012a: Enable secure DDR on LS1012A platforms
[people/ms/u-boot.git] / board / bf533-stamp / bf533-stamp.c
CommitLineData
6cb142fa 1/*
a187559e 2 * U-Boot - main board file
6cb142fa 3 *
23fd959e 4 * Copyright (c) 2005-2008 Analog Devices Inc.
6cb142fa
WD
5 *
6 * (C) Copyright 2000-2004
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 *
1a459660 9 * SPDX-License-Identifier: GPL-2.0+
6cb142fa
WD
10 */
11
12#include <common.h>
7194ab80 13#include <netdev.h>
6cfcf584 14#include <asm/gpio.h>
d87080b7 15
1218abf1
WD
16DECLARE_GLOBAL_DATA_PTR;
17
3f0606ad 18int checkboard(void)
6cb142fa 19{
3f0606ad
AL
20 printf("Board: ADI BF533 Stamp board\n");
21 printf(" Support: http://blackfin.uclinux.org/\n");
6cb142fa
WD
22 return 0;
23}
24
1f75d6f0
MF
25/* PF0 and PF1 are used to switch between the ethernet and flash:
26 * PF0 PF1
27 * flash: 0 0
28 * ether: 1 0
29 */
3f0606ad 30void swap_to(int device_id)
6cb142fa 31{
6cfcf584
MF
32 gpio_request(GPIO_PF0, "eth_flash_swap");
33 gpio_request(GPIO_PF1, "eth_flash_swap");
34 gpio_direction_output(GPIO_PF0, device_id == ETHERNET);
35 gpio_direction_output(GPIO_PF1, 0);
1f75d6f0 36 SSYNC();
6cb142fa
WD
37}
38
39#if defined(CONFIG_MISC_INIT_R)
40/* miscellaneous platform dependent initialisations */
3f0606ad 41int misc_init_r(void)
6cb142fa 42{
6cb142fa 43#ifdef CONFIG_STAMP_CF
5f79644d
MF
44 cf_ide_init();
45#endif
6cb142fa 46
5f79644d 47 return 0;
6cb142fa
WD
48}
49#endif
50
23fd959e
MF
51#ifdef CONFIG_SHOW_BOOT_PROGRESS
52
2d8d190c
UM
53#define CONFIG_LED_STATUS_OFF 0
54#define CONFIG_LED_STATUS_ON 1
23fd959e 55
6cfcf584
MF
56static int gpio_setup;
57
23fd959e 58static void stamp_led_set(int LED1, int LED2, int LED3)
6cb142fa 59{
6cfcf584
MF
60 if (!gpio_setup) {
61 gpio_request(GPIO_PF2, "boot_progress");
62 gpio_request(GPIO_PF3, "boot_progress");
63 gpio_request(GPIO_PF4, "boot_progress");
64 gpio_direction_output(GPIO_PF2, LED1);
65 gpio_direction_output(GPIO_PF3, LED2);
66 gpio_direction_output(GPIO_PF4, LED3);
67 gpio_setup = 1;
68 } else {
69 gpio_set_value(GPIO_PF2, LED1);
70 gpio_set_value(GPIO_PF3, LED2);
71 gpio_set_value(GPIO_PF4, LED3);
72 }
6cb142fa
WD
73}
74
3f0606ad 75void show_boot_progress(int status)
6cb142fa 76{
8e7b703a 77 switch (status) {
5dc88716 78 case BOOTSTAGE_ID_CHECK_MAGIC:
2d8d190c
UM
79 stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_OFF,
80 CONFIG_LED_STATUS_ON);
8e7b703a 81 break;
5dc88716 82 case BOOTSTAGE_ID_CHECK_HEADER:
2d8d190c
UM
83 stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_ON,
84 CONFIG_LED_STATUS_OFF);
8e7b703a 85 break;
5dc88716 86 case BOOTSTAGE_ID_CHECK_CHECKSUM:
2d8d190c
UM
87 stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_ON,
88 CONFIG_LED_STATUS_ON);
8e7b703a 89 break;
5dc88716 90 case BOOTSTAGE_ID_CHECK_ARCH:
2d8d190c
UM
91 stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_OFF,
92 CONFIG_LED_STATUS_OFF);
8e7b703a 93 break;
5dc88716
SG
94 case BOOTSTAGE_ID_CHECK_IMAGETYPE:
95 case BOOTSTAGE_ID_DECOMP_IMAGE:
2d8d190c
UM
96 stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_OFF,
97 CONFIG_LED_STATUS_ON);
8e7b703a 98 break;
5dc88716
SG
99 case BOOTSTAGE_ID_KERNEL_LOADED:
100 case BOOTSTAGE_ID_CHECK_BOOT_OS:
2d8d190c
UM
101 stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_ON,
102 CONFIG_LED_STATUS_OFF);
8e7b703a 103 break;
5dc88716 104 case BOOTSTAGE_ID_BOOT_OS_RETURNED:
5e410883
SG
105 case BOOTSTAGE_ID_RD_MAGIC:
106 case BOOTSTAGE_ID_RD_HDR_CHECKSUM:
107 case BOOTSTAGE_ID_RD_CHECKSUM:
108 case BOOTSTAGE_ID_RAMDISK:
109 case BOOTSTAGE_ID_NO_RAMDISK:
578ac1e9 110 case BOOTSTAGE_ID_RUN_OS:
2d8d190c
UM
111 stamp_led_set(CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_OFF,
112 CONFIG_LED_STATUS_OFF);
8e7b703a
WD
113 break;
114 default:
2d8d190c
UM
115 stamp_led_set(CONFIG_LED_STATUS_ON, CONFIG_LED_STATUS_ON,
116 CONFIG_LED_STATUS_ON);
8e7b703a 117 break;
6cb142fa
WD
118 }
119}
23fd959e
MF
120#endif
121
7194ab80
BW
122#ifdef CONFIG_SMC91111
123int board_eth_init(bd_t *bis)
124{
125 return smc91111_initialize(0, CONFIG_SMC91111_BASE);
126}
127#endif