blob: 2531a4433640d70a6df73179f5a069fd4af90b58 [file] [log] [blame]
Mike Frysinger9417d9a2008-10-12 21:49:28 -04001/*
2 * U-boot - main board file
3 *
4 * Copyright (c) 2005-2009 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#include <common.h>
10#include <config.h>
11#include <command.h>
12#include <net.h>
13#include <netdev.h>
14#include <asm/blackfin.h>
Mike Frysinger71dcc2c2010-07-24 03:54:19 -040015#include "../cm-bf537e/gpio_cfi_flash.h"
Mike Frysinger9417d9a2008-10-12 21:49:28 -040016
17DECLARE_GLOBAL_DATA_PTR;
18
19int checkboard(void)
20{
21 printf("Board: Bluetechnix TCM-BF537 board\n");
22 printf(" Support: http://www.bluetechnix.at/\n");
23 return 0;
24}
25
Harald Krapfenbauerfff18be2011-05-17 15:25:54 -040026static void board_init_enetaddr(char *var)
Mike Frysinger9417d9a2008-10-12 21:49:28 -040027{
Harald Krapfenbauerfff18be2011-05-17 15:25:54 -040028 uchar enetaddr[6];
29
30 if (eth_getenv_enetaddr(var, enetaddr))
31 return;
32
33 printf("Warning: %s: generating 'random' MAC address\n", var);
Joe Hershberger0adb5b72015-04-08 01:41:04 -050034 net_random_ethaddr(enetaddr);
Harald Krapfenbauerfff18be2011-05-17 15:25:54 -040035 eth_setenv_enetaddr(var, enetaddr);
Mike Frysinger9417d9a2008-10-12 21:49:28 -040036}
37
Harald Krapfenbauerfff18be2011-05-17 15:25:54 -040038#ifndef CONFIG_BFIN_MAC
39# define bfin_EMAC_initialize(x) 1
40#endif
41#ifndef CONFIG_SMC911X
42# define smc911x_initialize(n, x) 1
43#endif
Mike Frysinger9417d9a2008-10-12 21:49:28 -040044int board_eth_init(bd_t *bis)
45{
Harald Krapfenbauerfff18be2011-05-17 15:25:54 -040046 /* return ok if at least 1 eth device works */
47 return bfin_EMAC_initialize(bis) &
48 smc911x_initialize(0, CONFIG_SMC911X_BASE);
Mike Frysinger9417d9a2008-10-12 21:49:28 -040049}
Mike Frysinger9417d9a2008-10-12 21:49:28 -040050
51int misc_init_r(void)
52{
Harald Krapfenbauerfff18be2011-05-17 15:25:54 -040053 board_init_enetaddr("ethaddr");
54 board_init_enetaddr("eth1addr");
Mike Frysinger9417d9a2008-10-12 21:49:28 -040055
56 gpio_cfi_flash_init();
57
58 return 0;
59}