Mike Frysinger | 979294f | 2008-10-12 05:05:42 -0400 | [diff] [blame] | 1 | /* |
Bin Meng | 7557405 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 2 | * U-Boot - main board file |
Mike Frysinger | 979294f | 2008-10-12 05:05:42 -0400 | [diff] [blame] | 3 | * |
| 4 | * Copyright (c) 2005-2008 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> |
Mike Frysinger | 0287ffa | 2010-06-02 19:29:47 -0400 | [diff] [blame] | 12 | #include <netdev.h> |
Mike Frysinger | 979294f | 2008-10-12 05:05:42 -0400 | [diff] [blame] | 13 | #include <asm/blackfin.h> |
Mike Frysinger | 0287ffa | 2010-06-02 19:29:47 -0400 | [diff] [blame] | 14 | #include <asm/gpio.h> |
| 15 | #include <asm/portmux.h> |
Cliff Cai | e463892 | 2009-11-20 08:24:43 +0000 | [diff] [blame] | 16 | #include <asm/sdh.h> |
Mike Frysinger | 979294f | 2008-10-12 05:05:42 -0400 | [diff] [blame] | 17 | |
| 18 | DECLARE_GLOBAL_DATA_PTR; |
| 19 | |
| 20 | int checkboard(void) |
| 21 | { |
| 22 | printf("Board: ADI BF548 EZ-Kit board\n"); |
| 23 | printf(" Support: http://blackfin.uclinux.org/\n"); |
| 24 | return 0; |
| 25 | } |
| 26 | |
Mike Frysinger | 979294f | 2008-10-12 05:05:42 -0400 | [diff] [blame] | 27 | int board_early_init_f(void) |
| 28 | { |
Mike Frysinger | 0287ffa | 2010-06-02 19:29:47 -0400 | [diff] [blame] | 29 | /* Set async addr lines as peripheral */ |
| 30 | const unsigned short pins[] = { |
| 31 | P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12, |
| 32 | P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, |
| 33 | P_A21, P_A22, P_A23, P_A24, 0 |
| 34 | }; |
| 35 | return peripheral_request_list(pins, "async"); |
Mike Frysinger | 979294f | 2008-10-12 05:05:42 -0400 | [diff] [blame] | 36 | } |
Ben Warren | fbfdd3a | 2009-07-20 22:01:11 -0700 | [diff] [blame] | 37 | |
| 38 | #ifdef CONFIG_SMC911X |
| 39 | int board_eth_init(bd_t *bis) |
| 40 | { |
| 41 | return smc911x_initialize(0, CONFIG_SMC911X_BASE); |
| 42 | } |
| 43 | #endif |
Cliff Cai | e463892 | 2009-11-20 08:24:43 +0000 | [diff] [blame] | 44 | |
| 45 | #ifdef CONFIG_BFIN_SDH |
| 46 | int board_mmc_init(bd_t *bis) |
| 47 | { |
| 48 | return bfin_mmc_init(bis); |
| 49 | } |
| 50 | #endif |
Cliff Cai | 67d94f4 | 2009-12-08 07:25:57 +0000 | [diff] [blame] | 51 | |
| 52 | #ifdef CONFIG_USB_BLACKFIN |
| 53 | void board_musb_init(void) |
| 54 | { |
| 55 | /* |
| 56 | * Rev 1.0 BF549 EZ-KITs require PE7 to be high for both device |
| 57 | * and OTG host modes, while rev 1.1 and greater require PE7 to |
| 58 | * be low for device mode and high for host mode. We set it high |
| 59 | * here because we are in host mode. |
| 60 | */ |
Mike Frysinger | 0287ffa | 2010-06-02 19:29:47 -0400 | [diff] [blame] | 61 | gpio_request(GPIO_PE7, "musb-vbus"); |
| 62 | gpio_direction_output(GPIO_PE7, 1); |
Cliff Cai | 67d94f4 | 2009-12-08 07:25:57 +0000 | [diff] [blame] | 63 | } |
| 64 | #endif |