]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/bf537-stamp/bf537-stamp.c
2 * U-boot - main board file
4 * Copyright (c) 2005-2008 Analog Devices Inc.
6 * (C) Copyright 2000-2004
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 * See file CREDITS for list of people who contributed to this
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
31 #include <asm/blackfin.h>
34 #include <asm/mach-common/bits/bootrom.h>
37 DECLARE_GLOBAL_DATA_PTR
;
41 printf("Board: ADI BF537 stamp board\n");
42 printf(" Support: http://blackfin.uclinux.org/\n");
46 void board_reset(void)
48 /* workaround for weak pull ups on ssel */
49 if (CONFIG_BFIN_BOOT_MODE
== BFIN_BOOT_SPI_MASTER
) {
50 bfin_write_PORTF_FER(bfin_read_PORTF_FER() & ~PF10
);
51 bfin_write_PORTFIO_SET(PF10
);
56 #ifdef CONFIG_BFIN_MAC
57 static void board_init_enetaddr(uchar
*mac_addr
)
59 #ifdef CONFIG_SYS_NO_FLASH
60 # define USE_MAC_IN_FLASH 0
62 # define USE_MAC_IN_FLASH 1
64 bool valid_mac
= false;
66 if (USE_MAC_IN_FLASH
) {
67 /* we cram the MAC in the last flash sector */
68 uchar
*board_mac_addr
= (uchar
*)0x203F0000;
69 if (is_valid_ether_addr(board_mac_addr
)) {
70 memcpy(mac_addr
, board_mac_addr
, 6);
76 puts("Warning: Generating 'random' MAC address\n");
77 bfin_gen_rand_mac(mac_addr
);
80 eth_setenv_enetaddr("ethaddr", mac_addr
);
83 int board_eth_init(bd_t
*bis
)
85 return bfin_EMAC_initialize(bis
);
89 /* miscellaneous platform dependent initialisations */
92 #ifdef CONFIG_BFIN_MAC
94 if (!eth_getenv_enetaddr("ethaddr", enetaddr
))
95 board_init_enetaddr(enetaddr
);
98 #ifndef CONFIG_SYS_NO_FLASH
99 /* we use the last sector for the MAC address / POST LDR */
100 extern flash_info_t flash_info
[];
101 flash_protect(FLAG_PROTECT_SET
, 0x203F0000, 0x203FFFFF, &flash_info
[0]);
104 #ifdef CONFIG_BFIN_IDE