[FE training-materials-updates] Kernel labs: update to Linux 4.5
Michael Opdenacker
michael.opdenacker at free-electrons.com
Thu Mar 17 12:27:38 CET 2016
Repository : git://git.free-electrons.com/training-materials.git
On branch : master
Link : http://git.free-electrons.com/training-materials/commit/?id=7faa7e51f9215c3a57bd25a3be0c5364cfa8e939
>---------------------------------------------------------------
commit 7faa7e51f9215c3a57bd25a3be0c5364cfa8e939
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date: Thu Mar 17 12:27:38 2016 +0100
Kernel labs: update to Linux 4.5
Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>
>---------------------------------------------------------------
7faa7e51f9215c3a57bd25a3be0c5364cfa8e939
.../kernel-i2c-communication.tex | 55 ++--------------------
.../kernel-i2c-device-model.tex | 4 +-
labs/kernel-module-simple/kernel-module-simple.tex | 4 +-
labs/kernel-serial-iomem/kernel-serial-iomem.tex | 2 +-
labs/kernel-serial-iomem/uarts-pinctrl.dts | 9 ++--
.../kernel-sources-exploring.tex | 8 ++--
6 files changed, 19 insertions(+), 63 deletions(-)
diff --git a/labs/kernel-i2c-communication/kernel-i2c-communication.tex b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
index 56d1d79..f04bc90 100644
--- a/labs/kernel-i2c-communication/kernel-i2c-communication.tex
+++ b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
@@ -77,59 +77,14 @@ offsets are declared and what values they are given:
\begin{verbatim}
i2c1_pins: pinmux_i2c1_pins {
- pinctrl-single,pins = <
- 0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */
- 0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
- >;
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */
+ AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
+ >;
};
\end{verbatim}
-That's surprising: we have \code{0x158} instead of \code{0x958}
-and \code{0x15c} instead of \code{0x95c}! In both cases, there is a
-\code{0x800} offset.
-
-However, this makes sense if you look at the way the base address of the
-Control Module Registers is defined. Look for \code{pinctrl-single} in
-\kpath{arch/arm/boot/dts/am33xx.dtsi}:
-
-\begin{verbatim}
-am33xx_pinmux: pinmux at 800 {
- compatible = "pinctrl-single";
- reg = <0x800 0x238>;
- #address-cells = <1>;
- #size-cells = <0>;
- pinctrl-single,register-width = <32>;
- pinctrl-single,function-mask = <0x7f>;
-};
-\end{verbatim}
-
-We first have to compute the absolute address of the above node. It is
-at offset \code{800} inside node \code{scm at 210000} inside node
-\code{l4_wkup at 44c00000}. So, the absolute address is:
-
-\begin{verbatim}
-0x44c00000 + 0x210000 + 0x800 = 0x44e10800
-\end{verbatim}
-
-So, the base address is \code{0x44e10800} instead of \code{0x44e10000} in
-the datasheet! The value in the DTS is \code{0x800} greater, which
-matches the difference in the offsets.
-
-Why this difference? If you get back to the big TRM document where
-the offsets are defined, you will see that below the \code{0x800}
-offset, there are many other registers that seem to have nothing to do with
-pin muxing. Therefore, starting at offset \code{0x800} is probably
-a way to make sure that using the \code{pinctrl-single} driver, users
-can only access real pin muxing registers and do not mess with lower
-registers by mistake.
-
-Now, let's focus on the values for the registers corresponding
-to \code{i2c1}:
-
-\begin{verbatim}
-0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */
-0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
-\end{verbatim}
+Here are details about the values:
\begin{itemize}
\item \code{MUX_MODE2} corresponds to muxing mode 2, as explained in the
diff --git a/labs/kernel-i2c-device-model/kernel-i2c-device-model.tex b/labs/kernel-i2c-device-model/kernel-i2c-device-model.tex
index 32d0cca..27c982b 100644
--- a/labs/kernel-i2c-device-model/kernel-i2c-device-model.tex
+++ b/labs/kernel-i2c-device-model/kernel-i2c-device-model.tex
@@ -17,10 +17,10 @@ device/driver match.
\section{Setup}
Go to the \code{~/linux-kernel-labs/src/linux} directory. Check out the
-\code{4.1.y} branch.
+\code{4.5.y} branch.
Now create a new \code{nunchuk} branch starting from the
-\code{4.1.y} branch, for your upcoming work on the nunchuk
+\code{4.5.y} branch, for your upcoming work on the nunchuk
driver.
\section{Connecting the nunchuk}
diff --git a/labs/kernel-module-simple/kernel-module-simple.tex b/labs/kernel-module-simple/kernel-module-simple.tex
index 25f1415..5ccdef5 100644
--- a/labs/kernel-module-simple/kernel-module-simple.tex
+++ b/labs/kernel-module-simple/kernel-module-simple.tex
@@ -102,7 +102,7 @@ As we are going to make changes to the kernel sources, first create a
special branch for such changes:
\begin{verbatim}
-git checkout 4.1.y
+git checkout 4.5.y
git checkout -b hello
\end{verbatim}
@@ -152,7 +152,7 @@ from the commits between your branch and another branch, usually the
one you started from:
\begin{verbatim}
-git format-patch 4.1.y
+git format-patch 4.5.y
\end{verbatim}
Have a look at the generated file. You can see that its name reused
diff --git a/labs/kernel-serial-iomem/kernel-serial-iomem.tex b/labs/kernel-serial-iomem/kernel-serial-iomem.tex
index 469dd6e..308dc1f 100644
--- a/labs/kernel-serial-iomem/kernel-serial-iomem.tex
+++ b/labs/kernel-serial-iomem/kernel-serial-iomem.tex
@@ -22,7 +22,7 @@ is independent from the nunchuk changes, it's best to create a separate
branch!
\begin{verbatim}
-git checkout 4.1.y
+git checkout 4.5.y
git checkout -b uart
\end{verbatim}
diff --git a/labs/kernel-serial-iomem/uarts-pinctrl.dts b/labs/kernel-serial-iomem/uarts-pinctrl.dts
index 2c3cb07..7dff77c 100644
--- a/labs/kernel-serial-iomem/uarts-pinctrl.dts
+++ b/labs/kernel-serial-iomem/uarts-pinctrl.dts
@@ -1,15 +1,16 @@
/* Pins 21 (TX) and 22 (RX) of connector P9 */
uart2_pins: uart2_pins {
pinctrl-single,pins = <
- 0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* spi0_d0.uart2_tx, MODE 1 */
- 0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /* spi0_sclk.uart2_rx, MODE 1 */
+ AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* spi0_d0.uart2_tx */
+ AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE1) /* spi0_sclk.uart2_rx */
>;
};
/* Pins 11 (RX) and 13 (TX) of connector P9 */
+
uart4_pins: uart4_pins {
pinctrl-single,pins = <
- 0x74 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_wpn.uart4_tx, MODE 6 */
- 0x70 (PIN_INPUT_PULLUP | MUX_MODE6) /* gpmc_wait0.uart4_rx, MODE 6 */
+ AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* gpmc_wait0.uart4_rx */
+ AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLUP | MUX_MODE6) /* gpmc_wpn.uart4_tx */
>;
};
diff --git a/labs/kernel-sources-exploring/kernel-sources-exploring.tex b/labs/kernel-sources-exploring/kernel-sources-exploring.tex
index 52a7691..cd7b707 100644
--- a/labs/kernel-sources-exploring/kernel-sources-exploring.tex
+++ b/labs/kernel-sources-exploring/kernel-sources-exploring.tex
@@ -26,18 +26,18 @@ cd ~/linux-kernel-labs/src/linux
git branch -a
\end{verbatim}
-As we want to work with the Linux 4.1 stable branch, the remote branch
-we are interested in is \code{remotes/stable/linux-4.1.y}.
+As we will do our labs with the Linux 4.5 stable branch, the remote branch
+we are interested in is \code{remotes/stable/linux-4.5.y}.
First, open the \code{Makefile} file just to check the Linux kernel
version that you currently have.
Now, let's create a local branch starting from that remote branch:
\begin{verbatim}
-git checkout -b 4.1.y stable/linux-4.1.y
+git checkout -b 4.5.y stable/linux-4.5.y
\end{verbatim}
-Open \code{Makefile} again and make sure you now have a 4.1.y version.
+Open \code{Makefile} again and make sure you now have a 4.5.y version.
\section{Exploring the sources manually}
More information about the training-materials-updates
mailing list