[FE training-materials-updates] Kernel labs: improve datasheet related guidelines

Michael Opdenacker michael.opdenacker at free-electrons.com
Thu Dec 5 08:58:41 CET 2013

Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=41ac337052e3b406962edb7634d765ee3fc852cf


commit 41ac337052e3b406962edb7634d765ee3fc852cf
Author: Michael Opdenacker <michael.opdenacker at free-electrons.com>
Date:   Thu Dec 5 08:57:13 2013 +0100

    Kernel labs: improve datasheet related guidelines
    - Not complete yet
    Signed-off-by: Michael Opdenacker <michael.opdenacker at free-electrons.com>


 labs/kernel-board-setup/kernel-board-setup.tex     |   16 ++++++++--
 .../kernel-i2c-communication.tex                   |   32 +++++++++++++++++++-
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/labs/kernel-board-setup/kernel-board-setup.tex b/labs/kernel-board-setup/kernel-board-setup.tex
index 5f2ec6a..ddf284b 100644
--- a/labs/kernel-board-setup/kernel-board-setup.tex
+++ b/labs/kernel-board-setup/kernel-board-setup.tex
@@ -18,7 +18,14 @@ Take some time to read about the board features and connectors on
 \url{http://circuitco.com/support/index.php?title=BeagleBoneBlack}. The
 above image was taken from this page.
-Then download the board System Reference Manual found at 
+Don't hesitate to share your questions with the instructor.
+\section{Download technical documentation}
+We are going to download documents which we will need during our
+practical labs.
+The first document to download is the board System Reference Manual found at 
 \footnote{There is a link to this manual on the above page}.
 This is the ultimate reference about the board, giving all the details
@@ -26,13 +33,16 @@ about the design of the board and the components which were chosen.
 You don't have to start reading this document now but you will need it
 during the practical labs.
+The second document to download is the datasheet for the 
+TI AM335x SoCs, available on
+\url{http://www.ti.com/lit/ds/symlink/am3359.pdf}. This document will
+give us details about pin assignments.
 Last but not least, download the Technical Reference Manual (TRM) for
 the TI AM3359 SoC, available on \url{http://www.ti.com/product/am3359}.
 This document is more than 4700 pages big (20 MB)! You will need it
 too during the practical labs. 
-Don't hesitate to share your questions with the instructor.
 \section{Setting up serial communication with the board}
 The Beaglebone serial connector is exported on the 6 pins close to one
diff --git a/labs/kernel-i2c-communication/kernel-i2c-communication.tex b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
index 6fb570a..82e7b63 100644
--- a/labs/kernel-i2c-communication/kernel-i2c-communication.tex
+++ b/labs/kernel-i2c-communication/kernel-i2c-communication.tex
@@ -15,7 +15,7 @@ compiling (stay in the \code{nunchuk} branch), and in
 \code{~/felabs/linux/modules/nfsroot/root/nunchuk} for module compiling
 (use two different terminals).
-\section{Add pinctrl properties to the Device Tree}
+\section{Find pin muxing configuration information for i2c1}
 As you found in the previous lab, we now managed to have our nunchuk
 device enumerated on the \code{i2c1} bus.
@@ -30,6 +30,36 @@ of the AM335 SoC. You can also see that such pins need to be configured
 as \code{MODE2} to get the functionality that we need (\code{I2C1_SCL}
 and \code{I2C1_SDA}).
+The second step is to open the CPU datasheet (\code{am3359.pdf}), and
+look for pin assignment information ({\em Pin Assignments} section).
+You will find that the processor is available through two types of
+packages: \code{ZCE} and \code{ZCZ}. If you have a very close at the CPU
+(with your glasses on!), you will see that the CPU has \code{ZCZ} written
+on its lower right corner. The BeagleBonne Black Reference Manual also
+confirms this.
+So, in the {\em ZCZ Package Pin Maps (Top View)} section, you can find 
+hyperlinks to the descriptions of the \code{A16} and \code{B16} pins. 
+That's where you can find reference pin muxing information for these
+pins.  You can find that the pin name for \code{A16} is \code{SPI0_CS0}
+and that the pin name for \code{B16} is \code{SPI0_D1}.
+You can also get a confirm that to obtain the (\code{I2C1_SCL} and
+\code{I2C1_SDA}) signals, you need to configure muxing mode number 2.
+The next thing to do is to open the big TRM document and look for the
+address of the registers that control pin muxing. Look for
+\code{Control Module Registers} and you will find the \code{0x44E1_0000}
+address in {\em L4_WKUP Peripheral Memory Map}.
+Last but not least, look for the \code{SPI0_CS0} and \code{SPI0_D1} 
+pin names, and you will find the offsets for the registers controlling
+muxing for these pins in the {\em CONTROL_MODULE REGISTERS} table:
+respectively \code{0x95c} and \code{0x958}.
+We now know which registers we can write to to enable \code{i2c1}
+\section{Add pinctrl properties to the Device Tree}
 Now look at the Device Tree for the AM335x EVM board
 (\code{arch/arm/boot/dts/am335x-evm.dts}). It's using \code{i2c1} too.

More information about the training-materials-updates mailing list