Difference between revisions of "Linux Kernel for CM-X270"

From Compulab Mediawiki
Jump to: navigation, search
m (See also)
Line 4: Line 4:
 
CompuLab provides ready-to-run binary kernel images, and source code of the modifications and additions made to the Linux kernel to work properly on CM-X270 modules.
 
CompuLab provides ready-to-run binary kernel images, and source code of the modifications and additions made to the Linux kernel to work properly on CM-X270 modules.
  
== Changelog ==
+
== Building Linux kernel for CM-X270 ==
 +
 
 +
Instructions for building Linux kernel for CM-X270 can be found [[Linux_Development_for_XScale_modules#Building the Linux kernel for CM-X270 | here]].
 +
 
 +
== CM-X270 specific additions and changes to Linux kernel 2.6.16 ==
 +
 
 +
=== Basic Platform Support ===
 +
 
 +
The CM-X270 platform basic support is implemented in the {{filename|linux/arch/arm/mach-pxa/cm-x270.c}}. This file includes registration of the devices integrated in the PXA270 SoC, definitions of platform-specific configuration of these devices, platfrom-specific power management code and static mapping for memory mapped IO. This file also includes several routines needed for proper operation of the PCI bridge.
 +
 
 +
=== PCI support ===
 +
 
 +
The board support for CM-X270 introduces driver for ITE 8152 companion chip and platform specific drivers for proper initialization of ITE 8152 on the CM-X270. The bridge driver implementation resides in {{filename|linux/arch/arm/mach-pxa/it8152.[ch]}}, parts of the CM-X270 specific initialization code are in {{filename|linux/arch/arm/mach-pxa/cm-x270-pci.c}}. There are also changes in {{filename|linux/arch/arm/kernel/bios32.c}} that are needed to use the ITE 8152 PCI bridge.
 +
 
 +
==== PCI Ethernet Cards ====
 +
 
 +
The CompuLab stock kernel does not include built-in support for PCI Ethernet cards. A driver for popular RealTek 8139 card is available as loadable kernel module in [http://www.compulab.co.il/x270cm/download/x270-linux-img.zip Debian Linux for CM-X270] package. The module is called {{parameter|8139too}} and can be enabled using
 +
 
 +
<pre>
 +
modprobe 8139too
 +
</pre>
 +
 
 +
=== Sound and Touchsreen ===
 +
 
 +
UCB1400 AC97 codec with inetgrated touchscreen has several registers, that are not present in AC97 standard. We added initialization of some of these registers and exposure of these registers to user space. This change can be found in {{filename|linux/sound/pci/ac97/ac97_patch.[ch]}}
 +
 
 +
The touchscreen controller driver for UCB1400 is taken from patch [http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3075/2 3075/2] in the [http://www.arm.linux.org.uk/developer/patches/ ARM Linux patch system] and slightly modified to suit CM-X270 hardware configuration.
 +
 
 +
Both audio and touchscreen drivers are modularized if you use default CM-X270 configuration. The following commands enable audio support and touchscreen support respectively:
 +
 
 +
<pre>
 +
modprobe snd-pxa2xx-ac97
 +
modprobe ucb1x00-ts
 +
</pre>
 +
 
 +
Note, that enabling touchscreen driver without AC97 controller driver is meaningless, since {{parameter|ucb1x00-ts}} driver uses AC97 bus to access the touchscreen device.
 +
 
 +
More information about Linux audio subsystem can be found at [http://www.alsa-project.org http://www.alsa-project.org]
 +
 
 +
==== AC'97 and PCI interaction ====
 +
 
 +
{{note|
 +
The following note is relevant only for cards with 'B' option and without 'A' or 'AT' options.
 +
}}
 +
 
 +
CM-X270 contains local bus arbitration logic needed to arbiter bus accesses between the CPU and PCI bridge. This arbitration logic and AC97 controller share the same input clock. Linux AC97 driver tests whether  there's an audio codec attached to the AC97 bus. If the driver does not find a codec, it disables PXA270 AC97 controller, and its clock altogether. Disabling this clock, in turn, disables the local bus arbitration, and makes PCI bridge useless.
 +
 
 +
To avoid such unpleasant situation we'd recommend not to enable sound drivers, unless you need them.
 +
 
 +
=== NAND flash ===
  
=== Linux kernel 2.6.16 ===
+
CompuLab provides proprietary driver for on-board NAND flash. This driver emulates block device and provides wear-leveling for the flash. The driver uses the same NAND flash layout as the ARMMon bootloader.
  
* '''26-Dec-07'''
+
Starting at kernel release at October 12, 2006, we also included MTD driver for CM-X270. More information about using MTD on CM-X270 can be found at [[Linux MTD drivers on CM-X270]] page.
: Certain NAND flashes are sensitive to local bus activity. NAND flash driver updated to overcome this limitation.
 
  
* '''13-Jun-07'''
+
Recently we discovered that certain NAND flash chips are not tolerant to '''any''' activity on local bus during flash accesses. To overcome this limitation we added an option to NAND flash drivers that allows to ensure there is no bus activity at the time NAND flash is active. This option can be switched on and of with {{parameter|block_irqs}} parameter of the NAND flash driver.
: Fixed RTC access routines.
 
  
* '''06-Feb-06'''
+
=== I2C and SPI ===
: Added pcibios_set_master for ARM platforms with ITE8152 bridge. This allows proper setting of latency timer for PCI bus masters behind the bridge.
 
  
* '''12-Oct-06'''
+
Standard I2C and SPI drivers can be used to access these buses on CM-X270. The I2C drivers are present in Linux kernel 2.6.16, and can be easily enabled using Linux kernel configuration.
: Added ability to specify wireless access point MAC address
 
: Added MMC support
 
: Serial tty assignment made compatible for CM-X270L and CM-X270W. From now, ttySA0 is default console on both CM-X270L and CM-X270W.
 
: Fixed wireless LAN driver bug that caused incorrect transmission power setting
 
  
* '''15-Aug-06'''
+
As for the SPI drivers, they should be backported to Linux kernel 2.6.16 from 2.6.17 or more recent kernel version.
: Added BGW200 Wireless LAN support
 
  
* '''15-May-06'''
+
=== USB device ===
: Initial release of Linux 2.6.16:
 
: - Power management support
 
: - Added CardBus support
 
: - Added 2700G frame buffer device driver
 
: - Audio support upgraded to work with ALSA, added recording support
 
  
=== Linux kernel 2.6.12 ===
+
USB device controller drivers for PXA270 are not available in mainline kernels, and this is the main reason we do not support USB device functionality on CM-X270. Yet, there several patches available at [http://www.rpsys.net/openzaurus/patches/ http://www.rpsys.net/openzaurus/patches/], [http://handhelds.org/cgi-bin/cvsweb.cgi/linux/kernel26/drivers/usb/gadget/ Handhelds.org], [http://raph.people.8d.com/armcore_kernel.php Raphael Assenat site] dedicated to Linux on CompuLab boards, and probably others. We never tried these patches, and we don't know which of them will work on CM-X270.
  
* '''16-Mar-06'''
+
== Using Linux kernel 2.6.24 on CM-X270 ==
: Improved flash driver: better reliability, write performance and load distribution during writes
 
  
* '''27-Feb-06'''
+
The CM-X270 platform support was merged into mainline kernel starting from version 2.6.24. There are still some features that present in 2.6.16 support for CM-X270 and that are not merged upstream. Most notable are CompuLab proprietary NAND flash driver, and differences in serial port mappings.  
: Updated LCD controller support to match CM-X270W rev 1.2
 
: Fixed LCD timings for 800x600 in 2.6.12.2
 
: Added support for IDE and CardBus on SB-X270
 
: CL_FlashDrv.o renamed to CL_FlashDrv
 
  
* '''03-Jan-2005'''
+
We are currently working on release of board support package for Linux kernel 2.6.24, but before the release is ready you can use the mainline kernel "as is". The on-board NAND flash can be accessed using [[Linux MTD drivers for CM-X270|MTD drivers]], and the below table summarizes differences in serial port mappings on CM-X270L and CM-X270W:
: Changed toolchain recommendation, and updated usage instructions accordingly
 
  
* '''14-Nov-2005'''
 
: Initial revision: 2.6.12.2 kernel release for CM-X270
 
  
== Building Linux kernel for CM-X270 ==
+
{| border="2"
 +
|+ Serial ports mapping on CM-X270'''L'''
 +
! UART        || SB-X270 port name || Linux tty in 2.6.16 || Linux tty in 2.6.24
 +
|-
 +
| BTUART      || COM-A            || ttySA0              || ttyS1
 +
|-
 +
| FFUART      || COM-B            || ttySA1              || ttyS0
 +
|-
 +
| STUART      || COM-D            || ttySA2              || ttyS2
 +
|-
 +
| ITE8152 UART || COM-B            || ttyS0              || not present
 +
|}
 +
 
  
Instructions for building Linux kernel for CM-X270 can be found [[Linux_Development_for_XScale_modules#Building_the_Linux_kernel_for_XScale_modules | here]].
+
{| border="2"
 +
|+ Serial ports mapping on CM-X270'''W'''
 +
! UART        || SB-X270 port name || Linux tty in 2.6.16 || Linux tty in 2.6.24
 +
|-
 +
| FFUART      || COM-A            || ttySA0              || ttyS0
 +
|-
 +
| BTUART      || COM-D            || ttySA1              || ttyS1
 +
|-
 +
| STUART      || COM-C            || ttySA2              || ttyS2
 +
|-
 +
| ITE8152 UART || COM-B            || ttyS0              || not present
 +
|}
  
 
== See also ==
 
== See also ==

Revision as of 09:14, 11 March 2008

Overview

Linux kernel for CM-X270 modules provides support for on-board peripherals. Current support coverage is specified at O/S support coverage map page. CompuLab provides ready-to-run binary kernel images, and source code of the modifications and additions made to the Linux kernel to work properly on CM-X270 modules.

Building Linux kernel for CM-X270

Instructions for building Linux kernel for CM-X270 can be found here.

CM-X270 specific additions and changes to Linux kernel 2.6.16

Basic Platform Support

The CM-X270 platform basic support is implemented in the linux/arch/arm/mach-pxa/cm-x270.c. This file includes registration of the devices integrated in the PXA270 SoC, definitions of platform-specific configuration of these devices, platfrom-specific power management code and static mapping for memory mapped IO. This file also includes several routines needed for proper operation of the PCI bridge.

PCI support

The board support for CM-X270 introduces driver for ITE 8152 companion chip and platform specific drivers for proper initialization of ITE 8152 on the CM-X270. The bridge driver implementation resides in linux/arch/arm/mach-pxa/it8152.[ch], parts of the CM-X270 specific initialization code are in linux/arch/arm/mach-pxa/cm-x270-pci.c. There are also changes in linux/arch/arm/kernel/bios32.c that are needed to use the ITE 8152 PCI bridge.

PCI Ethernet Cards

The CompuLab stock kernel does not include built-in support for PCI Ethernet cards. A driver for popular RealTek 8139 card is available as loadable kernel module in Debian Linux for CM-X270 package. The module is called 8139too and can be enabled using

modprobe 8139too

Sound and Touchsreen

UCB1400 AC97 codec with inetgrated touchscreen has several registers, that are not present in AC97 standard. We added initialization of some of these registers and exposure of these registers to user space. This change can be found in linux/sound/pci/ac97/ac97_patch.[ch]

The touchscreen controller driver for UCB1400 is taken from patch 3075/2 in the ARM Linux patch system and slightly modified to suit CM-X270 hardware configuration.

Both audio and touchscreen drivers are modularized if you use default CM-X270 configuration. The following commands enable audio support and touchscreen support respectively:

modprobe snd-pxa2xx-ac97
modprobe ucb1x00-ts

Note, that enabling touchscreen driver without AC97 controller driver is meaningless, since ucb1x00-ts driver uses AC97 bus to access the touchscreen device.

More information about Linux audio subsystem can be found at http://www.alsa-project.org

AC'97 and PCI interaction

Admolition note.png

The following note is relevant only for cards with 'B' option and without 'A' or 'AT' options.

CM-X270 contains local bus arbitration logic needed to arbiter bus accesses between the CPU and PCI bridge. This arbitration logic and AC97 controller share the same input clock. Linux AC97 driver tests whether there's an audio codec attached to the AC97 bus. If the driver does not find a codec, it disables PXA270 AC97 controller, and its clock altogether. Disabling this clock, in turn, disables the local bus arbitration, and makes PCI bridge useless.

To avoid such unpleasant situation we'd recommend not to enable sound drivers, unless you need them.

NAND flash

CompuLab provides proprietary driver for on-board NAND flash. This driver emulates block device and provides wear-leveling for the flash. The driver uses the same NAND flash layout as the ARMMon bootloader.

Starting at kernel release at October 12, 2006, we also included MTD driver for CM-X270. More information about using MTD on CM-X270 can be found at Linux MTD drivers on CM-X270 page.

Recently we discovered that certain NAND flash chips are not tolerant to any activity on local bus during flash accesses. To overcome this limitation we added an option to NAND flash drivers that allows to ensure there is no bus activity at the time NAND flash is active. This option can be switched on and of with block_irqs parameter of the NAND flash driver.

I2C and SPI

Standard I2C and SPI drivers can be used to access these buses on CM-X270. The I2C drivers are present in Linux kernel 2.6.16, and can be easily enabled using Linux kernel configuration.

As for the SPI drivers, they should be backported to Linux kernel 2.6.16 from 2.6.17 or more recent kernel version.

USB device

USB device controller drivers for PXA270 are not available in mainline kernels, and this is the main reason we do not support USB device functionality on CM-X270. Yet, there several patches available at http://www.rpsys.net/openzaurus/patches/, Handhelds.org, Raphael Assenat site dedicated to Linux on CompuLab boards, and probably others. We never tried these patches, and we don't know which of them will work on CM-X270.

Using Linux kernel 2.6.24 on CM-X270

The CM-X270 platform support was merged into mainline kernel starting from version 2.6.24. There are still some features that present in 2.6.16 support for CM-X270 and that are not merged upstream. Most notable are CompuLab proprietary NAND flash driver, and differences in serial port mappings.

We are currently working on release of board support package for Linux kernel 2.6.24, but before the release is ready you can use the mainline kernel "as is". The on-board NAND flash can be accessed using MTD drivers, and the below table summarizes differences in serial port mappings on CM-X270L and CM-X270W:


Serial ports mapping on CM-X270L
UART SB-X270 port name Linux tty in 2.6.16 Linux tty in 2.6.24
BTUART COM-A ttySA0 ttyS1
FFUART COM-B ttySA1 ttyS0
STUART COM-D ttySA2 ttyS2
ITE8152 UART COM-B ttyS0 not present


Serial ports mapping on CM-X270W
UART SB-X270 port name Linux tty in 2.6.16 Linux tty in 2.6.24
FFUART COM-A ttySA0 ttyS0
BTUART COM-D ttySA1 ttyS1
STUART COM-C ttySA2 ttyS2
ITE8152 UART COM-B ttyS0 not present

See also