Commit 3473a5b1 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

sfc: Rename Falcon-specific board code and types

Siena will require entirely different board code.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 19e71cf6
sfc-y += efx.o falcon.o tx.o rx.o falcon_gmac.o \ sfc-y += efx.o falcon.o tx.o rx.o falcon_gmac.o \
falcon_xmac.o selftest.o ethtool.o xfp_phy.o \ falcon_xmac.o selftest.o ethtool.o xfp_phy.o \
mdio_10g.o tenxpress.o boards.o sfe4001.o mdio_10g.o tenxpress.o falcon_boards.o sfe4001.o
sfc-$(CONFIG_SFC_MTD) += mtd.o sfc-$(CONFIG_SFC_MTD) += mtd.o
obj-$(CONFIG_SFC) += sfc.o obj-$(CONFIG_SFC) += sfc.o
...@@ -10,15 +10,9 @@ ...@@ -10,15 +10,9 @@
#ifndef EFX_BOARDS_H #ifndef EFX_BOARDS_H
#define EFX_BOARDS_H #define EFX_BOARDS_H
/* Board IDs (must fit in 8 bits) */ #define FALCON_BOARD_SFE4001 0x01
enum efx_board_type {
EFX_BOARD_SFE4001 = 1,
EFX_BOARD_SFE4002 = 2,
EFX_BOARD_SFN4111T = 0x51,
EFX_BOARD_SFN4112F = 0x52,
};
extern void efx_set_board_info(struct efx_nic *efx, u16 revision_info); extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info);
/* SFE4001 (10GBASE-T) */ /* SFE4001 (10GBASE-T) */
extern int sfe4001_init(struct efx_nic *efx); extern int sfe4001_init(struct efx_nic *efx);
......
...@@ -2732,7 +2732,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx) ...@@ -2732,7 +2732,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad); EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad);
efx_set_board_info(efx, board_rev); falcon_probe_board(efx, board_rev);
kfree(nvconfig); kfree(nvconfig);
return 0; return 0;
......
...@@ -15,9 +15,14 @@ ...@@ -15,9 +15,14 @@
/* Macros for unpacking the board revision */ /* Macros for unpacking the board revision */
/* The revision info is in host byte order. */ /* The revision info is in host byte order. */
#define BOARD_TYPE(_rev) (_rev >> 8) #define FALCON_BOARD_TYPE(_rev) (_rev >> 8)
#define BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf) #define FALCON_BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf)
#define BOARD_MINOR(_rev) (_rev & 0xf) #define FALCON_BOARD_MINOR(_rev) (_rev & 0xf)
/* Board types */
#define FALCON_BOARD_SFE4002 0x02
#define FALCON_BOARD_SFN4111T 0x51
#define FALCON_BOARD_SFN4112F 0x52
/* Blink support. If the PHY has no auto-blink mode so we hang it off a timer */ /* Blink support. If the PHY has no auto-blink mode so we hang it off a timer */
#define BLINK_INTERVAL (HZ/2) #define BLINK_INTERVAL (HZ/2)
...@@ -286,31 +291,31 @@ static int sfn4112f_init(struct efx_nic *efx) ...@@ -286,31 +291,31 @@ static int sfn4112f_init(struct efx_nic *efx)
/* This will get expanded as board-specific details get moved out of the /* This will get expanded as board-specific details get moved out of the
* PHY drivers. */ * PHY drivers. */
struct efx_board_data { struct falcon_board_data {
enum efx_board_type type; u8 type;
const char *ref_model; const char *ref_model;
const char *gen_type; const char *gen_type;
int (*init) (struct efx_nic *nic); int (*init) (struct efx_nic *nic);
}; };
static struct efx_board_data board_data[] = { static struct falcon_board_data board_data[] = {
{ EFX_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init }, { FALCON_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init },
{ EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init }, { FALCON_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
{ EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter", { FALCON_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
sfn4111t_init }, sfn4111t_init },
{ EFX_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter", { FALCON_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
sfn4112f_init }, sfn4112f_init },
}; };
void efx_set_board_info(struct efx_nic *efx, u16 revision_info) void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
{ {
struct efx_board_data *data = NULL; struct falcon_board_data *data = NULL;
int i; int i;
efx->board_info.type = BOARD_TYPE(revision_info); efx->board_info.type = FALCON_BOARD_TYPE(revision_info);
efx->board_info.major = BOARD_MAJOR(revision_info); efx->board_info.major = FALCON_BOARD_MAJOR(revision_info);
efx->board_info.minor = BOARD_MINOR(revision_info); efx->board_info.minor = FALCON_BOARD_MINOR(revision_info);
for (i = 0; i < ARRAY_SIZE(board_data); i++) for (i = 0; i < ARRAY_SIZE(board_data); i++)
if (board_data[i].type == efx->board_info.type) if (board_data[i].type == efx->board_info.type)
......
...@@ -241,7 +241,7 @@ static ssize_t set_phy_flash_cfg(struct device *dev, ...@@ -241,7 +241,7 @@ static ssize_t set_phy_flash_cfg(struct device *dev,
efx->phy_mode = new_mode; efx->phy_mode = new_mode;
if (new_mode & PHY_MODE_SPECIAL) if (new_mode & PHY_MODE_SPECIAL)
efx_stats_disable(efx); efx_stats_disable(efx);
if (efx->board_info.type == EFX_BOARD_SFE4001) if (efx->board_info.type == FALCON_BOARD_SFE4001)
err = sfe4001_poweron(efx); err = sfe4001_poweron(efx);
else else
err = sfn4111t_reset(efx); err = sfn4111t_reset(efx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment