blob: 774204976e5de4e911e643e09ee664d49554bdbb [file] [log] [blame]
Alexey Brodkina7069dd2014-02-04 12:56:19 +04001/*
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
13DECLARE_GLOBAL_DATA_PTR;
14
15int 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;
Alexey Brodkind5717e82015-04-02 10:19:12 +030030 host->bus_hz = 50000000;
Alexey Brodkina7069dd2014-02-04 12:56:19 +040031
Alexey Brodkind5717e82015-04-02 10:19:12 +030032 add_dwmci(host, host->bus_hz, 400000);
Alexey Brodkina7069dd2014-02-04 12:56:19 +040033
34 return 0;
35}
36
37int board_eth_init(bd_t *bis)
38{
Alexey Brodkinf39b2a62014-02-08 10:24:35 +040039 if (designware_initialize(ARC_DWGMAC_BASE,
Alexey Brodkina7069dd2014-02-04 12:56:19 +040040 PHY_INTERFACE_MODE_RGMII) >= 0)
41 return 1;
42
43 return 0;
44}