Skip to contentSkip to conversation

i2c: add driver for Mellanox BlueField SoC

PATCH Superseded Khalil Blaiech 2 participants 5 messages Mar 25, 2020

Subsystems (3)

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v7 cover i2c: add driver for Mellanox BlueField SoC

Add I2C SMBus driver and device tree bindings documentation.

The Mellanox BlueField is a System-on-Chip (SoC) that combines Arm cores and ConnectX network adapter technology intended to accelerate storage network solutions. The Mellanox BlueField incorporates various I2C devices that are accessed using SMBus protocol, a variant of the I2C protocol. On storage controllers, the BlueField SoC is connected to a management controller board, e.g., BMC via an I2C bus.

An I2C driver running on the Arm side is needed to manage the hardware I2C controllers. The driver enables a master function to transfer data back and forth from/to I2C devices, such as EEPROM parts and implements a slave function to handle the BMC controller requests.

v6->v7:
- Fixing kernel coding style issues as suggested by Mellanox internal code reviewers.
- Updating the dependency expression in Kconfig.
- Fixing various device driver bugs.
- Adding an entry to MAINTAINERS file.
v5->v6:
- Fixing kernel coding style issues detected using '--strict' flag.
- Updating the device binding documentation to add support for BlueField-2 SoCs.
v4->v5:
- Fixing device driver bug.
v3->v4:
- Review of the device binding documentation to fix format issue and miscellaneous cleanup.
v2->v3:
- Various device driver changes and bug fixes.
- Updating the device property in the device binding documentation and file format review.
v1->v2:
- Various device driver changes and bug fixes.
- Cleanup of the device binding documentation.

Khalil Blaiech (2):
i2c: i2c-mlxbf: I2C SMBus driver for Mellanox BlueField SoC
dt-bindings: i2c: I2C binding for Mellanox BlueField SoC

 .../devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt |   42 +
 MAINTAINERS                                        |    6 +
 drivers/i2c/busses/Kconfig                         |   13 +
 drivers/i2c/busses/Makefile                        |    1 +
 drivers/i2c/busses/i2c-mlxbf.c                     | 2506 ++++++++++++++++++++
 5 files changed, 2568 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt
 create mode 100644 drivers/i2c/busses/i2c-mlxbf.c
Signature · 1 line
2.1.2
#1 lore raw

PATCH v7 1/2 i2c: i2c-mlxbf: I2C SMBus driver for Mellanox BlueField SoC

Add BlueField I2C driver to offer master and slave support for Mellanox BlueField SoCs. The driver implements an SMBus adapter and interfaces to multiple busses that can be probed using both ACPI and Device Tree infrastructures.

The driver supports several SMBus operations to transfer data back and forth from/to various I2C devices. It is mainly intended to be consumed by userspace tools and utilities, such as i2c-tools and decode-dimms to collect memory module information.

On the other hand, the driver has a slave function to support, among others, an IPMB interface that requires both master and slave functions to handle transfers between the BlueField SoC and a board management controllers (e.g., BMC).

v6->v7:
- Fixing kernel coding style issues.
- Rewording of the commit message.
- Renaming of the driver filename.
- Renaming of the macro, struture, variable and function names to be consistent with the module name.
- Removing 'MELLANOX_PLATFORM' dependency in Kconfig.
- Fixing bug in mlxbf_i2c_get_shared_resource() to prevent null pointer dereference.
- Fixing bug in mlxbf_i2c_release_gpio() to prevent the use of null pointers.
- Adding an entry to MAINTAINERS file.
v5->v6:
- Fixing kernel coding style issues detected using '--strict' flag.
- Updating SPDX identifier and module license.
v4->v5:
- Fixing bug in mlx_slave_enale routine.
v2->v3:
- Updating the "compatible" string and add a new entry to the mlx_i2c_dt_ids array.
- Adding a new entry to the mlx_i2c_acpi_ids array to support a new device _HID.
- Updating the device probe routines to derive the device type based on the instance property described in either devicetree or ACPI.
- Definition of new handlers to request and release the shared resources. These handlers relies on the device type.
v1->v2:
- Updating the '.compatible' field of of_device_id.
- Updating mlx_i2c_of_probe() call to extract the bus identifier from the pre-defined aliases.
- Removing the 'profile' property.
- Setting the timing parameters according to the value of 'clock-frequency' property.
- Convertng the timing configuration from KHz to Hz.

---
 MAINTAINERS                    |    6 +
 drivers/i2c/busses/Kconfig     |   13 +
 drivers/i2c/busses/Makefile    |    1 +
 drivers/i2c/busses/i2c-mlxbf.c | 2506 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 2526 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-mlxbf.c
MAINTAINERS +6 -0
index 110678d..64b1d24 100644
@@ -10668,6 +10668,12 @@ S:	Supported
 F:	drivers/input/touchscreen/melfas_mip4.c
 F:	Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
 
+MELLANOX BLUEFIELD I2C DRIVER
+M:	Khalil Blaiech <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	drivers/i2c/busses/i2c-mlxbf.c
+
 MELLANOX ETHERNET DRIVER (mlx4_en)
 M:	Tariq Toukan <[email protected]>
 L:	[email protected]
drivers/i2c/busses/Kconfig +13 -0
index 2ddca08..6a40a2b 100644
@@ -726,6 +726,19 @@ config I2C_LPC2K
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-lpc2k.
 
+config I2C_MLXBF
+        tristate "Mellanox BlueField I2C controller"
+        depends on ARM64 || COMPILE_TEST
+        help
+          Enabling this option will add I2C SMBus support for Mellanox BlueField
+          system.
+
+          This driver can also be built as a module. If so, the module will be
+          called i2c-mlxbf.
+
+          This driver implements an I2C SMBus host controller and enables both
+          master and slave functions.
+
 config I2C_MESON
 	tristate "Amlogic Meson I2C controller"
 	depends on ARCH_MESON || COMPILE_TEST
drivers/i2c/busses/Makefile +1 -0
index 25d6088..2f558fe 100644
@@ -140,6 +140,7 @@ obj-$(CONFIG_I2C_BRCMSTB)	+= i2c-brcmstb.o
 obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
 obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
 obj-$(CONFIG_I2C_ICY)		+= i2c-icy.o
+obj-$(CONFIG_I2C_MLXBF)		+= i2c-mlxbf.o
 obj-$(CONFIG_I2C_MLXCPLD)	+= i2c-mlxcpld.o
 obj-$(CONFIG_I2C_OPAL)		+= i2c-opal.o
 obj-$(CONFIG_I2C_PCA_ISA)	+= i2c-pca-isa.o
drivers/i2c/busses/i2c-mlxbf.c new file +2506 -0

2,506 lines not on this page · raw message

Signature · 1 line
2.1.2
#2 lore raw

Re: [PATCH v7 1/2] i2c: i2c-mlxbf: I2C SMBus driver for Mellanox BlueField SoC

I love your patch! Yet something to improve:

Hi Khalil,

I love your patch! Yet something to improve:

[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on robh/for-next linus/master v5.6-rc7 next-20200325] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Khalil-Blaiech/i2c-add-driver-for-Mellanox-BlueField-SoC/20200326-052624
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=sh

If you fix the issue, kindly add following tag

All error/warnings (new ones prefixed by >>):

drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_get_gpio':

>> drivers/i2c/busses/i2c-mlxbf.c:1288:17: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'devm_ioremap_release'? [-Werror=implicit-function-declaration]
    1288 |  gpio_res->io = devm_ioremap_nocache(dev, params->start, size);
         |                 ^~~~~~~~~~~~~~~~~~~~
         |                 devm_ioremap_release
>> drivers/i2c/busses/i2c-mlxbf.c:1288:15: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1288 |  gpio_res->io = devm_ioremap_nocache(dev, params->start, size);
         |               ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_get_corepll':
   drivers/i2c/busses/i2c-mlxbf.c:1353:18: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1353 |  corepll_res->io = devm_ioremap_nocache(dev, params->start, size);
         |                  ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_init_coalesce':
>> drivers/i2c/busses/i2c-mlxbf.c:1755:22: error: implicit declaration of function 'ioremap_nocache'; did you mean 'ioremap_cache'? [-Werror=implicit-function-declaration]
    1755 |   coalesce_res->io = ioremap_nocache(params->start, size);
         |                      ^~~~~~~~~~~~~~~
         |                      ioremap_cache
   drivers/i2c/busses/i2c-mlxbf.c:1755:20: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1755 |   coalesce_res->io = ioremap_nocache(params->start, size);
         |                    ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_acpi_probe':
>> drivers/i2c/busses/i2c-mlxbf.c:2296:8: error: implicit declaration of function 'acpi_device_uid'; did you mean 'dmi_device_id'? [-Werror=implicit-function-declaration]
    2296 |  uid = acpi_device_uid(adev);
         |        ^~~~~~~~~~~~~~~
         |        dmi_device_id
>> drivers/i2c/busses/i2c-mlxbf.c:2296:6: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    2296 |  uid = acpi_device_uid(adev);
         |      ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_smbus_irq_send':
>> drivers/i2c/busses/i2c-mlxbf.c:1910:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
    1910 |    byte = (data32 >> 8) & GENMASK(7, 0);
   drivers/i2c/busses/i2c-mlxbf.c:1911:3: note: here
    1911 |   case 1: /* Fall-through. */
         |   ^~~~
   In file included from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:19,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from drivers/i2c/busses/i2c-mlxbf.c:8:
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_init_timings':
   include/linux/printk.h:306:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
     306 |  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-mlxbf.c:1238:3: note: in expansion of macro 'pr_warn'
    1238 |   pr_warn("Illegal value %d: defaulting to 100 KHz\n",
         |   ^~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:1241:2: note: here
    1241 |  case MLXBF_I2C_TIMING_100KHZ: /* Fall-through. */
         |  ^~~~

cc1: some warnings being treated as errors

vim +1288 drivers/i2c/busses/i2c-mlxbf.c

1221
1222 static int mlxbf_i2c_init_timings(struct platform_device *pdev,
1223 struct mlxbf_i2c_priv *priv)
1224 {
1225 enum mlxbf_i2c_timings_config config_idx;
1226 struct device *dev = &pdev->dev;
1227 u32 config_khz;
1228
1229 int ret;
1230
1231 ret = device_property_read_u32(dev, "clock-frequency", &config_khz);
1232 if (ret < 0)
1233 config_khz = MLXBF_I2C_TIMING_100KHZ;
1234
1235 switch (config_khz) {
1236 default:
1237 /* Default settings is 100 KHz. */

> 1238			pr_warn("Illegal value %d: defaulting to 100 KHz\n",
  1239				config_khz);
  1240	
  1241		case MLXBF_I2C_TIMING_100KHZ: /* Fall-through. */
  1242			config_idx = MLXBF_I2C_TIMING_CONFIG_100KHZ;
  1243			break;
  1244	
  1245		case MLXBF_I2C_TIMING_400KHZ:
  1246			config_idx = MLXBF_I2C_TIMING_CONFIG_400KHZ;
  1247			break;
  1248	
  1249		case MLXBF_I2C_TIMING_1000KHZ:
  1250			config_idx = MLXBF_I2C_TIMING_CONFIG_1000KHZ;
  1251			break;
  1252		}
  1253	
  1254		mlxbf_i2c_set_timings(priv, &mlxbf_i2c_timings[config_idx]);
  1255	
  1256		return 0;
  1257	}
  1258	
  1259	static int mlxbf_i2c_get_gpio(struct platform_device *pdev,
  1260				      struct mlxbf_i2c_priv *priv)
  1261	{
  1262		struct mlxbf_i2c_resource *gpio_res;
  1263		struct device *dev = &pdev->dev;
  1264		struct resource	*params;
  1265		resource_size_t size;
  1266	
  1267		gpio_res = mlxbf_i2c_get_shared_resource(priv, MLXBF_I2C_GPIO_RES);
  1268		if (!gpio_res)
  1269			return -EPERM;
  1270	
  1271		/*
  1272		 * The GPIO region in TYU space is shared among I2C busses.
  1273		 * This function MUST be serialized to avoid racing when
  1274		 * claiming the memory region and/or setting up the GPIO.
  1275		 */
  1276		lockdep_assert_held(gpio_res->lock);
  1277	
  1278		/* Check whether the memory map exist. */
  1279		if (gpio_res->io)
  1280			return 0;
  1281	
  1282		params = gpio_res->params;
  1283		size = resource_size(params);
  1284	
  1285		if (!devm_request_mem_region(dev, params->start, size, params->name))
  1286			return -EFAULT;
  1287	
> 1288		gpio_res->io = devm_ioremap_nocache(dev, params->start, size);

1289 if (IS_ERR(gpio_res->io)) {
1290 devm_release_mem_region(dev, params->start, size);
1291 return PTR_ERR(gpio_res->io);
1292 }
1293
1294 return 0;
1295 }
1296

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#3 lore raw

Re: [PATCH v7 1/2] i2c: i2c-mlxbf: I2C SMBus driver for Mellanox BlueField SoC

In reply to Khalil Blaiech
I love your patch! Yet something to improve:

Hi Khalil,

I love your patch! Yet something to improve:

[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on robh/for-next linus/master v5.6-rc7 next-20200325] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Khalil-Blaiech/i2c-add-driver-for-Mellanox-BlueField-SoC/20200326-052624
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=parisc

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_get_gpio':
drivers/i2c/busses/i2c-mlxbf.c:1288:17: error: implicit declaration of function 'devm_ioremap_nocache'; did you mean 'devm_ioremap_release'? [-Werror=implicit-function-declaration]

    1288 |  gpio_res->io = devm_ioremap_nocache(dev, params->start, size);
         |                 ^~~~~~~~~~~~~~~~~~~~
         |                 devm_ioremap_release
   drivers/i2c/busses/i2c-mlxbf.c:1288:15: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1288 |  gpio_res->io = devm_ioremap_nocache(dev, params->start, size);
         |               ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_get_corepll':
   drivers/i2c/busses/i2c-mlxbf.c:1353:18: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1353 |  corepll_res->io = devm_ioremap_nocache(dev, params->start, size);
         |                  ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_init_coalesce':
>> drivers/i2c/busses/i2c-mlxbf.c:1755:22: error: implicit declaration of function 'ioremap_nocache' [-Werror=implicit-function-declaration]
    1755 |   coalesce_res->io = ioremap_nocache(params->start, size);
         |                      ^~~~~~~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:1755:20: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1755 |   coalesce_res->io = ioremap_nocache(params->start, size);
         |                    ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_acpi_probe':
   drivers/i2c/busses/i2c-mlxbf.c:2296:8: error: implicit declaration of function 'acpi_device_uid'; did you mean 'dmi_device_id'? [-Werror=implicit-function-declaration]
    2296 |  uid = acpi_device_uid(adev);
         |        ^~~~~~~~~~~~~~~
         |        dmi_device_id
   drivers/i2c/busses/i2c-mlxbf.c:2296:6: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    2296 |  uid = acpi_device_uid(adev);
         |      ^
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_smbus_irq_send':
   drivers/i2c/busses/i2c-mlxbf.c:1910:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
    1910 |    byte = (data32 >> 8) & GENMASK(7, 0);
   drivers/i2c/busses/i2c-mlxbf.c:1911:3: note: here
    1911 |   case 1: /* Fall-through. */
         |   ^~~~
   In file included from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:19,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from drivers/i2c/busses/i2c-mlxbf.c:8:
   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_init_timings':
   include/linux/printk.h:306:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
     306 |  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:1238:3: note: in expansion of macro 'pr_warn'
    1238 |   pr_warn("Illegal value %d: defaulting to 100 KHz\n",
         |   ^~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:1241:2: note: here
    1241 |  case MLXBF_I2C_TIMING_100KHZ: /* Fall-through. */
         |  ^~~~

cc1: some warnings being treated as errors

vim +/ioremap_nocache +1755 drivers/i2c/busses/i2c-mlxbf.c

1717
1718 static int mlxbf_i2c_init_coalesce(struct platform_device *pdev,
1719 struct mlxbf_i2c_priv *priv)
1720 {
1721 struct mlxbf_i2c_resource *coalesce_res;
1722 struct resource *params;
1723 resource_size_t size;
1724 int ret = 0;
1725
1726 /*
1727 * Unlike BlueField-1 platform, the coalesce registers is a dedicated
1728 * resource in the next generations of BlueField.
1729 */
1730 if (mlxbf_i2c_has_chip_type(priv, MLXBF_I2C_CHIP_TYPE_1)) {
1731 coalesce_res = mlxbf_i2c_get_shared_resource(priv,
1732 MLXBF_I2C_COALESCE_RES);
1733 if (!coalesce_res)
1734 return -EPERM;
1735
1736 /*
1737 * The Cause Coalesce group in TYU space is shared among
1738 * I2C busses. This function MUST be serialized to avoid
1739 * racing when claiming the memory region.
1740 */
1741 lockdep_assert_held(mlxbf_i2c_gpio_res->lock);
1742
1743 /* Check whether the memory map exist. */
1744 if (coalesce_res->io) {
1745 priv->coalesce = coalesce_res;
1746 return 0;
1747 }
1748
1749 params = coalesce_res->params;
1750 size = resource_size(params);
1751
1752 if (!request_mem_region(params->start, size, params->name))
1753 return -EFAULT;
1754

> 1755			coalesce_res->io = ioremap_nocache(params->start, size);

1756 if (IS_ERR(coalesce_res->io)) {
1757 release_mem_region(params->start, size);
1758 return PTR_ERR(coalesce_res->io);
1759 }
1760
1761 priv->coalesce = coalesce_res;
1762
1763 } else {
1764 ret = mlxbf_i2c_init_resource(pdev, &priv->coalesce,
1765 MLXBF_I2C_COALESCE_RES);
1766 }
1767
1768 return ret;
1769 }
1770

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#4 lore raw

PATCH v7 2/2 dt-bindings: i2c: I2C binding for Mellanox BlueField SoC

In reply to Khalil Blaiech

Added device tree bindings documentation for Mellanox BlueField I2C SMBus controller.

v5->v6:
- Adding description of an extra resource to be consistent with new BlueField-2 SoCs.
- Adding an additional example of device instance.
v3->v4:
- Re-ordering of the property descriptions.
- Removing useless register addresses from the resource description.
- Definition of default clock-frequency value.
- Fixing format issues; removing spaces.
- Removing "aliases" from Example section.
- Renaming device instance node in Example section.
v2->v3:
- Removing shared resources from the controller instance.
- Updating the 'compatible' property and support the second generation of the Mellanox BlueField SoC.
- Fixing file format; replacing spaces with tabs.
v1->v2:
- Enumeration of the device resources.
- Updating the 'compatible' property to make it less generic.
- Removing the 'bus' index property and replace it with standard approach to read the bus identifier.
- Getting rid of the 'profile' property.
- Using 'clock-frequency' property instead of 'bus-freq'.
- Convertion of the clock frequency from KHz to Hz.
- Removing useless examples.

---
 .../devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt
Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.txt new file +42 -0
new file mode 100644
index 0000000..566ea86
@@ -0,0 +1,42 @@
+Device tree configuration for the Mellanox I2C SMBus on BlueField SoCs
+
+Required Properties:
+
+- compatible : should be "mellanox,i2c-mlxbf1" or "mellanox,i2c-mlxbf2".
+
+- reg : address offset and length of the device registers. The
+	registers consist of the following set of resources:
+		1) Smbus block registers.
+		2) Cause master registers.
+		3) Cause slave registers.
+		4) Cause coalesce registers (if compatible isn't set
+		   to "mellanox,i2c-mlxbf1").
+
+- interrupts : interrupt number.
+
+Optional Properties:
+
+- clock-frequency : bus frequency used to configure timing registers;
+			allowed values are 100000, 400000 and 1000000;
+			those are expressed in Hz. Default is 100000.
+
+Example:
+
+i2c@2804000 {
+	compatible = "mellanox,i2c-mlxbf1";
+	reg =	<0x02804000 0x800>,
+		<0x02801200 0x020>,
+		<0x02801260 0x020>;
+	interrupts = <57>;
+	clock-frequency = <100000>;
+};
+
+i2c@2808800 {
+	compatible = "mellanox,i2c-mlxbf2";
+	reg =	<0x02808800 0x600>,
+	        <0x02808e00 0x020>,
+		<0x02808e20 0x020>,
+		<0x02808e40 0x010>;
+	interrupts = <57>;
+	clock-frequency = <400000>;
+};
Signature · 1 line
2.1.2