Skip to content

Commit

Permalink
kernel/modules/other/mlxreg: add new package
Browse files Browse the repository at this point in the history
This commit adds a new mlxreg package, which allows access
to Mellanox programmable device register space through sysfs
interface for thermal control and hardware management.

It also adds required Mellanox I²C drivers and packages
for the "special" MSN4800 series and SN2201 platform.

Signed-off-by: Til Kaiser <mail@tk154.de>
  • Loading branch information
tk154 committed Apr 28, 2024
1 parent c65c373 commit b92a302
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
36 changes: 36 additions & 0 deletions package/kernel/linux/modules/i2c.mk
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ endef
$(eval $(call KernelPackage,i2c-i801))


I2C_MLXCPLD_MODULES:= \
CONFIG_I2C_MLXCPLD:drivers/i2c/busses/i2c-mlxcpld

define KernelPackage/i2c-mlxcpld
$(call i2c_defaults,$(I2C_MLXCPLD_MODULES),59)
TITLE:=Mellanox I2C driver
DEPENDS:=@TARGET_x86_64 +kmod-regmap-core
endef

define KernelPackage/i2c-mlxcpld/description
This exposes the Mellanox platform I2C busses
to the linux I2C layer for X86 based systems.
Controller is implemented as CPLD logic.
endef

$(eval $(call KernelPackage,i2c-mlxcpld))


I2C_MUX_MODULES:= \
CONFIG_I2C_MUX:drivers/i2c/i2c-mux

Expand Down Expand Up @@ -200,6 +218,24 @@ endef
$(eval $(call KernelPackage,i2c-mux-gpio))


I2C_MUX_MLXCPLD_MODULES:= \
CONFIG_I2C_MUX_MLXCPLD:drivers/i2c/muxes/i2c-mux-mlxcpld

define KernelPackage/i2c-mux-mlxcpld
$(call i2c_defaults,$(I2C_MUX_MLXCPLD_MODULES),51)
TITLE:=Mellanox CPLD based I2C multiplexer
DEPENDS:=+kmod-i2c-mlxcpld +kmod-i2c-mux
endef

define KernelPackage/i2c-mux-mlxcpld/description
This driver provides access to
I2C busses connected through a MUX, which is controlled
by a CPLD register.
endef

$(eval $(call KernelPackage,i2c-mux-mlxcpld))


I2C_MUX_REG_MODULES:= \
CONFIG_I2C_MUX_REG:drivers/i2c/muxes/i2c-mux-reg

Expand Down
64 changes: 64 additions & 0 deletions package/kernel/linux/modules/other.mk
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,70 @@ endef
$(eval $(call KernelPackage,mlx_wdt))


define KernelPackage/mlxreg
SUBMENU:=$(OTHER_MENU)
TITLE:=Mellanox platform register access
DEPENDS:=+kmod-i2c-mux-mlxcpld
KCONFIG:= \
CONFIG_MELLANOX_PLATFORM=y \
CONFIG_MLX_PLATFORM \
CONFIG_MLXREG_HOTPLUG \
CONFIG_MLXREG_IO \
CONFIG_SENSORS_MLXREG_FAN \
CONFIG_LEDS_MLXREG
FILES:= \
$(LINUX_DIR)/drivers/platform/x86/mlx-platform.ko \
$(LINUX_DIR)/drivers/platform/mellanox/mlxreg-hotplug.ko \
$(LINUX_DIR)/drivers/platform/mellanox/mlxreg-io.ko \
$(LINUX_DIR)/drivers/hwmon/mlxreg-fan.ko \
$(LINUX_DIR)/drivers/leds/leds-mlxreg.ko
AUTOLOAD:=$(call AutoProbe,mlx-platform mlxreg-hotplug mlxreg-io mlxreg-fan leds-mlxreg)
endef

define KernelPackage/mlxreg/description
Allows access to Mellanox programmable device register
space through sysfs interface. The sets of registers for sysfs access
are defined per system type bases and include the registers related
to system resets operation, system reset causes monitoring and some
kinds of mux selection.
endef

$(eval $(call KernelPackage,mlxreg))


define KernelPackage/mlxreg-lc
SUBMENU:=$(OTHER_MENU)
TITLE:=Mellanox line card platform support
DEPENDS:=kmod-mlxreg +kmod-regmap-i2c
KCONFIG:=CONFIG_MLXREG_LC
FILES:=$(LINUX_DIR)/drivers/platform/mellanox/mlxreg-lc.ko
AUTOLOAD:=$(call AutoProbe,mlxreg-lc)
endef

define KernelPackage/mlxreg-lc/description
Provides support for the Mellanox MSN4800-XX line cards,
which are the part of MSN4800 Ethernet modular switch systems.
endef

$(eval $(call KernelPackage,mlxreg-lc))


define KernelPackage/nvsw-sn2201
SUBMENU:=$(OTHER_MENU)
TITLE:=Nvidia SN2201 platform support
DEPENDS:=kmod-mlxreg +kmod-regmap-i2c
KCONFIG:=CONFIG_NVSW_SN2201
FILES:=$(LINUX_DIR)/drivers/platform/mellanox/nvsw-sn2201.ko
AUTOLOAD:=$(call AutoProbe,nvsw-sn2201)
endef

define KernelPackage/nvsw-sn2201/description
Provides support for the Nvidia SN2201 platform.
endef

$(eval $(call KernelPackage,nvsw-sn2201))


define KernelPackage/pinctrl-mcp23s08
SUBMENU:=$(OTHER_MENU)
TITLE:=Microchip MCP23xxx I/O expander
Expand Down

0 comments on commit b92a302

Please sign in to comment.