1 /****************************************************************************
2 * Driver for Solarflare Solarstorm network controllers and boards
3 * Copyright 2007-2008 Solarflare Communications Inc.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
10 #include <linux/rtnetlink.h>
12 #include "net_driver.h"
18 #include "workarounds.h"
20 /* Macros for unpacking the board revision */
21 /* The revision info is in host byte order. */
22 #define FALCON_BOARD_TYPE(_rev) (_rev >> 8)
23 #define FALCON_BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf)
24 #define FALCON_BOARD_MINOR(_rev) (_rev & 0xf)
27 #define FALCON_BOARD_SFE4001 0x01
28 #define FALCON_BOARD_SFE4002 0x02
29 #define FALCON_BOARD_SFN4111T 0x51
30 #define FALCON_BOARD_SFN4112F 0x52
32 /*****************************************************************************
33 * Support for LM87 sensor chip used on several boards
35 #define LM87_REG_ALARMS1 0x41
36 #define LM87_REG_ALARMS2 0x42
37 #define LM87_IN_LIMITS(nr, _min, _max) \
38 0x2B + (nr) * 2, _max, 0x2C + (nr) * 2, _min
39 #define LM87_AIN_LIMITS(nr, _min, _max) \
40 0x3B + (nr), _max, 0x1A + (nr), _min
41 #define LM87_TEMP_INT_LIMITS(_min, _max) \
42 0x39, _max, 0x3A, _min
43 #define LM87_TEMP_EXT1_LIMITS(_min, _max) \
44 0x37, _max, 0x38, _min
46 #define LM87_ALARM_TEMP_INT 0x10
47 #define LM87_ALARM_TEMP_EXT1 0x20
49 #if defined(CONFIG_SENSORS_LM87) || defined(CONFIG_SENSORS_LM87_MODULE)
51 static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,
54 struct i2c_client *client = i2c_new_device(&efx->i2c_adap, info);
61 u8 reg = *reg_values++;
62 u8 value = *reg_values++;
63 rc = i2c_smbus_write_byte_data(client, reg, value);
68 efx->board_info.hwmon_client = client;
72 i2c_unregister_device(client);
76 static void efx_fini_lm87(struct efx_nic *efx)
78 i2c_unregister_device(efx->board_info.hwmon_client);
81 static int efx_check_lm87(struct efx_nic *efx, unsigned mask)
83 struct i2c_client *client = efx->board_info.hwmon_client;
86 /* If link is up then do not monitor temperature */
87 if (EFX_WORKAROUND_7884(efx) && efx->link_up)
90 alarms1 = i2c_smbus_read_byte_data(client, LM87_REG_ALARMS1);
91 alarms2 = i2c_smbus_read_byte_data(client, LM87_REG_ALARMS2);
98 if (alarms1 || alarms2) {
100 "LM87 detected a hardware failure (status %02x:%02x)"
103 (alarms1 & LM87_ALARM_TEMP_INT) ? " INTERNAL" : "",
104 (alarms1 & LM87_ALARM_TEMP_EXT1) ? " EXTERNAL" : "");
111 #else /* !CONFIG_SENSORS_LM87 */
114 efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,
115 const u8 *reg_values)
119 static inline void efx_fini_lm87(struct efx_nic *efx)
122 static inline int efx_check_lm87(struct efx_nic *efx, unsigned mask)
127 #endif /* CONFIG_SENSORS_LM87 */
129 /*****************************************************************************
130 * Support for the SFE4001 and SFN4111T NICs.
132 * The SFE4001 does not power-up fully at reset due to its high power
133 * consumption. We control its power via a PCA9539 I/O expander.
134 * Both boards have a MAX6647 temperature monitor which we expose to
137 * This also provides minimal support for reflashing the PHY, which is
138 * initiated by resetting it with the FLASH_CFG_1 pin pulled down.
139 * On SFE4001 rev A2 and later this is connected to the 3V3X output of
140 * the IO-expander; on the SFN4111T it is connected to Falcon's GPIO3.
141 * We represent reflash mode as PHY_MODE_SPECIAL and make it mutually
142 * exclusive with the network device being open.
145 /**************************************************************************
146 * Support for I2C IO Expander device on SFE40001
152 #define P0_INVERT 0x04
153 #define P0_CONFIG 0x06
155 #define P0_EN_1V0X_LBN 0
156 #define P0_EN_1V0X_WIDTH 1
157 #define P0_EN_1V2_LBN 1
158 #define P0_EN_1V2_WIDTH 1
159 #define P0_EN_2V5_LBN 2
160 #define P0_EN_2V5_WIDTH 1
161 #define P0_EN_3V3X_LBN 3
162 #define P0_EN_3V3X_WIDTH 1
163 #define P0_EN_5V_LBN 4
164 #define P0_EN_5V_WIDTH 1
165 #define P0_SHORTEN_JTAG_LBN 5
166 #define P0_SHORTEN_JTAG_WIDTH 1
167 #define P0_X_TRST_LBN 6
168 #define P0_X_TRST_WIDTH 1
169 #define P0_DSP_RESET_LBN 7
170 #define P0_DSP_RESET_WIDTH 1
174 #define P1_INVERT 0x05
175 #define P1_CONFIG 0x07
177 #define P1_AFE_PWD_LBN 0
178 #define P1_AFE_PWD_WIDTH 1
179 #define P1_DSP_PWD25_LBN 1
180 #define P1_DSP_PWD25_WIDTH 1
181 #define P1_RESERVED_LBN 2
182 #define P1_RESERVED_WIDTH 2
183 #define P1_SPARE_LBN 4
184 #define P1_SPARE_WIDTH 4
186 /* Temperature Sensor */
187 #define MAX664X_REG_RSL 0x02
188 #define MAX664X_REG_WLHO 0x0B
190 static void sfe4001_poweroff(struct efx_nic *efx)
192 struct i2c_client *ioexp_client = efx->board_info.ioexp_client;
193 struct i2c_client *hwmon_client = efx->board_info.hwmon_client;
195 /* Turn off all power rails and disable outputs */
196 i2c_smbus_write_byte_data(ioexp_client, P0_OUT, 0xff);
197 i2c_smbus_write_byte_data(ioexp_client, P1_CONFIG, 0xff);
198 i2c_smbus_write_byte_data(ioexp_client, P0_CONFIG, 0xff);
200 /* Clear any over-temperature alert */
201 i2c_smbus_read_byte_data(hwmon_client, MAX664X_REG_RSL);
204 static int sfe4001_poweron(struct efx_nic *efx)
206 struct i2c_client *hwmon_client = efx->board_info.hwmon_client;
207 struct i2c_client *ioexp_client = efx->board_info.ioexp_client;
212 /* Clear any previous over-temperature alert */
213 rc = i2c_smbus_read_byte_data(hwmon_client, MAX664X_REG_RSL);
217 /* Enable port 0 and port 1 outputs on IO expander */
218 rc = i2c_smbus_write_byte_data(ioexp_client, P0_CONFIG, 0x00);
221 rc = i2c_smbus_write_byte_data(ioexp_client, P1_CONFIG,
222 0xff & ~(1 << P1_SPARE_LBN));
226 /* If PHY power is on, turn it all off and wait 1 second to
227 * ensure a full reset.
229 rc = i2c_smbus_read_byte_data(ioexp_client, P0_OUT);
232 out = 0xff & ~((0 << P0_EN_1V2_LBN) | (0 << P0_EN_2V5_LBN) |
233 (0 << P0_EN_3V3X_LBN) | (0 << P0_EN_5V_LBN) |
234 (0 << P0_EN_1V0X_LBN));
236 EFX_INFO(efx, "power-cycling PHY\n");
237 rc = i2c_smbus_write_byte_data(ioexp_client, P0_OUT, out);
240 schedule_timeout_uninterruptible(HZ);
243 for (i = 0; i < 20; ++i) {
244 /* Turn on 1.2V, 2.5V, 3.3V and 5V power rails */
245 out = 0xff & ~((1 << P0_EN_1V2_LBN) | (1 << P0_EN_2V5_LBN) |
246 (1 << P0_EN_3V3X_LBN) | (1 << P0_EN_5V_LBN) |
247 (1 << P0_X_TRST_LBN));
248 if (efx->phy_mode & PHY_MODE_SPECIAL)
249 out |= 1 << P0_EN_3V3X_LBN;
251 rc = i2c_smbus_write_byte_data(ioexp_client, P0_OUT, out);
256 /* Turn on 1V power rail */
257 out &= ~(1 << P0_EN_1V0X_LBN);
258 rc = i2c_smbus_write_byte_data(ioexp_client, P0_OUT, out);
262 EFX_INFO(efx, "waiting for DSP boot (attempt %d)...\n", i);
264 /* In flash config mode, DSP does not turn on AFE, so
265 * just wait 1 second.
267 if (efx->phy_mode & PHY_MODE_SPECIAL) {
268 schedule_timeout_uninterruptible(HZ);
272 for (j = 0; j < 10; ++j) {
275 /* Check DSP has asserted AFE power line */
276 rc = i2c_smbus_read_byte_data(ioexp_client, P1_IN);
279 if (rc & (1 << P1_AFE_PWD_LBN))
284 EFX_INFO(efx, "timed out waiting for DSP boot\n");
287 sfe4001_poweroff(efx);
291 static int sfn4111t_reset(struct efx_nic *efx)
295 /* GPIO 3 and the GPIO register are shared with I2C, so block that */
296 i2c_lock_adapter(&efx->i2c_adap);
298 /* Pull RST_N (GPIO 2) low then let it up again, setting the
299 * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the
300 * output enables; the output levels should always be 0 (low)
301 * and we rely on external pull-ups. */
302 efx_reado(efx, ®, FR_AB_GPIO_CTL);
303 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO2_OEN, true);
304 efx_writeo(efx, ®, FR_AB_GPIO_CTL);
306 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO2_OEN, false);
307 EFX_SET_OWORD_FIELD(reg, FRF_AB_GPIO3_OEN,
308 !!(efx->phy_mode & PHY_MODE_SPECIAL));
309 efx_writeo(efx, ®, FR_AB_GPIO_CTL);
312 i2c_unlock_adapter(&efx->i2c_adap);
318 static ssize_t show_phy_flash_cfg(struct device *dev,
319 struct device_attribute *attr, char *buf)
321 struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev));
322 return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL));
325 static ssize_t set_phy_flash_cfg(struct device *dev,
326 struct device_attribute *attr,
327 const char *buf, size_t count)
329 struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev));
330 enum efx_phy_mode old_mode, new_mode;
334 old_mode = efx->phy_mode;
335 if (count == 0 || *buf == '0')
336 new_mode = old_mode & ~PHY_MODE_SPECIAL;
338 new_mode = PHY_MODE_SPECIAL;
339 if (old_mode == new_mode) {
341 } else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) {
344 /* Reset the PHY, reconfigure the MAC and enable/disable
345 * MAC stats accordingly. */
346 efx->phy_mode = new_mode;
347 if (new_mode & PHY_MODE_SPECIAL)
348 efx_stats_disable(efx);
349 if (efx->board_info.type == FALCON_BOARD_SFE4001)
350 err = sfe4001_poweron(efx);
352 err = sfn4111t_reset(efx);
353 efx_reconfigure_port(efx);
354 if (!(new_mode & PHY_MODE_SPECIAL))
355 efx_stats_enable(efx);
359 return err ? err : count;
362 static DEVICE_ATTR(phy_flash_cfg, 0644, show_phy_flash_cfg, set_phy_flash_cfg);
364 static void sfe4001_fini(struct efx_nic *efx)
366 EFX_INFO(efx, "%s\n", __func__);
368 device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);
369 sfe4001_poweroff(efx);
370 i2c_unregister_device(efx->board_info.ioexp_client);
371 i2c_unregister_device(efx->board_info.hwmon_client);
374 static int sfe4001_check_hw(struct efx_nic *efx)
378 /* If XAUI link is up then do not monitor */
379 if (EFX_WORKAROUND_7884(efx) && efx->mac_up)
382 /* Check the powered status of the PHY. Lack of power implies that
383 * the MAX6647 has shut down power to it, probably due to a temp.
384 * alarm. Reading the power status rather than the MAX6647 status
385 * directly because the later is read-to-clear and would thus
386 * start to power up the PHY again when polled, causing us to blip
387 * the power undesirably.
388 * We know we can read from the IO expander because we did
389 * it during power-on. Assume failure now is bad news. */
390 status = i2c_smbus_read_byte_data(efx->board_info.ioexp_client, P1_IN);
392 (status & ((1 << P1_AFE_PWD_LBN) | (1 << P1_DSP_PWD25_LBN))) != 0)
395 /* Use board power control, not PHY power control */
396 sfe4001_poweroff(efx);
397 efx->phy_mode = PHY_MODE_OFF;
399 return (status < 0) ? -EIO : -ERANGE;
402 static struct i2c_board_info sfe4001_hwmon_info = {
403 I2C_BOARD_INFO("max6647", 0x4e),
406 /* This board uses an I2C expander to provider power to the PHY, which needs to
407 * be turned on before the PHY can be used.
408 * Context: Process context, rtnl lock held
410 static int sfe4001_init(struct efx_nic *efx)
414 #if defined(CONFIG_SENSORS_LM90) || defined(CONFIG_SENSORS_LM90_MODULE)
415 efx->board_info.hwmon_client =
416 i2c_new_device(&efx->i2c_adap, &sfe4001_hwmon_info);
418 efx->board_info.hwmon_client =
419 i2c_new_dummy(&efx->i2c_adap, sfe4001_hwmon_info.addr);
421 if (!efx->board_info.hwmon_client)
424 /* Raise board/PHY high limit from 85 to 90 degrees Celsius */
425 rc = i2c_smbus_write_byte_data(efx->board_info.hwmon_client,
426 MAX664X_REG_WLHO, 90);
430 efx->board_info.ioexp_client = i2c_new_dummy(&efx->i2c_adap, PCA9539);
431 if (!efx->board_info.ioexp_client) {
436 /* 10Xpress has fixed-function LED pins, so there is no board-specific
438 efx->board_info.set_id_led = tenxpress_set_id_led;
440 efx->board_info.monitor = sfe4001_check_hw;
441 efx->board_info.fini = sfe4001_fini;
443 if (efx->phy_mode & PHY_MODE_SPECIAL) {
444 /* PHY won't generate a 156.25 MHz clock and MAC stats fetch
446 efx_stats_disable(efx);
448 rc = sfe4001_poweron(efx);
452 rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);
456 EFX_INFO(efx, "PHY is powered on\n");
460 sfe4001_poweroff(efx);
462 i2c_unregister_device(efx->board_info.ioexp_client);
464 i2c_unregister_device(efx->board_info.hwmon_client);
468 static int sfn4111t_check_hw(struct efx_nic *efx)
472 /* If XAUI link is up then do not monitor */
473 if (EFX_WORKAROUND_7884(efx) && efx->mac_up)
476 /* Test LHIGH, RHIGH, FAULT, EOT and IOT alarms */
477 status = i2c_smbus_read_byte_data(efx->board_info.hwmon_client,
486 static void sfn4111t_fini(struct efx_nic *efx)
488 EFX_INFO(efx, "%s\n", __func__);
490 device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);
491 i2c_unregister_device(efx->board_info.hwmon_client);
494 static struct i2c_board_info sfn4111t_a0_hwmon_info = {
495 I2C_BOARD_INFO("max6647", 0x4e),
498 static struct i2c_board_info sfn4111t_r5_hwmon_info = {
499 I2C_BOARD_INFO("max6646", 0x4d),
502 static int sfn4111t_init(struct efx_nic *efx)
507 efx->board_info.hwmon_client =
508 i2c_new_device(&efx->i2c_adap,
509 (efx->board_info.minor < 5) ?
510 &sfn4111t_a0_hwmon_info :
511 &sfn4111t_r5_hwmon_info);
512 if (!efx->board_info.hwmon_client)
515 efx->board_info.set_id_led = tenxpress_set_id_led;
516 efx->board_info.monitor = sfn4111t_check_hw;
517 efx->board_info.fini = sfn4111t_fini;
519 rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);
524 if (efx->phy_mode & PHY_MODE_SPECIAL) {
525 /* PHY may not generate a 156.25 MHz clock and MAC
526 * stats fetch will fail. */
527 efx_stats_disable(efx);
530 rc = sft9001_wait_boot(efx);
533 efx->phy_mode = PHY_MODE_SPECIAL;
534 } while (rc == -EINVAL && ++i < 2);
536 device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);
538 i2c_unregister_device(efx->board_info.hwmon_client);
542 /*****************************************************************************
543 * Support for the SFE4002
546 static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */
548 static const u8 sfe4002_lm87_regs[] = {
549 LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */
550 LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */
551 LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */
552 LM87_IN_LIMITS(3, 0xb0, 0xc9), /* 5V: 4.6-5.2V */
553 LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */
554 LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */
555 LM87_AIN_LIMITS(0, 0xa0, 0xb2), /* AIN1: 1.66V +/- 5% */
556 LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */
557 LM87_TEMP_INT_LIMITS(10, 60), /* board */
558 LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */
562 static struct i2c_board_info sfe4002_hwmon_info = {
563 I2C_BOARD_INFO("lm87", 0x2e),
564 .platform_data = &sfe4002_lm87_channel,
567 /****************************************************************************/
568 /* LED allocations. Note that on rev A0 boards the schematic and the reality
569 * differ: red and green are swapped. Below is the fixed (A1) layout (there
570 * are only 3 A0 boards in existence, so no real reason to make this
573 #define SFE4002_FAULT_LED (2) /* Red */
574 #define SFE4002_RX_LED (0) /* Green */
575 #define SFE4002_TX_LED (1) /* Amber */
577 static void sfe4002_init_leds(struct efx_nic *efx)
579 /* Set the TX and RX LEDs to reflect status and activity, and the
581 falcon_qt202x_set_led(efx, SFE4002_TX_LED,
582 QUAKE_LED_TXLINK | QUAKE_LED_LINK_ACTSTAT);
583 falcon_qt202x_set_led(efx, SFE4002_RX_LED,
584 QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACTSTAT);
585 falcon_qt202x_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF);
588 static void sfe4002_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
590 falcon_qt202x_set_led(
591 efx, SFE4002_FAULT_LED,
592 (mode == EFX_LED_ON) ? QUAKE_LED_ON : QUAKE_LED_OFF);
595 static int sfe4002_check_hw(struct efx_nic *efx)
597 /* A0 board rev. 4002s report a temperature fault the whole time
598 * (bad sensor) so we mask it out. */
599 unsigned alarm_mask =
600 (efx->board_info.major == 0 && efx->board_info.minor == 0) ?
601 ~LM87_ALARM_TEMP_EXT1 : ~0;
603 return efx_check_lm87(efx, alarm_mask);
606 static int sfe4002_init(struct efx_nic *efx)
608 int rc = efx_init_lm87(efx, &sfe4002_hwmon_info, sfe4002_lm87_regs);
611 efx->board_info.monitor = sfe4002_check_hw;
612 efx->board_info.init_leds = sfe4002_init_leds;
613 efx->board_info.set_id_led = sfe4002_set_id_led;
614 efx->board_info.fini = efx_fini_lm87;
618 /*****************************************************************************
619 * Support for the SFN4112F
622 static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */
624 static const u8 sfn4112f_lm87_regs[] = {
625 LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */
626 LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */
627 LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */
628 LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */
629 LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */
630 LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */
631 LM87_TEMP_INT_LIMITS(10, 60), /* board */
632 LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */
636 static struct i2c_board_info sfn4112f_hwmon_info = {
637 I2C_BOARD_INFO("lm87", 0x2e),
638 .platform_data = &sfn4112f_lm87_channel,
641 #define SFN4112F_ACT_LED 0
642 #define SFN4112F_LINK_LED 1
644 static void sfn4112f_init_leds(struct efx_nic *efx)
646 falcon_qt202x_set_led(efx, SFN4112F_ACT_LED,
647 QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACT);
648 falcon_qt202x_set_led(efx, SFN4112F_LINK_LED,
649 QUAKE_LED_RXLINK | QUAKE_LED_LINK_STAT);
652 static void sfn4112f_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
664 reg = QUAKE_LED_RXLINK | QUAKE_LED_LINK_STAT;
668 falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, reg);
671 static int sfn4112f_check_hw(struct efx_nic *efx)
673 /* Mask out unused sensors */
674 return efx_check_lm87(efx, ~0x48);
677 static int sfn4112f_init(struct efx_nic *efx)
679 int rc = efx_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs);
682 efx->board_info.monitor = sfn4112f_check_hw;
683 efx->board_info.init_leds = sfn4112f_init_leds;
684 efx->board_info.set_id_led = sfn4112f_set_id_led;
685 efx->board_info.fini = efx_fini_lm87;
689 /* This will get expanded as board-specific details get moved out of the
691 struct falcon_board_data {
693 const char *ref_model;
694 const char *gen_type;
695 int (*init) (struct efx_nic *nic);
699 static struct falcon_board_data board_data[] = {
700 { FALCON_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init },
701 { FALCON_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
702 { FALCON_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
704 { FALCON_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
708 void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
710 struct falcon_board_data *data = NULL;
713 efx->board_info.type = FALCON_BOARD_TYPE(revision_info);
714 efx->board_info.major = FALCON_BOARD_MAJOR(revision_info);
715 efx->board_info.minor = FALCON_BOARD_MINOR(revision_info);
717 for (i = 0; i < ARRAY_SIZE(board_data); i++)
718 if (board_data[i].type == efx->board_info.type)
719 data = &board_data[i];
722 EFX_INFO(efx, "board is %s rev %c%d\n",
723 (efx->pci_dev->subsystem_vendor == EFX_VENDID_SFC)
724 ? data->ref_model : data->gen_type,
725 'A' + efx->board_info.major, efx->board_info.minor);
726 efx->board_info.init = data->init;
728 EFX_ERR(efx, "unknown board type %d\n", efx->board_info.type);