The Kernel on the GTA01 is based on a vanilla 2.6.21.3 Linux kernel from kernel.org.
Some additional patches are required for
The openmoko "version" of the kernel can be obtained using git git clone git://git.openmoko.org/git/kernel.git linux-2.6 cd linux-2.6 git checkout origin/stable According to OpenMoko git web interface you should checkout origin/andy, but according to Andy Green himself it is "normally nowadays you want to checkout origin/stable".
The web interface also contains a list of other heads (branches) available.
Before you start the build of the kernel you need to configure it.
A good place to start are the predefined configurations. defconfig-gta01 and defconfig-gta02 are some of the more interesting configurations. They are available inside the checkout of the source.
You just copy one of the configuration files into .config
To customize the configuration use make menuconfig
The kernel build is executed as normal. We actually only need the "vmlinux" target, not the "zImage".
More current information about building the kernel is currently on the Toolchain page.
Prebuilt bootable kernel images called uImage* are available from:
For full operation on the currently supported platforms you need some modules inside the rootfs. You can either get a modules* archive from the above mentioned location (with the same version number) which contains many more modules then you might need.
Alternatively you can check the following location for prepackaged modules for the kernel version and install them using ipkg:
Latest images can always be found here: http://downloads.openmoko.org/distro/releases/
On the Neo1973 the following modules should be added to support most of the hardware:
These really should be in the unmodified root image to start with. See bug 580.
You'll probably have to put these in a file in /etc/modutils/ and run update-modules to get them to work automatically.
u-boot needs all images (such as kernel, initrd, ...) in the form of an uImage. This is basically just a special header adding CRC protection, version information, etc. Please see u-boot for details.
Since the QT2410 can be used with different liquid crystal modules (LCMs), the kernel images for the QT2410 have a boot parameter "tft":
In this section we will outline a couple of the GTA01 specific kernel drivers / features / subsystems
The gta01_pm_gsm driver implements GSM power management (this means, if this is compiled as a module, you have to load the gta01_pm_gsm.ko module first)
It exports the following sysfs based interface
root@fic-gta01:/$ ls -l /sys/bus/platform/devices/gta01-pm-gsm.0/ -rw-r--r-- 1 root root 4096 Feb 1 09:58 download -rw-r--r-- 1 root root 4096 Feb 1 09:58 power_on -rw-r--r-- 1 root root 4096 Feb 1 09:58 reset
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on gta01-pm-gsm gta01-pm-gsm.0: powering up GSM, thus disconnecting serial console root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on gta01-pm-gsm gta01-pm-gsm.0: powered down GSM, thus enabling serial console
Note that powering up GSM disables the console.
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/reset root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/reset
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/download
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/download
The gta01_pm_gps kernel driver offers a sysfs based interface:
root@fic-gta01:~$ ls -l /sys/bus/platform/devices/gta01-pm-gps.0/ -rw-r--r-- 1 root root 4096 Feb 1 09:14 power_avdd_3v -rw-r--r-- 1 root root 4096 Feb 1 09:14 power_lp_io_3v3 -rw-r--r-- 1 root root 4096 Feb 1 09:14 power_pll_core_2v5 -rw-r--r-- 1 root root 0 Feb 1 09:14 power_sequence -rw-r--r-- 1 root root 4096 Feb 1 09:14 power_vtxco_2v8 -rw-r--r-- 1 root root 4096 Feb 1 09:14 pwron -rw-r--r-- 1 root root 4096 Feb 1 09:14 reset
The power_avdd_3v, power_lp_io_3v3, power_pll_core_2v5, power_vtxco_2v8, pwron and reset files represent the state of the respective signal.
The power_sequence file implements power-up/power-down sequence in accordance with the GlobalLocate data sheet.
root@fic-gta01:~$ echo "power_up" > /sys/bus/platform/devices/gta01-pm-gps.0/power_sequence
root@fic-gta01:~$ echo "power_down" > /sys/bus/platform/devices/gta01-pm-gps.0/power_sequence
The GTA01 audio subsystem is fairly complex, even though the high-level requirements for the sound driver are simple. The features we need to support
For more details see Neo1973 Audio Subsystem
We're using the stock bluez implementation of the linux kernel.
The bluetooth basically has the following preconditions
The gta01_pm_bt driver implements the following files:
root@fic-gta01:/$ ls -l /sys/bus/platform/devices/gta01-pm-bt.0 -rw-r--r-- 1 root root 4096 Feb 1 09:52 power_on -rw-r--r-- 1 root root 4096 Feb 1 09:52 reset
root@fic-gta01:/$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on usb 1-1: new full speed USB device using s3c2410-ohci and address 4 usb 1-1: configuration #1 chosen from 1 choice
root@fic-gta01:/$ echo "0" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on usb 1-1: USB disconnect, address 3
root@fic-gta01:/$ echo "0" > /sys/bus/platform/devices/gta01-pm-bt.0/reset root@fic-gta01:/$ usb 1-1: USB disconnect, address 2
root@fic-gta01:/$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/reset s3c2410-ohci s3c2410-ohci: wakeup usb 1-1: new full speed USB device using s3c2410-ohci and address 3 usb 1-1: configuration #1 chosen from 1 choice
root@fic-gta01:~$ hciconfig hci0 up root@fic-gta01:~$ hcitool scan Scanning ... 00:14:9A:77:A2:02 A780 root@fic-gta01:~$ hcitool inq 00:14:9A:77:A2:02 Inquiring ... 00:14:9A:77:A2:02 clock offset: 0x55df class: 0x502204 root@fic-gta01:~$ hcitool cc 00:14:9A:77:A2:02 root@fic-gta01:~$ hcitool con Connections: < ACL 00:14:9A:77:A2:02 handle 42 state 1 lm MASTER root@fic-gta01:~$ hcitool info 00:14:9A:77:A2:02 Requesting information ... BD Address: 00:14:9A:77:A2:02 Device Name: A780 LMP Version: 1.1 (0x1) LMP Subversion: 0x700 Manufacturer: Broadcom Corporation (15) Features: 0xff 0xff 0x0d 0x00 0x00 0x00 0x00 0x00 <3-slot packets> <5-slot packets> <encryption> <slot offset> <timing accuracy> <role switch> <hold mode> <sniff mode> <park state> <RSSI> <channel quality> <SCO link> <HV2 packets> <HV3 packets> <u-law log> <A-law log> <CVSD> <power control> <transparent SCO>
The AUX button (formerly 911 button) is supported via the "gta01kbd" driver in the kernel (drivers/input/keyboard/gta01kbd.c).
It creates an input event device that only issues "KEY_PHONE" press/unpress events.
The PMU is supported via the "pcf50606" driver in the kernel (drivers/i2c/chips/pcf50606.c).
This driver provides a number of userspace interfaces for the various bits and pieces of the PMU
The PMU creates an input device that supports the following keys:
The real-time clock, including the alarm feature, is implemented as standard RTC (/dev/rtc).
The PMU-integrated watchdog is implemented using the standard watchdog character device.
The voltage regulators are exported to userspace using sysfs, much like lm_sensors.
Every regulator can be read (and written!). The format is ASCII in millivolts.
root@fic-gta01:/sys/devices/platform/s3c2410-i2c/i2c-0/0-0008$ ls -l /sys/bus/i2c/devices/0-0008/voltage_* -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d1reg -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d2reg -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d3reg -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcd -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcde -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcud -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_lpreg -rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_ioreg root@fic-gta01:/sys/devices/platform/s3c2410-i2c/i2c-0/0-0008$ cat voltage_dcd 1300
The battery voltage (in millivolts) can be read via sysfs
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/battvolt 3767
The battery charging current (in milliamperes) can be read via sysfs
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/chgcur 0
The battery temperature (in centigrades) can be read via sysfs
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/battemp 25
We provide a driver that supports the linux kernel standard backlight API. You can find the respective sysfs files in /sys/class/backlight/
The vibrator driver is implemented as a LED driver. You can find the respective sysfs files in /sys/class/leds/. The vibrator classdev name is gta01:vibrator.
Please note, depending on the kernel version, the driver only supports on/off or PWM of the vibrator device. If you want to run the vibrator at full power, use
root@fic-gta01:~$ echo "255" > /sys/class/leds/gta01\:vibrator/brightness
The kernel that is currently in development changes some paths around /sys, so userspace must be prepared for a change.
Here are the current /sys mappings for andy-tracking (which has Balaji's regulator PMU stuff). The reason virtually everything has changed is mainly due to the device tree changes to fix suspend - resume, many more things have a child relationship to the PMU now.
old: /sys/devices/platform/neo1973-pm-host.0/hostmode new: /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-host.0/hostmode same: /sys/devices/platform/s3c2410-ohci/usb_mode old: /sys/devices/platform/neo1973-pm-gsm.0/power_on|reset|download new: /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gsm.0/... old: /sys/devices/platform/neo1973-resume.0/resume_reason new: /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-resume.0/resume_reason ~ /sys/class/i2c-adapter/i2c-0/0-0073/resume_reason ~ (split into CPU wake interrupt and secondly PMU-specific reason) old: /sys/devices/platform/sc32440_fiq.0/fiq/count|dump|write new: /sys/devices/platform/sc32440_fiq.0/gta02-hdq.0/hdq/... old: /sys/devices/platform/bq27000-battery.0/power_supply/bat/ ~ uevent|type|status|voltage_now|current_now|charge_full|temp| ~ technology|present|time_to_empty_now|time_to_full_now|capacity| ~ online new: /sys/class/power_supply/battery/... old: /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/ ~ chgmode|charger_type|force_usb_limit_dangerous|dump_regs new: /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/... old: /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-bt.0/ ~ power_on|reset new: /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.6/neo1973-pm-bt.0/... old: /sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-gps.0/pwron new: /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/pwron same: /sys/devices/platform/soc-audio/codec_reg|codec_reg_write old: /sys/devices/platform/glamo3362.0/regs new: /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.9/glamo3362.0/regs old: /sys/devices/platform/neo1973-vibrator.0/leds/neo1973:vibrator/brightness new: /sys/class/leds/neo1973:vibrator/brightness old: /sys/devices/platform/gta02-led.0/leds/gta02-aux:red/brightness new: /sys/class/leds/gta02-aux:red/brightness old: /sys/devices/platform/gta02-led.0/leds/gta02-power:blue/brightness new: /sys/class/leds/gta02-power:blue/brightness old: /sys/devices/platform/gta02-led.0/leds/gta02-power:orange/brightness new: /sys/class/leds/gta02-power:orange/brightness old: /sys/devices/platform/spi_s3c24xx_gpio.1/spi0.{0|1}/ ~ power/wakeup|dump|full_scale... new: /sys/class/i2c-adapter/i2c-0/0-0073/lis302dl.{1|2}/...
For more recent kernel versions (like the one shipped on the Freerunner / GTA02), see the git repository.
Openmoko related kernel development discussions happen on the openmoko-kernel@lists.openmoko.org mailing list.
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |