From 95ae2ed79c50fb32e985ccdc40ba8e9daaafddbe Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Thu, 25 Nov 2021 17:35:42 +0100 Subject: [PATCH] Embedded Linux: add back slide about reasons to tweat the DT Done by splitting a set of slides shared between the kernel and sysdev courses. Signed-off-by: Michael Opdenacker --- mk/embedded-linux-4d.mk | 2 + mk/embedded-linux-qemu.mk | 2 + mk/embedded-linux.mk | 2 + mk/linux-kernel.mk | 1 + .../sysdev-customizing-dt.tex | 23 ++++++ .../sysdev-kernel-booting.tex | 68 +++++++++++++++++ ...understanding-falcon-mode-presentation.png | Bin .../sysdev-kernel-building.tex | 69 ------------------ 8 files changed, 98 insertions(+), 69 deletions(-) create mode 100644 slides/sysdev-customizing-dt/sysdev-customizing-dt.tex create mode 100644 slides/sysdev-kernel-booting/sysdev-kernel-booting.tex rename slides/{sysdev-kernel-building => sysdev-kernel-booting}/understanding-falcon-mode-presentation.png (100%) diff --git a/mk/embedded-linux-4d.mk b/mk/embedded-linux-4d.mk index 791cc1d52..95656774a 100644 --- a/mk/embedded-linux-4d.mk +++ b/mk/embedded-linux-4d.mk @@ -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 \ diff --git a/mk/embedded-linux-qemu.mk b/mk/embedded-linux-qemu.mk index 2a2db4bf5..e9bd09528 100644 --- a/mk/embedded-linux-qemu.mk +++ b/mk/embedded-linux-qemu.mk @@ -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 \ diff --git a/mk/embedded-linux.mk b/mk/embedded-linux.mk index c0ad4a2d3..1e6034f4d 100644 --- a/mk/embedded-linux.mk +++ b/mk/embedded-linux.mk @@ -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 \ diff --git a/mk/linux-kernel.mk b/mk/linux-kernel.mk index 35fa5c514..d4f8bb677 100644 --- a/mk/linux-kernel.mk +++ b/mk/linux-kernel.mk @@ -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 \ diff --git a/slides/sysdev-customizing-dt/sysdev-customizing-dt.tex b/slides/sysdev-customizing-dt/sysdev-customizing-dt.tex new file mode 100644 index 000000000..cb8c682f4 --- /dev/null +++ b/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} diff --git a/slides/sysdev-kernel-booting/sysdev-kernel-booting.tex b/slides/sysdev-kernel-booting/sysdev-kernel-booting.tex new file mode 100644 index 000000000..58237d46c --- /dev/null +++ b/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{.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} diff --git a/slides/sysdev-kernel-building/understanding-falcon-mode-presentation.png b/slides/sysdev-kernel-booting/understanding-falcon-mode-presentation.png similarity index 100% rename from slides/sysdev-kernel-building/understanding-falcon-mode-presentation.png rename to slides/sysdev-kernel-booting/understanding-falcon-mode-presentation.png diff --git a/slides/sysdev-kernel-building/sysdev-kernel-building.tex b/slides/sysdev-kernel-building/sysdev-kernel-building.tex index cf95f364c..8262c1aae 100644 --- a/slides/sysdev-kernel-building/sysdev-kernel-building.tex +++ b/slides/sysdev-kernel-building/sysdev-kernel-building.tex @@ -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{.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}