summaryrefslogtreecommitdiffstats
path: root/drivers/net/xilinx_ll_temac_mdio.h
blob: 0603c64457f354e5bf421f7b7b2a154939513ce2 (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
/*
 * Xilinx xps_ll_temac ethernet driver for u-boot
 *
 * MDIO bus access interface
 *
 * Copyright (C) 2011 - 2012 Stephan Linz <linz@li-pro.net>
 * Copyright (C) 2008 - 2011 Michal Simek <monstr@monstr.eu>
 * Copyright (C) 2008 - 2011 PetaLogix
 *
 * Based on Yoshio Kashiwagi kashiwagi@co-nss.co.jp driver
 * Copyright (C) 2008 Nissin Systems Co.,Ltd.
 * March 2008 created
 *
 * SPDX-License-Identifier:	GPL-2.0+
 *
 * [0]: http://www.xilinx.com/support/documentation
 *
 * [S]:	[0]/ip_documentation/xps_ll_temac.pdf
 * [A]:	[0]/application_notes/xapp1041.pdf
 */
#ifndef _XILINX_LL_TEMAC_MDIO_
#define _XILINX_LL_TEMAC_MDIO_

#include <net.h>
#include <miiphy.h>

#include <asm/types.h>
#include <asm/byteorder.h>

#include "xilinx_ll_temac.h"

int ll_temac_local_mdio_read(struct temac_reg *regs, int addr, int devad,
				int regnum);
void ll_temac_local_mdio_write(struct temac_reg *regs, int addr, int devad,
				int regnum, u16 value);

int ll_temac_phy_read(struct mii_dev *bus, int addr, int devad, int regnum);
int ll_temac_phy_write(struct mii_dev *bus, int addr, int devad, int regnum,
			u16 value);

int ll_temac_phy_addr(struct mii_dev *bus);

struct ll_temac_mdio_info {
	struct temac_reg *regs;
	char *name;
};

int xilinx_ll_temac_mdio_initialize(bd_t *bis, struct ll_temac_mdio_info *info);

#endif /* _XILINX_LL_TEMAC_MDIO_ */