Skip to content

Commit

Permalink
Embedded Linux: add back slide about reasons to tweat the DT
Browse files Browse the repository at this point in the history
Done by splitting a set of slides shared between the kernel
and sysdev courses.

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
  • Loading branch information
michaelopdenacker committed Nov 25, 2021
1 parent 49c9c82 commit 95ae2ed
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 69 deletions.
2 changes: 2 additions & 0 deletions mk/embedded-linux-4d.mk
Expand Up @@ -28,6 +28,8 @@ EMBEDDED_LINUX_4D_SLIDES = \
sysdev-linux-tarballs-and-patches \
sysdev-linux-intro-lab-sources \
sysdev-kernel-building \
sysdev-customizing-dt \
sysdev-kernel-booting \
sysdev-linux-intro-lab-cross-compilation \
sysdev-linux-intro-modules \
sysdev-root-filesystem-title \
Expand Down
2 changes: 2 additions & 0 deletions mk/embedded-linux-qemu.mk
Expand Up @@ -27,6 +27,8 @@ EMBEDDED_LINUX_QEMU_SLIDES = \
sysdev-linux-tarballs-and-patches \
sysdev-linux-intro-lab-sources \
sysdev-kernel-building \
sysdev-customizing-dt \
sysdev-kernel-booting \
sysdev-linux-intro-lab-cross-compilation \
sysdev-linux-intro-modules \
sysdev-root-filesystem-title \
Expand Down
2 changes: 2 additions & 0 deletions mk/embedded-linux.mk
Expand Up @@ -28,6 +28,8 @@ EMBEDDED_LINUX_SLIDES = \
sysdev-linux-tarballs-and-patches \
sysdev-linux-intro-lab-sources \
sysdev-kernel-building \
sysdev-customizing-dt \
sysdev-kernel-booting \
sysdev-linux-intro-lab-cross-compilation \
sysdev-linux-intro-modules \
sysdev-root-filesystem-title \
Expand Down
1 change: 1 addition & 0 deletions mk/linux-kernel.mk
Expand Up @@ -17,6 +17,7 @@ LINUX_KERNEL_SLIDES = \
kernel-source-code-management \
kernel-source-code-exploring-lab \
sysdev-kernel-building \
sysdev-kernel-booting \
kernel-board-setup-kernel-compiling-and-booting-labs \
sysdev-linux-intro-modules \
kernel-driver-development-modules \
Expand Down
23 changes: 23 additions & 0 deletions slides/sysdev-customizing-dt/sysdev-customizing-dt.tex
@@ -0,0 +1,23 @@
\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}
\end{frame}
68 changes: 68 additions & 0 deletions slides/sysdev-kernel-booting/sysdev-kernel-booting.tex
@@ -0,0 +1,68 @@
\begin{frame}
\frametitle{Booting with U-Boot}
\begin{itemize}
\item U-Boot can directly boot the \code{zImage} binary.
\item In addition to the kernel image, U-Boot should also pass a
DTB to the kernel.
\item The typical boot process is therefore:
\begin{enumerate}
\item Load \code{zImage} at address X in memory
\item Load \code{<board>.dtb} at address Y in memory
\item Start the kernel with \code{bootz X - Y} \\
The \code{-} in the middle indicates no {\em initramfs}
\end{enumerate}
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Kernel command line}
\begin{itemize}
\item In addition to the compile time configuration, the kernel
behavior can be adjusted with no recompilation using the {\bf
kernel command line}
\item The kernel command line is a string that defines various
arguments to the kernel
\begin{itemize}
\item It is very important for system configuration
\item \code{root=} for the root filesystem (covered later)
\item \code{console=} for the destination of kernel messages
\item Example: \code{console=ttyS0 root=/dev/mmcblk0p2 rootwait}
\item Many more exist. The most important ones are documented
in \kdochtml{admin-guide/kernel-parameters} in kernel
documentation.
\end{itemize}
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Passing the kernel command line}
\begin{columns}
\column{0.7\textwidth}
\begin{itemize}
\item U-Boot carries the Linux kernel command line string in its
\code{bootargs} environment variable
\item Right before starting the kernel, it will store the content of
\code{bootargs} in the \code{chosen} section of the Device Tree
\item The kernel will behave differently depending on its
configuration:
\begin{itemize}
\item If \kconfig{CONFIG_CMDLINE_FROM_BOOTLOADER} is set:\\
The kernel will use only the string from the bootloader
\item If \kconfig{CONFIG_CMDLINE_FORCE} is set:\\
The kernel will only use the string received at configuration
time in \kconfig{CONFIG_CMDLINE}
\item If \kconfig{CONFIG_CMDLINE_EXTEND} is set:\\
The kernel will concatenate both strings
\end{itemize}
\end{itemize}
\column{0.3\textwidth}
\tiny See the "Understanding U-Boot Falcon Mode"
presentation from Michael Opdenacker, for details about how U-Boot
boots Linux.\\
\vspace{0.6cm}
\includegraphics[width=\textwidth]{slides/sysdev-kernel-building/understanding-falcon-mode-presentation.png}\\
\vspace{0.4cm}
\tiny Slides: \url{https://bootlin.com/pub/conferences/2021/lee/}\\
Video: \url{https://www.youtube.com/watch?v=LFe3x2QMhSo}
\end{columns}
\end{frame}
69 changes: 0 additions & 69 deletions slides/sysdev-kernel-building/sysdev-kernel-building.tex
Expand Up @@ -557,72 +557,3 @@ \subsection{Booting the kernel}
in memory before starting the kernel.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Booting with U-Boot}
\begin{itemize}
\item U-Boot can directly boot the \code{zImage} binary.
\item In addition to the kernel image, U-Boot should also pass a
DTB to the kernel.
\item The typical boot process is therefore:
\begin{enumerate}
\item Load \code{zImage} at address X in memory
\item Load \code{<board>.dtb} at address Y in memory
\item Start the kernel with \code{bootz X - Y} \\
The \code{-} in the middle indicates no {\em initramfs}
\end{enumerate}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Kernel command line}
\begin{itemize}
\item In addition to the compile time configuration, the kernel
behavior can be adjusted with no recompilation using the {\bf
kernel command line}
\item The kernel command line is a string that defines various
arguments to the kernel
\begin{itemize}
\item It is very important for system configuration
\item \code{root=} for the root filesystem (covered later)
\item \code{console=} for the destination of kernel messages
\item Example: \code{console=ttyS0 root=/dev/mmcblk0p2 rootwait}
\item Many more exist. The most important ones are documented
in \kdochtml{admin-guide/kernel-parameters} in kernel
documentation.
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Passing the kernel command line}
\begin{columns}
\column{0.7\textwidth}
\begin{itemize}
\item U-Boot carries the Linux kernel command line string in its
\code{bootargs} environment variable
\item Right before starting the kernel, it will store the content of
\code{bootargs} in the \code{chosen} section of the Device Tree
\item The kernel will behave differently depending on its
configuration:
\begin{itemize}
\item If \kconfig{CONFIG_CMDLINE_FROM_BOOTLOADER} is set:\\
The kernel will use only the string from the bootloader
\item If \kconfig{CONFIG_CMDLINE_FORCE} is set:\\
The kernel will only use the string received at configuration
time in \kconfig{CONFIG_CMDLINE}
\item If \kconfig{CONFIG_CMDLINE_EXTEND} is set:\\
The kernel will concatenate both strings
\end{itemize}
\end{itemize}
\column{0.3\textwidth}
\tiny See the "Understanding U-Boot Falcon Mode"
presentation from Michael Opdenacker, for details about how U-Boot
boots Linux.\\
\vspace{0.6cm}
\includegraphics[width=\textwidth]{slides/sysdev-kernel-building/understanding-falcon-mode-presentation.png}\\
\vspace{0.4cm}
\tiny Slides: \url{https://bootlin.com/pub/conferences/2021/lee/}\\
Video: \url{https://www.youtube.com/watch?v=LFe3x2QMhSo}
\end{columns}
\end{frame}

0 comments on commit 95ae2ed

Please sign in to comment.