[bootlin/training-materials updates] master: device-tree: Simplify the introduction of device tree (4b0d1c05)

Miquel Raynal miquel.raynal at bootlin.com
Sat Jan 14 00:07:03 CET 2023


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/4b0d1c05a088a8eed2ca923a146cea17cb8ce025

>---------------------------------------------------------------

commit 4b0d1c05a088a8eed2ca923a146cea17cb8ce025
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date:   Fri Dec 23 16:39:48 2022 +0100

    device-tree: Simplify the introduction of device tree
    
    Let's just explain the concept of describing hardware that cannot be
    discovered in order to allow a single kernel binary to boot on different
    platforms. Let's be sligthly less DT oriented when talking about boot
    procedures.
    
    In the sysdev training, there is already an extensive chapter about DT
    which will soon be copied into the Linux kernel training.
    
    The "customize your DT" slide is slightly adapted at the same time to
    fit more DT oriented information.
    
    Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


>---------------------------------------------------------------

4b0d1c05a088a8eed2ca923a146cea17cb8ce025
 .../sysdev-customizing-dt.tex                      | 44 ++++++++++++----------
 .../sysdev-kernel-building.tex                     | 37 +++++-------------
 2 files changed, 35 insertions(+), 46 deletions(-)

diff --git a/slides/sysdev-customizing-dt/sysdev-customizing-dt.tex b/slides/sysdev-customizing-dt/sysdev-customizing-dt.tex
index cb8c682f..d771d155 100644
--- a/slides/sysdev-customizing-dt/sysdev-customizing-dt.tex
+++ b/slides/sysdev-customizing-dt/sysdev-customizing-dt.tex
@@ -1,23 +1,29 @@
 \begin{frame}
   \frametitle{Customize your board device tree!}
   \small
-  Often needed for embedded board users:
-  \begin{columns}
-    \column{0.65\textwidth}
-       \begin{itemize}
-       \item To describe external devices attached to non-discoverable
-             busses (such as I2C) and configure them.
-       \item To configure pin muxing: choosing what SoC signals are
-	     made available on the board external connectors.
-	     See \url{http://linux.tanzilli.com/} for a web service doing this
-	     interactively.
-       \item To configure some system parameters: flash partitions,
-	     kernel command line (other ways exist)
-       \item Device Tree 101 webinar, Thomas Petazzoni (2021):\\
-             Slides: \url{https://bootlin.com/blog/device-tree-101-webinar-slides-and-videos/}\\
-             Video: \url{https://youtu.be/a9CZ1Uk3OYQ}
-       \end{itemize}
-    \column{0.35\textwidth}
-    \includegraphics[width=\textwidth]{common/device-tree-video.jpg}
-  \end{columns}
+    \begin{itemize}
+    \item Kernel developpers write {\em Device Tree Sources (DTS)},
+      which become {\em Device Tree Blobs (DTB)} once compiled.
+    \item There is one different Device Tree for each board/platform
+      supported by the kernel, available in
+      \code{arch/<arch>/boot/dts/<board>.dtb}. Their purpose is:
+      \begin{columns}
+        \column{0.65\textwidth}
+        \begin{itemize}
+        \item To describe external devices attached to non-discoverable
+          busses and configure them.
+        \item To configure pin muxing: choosing what SoC signals are
+          made available on the board external connectors.
+          See \url{http://linux.tanzilli.com/} for a web service doing this
+          interactively.
+        \item To configure some system parameters: flash partitions,
+          kernel command line (other ways exist)
+        \end{itemize}
+        \column{0.35\textwidth}
+        \includegraphics[width=\textwidth]{common/device-tree-video.jpg}
+      \end{columns}
+    \item Device Tree 101 webinar, Thomas Petazzoni (2021):\\
+      Slides: \url{https://bootlin.com/blog/device-tree-101-webinar-slides-and-videos/}\\
+      Video: \url{https://youtu.be/a9CZ1Uk3OYQ}
+    \end{itemize}
 \end{frame}
diff --git a/slides/sysdev-kernel-building/sysdev-kernel-building.tex b/slides/sysdev-kernel-building/sysdev-kernel-building.tex
index c253fcf1..6038f8e7 100644
--- a/slides/sysdev-kernel-building/sysdev-kernel-building.tex
+++ b/slides/sysdev-kernel-building/sysdev-kernel-building.tex
@@ -519,37 +519,20 @@ Cleaning targets:
 \subsection{Booting the kernel}
 
 \begin{frame}
-  \frametitle{Device Tree 1/2}
+  \frametitle{Hardware description}
   \begin{itemize}
   \item Many embedded architectures have a lot of non-discoverable
-    hardware (serial, Ethernet, I2C, Nand flash, USB  controllers...)
-  \item Depending on the architecture, such hardware is either
-    described in ACPI tables (x86), using C code directly within the kernel,
-    or using a special hardware description language in a {\em Device Tree}.
-  \item The Device Tree (DT) was initially used for SPARC and PowerPC, and
-    later was adopted by other architectures (ARM, ARC...). Now Linux
-    has DT support in most architectures.
-  \item Its main purpose is to describe the hardware and its integration:
-    non-discoverable devices, clocks, interrupts, DMA channels, pin
-    muxing, etc.
-  \end{itemize}
-\end{frame}
-
-\begin{frame}
-  \frametitle{Device Tree 2/2}
-  \begin{itemize}
-  \item A {\em Device Tree Source (DTS)}, written by kernel developers,
-    is compiled into a binary {\em Device Tree Blob (DTB)}, and needs to
-    be passed to the kernel at boot time.
+    hardware (serial, Ethernet, I2C, Nand flash, USB controllers...)
+  \item This hardware needs to be described and passed to the Linux
+    kernel.
+  \item Using C code directly within the kernel is legacy, nowadays the
+    bootloader/firmware is expected to provide this description when
+    starting the kernel:
     \begin{itemize}
-    \item There is one different Device Tree for each board/platform
-      supported by the kernel, available in
-      \code{arch/arm/boot/dts/<board>.dtb}.
-     \item See \kfile{arch/arm/boot/dts/stm32mp157a-dk1.dts} for
-      example.
+    \item On x86: using ACPI tables
+    \item On most embedded devices: using an OpenFirmware Device Tree
+      (DT)
     \end{itemize}
-  \item The bootloader must load both the kernel image and the DTB
-    in memory before starting the kernel.
   \item This way, a kernel supporting different SoCs knows which
     SoC and device initialization hooks to run on the current board.
   \end{itemize}




More information about the training-materials-updates mailing list