xref: /openbmc/linux/drivers/net/ethernet/sfc/falcon/phy.h (revision 5a6681e2)
15a6681e2SEdward Cree /****************************************************************************
25a6681e2SEdward Cree  * Driver for Solarflare network controllers and boards
35a6681e2SEdward Cree  * Copyright 2007-2010 Solarflare Communications Inc.
45a6681e2SEdward Cree  *
55a6681e2SEdward Cree  * This program is free software; you can redistribute it and/or modify it
65a6681e2SEdward Cree  * under the terms of the GNU General Public License version 2 as published
75a6681e2SEdward Cree  * by the Free Software Foundation, incorporated herein by reference.
85a6681e2SEdward Cree  */
95a6681e2SEdward Cree 
105a6681e2SEdward Cree #ifndef EF4_PHY_H
115a6681e2SEdward Cree #define EF4_PHY_H
125a6681e2SEdward Cree 
135a6681e2SEdward Cree /****************************************************************************
145a6681e2SEdward Cree  * 10Xpress (SFX7101) PHY
155a6681e2SEdward Cree  */
165a6681e2SEdward Cree extern const struct ef4_phy_operations falcon_sfx7101_phy_ops;
175a6681e2SEdward Cree 
185a6681e2SEdward Cree void tenxpress_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode);
195a6681e2SEdward Cree 
205a6681e2SEdward Cree /****************************************************************************
215a6681e2SEdward Cree  * AMCC/Quake QT202x PHYs
225a6681e2SEdward Cree  */
235a6681e2SEdward Cree extern const struct ef4_phy_operations falcon_qt202x_phy_ops;
245a6681e2SEdward Cree 
255a6681e2SEdward Cree /* These PHYs provide various H/W control states for LEDs */
265a6681e2SEdward Cree #define QUAKE_LED_LINK_INVAL	(0)
275a6681e2SEdward Cree #define QUAKE_LED_LINK_STAT	(1)
285a6681e2SEdward Cree #define QUAKE_LED_LINK_ACT	(2)
295a6681e2SEdward Cree #define QUAKE_LED_LINK_ACTSTAT	(3)
305a6681e2SEdward Cree #define QUAKE_LED_OFF		(4)
315a6681e2SEdward Cree #define QUAKE_LED_ON		(5)
325a6681e2SEdward Cree #define QUAKE_LED_LINK_INPUT	(6)	/* Pin is an input. */
335a6681e2SEdward Cree /* What link the LED tracks */
345a6681e2SEdward Cree #define QUAKE_LED_TXLINK	(0)
355a6681e2SEdward Cree #define QUAKE_LED_RXLINK	(8)
365a6681e2SEdward Cree 
375a6681e2SEdward Cree void falcon_qt202x_set_led(struct ef4_nic *p, int led, int state);
385a6681e2SEdward Cree 
395a6681e2SEdward Cree /****************************************************************************
405a6681e2SEdward Cree * Transwitch CX4 retimer
415a6681e2SEdward Cree */
425a6681e2SEdward Cree extern const struct ef4_phy_operations falcon_txc_phy_ops;
435a6681e2SEdward Cree 
445a6681e2SEdward Cree #define TXC_GPIO_DIR_INPUT	0
455a6681e2SEdward Cree #define TXC_GPIO_DIR_OUTPUT	1
465a6681e2SEdward Cree 
475a6681e2SEdward Cree void falcon_txc_set_gpio_dir(struct ef4_nic *efx, int pin, int dir);
485a6681e2SEdward Cree void falcon_txc_set_gpio_val(struct ef4_nic *efx, int pin, int val);
495a6681e2SEdward Cree 
505a6681e2SEdward Cree #endif
51