[FE training-materials-updates] kernel-module-env: Switch the kernel compilation instructions to the BBB

Maxime Ripard maxime.ripard at free-electrons.com
Fri Sep 6 16:28:26 CEST 2013


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

On branch  : kernel-bbb
Link       : http://git.free-electrons.com/training-materials/commit/?id=1ffcbf1f4538701684daa0b6c08be3cae90c07dd

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

commit 1ffcbf1f4538701684daa0b6c08be3cae90c07dd
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Fri Sep 6 12:14:32 2013 +0200

    kernel-module-env: Switch the kernel compilation instructions to the BBB
    
    Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>


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

1ffcbf1f4538701684daa0b6c08be3cae90c07dd
 .../kernel-module-environment.tex                  |   75 +++++++++++++-------
 1 file changed, 50 insertions(+), 25 deletions(-)

diff --git a/labs/kernel-module-environment/kernel-module-environment.tex b/labs/kernel-module-environment/kernel-module-environment.tex
index 94977fa..8ddb374 100644
--- a/labs/kernel-module-environment/kernel-module-environment.tex
+++ b/labs/kernel-module-environment/kernel-module-environment.tex
@@ -74,20 +74,34 @@ dpkg -L gcc-arm-linux-gnueabi
 Set the \code{ARCH} and \code{CROSS_COMPILE} definitions for the \code{arm}
 platform and to use your cross-compiler.
 
-Configure this kernel with the ready-made configuration for boards
-with the AT91SAM9263 CPU.
+Configure this kernel with the ready-made configuration for boards ith
+the OMAP2 and later family which the AM335x found in the BeagleBone
+belong to.
 
 Make sure that this configuration has \code{CONFIG_ROOT_NFS=y} (support
 booting on an NFS exported root directory).
 
-Compile your kernel and generate the \code{uImage} kernel image that U-boot
-needs (the U-boot bootloader needs the kernel \code{zImage} file to be
-encapsulated in a special container and the kernel \code{Makefile} can
-generate this container for you by running the mkimage tool found in
-the \code{uboot-mkimage} package):
+Compile your kernel and generate the \code{uImage} kernel image that
+U-boot needs (the U-boot bootloader needs the kernel \code{zImage}
+file to be encapsulated in a special container and the kernel
+\code{Makefile} can generate this container for you by running the
+mkimage tool found in the \code{uboot-mkimage} package). This file
+will contain, among other things, the load address of the
+kernel. Nowadays, the kernel can boot on several platforms, each with
+different load addresses, that makes the use of the uImage not very
+convenient. You'll need to specify it during the generation of the
+uImage using the \code{LOADADDR} environment variable.
 
 \begin{verbatim}
-make uImage
+LOADADDR=0x80008000 make uImage
+\end{verbatim}
+
+You will also need to generate the device tree blob for the BeagleBone
+Black. Once again, the kernel build system can build all the DTBs
+relevant for the current configuration quite easily.
+
+\begin{verbatim}
+make dtbs
 \end{verbatim}
 
 \section{Setting up the NFS server}
@@ -117,9 +131,14 @@ errors disappear.
 
 \section{Setting up serial communication with the board}
 
-Plug the Calao board on your computer using its USB-A connector. When
-plugged-in, a new serial ports should appear: \code{/dev/ttyUSB0}.
-You can also see this device appear by looking at the output of \code{dmesg}.
+The Beaglebone serial connector is exported on the 6 pins close to one
+of the 48 pins headers. Using your USB->Serial adaptor, connect the
+ground to the pin closest to the power supply connector (let's call
+this pin the pin 0), and the RX and TX to the pins 3 and 4.
+
+Once the USB <-> Serial connector plugged in, a new serial ports
+should appear: \code{/dev/ttyUSB0}.  You can also see this device
+appear by looking at the output of \code{dmesg}.
 
 To communicate with the board through the serial port, install a serial communication program, such as \code{picocom}:
 
@@ -244,7 +263,7 @@ the directory exported through TFTP on your development
 workstation. Then, from U-Boot, do:
 
 \begin{verbatim}
-tftp 0x21000000 textfile.txt
+tftp 0x81000000 textfile.txt
 \end{verbatim}
 
 {\bf Caution: known issue in Ubuntu 12.04 and later}:
@@ -255,14 +274,14 @@ and start it again every time you boot your workstation:
 /etc/init.d/tftpd-hpa restart
 \end{verbatim}
 
-The \code{tftp} command should command should have downloaded
-the \code{textfile.txt} file from your development
-workstation into the board's memory at location \code{0x21000000} (this
-location is part of the board DRAM). You can verify that the download
-was successful by dumping the contents of the memory:
+The \code{tftp} command should command should have downloaded the
+\code{textfile.txt} file from your development workstation into the
+board's memory at location \code{0x81000000} (this location is part of
+the board DRAM). You can verify that the download was successful by
+dumping the contents of the memory:
 
 \begin{verbatim}
-md 0x21000000
+md 0x81000000
 \end{verbatim}
 
 \section{Boot the system}
@@ -273,7 +292,7 @@ over NFS, by setting some kernel parameters.  Use the following U-Boot
 command to do so (in just 1 line):
 
 \begin{verbatim}
-setenv bootargs root=/dev/nfs ip=192.168.0.100 console=ttyS0
+setenv bootargs root=/dev/nfs ip=192.168.0.100 console=ttyO0
   nfsroot=192.168.0.1:/home/<user>/felabs/linux/modules/nfsroot
 \end{verbatim}
 
@@ -282,13 +301,19 @@ setup. Save the environment variables (with \code{saveenv}).  Now, download
 the kernel image through \code{tftp}:
 
 \begin{verbatim}
-tftp 0x21000000 uImage
+tftp 0x81000000 uImage
+\end{verbatim}
+
+You'll also need to download the device tree blob:
+
+\begin{verbatim}
+tftp 0x82000000 am335x-bone.dtb
 \end{verbatim}
 
 Now, boot your kernel:
 
 \begin{verbatim}
-bootm 0x21000000
+bootm 0x81000000 - 0x82000000
 \end{verbatim}
 
 If everything goes right, you should reach a shell prompt. Otherwise,
@@ -305,15 +330,15 @@ you power on or reset your board, here's a way to automatically call the
 above commands at boot time:
 
 \begin{verbatim}
-setenv bootcmd 'tftp 0x21000000 uImage; bootm 0x21000000'
+setenv bootcmd 'tftp 0x81000000 uImage; tftp 0x82000000 am335x-bone.dtb; bootm 0x81000000 - 0x82000000'
 saveenv
 \end{verbatim}
 
 \code{bootcmd} will automatically be run after the U-boot timeout
 expires. Don't hesitate to change it according to your exact needs.
 
-We could also copy the \code{uImage} file to NAND flash and avoid
-downloading it over and over again. However, handling NAND flash is
-outside of the scope of this course. See our
+We could also copy the \code{uImage} file to the eMMC flash and avoid
+downloading it over and over again. However, handling flash is outside
+of the scope of this course. See our
 \href{http://free-electrons.com/training/embedded-linux/}{Embedded
 Linux system development course} and its on-line materials for details.



More information about the training-materials-updates mailing list