[[bc10]]
[[bc10-router]]
#contents




* Updating bc10-router kernel [#wef870cf]
>
Use arago-console-image as the boot image of bc10-router. The version of linux kernel is 3.3.7.~ (arago-console-image is a part of arago-project, and this is specifically created for begale board.)~
~
kernel is specified at the file, which is located at {HOME}/oe/arago/conf/machine/beagleboard.conf
<Code and Commands>
kernel is specified at the file, which is located at {HOME}/oe/arago/conf/machine/beagleboard.conf~
 PREFERRED_PROVIDER_virtual/kernel = "linux-stable"
This indicates that {Home}/oe/arago/recipes/linux/linux-stable_3.3bb is used for the configuration as kernel is built.~
~
3.3.7 stable kernel is cloned from git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git,
and two patches will be applied to this downloaded kernel. The patches can be founded at {HOME}/oe/arago/recipes/linux/linux-stable/~
~
The names of the patches are shown below.~
- 0001-ARM-OMAP-Cleanup-Beagleboard-DVI-reset-gpio.patch~
- 0001-ARM-OMAP2-UART-Fix-incorrect-population-of-default-u.patch~
To use bitbake, the kernel, which is applied to these patches, are built.~
~

>
Using the default kernel, the performance of bc10-router is as good as any home use router's. To make bc10-router perform better, the points shown below are needed to be considered, and the kernel of bc10-router is updated as an experiment. To update the kernel, there are no guarantees for improving its performance. The points, which are needed to be improved, are:~
- Higher network throughputs~
- Faster network connection for wireless LAN~
- Less power consumption~
~

>
Since Android equipped smart-phones have become common in the market, the developer communities of linux kernel for ARM SoC become more active, and the source code become more available. To update kernel, Ethernet and wireless LAN drivers, wireless LAN subsystem, and power management are expected to be improved.~
~
** Method of updating kernel [#kd577c70]
>
To update the kernel for bc10, the kernel source code for beagleboard is used.~




*** RobertCNelson repository [#e9fbbcad]
>
The build environment is downloaded form RobertCNelson repository. This repository provides the kernel build environments and patches for BeagleBoard, Pandaboard, and other TI's OMAP/Sitara series.~
Download the whole build environment from RovertCNellson repository.~
[[https://github.com/RobertCNelson/linux-dev.git ]]~
<Code and Command>
 $ mkdir {work_dir}
 $ cd ~/{work_dir}
 $ git clone https://github.com/RobertCNelson/linux-dev.git
 $ cd linux-dev
Please execute version.sh to make sure which version of kerne the master branch is going to build as of updating the kernel of bc10.~
<Code and Command>
 #Kernel/Build
 KERNEL_REL=3.8
 KERNEL_TAG=${KERNEL_REL}-rc3
 BUILD=d0
As of writing this document, the end of January 2013, the default is 3.8 kernel at the development branch. 3.7 kernel is already released at the stable brach. The selection of brach is shifted from the default 3.8 at the development branch to 3.7 of the stable version.~
<Code and Command>
 $ git branch -a
 * master
   remotes/origin/HEAD -> origin/master
   remotes/origin/am33x-v3.1
   remotes/origin/am33x-v3.2
   remotes/origin/am33x-v3.6
   remotes/origin/am33x-v3.7
   remotes/origin/master
 
 $ git checkout -b am33x-v3.7 remotes/origin/am33x-v3.7
As the build target is shifted from 3.8 to 3.7, the configuration file is modified. Please copy the pre-made sample configuration file.~
<Code and Command>
 $ cp system.sh.sample system.sh
As the default, The configurations of ARM GCC CROSS Compiler and the building setting of uImage are treated as comments. Remove these comments, make ARM GCC CROS Compiler and uImage effective, and configure the compiler and uImage.~
<Code and Command>
 #ARM GCC CROSS Compiler: (See hints in Readme, for different gcc cross compiler versions)
 #CC=arm-linux-gnueabi-
 CC=arm-arago-linux-gnueabi-
 
 ###OPTIONAL: BUILD_UIMAGE: also build uImage vs just zImage
 #
 BUILD_UIMAGE=1
 
 ###OPTIONAL: ZRELADDR: needed when building uImage's.
 #
 ##For TI: OMAP3/4/AM35xx
 ZRELADDR=0x80008000
Setting PATH to Cross Toolchain of ti-sdk-beagleboard-05.05.01.00, execute build_kernel.sh~
<Code and Command>
 $ export PATH={HOME}/ti-sdk-beagleboard-05.05.01.00/linux-devkit/bin:$PATH
 $ ./build_kernel.sh
Executing the command, git clone the kernel source to the directory of {Home}/linux-src/.~
Then, checkout 3.72 kernel to the directory of ~/{work_dir}/linux-dev/KERNEL.~
Applying patches for ARM, OMAP, and beagleboard, separately and individually, then perform menuconfig. Executing menuconfig, open up the console for kernel config.~
As Config is completed, the settings are saved (the completed configuration file is (&ref(bc10-router-3.7.2.config);), build is executed. Then the files show below is created under the deploy directory.
<Code and Command>
As Config is completed, the settings are saved (the completed configuration file is (&ref(bc10-router-3.7.2.config);), build is executed. Then the files show below is created under the deploy directory.~
 $ ls -1
 3.7.2-bone4.1-dtbs.tar.gz
 3.7.2-bone4.1-firmware.tar.gz
 3.7.2-bone4.1-headers.tar.gz
 3.7.2-bone4.1-modules.tar.gz
 3.7.2-bone4.1.config
 3.7.2-bone4.1.uImage
 3.7.2-bone4.1.zImage
 dtbs/
 fir/
 headers/
 mod/
dtbs is required for booting DeviceTree, which is adapted to ARM architecture, since its version 3.7 of dtbs, but dtbs is NOT used for bc10-router.~
Only uImage (3.7.2-bone4.1uImage) and module (3.7.2-bone-modules.tar.gz) are used for this article.~
~
Once the build process, done with build_kernel.sh, has been completed, and wish to rebuild it again,  please use rebuild.sh for the second time or later. rebuild.sh is located at tools directory.
<Code and  Command>
These created files are copied to the boot image of bc10-router, which has been generated at the section of [[bc10-router/arago-project]]. Assume that fat partition and ext3 partition are mounted at /media/FAT and at /media/EXT3, respectively.~
<Code and Command>
 $ ./tools/rebuild.sh
 These created files are copied to the boot image of bc10-router, which has been generated at the section of [[bc10-router/arago-project]]. Assume that fat partition and ext3 partition are mounted at /media/FAT and at /media/EXT3, respectively.~
 $ sudo -s
 # cp 3.7.2-bone4.1.uImage /media/FAT/uImage
 # tar xvfz 3.7.2-bone4.1-modules.tar.gz -C /media/EXT3
This is the end of updating to 3.7.2 kernel, which is downloaded from RobertCNelson repository.~




*** kernel.org  [#g517e364]
>
The default kernel of arago project consists of 3.3.7 stable kernel, gpio, and uart. The modifications are done to only gpio and uart, which are altered for DVI output and multiplexer, respectively, and no other modifications are done to the default kernel. The modifications, which are needed for working with bc10 as well as beagleboard, are already included in mainline kernel of 3.3.7.~
~
This part explains how to update the kernel, which is distributed from stable branch of kernel.org, in stead of RobertCNelson repository.~
~
First, obtain the newest kernel at the stable branch of kernel.org.~
<Code and Command>
 $ cd ~/
 $ wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.2.tar.bz2
 $ tar xvfj linux-3.7.2.tar.bz2
Set PATH to Toolchain of ti-sdk-beagleboard-05.05.01.00~
<Code and Command>
 $ export PATH={HOME}/ti-sdk-beagleboard-05.05.01.00/linux-devkit/bin:$PATH
To make kernel config similar to default kernel of arago project, work with .config, which has been used for building 3.3.7 kernel, and execute oldconfig.~
<Code and Command>
 $ cp {HOME}/oe/arago-tmp/work/beagleboard-arago-linux-gnueabi/linux-stable-3.3.7-r115/git/.config .
 $ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- oldconfig
To configure for 3.7.2 kernel, there are the new setting entries, which do not exist in 3.3.7 kernel. The console asks whether these new entries are configured or not. To select Y, this will be included in the kernel. To chose N, it will be ignored. To select m, it will be turned to a module. As all questions are answered, the configuration for 3.7.2 kernel is completed. If there are other entries you wish to reconfigure after oldconfig is completed, please use menuconfig.~
<Code and Command>
 $ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- menuconfig 
As finishing the configuration, please start the build process.~
<Code and Command>
 $ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-
 $ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- uImage
After the build process of kernel is finished, the kernel module is provisionally installed for placing on the booting image.~
<Code and Command>
 $ mkdir tmp_install
 $ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- modules_install INSTALL_MOD_PATH=./tmp_install
As the provisional installation is completed, tmp_inatall is mounted on rootfs, and kernel moduls are stored under tmp_install.~
~
The all needed files are uImage of arch/arm/boot/uImage and files located under lib/ of temp_install/. These files are copied at the boot images of bc10-router. Please look at bc10-router/arago-project for how to create the boot images for bc10- router. Assume that fat partition and ext3 partition are mounted at /media/FAT and at /media/EXT3, respectively.~
<Code and Command>
This is the end of updating process, which is using 3.7.2 kernel of kernel.org.
 $ sudo -s
 # cp arch/arm/boot/uImage /media/FAT/uImage
 # cd tmp_install
 # cp -a lib/ /media/EXT3/
 This is the end of updating process, which is using 3.7.2 kernel of kernel.org.




** Wi-Fi throughput [#s3a232a3]
>
There is a comparison of throughput between the default version of 3.3.7 kernel and the updated 3.7.2 kernel obtained from Robert Nelson repository. This tests how the differences of two kernels effect on level of throughput.~
~
bc10-router is booted with the router mode, and level of throughput is measured between a Wi-Fi access point and a Wi-Fi client. The Wi-Fi access point is bc10-router LAN side interface, and the Wi-Fi client is a netbook. To measure the level of throughput, nuttcp is used.
bc10-router is booted with the router mode, and level of throughput is measured between a Wi-Fi access point and a Wi-Fi client. The Wi-Fi access point is bc10-router LAN side interface, and the Wi-Fi client is a netbook. To measure the level of throughput, nuttcp is used.~




*** Between bc10-router wlan0 and PC [#s0dc08a9]
>
nuttcp~
Measured by nuttcp~
WAN side: bc10-router nuttcp -S~
LAN side: PC nuttcp 192.168.30.1~
~

>
- 3.3.7~
>
kernel version (Detail)~
<Code and Command>
 # uname -a
 Linux bc10-router 3.3.7 #1 Mon Nov 26 22:45:08 JST 2012 armv7l unknown
BogoMIPS~
<Code and Command>
 # cat /proc/cpuinfo | grep BogoMIPS
 BogoMIPS        : 581.89
~
Throughput (Average of 10 measurements)~
<Table>
~
|n     |      1|      2|      3|      4|      5|      6|      7|      8|      9|     10|   Avg.|h
|Mbps   |50.7863|55.0793|53.6637|54.0530|52.7941|55.5915|54.8066|55.8982|54.8012|56.3797|54.3853|
|%TX    |6      |6      |7      |7      |6      |7      |6      |7      |7      |7      |7      |
|%RX    |23     |25     |24     |24     |24     |25     |25     |25     |25     |25     |25     |
|retrans|0      |0      |0      |0      |0      |0      |0      |0      |0      |0      |0      |
|msRTT  |1.27   |1.62   |1.49   |1.40   |1.33   |1.35   |1.44   |1.40   |1.64   |1.92   |1.49   |

>
- 3.7.2~
>
kernel version (Detail)~
<Code and Command>
 # uname -a
 Linux bc10-router 3.7.2-bone4.1 #3 Wed Jan 16 14:35:07 JST 2013 armv7l unknown
BogoMIPS~
<Code and Command>
 # cat /proc/cpuinfo | grep BogoMIPS
 BogoMIPS        : 388.12
~
Throughput (Average of 10 measurements)~
<Table>
~
|n     |      1|      2|      3|      4|      5|      6|      7|      8|      9|     10|   Avg.|h
|Mbps   |36.3708|37.5193|37.8842|37.2199|37.4805|37.3811|34.5526|36.7064|38.0515|38.5973|37.1764|
|%TX    |4      |4      |8      |8      |8      |8      |7      |8      |8      |8      |7      |
|%RX    |25     |27     |28     |27     |26     |27     |25     |27     |26     |26     |26     |
|retrans|0      |0      |0      |0      |0      |0      |0      |0      |0      |0      |0      |
|msRTT  |1.81   |1.92   |1.71   |1.73   |1.84   |2.08   |1.55   |1.96   |2.92   |4.16   |2.17   |

>
Comparing the averages between two settings, the update of kernel does not guarantee the improvement on the network performance. Updating from 3.3.7 kernel from the newer stable 3.7.2 kernel, network performance is not improved.~
~
Since 3.7 kernel, the kernel for ARM architecture is also adapted to Device Tree. The source code of kernel is organized and standardized, and it widely supports different types of ARM architecture by the single type of kernel. On the other hand, due to the emphasize on the standardization and wide supports of hardware, the process of the optimization for a specific hardware and/or architecture such as a specific SoC gets behind. This could be a reason why the performance of newer kernel lags behind the older kernel.~
~
To seek the performance, better off to use arago-project's default 3.3.7 kernel. To keep up with newer linux kernel on ARM architecture and to enjoy new features, recommend to update the kernel to newer version rather than using  arago-project's default 3.3.7 kernel.

* Revision History [#pd9ad093]
~
-2013-07-29 This article is initially uploaded.~



Front page   New List of pages Search Recent changes   RSS of recent changes