diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-02-27 08:08:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-02 06:15:07 -0500 |
commit | 94f52cd152ce20aa72415bcf0804faee0d31d023 (patch) | |
tree | 9fc249b2a6e53eba8a476dd1b6545bbd30f1140c /drivers/net/sfc | |
parent | 8129d2173ea7a5b030b4cba044d1f92689895083 (diff) |
sfc: Add support for SFN4112F SFP+ reference design
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/boards.c | 62 | ||||
-rw-r--r-- | drivers/net/sfc/boards.h | 1 |
2 files changed, 63 insertions, 0 deletions
diff --git a/drivers/net/sfc/boards.c b/drivers/net/sfc/boards.c index b70987892dfe..5182ac5a1034 100644 --- a/drivers/net/sfc/boards.c +++ b/drivers/net/sfc/boards.c | |||
@@ -226,6 +226,66 @@ static int sfe4002_init(struct efx_nic *efx) | |||
226 | return 0; | 226 | return 0; |
227 | } | 227 | } |
228 | 228 | ||
229 | /***************************************************************************** | ||
230 | * Support for the SFN4112F | ||
231 | * | ||
232 | */ | ||
233 | static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */ | ||
234 | |||
235 | static const u8 sfn4112f_lm87_regs[] = { | ||
236 | LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ | ||
237 | LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ | ||
238 | LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ | ||
239 | LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ | ||
240 | LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ | ||
241 | LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ | ||
242 | LM87_TEMP_INT_LIMITS(10, 60), /* board */ | ||
243 | LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ | ||
244 | 0 | ||
245 | }; | ||
246 | |||
247 | static struct i2c_board_info sfn4112f_hwmon_info = { | ||
248 | I2C_BOARD_INFO("lm87", 0x2e), | ||
249 | .platform_data = &sfn4112f_lm87_channel, | ||
250 | .irq = -1, | ||
251 | }; | ||
252 | |||
253 | #define SFN4112F_ACT_LED 0 | ||
254 | #define SFN4112F_LINK_LED 1 | ||
255 | |||
256 | static void sfn4112f_init_leds(struct efx_nic *efx) | ||
257 | { | ||
258 | xfp_set_led(efx, SFN4112F_ACT_LED, | ||
259 | QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACT); | ||
260 | xfp_set_led(efx, SFN4112F_LINK_LED, | ||
261 | QUAKE_LED_RXLINK | QUAKE_LED_LINK_STAT); | ||
262 | } | ||
263 | |||
264 | static void sfn4112f_set_id_led(struct efx_nic *efx, bool state) | ||
265 | { | ||
266 | xfp_set_led(efx, SFN4112F_LINK_LED, | ||
267 | state ? QUAKE_LED_ON : QUAKE_LED_OFF); | ||
268 | } | ||
269 | |||
270 | static int sfn4112f_check_hw(struct efx_nic *efx) | ||
271 | { | ||
272 | /* Mask out unused sensors */ | ||
273 | return efx_check_lm87(efx, ~0x48); | ||
274 | } | ||
275 | |||
276 | static int sfn4112f_init(struct efx_nic *efx) | ||
277 | { | ||
278 | int rc = efx_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs); | ||
279 | if (rc) | ||
280 | return rc; | ||
281 | efx->board_info.monitor = sfn4112f_check_hw; | ||
282 | efx->board_info.init_leds = sfn4112f_init_leds; | ||
283 | efx->board_info.set_id_led = sfn4112f_set_id_led; | ||
284 | efx->board_info.blink = board_blink; | ||
285 | efx->board_info.fini = efx_fini_lm87; | ||
286 | return 0; | ||
287 | } | ||
288 | |||
229 | /* This will get expanded as board-specific details get moved out of the | 289 | /* This will get expanded as board-specific details get moved out of the |
230 | * PHY drivers. */ | 290 | * PHY drivers. */ |
231 | struct efx_board_data { | 291 | struct efx_board_data { |
@@ -241,6 +301,8 @@ static struct efx_board_data board_data[] = { | |||
241 | { EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init }, | 301 | { EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init }, |
242 | { EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter", | 302 | { EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter", |
243 | sfn4111t_init }, | 303 | sfn4111t_init }, |
304 | { EFX_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter", | ||
305 | sfn4112f_init }, | ||
244 | }; | 306 | }; |
245 | 307 | ||
246 | void efx_set_board_info(struct efx_nic *efx, u16 revision_info) | 308 | void efx_set_board_info(struct efx_nic *efx, u16 revision_info) |
diff --git a/drivers/net/sfc/boards.h b/drivers/net/sfc/boards.h index d93c6c6a7548..44942de0e080 100644 --- a/drivers/net/sfc/boards.h +++ b/drivers/net/sfc/boards.h | |||
@@ -15,6 +15,7 @@ enum efx_board_type { | |||
15 | EFX_BOARD_SFE4001 = 1, | 15 | EFX_BOARD_SFE4001 = 1, |
16 | EFX_BOARD_SFE4002 = 2, | 16 | EFX_BOARD_SFE4002 = 2, |
17 | EFX_BOARD_SFN4111T = 0x51, | 17 | EFX_BOARD_SFN4111T = 0x51, |
18 | EFX_BOARD_SFN4112F = 0x52, | ||
18 | }; | 19 | }; |
19 | 20 | ||
20 | extern void efx_set_board_info(struct efx_nic *efx, u16 revision_info); | 21 | extern void efx_set_board_info(struct efx_nic *efx, u16 revision_info); |