blob: 5941b5fcbe00a85a7b9df65ef0c10eab1f057d15 [file] [log] [blame]
Harald Krapfenbauerf4376602009-08-20 19:20:41 -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>
15#include <asm/net.h>
Mike Frysinger2ff0a302010-07-24 03:54:19 -040016#include "../cm-bf537e/gpio_cfi_flash.h"
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040017
18DECLARE_GLOBAL_DATA_PTR;
19
20int checkboard(void)
21{
22 printf("Board: Bluetechnix CM-BF537U board\n");
23 printf(" Support: http://www.bluetechnix.at/\n");
24 return 0;
25}
26
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040027static void board_init_enetaddr(char *var)
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040028{
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040029 uchar enetaddr[6];
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040030
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040031 if (eth_getenv_enetaddr(var, enetaddr))
32 return;
33
34 printf("Warning: %s: generating 'random' MAC address\n", var);
35 bfin_gen_rand_mac(enetaddr);
36 eth_setenv_enetaddr(var, enetaddr);
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040037}
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040038
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040039#ifndef CONFIG_BFIN_MAC
40# define bfin_EMAC_initialize(x) 1
41#endif
42#ifndef CONFIG_SMC911X
43# define smc911x_initialize(n, x) 1
44#endif
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040045int board_eth_init(bd_t *bis)
46{
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040047 /* return ok if at least 1 eth device works */
48 return bfin_EMAC_initialize(bis) &
49 smc911x_initialize(0, CONFIG_SMC911X_BASE);
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040050}
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040051
52int misc_init_r(void)
53{
Harald Krapfenbauer8ff448d2011-05-17 15:25:54 -040054 board_init_enetaddr("ethaddr");
55 board_init_enetaddr("eth1addr");
Harald Krapfenbauerf4376602009-08-20 19:20:41 -040056
57 gpio_cfi_flash_init();
58
59 return 0;
60}