]>
Commit | Line | Data |
---|---|---|
26bf7dec | 1 | /* |
751e54c3 | 2 | * U-boot - main board file |
26bf7dec | 3 | * |
751e54c3 | 4 | * Copyright (c) 2005-2008 Analog Devices Inc. |
26bf7dec AL |
5 | * |
6 | * (C) Copyright 2000-2004 | |
7 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | |
8 | * | |
1a459660 | 9 | * SPDX-License-Identifier: GPL-2.0+ |
26bf7dec AL |
10 | */ |
11 | ||
12 | #include <common.h> | |
13 | #include <config.h> | |
14 | #include <command.h> | |
15 | #include <asm/blackfin.h> | |
b8f4162a | 16 | #include <net.h> |
d4d77308 | 17 | #include <asm/mach-common/bits/bootrom.h> |
89973f8a | 18 | #include <netdev.h> |
26bf7dec | 19 | |
1218abf1 WD |
20 | DECLARE_GLOBAL_DATA_PTR; |
21 | ||
26bf7dec AL |
22 | int checkboard(void) |
23 | { | |
26bf7dec AL |
24 | printf("Board: ADI BF537 stamp board\n"); |
25 | printf(" Support: http://blackfin.uclinux.org/\n"); | |
26 | return 0; | |
27 | } | |
28 | ||
751e54c3 MF |
29 | #ifdef CONFIG_BFIN_MAC |
30 | static void board_init_enetaddr(uchar *mac_addr) | |
31 | { | |
76ec988b JH |
32 | #ifndef CONFIG_SYS_NO_FLASH |
33 | /* we cram the MAC in the last flash sector */ | |
34 | uchar *board_mac_addr = (uchar *)0x203F0000; | |
35 | if (is_valid_ethaddr(board_mac_addr)) { | |
36 | memcpy(mac_addr, board_mac_addr, 6); | |
37 | eth_setenv_enetaddr("ethaddr", mac_addr); | |
751e54c3 | 38 | } |
76ec988b | 39 | #endif |
751e54c3 MF |
40 | } |
41 | ||
42 | int board_eth_init(bd_t *bis) | |
43 | { | |
44 | return bfin_EMAC_initialize(bis); | |
45 | } | |
46 | #endif | |
47 | ||
26bf7dec AL |
48 | /* miscellaneous platform dependent initialisations */ |
49 | int misc_init_r(void) | |
50 | { | |
751e54c3 MF |
51 | #ifdef CONFIG_BFIN_MAC |
52 | uchar enetaddr[6]; | |
53 | if (!eth_getenv_enetaddr("ethaddr", enetaddr)) | |
54 | board_init_enetaddr(enetaddr); | |
55 | #endif | |
56 | ||
57 | #ifndef CONFIG_SYS_NO_FLASH | |
58 | /* we use the last sector for the MAC address / POST LDR */ | |
59 | extern flash_info_t flash_info[]; | |
60 | flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF, &flash_info[0]); | |
fcec2eb9 | 61 | #endif |
26bf7dec | 62 | |
d248cfb2 MF |
63 | #ifdef CONFIG_BFIN_IDE |
64 | cf_ide_init(); | |
26bf7dec | 65 | #endif |
d248cfb2 | 66 | |
26bf7dec AL |
67 | return 0; |
68 | } |