linux/drivers/platform/x86/mlx-platform.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/*
 * Mellanox platform driver
 *
 * Copyright (C) 2016-2018 Mellanox Technologies
 * Copyright (C) 2016-2018 Vadim Pasternak <[email protected]>
 */

#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/platform_data/i2c-mux-reg.h>
#include <linux/platform_data/mlxreg.h>
#include <linux/reboot.h>
#include <linux/regmap.h>

#define MLX_PLAT_DEVICE_NAME

/* LPC bus IO offsets */
#define MLXPLAT_CPLD_LPC_I2C_BASE_ADRR
#define MLXPLAT_CPLD_LPC_REG_BASE_ADRR
#define MLXPLAT_CPLD_LPC_REG_CPLD1_VER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD2_PN1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD3_PN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET
#define MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET
#define MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED3_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED4_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED5_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED6_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LED7_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_DIRECTION
#define MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GPCOM0_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GP0_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GP_RST_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GP1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WP1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GP2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WP2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FIELD_UPGRADE
#define MLXPLAT_CPLD_LPC_SAFE_BIOS_OFFSET
#define MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRCO_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRCX_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRCX_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_BRD_OFFSET
#define MLXPLAT_CPLD_LPC_REG_BRD_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_BRD_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GWP_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GWP_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GWP_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET
#define MLXPLAT_CPLD_LPC_REG_ASIC_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_ASIC_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_ASIC2_HEALTH_OFFSET
#define MLXPLAT_CPLD_LPC_REG_ASIC2_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_ASIC2_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRLC_OFFSET
#define MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PSU_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PSU_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PSU_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWR_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWR_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_IN_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_IN_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET
#define MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWRB_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWRB_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_VR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_VR_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_VR_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_PG_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_PG_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_PG_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_RD_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_RD_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_RD_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_SN_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_SN_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_SN_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_OK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_OK_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_OK_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_SD_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET
#define MLXPLAT_CPLD_LPC_REG_LC_PWR_ON
#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET
#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET
#define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET
#define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT
#define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD1_ACT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD2_TMR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD2_TLEFT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD2_ACT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD3_TLEFT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET
#define MLXPLAT_CPLD_LPC_REG_DBG_CTRL_OFFSET
#define MLXPLAT_CPLD_LPC_REG_I2C_CH1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_I2C_CH2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_I2C_CH3_OFFSET
#define MLXPLAT_CPLD_LPC_REG_I2C_CH4_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET
#define MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO3_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO4_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO5_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO6_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO7_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO8_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO9_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO10_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO11_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO13_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO14_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PWM4_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET
#define MLXPLAT_CPLD_LPC_REG_TACHO_SPEED_OFFSET
#define MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET
#define MLXPLAT_CPLD_LPC_REG_SLOT_QTY_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET
#define MLXPLAT_CPLD_LPC_REG_CONFIG3_OFFSET
#define MLXPLAT_CPLD_LPC_IO_RANGE

#define MLXPLAT_CPLD_LPC_PIO_OFFSET
#define MLXPLAT_CPLD_LPC_REG1
#define MLXPLAT_CPLD_LPC_REG2
#define MLXPLAT_CPLD_LPC_REG3
#define MLXPLAT_CPLD_LPC_REG4

