summaryrefslogtreecommitdiff
path: root/cpu/arm920t/wmt/ether.c
blob: aafad9e5cc4e083ca0d2cd03e281cebf15a9e269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*++ 
Copyright (c) 2010 WonderMedia Technologies, Inc.

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software 
Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details. You
should have received a copy of the GNU General Public License along with this
program. If not, see http://www.gnu.org/licenses/>.

WonderMedia Technologies, Inc.
10F, 529, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C.
--*/

#include <common.h>
#include <asm/io.h>
#include <net.h>
#include <miiphy.h>
#include "macif.h"
#include "mac.h"
#include "alloct.h"
#include <asm/u-boot.h>
#include <configs/wmt.h>

#ifdef CONFIG_DRIVER_ETHER

#if (CONFIG_COMMANDS & CFG_CMD_NET)

/******************************************************************************
 *
 * Public u-boot interface functions below
 *
 *****************************************************************************/
int eth_init(bd_t *bd)
{   
	return mac_startio(bd);	
 }

int eth_send(volatile void *packet, int length)
{
	return mac_send(packet,length);
}

int eth_rx(void)
{
	return mac_receive();
}

void eth_halt(void)
{
	mac_halt();
	return;
}

#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
int  wmt_miiphy_read(char *devname, unsigned char addr,
		unsigned char reg, unsigned short *value)
{
	mii_read(devname, addr, reg, value);
	return 0;
}

int  wmt_miiphy_write(char *devname, unsigned char addr,
		unsigned char reg, unsigned short value)
{
	mii_write(devname, addr, reg, value);
	return 0;
}

#endif	/* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) */

int wmt_miiphy_initialize(bd_t *bis)
{
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
	/* miiphy_register("wmtphy", wmt_miiphy_read, wmt_miiphy_write); */
#endif
	return 0;
}

#endif	/* CONFIG_COMMANDS & CFG_CMD_NET */

#endif	/* CONFIG_DRIVER_ETHER */