Project

General

Profile

ARM9 Linux Kernel

git://support.criticallink.com/home/git/linux-davinci.git

The most recent linux kernel port supported for the ARM based MityCPU platforms (MityDSP-L138, and MitySOM-1808) is derived from the mainline linux kernel at git.kernel.org.

Some patches to the kernel in the development branches may be derived from the Arago Project repositories maintained by Texas Instrument's developers. TI developers are also supporting the ARM-9 based processor drivers for this project. Patches included from the Arago Project are in general queued by TI to the mainline and are usually pending approval by the time we might include them here.

Note: The latest MityDSP-L138 BSP supports version 3.2 of the linux kernel with the last release of TI's DSPLINK and DSP/BIOS (version 5) software for the 6748 core. In Mid 2013, TI released a BIOS/Linux MultiCore SDK for the OMAP-L138 which replaced their earlier DVSDK. The MultiCore SDK is similar to the DVSDK except that it advances DSPLINK to SYSLINK and DSPBIOS to SYSBIOS. Currently Critical Link's BSP includes DSPLINK/DSPBIOS, which has been tested and used on several customer platforms currently fielded. Critical Link has not yet advanced/released the BSP provided with the MityDSP-L138 SOMs to support the SYSLINK/SYSBIOS libraries. However, customers have reported successful integration of the 3.2 kernel provided by CL with the MultiCore SDK. If you require the MultiCore SDK, please contact Critical Link.

The following branches are included in the repository at support.criticallink.com:

Summary of Changes from Mainline (by Branch)

  • mitydsp-linux-v3.2 Notes- This is the current released kernel branch with patches to support the MityDSP-L138 SOM.
  • mitydsp-linux-v3.X - UNDER DEVELOPMENT, EXPERIMENTAL These branches represent linux ports for a given revision of the linux mainline kernel. Support for the MityDSP-L138 family of SOMs may be periodically advanced to more recent versions of the kernel in order to support new devices/features as well as pick up patches, etc., for the platform. Note these branches are not fully functional. There will likely be one or more peripherals that don't have working drivers.
  • master - This is a legacy branch based on a merged TI 2.6.34 kernel. It represents tested code ready for initial releases of our baseline board support package (currently 2.6.34).
  • v2.6.33-rt - this branch represents the TI 2.6.33 kernel with Real Time Extensions that has been patched to support the MityDSP-L138 and MityARM-1808 SOM. This kernel should work the TI provided PSP, with the exception that the console needs to be at ttyS1.
  1. Add support for mityomapl138 machine SOM.
  2. Add support for parsing configuration data passed from local u-Boot for dynamic peripheral / pin-mux configuration.
  3. Short term driver patches as developed at the Arago Project waiting for inclusion into the mainline.
  4. Add support for various baseboards including the Industrial I/O development kit board.
  5. version 3.2 - include support for AUFS

Building the Kernel

NOTE: For the ubuntu 10.04 MDK VM: http://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release?rq=1

You will need to download a copy of the kernel source. In order to get a copy of the kernel source, you must have the git tool installed. Under a debian or Ubuntu system, git can be installed via

user@desktop->sudo apt-get install git-core

You also need to install a couple of additional packages and run a couple of additional steps. This can be done on a ubuntu or debian system with

user@desktop->sudo apt-get install build-essential u-boot-tools
For Ubuntu 10.04 LTS (32 or 64-Bit), the u-boot-tools package is no longer available. However the mkimage tool can be built via u-boot.
  • Run u-boot build Build u-boot
  • sudo cp u-boot-mitydspl138/tools/mkimage /usr/bin/

The kernel source tree can then be checked out. It is recommended that you check out the current branch used for the BSP (linux-mitydsp-v3.2).

user@desktop->git clone git://support.criticallink.com/home/git/linux-davinci.git
user@desktop->cd linux-davinci
user@desktop->git checkout -b mitydsp-linux-v3.2 origin/mitydsp-linux-v3.2

For MDK from or newer than August 2017 (Yocto-based)

In order to build the kernel, you need to have first installed a valid version of the Yocto based GCC Toolchain. Go to the files section then download and install the latest MDK.

Next, run the following commands to prepare for configuring and building the kernel.

user@desktop->source /opt/criticallink/mityomapl138_20170818/environment-setup-arm926ejste-criticallink-linux-gnueabi
user@desktop->unset LDFLAGS
user@desktop->alias makearm="make ARCH=arm -j$(nproc) CROSS_COMPILE=arm-criticallink-linux-gnueabi-" 

Skip to "For all MDK versions" section.

For angstrom MDK older than August 2017

In order to build the kernel, you need to have first installed the latest version of the angstrom GCC Toolchain.

Next, run the following commands to prepare for configuring and building the kernel.

user@desktop->source /usr/local/oecore-i686/environment-setup-armv5te-angstrom-linux-gnueabi
user@desktop->alias makearm="make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi-" 

Note: older versions of the toolchain setup path were located at "/usr/local/angstrom/arm/environment-setup", however the most recent MDK's were built using the updated toolchain which is setup from the path mentioned above.

For all MDK versions

user@desktop->makearm industrialio_defconfig
user@desktop->makearm menuconfig

The result of these steps is the generation of the file ".config" in the linux-davinci directory. This .config file defines the configuration of the kernel, and it can be saved with your project files so that you can regenerate a kernel without having to run the above make commands -- simply copy the .config from your project directory to the linux-davinci directory and make your image.

