[bootlin/training-materials updates] master: Kernel course: misc improvements (1bfd6f99)

Michael Opdenacker michael.opdenacker at bootlin.com
Wed Feb 3 13:27:50 CET 2021


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

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

commit 1bfd6f99a8d6b1911b90013640474d2435430b17
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Wed Feb 3 13:27:50 2021 +0100

    Kernel course: misc improvements
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

1bfd6f99a8d6b1911b90013640474d2435430b17
 .../kernel-i2c-device-model.tex                    |  0
 slides/kernel-device-model/kernel-device-model.tex |  4 +-
 slides/kernel-frameworks/kernel-frameworks.tex     |  4 +-
 slides/kernel-frameworks2/kernel-frameworks2.tex   | 21 +++------
 slides/kernel-i2c/kernel-i2c.tex                   |  3 ++
 slides/kernel-pinmuxing/kernel-pinmuxing.tex       | 52 +++++++++++++++-------
 6 files changed, 48 insertions(+), 36 deletions(-)

diff --git a/slides/kernel-device-model/kernel-device-model.tex b/slides/kernel-device-model/kernel-device-model.tex
index 57466f54..cb26eea8 100644
--- a/slides/kernel-device-model/kernel-device-model.tex
+++ b/slides/kernel-device-model/kernel-device-model.tex
@@ -21,7 +21,7 @@
 \begin{frame}
   \frametitle{Kernel and Device Drivers}
   \begin{columns}
-    \column{0.5\textwidth} In Linux, a driver is always interfacing
+    \column{0.7\textwidth} In Linux, a driver is always interfacing
     with:
     \begin{itemize}
     \item a {\bf framework} that allows the driver to expose the
@@ -31,7 +31,7 @@
     \end{itemize}
     This section focuses on the {\em device model}, while {\em kernel
       frameworks} are covered later in this training.
-    \column{0.5\textwidth}
+    \column{0.3\textwidth}
     \includegraphics[height=0.8\textheight]{slides/kernel-device-model/driver-architecture.pdf}
   \end{columns}
 \end{frame}
diff --git a/slides/kernel-frameworks/kernel-frameworks.tex b/slides/kernel-frameworks/kernel-frameworks.tex
index ca3c336a..b398a318 100644
--- a/slides/kernel-frameworks/kernel-frameworks.tex
+++ b/slides/kernel-frameworks/kernel-frameworks.tex
@@ -3,7 +3,7 @@
 \begin{frame}
   \frametitle{Kernel and Device Drivers}
   \begin{columns}
-    \column{0.5\textwidth} In Linux, a driver is always interfacing
+    \column{0.7\textwidth} In Linux, a driver is always interfacing
     with:
     \begin{itemize}
     \item a {\bf framework} that allows the driver to expose the
@@ -13,7 +13,7 @@
     \end{itemize}
     This section focuses on the {\em kernel frameworks}, while the
     {\em device model} was covered earlier in this training.
-    \column{0.5\textwidth}
+    \column{0.3\textwidth}
     \includegraphics[height=0.8\textheight]{slides/kernel-frameworks/driver-architecture.pdf}
   \end{columns}
 \end{frame}
diff --git a/slides/kernel-frameworks2/kernel-frameworks2.tex b/slides/kernel-frameworks2/kernel-frameworks2.tex
index 78533024..0d461951 100644
--- a/slides/kernel-frameworks2/kernel-frameworks2.tex
+++ b/slides/kernel-frameworks2/kernel-frameworks2.tex
@@ -55,7 +55,7 @@ Many more operations exist. All of them are optional.
     \item {\bf Only implement this function when you do something
           special with the device at \code{open()} time.}
     \item \kstruct{inode} is a structure that uniquely represents a file
