blob: bbfda27654e6311278e50cda7625e4ef7e362b6d [file] [log] [blame]
/*
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* 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.
*
*/
#ifndef _ATH_PHY_H
#define _ATH_PHY_H
#define ath_gmac_unit2name(_unit) (_unit ? "eth1" : "eth0")
extern int ath_gmac_miiphy_read(char *devname, uint32_t phaddr, uint8_t reg, uint16_t *data);
extern int ath_gmac_miiphy_write(char *devname, uint32_t phaddr, uint8_t reg, uint16_t data);
#define phy_reg_read(base, addr, reg) \
ath_gmac_miiphy_read(ath_gmac_unit2name(base), addr, reg, NULL)
#define phy_reg_write(base, addr, reg, data) \
ath_gmac_miiphy_write(ath_gmac_unit2name(base), addr, reg, data)
#endif