Difference between revisions of "Linux kernel for Exeda"

From Compulab Mediawiki
Jump to: navigation, search
m (1 revision(s))
 
Line 1: Line 1:
== Overview ==
+
#REDIRECT [[Exeda: Linux: Kernel]]
 
 
Linux kernel for Exeda package provides ready-to-run binary kernel image, and source code of the modifications and additions made to the Linux kernel to work properly with Exeda. Current support coverage is specified at [http://www.compulab.co.il/exeda/html/exeda-os-support.htm O/S support coverage map] page. The binary kernel image is bundled with minimal initramfs image to ease evaluation and development process. The Exeda users are free to choose the Linux flavor that suits best their specific application requirements.
 
 
 
This page includes description of the package structure, Linux installation procedure and peripheral device options specific to Exeda.
 
 
 
== Package contents ==
 
=== images ===
 
* {{filename|uImage-2.6.30-exeda}} - Linux kernel 2.6.30 image for the Exeda
 
* {{filename|kernel.jffs2}} - Linux kernel 2.6.30 JFFS2 image for NAND flash installation
 
* {{filename|ramdisk.tar.bz2}} - archive of the ramdisk file system integrated into the kernel images
 
* {{filename|libertas}} - a directory containing firmware required for Wireless LAN operation
 
 
 
=== kernel ===
 
* {{filename|linux-2.6.30-exeda.patch}} - patch vs. [http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.bz2 Linux kernel 2.6.30] with support for the Exeda peripherals
 
* {{filename|linux-2.6.30-exeda.config}} - Linux kernel 2.6.30 configuration file
 
 
 
== Running Linux ==
 
The Linux image for the Exeda can be installed to the Exeda NAND flash or can be executed from USB flash drive and even directly from your development workstation using networked boot. Execution from USB flash drive or network keeps the existing Windows Mobile installation intact.
 
 
 
=== Preparation steps ===
 
* Connect the host PC to the Exeda via a null modem cable supplied with the Eval Kit.
 
* Start terminal emulation software on your PC using the COM port to which the null modem is connected. Set baud rate to 115200 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
 
* Turn on or reset the Exeda. The U-Boot will start and you will get a command prompt.
 
*: {{Note|You may need to press and hold ^C while turning the Exeda on, in order to get command prompt.
 
If you'd like to prevent U-boot from starting an operating system automatically, use the following commands:
 
<pre>
 
> setenv boot_mode uboot
 
> saveenv
 
</pre>
 
}}
 
 
 
=== Running Linux from network ===
 
* Make sure that Linux kernel binary image {{filename|uImage-2.6.30-exeda}} from the [http://www.compulab.co.il/exeda/download/exeda-linux.zip Exeda Linux kernel package] is accessible by the TFTP server.
 
*: - On Windows machine: copy {{filename|uImage-2.6.30-exeda}} to the some folder and point the TFTP server to that folder.
 
*: - On Linux machine: copy {{filename|uImage-2.6.30-exeda}} to TFTP sevrver root directory, usually {{filename|/tftpboot}} or {{filename|/tftproot}}.
 
* You can use U-boot {{cmd|dhcp}} command to obtain IP address or manually set {{parameter|ipaddr}} and {{parameter|serverip}} environment variables:
 
<pre>
 
> setenv serverip <tftp server ip address>
 
> setenv ipaddr <exeda ip address>
 
> saveenv
 
</pre>
 
* After networking setup is finished, use the following U-boot commands to boot Linux on the Exeda:
 
<pre>
 
> tftp a0100000 uImage-2.6.30-exeda
 
> setenv bootargs
 
> bootm
 
</pre>
 
 
 
=== Running Linux from USB flash drive ===
 
* Copy {{filename|uImage-2.6.30-exeda}} to USB flash drive
 
* Insert the flash drive to the Exeda
 
* In the U-Boot prompt run the following commands:
 
<pre>
 
> setenv usb_mode host
 
> usb start
 
> fatload usb 0:1 a0100000 uImage-2.6.30-exeda
 
> setenv bootargs
 
> bootm a0100000
 
</pre>
 
 
 
=== Installing Linux to the Exeda NAND flash ===
 
The Linux kernel image can be installed on the Exeda NAND flash either from U-Boot command prompt or from Linux. Below is a description of U-Boot commands necessary to install the Linux kernel image to the Exeda NAND flash. Linux-based installation utilizes MTD utilities and it is similar to [[Getting_started_with_Linux_on_CM-X300|Linux installation on CM-X300]].
 
 
 
{{Warning|Installing Linux to the Exeda NAND flash will destroy preinstalled Windows Mobile image}}
 
* Start Exeda and get U-Boot command prompt
 
* Enable U-Boot NAND flash support, disable automatic Windows Mobile boot and reset the Exeda:
 
<pre>
 
> setenv nand_mode on
 
> setenv boot_mode exeda-linux
 
> saveenv
 
> reset
 
</pre>
 
<ul>
 
<li>Copy {{filename|kernel.jffs2}} image to the Exeda RAM</li>
 
<ul>
 
<li>Using TFTP
 
<pre>
 
> dhcp
 
> tftp a0100000 kernel.jffs2
 
</pre>
 
</li>
 
<li>Using USB flash drive
 
<pre>
 
> setenv usb_mode host
 
> usb start
 
> fatload usb 0:1 a0100000 kernel.jffs2
 
</pre></li></ul>
 
<li>Erase the Exeda NAND flash and copy the Linux image to the NAND:</li>
 
<pre>
 
> nand erase 0 400000
 
> nand write.jffs2 a0100000 0 3c0000
 
</pre>
 
<li>Setup the U-boot environment to automatically boot Linux:
 
<pre>
 
> setenv bootcmd "fsload a0100000 uImage; bootm a0100000"
 
> setenv bootargs
 
> saveenv
 
</pre>
 
</li>
 
</ul>
 
 
 
== Exeda specific additions and changes to Linux kernel 2.6.30 ==
 
 
 
The Exeda platform is supported by the mainline kernel. There are still some Exeda-specific features that are not present in the mainline kernel:
 
 
 
* Fixes to suspend/resume functionality
 
* Fixes to audio devices registration
 
* Updates for wireless LAN support
 
* Secondary USB port support
 
* GPS and GSM/GPRS power control support
 
* Touchpad support
 
 
 
Most of the above functionality will be available in the next release (2.6.31) of the mainline Linux kernel.
 
 
 
== Building Linux kernel for Exeda ==
 
<pre>
 
mkdir /home/development/exeda/kernel
 
cd /home/development/exeda/kernel
 
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.bz2
 
tar xjf linux-2.6.30.tar.bz2
 
cd linux-2.6.30
 
cat /path/to/exeda-linux/kernel/linux-2.6.30-exeda.patch | patch -p1
 
export ARCH=arm
 
export CROSS_COMPILE=arm-linux-
 
make em_x270_defconfig
 
make menuconfig
 
make && make uImage && \
 
    INSTALL_MOD_PATH=/home/development/exeda/rootfs make modules_install
 
</pre>
 
 
 
In the above example, the Linux kernel image ({{filename|1=uImage}}) will be created in {{filename|1=/home/development/exeda/kernel/linux-2.6.30/arch/arm/boot}}, and the loadable kernel modules will be installed into the {{filename|1=/home/development/exeda/rootfs/lib/modules}} directory.
 
 
 
Now, if you boot the Exeda with newly created kernel image and with networked root filesysem at {{filename|1=/home/development/exeda/rootfs/}} the system will be able to properly load kernel modules and you avoid modules versioning problems.
 
 
 
== Exeda specific device options ==
 
Certain on-board devices may be of particular interest for EM-X270 application developers. We provide here details of their operation in Linux for the Exeda.
 
 
 
=== GSM/GPRS modem ===
 
GSM/GPRS modem is connected to BTUART of PXA270 processor and can be accessed through {{filename|/dev/ttyS1}} device node.
 
To enable the modem you can use the following command sequence:
 
 
 
<pre>
 
echo 1 > /sys/devices/platform/reg-userspace-consumer.1/state
 
echo 132 > /sys/class/gpio/export
 
echo out > /sys/class/gpio/gpio132/direction
 
echo 0 > /sys/class/gpio/gpio132/value ; sleep 1; \
 
    echo 1 > /sys/class/gpio/gpio132/value; sleep 1; \
 
    echo 0 > /sys/class/gpio/gpio132/value; sleep 2
 
</pre>
 
 
 
=== GPS receiver ===
 
GPS reciever is connected to STUART of PXA270 processor and can be accessed through {{filename|/dev/ttyS2}} device node.
 
The GPS receiver can be enabled with the following command:
 
 
 
<pre>
 
echo 1 > /sys/devices/platform/reg-userspace-consumer.0/state
 
</pre>
 
 
 
=== Bluetooth ===
 
The Bluetooth can be  enabled with the following command sequence:
 
 
 
<pre>
 
echo 40 > /sys/class/gpio/export
 
echo out > /sys/class/gpio/gpio40/direction
 
echo 1 > /sys/class/gpio/gpio40/value
 
</pre>
 
 
 
=== USB ===
 
Current kernel release for Exeda does not support USB OTG. The USB OTG port should be configured as a host or slave port during kernel configuration and build. The default kernel configuration enables the UBS OTG port in the host mode. If you'd like to use this port as a USB slave port you'll need to reconfigure and rebuild the kernel. In the kernel configuration choose '''"Device Drivers -> USB support"''' and enable '''"USB Gadget Support"''' option.
 
 
 
<pre>
 
.config - Linux Kernel v2.6.30 Configuration
 
──────────────────────────────────────────────────────────────────────────────
 
  ┌────────────────────────────── USB support ──────────────────────────────┐
 
  │  Arrow keys navigate the menu.  <Enter> selects submenus --->.          │
 
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, │
 
  │  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> │
 
  │  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >      │
 
  │ ┌────^(-)─────────────────────────────────────────────────────────────┐ │
 
  │ │    < >  PlayStation 2 Trance Vibrator driver support              │ │
 
  │ │    < >  IO Warrior driver support                                  │ │
 
  │ │    < >  USB testing driver                                        │ │
 
  │ │    < >  iSight firmware loading support                            │ │
 
  │ │    < >  USB VST driver                                            │ │
 
  │ │    <*>  USB Gadget Support  --->                                  │ │
 
  │ │          *** OTG and related infrastructure ***                    │ │
 
  │ │    < >  GPIO based peripheral-only VBUS sensing 'transceiver'      │ │
 
  │ │    < >  NOP USB Transceiver Driver                                │ │
 
  │ └─────────────────────────────────────────────────────────────────────┘ │
 
  ├─────────────────────────────────────────────────────────────────────────┤
 
  │                    <Select>    < Exit >    < Help >                    │
 
  └─────────────────────────────────────────────────────────────────────────┘
 
</pre>
 
 
 
Then descend to the '''"USB Gadget Support"''' sub-menu, make sure that '''"USB Peripheral Controller"''' is set to '''"PXA 27x"''' and select the gadget drivers you'd like to use:
 
 
 
<pre>
 
.config - Linux Kernel v2.6.30 Configuration
 
──────────────────────────────────────────────────────────────────────────────
 
  ┌────────────────────────── USB Gadget Support ───────────────────────────┐
 
  │  Arrow keys navigate the menu.  <Enter> selects submenus --->.          │
 
  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, │
 
  │  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> │
 
  │  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >      │
 
  │ ┌─────────────────────────────────────────────────────────────────────┐ │
 
  │ │    --- USB Gadget Support                                          │ │
 
  │ │    [ ]  Debugging messages (DEVELOPMENT) (NEW)                    │ │
 
  │ │    [ ]  Debugging information files (DEVELOPMENT) (NEW)            │ │
 
  │ │    [ ]  Debugging information files in debugfs (DEVELOPMENT) (NEW) │ │
 
  │ │    (2)  Maximum VBUS Power usage (2-500 mA) (NEW)                  │ │
 
  │ │          USB Peripheral Controller (PXA 27x)  --->                  │ │
 
  │ │            PXA 27x (NEW)                                            │ │
 
  │ │    <M>  USB Gadget Drivers                                        │ │
 
  │ │    <M>    Gadget Zero (DEVELOPMENT)                                │ │
 
  │ │    <M>    Ethernet Gadget (with CDC Ethernet support)              │ │
 
  │ │    [*]      RNDIS support (NEW)                                    │ │
 
  │ │    <M>    Gadget Filesystem (EXPERIMENTAL)                        │ │
 
  │ │    < >    File-backed Storage Gadget (NEW)                        │ │
 
  │ │    < >    Serial Gadget (with CDC ACM and CDC OBEX support) (NEW)  │ │
 
  │ │    < >    MIDI Gadget (EXPERIMENTAL) (NEW)                        │ │
 
  │ │    < >    Printer Gadget (NEW)                                    │ │
 
  │ │    < >    CDC Composite Device (Ethernet and ACM) (NEW)            │ │
 
  │ └─────────────────────────────────────────────────────────────────────┘ │
 
  ├─────────────────────────────────────────────────────────────────────────┤
 
  │                    <Select>    < Exit >    < Help >                    │
 
  └─────────────────────────────────────────────────────────────────────────┘
 
</pre>
 
 
 
== Known problems and limitations ==
 
* Off-line battery charging is not implemented in the current release
 
* USB OTG is not supported in the current release. The USB OTG port can be enabled either in USB host mode or in USB device mode.
 
* Currently power consumption during suspend is above optimal.
 
* Camera is not supported in the current release
 
 
 
== See also ==
 
* [[Linux Development for XScale modules]]
 
* [http://www.denx.de/wiki/DULG/Manual The DENX U-Boot and Linux Guide]
 
* [http://wiki.openembedded.net/index.php/Main_Page OpenEmbedded]
 
* [http://www.debian.org/ports/arm/ Debian ARM port]
 

Latest revision as of 08:44, 23 December 2009