[bootlin/training-materials updates] master: kernel-porting: Remove redundant information about DT (c7c77450)
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/c7c77450d8955380b0e0f7ed536df4e4fc289bf7
>---------------------------------------------------------------
commit c7c77450d8955380b0e0f7ed536df4e4fc289bf7
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date: Sat Jan 14 00:05:46 2023 +0100
kernel-porting: Remove redundant information about DT
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>---------------------------------------------------------------
c7c77450d8955380b0e0f7ed536df4e4fc289bf7
.../kernel-porting-content.tex | 231 ---------------------
1 file changed, 231 deletions(-)
diff --git a/slides/kernel-porting-content/kernel-porting-content.tex b/slides/kernel-porting-content/kernel-porting-content.tex
index c3f768d2..b06b0e1c 100644
--- a/slides/kernel-porting-content/kernel-porting-content.tex
+++ b/slides/kernel-porting-content/kernel-porting-content.tex
@@ -114,237 +114,6 @@
\end{enumerate}
\end{frame}
-\begin{frame}
- \frametitle{Studying the Crystalfontz CFA-10036 platform}
- After using a platform based on the AM335x processor from Texas
- Instruments, let's study another platform Bootlin
- has worked on specifically.
- \begin{columns}
- \column{0.7\textwidth}
- \begin{itemize}
- \item Crystalfontz CFA-10036
- \item Uses the Freescale iMX28 SoC, from the MXS family.
- \item 128MB of RAM
- \item 1 serial port, 1 LED
- \item 1 I2C bus, equipped with an OLED display
- \item 1 SD-Card slot
- \end{itemize}
- \column{0.3\textwidth}
- \includegraphics[width=\textwidth]{slides/kernel-porting-content/crystalfontz.jpg}
- \end{columns}
- \bigskip
- Disclaimer: while the way of describing a board has slightly evolved
- over the past years, the official Crystalfontz support has not. As our
- incentive is to show up-to-date code and share best practices, the
- next snippets of code may diverge a little compared to the upstream
- files.
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036 Device Tree, header}
- \begin{itemize}
- \item SPDX license tag\\
- \item Mandatory Device Tree language definition\\
- \begin{block}{} \mint[fontsize=\small]{perl}+/dts-v1/;+ \end{block}
- \item Include the \code{.dtsi} file describing the SoC\\
- \begin{block}{}
- \mint[fontsize=\small]{perl}+#include "imx28.dtsi"+
- \end{block}
- \item Start the root of the tree (named \code{/}) then describe the board
- \begin{itemize}
- \item A human-readable string to describe the machine (shown at boot time)\\
- \begin{block}{}
- \mint[fontsize=\small]{perl}+model = "Crystalfontz CFA-10036 Board";+
- \end{block}
- \item A list of {\em compatible} strings, from the most specific one
- to the most general one. Mandatory to execute the right SoC specific
- initializations and board specific code.\\
- \begin{block}{}
- \mint[fontsize=\small]{perl}+compatible = "crystalfontz,cfa10036", "fsl,imx28";+
- \end{block}
- \end{itemize}
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036, backbone}
- \begin{itemize}
- \item Definition of the buses and peripherals
- \begin{block}{}
- \begin{minted}[fontsize=\small]{perl}
-/ {
- /* Define here 'standalone' peripherals and internal buses */
- memory {
- device_type = "memory";
- reg = <0x40000000 0x8000000>; /* 128 MB */
- };
- apb at 80000000 {
- apbh at 80000000 {
- /* Define apbh peripherals here */
- apbx at 80040000 {
- /* Define apbx peripherals here */
- };
- };
- };
-};
-/* Reference here existing nodes with their labels */
- \end{minted}
- \end{block}
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036 Device Tree, enable already
- described devices}
- \begin{itemize}
- \item The CFA-10036 has one debug UART. It is described in the iMX28
- DTSI file, so the corresponding controller should be referenced in
- the board DTS and enabled:
- \begin{block}{}
- \begin{minted}[fontsize=\small]{perl}
-&duart {
- pinctrl-names = "default";
- pinctrl-0 = <&duart_pins_b>;
- status = "okay";
-};
- \end{minted}
- \end{block}
- \item It also features an USB port which is described in the SoC
- DTSI but needs to be enabled:
- \begin{block}{}
- \begin{minted}[fontsize=\small]{perl}
-&usb0 {
- pinctrl-names = "default";
- pinctrl-0 = <&usb0_otg_cfa10036>;
- status = "okay";
-};
- \end{minted}
- \end{block}
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036 Device Tree, fully describe
- additional devices}
- \begin{itemize}
- \item The I2C bus with a Solomon SSD1306 OLED display connected on
- it must be described entirely at the location where it belongs:
- \begin{block}{}
- \begin{minted}[fontsize=\tiny]{perl}
-apbc at 80040000 {
- i2c0: i2c at 18000 { /* This means physical offset 0x80058000 */
- reg = <0x18000 0x1000>;
- pinctrl-names = "default";
- pinctrl-0 = <&i2c0_pins_b>;
- status = "okay";
- clock-frequency = <400000>;
-
- ssd1306: oled at 3c {
- compatible = "solomon,ssd1306fb-i2c";
- pinctrl-names = "default";
- pinctrl-0 = <&ssd1306_cfa10036>;
- reg = <0x3c>;
- reset-gpios = <&gpio2 7 0>;
- solomon,height = <32>;
- solomon,width = <128>;
- solomon,page-offset = <0>;
- };
- };
- \end{minted}
- \end{block}
- \item Mind the display's pin configuration that has not yet been
- described
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036 Device Tree, LEDs}
- \begin{itemize}
- \item One LED is connected to this platform, let's describe it as well
- \begin{block}{}
- \begin{minted}[fontsize=\small]{perl}
-/ {
- leds {
- compatible = "gpio-leds";
- pinctrl-names = "default";
- pinctrl-0 = <&led_pins_cfa10036>;
-
- power {
- gpios = <&gpio3 4 1>;
- default-state = "on";
- };
- };
- \end{minted}
- \end{block}
- \item Also mind the pin configuration that we can define at any place
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036 Device Tree, muxing}
- \begin{itemize}
- \item Definition of a few pins that will be muxed as GPIO, for LEDs and reset.
- \begin{block}{}
- \begin{minted}[fontsize=\tiny]{perl}
-&pinctrl {
- ssd1306_cfa10036: ssd1306-10036 at 0 {
- reg = <0>;
- fsl,pinmux-ids = <0x2073>; /* MX28_PAD_SSP0_D7__GPIO_2_7 */
- fsl,drive-strength = <0>;
- fsl,voltage = <1>;
- fsl,pull-up = <0>;
- };
-
- led_pins_cfa10036: leds-10036 at 0 {
- reg = <0>;
- fsl,pinmux-ids = <0x3043>; /* MX28_PAD_AUART1_RX__GPIO_3_4 */
- fsl,drive-strength = <0>;
- fsl,voltage = <1>;
- fsl,pull-up = <0>;
- };
-};
- \end{minted}
- \end{block}
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036 Device Tree, Breakout Boards}
- \begin{itemize}
- \item The CFA-10036 can be plugged in other breakout boards, and the
- device tree also allows us to describe this, using includes. For
- example, the CFA-10057:
- \begin{block}{}
- \mint[fontsize=\small]{perl}+#include "imx28-cfa10036.dts"+
- \end{block}
- \item This allows to have a layered description. This can also be
- done for boards that have a lot in common, like the BeagleBone and
- the BeagleBone Black, or the AT91 SAMA5D3-based boards.
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Crystalfontz CFA-10036: build the DTB}
- \begin{itemize}
- \item To ensure that the Device Tree Blob gets built for this board
- Device Tree Source, one need to ensure it is listed in
- \kfile{arch/arm/boot/dts/Makefile}:
- \begin{block}{}
- \begin{minted}{make}
-dtb-$(CONFIG_ARCH_MXS) +=
- imx28-cfa10036.dtb \
- imx28-cfa10037.dtb \
- imx28-cfa10049.dtb \
- imx28-cfa10055.dtb \
- imx28-cfa10056.dtb \
- imx28-cfa10057.dtb \
- imx28-cfa10058.dtb \
- imx28-evk.dtb
- \end{minted}
- \end{block}
- \end{itemize}
-\end{frame}
-
\begin{frame}
\frametitle{Understanding the SoC support}
\begin{itemize}
More information about the training-materials-updates
mailing list