/* Masks for aggregation, psu, pwr and fan event in CPLD related registers. */
#define MLXPLAT_CPLD_AGGR_ASIC_MASK_DEF
#define MLXPLAT_CPLD_AGGR_PSU_MASK_DEF
#define MLXPLAT_CPLD_AGGR_PWR_MASK_DEF
#define MLXPLAT_CPLD_AGGR_FAN_MASK_DEF
#define MLXPLAT_CPLD_AGGR_MASK_DEF
#define MLXPLAT_CPLD_AGGR_ASIC_MASK_NG
#define MLXPLAT_CPLD_AGGR_MASK_NG_DEF
#define MLXPLAT_CPLD_AGGR_MASK_COMEX
#define MLXPLAT_CPLD_AGGR_MASK_LC
#define MLXPLAT_CPLD_AGGR_MASK_MODULAR
#define MLXPLAT_CPLD_AGGR_MASK_LC_PRSNT
#define MLXPLAT_CPLD_AGGR_MASK_LC_RDY
#define MLXPLAT_CPLD_AGGR_MASK_LC_PG
#define MLXPLAT_CPLD_AGGR_MASK_LC_SCRD
#define MLXPLAT_CPLD_AGGR_MASK_LC_SYNC
#define MLXPLAT_CPLD_AGGR_MASK_LC_ACT
#define MLXPLAT_CPLD_AGGR_MASK_LC_SDWN
#define MLXPLAT_CPLD_AGGR_MASK_LC_LOW
#define MLXPLAT_CPLD_LOW_AGGR_MASK_LOW
#define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2
#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT
#define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C
#define MLXPLAT_CPLD_PSU_MASK
#define MLXPLAT_CPLD_PWR_MASK
#define MLXPLAT_CPLD_PSU_EXT_MASK
#define MLXPLAT_CPLD_PWR_EXT_MASK
#define MLXPLAT_CPLD_FAN_MASK
#define MLXPLAT_CPLD_ASIC_MASK
#define MLXPLAT_CPLD_FAN_NG_MASK
#define MLXPLAT_CPLD_LED_LO_NIBBLE_MASK
#define MLXPLAT_CPLD_LED_HI_NIBBLE_MASK
#define MLXPLAT_CPLD_VOLTREG_UPD_MASK
#define MLXPLAT_CPLD_GWP_MASK
#define MLXPLAT_CPLD_EROT_MASK
#define MLXPLAT_CPLD_FU_CAP_MASK
#define MLXPLAT_CPLD_PWR_BUTTON_MASK
#define MLXPLAT_CPLD_LATCH_RST_MASK
#define MLXPLAT_CPLD_THERMAL1_PDB_MASK
#define MLXPLAT_CPLD_THERMAL2_PDB_MASK
#define MLXPLAT_CPLD_INTRUSION_MASK
#define MLXPLAT_CPLD_PWM_PG_MASK
#define MLXPLAT_CPLD_L1_CHA_HEALTH_MASK
#define MLXPLAT_CPLD_I2C_CAP_BIT
#define MLXPLAT_CPLD_I2C_CAP_MASK
#define MLXPLAT_CPLD_SYS_RESET_MASK

/* Masks for aggregation for comex carriers */
#define MLXPLAT_CPLD_AGGR_MASK_CARRIER
#define MLXPLAT_CPLD_AGGR_MASK_CARR_DEF
#define MLXPLAT_CPLD_LOW_AGGRCX_MASK

/* Masks for aggregation for modular systems */
#define MLXPLAT_CPLD_LPC_LC_MASK

#define MLXPLAT_CPLD_HALT_MASK
#define MLXPLAT_CPLD_RESET_MASK

/* Default I2C parent bus number */
#define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR

/* Maximum number of possible physical buses equipped on system */
#define MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM
#define MLXPLAT_CPLD_MAX_PHYS_EXT_ADAPTER_NUM

/* Number of channels in group */
#define MLXPLAT_CPLD_GRP_CHNL_NUM

/* Start channel numbers */
#define MLXPLAT_CPLD_CH1
#define MLXPLAT_CPLD_CH2
#define MLXPLAT_CPLD_CH3
#define MLXPLAT_CPLD_CH2_ETH_MODULAR
#define MLXPLAT_CPLD_CH3_ETH_MODULAR
#define MLXPLAT_CPLD_CH4_ETH_MODULAR
#define MLXPLAT_CPLD_CH2_RACK_SWITCH
#define MLXPLAT_CPLD_CH2_NG800

/* Number of LPC attached MUX platform devices */
#define MLXPLAT_CPLD_LPC_MUX_DEVS

/* Hotplug devices adapter numbers */
#define MLXPLAT_CPLD_NR_NONE
#define MLXPLAT_CPLD_PSU_DEFAULT_NR
#define MLXPLAT_CPLD_PSU_MSNXXXX_NR
#define MLXPLAT_CPLD_FAN1_DEFAULT_NR
#define MLXPLAT_CPLD_FAN2_DEFAULT_NR
#define MLXPLAT_CPLD_FAN3_DEFAULT_NR
#define MLXPLAT_CPLD_FAN4_DEFAULT_NR
#define MLXPLAT_CPLD_NR_ASIC
#define MLXPLAT_CPLD_NR_LC_BASE

#define MLXPLAT_CPLD_NR_LC_SET(nr)
#define MLXPLAT_CPLD_LC_ADDR

/* Masks and default values for watchdogs */
#define MLXPLAT_CPLD_WD1_CLEAR_MASK
#define MLXPLAT_CPLD_WD2_CLEAR_MASK

#define MLXPLAT_CPLD_WD_TYPE1_TO_MASK
#define MLXPLAT_CPLD_WD_TYPE2_TO_MASK
#define MLXPLAT_CPLD_WD_RESET_ACT_MASK
#define MLXPLAT_CPLD_WD_FAN_ACT_MASK
#define MLXPLAT_CPLD_WD_COUNT_ACT_MASK
#define MLXPLAT_CPLD_WD_CPBLTY_MASK
#define MLXPLAT_CPLD_WD_DFLT_TIMEOUT
#define MLXPLAT_CPLD_WD3_DFLT_TIMEOUT
#define MLXPLAT_CPLD_WD_MAX_DEVS

#define MLXPLAT_CPLD_LPC_SYSIRQ

/* Minimum power required for turning on Ethernet modular system (WATT) */
#define MLXPLAT_CPLD_ETH_MODULAR_PWR_MIN

/* Default value for PWM control register for rack switch system */
#define MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT

#define MLXPLAT_I2C_MAIN_BUS_NOTIFIED
#define MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED

/* Lattice FPGA PCI configuration */
#define PCI_VENDOR_ID_LATTICE
#define PCI_DEVICE_ID_LATTICE_I2C_BRIDGE
#define PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE
#define PCI_DEVICE_ID_LATTICE_LPC_BRIDGE

/* mlxplat_priv - platform private data
 * @pdev_i2c - i2c controller platform device
 * @pdev_mux - array of mux platform devices
 * @pdev_hotplug - hotplug platform devices
 * @pdev_led - led platform devices
 * @pdev_io_regs - register access platform devices
 * @pdev_fan - FAN platform devices
 * @pdev_wd - array of watchdog platform devices
 * @regmap: device register map
 * @hotplug_resources: system hotplug resources
 * @hotplug_resources_size: size of system hotplug resources
 * @hi2c_main_init_status: init status of I2C main bus
 * @irq_fpga: FPGA IRQ number
 */
struct mlxplat_priv {};

static struct platform_device *mlxplat_dev;
static int mlxplat_i2c_main_completion_notify(void *handle, int id);
static void __iomem *i2c_bridge_addr, *jtag_bridge_addr;

/* Regions for LPC I2C controller and LPC base register space */
static const struct resource mlxplat_lpc_resources[] =;

/* Platform systems default i2c data */
static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_i2c_default_data =;

/* Platform i2c next generation systems data */
static struct mlxreg_core_data mlxplat_mlxcpld_i2c_ng_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_i2c_ng_items[] =;

/* Platform next generation systems i2c data */
static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_i2c_ng_data =;

/* Platform default channels */
static const int mlxplat_default_channels[][MLXPLAT_CPLD_GRP_CHNL_NUM] =;

/* Platform channels for MSN21xx system family */
static const int mlxplat_msn21xx_channels[] =;

/* Platform mux data */
static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] =;

/* Platform mux configuration variables */
static int mlxplat_max_adap_num;
static int mlxplat_mux_num;
static struct i2c_mux_reg_platform_data *mlxplat_mux_data;
static struct notifier_block *mlxplat_reboot_nb;

/* Platform extended mux data */
static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] =;

