aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/mlx-platform.c
diff options
context:
space:
mode:
authorVadim Pasternak <vadimp@mellanox.com>2018-02-09 18:59:32 -0500
committerDarren Hart (VMware) <dvhart@infradead.org>2018-02-09 20:23:20 -0500
commit1bd42d94ccab4eab5dc9dc9d303a687a61cde9bd (patch)
tree5e0db902885b81bd9ba821b69586453356dd40a6 /drivers/platform/x86/mlx-platform.c
parenta49a41482f61a48ff00f63f809ac0d802cb75424 (diff)
platform/x86: mlx-platform: Add support for new 200G IB and Ethernet systems
It adds support for new Mellanox system types of basic classes qmb7, sn34, sn37, containing systems QMB700 (40x200GbE InfiniBand switch), SN3700 (32x200GbE and 16x400GbE Ethernet switch) and SN3410 (6x400GbE plus 48x50GbE Ethernet switch). These are the Top of the Rack systems, equipped with Mellanox COM-Express carrier board and switch board with Mellanox Quantum device, which supports InfiniBand switching with 40X200G ports and line rate of up to HDR speed or with Mellanox Spectrum-2 device, which supports Ethernet switching with 32X200G ports line rate of up to HDR speed. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/mlx-platform.c')
-rw-r--r--drivers/platform/x86/mlx-platform.c142
1 files changed, 142 insertions, 0 deletions
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index e4251cfa7b5d..454e14f02285 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -83,6 +83,7 @@
83#define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0) 83#define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0)
84#define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0) 84#define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0)
85#define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0) 85#define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0)
86#define MLXPLAT_CPLD_FAN_NG_MASK GENMASK(5, 0)
86 87
87/* Start channel numbers */ 88/* Start channel numbers */
88#define MLXPLAT_CPLD_CH1 2 89#define MLXPLAT_CPLD_CH1 2
@@ -170,6 +171,15 @@ static struct i2c_board_info mlxplat_mlxcpld_psu[] = {
170 }, 171 },
171}; 172};
172 173
174static struct i2c_board_info mlxplat_mlxcpld_ng_psu[] = {
175 {
176 I2C_BOARD_INFO("24c32", 0x51),
177 },
178 {
179 I2C_BOARD_INFO("24c32", 0x50),
180 },
181};
182
173static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { 183static struct i2c_board_info mlxplat_mlxcpld_pwr[] = {
174 { 184 {
175 I2C_BOARD_INFO("dps460", 0x59), 185 I2C_BOARD_INFO("dps460", 0x59),
@@ -476,6 +486,103 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = {
476 .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, 486 .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW,
477}; 487};
478 488
489/* Platform hotplug next generation system family data */
490static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_psu_items_data[] = {
491 {
492 .label = "psu1",
493 .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
494 .mask = BIT(0),
495 .hpdev.brdinfo = &mlxplat_mlxcpld_ng_psu[0],
496 .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR,
497 },
498 {
499 .label = "psu2",
500 .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
501 .mask = BIT(1),
502 .hpdev.brdinfo = &mlxplat_mlxcpld_ng_psu[1],
503 .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR,
504 },
505};
506
507static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_fan_items_data[] = {
508 {
509 .label = "fan1",
510 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
511 .mask = BIT(0),
512 .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
513 },
514 {
515 .label = "fan2",
516 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
517 .mask = BIT(1),
518 .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
519 },
520 {
521 .label = "fan3",
522 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
523 .mask = BIT(2),
524 .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
525 },
526 {
527 .label = "fan4",
528 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
529 .mask = BIT(3),
530 .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
531 },
532 {
533 .label = "fan5",
534 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
535 .mask = BIT(4),
536 .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
537 },
538 {
539 .label = "fan6",
540 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
541 .mask = BIT(5),
542 .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
543 },
544};
545
546static struct mlxreg_core_item mlxplat_mlxcpld_default_ng_items[] = {
547 {
548 .data = mlxplat_mlxcpld_default_ng_psu_items_data,
549 .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF,
550 .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
551 .mask = MLXPLAT_CPLD_PSU_MASK,
552 .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_psu_items_data),
553 .inversed = 1,
554 .health = false,
555 },
556 {
557 .data = mlxplat_mlxcpld_default_ng_pwr_items_data,
558 .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF,
559 .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET,
560 .mask = MLXPLAT_CPLD_PWR_MASK,
561 .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_pwr_items_data),
562 .inversed = 0,
563 .health = false,
564 },
565 {
566 .data = mlxplat_mlxcpld_default_ng_fan_items_data,
567 .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF,
568 .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET,
569 .mask = MLXPLAT_CPLD_FAN_NG_MASK,
570 .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_fan_items_data),
571 .inversed = 1,
572 .health = false,
573 },
574};
575
576static
577struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = {
578 .items = mlxplat_mlxcpld_default_ng_items,
579 .counter = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_items),
580 .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET,
581 .mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF,
582 .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET,
583 .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW,
584};
585
479static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) 586static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg)
480{ 587{
481 switch (reg) { 588 switch (reg) {
@@ -633,6 +740,20 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi)
633 return 1; 740 return 1;
634}; 741};
635 742
743static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi)
744{
745 int i;
746
747 for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) {
748 mlxplat_mux_data[i].values = mlxplat_msn21xx_channels;
749 mlxplat_mux_data[i].n_values =
750 ARRAY_SIZE(mlxplat_msn21xx_channels);
751 }
752 mlxplat_hotplug = &mlxplat_mlxcpld_default_ng_data;
753
754 return 1;
755};
756
636static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { 757static const struct dmi_system_id mlxplat_dmi_table[] __initconst = {
637 { 758 {
638 .callback = mlxplat_dmi_msn274x_matched, 759 .callback = mlxplat_dmi_msn274x_matched,
@@ -683,6 +804,27 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = {
683 DMI_MATCH(DMI_PRODUCT_NAME, "MSN201"), 804 DMI_MATCH(DMI_PRODUCT_NAME, "MSN201"),
684 }, 805 },
685 }, 806 },
807 {
808 .callback = mlxplat_dmi_qmb7xx_matched,
809 .matches = {
810 DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"),
811 DMI_MATCH(DMI_PRODUCT_NAME, "QMB7"),
812 },
813 },
814 {
815 .callback = mlxplat_dmi_qmb7xx_matched,
816 .matches = {
817 DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"),
818 DMI_MATCH(DMI_PRODUCT_NAME, "SN37"),
819 },
820 },
821 {
822 .callback = mlxplat_dmi_qmb7xx_matched,
823 .matches = {
824 DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"),
825 DMI_MATCH(DMI_PRODUCT_NAME, "SN34"),
826 },
827 },
686 { } 828 { }
687}; 829};
688 830