http://wiki.openmoko.org/api.php?action=feedcontributions&user=Clheiny&feedformat=atomOpenmoko - User contributions [en]2024-03-29T00:08:39ZUser contributionsMediaWiki 1.19.24http://wiki.openmoko.org/wiki/KernelKernel2007-05-17T02:34:15Z<p>Clheiny: /* Kernel Configuration */</p>
<hr />
<div>== General ==<br />
<br />
The Kernel on the GTA01 is based on a vanilla 2.6.20.1 Linux kernel from [http://www.kernel.org/ kernel.org].<br />
<br />
Some additional patches are required for<br />
* S3C2410 Usb Device Controller<br />
** We use the driver from iPaq H1940 linux project<br />
* S3C2410 SD Card Controller<br />
** We use the driver from the [http://www.tomtom.com/gpl.php TomTom GO kernel]<br />
* [[QT2410]] machine support<br />
** This is just some glue that puts all pieces together<br />
* S3C2410 touch screen driver<br />
** Again from iPaq H1940 linux project<br />
* GTA01 machine support<br />
** Some glue/configuration to pull all pieces together<br />
* [[GSM Communication Infrastructure]]<br />
** The kernel-level part (TS07.10 line discipline, GPRS line discipline)<br />
<br />
== Kernel Patchset ==<br />
<br />
The latest patchset against the abovementioned vanilla kernel can be found at https://svn.openmoko.org/trunk/src/target/kernel/patches/. This is a so-called "[http://savannah.nongnu.org/projects/quilt quilt] patchset". In order to apply it, you have to download it into a "patches" directory below the "linux-2.6.x" directory, and then call "quilt push -a", which pushes all patches onto the kernel.<br />
<br />
For example, after unpacking the 2.6.21.1 kernel tarball, you might type the following commands:<br />
cd linux-2.6.21.1<br />
svn co https://svn.openmoko.org/trunk/src/target/kernel/patches<br />
quilt push -a<br />
to apply the latest patchset to that kernel. Note that 2.6.21.1 may not be the correct kernel to build against - see previous section to determine just which kernel version to download and patch.<br />
<br />
== Kernel Configuration ==<br />
<br />
The latest kernel configuration file can be found at https://svn.openmoko.org/trunk/oe/packages/linux/linux-gta01/. Just copy the config file corresponding to the correct kernel version to the linux-2.6.x/.config file.<br />
<br />
== Kernel building ==<br />
<br />
The kernel build is executed as normal. We actually only need the "vmlinux" target, not the "zImage".<br />
<br />
== Bootable kernel image ==<br />
<br />
A bootable kernel image called ''uImage'' is available from [https://buildhost.openmoko.org/tmp/gta01/deploy/images/])<br />
<br />
== Creating a bootable kernel image ==<br />
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.<br />
<br />
== Kernel Boot Parameters ==<br />
<br />
Since the [[QT2410]] can be used with different liquid crystal modules (LCMs), the kernel images for the QT2410 have a boot parameter "tft":<br />
* If you boot without any tft= parameter, the 'stock' qt2410 240x320 TFT panel is assumed.<br />
* If you boot with "tft=b" ('b' for big), the timings for the SHARP 8" 640x480 TFT panel are used.<br />
* If you boot with "tft=p" ('p' for production), the timings for the 2.8" 480x640 TFT panel are used.<br />
<br />
== Kernel Subsystems ==<br />
<br />
In this section we will outline a couple of the GTA01 specific kernel drivers / features / subsystems<br />
<br />
=== GSM ===<br />
<br />
==== Power Management ====<br />
<br />
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)<br />
<br />
It exports the following sysfs based interface<br />
<pre><br />
root@fic-gta01:/$ ls -l /sys/bus/platform/devices/gta01-pm-gsm.0/<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:58 download<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:58 power_on<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:58 reset<br />
</pre><br />
<br />
===== Powering up =====<br />
<pre><br />
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on <br />
gta01-pm-gsm gta01-pm-gsm.0: powering up GSM, thus disconnecting serial console<br />
</pre><br />
<br />
===== Powering down =====<br />
<pre><br />
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on <br />
gta01-pm-gsm gta01-pm-gsm.0: powered down GSM, thus enabling serial console<br />
</pre><br />
<br />
===== Resetting =====<br />
<pre><br />
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/reset <br />
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/reset <br />
</pre><br />
<br />
===== Activating GSM baseband download mode =====<br />
<pre><br />
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/download<br />
</pre><br />
<br />
===== De-activating GSM baseband download mode =====<br />
<pre><br />
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/download<br />
</pre><br />
<br />
=== GPS ===<br />
<br />
==== Power Management ====<br />
<br />
The gta01_pm_gps kernel driver offers a sysfs based interface:<br />
<pre><br />
root@fic-gta01:~$ ls -l /sys/bus/platform/devices/gta01-pm-gps.0/ <br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_avdd_3v<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_lp_io_3v3<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_pll_core_2v5<br />
-rw-r--r-- 1 root root 0 Feb 1 09:14 power_sequence<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_vtxco_2v8<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 pwron<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 reset<br />
</pre><br />
<br />
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.<br />
<br />
The <b>power_sequence</b> file implements power-up/power-down sequence in accordance with the GlobalLocate data sheet.<br />
<br />
===== Powering up =====<br />
root@fic-gta01:~$ echo "power_up" > /sys/bus/platform/devices/gta01-pm-gps.0/power_sequence <br />
===== Powering down =====<br />
root@fic-gta01:~$ echo "power_down" > /sys/bus/platform/devices/gta01-pm-gps.0/power_sequence<br />
<br />
=== Asound driver ===<br />
<br />
==== High-level requirements ====<br />
<br />
The GTA01 audio subsystem is fairly complex, even though the high-level requirements for the sound driver are simple.<br />
The features we need to support<br />
<br />
* voice call support<br />
** passing through the microphone signal to the GSM Modem<br />
** passing through the GSM Modem audio output to the integrated speaker(s)<br />
** the microphone input mixer gain will be statically configured according to the dynamic requirements<br />
** the audio volume that is sent to the GSM modem can be adjusted via line out level<br />
** the audio volume incoming (from GSM modem -> codec) can be adjusted via speaker out level<br />
* voice call recording support<br />
** the user is able to record phone conversations on digital storage inside the phone. Format will be ogg (not important to driver)<br />
** ideally, the user can choose between recording only incoming or outgoing signal, or both.<br />
** for both, we'd need to mix both microphone and line-in signals before recording. is this possible?<br />
* voice call playback support<br />
** the user is able to playback recorded files during a conversation. this means that PCM playback needs to be mixed with mic input before being passed to line-out (and to the GSM modem)<br />
* media playback support<br />
** an audio player can play back mp3/ogg/flac/... files and output sound via integrated speakers or headphone<br />
* headphone jack switch<br />
** this is connected to a GPIO of the S3C2410. How to best integrate this with the sound driver? It should just be handled like any other headphone jack reporting of e.g. laptop computers.<br />
<br />
For more details see [[Neo1973 Audio Subsystem]]<br />
<br />
=== Bluetooth ===<br />
<br />
We're using the stock bluez implementation of the linux kernel.<br />
<br />
==== Power Management ====<br />
<br />
The bluetooth basically has the following preconditions<br />
* BT_EN being set<br />
* The Voltage regulator set up properly<br />
* The ohci-hcd driver being loaded<br />
<br />
The gta01_pm_bt driver implements the following files:<br />
<pre><br />
root@fic-gta01:/$ ls -l /sys/bus/platform/devices/gta01-pm-bt.0<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:52 power_on<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:52 reset<br />
</pre><br />
<br />
===== Powering up the device =====<br />
<br />
<pre><br />
root@fic-gta01:/$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on<br />
usb 1-1: new full speed USB device using s3c2410-ohci and address 4<br />
usb 1-1: configuration #1 chosen from 1 choice<br />
</pre><br />
<br />
===== Powering down the device =====<br />
<pre><br />
root@fic-gta01:/$ echo "0" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on <br />
usb 1-1: USB disconnect, address 3<br />
</pre><br />
<br />
===== Asserting reset (low-active) =====<br />
<pre><br />
root@fic-gta01:/$ echo "0" > /sys/bus/platform/devices/gta01-pm-bt.0/reset <br />
root@fic-gta01:/$ usb 1-1: USB disconnect, address 2<br />
</pre><br />
<br />
===== De-asserting reset (low-active) =====<br />
<pre><br />
root@fic-gta01:/$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/reset <br />
s3c2410-ohci s3c2410-ohci: wakeup<br />
usb 1-1: new full speed USB device using s3c2410-ohci and address 3<br />
usb 1-1: configuration #1 chosen from 1 choice<br />
</pre><br />
<br />
==== Getting started ====<br />
<br />
<pre><br />
root@fic-gta01:~$ hciconfig hci0 up<br />
root@fic-gta01:~$ hcitool scan<br />
Scanning ...<br />
00:14:9A:77:A2:02 A780<br />
root@fic-gta01:~$ hcitool inq 00:14:9A:77:A2:02 <br />
Inquiring ...<br />
00:14:9A:77:A2:02 clock offset: 0x55df class: 0x502204<br />
root@fic-gta01:~$ hcitool cc 00:14:9A:77:A2:02 <br />
root@fic-gta01:~$ hcitool con <br />
Connections:<br />
< ACL 00:14:9A:77:A2:02 handle 42 state 1 lm MASTER <br />
root@fic-gta01:~$ hcitool info 00:14:9A:77:A2:02<br />
Requesting information ...<br />
BD Address: 00:14:9A:77:A2:02<br />
Device Name: A780<br />
LMP Version: 1.1 (0x1) LMP Subversion: 0x700<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xff 0x0d 0x00 0x00 0x00 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset> <br />
<timing accuracy> <role switch> <hold mode> <sniff mode> <br />
<park state> <RSSI> <channel quality> <SCO link> <HV2 packets> <br />
<HV3 packets> <u-law log> <A-law log> <CVSD> <power control> <br />
<transparent SCO> <br />
</pre><br />
<br />
=== AUX Button ===<br />
<br />
The AUX button (formerly 911 button) is supported via the "gta01kbd" driver in the kernel (drivers/input/keyboard/gta01kbd.c). <br />
<br />
It creates an input event device that only issues "KEY_PHONE" press/unpress events.<br />
<br />
=== Power Management Unit (PMU) ===<br />
<br />
The PMU is supported via the "pcf50606" driver in the kernel (drivers/i2c/chips/pcf50606.c).<br />
<br />
This driver provides a number of userspace interfaces for the various bits and pieces of the PMU<br />
<br />
==== Power Button, Charger insertion ====<br />
<br />
The PMU creates an input device that supports the following keys:<br />
* KEY_POWER: power button of GTA01<br />
* KEY_POWER2: USB power supply insert/remove<br />
* KEY_BATTERY: Charger insert/remove<br />
<br />
==== RTC ====<br />
<br />
The real-time clock, including the alarm feature, is implemented as standard RTC (/dev/rtc).<br />
<br />
==== Watchdog ====<br />
<br />
The PMU-integrated watchdog is implemented using the standard watchdog character device.<br />
<br />
==== Voltage Regulators ====<br />
<br />
The voltage regulators are exported to userspace using sysfs, much like lm_sensors.<br />
<br />
Every regulator can be read (and written!). The format is ASCII in millivolts.<br />
<br />
<pre><br />
root@fic-gta01:/sys/devices/platform/s3c2410-i2c/i2c-0/0-0008$ ls -l /sys/bus/i2c/devices/0-0008/voltage_*<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d1reg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d2reg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d3reg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcd<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcde<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcud<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_lpreg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_ioreg<br />
root@fic-gta01:/sys/devices/platform/s3c2410-i2c/i2c-0/0-0008$ cat voltage_dcd<br />
1300<br />
</pre><br />
<br />
==== Battery Voltage ====<br />
<br />
The battery voltage (in millivolts) can be read via sysfs<br />
<br />
<pre><br />
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/battvolt <br />
3767<br />
</pre><br />
<br />
==== Battery charging current ====<br />
<br />
The battery charging current (in milliamperes) can be read via sysfs<br />
<br />
<pre><br />
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/chgcur <br />
0<br />
</pre><br />
<br />
==== Battery temperature ====<br />
<br />
The battery temperature (in centigrades) can be read via sysfs<br />
<br />
<pre><br />
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/battemp<br />
25<br />
</pre><br />
<br />
== Kernel TODO ==<br />
<br />
=== Various ===<br />
* speed up in-kernel boot process<br />
** delay calibration<br />
** framebuffer takes ages<br />
<br />
=== TS07.10 multiplex ===<br />
<br />
=== PCF50606 ===<br />
* fix conversion problems when setting alarm time/date<br />
* check conversion table for temperature<br />
* implement 'persistent alarm setting' (see mail from mickey)<br />
<br />
=== Backlight ===<br />
* later: implement smooth fade-in, fade-out<br />
<br />
=== Vibrator ===<br />
* implement it as LED driver<br />
* test it<br />
* later: implement PWM<br />
<br />
=== USB device driver ===<br />
* test switching between usb host and usb device<br />
<br />
=== Power Management ===<br />
* test, debug and fix wakeup on<br />
** IRQ from GSM<br />
** IRQ from PMU (charger insert/remove or the like) <br />
** headphone jack insert/remove<br />
{{Languages|Kernel}}<br />
<br />
=== Mailing lists ===<br />
<br />
Kernel development is openmoko-kernel@lists.openmoko.org mailing list associated with it.</div>Clheinyhttp://wiki.openmoko.org/wiki/KernelKernel2007-05-17T02:28:16Z<p>Clheiny: /* Kernel Patchset */</p>
<hr />
<div>== General ==<br />
<br />
The Kernel on the GTA01 is based on a vanilla 2.6.20.1 Linux kernel from [http://www.kernel.org/ kernel.org].<br />
<br />
Some additional patches are required for<br />
* S3C2410 Usb Device Controller<br />
** We use the driver from iPaq H1940 linux project<br />
* S3C2410 SD Card Controller<br />
** We use the driver from the [http://www.tomtom.com/gpl.php TomTom GO kernel]<br />
* [[QT2410]] machine support<br />
** This is just some glue that puts all pieces together<br />
* S3C2410 touch screen driver<br />
** Again from iPaq H1940 linux project<br />
* GTA01 machine support<br />
** Some glue/configuration to pull all pieces together<br />
* [[GSM Communication Infrastructure]]<br />
** The kernel-level part (TS07.10 line discipline, GPRS line discipline)<br />
<br />
== Kernel Patchset ==<br />
<br />
The latest patchset against the abovementioned vanilla kernel can be found at https://svn.openmoko.org/trunk/src/target/kernel/patches/. This is a so-called "[http://savannah.nongnu.org/projects/quilt quilt] patchset". In order to apply it, you have to download it into a "patches" directory below the "linux-2.6.x" directory, and then call "quilt push -a", which pushes all patches onto the kernel.<br />
<br />
For example, after unpacking the 2.6.21.1 kernel tarball, you might type the following commands:<br />
cd linux-2.6.21.1<br />
svn co https://svn.openmoko.org/trunk/src/target/kernel/patches<br />
quilt push -a<br />
to apply the latest patchset to that kernel. Note that 2.6.21.1 may not be the correct kernel to build against - see previous section to determine just which kernel version to download and patch.<br />
<br />
== Kernel Configuration ==<br />
<br />
The latest kernel configuration can be found at https://svn.openmoko.org/trunk/oe/packages/linux/linux-gta01/defconfig-fic-gta01. Just copy it to the linux-2.6.x/.config file.<br />
<br />
== Kernel building ==<br />
<br />
The kernel build is executed as normal. We actually only need the "vmlinux" target, not the "zImage".<br />
<br />
== Bootable kernel image ==<br />
<br />
A bootable kernel image called ''uImage'' is available from [https://buildhost.openmoko.org/tmp/gta01/deploy/images/])<br />
<br />
== Creating a bootable kernel image ==<br />
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.<br />
<br />
== Kernel Boot Parameters ==<br />
<br />
Since the [[QT2410]] can be used with different liquid crystal modules (LCMs), the kernel images for the QT2410 have a boot parameter "tft":<br />
* If you boot without any tft= parameter, the 'stock' qt2410 240x320 TFT panel is assumed.<br />
* If you boot with "tft=b" ('b' for big), the timings for the SHARP 8" 640x480 TFT panel are used.<br />
* If you boot with "tft=p" ('p' for production), the timings for the 2.8" 480x640 TFT panel are used.<br />
<br />
== Kernel Subsystems ==<br />
<br />
In this section we will outline a couple of the GTA01 specific kernel drivers / features / subsystems<br />
<br />
=== GSM ===<br />
<br />
==== Power Management ====<br />
<br />
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)<br />
<br />
It exports the following sysfs based interface<br />
<pre><br />
root@fic-gta01:/$ ls -l /sys/bus/platform/devices/gta01-pm-gsm.0/<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:58 download<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:58 power_on<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:58 reset<br />
</pre><br />
<br />
===== Powering up =====<br />
<pre><br />
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on <br />
gta01-pm-gsm gta01-pm-gsm.0: powering up GSM, thus disconnecting serial console<br />
</pre><br />
<br />
===== Powering down =====<br />
<pre><br />
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/power_on <br />
gta01-pm-gsm gta01-pm-gsm.0: powered down GSM, thus enabling serial console<br />
</pre><br />
<br />
===== Resetting =====<br />
<pre><br />
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/reset <br />
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/reset <br />
</pre><br />
<br />
===== Activating GSM baseband download mode =====<br />
<pre><br />
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/gta01-pm-gsm.0/download<br />
</pre><br />
<br />
===== De-activating GSM baseband download mode =====<br />
<pre><br />
root@fic-gta01:~$ echo "0" > /sys/bus/platform/devices/gta01-pm-gsm.0/download<br />
</pre><br />
<br />
=== GPS ===<br />
<br />
==== Power Management ====<br />
<br />
The gta01_pm_gps kernel driver offers a sysfs based interface:<br />
<pre><br />
root@fic-gta01:~$ ls -l /sys/bus/platform/devices/gta01-pm-gps.0/ <br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_avdd_3v<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_lp_io_3v3<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_pll_core_2v5<br />
-rw-r--r-- 1 root root 0 Feb 1 09:14 power_sequence<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 power_vtxco_2v8<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 pwron<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:14 reset<br />
</pre><br />
<br />
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.<br />
<br />
The <b>power_sequence</b> file implements power-up/power-down sequence in accordance with the GlobalLocate data sheet.<br />
<br />
===== Powering up =====<br />
root@fic-gta01:~$ echo "power_up" > /sys/bus/platform/devices/gta01-pm-gps.0/power_sequence <br />
===== Powering down =====<br />
root@fic-gta01:~$ echo "power_down" > /sys/bus/platform/devices/gta01-pm-gps.0/power_sequence<br />
<br />
=== Asound driver ===<br />
<br />
==== High-level requirements ====<br />
<br />
The GTA01 audio subsystem is fairly complex, even though the high-level requirements for the sound driver are simple.<br />
The features we need to support<br />
<br />
* voice call support<br />
** passing through the microphone signal to the GSM Modem<br />
** passing through the GSM Modem audio output to the integrated speaker(s)<br />
** the microphone input mixer gain will be statically configured according to the dynamic requirements<br />
** the audio volume that is sent to the GSM modem can be adjusted via line out level<br />
** the audio volume incoming (from GSM modem -> codec) can be adjusted via speaker out level<br />
* voice call recording support<br />
** the user is able to record phone conversations on digital storage inside the phone. Format will be ogg (not important to driver)<br />
** ideally, the user can choose between recording only incoming or outgoing signal, or both.<br />
** for both, we'd need to mix both microphone and line-in signals before recording. is this possible?<br />
* voice call playback support<br />
** the user is able to playback recorded files during a conversation. this means that PCM playback needs to be mixed with mic input before being passed to line-out (and to the GSM modem)<br />
* media playback support<br />
** an audio player can play back mp3/ogg/flac/... files and output sound via integrated speakers or headphone<br />
* headphone jack switch<br />
** this is connected to a GPIO of the S3C2410. How to best integrate this with the sound driver? It should just be handled like any other headphone jack reporting of e.g. laptop computers.<br />
<br />
For more details see [[Neo1973 Audio Subsystem]]<br />
<br />
=== Bluetooth ===<br />
<br />
We're using the stock bluez implementation of the linux kernel.<br />
<br />
==== Power Management ====<br />
<br />
The bluetooth basically has the following preconditions<br />
* BT_EN being set<br />
* The Voltage regulator set up properly<br />
* The ohci-hcd driver being loaded<br />
<br />
The gta01_pm_bt driver implements the following files:<br />
<pre><br />
root@fic-gta01:/$ ls -l /sys/bus/platform/devices/gta01-pm-bt.0<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:52 power_on<br />
-rw-r--r-- 1 root root 4096 Feb 1 09:52 reset<br />
</pre><br />
<br />
===== Powering up the device =====<br />
<br />
<pre><br />
root@fic-gta01:/$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on<br />
usb 1-1: new full speed USB device using s3c2410-ohci and address 4<br />
usb 1-1: configuration #1 chosen from 1 choice<br />
</pre><br />
<br />
===== Powering down the device =====<br />
<pre><br />
root@fic-gta01:/$ echo "0" > /sys/bus/platform/devices/gta01-pm-bt.0/power_on <br />
usb 1-1: USB disconnect, address 3<br />
</pre><br />
<br />
===== Asserting reset (low-active) =====<br />
<pre><br />
root@fic-gta01:/$ echo "0" > /sys/bus/platform/devices/gta01-pm-bt.0/reset <br />
root@fic-gta01:/$ usb 1-1: USB disconnect, address 2<br />
</pre><br />
<br />
===== De-asserting reset (low-active) =====<br />
<pre><br />
root@fic-gta01:/$ echo "1" > /sys/bus/platform/devices/gta01-pm-bt.0/reset <br />
s3c2410-ohci s3c2410-ohci: wakeup<br />
usb 1-1: new full speed USB device using s3c2410-ohci and address 3<br />
usb 1-1: configuration #1 chosen from 1 choice<br />
</pre><br />
<br />
==== Getting started ====<br />
<br />
<pre><br />
root@fic-gta01:~$ hciconfig hci0 up<br />
root@fic-gta01:~$ hcitool scan<br />
Scanning ...<br />
00:14:9A:77:A2:02 A780<br />
root@fic-gta01:~$ hcitool inq 00:14:9A:77:A2:02 <br />
Inquiring ...<br />
00:14:9A:77:A2:02 clock offset: 0x55df class: 0x502204<br />
root@fic-gta01:~$ hcitool cc 00:14:9A:77:A2:02 <br />
root@fic-gta01:~$ hcitool con <br />
Connections:<br />
< ACL 00:14:9A:77:A2:02 handle 42 state 1 lm MASTER <br />
root@fic-gta01:~$ hcitool info 00:14:9A:77:A2:02<br />
Requesting information ...<br />
BD Address: 00:14:9A:77:A2:02<br />
Device Name: A780<br />
LMP Version: 1.1 (0x1) LMP Subversion: 0x700<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xff 0x0d 0x00 0x00 0x00 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset> <br />
<timing accuracy> <role switch> <hold mode> <sniff mode> <br />
<park state> <RSSI> <channel quality> <SCO link> <HV2 packets> <br />
<HV3 packets> <u-law log> <A-law log> <CVSD> <power control> <br />
<transparent SCO> <br />
</pre><br />
<br />
=== AUX Button ===<br />
<br />
The AUX button (formerly 911 button) is supported via the "gta01kbd" driver in the kernel (drivers/input/keyboard/gta01kbd.c). <br />
<br />
It creates an input event device that only issues "KEY_PHONE" press/unpress events.<br />
<br />
=== Power Management Unit (PMU) ===<br />
<br />
The PMU is supported via the "pcf50606" driver in the kernel (drivers/i2c/chips/pcf50606.c).<br />
<br />
This driver provides a number of userspace interfaces for the various bits and pieces of the PMU<br />
<br />
==== Power Button, Charger insertion ====<br />
<br />
The PMU creates an input device that supports the following keys:<br />
* KEY_POWER: power button of GTA01<br />
* KEY_POWER2: USB power supply insert/remove<br />
* KEY_BATTERY: Charger insert/remove<br />
<br />
==== RTC ====<br />
<br />
The real-time clock, including the alarm feature, is implemented as standard RTC (/dev/rtc).<br />
<br />
==== Watchdog ====<br />
<br />
The PMU-integrated watchdog is implemented using the standard watchdog character device.<br />
<br />
==== Voltage Regulators ====<br />
<br />
The voltage regulators are exported to userspace using sysfs, much like lm_sensors.<br />
<br />
Every regulator can be read (and written!). The format is ASCII in millivolts.<br />
<br />
<pre><br />
root@fic-gta01:/sys/devices/platform/s3c2410-i2c/i2c-0/0-0008$ ls -l /sys/bus/i2c/devices/0-0008/voltage_*<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d1reg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d2reg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_d3reg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcd<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcde<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_dcud<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_lpreg<br />
-rw-r--r-- 1 root root 4096 Sep 3 11:55 /sys/bus/i2c/devices/0-0008/voltage_ioreg<br />
root@fic-gta01:/sys/devices/platform/s3c2410-i2c/i2c-0/0-0008$ cat voltage_dcd<br />
1300<br />
</pre><br />
<br />
==== Battery Voltage ====<br />
<br />
The battery voltage (in millivolts) can be read via sysfs<br />
<br />
<pre><br />
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/battvolt <br />
3767<br />
</pre><br />
<br />
==== Battery charging current ====<br />
<br />
The battery charging current (in milliamperes) can be read via sysfs<br />
<br />
<pre><br />
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/chgcur <br />
0<br />
</pre><br />
<br />
==== Battery temperature ====<br />
<br />
The battery temperature (in centigrades) can be read via sysfs<br />
<br />
<pre><br />
root@fic-gta01:~$ cat /sys/bus/i2c/devices/0-0008/battemp<br />
25<br />
</pre><br />
<br />
== Kernel TODO ==<br />
<br />
=== Various ===<br />
* speed up in-kernel boot process<br />
** delay calibration<br />
** framebuffer takes ages<br />
<br />
=== TS07.10 multiplex ===<br />
<br />
=== PCF50606 ===<br />
* fix conversion problems when setting alarm time/date<br />
* check conversion table for temperature<br />
* implement 'persistent alarm setting' (see mail from mickey)<br />
<br />
=== Backlight ===<br />
* later: implement smooth fade-in, fade-out<br />
<br />
=== Vibrator ===<br />
* implement it as LED driver<br />
* test it<br />
* later: implement PWM<br />
<br />
=== USB device driver ===<br />
* test switching between usb host and usb device<br />
<br />
=== Power Management ===<br />
* test, debug and fix wakeup on<br />
** IRQ from GSM<br />
** IRQ from PMU (charger insert/remove or the like) <br />
** headphone jack insert/remove<br />
{{Languages|Kernel}}<br />
<br />
=== Mailing lists ===<br />
<br />
Kernel development is openmoko-kernel@lists.openmoko.org mailing list associated with it.</div>Clheinyhttp://wiki.openmoko.org/wiki/OpenEmbeddedOpenEmbedded2007-04-30T23:49:58Z<p>Clheiny: /* Build directory */</p>
<hr />
<div>[[OpenMoko]], our distribution, is built using Open Embedded. Open Embedded will:<br />
<br />
* Generate (cross-compile) software packages for multiple embedded targets.<br />
* Handle different hardware architectures, and support multiple releases across those architectures. <br />
<br />
For more information please see the [http://www.openembedded.org/ Open Embedded] website.<br />
<br />
== Master Build Server ==<br />
<br />
There is a master build server, it has the hostname buildhost.openmoko.org. Shell accounts are only available to core developers and the "distribution maintainer", once we have created such a job/task ;)<br />
<br />
The idea is that all official images and binary packages (ipk) are built on one machine with a well-defined environment.<br />
<br />
== Build Process with OpenEmbedded ==<br />
<br />
=== OE upstream snapshot ===<br />
<br />
We start from an OpenEmbedded snapshot from the official "upstream" aka "Vanilla" OpenEmbedded project. This snapshot contains the [[BitBake recipie]]s for thousands of packages<br />
<br />
=== OpenMoko OE overlay tree ===<br />
<br />
In addition to the upstream recipies, we also have a set of our own recipies. They are available from http://svn.openmoko.org/trunk/oe/ ([http://svnweb.openmoko.org/trunk/oe/ SVNweb]).<br />
<br />
The ''overlay'' tree works in the following way: It gives us the ability to add rules below a seperate directory tree. This means we don't have to edit or add rules to the upstream snapshot, and we always have a clear distinction about what is upstream, and what is our additions to it.<br />
<br />
=== Upstream Source tarballs ===<br />
<br />
When bitbake builds a particular OE package, it downloads the original source code of the upstream project (e.g. Linux kernel) from the web.<br />
After downloading it, it applies a series of local patches to it. Those patches are from either the [[OpenEmbedded#OE_upstream_snapshot]], or from the [[OpenEmbedded#OpenMoko_OE_overlay_tree]]. <br />
<br />
The unpatched source tarballs are available from http://buildhost.openmoko.org/sources/<br />
<br />
=== Build directory ===<br />
<br />
The content of the build directory is available at http://buildhost.openmoko.org/tmp/<br />
<br />
It contains<br />
* cache<br />
** Internal caching data, not for human interpretation<br />
* cross<br />
** The cross-compilation toolchain used. You can download this and use it on your local machine.<br />
* deploy<br />
** deploy/images<br />
*** The filesystem, kernel and bootloader images to be flashed into NAND<br />
** deploy/ipk<br />
*** the .ipk packages<br />
* rootfs<br />
** the extracted root filesystem. Please use the images from deploy/images instead<br />
* staging<br />
** no user servicable parts inside<br />
* stamp<br />
** internal state data<br />
* work<br />
** the actual build trees (including patches source code and binaries) of the individual packages<br />
<br />
=== Binary packages ===<br />
<br />
The binary packages of intermediate "unofficial" releases are available at <br />
http://buildhost.openmoko.org/tmp/deploy/ipk/<br />
<br />
The binary packages of intermediate "official" releases are available at <br />
http://buildhost.openmoko.org/releases/</div>Clheinyhttp://wiki.openmoko.org/wiki/Talk:OpenEmbeddedTalk:OpenEmbedded2007-04-30T23:47:52Z<p>Clheiny: Broken link</p>
<hr />
<div>The link http://buildhost.openmoko.org/tmp/gta01/ under "build directory" is broken. Does someone have the correct link?</div>Clheiny