/* Platform channels for modular system family */
static const int mlxplat_modular_upper_channel[] =;
static const int mlxplat_modular_channels[] =;

/* Platform modular mux data */
static struct i2c_mux_reg_platform_data mlxplat_modular_mux_data[] =;

/* Platform channels for rack switch system family */
static const int mlxplat_rack_switch_channels[] =;

/* Platform rack switch mux data */
static struct i2c_mux_reg_platform_data mlxplat_rack_switch_mux_data[] =;

/* Platform channels for ng800 system family */
static const int mlxplat_ng800_channels[] =;

/* Platform ng800 mux data */
static struct i2c_mux_reg_platform_data mlxplat_ng800_mux_data[] =;

/* Platform hotplug devices */
static struct i2c_board_info mlxplat_mlxcpld_pwr[] =;

static struct i2c_board_info mlxplat_mlxcpld_ext_pwr[] =;

static struct i2c_board_info mlxplat_mlxcpld_pwr_ng800[] =;

static struct i2c_board_info mlxplat_mlxcpld_fan[] =;

/* Platform hotplug comex carrier system family data */
static struct mlxreg_core_data mlxplat_mlxcpld_comex_psu_items_data[] =;

/* Platform hotplug default data */
static struct mlxreg_core_data mlxplat_mlxcpld_default_psu_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_wc_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_ng800_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_asic_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_asic2_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_default_items[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_comex_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_data =;

static struct mlxreg_core_item mlxplat_mlxcpld_default_wc_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_wc_data =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_comex_data =;

static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_pwr_items_data[] =;

/* Platform hotplug MSN21xx system family data */
static struct mlxreg_core_item mlxplat_mlxcpld_msn21xx_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn21xx_data =;

/* Platform hotplug msn274x system family data */
static struct mlxreg_core_data mlxplat_mlxcpld_msn274x_psu_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_pwr_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_msn274x_fan_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_msn274x_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn274x_data =;

/* Platform hotplug MSN201x system family data */
static struct mlxreg_core_data mlxplat_mlxcpld_msn201x_pwr_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_msn201x_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data =;

/* Platform hotplug next generation system family data */
static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_psu_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_fan_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_default_ng_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data =;

/* Platform hotplug extended system family data */
static struct mlxreg_core_data mlxplat_mlxcpld_ext_psu_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_ext_pwr_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_ext_items[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_ng800_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ng800_data =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_pwr_items_data[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_lc_act =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_asic_items_data[] =;

static struct i2c_board_info mlxplat_mlxcpld_lc_i2c_dev[] =;

static struct mlxreg_core_hotplug_notifier mlxplat_mlxcpld_modular_lc_notifier[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_pr_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_ver_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_pg_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_ready_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_synced_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_act_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_modular_lc_sd_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_modular_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_modular_data =;

/* Platform hotplug for NVLink blade systems family data  */
static struct mlxreg_core_data mlxplat_mlxcpld_global_wp_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_chassis_blade_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_chassis_blade_data =;

/* Platform hotplug for  switch systems family data */
static struct mlxreg_core_data mlxplat_mlxcpld_erot_ap_items_data[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_erot_error_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_rack_switch_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_rack_switch_data =;

/* Callback performs graceful shutdown after notification about power button event */
static int
mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_kind kind,
					     u8 action)
{}

static struct mlxreg_core_hotplug_notifier mlxplat_mlxcpld_l1_switch_pwr_events_notifier =;

/* Platform hotplug for l1 switch systems family data  */
static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] =;

/* Callback activates latch reset flow after notification about intrusion event */
static int
mlxplat_mlxcpld_l1_switch_intrusion_events_handler(void *handle, enum mlxreg_hotplug_kind kind,
						   u8 action)
{}

static struct mlxreg_core_hotplug_notifier mlxplat_mlxcpld_l1_switch_intrusion_events_notifier =;

static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_data[] =;

static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] =;

static
struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_l1_switch_data =;

/* Platform led default data */
static struct mlxreg_core_data mlxplat_mlxcpld_default_led_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_led_data =;

/* Platform led default data for water cooling */
static struct mlxreg_core_data mlxplat_mlxcpld_default_led_wc_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_led_wc_data =;

/* Platform led default data for water cooling Ethernet switch blade */
static struct mlxreg_core_data mlxplat_mlxcpld_default_led_eth_wc_blade_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_led_eth_wc_blade_data =;

/* Platform led MSN21xx system family data */
static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_led_data[] =;

static struct mlxreg_core_platform_data mlxplat_msn21xx_led_data =;

/* Platform led for default data for 200GbE systems */
static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_led_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_ng_led_data =;

/* Platform led for Comex based 100GbE systems */
static struct mlxreg_core_data mlxplat_mlxcpld_comex_100G_led_data[] =;

static struct mlxreg_core_platform_data mlxplat_comex_100G_led_data =;

/* Platform led for data for modular systems */
static struct mlxreg_core_data mlxplat_mlxcpld_modular_led_data[] =;

static struct mlxreg_core_platform_data mlxplat_modular_led_data =;

/* Platform led data for chassis system */
static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_led_data[] =;

static struct mlxreg_core_platform_data mlxplat_l1_switch_led_data =;

/* Platform register access default */
static struct mlxreg_core_data mlxplat_mlxcpld_default_regs_io_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_regs_io_data =;

/* Platform register access MSN21xx, MSN201x, MSN274x systems families data */
static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_regs_io_data[] =;

static struct mlxreg_core_platform_data mlxplat_msn21xx_regs_io_data =;

/* Platform register access for next generation systems families data */
static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_ng_regs_io_data =;

/* Platform register access for modular systems families data */
static struct mlxreg_core_data mlxplat_mlxcpld_modular_regs_io_data[] =;

static struct mlxreg_core_platform_data mlxplat_modular_regs_io_data =;

/* Platform register access for chassis blade systems family data  */
static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] =;

static struct mlxreg_core_platform_data mlxplat_chassis_blade_regs_io_data =;

/* Platform FAN default */
static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_data[] =;

static struct mlxreg_core_platform_data mlxplat_default_fan_data =;

/* Watchdog type1: hardware implementation version1
 * (MSN2700, MSN2410, MSN2740, MSN2100 and MSN2140 systems).
 */
static struct mlxreg_core_data mlxplat_mlxcpld_wd_main_regs_type1[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_wd_aux_regs_type1[] =;

static struct mlxreg_core_platform_data mlxplat_mlxcpld_wd_set_type1[] =;

/* Watchdog type2: hardware implementation version 2
 * (all systems except (MSN2700, MSN2410, MSN2740, MSN2100 and MSN2140).
 */
static struct mlxreg_core_data mlxplat_mlxcpld_wd_main_regs_type2[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_wd_aux_regs_type2[] =;

static struct mlxreg_core_platform_data mlxplat_mlxcpld_wd_set_type2[] =;

/* Watchdog type3: hardware implementation version 3
 * Can be on all systems. It's differentiated by WD capability bit.
 * Old systems (MSN2700, MSN2410, MSN2740, MSN2100 and MSN2140)
 * still have only one main watchdog.
 */
static struct mlxreg_core_data mlxplat_mlxcpld_wd_main_regs_type3[] =;

static struct mlxreg_core_data mlxplat_mlxcpld_wd_aux_regs_type3[] =;

static struct mlxreg_core_platform_data mlxplat_mlxcpld_wd_set_type3[] =;

static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg)
{}

static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg)
{}

static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg)
{}

