Mike Frysinger | d7fdc14 | 2008-10-12 23:16:52 -0400 | [diff] [blame^] | 1 | /* |
| 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 <netdev.h> |
| 13 | #include <net.h> |
| 14 | #include <asm/blackfin.h> |
| 15 | #include <asm/net.h> |
| 16 | |
| 17 | DECLARE_GLOBAL_DATA_PTR; |
| 18 | |
| 19 | int checkboard(void) |
| 20 | { |
| 21 | printf("Board: CSP BF537 Minotaur board\n"); |
| 22 | printf(" Support: http://www.camsig.co.uk/\n"); |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | phys_size_t initdram(int board_type) |
| 27 | { |
| 28 | gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; |
| 29 | gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE; |
| 30 | return gd->bd->bi_memsize; |
| 31 | } |
| 32 | |
| 33 | #ifdef CONFIG_BFIN_MAC |
| 34 | static void board_init_enetaddr(uchar *mac_addr) |
| 35 | { |
| 36 | puts("Warning: Generating 'random' MAC address\n"); |
| 37 | bfin_gen_rand_mac(mac_addr); |
| 38 | eth_setenv_enetaddr("ethaddr", mac_addr); |
| 39 | } |
| 40 | |
| 41 | int board_eth_init(bd_t *bis) |
| 42 | { |
| 43 | return bfin_EMAC_initialize(bis); |
| 44 | } |
| 45 | #endif |
| 46 | |
| 47 | int misc_init_r(void) |
| 48 | { |
| 49 | #ifdef CONFIG_BFIN_MAC |
| 50 | uchar enetaddr[6]; |
| 51 | if (!eth_getenv_enetaddr("ethaddr", enetaddr)) |
| 52 | board_init_enetaddr(enetaddr); |
| 53 | #endif |
| 54 | |
| 55 | return 0; |
| 56 | } |