2006-03-12 01:12:27 +00:00
|
|
|
/*
|
2008-10-12 02:40:22 +00:00
|
|
|
* U-boot - main board file
|
2006-03-12 01:12:27 +00:00
|
|
|
*
|
2008-10-12 02:40:22 +00:00
|
|
|
* Copyright (c) 2005-2008 Analog Devices Inc.
|
2006-03-12 01:12:27 +00:00
|
|
|
*
|
|
|
|
* (C) Copyright 2000-2004
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2006-03-12 01:12:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2009-10-05 05:37:03 +00:00
|
|
|
#include <netdev.h>
|
2010-06-02 10:18:57 +00:00
|
|
|
#include <asm/gpio.h>
|
2006-03-31 16:32:53 +00:00
|
|
|
|
2007-09-15 18:48:41 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2007-03-09 05:38:44 +00:00
|
|
|
int checkboard(void)
|
2006-03-12 01:12:27 +00:00
|
|
|
{
|
2007-03-09 05:38:44 +00:00
|
|
|
printf("Board: ADI BF533 Stamp board\n");
|
|
|
|
printf(" Support: http://blackfin.uclinux.org/\n");
|
2006-03-12 01:12:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-10-12 02:38:37 +00:00
|
|
|
/* PF0 and PF1 are used to switch between the ethernet and flash:
|
|
|
|
* PF0 PF1
|
|
|
|
* flash: 0 0
|
|
|
|
* ether: 1 0
|
|
|
|
*/
|
2007-03-09 05:38:44 +00:00
|
|
|
void swap_to(int device_id)
|
2006-03-12 01:12:27 +00:00
|
|
|
{
|
2010-06-02 10:18:57 +00:00
|
|
|
gpio_request(GPIO_PF0, "eth_flash_swap");
|
|
|
|
gpio_request(GPIO_PF1, "eth_flash_swap");
|
|
|
|
gpio_direction_output(GPIO_PF0, device_id == ETHERNET);
|
|
|
|
gpio_direction_output(GPIO_PF1, 0);
|
2008-10-12 02:38:37 +00:00
|
|
|
SSYNC();
|
2006-03-12 01:12:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(CONFIG_MISC_INIT_R)
|
|
|
|
/* miscellaneous platform dependent initialisations */
|
2007-03-09 05:38:44 +00:00
|
|
|
int misc_init_r(void)
|
2006-03-12 01:12:27 +00:00
|
|
|
{
|
|
|
|
#ifdef CONFIG_STAMP_CF
|
2009-11-30 18:08:39 +00:00
|
|
|
cf_ide_init();
|
|
|
|
#endif
|
2006-03-12 01:12:27 +00:00
|
|
|
|
2009-11-30 18:08:39 +00:00
|
|
|
return 0;
|
2006-03-12 01:12:27 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-10-12 02:40:22 +00:00
|
|
|
#ifdef CONFIG_SHOW_BOOT_PROGRESS
|
|
|
|
|
|
|
|
#define STATUS_LED_OFF 0
|
|
|
|
#define STATUS_LED_ON 1
|
|
|
|
|
2010-06-02 10:18:57 +00:00
|
|
|
static int gpio_setup;
|
|
|
|
|
2008-10-12 02:40:22 +00:00
|
|
|
static void stamp_led_set(int LED1, int LED2, int LED3)
|
2006-03-12 01:12:27 +00:00
|
|
|
{
|
2010-06-02 10:18:57 +00:00
|
|
|
if (!gpio_setup) {
|
|
|
|
gpio_request(GPIO_PF2, "boot_progress");
|
|
|
|
gpio_request(GPIO_PF3, "boot_progress");
|
|
|
|
gpio_request(GPIO_PF4, "boot_progress");
|
|
|
|
gpio_direction_output(GPIO_PF2, LED1);
|
|
|
|
gpio_direction_output(GPIO_PF3, LED2);
|
|
|
|
gpio_direction_output(GPIO_PF4, LED3);
|
|
|
|
gpio_setup = 1;
|
|
|
|
} else {
|
|
|
|
gpio_set_value(GPIO_PF2, LED1);
|
|
|
|
gpio_set_value(GPIO_PF3, LED2);
|
|
|
|
gpio_set_value(GPIO_PF4, LED3);
|
|
|
|
}
|
2006-03-12 01:12:27 +00:00
|
|
|
}
|
|
|
|
|
2007-03-09 05:38:44 +00:00
|
|
|
void show_boot_progress(int status)
|
2006-03-12 01:12:27 +00:00
|
|
|
{
|
2006-03-12 01:55:22 +00:00
|
|
|
switch (status) {
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_CHECK_MAGIC:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_ON);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_CHECK_HEADER:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_OFF);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_CHECK_CHECKSUM:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_OFF, STATUS_LED_ON, STATUS_LED_ON);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_CHECK_ARCH:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_OFF);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_CHECK_IMAGETYPE:
|
|
|
|
case BOOTSTAGE_ID_DECOMP_IMAGE:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_ON, STATUS_LED_OFF, STATUS_LED_ON);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_KERNEL_LOADED:
|
|
|
|
case BOOTSTAGE_ID_CHECK_BOOT_OS:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_OFF);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2012-01-14 15:24:47 +00:00
|
|
|
case BOOTSTAGE_ID_BOOT_OS_RETURNED:
|
2011-12-10 11:07:57 +00:00
|
|
|
case BOOTSTAGE_ID_RD_MAGIC:
|
|
|
|
case BOOTSTAGE_ID_RD_HDR_CHECKSUM:
|
|
|
|
case BOOTSTAGE_ID_RD_CHECKSUM:
|
|
|
|
case BOOTSTAGE_ID_RAMDISK:
|
|
|
|
case BOOTSTAGE_ID_NO_RAMDISK:
|
2011-12-10 11:07:54 +00:00
|
|
|
case BOOTSTAGE_ID_RUN_OS:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_OFF, STATUS_LED_OFF, STATUS_LED_OFF);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
|
|
|
default:
|
2007-03-09 05:38:44 +00:00
|
|
|
stamp_led_set(STATUS_LED_ON, STATUS_LED_ON, STATUS_LED_ON);
|
2006-03-12 01:55:22 +00:00
|
|
|
break;
|
2006-03-12 01:12:27 +00:00
|
|
|
}
|
|
|
|
}
|
2008-10-12 02:40:22 +00:00
|
|
|
#endif
|
|
|
|
|
2009-10-05 05:37:03 +00:00
|
|
|
#ifdef CONFIG_SMC91111
|
|
|
|
int board_eth_init(bd_t *bis)
|
|
|
|
{
|
|
|
|
return smc91111_initialize(0, CONFIG_SMC91111_BASE);
|
|
|
|
}
|
|
|
|
#endif
|