RPMsg Kernel Sources

From OMAPpedia

Revision as of 23:17, 10 December 2011 by S-anna (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page gives all the information about the RPMsg kernel source code trees, and supporting hardware.

Contents

[edit] Prerequisites

Here is a list of what you need to be able to work on RPMsg:


[edit] Repositories

The RPMsg code is included in the following kernel trees. Each of the following trees may be geared towards different needs and may require different levels of integration. Majority of the code should be present in almost all the trees, with minor features varying between one tree and another depending on the board you want to use, and the product distribution with corresponding product features.

[edit] Product/Integration Trees

[edit] TI Public Trees

[edit] Google Public Trees

Clone: git clone https://android.googlesource.com/kernel/omap.git

[edit] Feature Trees

RPMsg Feature trees serve only to keep track of specific rpmsg topic branches. Used only for development testing and easy integration into other product branches Currently, there is no up-to-date feature tree hosted anywhere (will be hosted soon). Please use one of the above product integration trees.

[edit] Open Source Trees

Please look up the RPMsg Open Source page (coming soon) for details on the upstream version.


[edit] Source Files

The following are the typical directories and files associated with or used by RPMsg in a kernel. Some of the files/modules may not be present in all the trees. This list only highlights the files specific to OMAP.


[edit] Build Instructions

[edit] Compiler

Please pick a compiler depending on your environment - Android or Ubuntu

[edit] Android

Add this compiler directory to PATH.

 export PATH=/<Pastry Root>/prebuilt/linux-x86/toolchain/<toolchain_folder>/bin:$PATH
 export ARCH=arm
 export CROSS_COMPILE=arm-eabi-
 alias amake='make ARCH=arm CROSS_COMPILE=arm-eabi- '

[edit] Ubuntu

 wget -c https://sourcery.mentor.com/sgpp/lite/arm/portal/package6488/public/arm-none-linux-gnueabi/arm-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
 mkdir -p ${HOME}/opt
 tar -C ${HOME}/opt -jxf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
 export PATH=/<toolchain_folder>/bin:$PATH
 export ARCH=arm
 export CROSS_COMPILE=arm-none-linux-gnueabi-

[edit] Board Configs

Please use the appropriate board config based on the branch you are working with. Typical one used is blaze_defconfig with p-android-omap-3.0 branch. Below steps assume that ARCH and CROSS_COMPILE are either exported or specified in an alias.

If using compiler provided with Android,

amake blaze_defconfig

If using standard GCC compiler,

make blaze_defconfig

The defconfigs should already have the rpmsg and tiler options selected, but it doesn't hurt to make sure.

[edit] Build

All the following instructions are illustrated using the 'make' command. If Android Compiler is preferred, replace 'make' in below steps with the 'amake' alias.

[edit] Kernel Built-In

In menuconfig:

make menuconfig

Make sure that the following options are set. Look in Build Customization section for customizing your build.

System Type  ---> 
   TI OMAP Common Features  ---> 
      <*> OMAP Virtio-based remote processor messaging support
         [*] OMAP RPMSG Recovery 
      -*- Mailbox framework support
      (256) Mailbox kfifo default buffer size (bytes)
      -*- IOMMU support for OMAP devices
      [ ]   Export OMAP IOMMU internals in DebugFS
      (0x0) Physical carveout memory pool size (Byte)
Device Drivers  --->      
   <*> Multimedia support  --->
      <*>   TI TILER support  --->
Device Drivers  --->      
   <*> Generic Hardware Spinlock framework
      <*>   OMAP Hardware Spinlock device
   [*] Autosuspend support for remoteproc
   [*] OMAP remoteproc support
      <*> Remote Processor Resources
   [*] OMAP remoteproc watchdog timer
   <*> Virtio-based remote processor messaging bus
      <*>   rpmsg OMX driver
      <*>   rpmsg resource manager
      <M>   An rpmsg client sample
      <M>   An rpmsg server sample

To have RPMsg built-in to the kernel, simply use

make uImage

[edit] Kernel Modules

[edit] Build modules

RPMsg is composed of different modules, and instead of building them into the kernel, they can be built as modules and installed/uninstalled after the Linux kernel has booted. The following assumes that TILER support is built-in into the kernel.

Make these selections:

System Type  ---> 
   TI OMAP Common Features  ---> 
      <M> OMAP Virtio-based remote processor messaging support 
         [*] OMAP RPMSG Recovery 
      -*- Mailbox framework support
      (256) Mailbox kfifo default buffer size (bytes)
      -*- IOMMU support for OMAP devices
      [ ]   Export OMAP IOMMU internals in DebugFS
      (0x0) Physical carveout memory pool size (Byte)
Device Drivers  --->      
   <*> Multimedia support  --->
      <*>   TI TILER support  --->
   <*> Generic Hardware Spinlock framework
      <*>   OMAP Hardware Spinlock device
   [*] Autosuspend support for remoteproc
   [*] OMAP remoteproc support
      <*> Remote Processor Resources
   [*] OMAP remoteproc watchdog timer
   <M> Virtio-based remote processor messaging bus
      <M>   rpmsg OMX driver
      <M>   rpmsg resource manager
      <M>   An rpmsg client sample
      <M>   An rpmsg server sample

To build modules, just use

amake modules or make modules

The following modules would be generated typically

arch/arm/plat-omap/omap_rpmsg.ko
drivers/rpmsg/rpmsg_client_sample.ko
drivers/rpmsg/rpmsg_omx.ko
drivers/rpmsg/rpmsg_resmgr.ko
drivers/rpmsg/rpmsg_server_sample.ko
drivers/rpmsg/virtio_rpmsg_bus.ko
drivers/virtio/virtio.ko
drivers/virtio/virtio_ring.ko

[edit] Copy modules into FS

These modules can be installed either using insmod or modprobe. If using insmod, copy the relevant .ko's into an appropriate folder. If using modprobe, you can use the following to copy into your file system.

amake modules_install INSTALL_MOD_PATH=<root file system directory>

[edit] Install/Uninstall modules

To install the modules,

depmod -a
modprobe virtio_rpmsg_bus
modprobe omap_rpmsg
modprobe rpmsg_omx
modprobe rpmsg_resmgr

To uninstall the modules,

modprobe -r virtio_rpmsg_bus
modprobe -r omap_rpmsg
modprobe -r rpmsg_omx
modprobe -r rpmsg_resmgr

If you are using insmod, you would have to insmod virtio.ko and virtio_ring.ko as well.

[edit] Generic Kernel Build Customizations

[edit] Enable NFS Boot

Make sure the following are selected in your menuconfig to enable NFS boot

    Device Drivers  --->
      -> Network Device Support  --->
          -> [*] Ethernet (10 or 100Mbit)  --->
              -> <*> Micrel KS8851 SPI
      -> Generic Driver Options  --->
          -> [*] Maintain a devtmpfs filesystem to mount at /dev
          -> [*]   Automount devtmpfs at /dev, after the kernel mounted the rootfs
      -> SPI support  --->
          -> <*> McSPI driver for OMAP
[*] Networking support  --->
      -> Networking options  --->
          -> [*] TCP/IP networking
             -> [*] IP: kernel level autoconfiguration 
             -> [*] IP: DHCP Support
    File Systems  --->
      -> [*] Network File Systems  --->
          -> <*> NFS Client Support
                [*] NFS Client Support for NFS version 3
                [*]      NFS Client Support for the NFSv3 ACL protocol extension
          -> [*] Root File System on NFS

[edit] Enable DebugFS

Make sure the following are selected in your menuconfig to enable debugfs (CONFIG_DEBUGFS) in your kernel

Kernel hacking  --->
   [*] Debug Filesystem

[edit] Enable Dynamic printk

RPMsg modules use dynamic prints, and so you can control the level of traces. Select the dynamic debugging option (CONFIG_DYNAMIC_DEBUG) in menuconfig

Kernel hacking  --->
   [*] Enable dynamic printk() support


[edit] RPMsg Customizations

[edit] Disable Error Recovery Mechanism

RPMsg has the remote processor recovery mechanism enabled by default. This automatically kicks in whenever there is a MMU Fault or an Exception or a Watch Dog Error on the BIOS-side. To aid better debugging, it is better to turn off the recovery (CONFIG_OMAP_RPMSG_RECOVERY) in menuconfig

System Type  ---> 
   TI OMAP Common Features  ---> 
      <*> OMAP Virtio-based remote processor messaging support
         [ ] OMAP RPMSG Recovery 

[edit] Disable Remoteproc WatchDog

Turning off the remote processor recovery mechanism halts the rpmsg channels from being deleted and recreated. It does not turn off any of the error reporting. The error notifications for exception handling is sent from the BIOS-side, and cannot be controlled from the kernel. The remote processor WatchDog however can be controlled from the kernel-side and it can turned off in menuconfig.

Device Drivers  --->      
   [*] Autosuspend support for remoteproc
   [*] OMAP remoteproc support
      <*> Remote Processor Resources
   [ ] OMAP remoteproc watchdog timer

The runtime disabling of Watchdog is currently not supported. It can probably be done in a crude way (not recommended) by disabling the interrupt of the corresponding Watchdog timer.

[edit] Disable Remoteproc Hibernation/Suspend

RPMsg supports runtime power management and puts the remote processor into hibernation/suspend (saves the remote processor context and puts it in reset) after a certain amount of duration (5 sec) provided remote processor is already idled. When an exception occurs on the remote processor, the remote processor is halted, and to aid debugging, the auto hibernation needs to be disabled.

Device Drivers  --->      
   [ ] Autosuspend support for remoteproc
   [*] OMAP remoteproc support
      <*> Remote Processor Resources
   [*] OMAP remoteproc watchdog timer

This can be configured during runtime as well. Please see the runtime ducati hibernation control section in the Debugging page.

[edit] Disable Remoteproc Core Dump

In case of a crash or an error, there is an option to dump the entire remote processor memory. This is a configurable option (CONFIG_OMAP_RPMSG_RECOVERY) , and can be chosen to be turned off (albiet, not much would be gained) in menuconfig

Device Drivers  --->      
   [*] Autosuspend support for remoteproc
   [*] OMAP remoteproc support
      <*> Remote Processor Resources
   [*] OMAP remoteproc watchdog timer
   [ ] Support for extracting a core dump from a remote processor

The behavior of this dump can be controlled dynamically at runtime. Please see the runtime ducati core dump section in the Debugging page.

[edit] Exclude RPMsg

To build a minimal kernel without RPMsg, please disable the following options in menuconfig. You can choose to disable Mailbox, IOMMU and HW Spinlock support as well if RPMsg is the only client for these kernel components.

System Type  ---> 
   TI OMAP Common Features  ---> 
      < > OMAP Virtio-based remote processor messaging support
      [*] Mailbox framework support
      (256) Mailbox kfifo default buffer size (bytes)
      [*] IOMMU support for OMAP devices
      [ ]   Export OMAP IOMMU internals in DebugFS
      (0x0) Physical carveout memory pool size (Byte)
Device Drivers  --->      
   <*> Generic Hardware Spinlock framework
      <*>   OMAP Hardware Spinlock device
   [ ] OMAP remoteproc support

RPMsg depends on TILER driver being enabled, while the converse is not true. There may be other clients for the TILER driver, and as such you can choose to disable TILER driver as well if you know that your desired configuration won't be using the TILER.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox