[rtems-docs commit] user/bsps/arm/beagle: Update i2c initialization instructions

Christian Mauderer christianm at rtems.org
Thu Apr 22 16:54:22 UTC 2021


Module:    rtems-docs
Branch:    master
Commit:    2ce0fe2b8e8749e841c39b08f3e7011dc5e91d63
Changeset: http://git.rtems.org/rtems-docs/commit/?id=2ce0fe2b8e8749e841c39b08f3e7011dc5e91d63

Author:    G S Niteesh Babu <niteesh.gs at gmail.com>
Date:      Sun Apr 11 01:03:25 2021 +0530

user/bsps/arm/beagle: Update i2c initialization instructions

The new i2c driver in the beagle BSP uses FDT based initialization.
This updates the documentation of the BSP about the same.

---

 user/bsps/arm/beagle.rst | 41 ++++++++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 13 deletions(-)

diff --git a/user/bsps/arm/beagle.rst b/user/bsps/arm/beagle.rst
index 5789bb8..696b89d 100644
--- a/user/bsps/arm/beagle.rst
+++ b/user/bsps/arm/beagle.rst
@@ -67,23 +67,38 @@ Add the following to a file named uEnv.txt:
 I2C Driver
 ----------
 
-The Beagle has the `i2c-0` device registered at initialization. For registering
-`i2c-1` and `i2c-2` ``bbb_register_i2c_1()`` and
-``bbb_register_i2c_2()`` wrapper functions are respectively used.
+The Beagle i2c initialization is based on the device tree. To initialize a i2c
+device, the user has to enable the respective node in the device tree using
+overlays.
 
-For registering an I2C device with a custom path (say `/dev/i2c-3`) the
-function ``am335x_i2c_bus_register()`` has to be used.
+For registering an I2C device with a custom path (say `/dev/i2c-eeprom`) an
+overlay has to be provided. The overlay must add an additional attribute
+`rtems,path` with the custom path as value to the respective i2c node.
 
-The function prototype is given below:
+For example,
 
-.. code-block:: C
+.. code-block::
+     /dts-v1/;
+
+     / {
+        compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
+
+        fragment at 0 {
+           target = <0xffffffff>;
+
+           __overlay__ {
+              compatible = "rtems,bsp-i2c", "ti,omap4-i2c";
+              status = "okay";
+              rtems,path = "/dev/i2c-eeprom";
+           };
+        };
+
+        __fixups__ {
+           i2c0 = "/fragment at 0:target:0";
+        };
+     };
 
-   int am335x_i2c_bus_register(
-   const char         *bus_path,
-   uintptr_t           register_base,
-   uint32_t            input_clock,
-   rtems_vector_number irq
-   );
+The above example registers a custom path `/dev/i2c-eeprom` for i2c0.
 
 SPI Driver
 ----------



More information about the vc mailing list