static const struct reg_default mlxplat_mlxcpld_regmap_default[] =;

static const struct reg_default mlxplat_mlxcpld_regmap_ng[] =;

static const struct reg_default mlxplat_mlxcpld_regmap_comex_default[] =;

static const struct reg_default mlxplat_mlxcpld_regmap_ng400[] =;

static const struct reg_default mlxplat_mlxcpld_regmap_rack_switch[] =;

static const struct reg_default mlxplat_mlxcpld_regmap_eth_modular[] =;

struct mlxplat_mlxcpld_regmap_context {};

static struct mlxplat_mlxcpld_regmap_context mlxplat_mlxcpld_regmap_ctx;

static int
mlxplat_mlxcpld_reg_read(void *context, unsigned int reg, unsigned int *val)
{}

static int
mlxplat_mlxcpld_reg_write(void *context, unsigned int reg, unsigned int val)
{}

static const struct regmap_config mlxplat_mlxcpld_regmap_config =;

static const struct regmap_config mlxplat_mlxcpld_regmap_config_ng =;

static const struct regmap_config mlxplat_mlxcpld_regmap_config_comex =;

static const struct regmap_config mlxplat_mlxcpld_regmap_config_ng400 =;

static const struct regmap_config mlxplat_mlxcpld_regmap_config_rack_switch =;

