[rtems-docs commit] user/bsp/imxrt: Information for custom FDT

Christian Mauderer christianm at rtems.org
Mon Dec 14 11:55:25 UTC 2020


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

Author:    Christian Mauderer <christian.mauderer at embedded-brains.de>
Date:      Mon Dec 14 11:22:39 2020 +0100

user/bsp/imxrt: Information for custom FDT

Update #4180

---

 user/bsps/arm/imxrt.rst | 46 ++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 38 insertions(+), 8 deletions(-)

diff --git a/user/bsps/arm/imxrt.rst b/user/bsps/arm/imxrt.rst
index f68ee05..1bce6d7 100644
--- a/user/bsps/arm/imxrt.rst
+++ b/user/bsps/arm/imxrt.rst
@@ -78,17 +78,47 @@ look at the `i.MX RT1050 Processor Reference Manual, Rev. 4, 12/2019` chapter
 FDT
 ---
 
-The BSP used a FDT based initialization. The FDT is linked into the application.
+The BSP uses a FDT based initialization. The FDT is linked into the application.
 You can find the default FDT used in the BSP in
-`bsps/arm/imxrt/dts/imxrt1050-evkb.dts`. To use your own FDT compile it and
-convert it into a C file with (replace `YOUR.dts` and simmilar with your FDT
-source names)::
+`bsps/arm/imxrt/dts/imxrt1050-evkb.dts`. The FDT is split up into two parts. The
+core part is put into an `dtsi` file and is installed together with normal
+headers into `${PREFIX}/arm-rtems6/imxrt1052/lib/include`. You can use that to
+create your own device tree based on that. Basically use something like::
+
+  /dts-v1/;
+  
+  #include <imxrt/imxrt1050-pinfunc.h>
+  #include <imxrt/imxrt1050.dtsi>
+  
+  &lpuart1 {
+          pinctrl-0 = <&pinctrl_lpuart1>;
+          status = "okay";
+  };
+  
+  &chosen {
+          stdout-path = &lpuart1;
+  };
+  
+  /* put your further devices here */
+  
+  &iomuxc {
+          pinctrl_lpuart1: lpuart1grp {
+                  fsl,pins = <
+                          IMXRT_PAD_GPIO_AD_B0_12__LPUART1_TX     0x8
+                          IMXRT_PAD_GPIO_AD_B0_13__LPUART1_RX     0x13000
+                  >;
+          };
+  
+          /* put your further pinctrl groups here */
+  };
+
+You can then convert your FDT into a C file with (replace `YOUR.dts` and similar
+with your FDT source names)::
 
-  sh> export BSP_DIR="${RTEMS_SRC_DIR}/bsps/arm/imxrt/"
   sh> arm-rtems6-cpp -P -x assembler-with-cpp \
-          -I "${BSP_DIR}/include/" \
-          -include "YOUR.dts" /dev/null | \
-      dtc -@ -O dtb -o "YOUR.dtb" -b 0 -p 1024
+                     -I ${PREFIX}/arm-rtems6/imxrt1052/lib/include \
+                     -include "YOUR.dts" /dev/null | \
+            dtc -@ -O dtb -o "YOUR.dtb" -b 0 -p 1024
   sh> rtems-bin2c -C -N imxrt_dtb "YOUR.dtb" "YOUR.c"
 
 Make sure that your new c file is compiled and linked into the application.



More information about the vc mailing list