-      in the system (be it a regular file, a directory, a symbolic
+      in the filesystem (be it a regular file, a directory, a symbolic
       link, a character or block device)
     \item \kstruct{file} is a structure created every time a file is
       opened. Several file structures can point to the same
@@ -78,11 +78,10 @@ Many more operations exist. All of them are optional.
   \end{itemize}
 \end{frame}
 
-\begin{frame}
-  \frametitle{read()}
+\begin{frame}[fragile]
+  \frametitle{read() and write()}
   \begin{itemize}
-  \item \mint{c}+ssize_t foo_read(struct file *f, char __user *buf,+
-    \mint{c}+size_t sz, loff_t *off)+
+  \item \mint[fontsize=\small]{c}+ssize_t foo_read(struct file *f, char __user *buf, size_t sz, loff_t *off)+
     \begin{itemize}
     \item Called when user space uses the \code{read()} system call on
       the device.
@@ -97,14 +96,7 @@ Many more operations exist. All of them are optional.
     \item On UNIX, \code{read()} operations typically block when there
       isn't enough data to read from the device
     \end{itemize}
-  \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{write()}
-  \begin{itemize}
-  \item \mint{c}+ssize_t foo_write(struct file *f,+
-    \mint{c}+const char __user *buf, size_t sz, loff_t *off)+
+  \item \mint[fontsize=\small]{c}+ssize_t foo_write(struct file *f, const char __user *buf, size_t sz, loff_t *off)+
     \begin{itemize}
     \item Called when user space uses the \code{write()} system call
       on the device
@@ -189,8 +181,7 @@ Many more operations exist. All of them are optional.
 \begin{frame}[fragile]
   \frametitle{unlocked\_ioctl()}
   \begin{itemize}
-  \item \mint{c}+long unlocked_ioctl(struct file *f,+
-    \mint{c}+unsigned int cmd, unsigned long arg)+
+  \item \mint[fontsize=\small]{c}+long unlocked_ioctl(struct file *f, unsigned int cmd, unsigned long arg)+
     \begin{itemize}
     \item Associated to the \code{ioctl()} system call.
     \item Called unlocked because it didn't hold the Big Kernel Lock
diff --git a/slides/kernel-i2c/kernel-i2c.tex b/slides/kernel-i2c/kernel-i2c.tex
index 1e794999..4b1cf9ea 100644
--- a/slides/kernel-i2c/kernel-i2c.tex
+++ b/slides/kernel-i2c/kernel-i2c.tex
@@ -162,6 +162,9 @@ static void __init em7210_init_machine(void)
       I2C controller node, where the \code{reg} property gives the I2C
       slave address on the bus.
     \end{itemize}
+   \item See the binding for the corresponding driver for a
+      specification of the expected DT properties. Example:
+      \kfile{Documentation/devicetree/bindings/i2c/i2c-omap.txt}
   \end{itemize}
 \end{frame}
 
diff --git a/slides/kernel-pinmuxing/kernel-pinmuxing.tex b/slides/kernel-pinmuxing/kernel-pinmuxing.tex
index a947015e..d116a3a5 100644
--- a/slides/kernel-pinmuxing/kernel-pinmuxing.tex
+++ b/slides/kernel-pinmuxing/kernel-pinmuxing.tex
@@ -48,29 +48,47 @@
   \end{center}
 \end{frame}
 
-\begin{frame}[fragile]{Device Tree binding for consumer devices}
+\begin{frame}[fragile]{Device Tree properties for consumer devices}
+  The devices that require certains pins to be muxed will use
+  the \code{pinctrl-<x>} and \code{pinctrl-names} Device Tree
+  properties.
   \begin{itemize}
-  \item The devices that require certains pins to be muxed will use
-    the \code{pinctrl-<x>} and \code{pinctrl-names} Device Tree
-    properties.
-  \item The \code{pinctrl-0}, \code{pinctrl-1}, \code{pinctrl-<x>}
-    properties link to a pin configuration for a given state of the
-    device.
-  \item The \code{pinctrl-names} property associates a name to each
-    state. The name \code{default} is special, and is automatically
-    selected by a device driver, without having to make an explicit
-    {\em pinctrl} function call.
-  \item In most cases, the following is sufficient:
+     \item The \code{pinctrl-0}, \code{pinctrl-1}, \code{pinctrl-<x>}
+       properties link to a pin configuration for a given state of the
+       device.
+     \item The \code{pinctrl-names} property associates a name to each
+       state. The name \code{default} is special, and is automatically
+       selected by a device driver, without having to make an explicit
+       {\em pinctrl} function call.
+     \item See \kerneldoctext{devicetree/bindings/pinctrl/pinctrl-bindings.txt}
+       for details.
+  \end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]{Device Tree properties for consumer devices - Examples}
+  \begin{columns}
+    \column{0.5\textwidth}
     \begin{minted}[fontsize=\footnotesize]{perl}
-i2c at 11000 {
+i2c0: i2c at 11000 {
+        ...
         pinctrl-0 = <&pmx_twsi0>;
         pinctrl-names = "default";
         ...
 };
 \end{minted}
-\item See \kerneldoctext{devicetree/bindings/pinctrl/pinctrl-bindings.txt}
-  for details.
-\end{itemize}
+    Most common case (\kfile{arch/arm/boot/dts/kirkwood.dtsi})
+    \column{0.5\textwidth}
+    \begin{minted}[fontsize=\footnotesize]{perl}
+i2c0: i2c at f8014000 {
+       ...
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c0>;
+       pinctrl-1 = <&pinctrl_i2c0_gpio>;
+       ...
+};
+\end{minted}
+    Case with multiple pin states (\kfile{arch/arm/boot/dts/sama5d4.dtsi})
+  \end{columns}
 \end{frame}
 
 \begin{frame}{Defining pinctrl configurations}
@@ -143,7 +161,7 @@ i2c at 11000 {
   \end{columns}
 \end{frame}
 
-\begin{frame}[fragile]{Example on Allwinner SoC}
+\begin{frame}[fragile]{Example on the Allwinner A20 SoC}
   \begin{center}
     \includegraphics[height=0.8\textheight]{slides/kernel-pinmuxing/allwinner-example.pdf}
   \end{center}




More information about the training-materials-updates mailing list