It is also possible to reconstruct your .config from a currently built linux kernel. This can be done on the running kernel (on the MityDSP-L138 SOM) by zcatting the file /proc/config.gz. The resulting output can be directed to a file to generate the .config that was used to build the kernel. E.g., "zcat /proc/config.gz > /tmp/config".

Once you have your configuration set up they way you need it for your build, you can then build the kernel as well as the u-Boot compatible compressed image needed for booting.

user@desktop->makearm uImage

If your configuration requires kernel modules, you will also need to rebuild them as well as install them. Please ensure to set your INSTALL_MOD_PATH correctly, and don't run this command as root, as running the command with a default INSTALL_MOD_PATH will install to your build machine modules area (this could be very bad).

user@desktop->makearm INSTALL_MOD_PATH=../rootfs modules
user@desktop->makearm INSTALL_MOD_PATH=../rootfs modules_install

Installing the Kernel on SPI - FLASH

u-Boot

Factory configured MityDSP-L138 and MityARM-1808 SOMs are configured to load the kernel out of onboard SPI-NOR FLASH at offset 0x100000 having a maximum size of 0x280000 bytes. If you want to load your kernel into RAM and execute it (for testing purposes), from u-Boot you can override the loading of the flashed kernel by the following:

u-Boot> tftp 0xC0700000 192.168.0.23:/uImage
u-Boot> bootm 0xC0700000

Note that you need to load the kernel image that has been prepared for u-Boot, located in arch/arm/boot/uImage of your kernel build directory.

You can also NFS load the kernel image if you are NFS mounting the root file system. See Linux Root File System for details.

If you want to permanently flash the kernel image to SPI FLASH:

u-Boot> tftp 0xC0700000 192.168.0.23:/uImage
u-Boot> sf probe 0
u-Boot> sf erase 0x100000 0x300000
u-Boot> sf write 0xC0700000 0x100000 ${filesize}

Note: If your kernel size is larger than 0x300000, then you will of course need to change the erase size above as well as the bootcmd environment string (which is used to load the kernel from the SPI FLASH on startup, if this is your preferred approach).

You will then need to change your bootcmd to load the kernel from SPI FLASH by:

u-Boot> set bootcmd "sf probe 0; sf read 0xc0700000 0x100000 0x300000;bootm 0xc0700000" 
u-Boot> saveenv

Linux User Space

To flash the Kernel to SPI-NOR Flash from Linux user space, the use of the flashcp utility is needed.

The flashcp utility is apart of the mtd-utils package. The mtd-utils package can be found below and also depends on liblzo2-2.
mtd-utils
liblzo2-2

These packages can be installed by executing the following commands:

opkg install liblzo2-2_2.06-r1_armv5te.ipk
opkg install mtd-utils_1.4.9-r1_armv5te.ipk

To verify the Kernel SPI_NOR Flash MTD device, execute the following:

cat /proc/mtd
mtd0: 08000000 00020000 "rootfs" 
mtd1: 08000000 00020000 "homefs" 
mtd2: 00010000 00010000 "ubl" 
mtd3: 00080000 00010000 "u-boot" 
mtd4: 00010000 00010000 "u-boot-env" 
mtd5: 00010000 00010000 "periph-config" 
mtd6: 00050000 00010000 "reserved" 
mtd7: 00300000 00010000 "kernel" 
mtd8: 00200000 00010000 "fpga" 
mtd9: 00200000 00010000 "spare" 

The Kernel can then be flashed by using flashcp with the following command:

flashcp -v uImage /dev/mtd7

Installing the Kernel on MMC

It is also possible to load the kernel from an MMC card. This is convenient if MMC is used to distribute software upgrades to your unit. See the MMC section on the Linux_Root_File_System page for details.

Baseboard Configuration Files

The MityDSP-L138 can be configured in a multitude of ways (i.e. with different pin mux or device settings). In order to easily and quickly switch between a multitude of configurations Critical Link uses Baseboard Configuration Files. The files themselves are located in the kernel at linux-davinci/arch/arm/mach-davinci/

Creating a new Baseboard Configuration File

  1. Change directory to linux-davinci/arch/arm/mach-davinci/
  2. Create your baseboard file and name it 'baseboard-yourprojectname.c'
    • You may want to copy baseboard-industrialio.c as an example.
  3. Edit Makefile and add a line for your baseboard.
    • i.e. Here is the line added for the baseboard-industrialio.c:
      obj-$(CONFIG_BASEBOARD_INDUSTRIALIO)    += baseboard-industrialio.o
      
  4. Edit Kconfig and add a line for your baseboard.
    • Search for 'BASEBOARD_INDUSTRIALIO' and in that area add an entry for your baseboard. As an example, the baseboard-industrialio.c entry is as follows:
              config BASEBOARD_INDUSTRIALIO
              bool "Critical Link Industrial I/O Baseboard" 
              help
                Select this option for the Critical Link Industrial I/O Baseboard
      

Selecting a Baseboard Configuration File

  1. Run menuconfig:
    mitydspl138@mitydspl138-desktop:~/projects/linux-davinci$ makearm menuconfig
    
  2. Select 'System Type --->'
  3. Select 'TI DaVinci Implementation --->'
  4. Select 'Select baseboard () ---->'
  5. Select the desired baseboard from the list.
  6. Exit menuconfig and save changes.
  7. Finish recompiling the kernel.
  8. Copy your modified .config to arch/arm/configs/yourprojectname_defconfig so it can be selected by makearm yourprojectname_defconfig

Go to top
Add picture from clipboard (Maximum size: 1 GB)