x86/platform/mellanox: introduce support for Mellanox systems platform
Subsystems (2)
PATCH v5 1/1 x86/platform/mellanox: introduce support for Mellanox systems platform
From: Vadim Pasternak <[email protected]>
Enable system support for the Mellanox Technologies platform, which provides support for the next Mellanox basic systems: "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800", "msn2740", "msn2100" and also various number of derivative systems from the above basic types.
The Kconfig currently controlling compilation of this code is:
arch/x86/platform:config MLX_PLATFORMarch/x86/platform: tristate "Mellanox Technologies platform support"
---v1->v2:
Comments pointed out by Greg:
- kick out all PCI related code;v2->v3
Comments pointed out by Guenter:
- remove not directly related depends and selects for Kconfig;
- use single dimensional array for mlxplat_msn21xx_channels;
- define mlxplat_mux_data and mlxplat_priv as static;
- fix line split;
- remove error messages for memory allocation failure;
- change module alias to dmi;v3->v4
Comments pointed out by Thomas:
- remove dependencies from Kconfig for DMI and I2C.v4->v5
Comments pointed out by Greg:
- fix LICENSE;
--- MAINTAINERS | 6 + arch/x86/Kconfig | 12 ++ arch/x86/platform/Makefile | 1 + arch/x86/platform/mellanox/Makefile | 1 + arch/x86/platform/mellanox/mlx-platform.c | 268 ++++++++++++++++++++++++++++++ 5 files changed, 288 insertions(+) create mode 100644 arch/x86/platform/mellanox/Makefile create mode 100644 arch/x86/platform/mellanox/mlx-platform.c
MAINTAINERS +6 -0
@@ -7664,6 +7664,12 @@ W: http://www.mellanox.com Q: http://patchwork.ozlabs.org/project/netdev/list/ F: drivers/net/ethernet/mellanox/mlxsw/ +MELLANOX PLATFORM DRIVER +M: Vadim Pasternak <[email protected]> +L: [email protected] +S: Supported +F: arch/x86/platform/mellanox/mlx-platform.c + SOFT-ROCE DRIVER (rxe) M: Moni Shoua <[email protected]> L: [email protected]
arch/x86/Kconfig +12 -0
@@ -550,6 +550,18 @@ config X86_INTEL_QUARK Say Y here if you have a Quark based system such as the Arduino compatible Intel Galileo. +config MLX_PLATFORM + tristate "Mellanox Technologies platform support" + depends on X86_64 + depends on X86_EXTENDED_PLATFORM + ---help--- + This option enables system support for the Mellanox Technologies + platform. + + Say Y here if you are building a kernel for Mellanox system. + + Otherwise, say N. + config X86_INTEL_LPSS bool "Intel Low Power Subsystem Support" depends on X86 && ACPI
arch/x86/platform/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-y += iris/ obj-y += intel/ obj-y += intel-mid/ obj-y += intel-quark/ +obj-y += mellanox/ obj-y += olpc/ obj-y += scx200/ obj-y += sfi/
arch/x86/platform/mellanox/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o
arch/x86/platform/mellanox/mlx-platform.c new file +268 -0
268 lines not on this page · raw message
Signature · 1 line
2.1.4
On Tue, 20 Sep 2016, [email protected] wrote:
Just a few nitpicks.
arch/x86/platform/mellanox/mlx-platform.c line 76
Quoted 2 lines
arch/x86/platform/mellanox/mlx-platform.c new file +2
-0+/* Regions for LPC I2C controller and LPC base register space */ +static struct resource mlxplat_lpc_resources[] = {
Shouldnt this be const?
Review
Quoted 2 lines
(quoted diff) +2
-0+static int mlxplat_default_channels[][8] = { + {
Ditto. And some more of these?
Quoted 1 line
+static struct
dmi_system_idmlxplat_dmi_table[]__initdata= {
This one as well.
arch/x86/platform/mellanox/mlx-platform.c line 195
Quoted 5 lines
arch/x86/platform/mellanox/mlx-platform.c new file +5
-0+static int __init mlxplat_init (void ) +{ +struct mlxplat_priv *priv; +int i; +int err;
Same types can go into one line.
Review
Quoted 2 lines
(quoted diff) +2
-0+ + return err;
err is unitialized if we get here. Just return 0 and be done with it.
Quoted 7 lines
arch/x86/platform/mellanox/mlx-platform.c new file +6
-0+ +fail_platform_mux_register: +static void __exit mlxplat_exit(void) +{ +struct mlxplat_priv *priv =platform_get_drvdata (mlxplat_dev); +int i;
arch/x86/platform/mellanox/mlx-platform.c line 259
Quoted 10 lines
arch/x86/platform/mellanox/mlx-platform.c new file +10
-0+ +for (i =ARRAY_SIZE (mlxplat_mux_data) -1 ; i >=0 ; i--) +platform_device_unregister (priv->pdev_mux[i]); + +platform_device_unregister (priv->pdev_i2c); +platform_device_unregister (mlxplat_dev); +} + +module_init (mlxplat_init); +module_exit (mlxplat_exit);
Please move the module_xxx() right under the closing brace of the function to which it belongs.
Otherwise this looks good.
Thanks,
tglx