static const struct regmap_config mlxplat_mlxcpld_regmap_config_eth_modular =;

static struct resource mlxplat_mlxcpld_resources[] =;

static struct mlxreg_core_hotplug_platform_data *mlxplat_i2c;
static struct mlxreg_core_hotplug_platform_data *mlxplat_hotplug;
static struct mlxreg_core_platform_data *mlxplat_led;
static struct mlxreg_core_platform_data *mlxplat_regs_io;
static struct mlxreg_core_platform_data *mlxplat_fan;
static struct mlxreg_core_platform_data
	*mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS];
static const struct regmap_config *mlxplat_regmap_config;
static struct pci_dev *lpc_bridge;
static struct pci_dev *i2c_bridge;
static struct pci_dev *jtag_bridge;

/* Platform default reset function */
static int mlxplat_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused)
{}

static struct notifier_block mlxplat_reboot_default_nb =;

/* Platform default poweroff function */
static void mlxplat_poweroff(void)
{}

static int __init mlxplat_register_platform_device(void)
{}

static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_default_eth_wc_blade_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_ng400_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_chassis_blade_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi)
{}

static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi)
{}

static const struct dmi_system_id mlxplat_dmi_table[] __initconst =;

MODULE_DEVICE_TABLE(dmi, mlxplat_dmi_table);

static int mlxplat_mlxcpld_verify_bus_topology(int *nr)
{}

static int mlxplat_mlxcpld_check_wd_capability(void *regmap)
{}

static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources,
					unsigned int *hotplug_resources_size)
{}

static void mlxplat_lpc_cpld_device_exit(void)
{}

static int
mlxplat_pci_fpga_device_init(unsigned int device, const char *res_name, struct pci_dev **pci_bridge,
			     void __iomem **pci_bridge_addr)
{}

static void
mlxplat_pci_fpga_device_exit(struct pci_dev *pci_bridge,
			     void __iomem *pci_bridge_addr)
{}

static int
mlxplat_pci_fpga_devices_init(struct resource **hotplug_resources,
			      unsigned int *hotplug_resources_size)
{}

static void mlxplat_pci_fpga_devices_exit(void)
{}

static int
mlxplat_logicdev_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size)
{}

static void mlxplat_logicdev_exit(void)
{}

static int mlxplat_platdevs_init(struct mlxplat_priv *priv)
{}

static void mlxplat_platdevs_exit(struct mlxplat_priv *priv)
{}

static int
mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent,
				  struct i2c_adapter *adapters[])
{}

static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv)
{}

static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv)
{}

static int mlxplat_i2c_main_completion_notify(void *handle, int id)
{}

static int mlxplat_i2c_main_init(struct mlxplat_priv *priv)
{}

static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv)
{}

static int mlxplat_probe(struct platform_device *pdev)
{}

static void mlxplat_remove(struct platform_device *pdev)
{}

static const struct acpi_device_id mlxplat_acpi_table[] =;
MODULE_DEVICE_TABLE(acpi, mlxplat_acpi_table);

static struct platform_driver mlxplat_driver =;

static int __init mlxplat_init(void)
{}
module_init();

static void __exit mlxplat_exit(void)
{}
module_exit(mlxplat_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();