Alexey Brodkin | a7069dd | 2014-02-04 12:56:19 +0400 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <dwmmc.h> |
| 9 | #include <malloc.h> |
| 10 | #include <netdev.h> |
| 11 | #include <phy.h> |
| 12 | |
| 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
| 15 | int board_mmc_init(bd_t *bis) |
| 16 | { |
| 17 | struct dwmci_host *host = NULL; |
| 18 | |
| 19 | host = malloc(sizeof(struct dwmci_host)); |
| 20 | if (!host) { |
| 21 | printf("dwmci_host malloc fail!\n"); |
| 22 | return 1; |
| 23 | } |
| 24 | |
| 25 | memset(host, 0, sizeof(struct dwmci_host)); |
| 26 | host->name = "Synopsys Mobile storage"; |
| 27 | host->ioaddr = (void *)ARC_DWMMC_BASE; |
| 28 | host->buswidth = 4; |
| 29 | host->dev_index = 0; |
| 30 | host->bus_hz = 25000000; |
| 31 | |
| 32 | add_dwmci(host, 52000000, 400000); |
| 33 | |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | int board_eth_init(bd_t *bis) |
| 38 | { |
| 39 | if (designware_initialize(0, ARC_DWGMAC_BASE, 0, |
| 40 | PHY_INTERFACE_MODE_RGMII) >= 0) |
| 41 | return 1; |
| 42 | |
| 43 | return 0; |
| 44 | } |