http://openmoko.org/api.php?action=feedcontributions&user=Sunlt&feedformat=atomOpenmoko - User contributions [en]2024-03-29T00:12:12ZUser contributionsMediaWiki 1.19.24http://openmoko.org/wiki/OpenmokoFramework/zh_cnOpenmokoFramework/zh cn2008-07-02T09:47:33Z<p>Sunlt: New page: {{Languages|OpenmokoFramework}} {{Introbox}} ''Note: This is the (ongoing) description of the new framework architecture that is '''in development'''. See OpenmokoOldFramework for ...</p>
<hr />
<div>{{Languages|OpenmokoFramework}}<br />
<br />
<br />
{{Introbox}}<br />
<br />
<br />
''Note: This is the (ongoing) description of the new framework architecture that is '''in development'''. See [[OpenmokoOldFramework]] for the framework architecture of 2007.1 and 2007.2 and [[NeoSoftwareStack]] for the current status (which has nothing to do yet with this framework)''<br />
<br />
=Answering the TOP x questions=<br />
* ''Question 1'': Is this a part of the current images yet?<br />
* ''Answer'': No.<br />
* ''Question 2'': Is this the mystic ASU?<br />
* ''Answer'': No.<br />
* ''Question 3'': When can I see this as part of an image?<br />
* ''Answer'': See roadmap at the bottom of this document. It's going to be an interesting autumn and winter '08 ;)<br />
* ''Question 4'': What's the current status?<br />
* ''Answer'': See right below:<br />
** [[OpenmokoFramework/Status Update 1|Status Update 1]]<br />
** [[OpenmokoFramework/Status Update 2|Status Update 2]]<br />
<br />
<categorytree mode=pages style="float:right; clear:right; margin-left:1ex; border:1px solid gray; padding:0.7ex; background-color:white;">Framework</categorytree><br />
=Purposes=<br />
* '''Give people the infrastructure to create solid and exciting software products based on the Openmoko platform'''<br />
* '''Support competing UIs while collaborating on developing services'''<br />
* '''Encourage framework users (e.g. application developers) to also contribute to the framework'''<br />
<br />
=Requirements=<br />
* Make it simple<br />
* Concentrate on core services<br />
* Be programming language agnostic<br />
* Be UI toolkit agnostic<br />
* Try to reuse existing technologies as much as possible, but not at the cost of a bad API<br />
<br />
=How to achieve that technically=<br />
* Chose [[Dbus]] as the collaboration line. Below dbus, we can work together. Above dbus, we can differentiate.<br />
* Expose features through dbus APIs implemented by UI-agnostic and language-agnostic services (daemons).<br />
* Optimize for Openmoko devices, but support multiple architectures and purposes through plugin interfaces and suitable hardware abstraction mechanisms.<br />
* Be not afraid of reinventing the wheel for a wheel-barrow if all the existing wheels are made for sports cars.<br />
<br />
=Mandatory Readings=<br />
* [http://adam.gomaa.us/blog/frameworks-exist-for-conceptual-integrity/ Frameworks exist for conceptual integrity]<br />
* [http://humanized.com/weblog/2007/10/05/make_oss_humane/ Ten ways to make more humane open source software]<br />
* [http://www.freesmartphone.org FreeSmartPhone.org Wiki]<br />
<br />
=What this is NOT about=<br />
This initiative does not cover low level services such as<br />
* Bootloader, Kernel, or System Init.<br />
<br />
This initiative does not cover high level services such as<br />
* X-Window-System, Window Manager, UI Toolkits,<br />
* Application Launchers, Applications, or Fancy UIs.<br />
<br />
=Architectural Overview=<br />
[[Image:OpenmokoFramework08.png |823px|frontside]]<br />
<br />
=Software Components=<br />
<br />
We differenciate between low-level and high-level services -- dbus will be used to communicate horizontally and vertically.<br />
<br />
===Low-Level Services===<br />
<br />
====Device Control====<br />
The low level device control service manages peripheral control, i.e. controlling power for individual subsystems such as<br />
* GSM, WiFi, Bluetooth, GPS, as well as<br />
* Backlight brightness and power,<br />
* turning LEDs on and off, etc.<br />
It also deals with<br />
* charging, suspend/resume,<br />
* accellerometers, and buttons.<br />
Last but not least, it sends notifications about the user's activity so that listeners have a chance to<br />
* change to powersaving modes, or<br />
* lock the device.<br />
We implement the following software for that:<br />
* [http://www.freesmartphone.org/index.php/Implementations/OpenDeviceDaemon odeviced]<br />
<br />
====Audio====<br />
The low level audio service relies on a working alsa device driver. On top of that, there are two components:<br />
# [http://gstreamer.freedesktop.org/ gstreamer]<br />
# [http://pulseaudio.org pulseaudio]<br />
<br />
'''Gstreamer''' is to be used for all kinds of event sounds where a) multiple audio formats need to be supported and b) a latency of about one second is acceptable. This goes for e.g. ring tones, welcome tones, plug indication.<br />
<br />
'''Pulseaudio''' is to be used for event sounds, where low-latency is necessary, e.g. touch click sounds and UI event acknowledge sounds. Pulseaudio is our general all-purpose mixer. Gstreamer will use the pulseaudio sink to feed audio through.<br />
<br />
====GSM====<br />
The low level GSM services expect a modem complying to GSM 07.07, GSM 07.05, and assorted GSM specifications, talking an AT-protocol over a serial line. If GSM 07.10 is supported, we use the multiplexing daemon<br />
* [http://www.freesmartphone.org/index.php/Implementations/gsm0710muxd gsm0710muxd]<br />
to export virtual serial lines over -- again -- AT-protocol can be spoken.<br />
<br />
====Bluetooth====<br />
The low level Bluetooth services rely on the official Linux Bluetooth subsystem:<br />
* [http://www.bluez.org BlueZ].<br />
<br />
====GPS====<br />
The low level GPS services assume a GPS device that talks NMEA over a device node. We rely on the following software:<br />
* [http://gypsy.freedesktop.org Gypsy]<br />
<br />
====Network====<br />
The low level networking service assumes network interfaces, such as USB, Ethernet, Wifi, etc. We rely on the following software here:<br />
* Network Manager or Intel Connection Manager (undecided yet)<br />
* ppp<br />
<br />
===High Level===<br />
<br />
====Usage====<br />
The Usage subsystem is coordinating application I/O requirements preventing. Applications are not supposed to turn on or off devices, since they do not have any knowledge about concurrent applications that may be also using the device -- think ''reference counting'' for I/O requirements.<br />
<br />
With this added layer, we could later think about monitoring subsystems, subsystem usage statistics, or accounting.<br />
<br />
See discussion page about PolicyKit.<br />
<br />
====Events====<br />
* signaling events via I/O (ringing, blinking, vibrating)<br />
* might use fd.o notification API<br />
<br />
====PIM====<br />
An intelligent storage database server. This is being carried out as a Google Summer of Code project. See complete description [http://www.neo1973-germany.de/wiki/pyPimd here]<br />
<br />
====Context====<br />
* Intelligent context API, integrating location as one -- among other -- sources<br />
TBD<br />
Reference Geoclue<br />
<br />
====Telephony====<br />
* Voice<br />
* Data<br />
<br />
=== [http://www.freesmartphone.org/index.php/Implementations/OpenPreferencesDaemon Preferences] ===<br />
* settings database<br />
<br />
====Network====<br />
* high level networking queries<br />
<br />
=Implementation=<br />
<br />
===Completion Status===<br />
<br />
====Low Level====<br />
* device control: 50%<br />
* audio: 80%<br />
* GSM: 80%<br />
* Bluetooth: 80%<br />
* GPS: 80%<br />
* Network: 50%<br />
<br />
====High Level====<br />
* Usage: 0%<br />
* Event: 0%<br />
* [http://www.freesmartphone.org/index.php/Implementations/OpenPreferencesDaemon Preferences]: 50%<br />
* Context: 0%<br />
* Telephony: 50%<br />
* Networking: 0%<br />
* PIM: 0%<br />
<br />
=The role of Python=<br />
<br />
Where we write new code, we will use Python to implement the dbus services. The reason for that being the rapid prototyping nature of Python and the emphasis on the Dbus APIs. Using Python, the turnaround times to experiment with APIs are incredibly faster than for using a compiled language such as C or C++.<br />
<br />
Once the APIs have been used by application programmers, we can start profiling and possibly reimplement some of the services with daemons written in Vala, ''if'' necessary. We might as well succeed in improving performance by using Pyrex/Cython/Ctypes to keep the benefits of Python.<br />
<br />
=Team & Roadmap=<br />
<br />
==Team==<br />
<br />
* [[User:Mickey|Michael 'Mickey' Lauer]] (team leader) -- Openmoko freelancer, working in Frankfurt/Main, Germany.<br />
* [[User:Charlie| Guillaume 'Charlie' Chereau]] -- Openmoko employee, working fulltime in the Openmoko office, Taipei, Taiwan.<br />
* [[User:Shoragan|Jan 'Shoragan' Luebbe]] -- Openmoko student, working part-time in Brunswick, Germany.<br />
* [[User:DanielWillmann|Daniel 'Alphaone' Willmann]] -- Openmoko student, working part-time in Brunswick, Germany.<br />
* (Holger 'Zecke' Freyther -- hopefully joining the team after releasing ASU, working in Berlin, Germany.)<br />
<br />
'''Subsystem Ownership'''<br />
<br />
''Phase 1 subsystems''<br />
<br />
* odeviced (mickey)<br />
* ophoned (mickey)<br />
* ousaged (jan)<br />
* oeventd (jan)<br />
* opreferencesd (guillaume)<br />
* ocontextd (guillaume)<br />
<br />
''Phase 2 subsystems''<br />
<br />
* network (to be defined)<br />
* pim (to be defined)<br />
<br />
==Roadmap==<br />
<br />
The milestone releases are combined Openmoko Framework and [[Zhone]] releases. Remember: A feature that isn't visible, working, and tested in our framework testing application (Zhone) does ''not'' exist. Until Framework 1.0.0 (later this year), we will not use any versioning in components. Afterwards, individual components may see individual releases.<br />
<br />
'''Note: The milestones and tasks moved over to our [http://trac.freesmartphone.org issue tracker].'''<br />
<br />
----<br />
<br />
[[Category:Openmoko ]]<br />
[[Category:Framework ]]</div>Sunlthttp://openmoko.org/wiki/Kernel/zh_cnKernel/zh cn2008-05-19T03:45:07Z<p>Sunlt: /* 内核配置 */</p>
<hr />
<div>== 概述 ==<br />
<br />
GTA01上所使用的内核基于来自[http://www.kernel.org/ kernel.org]未经修改的Linux 2.6.21.3内核。 <br />
<br />
针对如下设备还需要一些额外的补丁<br />
* S3C2410 Usb设备控制器<br />
** 我们使用来自iPaq H1940 linux项目的驱动程序<br />
* S3C2410 SD卡控制器<br />
** 我们使用来自[http://www.tomtom.com/gpl.php TomTom GO kernel]的驱动程序<br />
* [[QT2410]]支持<br />
** This is just some glue that puts all pieces together<br />
* S3C2410触摸屏驱动程序<br />
** 来自iPaq H1940 linux项目<br />
* GTA01支持<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 />
== 内核补丁 ==<br />
<br />
针对上述未经修改的内核的补丁集可以从[https://svn.openmoko.org/trunk/src/target/kernel/patches/ https://svn.openmoko.org/trunk/src/target/kernel/patches/]下载,这是一个 "[http://savannah.nongnu.org/projects/quilt quilt] patchset"。你必须把它解压到"linux-2.6.x"目录的"patches"文件夹,然后使用"quilt push -a"命令,这个命令将把所有的补丁打到内核里。<br />
<br />
例如,解压2.6.21.1内核tarball,然后使用如下命令来把最新的补丁打到内核里:<br />
cd linux-2.6.21.1<br />
svn co https://svn.openmoko.org/trunk/src/target/kernel/patches<br />
quilt push -a<br />
注意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 />
== 内核配置 ==<br />
<br />
最新的内核配置文件可以从[https://svn.openmoko.org/trunk/oe/packages/linux/linux-gta01/defconfig-fic-gta01 https://svn.openmoko.org/trunk/oe/packages/linux/linux-gta01/defconfig-fic-gta01]下载。将它复制到linux-2.6.x/目录下并保存为.config文件。<br />
<br />
== 内核构建 ==<br />
<br />
The kernel build is executed as normal. We actually only need the "vmlinux" target, not the "zImage".<br />
<br />
== 可引导的内核映像 ==<br />
<br />
A bootable kernel image called ''uImage'' is available from [https://buildhost.openmoko.org/tmp/gta01/deploy/images/]<br />
<br />
== 创建一个可引导的内核映像 ==<br />
u-boot要求所有的映像文件以uImage格式进行封装(比如内核,initrd,...)。This is basically just a special header adding CRC protection, version information, etc. Pleaes see [[u-boot/zh_cn|u-boot]] for details.<br />
<br />
== 内核启动参数 ==<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 />
== 内核子系统 ==<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 />
===== 复位 =====<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 />
=== 蓝牙 ===<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/devices/platform/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/devices/platform/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/devices/platform/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/devices/platform/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/devices/platform/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 />
==== 实时时钟 ====<br />
<br />
The real-time clock, including the alarm feature, is implemented as standard RTC (/dev/rtc).<br />
<br />
==== 看门狗 ====<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 />
==== 电池温度 ====<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 />
== 内核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设备驱动 ===<br />
* test switching between usb host and usb device<br />
<br />
=== Power Management ===<br />
* test, debug and fix suspend on user request<br />
* test, debug and fix wakeup on<br />
** IRQ on serial UART (GSM)<br />
** IRQ on serial UART (GPS)<br />
** IRQ from PMU (charger insert/remove or the like)<br />
** IRQ from ADC/touchscreen<br />
** 911 button press (GPIO IRQ)<br />
** headphone jack insert/remove<br />
{{Languages|Kernel}}</div>Sunlthttp://openmoko.org/wiki/Kernel/zh_cnKernel/zh cn2008-05-19T03:27:55Z<p>Sunlt: </p>
<hr />
<div>== 概述 ==<br />
<br />
GTA01上所使用的内核基于来自[http://www.kernel.org/ kernel.org]未经修改的Linux 2.6.21.3内核。 <br />
<br />
针对如下设备还需要一些额外的补丁<br />
* S3C2410 Usb设备控制器<br />
** 我们使用来自iPaq H1940 linux项目的驱动程序<br />
* S3C2410 SD卡控制器<br />
** 我们使用来自[http://www.tomtom.com/gpl.php TomTom GO kernel]的驱动程序<br />
* [[QT2410]]支持<br />
** This is just some glue that puts all pieces together<br />
* S3C2410触摸屏驱动程序<br />
** 来自iPaq H1940 linux项目<br />
* GTA01支持<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 />
== 内核补丁 ==<br />
<br />
针对上述未经修改的内核的补丁集可以从[https://svn.openmoko.org/trunk/src/target/kernel/patches/ https://svn.openmoko.org/trunk/src/target/kernel/patches/]下载,这是一个 "[http://savannah.nongnu.org/projects/quilt quilt] patchset"。你必须把它解压到"linux-2.6.x"目录的"patches"文件夹,然后使用"quilt push -a"命令,这个命令将把所有的补丁打到内核里。<br />
<br />
例如,解压2.6.21.1内核tarball,然后使用如下命令来把最新的补丁打到内核里:<br />
cd linux-2.6.21.1<br />
svn co https://svn.openmoko.org/trunk/src/target/kernel/patches<br />
quilt push -a<br />
注意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 />
== 内核配置 ==<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 />
== 内核构建 ==<br />
<br />
The kernel build is executed as normal. We actually only need the "vmlinux" target, not the "zImage".<br />
<br />
== 可引导的内核映像 ==<br />
<br />
A bootable kernel image called ''uImage'' is available from [https://buildhost.openmoko.org/tmp/gta01/deploy/images/]<br />
<br />
== 创建一个可引导的内核映像 ==<br />
u-boot要求所有的映像文件以uImage格式进行封装(比如内核,initrd,...)。This is basically just a special header adding CRC protection, version information, etc. Pleaes see [[u-boot/zh_cn|u-boot]] for details.<br />
<br />
== 内核启动参数 ==<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 />
== 内核子系统 ==<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 />
===== 复位 =====<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 />
=== 蓝牙 ===<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/devices/platform/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/devices/platform/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/devices/platform/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/devices/platform/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/devices/platform/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 />
==== 实时时钟 ====<br />
<br />
The real-time clock, including the alarm feature, is implemented as standard RTC (/dev/rtc).<br />
<br />
==== 看门狗 ====<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 />
==== 电池温度 ====<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 />
== 内核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设备驱动 ===<br />
* test switching between usb host and usb device<br />
<br />
=== Power Management ===<br />
* test, debug and fix suspend on user request<br />
* test, debug and fix wakeup on<br />
** IRQ on serial UART (GSM)<br />
** IRQ on serial UART (GPS)<br />
** IRQ from PMU (charger insert/remove or the like)<br />
** IRQ from ADC/touchscreen<br />
** 911 button press (GPIO IRQ)<br />
** headphone jack insert/remove<br />
{{Languages|Kernel}}</div>Sunlthttp://openmoko.org/wiki/Main_Page/zh_cnMain Page/zh cn2008-05-14T08:31:17Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Main_Page}}<br />
__NOTOC__<br />
__NOEDITSECTION__<br />
__NOTOC__<br />
<br />
<DIV ALIGN=CENTER><big>欢迎加入[[Openmoko]]&trade; 公共维基'''</big><br></DIV><br />
<BR><br />
<br />
==<font color=75d806>简介</font>==<br />
<br />
[[Image:GTA02.gif|150 px|right|frontside]]<br />
<br />
Openmoko™ 是一个开源软件项目,目的是建立全球第一个自由的移动通讯操作系统平台,此平台运行在X server之上,并能运行大多数的X应用程序。<br />
<br />
Openmoko项目是一个社区,所有的人都可以加入,协助设计他们理想中的手机。你可以将Openmoko 软件安装在各个 [[OpenMoko-supported hardware/zh cn|Openmoko 支持的硬件]],并且更新手机时,软件不会遗失。<br />
<br />
<div align=center><br />
{| class="wikitable" cellspacing="0" cellpadding="0" width=60%<br />
! width=30% style="background:#ff6600;border-left:0px solid white;border-right:0px solid white;border-top:0px solid white;" | <font color=white>简介</font><br />
! width=30% style="background:#ff6600;border-left:0px solid white;border-right:0px solid white;border-top:0px solid white;" |<br />
|-<br />
|valign="TOP" style="background:#333333;border-left:0px solid white;border-right:0px solid white;border-bottom:0px solid white;" | <br />
<div align="left"><br />
:*[[OpenMokoFramework|Openmoko软件架构图]]<br />
:*[[Meet_the_Core_Team|核心团队]]<br />
:*[[Introduction|Openmoko 简介]]<br />
:*[[Trademark Policy|商标]]<br />
:*[[License|授权]]<br />
</div><br />
|valign="TOP" style="background:#333333;border-left:0px solid white;border-right:0px solid white;border-bottom:0px solid white;" |<br />
* [[Look & Feel|外观]]<br />
* [[Introduction/zh_cn|简介]]<br />
* [[Introduction/zh_cn#照片|照片]]<br />
* [[Introduction/zh_cn#视频|视频]]<br />
* [[FAQ/zh_cn|常见问题与解答]]<br />
|}<br />
<b><font color=426fdc>▲ 获取更多与Openmoko相关信息</font></B><br />
</div><br />
<br />
==<font color=75d806 >Openmoko支持的硬件</font>==<br />
<br />
[[image:FIC-neo1973 small.jpg|100px|left|frontside]]<br />
<br />
来自 [[FIC]] 的 [[Neo1973]] 是运行 Openmoko 的第一款手机,目前已销售完毕 (Feb 11 2008),可以在[https://direct.openmoko.com/ Openmoko 网络商店]找到销售信息 。目前,[[Neo FreeRunner/zh cn|Neo FreeRunner]] 尚未销售,您可以在此页面上找到最新的开发与更新信息。你可以把你的名字加到我们的,[[Buying_Interest_List|Neo FreeRunner 购买名单]]里,我们后续会发送信息给您。<br />
<br />
<div align=center><br />
{| class="wikitable" cellspacing="4" cellpadding="4" width=80%<br />
! width=40% style="background:#ff6600;border-left:5px solid white;border-right:5px solid white;border-top:0px solid white; border:1px solid #ff6600; " |<font <br />
<br />
color=white>GTA 01</font><br />
! width=40% style="background:#ff7c11;border-left:5px solid white;border-right:5px solid white;border-top:0px solid white; border:1px solid #ff6600;" |<font <br />
<br />
color="ffffff" >FreeRunner-GTA02</font><br />
|-<br />
|valign="TOP" style="background:#333333;border-left:5px solid white;border-right:5px solid white;border-bottom:0px solid white; border:1px solid #cccccc; " | <br />
<div align=left><br />
*[[Neo1973]]<br />
*[[Neo1973 hardware |Neo 1973硬件规格]]<br />
*[[Disassembling Neo1973|Neo 1973拆解图]]<br />
*[[Neo1973 Phase 1]]<br />
*[[Getting Started with your Neo1973|开始使用你的Neo 1973]]<br />
=====<font color=white>调试板</font>=====<br />
*[[Neo1973 Debug Board v2|Neo 1973 v2调试板]]<br />
*[[Neo1973 Debug Board v3|Neo 1973 v3调试板]]<br />
=====<font color=white>开发板</font>=====<br />
*[[QT2410]]<br />
<br />
<font color=white> ※</font>[[: Category:Neo1973 Hardware |参考更多关于Neo 1973的相关文章....]]<br />
|valign="TOP" style="background:#333333;border-left:5px solid white;border-right:5px solid white;border-bottom:0px solid white; border:1px solid #cccccc; " |<br />
<div align=left><br />
*[[GTA02 Openness|了解GTA02]]<br />
*[[Neo FreeRunner/zh cn|Neo FreeRunner]]<br />
*[[Neo FreeRunner GTA02 Hardware/zh cn|Neo FreeRunner 硬件规格]]<br />
*[[Getting Started with your Neo FreeRunner/zh cn|Neo FreeRunner使用手冊]]<br />
*[[Prototypes|原型机]]<br />
<br />
<font color=white> ※</font>[[: Category: GTA02 Hardware | 查阅更多与GTA02相关的信息....]]<br />
====<font color=white>Openmoko定制套件</font>====<br />
*[[OpenMoko-supported hardware/zh cn|支持硬件]]<br />
*[[HXD8]]<br />
*[[Neo1973: GTA01Bv4 versus GTA02 comparison/zh cn|Neo1973: GTA01Bv4 及GTA02 比较]]</div><br />
<div align=left><br />
<font color=white> ※</font>[[:Category:Hardware Support | 参考更多关于支持的硬件平台文章...]]<br />
</div><br />
|}<br />
<b><font color=426fdc>▲ 由此取得更多Openmoko 手机平台信息</font></B><br />
</div><br />
<br />
==<font color=75d806>Openmoko 社区</font>==<br />
<br />
[[Openmoko]]是由社区共同开发而成长的。任何使用者都可以加入我们,与我们共同开发手机上的软件,成为社群中的一份子。请透过WIKI或[[Development resources | 任何项目资源]] 加入我们的社群。<br />
<br />
如果您是第一次参欢我们的首页,请参考[[introduction|基本介绍]] 页、 取得[[Introduction#Photos|照片]]、 [[Introduction#Videos|影片]] 及 [[Openmoko Wiki Official Index Page|Openmoko官方索引页]],取得更多关于Openmoko wiki的更多信息。或者,透过[[FAQ | Frequently Asked Questions|常见问题]] 及 [http://lists.openmoko.org/mailman/listinfo/| 邮件列表] 页,取得更多相关的帮助。<br />
<br />
{| class="wikitable" cellspacing="4" cellpadding="6" width=100%<br />
! width=50% style="background:#ff6600;border-left:5px solid white;border-right:5px solid white;border-top:0px solid white; border:1px solid #ff6600; " | <br />
<br />
<font color="white" >最新消息</font><br />
! width=50% style="background:#ff6600;border-left:5px solid white;border-right:5px solid white;border-top:0px solid white; border:1px solid #ff6600;" |<font <br />
<br />
color="white" >社群与社群活动</font><br />
|-<br />
|valign="TOP" style="background:#333333;border-left:5px solid white;border-right:5px solid white;border-bottom:0px solid white; border:1px solid #cccccc; " | <br />
==<font color=white>由此开始</font>==<br />
*[[Getting Started with your Neo FreeRunner|认识Neo FreeRunner]]<br />
*[[Getting Started with your Neo1973| 认识Neo 1973]]<br />
==<font color=white>Snapshot</font>==<br />
*<font color=white>你可以至[http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/ 最新下載] 取得最新的映像档。<br />
*在[[Snapshot_review| 每日更新映像档]]取得 、[http://downloads.openmoko.org/recommended/ KERNEL及ROOT映像档]。 <br />
在此取得的档案皆为最新的映像档更新,但不代表其为最稳定、可靠及所有功能为可运作的档案。</font><br />
|valign="TOP" style="background:#333333;border-left:5px solid white;border-right:5px solid white;border-bottom:0px solid white; border:1px solid #cccccc; " |<br />
==<font color=white> 社群信息</font>==<br />
<font color=white>要取得社群最新消息,可参考[[Community_Updates|社群最新更新信息]]</font><br />
<br />
<font color=ffffff> ※</font>[[:Category:Community| 查阅更多与社群相关之文章...]]<br />
<br />
==<font color=white>暸解维基</font>==<br />
*<font color=white>要暸解Openmoko维基的所有信息,请参考 [[Openmoko Wiki Official Index Page|Openmoko 维基官方索引页]].</font><br />
==<font color=white>活动</font>==<br />
*[[Summer of Code 2008]]<br />
*[[OpenMoko Education/zh tw|台湾区校园教育训练活动]]<br />
*[[Events:FOSDEM 2008|FOSDEM 2008]]<br />
*[[OpenMoko Education Interview|Openmoko教育训练活动一览]]<br />
<br />
<font color=ffffff> ※</font>[[:Category:Event| 查阅更多社群活动之信息...]]<br />
<br />
|}<br />
<b><font color=426fdc>▲加入社群</font></B><br />
</div><br />
<br />
<br />
==<font color=75d806>成为Openmoko开发人员</font>==<br />
<br />
Openmoko是专为开发手机装置的平台,您可以自[[Openmoko]] 软件框架取得更多的信息。如果您有志成为Openmoko手机平台的开发人员,下列的技术文件,有助于您取得进一步的开发信息。<br />
<br />
{| class="wikitable" cellspacing="4" cellpadding="6" width=100%<br />
! width=50% style="background:#ff6600;border-left:5px solid white;border-right:5px solid white;border-top:0px solid white; border:1px solid #ff6600; " | <br />
<br />
<font color="white" >硬件文件及测试计划</font><br />
! width=50% style="background:#ff6600;border-left:5px solid white;border-right:5px solid white;border-top:0px solid white; border:1px solid #ff6600;" |<font <br />
<br />
color="white" >软件技术文件</font><br />
|-<br />
|valign="TOP" style="background:#333333;border-left:5px solid white;border-right:5px solid white;border-bottom:0px solid white; border:1px solid #cccccc; " | <br />
===<font color=white>开始</font>===<br />
* [[Installation guide|安装指南]]<br />
* [[Customizing the Openmoko Distribution/zh cn|客制化Openmoko套件]]<br />
* [[Getting Started with your Neo1973|开始使用Neo 1973]]<br />
* [[MokoMakefile|使用MokoMakefile]]<br />
* [[Building OpenMoko from scratch (pre-BBT)|建立Openmoko]]<br />
* [[Migration to bad block tolerant builds|套件整合]]<br />
<br />
<font color=white> ※</font> [[:Category:Guides| See More About Guides...]]<br />
===<font color=white> 硬件技术文件</font> ===<br />
<br />
<font color=white>组件、PCD图片一览</font><br />
** [[Disassembling Neo1973]] <font color=white>-拆解Neo 1973</font><br />
* [[Debug Board]] <font color=white> -Neo1973除错板<font><br />
** [[Connecting Neo1973 with Debug Board v2|Neo 1973 除错板]]<br />
** [[Neo1973 Debug Board v1]] <font color=white>-旧版之除错板</font><br />
* [[QT2410]] <font color=white>-早期所使用之 S3C2410 开发板</font><br />
<font color=white> ※</font>[[:Category: Hardware | 参考更多硬件相关信息...]]<br />
===<font color=white>测试</font>===<br />
*[[GSM unit test|GSM单元测试]]<br />
*[[GSM 850 test|GSM 850测试]]<br />
*[[Test Plans|测试计划]]<br />
<font color=white> ※</font> [[:Category: Test | 参考更多与测试有关之信息...]]<br />
<br />
===<font color=white>模拟</font>===<br />
*[[Getting OpenMoko working on host with Xephyr|在Xephy下使用Openmoko]]<br />
*[[Test_Openmoko Emulation with chroot image|使用chroot影像文件测试Openmoko仿真]]<br />
<br />
|valign="TOP" style="background:#333333;border-left:5px solid white;border-right:5px solid white;border-bottom:0px solid white; border:1px solid #cccccc; " |<br />
<br />
=== <font color=white>软件参考文件</font>===<br />
* <font color=white>架构</font><br />
** [[OpenMokoFramework]] <font color=white>-Openmoko应用程序架构</font><br />
* <font color=white>Host utilities</font><br />
** [[sjf2410-linux]] <font color=white>-JTAG NAND flashing program, last-resort phone un-bricking</font><br />
** [[s3c2410_boot_usb]] <font color=white>-转换RAM到QT2410 之程序(非Neo1973)</font><br />
** [[Toolchain/zh cn|Toolchain]] <font color=white>-用于编译的程序工具</font><br />
** [[Neo1973 OpenOCD]] <font color=white>-用于侦错的On-Chip Debugger</font><br />
** [[OpenEmbedded]] <font color=white> -建立套件之框架</font><br />
* <font color=white>装置软件</font><br />
** <font color=white>低阶</font><br />
*** [[Bootloader/zh cn| u-boot]] <font color=white>bootloader </font><br />
*** [[kernel]] <font color=white>- Linux Kernel及修改之相关文件内容</font><br />
** <font color=white>Userspace</font><br />
*** [[gsmd]] <font color=white> - 管理GSM调制解调器之daemon </font><br />
*** [[agpsd]] <font color=white>-AGPS (支援GPS) daemon</font><br />
*** [[OpenMoko]] <font color=white>-Openmoko套件</font><br />
**** [[OpenMoko2007]] - <font color=white>第一支释出之套件</font><br />
**** [[Userspace root image]]<br />
<br />
<font color=ffffff>※</font>[[:Category: Software | 参考更多关于软件之文章... ]]<br />
<br />
|}<br />
<b><font color=426fdc>▲ 你可以由此取得更多的技术信息</font></B><br />
<br />
==<font color=75d806>加入Openmoko维基小组</font>==<br />
<br />
Openmoko 维基是一个开放式的园地,任何人都可以加入维基编辑小组的行列。在维基百科里,你可以取得任何与Openmoko技术相关的信息,并且取得更多的社群资源。加入讨论组、参与社群活动,或在维基百科中留下您希望的手机功能...等信息,都是让您的声音被世界听到的最佳方法。<br />
<br />
当然,我们更欢迎您加入我们的维基百科中文计划。您可以主动申请维基百科的账号,并且加入编辑的行列。<br />
欢迎您加入编辑计划,您可以主动的将英文网页,翻译成为中文网页,让信息可以提供给华语系的使用者使用。或者,您也可以将个人研究心得,写在维基百科上,与全世界的人分享你的开发计划。<br />
<br />
要暸解Openmoko维基,您可以藉由[[Openmoko Wiki Official Index Page|Openmoko 维基官方索引]]取得所有的文章信息。或者请详阅我们的[[OpenMoko Wiki Editing Guidelines|Openmoko 编辑手册]],取得更多编辑信息。或透过下列连结,得到更多的支持:<br />
<br />
* [http://www.mediawiki.org/wiki/Help:Configuration_settings 设定清单]<br />
* [http://meta.wikimedia.org/wiki/Help:Wikitext_reference MediaWiki Wikitext 参考]<br />
* 若您新加入了一个文章页面,请参考[[Openmoko Wiki Categories Index Page|Openmoko Wiki 索引页]] ,将您的文章页面做最详尽的分类,方便社群快速找到您的文章页面。 <br />
* [http://www.mediawiki.org/wiki/Help:FAQ MediaWiki FAQ]<br />
<font color=ffffff>※</font>[[:Category: Help | 查阅更多辅助说明...]]<br />
{| cellspacing="5" cellpadding="0" style="padding: 2%; margin:0em 0em 1em 0em; border:1px solid #c8bbbf; background:#ECE5B6; width:100%" <br />
| 简体中文仍在翻译中,欢迎华文环境的朋友协助[[OpenMoko Wiki Traditional Chinese Translation/zh_tw|列出及共同翻译需要中文翻译的页面]]。<br />
<br />
|}<br />
<br />
[[Category:Information| ]]<br />
[[Category:Categories| ]]</div>Sunlthttp://openmoko.org/wiki/User_talk:SunltUser talk:Sunlt2008-04-30T03:23:55Z<p>Sunlt: </p>
<hr />
<div>您好, 我把toolchain的文章翻好了,您有空的話,可以幫我順一下簡體中文的用法。因為我們是用繁體中文譯的。<br />
謝謝! --Coolcat<br />
<br />
我已经将toolchain 和 bootloader修改完毕,谢谢提醒。 --sunlt</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2008-04-30T03:23:15Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Bootloader}}<br />
[[Image:GTA01-U-Boot.JPG|thumb|300px|u-boot menu on Neo1973]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|u-boot splash screen on Neo1973]]<br />
<br />
[[Neo1973]]上的bootloader '''U-Boot''',在 [[Openmoko]]启动之前负责设备的功能运作,包括用来[[Flashing openmoko/zh|烧写OpenMokoFLASH]]的 [[USB DFU]]、屏幕显示、启动选单、[[bootloader commands|bootloader 命令]] 控制台、通过[[bootloader environment|bootloader 环境]]配置和加载[[kernel | 内核]]等。<br />
<br />
有不同的[[bootloader versions|bootloader版本]]可供使用:<br />
<br />
== Phase0 快速启动==<br />
* 请确认你的Neo手机已装好电池,并且USB连接线已被拔出至少30秒。<br />
* 通过USB接线,将Neo (并不是调试板) 连接到Linux主机。<br />
* 在启动电源时,按住AUX按钮以访问启动菜单。<br />
* 将控制台设定为USB。<br />
* 在Linux主机上通过终端Terminal连接到/dev/ttyACM0 (你可能会用到chown uucp.uucp /dev/ttyACM0 )。<br />
* 请注意cdc_acm /dev/ttyACM0 访问会在Neo启动后消失,它会被cdc_ether usb0网络访问取代。<br />
* 你现在会看见bootloader提示指令。<br />
* 如果你希望在每次启动时都停留在bootloader,可将bootdelay uboot环境变量设定为-1 。<br />
<br />
== 一般 ==<br />
GTA01 使用[http://u-boot.sourceforge.net/ u-boot] bootloader.<br />
<br />
关于u-boot的更多信息,可以参考下列网址: <br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
您也可以参考下面的内容,得到其它u-boot的信息: <br />
* 使用[[S3C2410 Steppingstone]]支持从NAND 中启动<br />
* 支持S3C2410 NAND 内存<br />
* 支持透过S3C2410 USB 装置控制器下载程序<br />
* 支持在S3C2410 Framebuffer中显示启动logo / 状态 <br />
然而,u-boot并不会支持GTA01所需要的功能,如<br />
*支持从SD/Transflash读取kernel/initrd <br />
<br />
[[User:HaraldWelte|HaraldWelte]]目前正在进行这项工作,事实上,已完成大部份的工作。<br />
<br />
== Bootloader 源码==<br />
目前的bootloader patche 可以在[http://svn.openmoko.org/trunk/src/target/u-boot/patches/| http://svn.openmoko.org/trunk/src/target/u-boot/patches/这个位置]]下位置取得。. <br />
<br />
将源码解压缩缩,套用到patch,执行"make gta01bv3_config" (或gta01bv2_config, 或你拥有的任何硬件版本),执行"make"。你将会得到"u-boot.bin" 映像档,你可以在NAND中直接更新 (也可以使用现有的bootloader 或 [[sjf2410-linux]])。<br />
<br />
<br />
== Bootloader 二进制文件==<br />
<br />
最新的bootloader 二进制文件可以在以下的位置中找到under http://buildhost.openmoko.org/snapshots in the subdirectory 200X.XX/images/。它应该被写入NAND 0x00000000的位置 (大小为0x30000) (第一个 [[partition|分割区]]).<br />
<br />
== 开发Bootloader ==<br />
<br />
=== QT2410 ===<br />
如果你想要在QT2410上开发bootloader,使用bootloader 映像档更新会从USB上下载到RAM来的简单的多。<br />
要进行这项工作,你必须编辑u-boot/include/configs/qt2410.h 档案,并且将第32行程序中的"if 0"变更为 "if 1",之后再使用"make"重新编译。<br />
<br />
产生的"u-boot.bin" 档案对于NAND内存并不稳定,但却可以直接或在RAM中执行,如透过使用[[s3c2410_boot_usb]] 程序。<br />
<br />
=== GTA01 ===<br />
<br />
在GTA01上开发bootloader是很辣手的一件事情,首先,我们并不会有任何的NOR内存。第二,并没有其它的方法可以不从NAND中启动。然而,我们也不会有一个像QT2410一样的USB下载器。<br />
<br />
最主要的问题是:[[S3C2410 Steppingstone]]内部的SRAM的前4K并没有被限制。SRAM 分割并非绝对性的对应到实体0的位置。我们要如何因应呢?<br />
<br />
==== 使用JTAG 自RAM中启动====<br />
那我们要如何自RAM启动?我们使用JTAG / OpenOCD 进行:<br />
<br />
* 在PC=0的时候重设及暂停CPU<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* 针对低阶SDRAM启动下载程序片段 (做为4k的sram踏脚石)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/board/gta01/lowlevel_foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* 在0x33f80000插入断点 (能指出低阶程序已完成)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
在0x33f80000 中加入断点<br />
</pre><br />
<br />
* 执行程序到断点<br />
<pre><br />
> resume<br />
Target 0 重新开始<br />
> Target 0 halted<br />
因断点的关系,目标暂停,目前的模式为:Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* 下载u-boot RAM映像档到0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* 继续处理<br />
<pre><br />
> resume<br />
Target 0 重新开始<br />
</pre><br />
<br />
在进行到这里时,显示的背光会变明亮,我们会看到下面的指令:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可启动的映像档 ==<br />
<br />
u-boot 需要可启动的映像档 (如kernels,也包括 initrd 及其它内容) ,形成所谓的''uImage''。为了建立''uImage'',如从''vmlinux'' kernel 映像档,你可以进行下面的处理:<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 启动选单==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
从Phase-0 释出后,我们的u-boot版本现在放在以屏幕显示的启动选单中,选单中的项目被定义在[[bootloader environment#menu|环境选单输入]]中。<br />
<br />
=== 存取启动选单===<br />
<br />
你可以在启动电话时,藉由按下[[Neo1973 AUX Button]] 及电源按钮来存取选单。<br />
<br />
=== 使用启动选单===<br />
<br />
藉由按下[[Neo1973 AUX Button]] 你可以循环使用选单项目。使用''POWER''按钮选取其中的项目。<br />
<br />
== Bootloader 命令提示==<br />
<br />
===存取bootloader的命令提示===<br />
bootloader 命令提示可以在序列控制台上进行 (透过[[Debug Board]]) 或者是虚拟USB 序列装置(USB CDC_ACM)。<br />
不论是串行端口或usb,都依照'''stdin'''、 '''stdout''' 及 '''stderr''' u-boot 环境变量而定。<br />
<br />
不论你是否使用usbtty,前面的讯息会在序列控制台中显示。bootloader 目前被设定为三秒钟的等待时间。如果在 三秒内,'''stdin'''中收到键入的讯息,自动启动就会被取消掉。<br />
<br />
==== 自Linux中使用usbtty ====<br />
<br />
藉由在u-boot模式下连接电话到Linux 主机上,它会让它侦测到 [[CDC ACM]] 装置,你会拥有一个名为/dev/ttyACM0的新tty装置。若没有的话,请启用CONFIG_USB_ACM (Device Drivers -> USB support -> USB Modem (CDC ACM) support)。 (MacOS 的使用者请参考[[MacOS_X#USB_Serial|这里取得更多信息]])<br />
<br />
使用你熟悉的仿真器 (minicom, cu, zc, screen ...) 像使用任何串行端口般存取。如果你并没有熟悉的仿真器,可以试试看: (位于taylor-uucp 中的cu,使用"apt-get 安装 cu" 如果它还未安装话。<br />
cu -l /dev/ttyACM0<br />
<br />
你会需要用到 <br />
chown uucp.uucp /dev/ttyACM0<br />
<br />
取得必要的权限(甚至是root)<br />
<br />
可以用来取代cu的另一个方法是 Werner Almesberger的 [[NeoCon|neocon]]。<br />
<br />
首先,你必须试着去查看在你执行u-boot模式时,USB装置是否出现了'lsusb' 。<br />
<br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
<br />
接着,让我们来查看更多可用的endpoint及设定:<br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
接下来,你可以使用你最喜欢的终端机程序存取它。之后,若环境仍然不正确的话,你必须使用目前的控制台(如序列控制台(serial console)) 来变更[[bootloader environment#console|控制台环境下的输入选项]]:<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== 典型的u-boot提示字符====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== bootloader 提示字符下的指令===<br />
<br />
'请参考[[bootloader commands|bootloader 指令集]].''<br />
<br />
<br />
== 装置轫体更新==<br />
<br />
u-boot也可以使用[[USB DFU]]做为更新工具。对于快速测试下的加载档案及kernel而言,是很有效的一个方法。<br />
要找出你的u-boot版本是否支持这个USB DFU,请使用下面的方法:<br />
$ lsusb -v -d 1457:5119<br />
当装置目前使用的是u-boot模式。<br />
<br />
如果它支持DFU,你可以在输出的讯息后面看到以下的内容:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
要查看韧体如何更新,请参考[[dfu-util]]。<br />
<br />
=== 透过DFU置入档案 ===<br />
<br />
要将档案加载内存位置0x32000000:<br />
<pre><br />
dfu-util -a 0 -D fileToLoad -R<br />
</pre><br />
<br />
之后,传送'bootm 0x32000000' 到u-boot或者 'bootelf 0x32000000',如果它是一个elf档案。<br />
<br />
简单的python script可以启动ELF映像档—以防止ACM bug破坏较大的封包。<br />
<br />
<pre><br />
#!/usr/bin/python<br />
import sys<br />
import os<br />
import time<br />
<br />
cmd1 = "neo backlight off\n"<br />
cmd2 = "bootelf 0x32000000\n"<br />
<br />
def output(tty, str):<br />
for x in str:<br />
tty.write(x)<br />
tty.flush()<br />
<br />
if len(sys.argv) == 2:<br />
print "Loading %s..." % sys.argv[1]<br />
<br />
loadfile = "dfu-util -a 0 -D %s -R" % sys.argv[1]<br />
<br />
os.system(loadfile)<br />
<br />
time.sleep(3)<br />
<br />
tty = open("/dev/ttyACM0", "a")<br />
<br />
output(tty, cmd1)<br />
output(tty, cmd2)<br />
<br />
tty.close()<br />
else:<br />
print "Usage: %s elffile" % sys.argv[0]<br />
print ""<br />
sys.exit(2)<br />
</pre><br />
<br />
== 问题排除 ==<br />
<br />
=== USB连接问题 ===<br />
<br />
在连接Neo时,位于u-boot下,在Linux主机上,我曾经遇到如下的问题 (在 dmesg or /var/log/messages) o。<br />
<br />
usb 2-1: device descriptor read/64, error -110<br />
usb usb2: Controller not stopped yet!<br />
<br />
利用下面的指令,我解决掉上述的问题。请注意,如果你没有USB键盘或者是鼠标,用这些指令可能会造成问题。 我只有PS/2界面的装置,所以,并无法测试这个问题。<br />
<br />
rmmod uhci_hcd ; modprobe uhci_hcd<br />
<br />
<br />
<br />
[[Category:Software]]<br />
[[Category:Kernel]]<br />
[[Category:Guides]]</div>Sunlthttp://openmoko.org/wiki/User_talk:SunltUser talk:Sunlt2008-04-30T03:10:39Z<p>Sunlt: </p>
<hr />
<div>您好, 我把toolchain的文章翻好了,您有空的話,可以幫我順一下簡體中文的用法。因為我們是用繁體中文譯的。<br />
謝謝! --Coolcat<br />
<br />
我已经修改完毕,谢谢提醒。 --sunlt</div>Sunlthttp://openmoko.org/wiki/User_talk:SunltUser talk:Sunlt2008-04-30T03:10:00Z<p>Sunlt: </p>
<hr />
<div>您好, 我把toolchain的文章翻好了,您有空的話,可以幫我順一下簡體中文的用法。因為我們是用繁體中文譯的。<br />
謝謝!<br />
<br />
我已经修改完毕,谢谢提醒。 --sunlt</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_twToolchain/zh tw2008-04-30T03:08:50Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 簡介=<br />
<br />
Toolchain是一整組可以讓你編譯檔案的工具。針對Openmoko,你可以依下列不同的用途使用不同的工具。<br />
<br />
== 開發單一應用程式==<br />
針對這個用途,你應該可以使用針對Openmoko專案所預先建立好的toolchain。在這裡你可以找到如何使用toolchain的方法,帶領你進入編譯專案的一連串程序,並且讓程式能順利的在你的手持式裝置上執行。你應該聽過 [[OpenEmbedded]],身為一個程式開發人員,你應該’’’不要’’’使用[[OpenEmbedded]]。<br />
<br />
==系統整合及客製化套件==<br />
針對系統整合及客製化套件,在ootstrapping/build process時,你應該使用[[OpenEmbedded]]來建立cross compiler。系統整合及套件客製化整合等問題,超過本文章所要討論的問題,因此在此不加以討論。<br />
<br />
<br />
=基本的toolchain 環境需求=<br />
<br />
==基本安裝條件==<br />
熟悉Linux 及其基本的指令工具是最基本的,你必須有x86相容,至少1G的磁碟空間。你也必須要有使用本機編譯器來編譯原始碼的相關操作經驗。在此,提醒您,本篇文章是假設你有存取/home及/usr/local/ 目錄的權限 (有需要時,需成為root)。如果你沒有上述的權限,請與你的管理人員連絡。<br />
<br />
你至少應該能使用安裝程式的權限,允許你使用autotools編譯套裝軟體。(the triade of '''./configure, make, make install''').<br />
<br />
需要安裝的軟體—有需要請加入以下 的套件:<br />
* 針對大部份版本的Linux ,你可能只需要安裝以下的軟體:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 針對 ubuntu (7.10) ,則需要安裝以下的套件:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下載及安裝==<br />
<br />
toolchain 可以自 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下載:<br />
<br />
* 在電腦中建立一個目標目錄位置,如:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 依您的CPU 類型 (x86_64 or i686) 下載合適的套件:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接著,你想要將它解壓縮到檔案系統時,toolchain 它必須安裝到<tt>/usr/local/openmoko/</tt>.<br />
<br />
現在,你有以下的選項:<br />
* 將它直接解壓縮到root請使用"su" (或者若您使用的是Debian/Ubuntu,在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在Debian-based 系統上,你可以使用alien(+fakeroot)自.tar.bz2來建立一個易於安裝的套件 (使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 預建的toolchain是針對x86_64或i686。如果你希望的話,你可以使用OE建立自己的toolchain:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最後,每次你想要使用這個工具時,必須改變環境變數,這樣才會找到要用的工具。Toolchain提供了script進行這項工作,因此你必須做的事只是取得它。<br />
<br />
請注意,如果你並沒有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必須啟動"sh" 或"bash"。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==建立一個範例專案==<br />
<br />
在選定的目標目錄位址中 (在本範例中為~/):<br />
<br />
* 複製下載的範例應用程式原始碼:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 請記得設定適當的環境變數 (使用"sh" 或 "bash")提供給Openmoko使用。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你必須為這個應用程式建立一個設定值,這個也可以用來檢查你的系統上可以使用的所有必須的程式庫、工具…等。如果這項工作無法完成時,請參考"需求環境"一節,取得更多資訊。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 現在你可以選擇性的修改openmoko-sample2/src 中的源碼。<br />
<br />
* 要從源碼中建立應用程式,你應該使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主機上安裝這個專案,你可以利用下面的操作,將它安裝到一個現有的設定中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改範例專案==<br />
<br />
為了要使用Openmoko-sample2 檔案來製作你自己的專案,某些變更是必須的: * 複製下載的範例應用程式:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 將檔案夾以你的專案名稱命名 ( 在這個範例中為your-project-name) ,並刪除舊有的範例檔案。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* copy your sources (in this example your-sources) into src/<br />
<br />
cp your-sources .<br />
cd ..<br />
<br />
* 現在,在主要的檔案夾中,使用下面的指令修改autogen.sh 。<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 藉由更新下面的內容修改configure.ac <br />
AC_INIT(your-project-main, 0.0.1, http://www.openmoko.org/) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 到data/ 檔資夾,並且重新將這些檔案命名: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 用下列的指令修改data/下的Makefile.am 檔案。<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 透過修改下面的內容,修改data/路徑下的 Makefile.in<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 透過下面的內容,修改your-project-name:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
*加入以下的內容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切換到src/ 資料夾<br />
<br />
cd ..<br />
cd src<br />
<br />
* 藉由更新下面的程式,修改Makefile.am<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 請確認除了 main.c 外,修改,將所有的.c 及.h 檔案 參數名稱的 '-' 字元修改為 '_' 。<br />
<br />
==封裝你的應用程式==<br />
<br />
我們已經加入了一個script在你的應用程式外製作了ipkg 。請注意這並不是要在Neo上測試你的應用程式 ( 若你要測試應用程式,你只要使用SCP產出的二進位碼及資料),它對於想你將你的軟體發佈給其它人而言,相當方便。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
現在你已經取得了openmoko-sample2_0.1_armv4t.ipk ,你可以將它`scp' 到你的Neo,並且安裝它。<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
請注意當你重新發佈產生的ipkg ,請注意它只是一個有更多資訊的ipk骨架,若你無法取得程式庫的獨立性。查看下面的內容來暸解如何修復這個問題。<br />
你也可以在控制檔中提出這個版本的編號,描述及作者/連絡方式。<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的範本:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==從這裡出發的目的地==<br />
<br />
使用外部的 toolchain是一個為Neo建立程式的好方法。如果你熟悉這個產品的話,你也會想要參考:<br />
* 使用[[Qemu]] 在模擬環境下測試應用程式<br />
** Ubuntu使用者可能想要查看[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 加強效能<br />
* 使用[[OpenEmbedded]] 客製化你的Openmoko套件映像檔<br />
<br />
=進階議題=<br />
==使用 toolchain 提供的程式庫==<br />
加入必要的程式庫到src/Makefile.am 的 _LDADD 欄位,如:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之後,請確定再次執行<br />
om-conf <br />
<br />
==將其它的程式庫安裝到toolchain==<br />
不久之後,你會想要編譯一個無法透過預先編譯toolchain來完成依存性的程式,’如一些obscure libraries。<br />
<br />
在這樣的案例當中,請放心的將其它的libraries 放到下一次釋出的Openmoko toolchain。以下是你如何擴充 toolchain安裝。也就是說,我們想要加入一個名為liburiparse的程式庫:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE包裝應用程式==<br />
當你撰寫了一支很好的應用式,而你想要與其它人分享,最佳的方式是<br />
# 上傳你的程式原始碼到公共的區域<br />
# 送出[[BitBake]]到[[OpenEmbedded]],最好的方法是透過[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以參考 [[Customizing your OpenMoko distribution|客製化你的Openmoko套件]].<br />
<br />
==問題排除==<br />
<br />
* 請使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 郵件清單來取得更多幫助。<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-04-30T03:04:50Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集,Openmoko有两类不同用途的工具链。<br />
<br />
== 基本工具链:用于开发简单的单一应用程序 ==<br />
<br />
为了开发简单的单一应用程序,你可以使用针对Openmoko项目预先构建好的工具链。本文将说明这一工具链的使用方法,它将帮助你一步步的编译项目并最终运行在目标设备上。你应该听过[[OpenEmbedded]],但作为开发此类应用程序的开发人员,你’’’不’’’应该使用[[OpenEmbedded]]。<br />
<br />
== [[OpenEmbedded]]:用于系统集成和定制发行版 ==<br />
<br />
针对系统集成和定制发行版的任务,你应该使用[[OpenEmbedded]],它能通过bootstrapping/build流程建立起自己的交叉编译工具链。系统集成和定制发行版未在本文加以讨论。<br />
<br />
=基本工具链的用法=<br />
<br />
==基本安装条件==<br />
熟悉Linux及其命令行工具是最基本的,你必须有一台x86兼容的、最少有1G磁盘空间的电脑。你也必须要有使用本地编译器来编译程序源码的相关操作经验。同时,假设你有home目录(~)和/usr/local/目录(有需要时,需使用root用户来操作)的写权限。如果你没有上述的权限,请与管理员联系。<br />
<br />
你至少应该具有使用安装程序的权限,允许你使用自动工具构建软件包。(比如'''./configure, make, make install''')。<br />
<br />
需要安装的部分软件如下:<br />
* 针对大多数Linux发行版,需要安装如下软件包:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 针对 ubuntu (7.10) ,需要安装以下软件包:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下载及安装==<br />
<br />
预构建的工具链可以从 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下载:<br />
<br />
* 在计算机中的任一位置建立目标文件夹,但推荐建立下述文件夹:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 下载与计算机CPU类型(x86_64或i686)匹配的软件包:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接着,要将它解压缩到文件系统。注意:此软件包必须安装到且会自动安装到<tt>/usr/local/openmoko/</tt>目录。<br />
<br />
* 切换到超级用户,然后解压缩。(请使用"su",若您使用的是Debian/Ubuntu,请在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在类Debian系统上,你可以使用alien(+fakeroot)来将.tar.bz2文件构建成一个易于卸载的软件包(使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 预构建的工具链是针对x86_64或i686的。如果你希望的话,你可以使用OpenEmbedded来建立自己的工具链:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最后,每次使用此工具链时,必须先改变环境变量,这样才会找到此工具链。此工具链提供了一个脚本来做这项工作。<br />
<br />
请注意,如果你并没有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必须先启动"sh" 或"bash"。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==构建示例项目==<br />
<br />
在目标文件夹中 (本文为~/):<br />
<br />
* 复制已下载的示例应用程序源文件:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 设定环境变量 (记得使用"sh" 或 "bash"):<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你需要为这个应用程序建立配置文件,这个过程也用来检查你的计算机上的函数库和工具等是否可用。如果这项工作无法完成时,请参考本文的"基本安装环境"一节。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 现在你可以选择性的修改openmoko-sample2/src 中的源码。<br />
<br />
* 要从源代码中构建应用程序,你应该使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主机上安装这个程序,作为后续使用的共享库,那么你可以进行如下操作来将它安装到指定目录中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改示例项目==<br />
<br />
为了要使用Openmoko-sample2 文件来制作你自己的项目,需要做适度修改:<br />
* 复制下载的示例应用程序:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 重命名文件夹 ( 在这个示例中为"your-project-name") ,并删除旧有的示例文件。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* 将你自己的源代码复制到src/目录(本示例中为"your-sources"):<br />
cp your-sources .<br />
cd ..<br />
<br />
* 现在,在主目录下,修改autogen.sh:<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 修改configure.ac文件("main.c"应该是项目中的主程序文件) <br />
AC_INIT(your-project-main, 0.0.1, [http://www.openmoko.org/ http://www.openmoko.org/]) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 切换到data/目录,以你的项目名重命名几个文件: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 修改data/下的Makefile.am文件:<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 修改data/下的 Makefile.in文件<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 修改your-project-name.desktop文件:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
* 在your-project-name.desktop文件加入以下的内容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切换到src/目录:<br />
<br />
cd ..<br />
cd src<br />
<br />
* 修改Makefile.am文件<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 请将main.c之外的所有.c和.h文件放入其中,并将变量名称中的 '-' 字符修改为 '_' 。<br />
<br />
==将你的应用程序打包==<br />
<br />
工具链中有一个脚本用来将应用程序制作为ipkg包。请注意,你并不需要在Neo手机上测试此应用程序 ( 若要在Neo手机上测试此应用程序,只需要使用scp将生成的二进制代码和数据传送到手机上即可),打成ipkg包也是为了方便发布给他人。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
现在你已经得到了openmoko-sample2_0.1_armv4t.ipk ,你可以使用"scp"将它传输到Neo手机并安装:<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
请注意:这个ipkg包并未包含控制信息,例如函数库的依赖关系,所以,如果你想分发此ipkg包,应该加入控制信息文件。你可以在控制信息文件中提供版本号、软件包描述、作者和联系方式等:<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的模板如下:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: [http://www.openmoko.org/ http://www.openmoko.org/]<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==你下一步要参考的内容==<br />
<br />
使用外部工具链来为Neo构建应用程序比较简单。如果你熟悉这个流程的话,你也会想要参考:<br />
* 使用[[Qemu]] 在仿真环境下测试你的应用程序<br />
** Ubuntu使用者可能想要查看的[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 提高效率<br />
* 使用[[OpenEmbedded]] 定制你的Openmoko发行版映像文件<br />
<br />
=高级主题=<br />
==使用工具链提供的链接库==<br />
向src/Makefile.am文件的 _LDADD 字段加入必要的链接库,示例如下:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之后,请再次运行<br />
om-conf <br />
<br />
==向工具链中安装附加函数库==<br />
不久之后,你也许想要编译一个应用程序,这个应用程序依赖于生僻的函数库,而这些函数库并未由预编译的工具链提供。<br />
<br />
这种情况下,你可以请求将附加的函数库放入下一版本的OpenMoko工具链,而在那之前,你可以通过如下方式增强现有的工具链。这里演示了如何向工具链中加入一个名为liburiparse的函数库:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE打包应用程序==<br />
当你编写了一个很酷的应用程序并想与他人分享,最佳方法是<br />
# 上传你的应用程序源代码到公共区域<br />
# 提交一个[[BitBake]]包到[[OpenEmbedded]],最好通过[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以参考 [[Customizing your OpenMoko distribution|定制化你的OpenMoko发行版]].<br />
<br />
==问题排除==<br />
<br />
* 请使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 邮件列表来获得帮助。<br />
<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-04-30T03:03:58Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集,Openmoko有两类不同用途的工具链。<br />
<br />
== 基本工具链:用于开发简单的单一应用程序 ==<br />
<br />
为了开发简单的单一应用程序,你可以使用针对Openmoko项目预先构建好的工具链。本文将说明这一工具链的使用方法,它将帮助你一步步的编译项目并最终运行在目标设备上。你应该听过[[OpenEmbedded]],但作为开发此类应用程序的开发人员,你’’’不’’’应该使用[[OpenEmbedded]]。<br />
<br />
== [[OpenEmbedded]]:用于系统集成和定制发行版 ==<br />
<br />
针对系统集成和定制发行版的任务,你应该使用[[OpenEmbedded]],它能通过bootstrapping/build流程建立起自己的交叉编译工具链。系统集成和定制发行版未在本文加以讨论。<br />
<br />
=基本工具链的用法=<br />
<br />
==基本安装条件==<br />
熟悉Linux及其命令行工具是最基本的,你必须有一台x86兼容的、最少有1G磁盘空间的电脑。你也必须要有使用本地编译器来编译程序源码的相关操作经验。同时,假设你有home目录(~)和/usr/local/目录(有需要时,需使用root用户来操作)的写权限。如果你没有上述的权限,请与管理员联系。<br />
<br />
你至少应该具有使用安装程序的权限,允许你使用自动工具构建软件包。(比如'''./configure, make, make install''')。<br />
<br />
需要安装的部分软件如下:<br />
* 针对大多数Linux发行版,需要安装如下软件包:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 针对 ubuntu (7.10) ,需要安装以下软件包:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下载及安装==<br />
<br />
预构建的工具链可以从 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下载:<br />
<br />
* 在计算机中的任一位置建立目标文件夹,但推荐建立下述文件夹:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 下载与计算机CPU类型(x86_64或i686)匹配的软件包:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接着,要将它解压缩到文件系统。注意:此软件包必须安装到且会自动安装到<tt>/usr/local/openmoko/</tt>目录。<br />
<br />
* 切换到超级用户,然后解压缩。(请使用"su",若您使用的是Debian/Ubuntu,请在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在类Debian系统上,你可以使用alien(+fakeroot)来将.tar.bz2文件构建成一个易于卸载的软件包(使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 预构建的工具链是针对x86_64或i686的。如果你希望的话,你可以使用OpenEmbedded来建立自己的工具链:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最后,每次使用此工具链时,必须先改变环境变量,这样才会找到此工具链。此工具链提供了一个脚本来做这项工作。<br />
<br />
请注意,如果你并没有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必须先启动"sh" 或"bash"。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==构建示例项目==<br />
<br />
在目标文件夹中 (本文为~/):<br />
<br />
* 复制已下载的示例应用程序源文件:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 设定环境变量 (记得使用"sh" 或 "bash"):<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你需要为这个应用程序建立配置文件,这个过程也用来检查你的计算机上的函数库和工具等是否可用。如果这项工作无法完成时,请参考本文的"基本安装环境"一节。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 现在你可以选择性的修改openmoko-sample2/src 中的源码。<br />
<br />
* 要从源代码中构建应用程序,你应该使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主机上安装这个程序,作为后续使用的共享库,那么你可以进行如下操作来将它安装到指定目录中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改示例项目==<br />
<br />
为了要使用Openmoko-sample2 文件来制作你自己的项目,需要做适度修改:<br />
* 复制下载的示例应用程序:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 重命名文件夹 ( 在这个示例中为"your-project-name") ,并删除旧有的示例文件。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* 将你自己的源代码复制到src/目录(本示例中为"your-sources"):<br />
cp your-sources .<br />
cd ..<br />
<br />
* 现在,在主目录下,修改autogen.sh:<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 修改configure.ac文件("main.c"应该是项目中的主程序文件) <br />
AC_INIT(your-project-main, 0.0.1, [http://www.openmoko.org/ http://www.openmoko.org/]) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 切换到data/目录,以你的项目名重命名几个文件: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 修改data/下的Makefile.am文件:<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 修改data/下的 Makefile.in文件<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 修改your-project-name.desktop文件:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
* 在your-project-name.desktop文件加入以下的内容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切换到src/目录:<br />
<br />
cd ..<br />
cd src<br />
<br />
* 修改Makefile.am文件<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 请将main.c之外的所有.c和.h文件放入其中,并将变量名称中的 '-' 字符修改为 '_' 。<br />
<br />
==将你的应用程序打包==<br />
<br />
工具链中有一个脚本用来将应用程序制作为ipkg包。请注意,你并不需要在Neo手机上测试此应用程序 ( 若要在Neo手机上测试此应用程序,只需要使用scp将生成的二进制代码和数据传送到手机上即可),打成ipkg包也是为了方便发布给他人。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
现在你已经得到了openmoko-sample2_0.1_armv4t.ipk ,你可以使用"scp"将它传输到Neo手机并安装:<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
请注意:这个ipkg包并未包含控制信息,例如函数库的依赖关系,所以,如果你想分发此ipkg包,应该加入控制信息文件。你可以在控制信息文件中提供版本号、软件包描述、作者和联系方式等:<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的模板如下:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: [http://www.openmoko.org/ http://www.openmoko.org/]<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==你下一步要参考的内容==<br />
<br />
使用外部工具链来为Neo构建应用程序比较简单。如果你熟悉这个流程的话,你也会想要参考:<br />
* 使用[[Qemu]] 在仿真环境下测试你的应用程序<br />
** Ubuntu使用者可能想要查看的[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 提高效率<br />
* 使用[[OpenEmbedded]] 定制你的Openmoko发行版映像文件<br />
<br />
=高级主题=<br />
==使用工具链提供的链接库==<br />
向src/Makefile.am文件的 _LDADD 字段加入必要的链接库,示例如下:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之后,请再次运行<br />
om-conf <br />
<br />
==向工具链中安装附加函数库==<br />
不久之后,你也许想要编译一个应用程序,这个应用程序依赖于生僻的函数库,而这些函数库并未由预编译的工具链提供。<br />
<br />
这种情况下,你可以请求将附加的函数库放入下一版本的OpenMoko工具链,而在那之前,你可以通过如下方式增强现有的工具链。这里演示了如何向工具链中加入一个名为liburiparse的函数库:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE打包应用程序==<br />
当你编写了一个很酷的应用程序并想与他人分享,最佳方法是<br />
# 上传你的应用程序源代码到公共区域<br />
# 提交一个[[BitBake]]包到[[OpenEmbedded]],最好通过[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以参考 [[Customizing your OpenMoko distribution|定制化你的OpenMoko发行版]].<br />
<br />
==问题排除==<br />
<br />
* 请使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 邮件列表来获得帮助。<br />
<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-04-30T02:09:46Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集,Openmoko有两类不同用途的工具链。<br />
<br />
== 基本工具链:用于开发简单的单一应用程序 ==<br />
<br />
为了开发简单的单一应用程序,你可以使用针对Openmoko项目预先构建好的工具链。本文将说明这一工具链的使用方法,它将帮助你一步步的编译项目并最终运行在目标设备上。你应该听过[[OpenEmbedded]],但作为开发此类应用程序的开发人员,你’’’不’’’应该使用[[OpenEmbedded]]。<br />
<br />
== [[OpenEmbedded]]:用于系统集成和定制发行版 ==<br />
<br />
针对系统集成和定制发行版的任务,你应该使用[[OpenEmbedded]],它能通过bootstrapping/build流程建立起自己的交叉编译工具链。系统集成和定制发行版未在本文加以讨论。<br />
<br />
=基本工具链的用法=<br />
<br />
==基本安装条件==<br />
熟悉Linux及其命令行工具是最基本的,你必须有一台x86兼容的、最少有1G磁盘空间的电脑。你也必须要有使用本地编译器来编译程序源码的相关操作经验。同时,假设你有home目录(~)和/usr/local/目录(有需要时,需使用root用户来操作)的写权限。如果你没有上述的权限,请与管理员联系。<br />
<br />
你至少应该具有使用安装程序的权限,允许你使用自动工具构建软件包。(比如'''./configure, make, make install''')。<br />
<br />
需要安装的部分软件如下:<br />
* 针对大多数Linux发行版,需要安装如下软件包:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 针对 ubuntu (7.10) ,需要安装以下软件包:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下载及安装==<br />
<br />
预构建的工具链可以从 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下载:<br />
<br />
* 在计算机中的任一位置建立目标文件夹,但推荐建立下述文件夹:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 下载与计算机CPU类型(x86_64或i686)匹配的软件包:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接着,要将它解压缩到文件系统。注意:此软件包必须安装到且会自动安装到<tt>/usr/local/openmoko/</tt>目录。<br />
<br />
* 切换到超级用户,然后解压缩。(请使用"su",若您使用的是Debian/Ubuntu,请在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在类Debian系统上,你可以使用alien(+fakeroot)来将.tar.bz2文件构建成一个易于卸载的软件包(使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 预构建的工具链是针对x86_64或i686的。如果你希望的话,你可以使用OpenEmbedded来建立自己的工具链:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最后,每次使用此工具链时,必须先改变环境变量,这样才会找到此工具链。此工具链提供了一个脚本来做这项工作。<br />
<br />
请注意,如果你并没有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必须先启动"sh" 或"bash"。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==构建示例项目==<br />
<br />
在目标文件夹中 (本文为~/):<br />
<br />
* 复制已下载的示例应用程序源文件:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 设定环境变量 (记得使用"sh" 或 "bash"):<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你必须为这个应用程序建立一个设定值,这个也可以用来检查你的系统上可以使用的所有必须的链接库、工具…等。如果这项工作无法完成时,请参考"需求环境"一节,取得更多信息。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 现在你可以选择性的修改openmoko-sample2/src 中的源码。<br />
<br />
* 要从源码中建立应用程序,你应该使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主机上安装这个项目,你可以利用下面的操作,将它安装到一个现有的设定中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改范例项目==<br />
<br />
为了要使用Openmoko-sample2 档案来制作你自己的项目,某些变更是必须的: * 复制下载的范例应用程序:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 将档案夹以你的项目名称命名 ( 在这个范例中为your-project-name) ,并删除旧有的范例档案。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* copy your sources (in this example your-sources) into src/<br />
<br />
cp your-sources .<br />
cd ..<br />
<br />
* 现在,在主要的档案夹中,使用下面的指令修改autogen.sh 。<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 藉由更新下面的内容修改configure.ac <br />
AC_INIT(your-project-main, 0.0.1, http://www.openmoko.org/) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 到data/ 档资夹,并且重新将这些档案命名: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 用下列的指令修改data/下的Makefile.am 档案。<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 透过修改下面的内容,修改data/路径下的 Makefile.in<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 透过下面的内容,修改your-project-name:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
*加入以下的内容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切换到src/ 资料夹<br />
<br />
cd ..<br />
cd src<br />
<br />
* 藉由更新下面的程序,修改Makefile.am<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 请确认除了 main.c 外,修改,将所有的.c 及.h 档案 参数名称的 '-' 字符修改为 '_' 。<br />
<br />
==封装你的应用程序==<br />
<br />
我们已经加入了一个script在你的应用程序外制作了ipkg 。请注意这并不是要在Neo上测试你的应用程序 ( 若你要测试应用程序,你只要使用SCP产出的二进制代码及数据),它对于想你将你的软件发布给其它人而言,相当方便。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
现在你已经取得了openmoko-sample2_0.1_armv4t.ipk ,你可以将它`scp' 到你的Neo,并且安装它。<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
请注意当你重新发布产生的ipkg ,请注意它只是一个有更多信息的ipk骨架,若你无法取得链接库的独立性。查看下面的内容来暸解如何修复这个问题。<br />
你也可以在控制档中提出这个版本的编号,描述及作者/连络方式。<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的范本:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==从这里出发的目的地==<br />
<br />
使用外部的 toolchain是一个为Neo建立程序的好方法。如果你熟悉这个产品的话,你也会想要参考:<br />
* 使用[[Qemu]] 在仿真环境下测试应用程序<br />
** Ubuntu使用者可能想要查看[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 加强效能<br />
* 使用[[OpenEmbedded]] 客制化你的Openmoko套件映像档<br />
<br />
=进阶议题=<br />
==使用 toolchain 提供的链接库==<br />
加入必要的链接库到src/Makefile.am 的 _LDADD 字段,如:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之后,请确定再次执行<br />
om-conf <br />
<br />
==将其它的链接库安装到toolchain==<br />
不久之后,你会想要编译一个无法透过预先编译toolchain来完成依存性的程序,’如一些obscure libraries。<br />
<br />
在这样的案例当中,请放心的将其它的libraries 放到下一次释出的Openmoko toolchain。以下是你如何扩充 toolchain安装。也就是说,我们想要加入一个名为liburiparse的链接库:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE包装应用程序==<br />
当你撰写了一支很好的应用式,而你想要与其它人分享,最佳的方式是<br />
# 上传你的程序原始码到公共的区域<br />
# 送出[[BitBake]]到[[OpenEmbedded]],最好的方法是透过[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以参考 [[Customizing your OpenMoko distribution|客制化你的Openmoko套件]].<br />
<br />
==问题排除==<br />
<br />
* 请使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 邮件清单来取得更多帮助。<br />
<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-04-30T01:58:47Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集,Openmoko有两类不同用途的工具链。<br />
<br />
== 基本工具链:用于开发简单的单一应用程序 ==<br />
<br />
为了开发简单的单一应用程序,你可以使用针对Openmoko项目预先构建好的工具链。本文将说明这一工具链的使用方法,它将帮助你一步步的编译项目并最终运行在目标设备上。你应该听过[[OpenEmbedded]],但作为开发此类应用程序的开发人员,你’’’不’’’应该使用[[OpenEmbedded]]。<br />
<br />
== [[OpenEmbedded]]:用于系统集成和定制发行版 ==<br />
<br />
针对系统集成和定制发行版的任务,你应该使用[[OpenEmbedded]],它能通过bootstrapping/build流程建立起自己的交叉编译工具链。系统集成和定制发行版未在本文加以讨论。<br />
<br />
=基本工具链的用法=<br />
<br />
==基本安装条件==<br />
熟悉Linux及其命令行工具是最基本的,你必须有一台x86兼容的、最少有1G磁盘空间的电脑。你也必须要有使用本地编译器来编译程序源码的相关操作经验。同时,假设你有home目录(~)和/usr/local/目录(有需要时,需使用root用户来操作)的写权限。如果你没有上述的权限,请与管理员联系。<br />
<br />
你至少应该具有使用安装程序的权限,允许你使用自动工具构建软件包。(比如'''./configure, make, make install''')。<br />
<br />
需要安装的部分软件如下:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 针对 ubuntu (7.10) ,需要安装以下软件包:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下载及安装==<br />
<br />
预构建的工具链可以从 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下载:<br />
<br />
* 在计算机中的任一位置建立目标文件夹,但推荐建立下述文件夹:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 下载与计算机CPU类型(x86_64或i686)匹配的软件包:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接着,要将它解压缩到文件系统。注意:此软件包必须安装到且会自动安装到<tt>/usr/local/openmoko/</tt>目录。<br />
<br />
* 将它直接解压缩到root请使用"su" (或者若您使用的是Debian/Ubuntu,在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在Debian-based 系统上,你可以使用alien(+fakeroot)自.tar.bz2来建立一个易于安装的套件 (使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 预建的toolchain是针对x86_64或i686。如果你希望的话,你可以使用OE建立自己的toolchain:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最后,每次你想要使用这个工具时,必须改变环境变量,这样才会找到要用的工具。Toolchain提供了script进行这项工作,因此你必须做的事只是取得它。<br />
<br />
请注意,如果你并没有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必须先从"sh" 或"bash"开始。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==建立一个简单的项目==<br />
<br />
在选定的目标目录地址中 (在本范例中为~/):<br />
<br />
* 复制下载的范例应用程序原始码:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 请记得设定适当的环境变量 (使用"sh" 或 "bash")提供给Openmoko使用。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你必须为这个应用程序建立一个设定值,这个也可以用来检查你的系统上可以使用的所有必须的链接库、工具…等。如果这项工作无法完成时,请参考"需求环境"一节,取得更多信息。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 现在你可以选择性的修改openmoko-sample2/src 中的源码。<br />
<br />
* 要从源码中建立应用程序,你应该使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主机上安装这个项目,你可以利用下面的操作,将它安装到一个现有的设定中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改范例项目==<br />
<br />
为了要使用Openmoko-sample2 档案来制作你自己的项目,某些变更是必须的: * 复制下载的范例应用程序:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 将档案夹以你的项目名称命名 ( 在这个范例中为your-project-name) ,并删除旧有的范例档案。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* copy your sources (in this example your-sources) into src/<br />
<br />
cp your-sources .<br />
cd ..<br />
<br />
* 现在,在主要的档案夹中,使用下面的指令修改autogen.sh 。<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 藉由更新下面的内容修改configure.ac <br />
AC_INIT(your-project-main, 0.0.1, http://www.openmoko.org/) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 到data/ 档资夹,并且重新将这些档案命名: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 用下列的指令修改data/下的Makefile.am 档案。<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 透过修改下面的内容,修改data/路径下的 Makefile.in<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 透过下面的内容,修改your-project-name:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
*加入以下的内容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切换到src/ 资料夹<br />
<br />
cd ..<br />
cd src<br />
<br />
* 藉由更新下面的程序,修改Makefile.am<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 请确认除了 main.c 外,修改,将所有的.c 及.h 档案 参数名称的 '-' 字符修改为 '_' 。<br />
<br />
==封装你的应用程序==<br />
<br />
我们已经加入了一个script在你的应用程序外制作了ipkg 。请注意这并不是要在Neo上测试你的应用程序 ( 若你要测试应用程序,你只要使用SCP产出的二进制代码及数据),它对于想你将你的软件发布给其它人而言,相当方便。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
现在你已经取得了openmoko-sample2_0.1_armv4t.ipk ,你可以将它`scp' 到你的Neo,并且安装它。<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
请注意当你重新发布产生的ipkg ,请注意它只是一个有更多信息的ipk骨架,若你无法取得链接库的独立性。查看下面的内容来暸解如何修复这个问题。<br />
你也可以在控制档中提出这个版本的编号,描述及作者/连络方式。<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的范本:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==从这里出发的目的地==<br />
<br />
使用外部的 toolchain是一个为Neo建立程序的好方法。如果你熟悉这个产品的话,你也会想要参考:<br />
* 使用[[Qemu]] 在仿真环境下测试应用程序<br />
** Ubuntu使用者可能想要查看[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 加强效能<br />
* 使用[[OpenEmbedded]] 客制化你的Openmoko套件映像档<br />
<br />
=进阶议题=<br />
==使用 toolchain 提供的链接库==<br />
加入必要的链接库到src/Makefile.am 的 _LDADD 字段,如:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之后,请确定再次执行<br />
om-conf <br />
<br />
==将其它的链接库安装到toolchain==<br />
不久之后,你会想要编译一个无法透过预先编译toolchain来完成依存性的程序,’如一些obscure libraries。<br />
<br />
在这样的案例当中,请放心的将其它的libraries 放到下一次释出的Openmoko toolchain。以下是你如何扩充 toolchain安装。也就是说,我们想要加入一个名为liburiparse的链接库:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE包装应用程序==<br />
当你撰写了一支很好的应用式,而你想要与其它人分享,最佳的方式是<br />
# 上传你的程序原始码到公共的区域<br />
# 送出[[BitBake]]到[[OpenEmbedded]],最好的方法是透过[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以参考 [[Customizing your OpenMoko distribution|客制化你的Openmoko套件]].<br />
<br />
==问题排除==<br />
<br />
* 请使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 邮件清单来取得更多帮助。<br />
<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/User:SunltUser:Sunlt2008-04-30T01:40:38Z<p>Sunlt: </p>
<hr />
<div>* sunlt is chinese with the full name Sun Liantao.<br />
* I works in China for [http://www.csip.org.cn Ministry of Information Industry CSIP].<br />
* I am a member of [http://www.beijinglug.org Beijing Linux User Group] and BOSS which stands for Beijing University of Posts and Telecommunications Open Source Society.<br />
* I focuses on both the technology and commercial things of Embedded Linux System.<br />
* Email : sunlt@csip.org.cn</div>Sunlthttp://openmoko.org/wiki/User:SunltUser:Sunlt2008-04-30T01:40:24Z<p>Sunlt: </p>
<hr />
<div>* sunlt is chinese with the full name Sun Liantao孙廉焘.<br />
* I works in China for [http://www.csip.org.cn Ministry of Information Industry CSIP].<br />
* I am a member of [http://www.beijinglug.org Beijing Linux User Group] and BOSS which stands for Beijing University of Posts and Telecommunications Open Source Society.<br />
* I focuses on both the technology and commercial things of Embedded Linux System.<br />
* Email : sunlt@csip.org.cn</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-04-30T01:33:46Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集,Openmoko有两类不同用途的工具链。<br />
<br />
== 基本工具链:用于开发简单的单一应用程序 ==<br />
<br />
为了开发简单的单一应用程序,你可以使用针对Openmoko项目预先构建好的工具链。本文将说明这一工具链的使用方法,它将帮助你一步步的编译项目并最终运行在目标设备上。你应该听过[[OpenEmbedded]],但作为开发此类应用程序的开发人员,你’’’不’’’应该使用[[OpenEmbedded]]。<br />
<br />
== [[OpenEmbedded]]:用于系统集成和定制发行版 ==<br />
<br />
针对系统集成和定制发行版的任务,你应该使用[[OpenEmbedded]],它能通过bootstrapping/build流程建立起自己的交叉编译工具链。系统集成和定制发行版未在本文加以讨论。<br />
<br />
=基本工具链的用法=<br />
<br />
==先决条件==<br />
==基本安装条件==<br />
熟悉Linux 及其基本的指令工具是最基本的,你必须有x86兼容,至少1G的磁盘空间。你也必须要有使用本机编译器来编译原始码的相关操作经验。在此,提醒您,本篇文章是假设你有存取/home及/usr/local/ 目录的权限 (有需要时,需成为root)。如果你没有上述的权限,请与你的管理人员连络。<br />
<br />
你至少应该能使用安装程序的权限,允许你使用autotools编译软件包。(the triade of '''./configure, make, make install''').<br />
<br />
需要安装的软件—有需要请加入以下 的套件:<br />
* 针对大部份版本的Linux ,你可能只需要安装以下的软件:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 针对 ubuntu (7.10) ,则需要安装以下的套件:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下载及安装==<br />
<br />
toolchain 可以自 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下载:<br />
<br />
* 在计算机中建立一个目标目录位置,如:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 依您的CPU 类型 (x86_64 or i686) 下载合适的套件:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接着,你想要将它解压缩到档案系统时,toolchain 它必须安装到<tt>/usr/local/openmoko/</tt>.<br />
<br />
现在,你有以下的选项:<br />
* 将它直接解压缩到root请使用"su" (或者若您使用的是Debian/Ubuntu,在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在Debian-based 系统上,你可以使用alien(+fakeroot)自.tar.bz2来建立一个易于安装的套件 (使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 预建的toolchain是针对x86_64或i686。如果你希望的话,你可以使用OE建立自己的toolchain:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最后,每次你想要使用这个工具时,必须改变环境变量,这样才会找到要用的工具。Toolchain提供了script进行这项工作,因此你必须做的事只是取得它。<br />
<br />
请注意,如果你并没有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必须先从"sh" 或"bash"开始。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==建立一个简单的项目==<br />
<br />
在选定的目标目录地址中 (在本范例中为~/):<br />
<br />
* 复制下载的范例应用程序原始码:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 请记得设定适当的环境变量 (使用"sh" 或 "bash")提供给Openmoko使用。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你必须为这个应用程序建立一个设定值,这个也可以用来检查你的系统上可以使用的所有必须的链接库、工具…等。如果这项工作无法完成时,请参考"需求环境"一节,取得更多信息。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 现在你可以选择性的修改openmoko-sample2/src 中的源码。<br />
<br />
* 要从源码中建立应用程序,你应该使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主机上安装这个项目,你可以利用下面的操作,将它安装到一个现有的设定中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改范例项目==<br />
<br />
为了要使用Openmoko-sample2 档案来制作你自己的项目,某些变更是必须的: * 复制下载的范例应用程序:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 将档案夹以你的项目名称命名 ( 在这个范例中为your-project-name) ,并删除旧有的范例档案。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* copy your sources (in this example your-sources) into src/<br />
<br />
cp your-sources .<br />
cd ..<br />
<br />
* 现在,在主要的档案夹中,使用下面的指令修改autogen.sh 。<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 藉由更新下面的内容修改configure.ac <br />
AC_INIT(your-project-main, 0.0.1, http://www.openmoko.org/) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 到data/ 档资夹,并且重新将这些档案命名: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 用下列的指令修改data/下的Makefile.am 档案。<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 透过修改下面的内容,修改data/路径下的 Makefile.in<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 透过下面的内容,修改your-project-name:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
*加入以下的内容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切换到src/ 资料夹<br />
<br />
cd ..<br />
cd src<br />
<br />
* 藉由更新下面的程序,修改Makefile.am<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 请确认除了 main.c 外,修改,将所有的.c 及.h 档案 参数名称的 '-' 字符修改为 '_' 。<br />
<br />
==封装你的应用程序==<br />
<br />
我们已经加入了一个script在你的应用程序外制作了ipkg 。请注意这并不是要在Neo上测试你的应用程序 ( 若你要测试应用程序,你只要使用SCP产出的二进制代码及数据),它对于想你将你的软件发布给其它人而言,相当方便。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
现在你已经取得了openmoko-sample2_0.1_armv4t.ipk ,你可以将它`scp' 到你的Neo,并且安装它。<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
请注意当你重新发布产生的ipkg ,请注意它只是一个有更多信息的ipk骨架,若你无法取得链接库的独立性。查看下面的内容来暸解如何修复这个问题。<br />
你也可以在控制档中提出这个版本的编号,描述及作者/连络方式。<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的范本:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==从这里出发的目的地==<br />
<br />
使用外部的 toolchain是一个为Neo建立程序的好方法。如果你熟悉这个产品的话,你也会想要参考:<br />
* 使用[[Qemu]] 在仿真环境下测试应用程序<br />
** Ubuntu使用者可能想要查看[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 加强效能<br />
* 使用[[OpenEmbedded]] 客制化你的Openmoko套件映像档<br />
<br />
=进阶议题=<br />
==使用 toolchain 提供的链接库==<br />
加入必要的链接库到src/Makefile.am 的 _LDADD 字段,如:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之后,请确定再次执行<br />
om-conf <br />
<br />
==将其它的链接库安装到toolchain==<br />
不久之后,你会想要编译一个无法透过预先编译toolchain来完成依存性的程序,’如一些obscure libraries。<br />
<br />
在这样的案例当中,请放心的将其它的libraries 放到下一次释出的Openmoko toolchain。以下是你如何扩充 toolchain安装。也就是说,我们想要加入一个名为liburiparse的链接库:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE包装应用程序==<br />
当你撰写了一支很好的应用式,而你想要与其它人分享,最佳的方式是<br />
# 上传你的程序原始码到公共的区域<br />
# 送出[[BitBake]]到[[OpenEmbedded]],最好的方法是透过[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以参考 [[Customizing your OpenMoko distribution|客制化你的Openmoko套件]].<br />
<br />
==问题排除==<br />
<br />
* 请使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 邮件清单来取得更多帮助。<br />
<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-04-30T01:20:40Z<p>Sunlt: </p>
<hr />
<div>{{Languages|Toolchain}}<br />
= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集。Openmoko有两类不同用途的工具链:<br />
<br />
== 开发简单的应用程序 ==<br />
<br />
针对这个用途,你应该可以使用针对Openmoko项目所预先建立好的toolchain。在这里你可以找到如何使用toolchain的方法,带领你进入编译项目的一连串程序,并且让程序能顺利的在你的手持式装置上执行。你应该听过 [[OpenEmbedded]],身为一个程序开发人员,你应该’’’不要’’’使用[[OpenEmbedded]]。<br />
<br />
== 系统集成和定制发行版 ==<br />
<br />
针对系统整合及客制化套件,在ootstrapping/build process时,你应该使用[[OpenEmbedded]]来建立cross compiler。系统整合及套件客制化整合等问题,超过本文章所要讨论的问题,因此在此不加以讨论。<br />
<br />
=基本工具链的用法=<br />
<br />
==先决条件==<br />
==基本安装条件==<br />
熟悉Linux 及其基本的指令工具是最基本的,你必须有x86兼容,至少1G的磁盘空间。你也必须要有使用本机编译器来编译原始码的相关操作经验。在此,提醒您,本篇文章是假设你有存取/home及/usr/local/ 目录的权限 (有需要时,需成为root)。如果你没有上述的权限,请与你的管理人员连络。<br />
<br />
你至少应该能使用安装程序的权限,允许你使用autotools编译软件包。(the triade of '''./configure, make, make install''').<br />
<br />
需要安装的软件—有需要请加入以下 的套件:<br />
* 针对大部份版本的Linux ,你可能只需要安装以下的软件:<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* 针对 ubuntu (7.10) ,则需要安装以下的套件:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool<br />
<br />
==下载及安装==<br />
<br />
toolchain 可以自 [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]下载:<br />
<br />
* 在计算机中建立一个目标目录位置,如:<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* 依您的CPU 类型 (x86_64 or i686) 下载合适的套件:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
接着,你想要将它解压缩到档案系统时,toolchain 它必须安装到<tt>/usr/local/openmoko/</tt>.<br />
<br />
现在,你有以下的选项:<br />
* 将它直接解压缩到root请使用"su" (或者若您使用的是Debian/Ubuntu,在tar指令前加入"sudo"):<br />
<br />
cd /<br />
tar -xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* 在Debian-based 系统上,你可以使用alien(+fakeroot)自.tar.bz2来建立一个易于安装的套件 (使用dpkg -i <package.deb>): <br />
<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* 预建的toolchain是针对x86_64或i686。如果你希望的话,你可以使用OE建立自己的toolchain:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
最后,每次你想要使用这个工具时,必须改变环境变量,这样才会找到要用的工具。Toolchain提供了script进行这项工作,因此你必须做的事只是取得它。<br />
<br />
请注意,如果你并没有使用"sh" 或"bash" shell (用"echo $SHELL" 查看) ,那你必须先从"sh" 或"bash"开始。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==建立一个简单的项目==<br />
<br />
在选定的目标目录地址中 (在本范例中为~/):<br />
<br />
* 复制下载的范例应用程序原始码:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 请记得设定适当的环境变量 (使用"sh" 或 "bash")提供给Openmoko使用。<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* 你必须为这个应用程序建立一个设定值,这个也可以用来检查你的系统上可以使用的所有必须的链接库、工具…等。如果这项工作无法完成时,请参考"需求环境"一节,取得更多信息。<br />
<br />
om-conf openmoko-sample2<br />
<br />
* 现在你可以选择性的修改openmoko-sample2/src 中的源码。<br />
<br />
* 要从源码中建立应用程序,你应该使用"make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
如果你希望在主机上安装这个项目,你可以利用下面的操作,将它安装到一个现有的设定中:<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==如何修改范例项目==<br />
<br />
为了要使用Openmoko-sample2 档案来制作你自己的项目,某些变更是必须的: * 复制下载的范例应用程序:<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* 将档案夹以你的项目名称命名 ( 在这个范例中为your-project-name) ,并删除旧有的范例档案。<br />
<br />
mv openmoko-sample2 your-project-name<br />
cd your-project-name<br />
cd src<br />
rm *.c<br />
<br />
* copy your sources (in this example your-sources) into src/<br />
<br />
cp your-sources .<br />
cd ..<br />
<br />
* 现在,在主要的档案夹中,使用下面的指令修改autogen.sh 。<br />
<br />
PKG_NAME="your-project-name"<br />
<br />
* 藉由更新下面的内容修改configure.ac <br />
AC_INIT(your-project-main, 0.0.1, http://www.openmoko.org/) <br />
AC_CONFIG_SRCDIR(src/main.c)<br />
<br />
* 到data/ 档资夹,并且重新将这些档案命名: <br />
cd data<br />
mv openmoko-sample.png your-project-name.png<br />
mv openmoko-sample.desktop your-project-name.desktop<br />
<br />
* 用下列的指令修改data/下的Makefile.am 档案。<br />
<br />
dist_desktop_DATA = your-project-name.desktop<br />
dist_appicon_DATA = your-project-name.png<br />
<br />
* 透过修改下面的内容,修改data/路径下的 Makefile.in<br />
<br />
dist_desktop_DATA = smart-search.desktop<br />
dist_appicon_DATA = smart-search.png<br />
<br />
* 透过下面的内容,修改your-project-name:<br />
<br />
Name=your-project-name<br />
Encoding=UTF-8<br />
Version=0.0.1<br />
Type=Application<br />
Exec=your-project-name<br />
<br />
*加入以下的内容,<br />
<br />
Icon=your-project-name<br />
<br />
* 切换到src/ 资料夹<br />
<br />
cd ..<br />
cd src<br />
<br />
* 藉由更新下面的程序,修改Makefile.am<br />
<br />
bin_PROGRAMS = your-project-name <br />
your_project_name_SOURCES = \ <br />
main.c <br />
your_project_name_LDADD = @DEPENDENCIES_LIBS@<br />
<br />
* 请确认除了 main.c 外,修改,将所有的.c 及.h 档案 参数名称的 '-' 字符修改为 '_' 。<br />
<br />
==封装你的应用程序==<br />
<br />
我们已经加入了一个script在你的应用程序外制作了ipkg 。请注意这并不是要在Neo上测试你的应用程序 ( 若你要测试应用程序,你只要使用SCP产出的二进制代码及数据),它对于想你将你的软件发布给其它人而言,相当方便。<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
现在你已经取得了openmoko-sample2_0.1_armv4t.ipk ,你可以将它`scp' 到你的Neo,并且安装它。<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
请注意当你重新发布产生的ipkg ,请注意它只是一个有更多信息的ipk骨架,若你无法取得链接库的独立性。查看下面的内容来暸解如何修复这个问题。<br />
你也可以在控制档中提出这个版本的编号,描述及作者/连络方式。<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
myapp_control的范本:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==从这里出发的目的地==<br />
<br />
使用外部的 toolchain是一个为Neo建立程序的好方法。如果你熟悉这个产品的话,你也会想要参考:<br />
* 使用[[Qemu]] 在仿真环境下测试应用程序<br />
** Ubuntu使用者可能想要查看[[Automatic_emulation_in_Ubuntu]]<br />
* 使用[[Host-based_development_with_Xoo_and_Xephyr|host-based development]] 加强效能<br />
* 使用[[OpenEmbedded]] 客制化你的Openmoko套件映像档<br />
<br />
=进阶议题=<br />
==使用 toolchain 提供的链接库==<br />
加入必要的链接库到src/Makefile.am 的 _LDADD 字段,如:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
之后,请确定再次执行<br />
om-conf <br />
<br />
==将其它的链接库安装到toolchain==<br />
不久之后,你会想要编译一个无法透过预先编译toolchain来完成依存性的程序,’如一些obscure libraries。<br />
<br />
在这样的案例当中,请放心的将其它的libraries 放到下一次释出的Openmoko toolchain。以下是你如何扩充 toolchain安装。也就是说,我们想要加入一个名为liburiparse的链接库:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
==使用OE包装应用程序==<br />
当你撰写了一支很好的应用式,而你想要与其它人分享,最佳的方式是<br />
# 上传你的程序原始码到公共的区域<br />
# 送出[[BitBake]]到[[OpenEmbedded]],最好的方法是透过[http://bugs.openembedded.org OpenEmbedded bugtracker]<br />
<br />
您也可以参考 [[Customizing your OpenMoko distribution|客制化你的Openmoko套件]].<br />
<br />
==问题排除==<br />
<br />
* 请使用[http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] 邮件清单来取得更多帮助。<br />
<br />
<br />
[[Category:Software ]]<br />
[[Category:Application Developer]]<br />
[[Category:Openmoko]]</div>Sunlthttp://openmoko.org/wiki/Qtopia_on_Neo1973/zh_cnQtopia on Neo1973/zh cn2008-04-24T06:13:00Z<p>Sunlt: /* Current status */</p>
<hr />
<div>[http://en.wikipedia.org/wiki/Qtopia Qtopia] is a complete mobile phone and PDA platform which can be built for many devices and is dual-licensed under the GPL and a proprietary license, but since version 3.4.0, everything needed to use Qtopia on the Neo1973 is licensed under the GPL.<br />
{|align=right<br />
|__TOC__<br />
|}<br />
<br />
==当前状态 ==<br />
On 27 November 2007, Lorn Potter of Trolltech released the [http://www.qtopia.net/modules/mydownloads/visit.php?lid=50 latest flash image for the FIC Neo 1973] containing the Qtopia 4.3.1 snapshot of that day (GPL version). This introduces the new Cruxus mediaengine, which has a few plugins already, which include libmad, tremor (ogg) and timidity, for .wav, .mp3, ogg and .mid file support.<br />
<br />
For installing it, follow the instructions on [[#Flashing Qtopia images|flashing Qtopia images]] below.<br />
<br />
Bug: The dialer might not ask for a PIN (even if your SIM card needs it) on first boot after flashing to Qtopia.<br><br />
Workaround: Somehow, completely powering down the Neo seems to cure this issue. You do can do it in two ways:<br />
# Remove the USB cable and the Battery for a moment to remove all power from the Neo, or<br />
# Remove the USB cable, press the power button for a second, select "Shutdown device" (Note: "Restart Device" does not help - you need to power it down completely!)<br />
<br />
If your SIM card does not require a PIN, you can skip the above possibly, but otherwise you won't be able to use GSM networks at all!<br />
<br />
'''After this power-cycle of the Neo, the Qtopia dialer should ask for the PIN if it's needed, and you should be able to make and receive calls, each side should hear each other and you should be able to send and receive SMS, and use Contacts for Calls and SMS!!!'''.<br />
<br />
The Call, SMS and contact interface is quite intuitive and should be usable by non-expert users from that point on. Also the rest of Qtopia looks very polished.<br />
<br />
For the latest information on this snapshot read the thread following its [http://lists.openmoko.org/pipermail/community/2007-November/011836.html announcement].<br />
<br />
=== Suspend issues ===<br />
The area of battery time and/or suspend still needs improvement. By default, Suspend is disabled in Qtopia because at the moment, you are not able to receive a phone call or an SMS when the Neo is suspended. At the moment (with suspend not enabled, which is the default), Qtopia lasts about 3-5 hours, depending on the amount of use.<br />
<br />
The current maximum standby time seems to be around 7 hours - if there is no use of the phone and the phone is not getting any touches and just sitting on the desk with Bluetooth disabled and getting no touches so that the display is off, just being ready to receive calls and SMS.<br />
<br />
Note that if the Neo [[Neo1973_Battery_Charger#Neo1973_emergency_charging | runs out of battery]], simply connecting USB is not sufficient at that point, the battery has too little voltage to allow the Neo to turn on and enable 500mA charging current. At this point, the Neo is just dead as a brick and charges very slowly with 100mA charging current for about 4 to 6 hours until the battery is recharged enough to allow turning on the Neo and charge with 500mA charging current.<br />
<br />
Current status regarding suspend: Suspending and resuming works, when you remove console=ttySAC0,115200 from bootargs_base (see this [http://blog.rot13.org/2007/09/openmoko_as_a_phone.html howto]), it even wakes up with the GSM part working, but it does not make Qtopia wake up on incoming calls or SMS, so you are not getting notified if you turn on suspend.<br />
After pressing the AUX button, the Neo should wake up from suspend though and should inform you of missed calls and received SMS.<br />
<br />
This bug seems to be [http://labs.trolltech.com/blogs/2007/12/04/neo-neuros-and-other-things/ half-workedarounded], but the fix is not included in the most recent (as of 2007-12-16) official Qtopia image yet. There is an unofficial image from Lorn at http://llornkcor.com/neo/qtopia-4.3-snapshot-12192309-neo-flash.tgz that you can try out that includes his fix.<br />
<br />
== Flashing Qtopia images ==<br />
These are instructions for flashing the latest release of Qtopia (27112007). This seems to be the best working<br />
image yet, eg. voice _and_ SMS seems to work.<br />
<br />
The link to the archive file, Qtopia flash image for FIC Neo 1973,<br />
is mentioned below <br />
<br />
http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50 [http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50]<br />
<br />
Get that and save it on your computer. It should be:<br />
"qtopia-4.3.1-snapshot-1127.tgz"<br />
<br />
Unpack it with:<br />
<br />
tar zxvf qtopia-4.3.1-snapshot-1127.tgz<br />
<br />
This should make you have the following two files, ie. a kernel file and<br />
a rootfs file:<br />
<br />
-rw-r--r-- 1 plr 1000 31956148 2007-11-27 06:55<br />
qtopia-rootfs.2-11270550.jffs2<br />
<br />
-rw-r--r-- 1 plr 1000 1538620 2007-11-10 20:57<br />
uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin<br />
<br />
In case you already do not have a dfu-util utility, you will need to download it. The following version has been tried out and seemed to work.<br />
<br />
http://buildhost.automated.it/OM2007.2/dfu-util [http://buildhost.automated.it/OM2007.2/dfu-util]<br />
<br />
Before moving forward please make sure of the following<br />
<br />
1. You have the necessary permissions in your system (i.e. root access)<br />
<br />
2. dfu-util is executable<br />
<br />
3. Your Neo is in uboot mode<br />
<br />
4. And a USB cable is connected between your computer and the Neo<br />
<br />
5. Realize that the following is low-level stuff and doing something<br />
wrong may brick your Neo<br />
<br />
execute the following from a command line:<br />
<br />
cu -l /dev/ttyACM0<br />
<br />
Which should get you the following:<br />
<br />
Connected.<br />
In: usbtty<br />
Out: usbtty<br />
Err: usbtty<br />
GTA01Bv4 # DEVICE_CONFIGURED: 1<br />
Enabling automatic fast charge<br />
<br />
Press <Enter> and you should get:<br />
<br />
GTA01Bv4 #<br />
<br />
<br />
{{warning|Before flashing the rootfs image, be sure to erase the rootfs using [[nand erase]]. Otherwise, the Neo may hang somewhere after on boot. Before you hit enter on one of the following commands, make sure that you are *not* issuing a plain "nand erase" command - always make sure you tell it which partition to erase. If you forget this you'll brick the Neo and you'll need a debug board to recover it.}}<br />
<br />
At that prompt type:<br />
<br />
nand erase rootfs<br />
<br />
<br />
and the <Enter> key, which should get you:<br />
<br />
NAND erase: device 0 offset 0x2e4000, size 0x3d1c000<br />
OK<br />
GTA01Bv4 #<br />
<br />
At that prompt don't press anything else, but:<br />
<br />
~.<br />
<br />
and the <Enter> key, which should disconnect you from the bootloader.<br />
<br />
<br />
Now, from the computer prompt, execute the following:<br />
<br />
./dfu-util -a kernel -R -D uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin<br />
<br />
which should get you the following, and it should only take a few<br />
seconds to finish:<br />
<br />
dfu-util - (C) 2007 by OpenMoko Inc.<br />
This program is Free Software and has ABSOLUTELY NO WARRANTY<br />
<br />
Opening USB Device 0x0000:0x0000...<br />
Claiming USB DFU Runtime Interface...<br />
Determining device status: state = appIDLE, status = 0<br />
Device really in Runtime Mode, send DFU detach request...<br />
Resetting USB...<br />
Opening USB Device...<br />
Found Runtime: [0x1457:0x5119] devnum=3, cfg=0, intf=0, alt=3, name="kernel"<br />
Claiming USB DFU Interface...<br />
Setting Alternate Setting ...<br />
Determining device status: state = dfuIDLE, status = 0<br />
dfuIDLE, continuing<br />
Transfer Size = 0x1000<br />
bytes_per_hash=30772<br />
Starting download: [##################################################]<br />
finished!<br />
state(2) = dfuIDLE, status(0) = No error condition is present<br />
Done!<br />
Resetting USB to switch back to runtime mode<br />
<br />
After that, execute the following:<br />
<br />
./dfu-util -a rootfs -R -D qtopia-rootfs.2-11270550.jffs2<br />
<br />
which should get you the following, and it should take between 5-10min<br />
to finish:<br />
<br />
dfu-util - (C) 2007 by OpenMoko Inc.<br />
This program is Free Software and has ABSOLUTELY NO WARRANTY<br />
<br />
Opening USB Device 0x0000:0x0000...<br />
Claiming USB DFU Runtime Interface...<br />
Determining device status: state = appIDLE, status = 0<br />
Device really in Runtime Mode, send DFU detach request...<br />
Resetting USB...<br />
Opening USB Device...<br />
Found Runtime: [0x1457:0x5119] devnum=5, cfg=0, intf=0, alt=5, name="rootfs"<br />
Claiming USB DFU Interface...<br />
Setting Alternate Setting ...<br />
Determining device status: state = dfuIDLE, status = 0<br />
dfuIDLE, continuing<br />
Transfer Size = 0x1000<br />
bytes_per_hash=639122<br />
Starting download: [##################################################]<br />
finished!<br />
state(2) = dfuIDLE, status(0) = No error condition is present<br />
Done!<br />
Resetting USB to switch back to runtime mode<br />
<br />
In both cases, some text on your Neo should appear, indicating that the<br />
kernel or the rootfs are being downloaded.<br />
<br />
After this, the Neo should be able to boot, and depending on how you<br />
have your boot menu set up, choose "Boot" or perhaps "Boot from NAND".<br />
The method described above in any case puts the software on the NAND<br />
flash, and not on an SD card, if you have that installed.<br />
<br />
<br />
The lasted official Qtopia flash images are found at: http://www.qtopia.net/modules/mydownloads/ (Scroll down on this page to find them)<br />
<br />
Unofficial Qtopia images can be found in the ScaredyCat and Chooseopen [[repositories]].<br />
<br />
For more details on the the process of flashing the Neo, see [[Flashing openmoko]].<br />
<br />
== Dual-booting between Qtopia and X ==<br />
<br />
Both examples described here require you to reformat your MicroSD card to ext3, so this is the first step for both:<br />
<br />
{{warning|The following step will reformat your MicroSD card with the ext3 filesystem. We need it because we need support for symbolic or/and static links, which other filesystems like FAT do not support directly. After reformatting, no data on the card will be accessible to you anymore, so create good backups of anything which you need before starting!}}<br />
<br />
Then ssh to your neo and reformat your MicroSD card with:<br />
umount /dev/mmcblk0p1<br />
mkfs.ext3 /dev/mmcblk0p1<br />
mount /dev/mmcblk0p1<br />
<br />
=== Installing Qtopia into an openmoko rootfs ===<br />
<br />
On [http://www.qtopia.net/modules/devices/openmoko.php], click "Developer root filesystem". Then extract opt/Qtopia and the qpe init script and copy both to the mmc card of your neo:<br />
<br />
tar xzf ficgta01-qtopia-developer-rootfs.tgz opt/Qtopia etc/init.d/qpe<br />
mv opt/Qtopia etc/init.d/qpe . && rm -r opt etc<br />
tar czf Qtopia.tar.gz Qtopia qpe<br />
scp Qtopia.tar.gz root@192.168.0.202:/media/card/<br />
<br />
Log in to your Neo and unpack the archive and install it:<br />
<br />
cd /media/card<br />
tar xzf Qtopia.tar.gz<br />
mkdir -p /opt<br />
ln -s /media/card/Qtopia /opt/Qtopia<br />
mv qpe /etc/init.d<br />
<br />
Now kill the X server and gsmd and start Qtopia (this can take some time):<br />
<br />
/etc/init.d/xserver-nodm stop<br />
/etc/init.d/gsmd stop<br />
/etc/init.d/qpe start<br />
<br />
Now, in theory, it should be possible to could create a new entry in the [[uboot]] boot menu which adds a new boot argument to the kernel, say "qtopia=1" and you could could write a script which checks that boot parameter by checking if "$qtopia" is set to "1" or by checking /proc/cmdline and then boot Qtopia instead of X.<br />
<br />
=== Installing Qtopia on the SD card ===<br />
<br />
* format your SD card with ext3 and mount it (see above)<br />
* unpack rootfs from qtopia-4.3.0-preview-neo-flash.tgz to SD card (see above)<br />
* copy the uImage-2.6.22.5-moko11-r2-fic-gta01.bin kernel to the boot/ on SD card and rename it to uImage<br />
* put a 'Boot from SD' menu item in uboot menu as explained here: [[Booting_from_SD#Step_3:_Add_uboot_boot_entry]]<br />
<br />
== Build Qtopia from source ==<br />
If you want to build qtopia for yourself you can download the [ftp://ftp.trolltech.com/qtopia/tech-preview/ technical preview] or [ftp://ftp.trolltech.com/qtopia/snapshots/ snapshots]<br />
<br />
== Tips ==<br />
Most things seem to work out of the box, however you might need to use the following command to get audio (but not with the official flash image available from Trolltech):<br />
alsactl -f /etc/gsmhandset.state restore<br />
Or put this command in /etc/init.d/qpe line 64<br />
<br />
Do not switch themes. Only the default theme is usable. For example, once you switch themes, the lock feature continues to work, but only if you unlock using the smallest # keypad in the world.<br />
<br />
Suspend support is very flaky. The neo often shuts off from a suspend state. It will not wake from suspend for an incoming call or text message (someone try setting an alarm and report results here). To turn suspend off (this will of course use the batteries very quickly), hit the down arrow next to the suspend setting in the power management until it says "Off".<br />
<br />
When using the "Predictive keyboard," do a quick flick up or down over the keyboard to access numbers/symbols/capitals. In snapshot builds, you can select virtual keyboard by tapping on the little arrow icon to the left of the battery status icon.<br />
<br />
In summary, Qtopia on the Neo1973 is much closer to being ready than OpenMoko as of this writing. However, sound and suspend support prevent it from being at all useful as a cell phone (as a landline that doesn't ring but instead vibrates, it works ok).<br />
<br />
The [http://www.qtopia.net/modules/newbb_plus/viewtopic.php?topic_id=473&forum=4 Qtopia forum area on the FIC GTA01] might be helpful, but it is preferred that you update this section with issues and fixes you find.<br />
<br />
== Screenshots ==<br />
<br />
{|<br />
|-<br />
|[[Image:Qtopia001.png|thumb|center|240px]]<br />
|[[Image:Qtopia002.png|thumb|center|240px]]<br />
|[[Image:Qtopia003.png|thumb|center|240px]]<br />
|-<br />
|[[Image:Qtopia004.png|thumb|center|240px]]<br />
|[[Image:Qtopia005.png|thumb|center|240px]]<br />
|[[Image:Qtopia006.png|thumb|center|240px]]<br />
|}<br />
<br />
== Videos ==<br />
<br />
http://www.youtube.com/watch?v=YW5q8SpY7t4<br />
http://www.youtube.com/watch?v=iOG_mtSEMgs<br />
<br />
For full size videos, 346 MiB:<br />
<br />
http://linuxtracker.org/download.php?id=4613&name=qt_on_neo1973_videos.torrent<br />
<br />
{{Languages|Qtopia_on_Neo1973}}<br />
<br />
[[Category:Distributions]]<br />
[[Category:Software]]<br />
[[Category:Applications]]</div>Sunlthttp://openmoko.org/wiki/Qtopia_on_Neo1973/zh_cnQtopia on Neo1973/zh cn2008-04-24T06:11:53Z<p>Sunlt: </p>
<hr />
<div>[http://en.wikipedia.org/wiki/Qtopia Qtopia] is a complete mobile phone and PDA platform which can be built for many devices and is dual-licensed under the GPL and a proprietary license, but since version 3.4.0, everything needed to use Qtopia on the Neo1973 is licensed under the GPL.<br />
{|align=right<br />
|__TOC__<br />
|}<br />
<br />
== Current status ==<br />
On 27 November 2007, Lorn Potter of Trolltech released the [http://www.qtopia.net/modules/mydownloads/visit.php?lid=50 latest flash image for the FIC Neo 1973] containing the Qtopia 4.3.1 snapshot of that day (GPL version). This introduces the new Cruxus mediaengine, which has a few plugins already, which include libmad, tremor (ogg) and timidity, for .wav, .mp3, ogg and .mid file support.<br />
<br />
For installing it, follow the instructions on [[#Flashing Qtopia images|flashing Qtopia images]] below.<br />
<br />
Bug: The dialer might not ask for a PIN (even if your SIM card needs it) on first boot after flashing to Qtopia.<br><br />
Workaround: Somehow, completely powering down the Neo seems to cure this issue. You do can do it in two ways:<br />
# Remove the USB cable and the Battery for a moment to remove all power from the Neo, or<br />
# Remove the USB cable, press the power button for a second, select "Shutdown device" (Note: "Restart Device" does not help - you need to power it down completely!)<br />
<br />
If your SIM card does not require a PIN, you can skip the above possibly, but otherwise you won't be able to use GSM networks at all!<br />
<br />
'''After this power-cycle of the Neo, the Qtopia dialer should ask for the PIN if it's needed, and you should be able to make and receive calls, each side should hear each other and you should be able to send and receive SMS, and use Contacts for Calls and SMS!!!'''.<br />
<br />
The Call, SMS and contact interface is quite intuitive and should be usable by non-expert users from that point on. Also the rest of Qtopia looks very polished.<br />
<br />
For the latest information on this snapshot read the thread following its [http://lists.openmoko.org/pipermail/community/2007-November/011836.html announcement].<br />
<br />
=== Suspend issues ===<br />
The area of battery time and/or suspend still needs improvement. By default, Suspend is disabled in Qtopia because at the moment, you are not able to receive a phone call or an SMS when the Neo is suspended. At the moment (with suspend not enabled, which is the default), Qtopia lasts about 3-5 hours, depending on the amount of use.<br />
<br />
The current maximum standby time seems to be around 7 hours - if there is no use of the phone and the phone is not getting any touches and just sitting on the desk with Bluetooth disabled and getting no touches so that the display is off, just being ready to receive calls and SMS.<br />
<br />
Note that if the Neo [[Neo1973_Battery_Charger#Neo1973_emergency_charging | runs out of battery]], simply connecting USB is not sufficient at that point, the battery has too little voltage to allow the Neo to turn on and enable 500mA charging current. At this point, the Neo is just dead as a brick and charges very slowly with 100mA charging current for about 4 to 6 hours until the battery is recharged enough to allow turning on the Neo and charge with 500mA charging current.<br />
<br />
Current status regarding suspend: Suspending and resuming works, when you remove console=ttySAC0,115200 from bootargs_base (see this [http://blog.rot13.org/2007/09/openmoko_as_a_phone.html howto]), it even wakes up with the GSM part working, but it does not make Qtopia wake up on incoming calls or SMS, so you are not getting notified if you turn on suspend.<br />
After pressing the AUX button, the Neo should wake up from suspend though and should inform you of missed calls and received SMS.<br />
<br />
This bug seems to be [http://labs.trolltech.com/blogs/2007/12/04/neo-neuros-and-other-things/ half-workedarounded], but the fix is not included in the most recent (as of 2007-12-16) official Qtopia image yet. There is an unofficial image from Lorn at http://llornkcor.com/neo/qtopia-4.3-snapshot-12192309-neo-flash.tgz that you can try out that includes his fix.<br />
<br />
== Flashing Qtopia images ==<br />
These are instructions for flashing the latest release of Qtopia (27112007). This seems to be the best working<br />
image yet, eg. voice _and_ SMS seems to work.<br />
<br />
The link to the archive file, Qtopia flash image for FIC Neo 1973,<br />
is mentioned below <br />
<br />
http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50 [http://www.qtopia.net/modules/mydownloads/singlefile.php?lid=50]<br />
<br />
Get that and save it on your computer. It should be:<br />
"qtopia-4.3.1-snapshot-1127.tgz"<br />
<br />
Unpack it with:<br />
<br />
tar zxvf qtopia-4.3.1-snapshot-1127.tgz<br />
<br />
This should make you have the following two files, ie. a kernel file and<br />
a rootfs file:<br />
<br />
-rw-r--r-- 1 plr 1000 31956148 2007-11-27 06:55<br />
qtopia-rootfs.2-11270550.jffs2<br />
<br />
-rw-r--r-- 1 plr 1000 1538620 2007-11-10 20:57<br />
uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin<br />
<br />
In case you already do not have a dfu-util utility, you will need to download it. The following version has been tried out and seemed to work.<br />
<br />
http://buildhost.automated.it/OM2007.2/dfu-util [http://buildhost.automated.it/OM2007.2/dfu-util]<br />
<br />
Before moving forward please make sure of the following<br />
<br />
1. You have the necessary permissions in your system (i.e. root access)<br />
<br />
2. dfu-util is executable<br />
<br />
3. Your Neo is in uboot mode<br />
<br />
4. And a USB cable is connected between your computer and the Neo<br />
<br />
5. Realize that the following is low-level stuff and doing something<br />
wrong may brick your Neo<br />
<br />
execute the following from a command line:<br />
<br />
cu -l /dev/ttyACM0<br />
<br />
Which should get you the following:<br />
<br />
Connected.<br />
In: usbtty<br />
Out: usbtty<br />
Err: usbtty<br />
GTA01Bv4 # DEVICE_CONFIGURED: 1<br />
Enabling automatic fast charge<br />
<br />
Press <Enter> and you should get:<br />
<br />
GTA01Bv4 #<br />
<br />
<br />
{{warning|Before flashing the rootfs image, be sure to erase the rootfs using [[nand erase]]. Otherwise, the Neo may hang somewhere after on boot. Before you hit enter on one of the following commands, make sure that you are *not* issuing a plain "nand erase" command - always make sure you tell it which partition to erase. If you forget this you'll brick the Neo and you'll need a debug board to recover it.}}<br />
<br />
At that prompt type:<br />
<br />
nand erase rootfs<br />
<br />
<br />
and the <Enter> key, which should get you:<br />
<br />
NAND erase: device 0 offset 0x2e4000, size 0x3d1c000<br />
OK<br />
GTA01Bv4 #<br />
<br />
At that prompt don't press anything else, but:<br />
<br />
~.<br />
<br />
and the <Enter> key, which should disconnect you from the bootloader.<br />
<br />
<br />
Now, from the computer prompt, execute the following:<br />
<br />
./dfu-util -a kernel -R -D uImage-2.6.22.5-moko11+svnr3238-r7-neo1973.bin<br />
<br />
which should get you the following, and it should only take a few<br />
seconds to finish:<br />
<br />
dfu-util - (C) 2007 by OpenMoko Inc.<br />
This program is Free Software and has ABSOLUTELY NO WARRANTY<br />
<br />
Opening USB Device 0x0000:0x0000...<br />
Claiming USB DFU Runtime Interface...<br />
Determining device status: state = appIDLE, status = 0<br />
Device really in Runtime Mode, send DFU detach request...<br />
Resetting USB...<br />
Opening USB Device...<br />
Found Runtime: [0x1457:0x5119] devnum=3, cfg=0, intf=0, alt=3, name="kernel"<br />
Claiming USB DFU Interface...<br />
Setting Alternate Setting ...<br />
Determining device status: state = dfuIDLE, status = 0<br />
dfuIDLE, continuing<br />
Transfer Size = 0x1000<br />
bytes_per_hash=30772<br />
Starting download: [##################################################]<br />
finished!<br />
state(2) = dfuIDLE, status(0) = No error condition is present<br />
Done!<br />
Resetting USB to switch back to runtime mode<br />
<br />
After that, execute the following:<br />
<br />
./dfu-util -a rootfs -R -D qtopia-rootfs.2-11270550.jffs2<br />
<br />
which should get you the following, and it should take between 5-10min<br />
to finish:<br />
<br />
dfu-util - (C) 2007 by OpenMoko Inc.<br />
This program is Free Software and has ABSOLUTELY NO WARRANTY<br />
<br />
Opening USB Device 0x0000:0x0000...<br />
Claiming USB DFU Runtime Interface...<br />
Determining device status: state = appIDLE, status = 0<br />
Device really in Runtime Mode, send DFU detach request...<br />
Resetting USB...<br />
Opening USB Device...<br />
Found Runtime: [0x1457:0x5119] devnum=5, cfg=0, intf=0, alt=5, name="rootfs"<br />
Claiming USB DFU Interface...<br />
Setting Alternate Setting ...<br />
Determining device status: state = dfuIDLE, status = 0<br />
dfuIDLE, continuing<br />
Transfer Size = 0x1000<br />
bytes_per_hash=639122<br />
Starting download: [##################################################]<br />
finished!<br />
state(2) = dfuIDLE, status(0) = No error condition is present<br />
Done!<br />
Resetting USB to switch back to runtime mode<br />
<br />
In both cases, some text on your Neo should appear, indicating that the<br />
kernel or the rootfs are being downloaded.<br />
<br />
After this, the Neo should be able to boot, and depending on how you<br />
have your boot menu set up, choose "Boot" or perhaps "Boot from NAND".<br />
The method described above in any case puts the software on the NAND<br />
flash, and not on an SD card, if you have that installed.<br />
<br />
<br />
The lasted official Qtopia flash images are found at: http://www.qtopia.net/modules/mydownloads/ (Scroll down on this page to find them)<br />
<br />
Unofficial Qtopia images can be found in the ScaredyCat and Chooseopen [[repositories]].<br />
<br />
For more details on the the process of flashing the Neo, see [[Flashing openmoko]].<br />
<br />
== Dual-booting between Qtopia and X ==<br />
<br />
Both examples described here require you to reformat your MicroSD card to ext3, so this is the first step for both:<br />
<br />
{{warning|The following step will reformat your MicroSD card with the ext3 filesystem. We need it because we need support for symbolic or/and static links, which other filesystems like FAT do not support directly. After reformatting, no data on the card will be accessible to you anymore, so create good backups of anything which you need before starting!}}<br />
<br />
Then ssh to your neo and reformat your MicroSD card with:<br />
umount /dev/mmcblk0p1<br />
mkfs.ext3 /dev/mmcblk0p1<br />
mount /dev/mmcblk0p1<br />
<br />
=== Installing Qtopia into an openmoko rootfs ===<br />
<br />
On [http://www.qtopia.net/modules/devices/openmoko.php], click "Developer root filesystem". Then extract opt/Qtopia and the qpe init script and copy both to the mmc card of your neo:<br />
<br />
tar xzf ficgta01-qtopia-developer-rootfs.tgz opt/Qtopia etc/init.d/qpe<br />
mv opt/Qtopia etc/init.d/qpe . && rm -r opt etc<br />
tar czf Qtopia.tar.gz Qtopia qpe<br />
scp Qtopia.tar.gz root@192.168.0.202:/media/card/<br />
<br />
Log in to your Neo and unpack the archive and install it:<br />
<br />
cd /media/card<br />
tar xzf Qtopia.tar.gz<br />
mkdir -p /opt<br />
ln -s /media/card/Qtopia /opt/Qtopia<br />
mv qpe /etc/init.d<br />
<br />
Now kill the X server and gsmd and start Qtopia (this can take some time):<br />
<br />
/etc/init.d/xserver-nodm stop<br />
/etc/init.d/gsmd stop<br />
/etc/init.d/qpe start<br />
<br />
Now, in theory, it should be possible to could create a new entry in the [[uboot]] boot menu which adds a new boot argument to the kernel, say "qtopia=1" and you could could write a script which checks that boot parameter by checking if "$qtopia" is set to "1" or by checking /proc/cmdline and then boot Qtopia instead of X.<br />
<br />
=== Installing Qtopia on the SD card ===<br />
<br />
* format your SD card with ext3 and mount it (see above)<br />
* unpack rootfs from qtopia-4.3.0-preview-neo-flash.tgz to SD card (see above)<br />
* copy the uImage-2.6.22.5-moko11-r2-fic-gta01.bin kernel to the boot/ on SD card and rename it to uImage<br />
* put a 'Boot from SD' menu item in uboot menu as explained here: [[Booting_from_SD#Step_3:_Add_uboot_boot_entry]]<br />
<br />
== Build Qtopia from source ==<br />
If you want to build qtopia for yourself you can download the [ftp://ftp.trolltech.com/qtopia/tech-preview/ technical preview] or [ftp://ftp.trolltech.com/qtopia/snapshots/ snapshots]<br />
<br />
== Tips ==<br />
Most things seem to work out of the box, however you might need to use the following command to get audio (but not with the official flash image available from Trolltech):<br />
alsactl -f /etc/gsmhandset.state restore<br />
Or put this command in /etc/init.d/qpe line 64<br />
<br />
Do not switch themes. Only the default theme is usable. For example, once you switch themes, the lock feature continues to work, but only if you unlock using the smallest # keypad in the world.<br />
<br />
Suspend support is very flaky. The neo often shuts off from a suspend state. It will not wake from suspend for an incoming call or text message (someone try setting an alarm and report results here). To turn suspend off (this will of course use the batteries very quickly), hit the down arrow next to the suspend setting in the power management until it says "Off".<br />
<br />
When using the "Predictive keyboard," do a quick flick up or down over the keyboard to access numbers/symbols/capitals. In snapshot builds, you can select virtual keyboard by tapping on the little arrow icon to the left of the battery status icon.<br />
<br />
In summary, Qtopia on the Neo1973 is much closer to being ready than OpenMoko as of this writing. However, sound and suspend support prevent it from being at all useful as a cell phone (as a landline that doesn't ring but instead vibrates, it works ok).<br />
<br />
The [http://www.qtopia.net/modules/newbb_plus/viewtopic.php?topic_id=473&forum=4 Qtopia forum area on the FIC GTA01] might be helpful, but it is preferred that you update this section with issues and fixes you find.<br />
<br />
== Screenshots ==<br />
<br />
{|<br />
|-<br />
|[[Image:Qtopia001.png|thumb|center|240px]]<br />
|[[Image:Qtopia002.png|thumb|center|240px]]<br />
|[[Image:Qtopia003.png|thumb|center|240px]]<br />
|-<br />
|[[Image:Qtopia004.png|thumb|center|240px]]<br />
|[[Image:Qtopia005.png|thumb|center|240px]]<br />
|[[Image:Qtopia006.png|thumb|center|240px]]<br />
|}<br />
<br />
== Videos ==<br />
<br />
http://www.youtube.com/watch?v=YW5q8SpY7t4<br />
http://www.youtube.com/watch?v=iOG_mtSEMgs<br />
<br />
For full size videos, 346 MiB:<br />
<br />
http://linuxtracker.org/download.php?id=4613&name=qt_on_neo1973_videos.torrent<br />
<br />
{{Languages|Qtopia_on_Neo1973}}<br />
<br />
[[Category:Distributions]]<br />
[[Category:Software]]<br />
[[Category:Applications]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-02-22T03:36:25Z<p>Sunlt: </p>
<hr />
<div>= 简介 =<br />
<br />
工具链是一组用来编译代码的工具集。OpenMoko有两类不同用途的工具链:<br />
<br />
* 开发简单的应用程序<br />
<br />
For this, you should use a prebuilt toolchain from the OpenMoko project. Here you can find a recipe to get started with this toolchain leading you through a series of steps to compile a project and run it on your target device. You might have heard about [[OpenEmbedded]], however as an application programmer, you should '''not''' be using [[OpenEmbedded]].<br />
<br />
* 系统集成和定制发行版<br />
<br />
For this task, you should use [[OpenEmbedded]] which builds its own cross compiler during the bootstrapping/build process. System Integration and customizing a distribution is out of scope of this page.<br />
<br />
=基本工具链的用法=<br />
<br />
==先决条件==<br />
<br />
You should be reasonably familiar with Linux and its command line tools, have an x86-compatible computer with at least 1G of free disk space. You should have experience with compiling programs from source using your local compiler. The remainder of this document will also assume you have write access in your home directory (~) and <tt>/usr/local/</tt> (becoming root if needed). If any of this is not the case, please call your local administrator for help.<br />
<br />
Last but not least you should have a working setup that allows you to compile native software packages using the autotools build system (the triade of '''./configure, make, make install''').<br />
<br />
A (partial) list of required packages -- please append as necessary:<br />
<br />
* For most Linux version you might only need to install the packages<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* For ubuntu (7.10) the following is required:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev glib-gettextize ccache libxrender-dev<br />
<br />
==下载和安装==<br />
<br />
The prebuilt toolchain can be downloaded from [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]:<br />
<br />
* Creating a destination directory can be anywhere, but for example:<br />
<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* Depending on your CPU type (x86_64 or i686) download the proper package:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
Next, you want to extract it on your filesystem. This toolchain is ''not'' relocatable, it needs to be installed into <tt>/usr/local/openmoko/</tt>.<br />
Now you have the following options:<br />
<br />
* Extract it directly as root, so use command "su" first (or prefix the tar command with "sudo" when you are using Debian/Ubuntu):<br />
<br />
cd /<br />
tar xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* On Debian-based systems, you can use alien(+fakeroot) to create an easy-to-uninstall package from this .tar.bz2 (install with dpkg -i <package.deb>):<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* The prebuilt toolchain is for x86_64 or i686. If you wanted, you could build it on your own with OE:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
Finally, everytime you want to use this toolchain, you need to alter some environment variables, so that your tools will be found. The toolchain provides a script to do that, so the only thing you need to do is to source it.<br />
Note that if you are not using a "sh" or "bash" shell (check with "echo $SHELL") that you need<br />
to start "sh" or "bash" first.<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==构建简单的项目==<br />
<br />
In a choosen destination directory (in this example ~/):<br />
<br />
* copy the downloaded sample application source:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* Remember to set the proper environment variables (again with "sh" or "bash") for openmoko:<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* You need to create a build configuration for this application. This also checks if all needed libraries, tools, etc.. is available on your system. If this fails see the notes about the needed packages in the section "Prerequisites" mentioned earlier.<br />
<br />
om-conf openmoko-sample2<br />
<br />
* Optionally now you can modify the source code in openmoko-sample2/src<br />
<br />
* To build the application from the source code you only need to use "make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
If you want to install this project on host for staging usage later, a shared library, for example, you can do the following to install it into a given configured prefix.<br />
<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==打包编译好的应用程序==<br />
<br />
We have included a script to make an ipkg out of your application. Note that this is not needed to test your application on the Neo (for that you can just scp the resulting binary and data over), however it's very handy if you want to distribute your application to others.<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
Now you got openmoko-sample2_0.1_armv4t.ipk , you can `scp' it to your<br />
Neo and install it:<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
Note that while you can redistribute the generated ipkg, be aware that this is a bare-bones ipk that contains no further information, i.e. you will lack library dependencies. See below how to fix this.<br />
<br />
You can also supply the version number, a description, and an author / contacts string in a control file:<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
A template of myapp_control:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==Where to go from here==<br />
<br />
Using the external toolchain is an easy way to build applications for your Neo. If you are familiar with this procedure, you might also want to look into<br />
* Using [[Qemu]] to test your applications in an emulated environment<br />
* Using [[Host-based_development_with_Xoo_and_Xephyr|host-based development]] to improve your efficiency<br />
* Using [[OpenEmbedded]] to customize your OpenMoko distribution image<br />
<br />
=Advanced topics=<br />
==Using toolchain provided libraries==<br />
Add the necessary libraries to the _LDADD field in src/Makefile.am, for example:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
make sure to run om-conf again after this.<br />
<br />
==Installing additional libraries into the toolchain==<br />
<br />
Sooner or later you will want to compile an application that has dependencies which can't be fulfilled by the precompiled toolchain, e.g. some obscure libraries.<br />
<br />
In that case, feel free to request the inclusion of additional libraries into the next release of the OpenMoko toolchain. Until then, here is how you enhance your already installed toolchain. Say, we want to add the library called liburiparse:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
That's it.<br />
<br />
==Getting your application packaged by OE==<br />
<br />
If you have written a cool application which you want to share with others, the best way to do that is to<br />
<br />
# upload your application source code to a public location<br />
# submit a [[BitBake]] recipe to [[OpenEmbedded]], preferably via the [http://bugs.openembedded.org OpenEmbedded bugtracker].<br />
<br />
See also [[Customizing your OpenMoko distribution]].<br />
<br />
==Troubleshooting==<br />
<br />
* Please use the [http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] mailing list.<br />
<br />
{{Languages|Toolchain}}<br />
<br />
[[Category:OpenMoko]]</div>Sunlthttp://openmoko.org/wiki/Toolchain/zh_cnToolchain/zh cn2008-02-22T03:32:14Z<p>Sunlt: </p>
<hr />
<div>= Introduction =<br />
<br />
A toolchain is a set of tools that allows you to compile code. For OpenMoko, we have to differenciate the following use-cases:<br />
<br />
* Developing a single application<br />
<br />
For this, you should use a prebuilt toolchain from the OpenMoko project. Here you can find a recipe to get started with this toolchain leading you through a series of steps to compile a project and run it on your target device. You might have heard about [[OpenEmbedded]], however as an application programmer, you should '''not''' be using [[OpenEmbedded]].<br />
<br />
* System Integration and customizing a distribution<br />
<br />
For this task, you should use [[OpenEmbedded]] which builds its own cross compiler during the bootstrapping/build process. System Integration and customizing a distribution is out of scope of this page.<br />
<br />
=Basic toolchain usage=<br />
<br />
==Prerequisites==<br />
<br />
You should be reasonably familiar with Linux and its command line tools, have an x86-compatible computer with at least 1G of free disk space. You should have experience with compiling programs from source using your local compiler. The remainder of this document will also assume you have write access in your home directory (~) and <tt>/usr/local/</tt> (becoming root if needed). If any of this is not the case, please call your local administrator for help.<br />
<br />
Last but not least you should have a working setup that allows you to compile native software packages using the autotools build system (the triade of '''./configure, make, make install''').<br />
<br />
A (partial) list of required packages -- please append as necessary:<br />
<br />
* For most Linux version you might only need to install the packages<br />
** autoconf, automake<br />
** binutils, gcc, gcc-c++<br />
** libtool<br />
** ccache<br />
** intltool<br />
<br />
* For ubuntu (7.10) the following is required:<br />
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev glib-gettextize ccache libxrender-dev<br />
<br />
==Downloading and installing==<br />
<br />
The prebuilt toolchain can be downloaded from [[http://downloads.openmoko.org/toolchains downloads.openmoko.org]]:<br />
<br />
* Creating a destination directory can be anywhere, but for example:<br />
<br />
mkdir ~/sources<br />
cd ~/sources<br />
<br />
* Depending on your CPU type (x86_64 or i686) download the proper package:<br />
<br />
wget http://downloads.openmoko.org/toolchains/openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
or<br />
wget http://downloads.openmoko.org/toolchains/openmoko-i686-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
<br />
Next, you want to extract it on your filesystem. This toolchain is ''not'' relocatable, it needs to be installed into <tt>/usr/local/openmoko/</tt>.<br />
Now you have the following options:<br />
<br />
* Extract it directly as root, so use command "su" first (or prefix the tar command with "sudo" when you are using Debian/Ubuntu):<br />
<br />
cd /<br />
tar xjvf ~/sources/openmoko-XYZ-arm-linux-gnueabi-toolchain.tar.bz2<br />
<br />
* On Debian-based systems, you can use alien(+fakeroot) to create an easy-to-uninstall package from this .tar.bz2 (install with dpkg -i <package.deb>):<br />
<br />
bunzip2 openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.bz2<br />
gzip openmoko-x86_64-arm-linux-gnueabi-toolchain.tar<br />
fakeroot alien -d openmoko-x86_64-arm-linux-gnueabi-toolchain.tar.gz<br />
<br />
* The prebuilt toolchain is for x86_64 or i686. If you wanted, you could build it on your own with OE:<br />
<br />
bitbake meta-toolchain-openmoko<br />
<br />
Finally, everytime you want to use this toolchain, you need to alter some environment variables, so that your tools will be found. The toolchain provides a script to do that, so the only thing you need to do is to source it.<br />
Note that if you are not using a "sh" or "bash" shell (check with "echo $SHELL") that you need<br />
to start "sh" or "bash" first.<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
==Building a sample project==<br />
<br />
In a choosen destination directory (in this example ~/):<br />
<br />
* copy the downloaded sample application source:<br />
<br />
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/<br />
<br />
* Remember to set the proper environment variables (again with "sh" or "bash") for openmoko:<br />
<br />
. /usr/local/openmoko/arm/setup-env<br />
<br />
* You need to create a build configuration for this application. This also checks if all needed libraries, tools, etc.. is available on your system. If this fails see the notes about the needed packages in the section "Prerequisites" mentioned earlier.<br />
<br />
om-conf openmoko-sample2<br />
<br />
* Optionally now you can modify the source code in openmoko-sample2/src<br />
<br />
* To build the application from the source code you only need to use "make":<br />
<br />
cd openmoko-sample2<br />
make<br />
<br />
If you want to install this project on host for staging usage later, a shared library, for example, you can do the following to install it into a given configured prefix.<br />
<br />
om-conf --prefix=/usr/local/openmoko openmoko-sample2<br />
cd openmoko-sample2<br />
make install<br />
<br />
==Packaging your application==<br />
<br />
We have included a script to make an ipkg out of your application. Note that this is not needed to test your application on the Neo (for that you can just scp the resulting binary and data over), however it's very handy if you want to distribute your application to others.<br />
<br />
om-make-ipkg openmoko-sample2<br />
<br />
Now you got openmoko-sample2_0.1_armv4t.ipk , you can `scp' it to your<br />
Neo and install it:<br />
<br />
scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202:<br />
ssh root@192.168.0.202 ipkg install openmoko-sample2_0.1_armv4t.ipk<br />
<br />
Note that while you can redistribute the generated ipkg, be aware that this is a bare-bones ipk that contains no further information, i.e. you will lack library dependencies. See below how to fix this.<br />
<br />
You can also supply the version number, a description, and an author / contacts string in a control file:<br />
<br />
om-make-ipkg myapp myapp_control<br />
<br />
A template of myapp_control:<br />
<br />
Package: $appname<br />
Version: 0.1<br />
Description: package built by openmoko toolchain<br />
Section: openmoko/applications<br />
Priority: optional<br />
Maintainer: $USER<br />
Architecture: armv4t<br />
Homepage: http://www.openmoko.org/<br />
Depends: <br />
Source: ${SRC}<br />
<br />
==Where to go from here==<br />
<br />
Using the external toolchain is an easy way to build applications for your Neo. If you are familiar with this procedure, you might also want to look into<br />
* Using [[Qemu]] to test your applications in an emulated environment<br />
* Using [[Host-based_development_with_Xoo_and_Xephyr|host-based development]] to improve your efficiency<br />
* Using [[OpenEmbedded]] to customize your OpenMoko distribution image<br />
<br />
=Advanced topics=<br />
==Using toolchain provided libraries==<br />
Add the necessary libraries to the _LDADD field in src/Makefile.am, for example:<br />
openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2<br />
<br />
make sure to run om-conf again after this.<br />
<br />
==Installing additional libraries into the toolchain==<br />
<br />
Sooner or later you will want to compile an application that has dependencies which can't be fulfilled by the precompiled toolchain, e.g. some obscure libraries.<br />
<br />
In that case, feel free to request the inclusion of additional libraries into the next release of the OpenMoko toolchain. Until then, here is how you enhance your already installed toolchain. Say, we want to add the library called liburiparse:<br />
<br />
cd ~/source<br />
wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2<br />
./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/openmoko/arm<br />
make<br />
make install<br />
<br />
That's it.<br />
<br />
==Getting your application packaged by OE==<br />
<br />
If you have written a cool application which you want to share with others, the best way to do that is to<br />
<br />
# upload your application source code to a public location<br />
# submit a [[BitBake]] recipe to [[OpenEmbedded]], preferably via the [http://bugs.openembedded.org OpenEmbedded bugtracker].<br />
<br />
See also [[Customizing your OpenMoko distribution]].<br />
<br />
==Troubleshooting==<br />
<br />
* Please use the [http://lists.openmoko.org/mailman/listinfo/openmoko-devel OpenMoko-Devel] mailing list.<br />
<br />
{{Languages|Toolchain}}<br />
<br />
[[Category:OpenMoko]]</div>Sunlthttp://openmoko.org/wiki/User:SunltUser:Sunlt2008-02-22T02:20:58Z<p>Sunlt: </p>
<hr />
<div>* sunlt is chinese with the full name Sun Liantao.<br />
* He works in [http://www.csip.org.cn Ministry of Information Industry CSIP].<br />
* He is a member of [http://www.beijinglug.org Beijing Linux User Group] and BOSS which stands for Beijing University of Posts and Telecommunications Open Source Society.<br />
* He focuses on both the technology and commercial things of Embedded Linux System.<br />
* Email : sunlt@csip.org.cn</div>Sunlthttp://openmoko.org/wiki/User:SunltUser:Sunlt2008-02-22T02:20:11Z<p>Sunlt: </p>
<hr />
<div>* sunlt is chinese with the full name Sun Liantao. He works in [http://www.csip.org.cn Ministry of Information Industry CSIP].He is a member of [http://www.beijinglug.org Beijing Linux User Group] and BOSS which stands for Beijing University of Posts and Telecommunications Open Source Society.He focuses on both the technology and commercial things of Embedded Linux System.<br />
* Email : sunlt@csip.org.cn</div>Sunlthttp://openmoko.org/wiki/User:SunltUser:Sunlt2008-02-22T02:16:31Z<p>Sunlt: </p>
<hr />
<div>sunlt is chinese which name is Sun Liantao. He works in [http://www.csip.org.cn MII CSIP]. He is a member of [http://www.beijinglug.org Beijing Linux User Group]. He focuses on both the technology and commercial things of Embedded Linux System. <br />
Email : sunlt@csip.org.cn</div>Sunlthttp://openmoko.org/wiki/TranslationTranslation2008-02-22T02:12:30Z<p>Sunlt: /* Chinese (Simplified) */</p>
<hr />
<div>{{todo|{{PAGENAME}}}}<br />
<br />
Let us spread the popularity of OpenMoko/Neo1973 by localization of the software and translation of documentation and wiki.<br />
<br />
Just as an overview who is able and willing to translate parts into other languages,<br />
please join and add your Language and name. The source for the translation will<br />
be English. If you have good English skills then you could contribute by correcting<br />
the sources :)<br />
<br />
A good point to start would be to continuous translating of <br />
http://en.wikipedia.org/wiki/OpenMoko into more languages on the other language sites of wikipedia.<br />
<br />
"...it is easy to join and spend some minutes for translating,<br />
and when someone finds some mistakes in any languages don't<br />
blame the translator - just be productive and fix it yourself!" -[[User:RobertMichel|Robert Michel]]<br />
<br />
Please take a look at [[Translation HOWTO]] and improve it if possible.<br />
<br />
Languages already offered on our community mailinglist, please add your name yourself and join community mailinglist (until we'll have a proper mailinglist) to discuss about translations:<br />
<br />
== Afrikaans ==<br />
<br />
== Amharic ==<br />
* [[User:ethiopia|Ethiopia Alemayehu]]<br />
<br />
== Armenian ==<br />
* [[User:surenk|Suren Karapetyan]]<br />
<br />
== Arabic عربي == <br />
* Hossam Mahmoud حسام محمود<br />
* [[User:ترجمان05|ترجمان05]]<br />
* [[User:Lixy|Lixy]] 17:54, 21 July 2007 (CEST)<br />
<br />
== Bulgarian == <br />
* [[User:Mr700|Doncho Nicolaev Gunchev]]<br />
<br />
== Catalan ==<br />
<br />
* [[User:montxovs|Montxo Vicente i Sempere]]<br />
<br />
* [[User:Mandarino|Mandarino]]<br />
<br />
* [[User:RafaelCarreras|Rafael Carreras]]<br />
<br />
* [[User:JaumeI|JaumeI]]<br />
<br />
== Chinese (Simplified)== <br />
* [[User:JarodWang|JarodWang]]<br />
* xyb<br />
* [[User:Liuxf|Liuxf]]<br />
* [[User:sunlt|sunlt]]<br />
<br />
== Czech ==<br />
* [[User:Mikesh|Michal Heczko]]<br />
* [[User:Vatoz|Vaclav Cerny]]<br />
<br />
== Danish == <br />
* [[User:EsbenDamgaard|Esben Damgaard]]<br />
* [[User:UlrikRasmussen|Ulrik Rasmussen]]<br />
* [[User:miki|Mikkel Kirkgaard Nielsen]]<br />
<br />
== Dutch == <br />
* [[User:MarcVerwerft|Marc Verwerft]]<br />
* [[User:Madjo|Marcel De Jong]]<br />
* [[User:LuitvD|Luit van Drongelen]]<br />
* [[User:reinouts|Reinout van Schouwen]]<br />
* [[User:Steamrunner|Koen De Voegt]]<br />
<br />
([[User:Madjo|Marcel]] 18/04) Misschien is het handig om alvast te beginnen met vertalen van de Wiki? Of hebben jullie andere ideeen? Ik heb al een start gemaakt van de voorpagina van de wiki, maar ben nog niet veel verder gekomen<br />
([[User:reinouts|Reinout]] 21/04) Valt er verder nog niks te vertalen? De wiki is niet echt boeiend.<br />
<br />
== Esperanto ==<br />
* [[User:Antono|Antono Vasiljev]]<br />
* [[User:Alekcxjo|Alekĉjo Rajmondo]]<br />
<br />
== Estonian ==<br />
* [[User:Hadara|Sven Petai]]<br />
* [[User:Myoldryn|Jaan Nigul]]<br />
<br />
== Finnish == <br />
<br />
Notes to Finnish translators: please use the dictionary at [http://lokalisointi.org/ lokalisointi.org], avoid anglisms, avoid capital letters where unnecessary etc., kiitos :) Also, send new, big translations to [http://lokalisointi.org/mailman/listinfo/laatu laatu] mailing list for review. Until openmoko specific lists, you may join [http://lokalisointi.org/mailman/listinfo/keskustelu keskustelu] list too (it can be used despite the fact it's been silent).<br />
<br />
* [[User:gua|Atte Hinkka]]<br />
* [[User:Jani-Matti_Hätinen|Jani-Matti Hätinen]]<br />
* [[User:TimoJyrinki|Timo Jyrinki]]<br />
* [[User:Eyec|Samuli Perttula]]<br />
* [[User:TuomoSipola|Tuomo Sipola]]<br />
<br />
== French ==<br />
* [[User:SebastienJolicoeur|Sebastien Jolicoeur]]<br />
* [[User:MarcSert|Marc Sert]]<br />
* [[User:FoucaultdeBonneval|Foucault deBonneval]]<br />
* [[User:Sufflope|Jean-Sébastien Bour]]<br />
* [[User:Ymahe|Yves Mahé]]<br />
* [[User:opampca|Richard Lussier, Canada]]<br />
* [[User:Kheldar|Guillaume Maiano]]<br />
* [[User:Thomas01|Thomas Leclere]]<br />
* [[User:fredlala|Frédéric Lasnier]]<br />
* [[User:alekcxjo|Alexandre Raymond]]<br />
<br />
== German ==<br />
* [[User:RobertMichel|Robert Michel]]<br />
* [[User:FabianOff|Fabian Off]]<br />
* [[User:Denis std|Denis]]<br />
* [[User:ktd85|Thomas Drewermann]]<br />
* Lars C.<br />
* [[User:AndreasHochsteger|Andreas Hochsteger]]<br />
* [[User:Christophloew|Christoph Löw]]<br />
* [[User:dFence|Daniel Zauner]]<br />
* [[User:Imitation|Thomas Sanladerer]]<br />
* [[User:Peter Santo|Peter Santo]]<br />
* [[User:Bartholomaus|Marco K.]]<br />
<br />
== Greek ==<br />
* [[User:Chronix|Polychronis Papadakis]]<br />
<br />
== Hebrew ==<br />
* [[User:OlegSverdlov|Oleg Sverdlov]]<br />
* [[User:Any_Key|Any_Key]]<br />
* [[User:Koala|Koala]]<br />
<br />
== Hungarian ==<br />
* [[User:ZeD|Zoltán Balogh]]<br />
<br />
== Indonesian ==<br />
* [[User:Hcblue|Hcblue]]<br />
<br />
== Italian ==<br />
* per il momento useremo [http://www.openmokoboard.org/ita/index.php?getforum=24 questo forum] per organizzarci. iscrivetevi e partecipate.<br />
* [[User:SergioTota|Sergio Tota]]<br />
* [[User:Franco|Franco Rimoldi]]<br />
* [[User:Filippo|Filippo]]<br />
* [[User:Massi|Massimiliano]]<br />
* [[User:Markk0|Marco Cattaneo]]<br />
* [[User:Cga|Callea Gaetano Andrea]]<br />
* [[User:Herod2k|Alessandro]]<br />
* [[User:shainer|Lisa Vitolo]]<br />
* [[User:tia1982|Mattia]]<br />
* [[User:azanutta|abe]]<br />
* [[User:Gualti|Gualtiero]]<br />
* [[User:Milo|Milo Casagrande]]<br />
* [[User:White|Marco Celeri]]<br />
* [[User:Aegis|Maurizio Scorianz]]<br />
<br />
== Japanese ==<br />
*[[User:WilliamLai|William Lai]]<br />
*[[Momoko Matsuzaki]]<br />
<br />
== Norwegian ==<br />
*[[User:Vegar|Vegar Storvann]]<br />
*[[User:Denniz|Denniz Fjerdingby]]<br />
<br />
== Polish ==<br />
* [[User:KrzysztofKajkowski|Krzysztof Kajkowski]]<br />
* Tomasz Zieliński<br />
* [[User:MaciejLigenza|Maciej Ligenza]]<br />
* [[User:PiotrDuda|Piotr Duda]]<br />
* [[User:Zbraniecki|Zbigniew Braniecki]]<br />
<br />
== Portuguese ==<br />
*[[User:Skull Death|James Côrtes]]<br />
* Sergio Bessa<br />
* Mario Costa<br />
*[[User:kuyky|Tiago Saraiva]]<br />
<br />
== Punjabi ==<br />
* [[User:aalam|A S Alam]]<br />
<br />
== Romanian ==<br />
<br />
* [[User:alexxed|Alexandru Szasz]]<br />
* [[User:sin|Lucian]]<br />
* [[User:Adrians|Adrians]]<br />
<br />
== Russian ==<br />
* [[User:OlegSverdlov|Oleg Sverdlov]]<br />
* [[User:DenisBY|Denis Kot]]<br />
* [[User:MikhailGusarov|Mikhail Gusarov]]<br />
* [[User:x-demon|Alexander Sokolow]]<br />
* [[User:Any_Key|Any_Key]]<br />
* [[User:Dmitri|Dmitri]]<br />
* [[User:Buffet|Denis Kaledin]]<br />
* [[User:Nes|Mike Drapolyuk]]<br />
* [[User:vase|Vasiliy Tolstov]]<br />
* [[User:Shadowjack|Shadowjack]]<br />
* [[User:Cray|Denis Parchenko]]<br />
* [[User:Vlad|Vladimir Orlov]]<br />
* [[User:xnike|Nikolay Khramchenkov]]<br />
Можем начинать переводить wiki :)<br />
К любой странице добавляете /ru и переводите. В конце оригинальной страницы и переведенной добавляете ссылку на шаблон <br />
<nowiki>{{Languages|Имя_страницы_оригинала}}</nowiki><br />
<br />
== Slovak == <br />
* [[User:Cezz|Cezz]]<br />
* [[User:PipBoy2000|PipBoy2000]]<br />
* [[User:m4rtin.m|m4rtin.m]]<br />
<br />
== Spanish ==<br />
* [[User:RosangelaCaninoKoning|Rosangela CaninoKoning]]<br />
* [[User:kresp0|Santiago Crespo (kresp0)]]<br />
* [[User:José_Suárez|José Suárez]]<br />
* [[User:Rafa_Couto|Rafa Couto (caligari)]]<br />
* [[User:NeoMorfeo|Guillermo Santos (NeoMorfeo)]]<br />
* [[User:Mandarino|Mandarino]]<br />
* [[User:pptudela|Pepe Tudela]]<br />
* [[User:avathar|Fernando González (Avathar)]]<br />
* [[User:Rbruzz|Rbruzz]]<br />
* [[User:Saaib|Urivan Flores Saaib (Saaib)]]<br />
* [[User:mutrox|David Samblas Martinez (mutrox)]]<br />
<br />
== Swedish ==<br />
* [[User:yeager|Daniel Nylander]]<br />
* [[User:possan|Per-Olov Jernberg]]<br />
* [[User:C.M|Claes Mogren]]<br />
<br />
== Turkish ==<br />
* [[User:EnginErenturk|Engin Erenturk]]<br />
* [[User:Supernova|İsmail AŞCI]]<br />
<br />
== Welsh ==<br />
* [[User:Rhoslyn_Prys|Rhoslyn Prys]]<br />
<br />
<br />
And feel free to join and add an new language to this list above.<br />
<br />
{{Languages|Translation}}</div>Sunlthttp://openmoko.org/wiki/Openmoko:Current_eventsOpenmoko:Current events2008-02-22T01:58:43Z<p>Sunlt: /* Past */</p>
<hr />
<div>This ''Current Events'' page provides information on both [[Current events#Past | past ]] and [[Current events#Upcoming | future]] events where FIC or [[OpenMoko]] had or will have a presence.<br />
<br />
== Upcoming ==<br />
* 2008-03-28: [[OpenMoko Education/zh tw]] - Friday March 28, 2008. | Hualien, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Dong Hwa University <br />
* 2008-03-26: [[OpenMoko Education/zh tw]] - Wednesday March 26, 2008. | Chung Li, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at Yuan Ze University <br />
* 2008-03-16: [http://www.bossaconference.indt.org/ Bossa'08] - March 16-19, 2008 | Porto de Galinhas, Brazil| [[User:Raster|Raster]] is attending and will give a talk<br />
* 2008-03-12: [http://www.openexpo.ch/openexpo-2008-bern/ OpenExpo'08] - March 12-13, 2008 | Bern, Switzerland | [[User:Mickey|Mickey]] is giving a talk about OpenMoko | [[User:C7|C7]] is organising an OpenMoko booth<br />
* 2008-03-03: [[OpenMoko Education/zh tw]] - Monday March 3, 2008. | Chung Li, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at Chung Yuan Christian University <br />
* 2008-02-27: [[OpenMoko Education/zh tw]] - Wednesday February 27, 2008. | Hsinzhu, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Chiao Tung University <br />
* 2008-02-23: [http://www.fosdem.org Fosdem'08] - February 23-24, 2008 | Brussels, Belgium | OpenMoko will be present at the [http://www.openembedded.org OpenEmbedded] booth, lots of OpenMoko developers will be present. [[Events:FOSDEM_2008 | Will you be there?]]<br />
* 2008-02-22: [[OpenMoko Education/zh tw]] - Friday February 22, 2008. | Tainan, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Cheng Kung University<br />
<br />
== Past ==<br />
* 2008-02-19: [http://www.oss.org.cn/index.php?option=com_content&task=view&id=677&Itemid=162 2008 Linux Developer Symposium-China] - February 19, 2008 | Beijing, China | Neo1973 was presented in a booth by Sun Liantao from [http://www.csip.org.cn CSIP] and [http://www.beijinglug.org BLUG]<br />
* 2008-02-08: [http://www.socallinuxexpo.org/ SCALE'08] - February 8-10, 2008 | Los Angeles, USA | [[User:Raster|Raster]] is attending and will man the OpenMoko and Enlightenment booths<br />
* 2008-01-07: Consumer Electronics Trade Show. [[Neo FreeRunner]] was presented. Links to stories, pictures, and videos:<br><br />
[[http://gizmodo.com/341755/openmoko-neo-freerunner-linux-smartphone-hands+on gizmodo]]<br><br />
[[http://takezero.net/3g-and-mobile-news/hands-on-with-fics-openmoko-powered-freerunner-2 takezero ]]<br><br />
[[http://youtube.com/watch?v=SZsps3bj6yE youtube]]<br><br />
[[http://www.reghardware.co.uk/2008/01/11/ces_video_openmoko_handset/ reghardware]]<br><br />
* 2007-12-19: [[OpenLab 2nd Event/zh tw]] - December 19, Wed. | Taipei, Taiwan | OpenLab 2nd Event: GPL & Apache License Talk and Discussion.<br />
* 2007-11-17: [[OpenMoko OpenLab Opening]] - November 17, Sat. | Taipei, Taiwan | OpenLab for OpenMoko Community is going to open.<br />
* 2007-11-04: [http://coscup.org/2007/ Conference for Open Source Coders, Users and Promoters] - November 04 | Taipei, Taiwan | Jollen gave a talk about OpenMoko and OpenLab ideas.<br />
* 2007-10-13: [http://onlinux.ca OnLinux Ontario Linux Fest 2007] - October 13 | Toronto, Canada | [[User:Idarwin|Ian Darwin]] gave a talk about OpenMoko (slides [http://www.darwinsys.com/openmoko/ here]).<br />
* 2007-10-02: [http://www.coss.fi/web/openmind/programme Openmind Conference] - October 02-03, 2007 | Tampere, Finland | Michael Shiloh as a speaker<br />
* 2007-09-26: [http://imm.dtu.dk/ IMM at Danish Technical University] - [http://ole.tange.dk Ole Tange] is giving a talk.<br />
* 2007-09-23: [http://www.barcamporlando.org/ BarCamp Orlando] Orlando, FL, USA | [[User:Writchie|Wally Ritchie]] will show Neos and talk about OpenMoko project<br />
* 2007-09-20: [http://www.openexpo.ch/openexpo-2007-zuerich/ OpenExpo'07] - September 19-20, 2007 | Zurich, Switzerland | [[User:Mickey|Mickey]] gave a talk about OpenMoko | [[User:C7|C7]] was organising an OpenMoko booth<br />
* 2007-09-15: [http://mrmcd110b.metarheinmain.de metarheinmain chaosdays 110b] - ixs igave a [https://mrmcd110b.metarheinmain.de/fahrplan/events/2107.en.html talk]<br />
* 2007-09-12: [http://dmusyd.edu/ Datamatikeruddannelsen i Nykøbing Falster] - [http://ole.tange.dk Ole Tange] gave a talk.<br />
* 2007-08-30: [http://mobiledevices.kom.aau.dk/team_and_organization/events/mobile_developer_days_2007/ Mobile Developer Days 2007] - August 30 - September 2, 2007 | at Aalborg University, Denmark | [[User:Mickey|Mickey]] was invited to give a speech<br />
* 2007-08-25: [http://www.froscon.org/Home.2.0.html?L=1 FrosCon'07] - August 25-26, 2007 | Sankt Augustin, Bonn, Germany | Mickey gave a talk about OpenMoko<br />
* 2007-08-21: [http://www.beijinglug.org/en/index.php Beijing LUG] - August 21, 2007 | Sean and other OpenMoko team members were there to talk and give a presentation<br />
* 2007-08-08 till 08-12: [http://events.ccc.de/camp/2007/Chaos_Communication_Camp_2007 Chaos Communication Camp 2007] took place in Finowfurt (close to Berlin, Germany) featuring the [http://events.ccc.de/camp/2007/GSM_Village GSM Village]<br />
* 2007-08-04: [http://barcamp.org/BarCampRDU BarCampRDU] Raleigh, NC, USA | [[User:Writchie|Wally Ritchie]] showed neos and talk about OpenMoko project <br />
* 2007-08-03: [http://wikimania2007.wikimedia.org/wiki/Main_Page wikimania 2007] - August 03-05, 2007 | Taipei, Taiwan | OpenMoko has been invited to co-host with Wiki heads to promote open content in Taiwan.<br />
* 2007-07-26 [http://conferences.oreillynet.com/os2007/ OSCON 2007] | OpenMoko Birds of a Feather session July 26th, Portland Oregon<br />
* 2007-07-15: [http://www.guadec.org GUADEC, The GNOME Conference 2007] - July 15-21, 2007 | Birmingham, United Kingdom | [[User:Mickey|Mickey]] gave a talk about OpenMoko<br />
* 2007-07-10: [http://www.rmll.info 8th Libre Software Meeting] - July 10-14, 2007 | Amiens, France | [http://datenfreihafen.org Stefan Schmidt] gave a [http://www.rmll.info/article136.html?lang=en talk] about OpenEZX and OpenMoko<br />
* 2007-07-09: The [http://www.openmoko.com openmoko.com web shop] was opened; first sales of GTA01_v4 devices.<br />
* 2007-06-05: [http://www.computextaipei.com.tw Computex Taipei 2007] - June 5-9, 2007 | Taipei World Trade Center, Taipei, Taiwan | OpenMoko was in the FIC Group's Booth<br />
* 2007-06-01: [http://www.linuxtag.org/2007/en/home/welcome.html LinuxTag 2007] - May 30-June-2, 2007 | LinuxTag in Berlin, Germany | [[User:Mickey|Mickey]] gave a [http://www.linuxtag.org/2007/en/conf/events/vp-speakers/details.html?talkid=84 talk] about OpenMoko<br />
* 2007-05-19: [http://www.makerfaire.com/ Maker Faire Events] -- May 19-May 20, 2007 | San Francisco Bay Area, San Mateo Expo Center, USA | Michael Shiloh and Jon Phillips presented at OpenMoko's booth on behalf of Sean<br />
* 2007-05-08 [http://wiki.tossug.org/SignUp:2007-05 Taipei Open Source Software User Group (TOSSUG)] - Cafe Lumiere, Taipei, Taiwan | May 8, 2007<br />
* 2007-04-04 [http://fostel2007.fostel.org/index.php/Main_Page FOSTEL] - European Institute of Technology, Paris, France | April 4-5, 2007<br />
* 2007-03-16: On March 16, 2007 [[User:Mickey|Mickey]] presented the device at a Zaurus User Group Meeting in Düsseldorf, Germany.<br />
* 2007-03-15: On March 15-18, 2007 there was a Polish Linux User Group conference [http://pingwinaria.linux.org.pl/PLUG/imprezy/pingwinaria/2007/agenda Pingwinaria 2007] in Krynica Zdrój, Poland. Tomasz Zieliński gave a talk about OpenMoko and two Neo1973 devices were present there. Also Marcin Juszkiewicz presented OpenEmbedded project there.<br />
* 2007-03-05: 36 P0 devices shipped to developers.<br />
* 2007-03-03: [http://www.linuxforum.dk/2007/program/saturday/Martin_Hansen.shtml Martin Hansen and Ole Tange] spoke at [http://www.linuxforum.dk LinuxForum] <br />
* 2007-02-27: February 27th-March 1st the [http://conferences.oreillynet.com/etel2007/ O'Reilly Emerging Telephony conference] was held at the San Francisco Airport Mariott, Burlingame, CA. Open Phones are on the agenda: Sean presented a workshop on February 27; Surj Patel and Matt Hamrick of Tuxphone and the homebrew club also presented. An OpenMoko/Open Phones Social gathering was proposed on the evening of the last day, March 1. We hope Tuxphone and SVHMPC people will join us as well. [[ETel]]<br />
* 2007-02-23: Meeting at [[Events:FOSDEM_2007|FOSDEM 2007]]<br />
* 2007-02-14: The openmoko.org web site was [http://lists.openmoko.org/pipermail/announce/2007-February/000004.html opened to the public].<br />
* 2007-01-06 [http://www.lunchat.com/ Lunch@Piero's] - CES, Las Vegas, NE | 7-9 January, 2007 <br />
* 2006-11-07: [http://www.informatm.com/NASApp/cs/ContentServer?pagename=marlin/home&MarlinViewType=MARKT_EFFORT&siteid=30000000861&marketingid=20001437372&proceed=true&MarEntityId=1162023598681&entHash=100595e9ac1 Open Source in Mobile] - Amsterdam, The Netherlands, 7-8 November 2006. Sean Moss-Pultz's "Mystery Guest" presentation can be found [http://www.openmoko.com/files/OpenMoko_Amsterdam.pdf here].<br />
<br />
[[Category:Events]]<br />
[[Category:Community]]</div>Sunlthttp://openmoko.org/wiki/Openmoko:Current_eventsOpenmoko:Current events2008-02-22T01:58:11Z<p>Sunlt: /* Past */</p>
<hr />
<div>This ''Current Events'' page provides information on both [[Current events#Past | past ]] and [[Current events#Upcoming | future]] events where FIC or [[OpenMoko]] had or will have a presence.<br />
<br />
== Upcoming ==<br />
* 2008-03-28: [[OpenMoko Education/zh tw]] - Friday March 28, 2008. | Hualien, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Dong Hwa University <br />
* 2008-03-26: [[OpenMoko Education/zh tw]] - Wednesday March 26, 2008. | Chung Li, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at Yuan Ze University <br />
* 2008-03-16: [http://www.bossaconference.indt.org/ Bossa'08] - March 16-19, 2008 | Porto de Galinhas, Brazil| [[User:Raster|Raster]] is attending and will give a talk<br />
* 2008-03-12: [http://www.openexpo.ch/openexpo-2008-bern/ OpenExpo'08] - March 12-13, 2008 | Bern, Switzerland | [[User:Mickey|Mickey]] is giving a talk about OpenMoko | [[User:C7|C7]] is organising an OpenMoko booth<br />
* 2008-03-03: [[OpenMoko Education/zh tw]] - Monday March 3, 2008. | Chung Li, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at Chung Yuan Christian University <br />
* 2008-02-27: [[OpenMoko Education/zh tw]] - Wednesday February 27, 2008. | Hsinzhu, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Chiao Tung University <br />
* 2008-02-23: [http://www.fosdem.org Fosdem'08] - February 23-24, 2008 | Brussels, Belgium | OpenMoko will be present at the [http://www.openembedded.org OpenEmbedded] booth, lots of OpenMoko developers will be present. [[Events:FOSDEM_2008 | Will you be there?]]<br />
* 2008-02-22: [[OpenMoko Education/zh tw]] - Friday February 22, 2008. | Tainan, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Cheng Kung University<br />
<br />
== Past ==<br />
* 2008-02-19: [http://www.oss.org.cn/index.php?option=com_content&task=view&id=677&Itemid=162 2008 Linux Developer Symposium-China] - February 19, 2008 | Beijing, China | Neo1973 was presented in a booth by Sun Liantao from [www.csip.org.cn CSIP] and [www.beijinglug.org BLUG]<br />
* 2008-02-08: [http://www.socallinuxexpo.org/ SCALE'08] - February 8-10, 2008 | Los Angeles, USA | [[User:Raster|Raster]] is attending and will man the OpenMoko and Enlightenment booths<br />
* 2008-01-07: Consumer Electronics Trade Show. [[Neo FreeRunner]] was presented. Links to stories, pictures, and videos:<br><br />
[[http://gizmodo.com/341755/openmoko-neo-freerunner-linux-smartphone-hands+on gizmodo]]<br><br />
[[http://takezero.net/3g-and-mobile-news/hands-on-with-fics-openmoko-powered-freerunner-2 takezero ]]<br><br />
[[http://youtube.com/watch?v=SZsps3bj6yE youtube]]<br><br />
[[http://www.reghardware.co.uk/2008/01/11/ces_video_openmoko_handset/ reghardware]]<br><br />
* 2007-12-19: [[OpenLab 2nd Event/zh tw]] - December 19, Wed. | Taipei, Taiwan | OpenLab 2nd Event: GPL & Apache License Talk and Discussion.<br />
* 2007-11-17: [[OpenMoko OpenLab Opening]] - November 17, Sat. | Taipei, Taiwan | OpenLab for OpenMoko Community is going to open.<br />
* 2007-11-04: [http://coscup.org/2007/ Conference for Open Source Coders, Users and Promoters] - November 04 | Taipei, Taiwan | Jollen gave a talk about OpenMoko and OpenLab ideas.<br />
* 2007-10-13: [http://onlinux.ca OnLinux Ontario Linux Fest 2007] - October 13 | Toronto, Canada | [[User:Idarwin|Ian Darwin]] gave a talk about OpenMoko (slides [http://www.darwinsys.com/openmoko/ here]).<br />
* 2007-10-02: [http://www.coss.fi/web/openmind/programme Openmind Conference] - October 02-03, 2007 | Tampere, Finland | Michael Shiloh as a speaker<br />
* 2007-09-26: [http://imm.dtu.dk/ IMM at Danish Technical University] - [http://ole.tange.dk Ole Tange] is giving a talk.<br />
* 2007-09-23: [http://www.barcamporlando.org/ BarCamp Orlando] Orlando, FL, USA | [[User:Writchie|Wally Ritchie]] will show Neos and talk about OpenMoko project<br />
* 2007-09-20: [http://www.openexpo.ch/openexpo-2007-zuerich/ OpenExpo'07] - September 19-20, 2007 | Zurich, Switzerland | [[User:Mickey|Mickey]] gave a talk about OpenMoko | [[User:C7|C7]] was organising an OpenMoko booth<br />
* 2007-09-15: [http://mrmcd110b.metarheinmain.de metarheinmain chaosdays 110b] - ixs igave a [https://mrmcd110b.metarheinmain.de/fahrplan/events/2107.en.html talk]<br />
* 2007-09-12: [http://dmusyd.edu/ Datamatikeruddannelsen i Nykøbing Falster] - [http://ole.tange.dk Ole Tange] gave a talk.<br />
* 2007-08-30: [http://mobiledevices.kom.aau.dk/team_and_organization/events/mobile_developer_days_2007/ Mobile Developer Days 2007] - August 30 - September 2, 2007 | at Aalborg University, Denmark | [[User:Mickey|Mickey]] was invited to give a speech<br />
* 2007-08-25: [http://www.froscon.org/Home.2.0.html?L=1 FrosCon'07] - August 25-26, 2007 | Sankt Augustin, Bonn, Germany | Mickey gave a talk about OpenMoko<br />
* 2007-08-21: [http://www.beijinglug.org/en/index.php Beijing LUG] - August 21, 2007 | Sean and other OpenMoko team members were there to talk and give a presentation<br />
* 2007-08-08 till 08-12: [http://events.ccc.de/camp/2007/Chaos_Communication_Camp_2007 Chaos Communication Camp 2007] took place in Finowfurt (close to Berlin, Germany) featuring the [http://events.ccc.de/camp/2007/GSM_Village GSM Village]<br />
* 2007-08-04: [http://barcamp.org/BarCampRDU BarCampRDU] Raleigh, NC, USA | [[User:Writchie|Wally Ritchie]] showed neos and talk about OpenMoko project <br />
* 2007-08-03: [http://wikimania2007.wikimedia.org/wiki/Main_Page wikimania 2007] - August 03-05, 2007 | Taipei, Taiwan | OpenMoko has been invited to co-host with Wiki heads to promote open content in Taiwan.<br />
* 2007-07-26 [http://conferences.oreillynet.com/os2007/ OSCON 2007] | OpenMoko Birds of a Feather session July 26th, Portland Oregon<br />
* 2007-07-15: [http://www.guadec.org GUADEC, The GNOME Conference 2007] - July 15-21, 2007 | Birmingham, United Kingdom | [[User:Mickey|Mickey]] gave a talk about OpenMoko<br />
* 2007-07-10: [http://www.rmll.info 8th Libre Software Meeting] - July 10-14, 2007 | Amiens, France | [http://datenfreihafen.org Stefan Schmidt] gave a [http://www.rmll.info/article136.html?lang=en talk] about OpenEZX and OpenMoko<br />
* 2007-07-09: The [http://www.openmoko.com openmoko.com web shop] was opened; first sales of GTA01_v4 devices.<br />
* 2007-06-05: [http://www.computextaipei.com.tw Computex Taipei 2007] - June 5-9, 2007 | Taipei World Trade Center, Taipei, Taiwan | OpenMoko was in the FIC Group's Booth<br />
* 2007-06-01: [http://www.linuxtag.org/2007/en/home/welcome.html LinuxTag 2007] - May 30-June-2, 2007 | LinuxTag in Berlin, Germany | [[User:Mickey|Mickey]] gave a [http://www.linuxtag.org/2007/en/conf/events/vp-speakers/details.html?talkid=84 talk] about OpenMoko<br />
* 2007-05-19: [http://www.makerfaire.com/ Maker Faire Events] -- May 19-May 20, 2007 | San Francisco Bay Area, San Mateo Expo Center, USA | Michael Shiloh and Jon Phillips presented at OpenMoko's booth on behalf of Sean<br />
* 2007-05-08 [http://wiki.tossug.org/SignUp:2007-05 Taipei Open Source Software User Group (TOSSUG)] - Cafe Lumiere, Taipei, Taiwan | May 8, 2007<br />
* 2007-04-04 [http://fostel2007.fostel.org/index.php/Main_Page FOSTEL] - European Institute of Technology, Paris, France | April 4-5, 2007<br />
* 2007-03-16: On March 16, 2007 [[User:Mickey|Mickey]] presented the device at a Zaurus User Group Meeting in Düsseldorf, Germany.<br />
* 2007-03-15: On March 15-18, 2007 there was a Polish Linux User Group conference [http://pingwinaria.linux.org.pl/PLUG/imprezy/pingwinaria/2007/agenda Pingwinaria 2007] in Krynica Zdrój, Poland. Tomasz Zieliński gave a talk about OpenMoko and two Neo1973 devices were present there. Also Marcin Juszkiewicz presented OpenEmbedded project there.<br />
* 2007-03-05: 36 P0 devices shipped to developers.<br />
* 2007-03-03: [http://www.linuxforum.dk/2007/program/saturday/Martin_Hansen.shtml Martin Hansen and Ole Tange] spoke at [http://www.linuxforum.dk LinuxForum] <br />
* 2007-02-27: February 27th-March 1st the [http://conferences.oreillynet.com/etel2007/ O'Reilly Emerging Telephony conference] was held at the San Francisco Airport Mariott, Burlingame, CA. Open Phones are on the agenda: Sean presented a workshop on February 27; Surj Patel and Matt Hamrick of Tuxphone and the homebrew club also presented. An OpenMoko/Open Phones Social gathering was proposed on the evening of the last day, March 1. We hope Tuxphone and SVHMPC people will join us as well. [[ETel]]<br />
* 2007-02-23: Meeting at [[Events:FOSDEM_2007|FOSDEM 2007]]<br />
* 2007-02-14: The openmoko.org web site was [http://lists.openmoko.org/pipermail/announce/2007-February/000004.html opened to the public].<br />
* 2007-01-06 [http://www.lunchat.com/ Lunch@Piero's] - CES, Las Vegas, NE | 7-9 January, 2007 <br />
* 2006-11-07: [http://www.informatm.com/NASApp/cs/ContentServer?pagename=marlin/home&MarlinViewType=MARKT_EFFORT&siteid=30000000861&marketingid=20001437372&proceed=true&MarEntityId=1162023598681&entHash=100595e9ac1 Open Source in Mobile] - Amsterdam, The Netherlands, 7-8 November 2006. Sean Moss-Pultz's "Mystery Guest" presentation can be found [http://www.openmoko.com/files/OpenMoko_Amsterdam.pdf here].<br />
<br />
[[Category:Events]]<br />
[[Category:Community]]</div>Sunlthttp://openmoko.org/wiki/Openmoko:Current_eventsOpenmoko:Current events2008-02-22T01:56:34Z<p>Sunlt: /* Past */</p>
<hr />
<div>This ''Current Events'' page provides information on both [[Current events#Past | past ]] and [[Current events#Upcoming | future]] events where FIC or [[OpenMoko]] had or will have a presence.<br />
<br />
== Upcoming ==<br />
* 2008-03-28: [[OpenMoko Education/zh tw]] - Friday March 28, 2008. | Hualien, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Dong Hwa University <br />
* 2008-03-26: [[OpenMoko Education/zh tw]] - Wednesday March 26, 2008. | Chung Li, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at Yuan Ze University <br />
* 2008-03-16: [http://www.bossaconference.indt.org/ Bossa'08] - March 16-19, 2008 | Porto de Galinhas, Brazil| [[User:Raster|Raster]] is attending and will give a talk<br />
* 2008-03-12: [http://www.openexpo.ch/openexpo-2008-bern/ OpenExpo'08] - March 12-13, 2008 | Bern, Switzerland | [[User:Mickey|Mickey]] is giving a talk about OpenMoko | [[User:C7|C7]] is organising an OpenMoko booth<br />
* 2008-03-03: [[OpenMoko Education/zh tw]] - Monday March 3, 2008. | Chung Li, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at Chung Yuan Christian University <br />
* 2008-02-27: [[OpenMoko Education/zh tw]] - Wednesday February 27, 2008. | Hsinzhu, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Chiao Tung University <br />
* 2008-02-23: [http://www.fosdem.org Fosdem'08] - February 23-24, 2008 | Brussels, Belgium | OpenMoko will be present at the [http://www.openembedded.org OpenEmbedded] booth, lots of OpenMoko developers will be present. [[Events:FOSDEM_2008 | Will you be there?]]<br />
* 2008-02-22: [[OpenMoko Education/zh tw]] - Friday February 22, 2008. | Tainan, Taiwan | Taiwan School promotion: OpenMoko concepts will be presented at National Cheng Kung University<br />
<br />
== Past ==<br />
* 2008-02-19: [http://www.oss.org.cn/index.php?option=com_content&task=view&id=677&Itemid=162 2008 Linux Developer Symposium-China] - February 19, 2008 | Beijing, China | Neo1973 was presented in a booth<br />
* 2008-02-08: [http://www.socallinuxexpo.org/ SCALE'08] - February 8-10, 2008 | Los Angeles, USA | [[User:Raster|Raster]] is attending and will man the OpenMoko and Enlightenment booths<br />
* 2008-01-07: Consumer Electronics Trade Show. [[Neo FreeRunner]] was presented. Links to stories, pictures, and videos:<br><br />
[[http://gizmodo.com/341755/openmoko-neo-freerunner-linux-smartphone-hands+on gizmodo]]<br><br />
[[http://takezero.net/3g-and-mobile-news/hands-on-with-fics-openmoko-powered-freerunner-2 takezero ]]<br><br />
[[http://youtube.com/watch?v=SZsps3bj6yE youtube]]<br><br />
[[http://www.reghardware.co.uk/2008/01/11/ces_video_openmoko_handset/ reghardware]]<br><br />
* 2007-12-19: [[OpenLab 2nd Event/zh tw]] - December 19, Wed. | Taipei, Taiwan | OpenLab 2nd Event: GPL & Apache License Talk and Discussion.<br />
* 2007-11-17: [[OpenMoko OpenLab Opening]] - November 17, Sat. | Taipei, Taiwan | OpenLab for OpenMoko Community is going to open.<br />
* 2007-11-04: [http://coscup.org/2007/ Conference for Open Source Coders, Users and Promoters] - November 04 | Taipei, Taiwan | Jollen gave a talk about OpenMoko and OpenLab ideas.<br />
* 2007-10-13: [http://onlinux.ca OnLinux Ontario Linux Fest 2007] - October 13 | Toronto, Canada | [[User:Idarwin|Ian Darwin]] gave a talk about OpenMoko (slides [http://www.darwinsys.com/openmoko/ here]).<br />
* 2007-10-02: [http://www.coss.fi/web/openmind/programme Openmind Conference] - October 02-03, 2007 | Tampere, Finland | Michael Shiloh as a speaker<br />
* 2007-09-26: [http://imm.dtu.dk/ IMM at Danish Technical University] - [http://ole.tange.dk Ole Tange] is giving a talk.<br />
* 2007-09-23: [http://www.barcamporlando.org/ BarCamp Orlando] Orlando, FL, USA | [[User:Writchie|Wally Ritchie]] will show Neos and talk about OpenMoko project<br />
* 2007-09-20: [http://www.openexpo.ch/openexpo-2007-zuerich/ OpenExpo'07] - September 19-20, 2007 | Zurich, Switzerland | [[User:Mickey|Mickey]] gave a talk about OpenMoko | [[User:C7|C7]] was organising an OpenMoko booth<br />
* 2007-09-15: [http://mrmcd110b.metarheinmain.de metarheinmain chaosdays 110b] - ixs igave a [https://mrmcd110b.metarheinmain.de/fahrplan/events/2107.en.html talk]<br />
* 2007-09-12: [http://dmusyd.edu/ Datamatikeruddannelsen i Nykøbing Falster] - [http://ole.tange.dk Ole Tange] gave a talk.<br />
* 2007-08-30: [http://mobiledevices.kom.aau.dk/team_and_organization/events/mobile_developer_days_2007/ Mobile Developer Days 2007] - August 30 - September 2, 2007 | at Aalborg University, Denmark | [[User:Mickey|Mickey]] was invited to give a speech<br />
* 2007-08-25: [http://www.froscon.org/Home.2.0.html?L=1 FrosCon'07] - August 25-26, 2007 | Sankt Augustin, Bonn, Germany | Mickey gave a talk about OpenMoko<br />
* 2007-08-21: [http://www.beijinglug.org/en/index.php Beijing LUG] - August 21, 2007 | Sean and other OpenMoko team members were there to talk and give a presentation<br />
* 2007-08-08 till 08-12: [http://events.ccc.de/camp/2007/Chaos_Communication_Camp_2007 Chaos Communication Camp 2007] took place in Finowfurt (close to Berlin, Germany) featuring the [http://events.ccc.de/camp/2007/GSM_Village GSM Village]<br />
* 2007-08-04: [http://barcamp.org/BarCampRDU BarCampRDU] Raleigh, NC, USA | [[User:Writchie|Wally Ritchie]] showed neos and talk about OpenMoko project <br />
* 2007-08-03: [http://wikimania2007.wikimedia.org/wiki/Main_Page wikimania 2007] - August 03-05, 2007 | Taipei, Taiwan | OpenMoko has been invited to co-host with Wiki heads to promote open content in Taiwan.<br />
* 2007-07-26 [http://conferences.oreillynet.com/os2007/ OSCON 2007] | OpenMoko Birds of a Feather session July 26th, Portland Oregon<br />
* 2007-07-15: [http://www.guadec.org GUADEC, The GNOME Conference 2007] - July 15-21, 2007 | Birmingham, United Kingdom | [[User:Mickey|Mickey]] gave a talk about OpenMoko<br />
* 2007-07-10: [http://www.rmll.info 8th Libre Software Meeting] - July 10-14, 2007 | Amiens, France | [http://datenfreihafen.org Stefan Schmidt] gave a [http://www.rmll.info/article136.html?lang=en talk] about OpenEZX and OpenMoko<br />
* 2007-07-09: The [http://www.openmoko.com openmoko.com web shop] was opened; first sales of GTA01_v4 devices.<br />
* 2007-06-05: [http://www.computextaipei.com.tw Computex Taipei 2007] - June 5-9, 2007 | Taipei World Trade Center, Taipei, Taiwan | OpenMoko was in the FIC Group's Booth<br />
* 2007-06-01: [http://www.linuxtag.org/2007/en/home/welcome.html LinuxTag 2007] - May 30-June-2, 2007 | LinuxTag in Berlin, Germany | [[User:Mickey|Mickey]] gave a [http://www.linuxtag.org/2007/en/conf/events/vp-speakers/details.html?talkid=84 talk] about OpenMoko<br />
* 2007-05-19: [http://www.makerfaire.com/ Maker Faire Events] -- May 19-May 20, 2007 | San Francisco Bay Area, San Mateo Expo Center, USA | Michael Shiloh and Jon Phillips presented at OpenMoko's booth on behalf of Sean<br />
* 2007-05-08 [http://wiki.tossug.org/SignUp:2007-05 Taipei Open Source Software User Group (TOSSUG)] - Cafe Lumiere, Taipei, Taiwan | May 8, 2007<br />
* 2007-04-04 [http://fostel2007.fostel.org/index.php/Main_Page FOSTEL] - European Institute of Technology, Paris, France | April 4-5, 2007<br />
* 2007-03-16: On March 16, 2007 [[User:Mickey|Mickey]] presented the device at a Zaurus User Group Meeting in Düsseldorf, Germany.<br />
* 2007-03-15: On March 15-18, 2007 there was a Polish Linux User Group conference [http://pingwinaria.linux.org.pl/PLUG/imprezy/pingwinaria/2007/agenda Pingwinaria 2007] in Krynica Zdrój, Poland. Tomasz Zieliński gave a talk about OpenMoko and two Neo1973 devices were present there. Also Marcin Juszkiewicz presented OpenEmbedded project there.<br />
* 2007-03-05: 36 P0 devices shipped to developers.<br />
* 2007-03-03: [http://www.linuxforum.dk/2007/program/saturday/Martin_Hansen.shtml Martin Hansen and Ole Tange] spoke at [http://www.linuxforum.dk LinuxForum] <br />
* 2007-02-27: February 27th-March 1st the [http://conferences.oreillynet.com/etel2007/ O'Reilly Emerging Telephony conference] was held at the San Francisco Airport Mariott, Burlingame, CA. Open Phones are on the agenda: Sean presented a workshop on February 27; Surj Patel and Matt Hamrick of Tuxphone and the homebrew club also presented. An OpenMoko/Open Phones Social gathering was proposed on the evening of the last day, March 1. We hope Tuxphone and SVHMPC people will join us as well. [[ETel]]<br />
* 2007-02-23: Meeting at [[Events:FOSDEM_2007|FOSDEM 2007]]<br />
* 2007-02-14: The openmoko.org web site was [http://lists.openmoko.org/pipermail/announce/2007-February/000004.html opened to the public].<br />
* 2007-01-06 [http://www.lunchat.com/ Lunch@Piero's] - CES, Las Vegas, NE | 7-9 January, 2007 <br />
* 2006-11-07: [http://www.informatm.com/NASApp/cs/ContentServer?pagename=marlin/home&MarlinViewType=MARKT_EFFORT&siteid=30000000861&marketingid=20001437372&proceed=true&MarEntityId=1162023598681&entHash=100595e9ac1 Open Source in Mobile] - Amsterdam, The Netherlands, 7-8 November 2006. Sean Moss-Pultz's "Mystery Guest" presentation can be found [http://www.openmoko.com/files/OpenMoko_Amsterdam.pdf here].<br />
<br />
[[Category:Events]]<br />
[[Category:Community]]</div>Sunlthttp://openmoko.org/wiki/S3C2410_Steppingstone/zh_cnS3C2410 Steppingstone/zh cn2008-01-10T02:54:47Z<p>Sunlt: </p>
<hr />
<div>S3C2410 Steppingstone是一个能够使得S3C2410直接从NAND闪存引导的特殊的4KB大缓冲区。<br />
<br />
S3C2410的微代码复制NAND Flash的头4KB数据到RAM,然后将SDRAM的首页从0x30000000到0x00000000重映射。<br />
<br />
引导加载程序在执行前需要一些代码从NAND加载剩余的引导加载程序代码。{{Languages|S3C2410_Steppingstone}}</div>Sunlthttp://openmoko.org/wiki/Manuals/Neo_1973/zh_cnManuals/Neo 1973/zh cn2007-11-16T05:59:29Z<p>Sunlt: /* 拆解 */</p>
<hr />
<div>这是一个对刚拿到[[Neo1973]]手机的人很有用的上手指南。[[Shipment 1]] has some specifics limited to that batch.<br />
<br />
== 硬件 ==<br />
<br />
=== 拆解 ===<br />
<br />
Google视频上有一些拆解演示: [http://video.google.de/videoplay?docid=-8343770443102960945 打开后盖、拿走电池、拿走SIM卡、拿走micro-SD卡、插入micro-SD卡、插 SIM卡、插入电池、合上后盖]<br />
<br />
micro-SD插槽在SIM插槽下面,SIM插槽在电池插槽下面,最上面是手机后盖。<br />
<br />
[[SIM]]卡和[[micro-SD]]存储卡是可选的;SIM用于需要蜂窝网络功能的时候,存储卡用于需要外部存储的时候。<br />
<br />
==== 后盖 ====<br />
<br />
Remove the back cover by putting your fingernail or a guitar pick in the small recess on the top of the Neo and pulling gently (参见[[Disassembling Neo1973]]中的第一步).<br />
<br />
When you are done, close the back cover by inserting the pins of the cover into the holes on the bottom of the Neo and pressing the top of the case gently.<br />
<br />
==== 电池 ====<br />
<br />
To remove the [[battery]], lift its bottom edge with your fingernail. <br />
<br />
Before closing the cover, insert the battery by pushing it against the three metal springs with the contacts aligned and pressing the bottom edge of the battery down into the case. <br />
<br />
==== SIM卡(可选) ====<br />
<br />
[[SIM card]]从蜂窝网络运营商那里获得。SIM卡插槽在电池下面。The metallic card holder has arrows and text indicating which way to push it to lock and unlock it - make sure you don't open it with force when it's locked or it may break. <br />
<br />
Click the holder unlocked and open it up. To remove the SIM card, slide it out of the holder.<br />
<br />
When you're done with the micro-SD slot, slide the SIM card into its holder so that the pads make contact when you close the holder. Push the holder firmly against the springs, then lock it - otherwise the card will not be detected.<br />
<br />
To check in Linux if the SIM card is inserted correctly, you can have a look in gsmd logs or use the instructions detailed in the [[Manually using GSM]] page and issue the ''AT+CIMI'' command.<br />
<br />
==== Micro-SD卡(可选) ====<br />
<br />
You should have received a [[micro-SD]] memory card with your phone. You might want to copy some mp3 (or better Ogg Vorbis) files to it to try media playback.<br />
<br />
The micro-SD slot is right under the SIM slot. Gently slide the micro-SD holder toward the battery contacts to unlock it. Lift up the holder. To remove a card, simply slide it out.<br />
<br />
To insert a card, slide it into the holder the metal contacts first and away from the holder. Rotate the holder shut, press it firmly against the springs, and gently slide the holder away from the battery contacts to lock it closed.<br />
<br />
The card should automatically be available under /media/card the next time you boot. You can test it and your audio drivers at the same time by playing an mp3 or ogg from it (see [[Neo1973 Audio Subsystem]]).<br />
<br />
=== 按钮 ===<br />
<br />
The [[Neo1973 Power Button|power button]] is on the lower right-hand side, and the [[Neo1973 AUX Button|AUX button]] is on the top-left.<br />
<br />
Button functions while the phone is on (as of writing):<br />
* Power button short press: Close the current application<br />
* Power button 1 second press: Open the [[power management menu]]<br />
* Power button 10 second press: Last-resort power off<br />
* AUX button short press: Go to the [[Today]] application<br />
* AUX button 1 second press: Open the [[functions menu]]<br />
<br />
=== 附件 ===<br />
<br />
==== 触摸笔 ====<br />
<br />
The stylus as shipped has three batteries in it, providing for the laser pointer and flashlight LEDs. A set of replacement batteries is also included. The stylus can be twisted open in middle to access the batteries.<br />
<br />
To use the ballpoint or stylus head, turn the bottom part of the stylus to either direction.<br />
<br />
==== 耳机 ====<br />
<br />
The Neo ships with a stereo headset including a microphone and a push button. The plug is a standard 2.5 mm four-conductor version, though it differs from standard 3.5 mm headphones. The black socket is on the left side of the phone, and the last millimeter is somewhat firmer so make sure you push the plug all the way.<br />
<br />
==== Lanyard ====<br />
<br />
The provided lanyard can be attached to the hole in the bottom part of the phone. Put the loose end through the phone, through the two metal loops in the lanyard, between the metal loops and back through the first metal loop.<br />
<br />
=== 手机开机 ===<br />
[[Image:Neo1973_uboot_splash.jpg|200px|thumb|bootloader splash screen]]<br />
Just hitting the power button (depending on your [[u-boot]] version you have to press for >= 5 seconds) should get the phone first into the bootloader, then boot the kernel, and get into X/OpenMoko. The shipped battery typically has enough charge to boot up directly without charging through the usb cable first.<br />
<br />
Once you have pressed the power button sufficiently long, the vibrator makes a short pulse and the screen backlight turns on. You can now release the power button and watch the phone booting.<br />
<br />
If the battery is not sufficiently charged, the phone will not turn on, even if the usb cable is plugged in.<br />
<br />
=== Flashing the Neo1973 GTA01Bv4 ===<br />
The GTA01Bv4 devices that are currently shipping do not boot out of the box. Flashing the phone with the latest kernel and [[Userspace root image|supporting file system ("rootfs")]] is required before the phone will successfully boot.<br />
<br />
Read more information at about [[Flashing openmoko]]. MacOS X users please also refer to [[MacOS_X]].<br />
<br />
=== 手机关机 ===<br />
<br />
==== While in bootloader mode, or if the phone has crashed ====<br />
<br />
If you press the power button for 9 seconds, the phone will switch off. You can notice this by the backlight going dark.<br />
<br />
==== While running a full linux system with userspace ====<br />
<br />
In this mode, a power-button press of 5 seconds will be sufficient. After this, the init process will take care of safely shutting down the phone, which might take up to 20 extra seconds. The X server should get killed, you should drop back to a (garbled) console, and it should finally switch off - much like a regular Linux PC.<br />
<br />
=== 充电 ===<br />
:''See also [[Neo1973 Battery Charger]]<br />
The [[Neo1973]] supports two charging modes: One 100mA charge mode (called pre-charge) and 500mA (called fast charge). Charging is always done via the USB socket. You can use any USB-A to USB-mini-B cable to connect the phone to any USB host.<br />
<br />
Note: If the Neo1973 battery completely drains it's possible that even after a long recharge you might not be able to power the phone on. To fix that you need to remove the battery, and leave it out for about a minute, then replace the battery and plug the phone back into a usb port. You should be able to power it on after a few minutes of charging.<br />
<br />
==== While in u-boot ====<br />
<br />
While you are in u-boot mode, the phone only charges with 100mA by default. (This will change in one of the future revisions).<br />
<br />
However, using the u-boot console you can manually enable fast charging. See [[U-boot#Battery_charger_related]] for more information.<br />
<br />
==== While in Linux ====<br />
<br />
As soon as the phone is connected via USB cable, it will charge. However, the default charging current is only 100mA, way too little if you want to operate the phone and charge at the same time. <br />
<br />
If your USB upstream port is capable of supplying 500mA, then it will configure the Neo1973 accordingly and use 500mA charging mode. You can notice this by the following line in the kernel log (/var/log/messages) of the Neo1973:<br />
usb0: full speed config #1: 500 mA, Ethernet Gadget, using CDC Ethernet<br />
<br />
== Getting shell access on the phone ==<br />
<br />
=== By using the terminal emulator and on-screen keyboard ===<br />
<br />
In [[Today]] (the main screen the phone boots to and which can always be accessed by pressing the [[AUX button]]), selecting (with a stylus or a thumb) the "+" tab in the center bottom of the screen shows the application launcher. Make sure the filter at the top of the window is set at "Applications" or "All", then drag upward on the list to scroll it until the Terminal application appears. Alternatively, you can toggle the magnifier glass in the filter and type "terminal" to the text box that appears. Click the application in the list to make it turn yellow and start - this might be difficult a first since any movement is interpreted as dragging rather than clicking. <br />
<br />
The on-screen keyboard should appear whenever you choose a text entry. It can also be toggled by clicking on the tiny keyboard icon in the panel at the very top of the screen. More options are available via Input Manager which can be started in the application launcher filtered by "Utilities" or "All". A white box appears in the panel. It also can be used to toggle the keyboard. You can choose between different keyboard layouts and the stroke recognizer by dragging from the white box to the right of the box, which should make a menu appear.<br />
<br />
=== By using Ethernet emulation over a USB cable ===<br />
<br />
The standard Neo1973 Linux [[kernel]] has support for the "cdc_ether USB gadget", i.e. a standard implementation of how to emulate an Ethernet device over USB.<br />
<br />
The following description is for generic *NIX system. For setting up connectivity specifically on a MacOS X machine, refer to [[MacOS_X]] (because there is no usb0 and you need a special kernel driver first).<br />
<br />
As soon as the kernel is up and running, and you have the phone connected via USB, you should get a '''usb0''' device on your host. <br />
<br />
The Phone will have the IPv4 address 192.168.0.202/24. You can run `ifconfig` in the terminal on the phone to verify this (this is optional, just check it if it doesn't work given the instructions below)<br />
<br />
If you plug a USB cable into a laptop running Linux, you'll likely see the "cdc_ether" kernel module being loaded and a usb0 network interface appear. If not, see [[USB_Networking]] for more details.<br />
<br />
On the '''host PC''', you should then configure your interface to 192.168.0.200 by using<br />
# ifconfig usb0 192.168.0.200 netmask 255.255.255.0<br />
<br />
Then you should be able to<br />
# ping 192.168.0.202<br />
<br />
and last, but not least<br />
# ssh root@192.168.0.202<br />
<br />
Once you press 'enter' (empty password), you should now have a root login.<br />
<br />
See [[USB_Networking]] for more details, including instructions on how to automatically setup masquerading so that your phone can get access to the internet through the host PC.<br />
<br />
Note: If you have a power management profile enabled on your device your ssh connection might appear to freeze when your phone tries to sleep. To stop this from occuring you need to hold the power button down for a few seconds until you get the menu with the "Power Off" option at the bottom. Once you do, you should select the "Profile: No PM" option. If your shell died and you want it back, you can do the following:<br />
<br />
# modprobe -r cdc_ether <br />
# modprobe -r cdc_acm<br />
<br />
Then unplug the device and plug it back in after turning power-management off.<br />
<br />
=== By using the debug board/serial/JTAG ===<br />
<br />
Please see [[Debug Board#Usage_Instructions]]<br />
<br />
== Getting access to the bootloader console ==<br />
<br />
Please see [[u-boot#Using_usbtty_from_Linux]]<br />
<br />
== Using Audio ==<br />
=== Enable Internal Speaker and Mic in Phone Calls ===<br />
If you got no Speaker and Mic during a Call you need to load the "gsmhandset.state" alsa-configfile<br />
<br />
alsactl -f /etc/alsa/gsmhandset.state restore<br />
<br />
Maybe you need to load another .state file for playing mp3 or a BT-Headset see in /etc/alsa/<br />
<br />
To hear something you can find an .au file (or convert a .wav into an .au by using the sox tool):<br />
<br />
sox ringtone_thereisnophone.wav -t raw -r 8012 -u -b -c 1 rigtone_thereisnophone.au<br />
<br />
copy it to the device and run<br />
<br />
cat ringtone_thereisnophone.au > /dev/dsp<br />
<br />
== Useful commands in Linux ==<br />
<br />
=== Suspending ===<br />
<br />
Writing "mem" into ''/sys/power/state'' tells Linux to suspend - it will enter a low power mode where only the GSM and RAM are powered up and the CPU sleeps. It will persist in this state until a wake-up event arrives. Some currently enabled wake-up events are: AUX or POWER key press, USB cable detect.<br />
<br />
If you're connected over ssh, sshd will stop responding when the OS suspends, so to avoid locking up your ssh client, use the command<br />
# (sleep 1; echo mem > /sys/power/state) & exit<br />
<br />
=== Initial backup ===<br />
<br />
After getting your new Neo1973 booted for the first time you might want to make a back up of the original flash chip contents on your PC, before you overwrite the flash with a custom image or just update to a newer build. <br />
<br />
{{note|For phase 0 developers only (GTA01Bv4 shippment 0, '''not &gt; 0 '''): This is a good idea because there are parts in the root filesystem that can't be distributed over internet so they are only found in the shipped ROM (see the [[GPS]] driver).}}<br />
<br />
One easy way to back up all of the Flash, that doesn't require installing any special software, is with ''netcat'' over the [[USB Networking|USB ethernet]]. The following commands can be used for that.<br />
{|<br />
! On the host !! On the target<br />
|-<br />
|<pre><br />
$ nc -l -p 20000 > mtdblock0<br />
$ nc -l -p 20000 > mtdblock1<br />
$ nc -l -p 20000 > mtdblock2<br />
$ nc -l -p 20000 > mtdblock3<br />
$ nc -l -p 20000 > mtdblock4<br />
</pre><br />
|<pre><br />
# cat /dev/mtdblock0 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock1 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock2 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock3 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock4 | nc 192.168.0.200 20000<br />
</pre><br />
|}<br />
<br />
This stores the five NAND partitions in files named mtdblock*. Knowing the partition layout (u-boot "mtdparts" command or Linux dmesg) you can restore the whole flash with it.<br />
<br />
=== Setting date and time ===<br />
<br />
To set the date and time you need to open a terminal or ssh to the device. To set the date and time to August 9 19:02 2007 type:<br />
<br />
# date -s 080919022007<br />
<br />
The screensaver might turn on as you execute this command - just tap the screen to get back.<br />
<br />
Now, you need to synchronize the time with the hardware date/time by typing:<br />
<br />
# hwclock --systohc<br />
<br />
=== Where to from here ===<br />
<br />
You'll probably want to play with some of the interesting hardware in this device. Obviously, you can explore the applications available through the touch-screen interface. But for those who prefer doing things more in the raw from a shell prompt, you can [[Manually_using_GSM | manually use GSM]], [[Manually_using_SMS | manually use SMS]], or you can start playing with the [[GPS]].<br />
<br />
<span id="bottom">{{Languages|Getting_Started_with_your_Neo1973}}</span><br />
<br />
[[Category:Documentation]]<br />
[[Category:Neo1973_Phase_1_related]]</div>Sunlthttp://openmoko.org/wiki/Manuals/Neo_1973/zh_cnManuals/Neo 1973/zh cn2007-11-16T05:52:10Z<p>Sunlt: </p>
<hr />
<div>这是一个对刚拿到[[Neo1973]]手机的人很有用的上手指南。[[Shipment 1]] has some specifics limited to that batch.<br />
<br />
== 硬件 ==<br />
<br />
=== 拆解 ===<br />
<br />
Google视频上有一些拆解演示: [http://video.google.de/videoplay?docid=-8343770443102960945 Open the back cover, remove the battery, remove the SIM card, remove the micro-SD card, insert the micro-SD card, insert the SIM card, insert the battery, close the back cover]<br />
<br />
The micro-SD slot is underneath the SIM slot, which is underneath the battery. To access any of these, you need to open the back cover of the phone.<br />
<br />
The [[SIM]] card and the [[micro-SD]] memory card are optional; SIM is needed only for cell network functionality and memory card for extra storage.<br />
<br />
==== 后盖 ====<br />
<br />
Remove the back cover by putting your fingernail or a guitar pick in the small recess on the top of the Neo and pulling gently (see just the first step of [[Disassembling Neo1973]]).<br />
<br />
When you are done, close the back cover by inserting the pins of the cover into the holes on the bottom of the Neo and pressing the top of the case gently.<br />
<br />
==== 电池 ====<br />
<br />
To remove the [[battery]], lift its bottom edge with your fingernail. <br />
<br />
Before closing the cover, insert the battery by pushing it against the three metal springs with the contacts aligned and pressing the bottom edge of the battery down into the case. <br />
<br />
==== SIM卡(可选) ====<br />
<br />
The [[SIM card]] is obtained from a cell network operator. The slot for the SIM card is found just under the battery. The metallic card holder has arrows and text indicating which way to push it to lock and unlock it - make sure you don't open it with force when it's locked or it may break. <br />
<br />
Click the holder unlocked and open it up. To remove the SIM card, slide it out of the holder.<br />
<br />
When you're done with the micro-SD slot, slide the SIM card into its holder so that the pads make contact when you close the holder. Push the holder firmly against the springs, then lock it - otherwise the card will not be detected.<br />
<br />
To check in Linux if the SIM card is inserted correctly, you can have a look in gsmd logs or use the instructions detailed in the [[Manually using GSM]] page and issue the ''AT+CIMI'' command.<br />
<br />
==== Micro-SD卡(可选) ====<br />
<br />
You should have received a [[micro-SD]] memory card with your phone. You might want to copy some mp3 (or better Ogg Vorbis) files to it to try media playback.<br />
<br />
The micro-SD slot is right under the SIM slot. Gently slide the micro-SD holder toward the battery contacts to unlock it. Lift up the holder. To remove a card, simply slide it out.<br />
<br />
To insert a card, slide it into the holder the metal contacts first and away from the holder. Rotate the holder shut, press it firmly against the springs, and gently slide the holder away from the battery contacts to lock it closed.<br />
<br />
The card should automatically be available under /media/card the next time you boot. You can test it and your audio drivers at the same time by playing an mp3 or ogg from it (see [[Neo1973 Audio Subsystem]]).<br />
<br />
=== 按钮 ===<br />
<br />
The [[Neo1973 Power Button|power button]] is on the lower right-hand side, and the [[Neo1973 AUX Button|AUX button]] is on the top-left.<br />
<br />
Button functions while the phone is on (as of writing):<br />
* Power button short press: Close the current application<br />
* Power button 1 second press: Open the [[power management menu]]<br />
* Power button 10 second press: Last-resort power off<br />
* AUX button short press: Go to the [[Today]] application<br />
* AUX button 1 second press: Open the [[functions menu]]<br />
<br />
=== 附件 ===<br />
<br />
==== 触摸笔 ====<br />
<br />
The stylus as shipped has three batteries in it, providing for the laser pointer and flashlight LEDs. A set of replacement batteries is also included. The stylus can be twisted open in middle to access the batteries.<br />
<br />
To use the ballpoint or stylus head, turn the bottom part of the stylus to either direction.<br />
<br />
==== 耳机 ====<br />
<br />
The Neo ships with a stereo headset including a microphone and a push button. The plug is a standard 2.5 mm four-conductor version, though it differs from standard 3.5 mm headphones. The black socket is on the left side of the phone, and the last millimeter is somewhat firmer so make sure you push the plug all the way.<br />
<br />
==== Lanyard ====<br />
<br />
The provided lanyard can be attached to the hole in the bottom part of the phone. Put the loose end through the phone, through the two metal loops in the lanyard, between the metal loops and back through the first metal loop.<br />
<br />
=== 手机开机 ===<br />
[[Image:Neo1973_uboot_splash.jpg|200px|thumb|bootloader splash screen]]<br />
Just hitting the power button (depending on your [[u-boot]] version you have to press for >= 5 seconds) should get the phone first into the bootloader, then boot the kernel, and get into X/OpenMoko. The shipped battery typically has enough charge to boot up directly without charging through the usb cable first.<br />
<br />
Once you have pressed the power button sufficiently long, the vibrator makes a short pulse and the screen backlight turns on. You can now release the power button and watch the phone booting.<br />
<br />
If the battery is not sufficiently charged, the phone will not turn on, even if the usb cable is plugged in.<br />
<br />
=== Flashing the Neo1973 GTA01Bv4 ===<br />
The GTA01Bv4 devices that are currently shipping do not boot out of the box. Flashing the phone with the latest kernel and [[Userspace root image|supporting file system ("rootfs")]] is required before the phone will successfully boot.<br />
<br />
Read more information at about [[Flashing openmoko]]. MacOS X users please also refer to [[MacOS_X]].<br />
<br />
=== 手机关机 ===<br />
<br />
==== While in bootloader mode, or if the phone has crashed ====<br />
<br />
If you press the power button for 9 seconds, the phone will switch off. You can notice this by the backlight going dark.<br />
<br />
==== While running a full linux system with userspace ====<br />
<br />
In this mode, a power-button press of 5 seconds will be sufficient. After this, the init process will take care of safely shutting down the phone, which might take up to 20 extra seconds. The X server should get killed, you should drop back to a (garbled) console, and it should finally switch off - much like a regular Linux PC.<br />
<br />
=== 充电 ===<br />
:''See also [[Neo1973 Battery Charger]]<br />
The [[Neo1973]] supports two charging modes: One 100mA charge mode (called pre-charge) and 500mA (called fast charge). Charging is always done via the USB socket. You can use any USB-A to USB-mini-B cable to connect the phone to any USB host.<br />
<br />
Note: If the Neo1973 battery completely drains it's possible that even after a long recharge you might not be able to power the phone on. To fix that you need to remove the battery, and leave it out for about a minute, then replace the battery and plug the phone back into a usb port. You should be able to power it on after a few minutes of charging.<br />
<br />
==== While in u-boot ====<br />
<br />
While you are in u-boot mode, the phone only charges with 100mA by default. (This will change in one of the future revisions).<br />
<br />
However, using the u-boot console you can manually enable fast charging. See [[U-boot#Battery_charger_related]] for more information.<br />
<br />
==== While in Linux ====<br />
<br />
As soon as the phone is connected via USB cable, it will charge. However, the default charging current is only 100mA, way too little if you want to operate the phone and charge at the same time. <br />
<br />
If your USB upstream port is capable of supplying 500mA, then it will configure the Neo1973 accordingly and use 500mA charging mode. You can notice this by the following line in the kernel log (/var/log/messages) of the Neo1973:<br />
usb0: full speed config #1: 500 mA, Ethernet Gadget, using CDC Ethernet<br />
<br />
== Getting shell access on the phone ==<br />
<br />
=== By using the terminal emulator and on-screen keyboard ===<br />
<br />
In [[Today]] (the main screen the phone boots to and which can always be accessed by pressing the [[AUX button]]), selecting (with a stylus or a thumb) the "+" tab in the center bottom of the screen shows the application launcher. Make sure the filter at the top of the window is set at "Applications" or "All", then drag upward on the list to scroll it until the Terminal application appears. Alternatively, you can toggle the magnifier glass in the filter and type "terminal" to the text box that appears. Click the application in the list to make it turn yellow and start - this might be difficult a first since any movement is interpreted as dragging rather than clicking. <br />
<br />
The on-screen keyboard should appear whenever you choose a text entry. It can also be toggled by clicking on the tiny keyboard icon in the panel at the very top of the screen. More options are available via Input Manager which can be started in the application launcher filtered by "Utilities" or "All". A white box appears in the panel. It also can be used to toggle the keyboard. You can choose between different keyboard layouts and the stroke recognizer by dragging from the white box to the right of the box, which should make a menu appear.<br />
<br />
=== By using Ethernet emulation over a USB cable ===<br />
<br />
The standard Neo1973 Linux [[kernel]] has support for the "cdc_ether USB gadget", i.e. a standard implementation of how to emulate an Ethernet device over USB.<br />
<br />
The following description is for generic *NIX system. For setting up connectivity specifically on a MacOS X machine, refer to [[MacOS_X]] (because there is no usb0 and you need a special kernel driver first).<br />
<br />
As soon as the kernel is up and running, and you have the phone connected via USB, you should get a '''usb0''' device on your host. <br />
<br />
The Phone will have the IPv4 address 192.168.0.202/24. You can run `ifconfig` in the terminal on the phone to verify this (this is optional, just check it if it doesn't work given the instructions below)<br />
<br />
If you plug a USB cable into a laptop running Linux, you'll likely see the "cdc_ether" kernel module being loaded and a usb0 network interface appear. If not, see [[USB_Networking]] for more details.<br />
<br />
On the '''host PC''', you should then configure your interface to 192.168.0.200 by using<br />
# ifconfig usb0 192.168.0.200 netmask 255.255.255.0<br />
<br />
Then you should be able to<br />
# ping 192.168.0.202<br />
<br />
and last, but not least<br />
# ssh root@192.168.0.202<br />
<br />
Once you press 'enter' (empty password), you should now have a root login.<br />
<br />
See [[USB_Networking]] for more details, including instructions on how to automatically setup masquerading so that your phone can get access to the internet through the host PC.<br />
<br />
Note: If you have a power management profile enabled on your device your ssh connection might appear to freeze when your phone tries to sleep. To stop this from occuring you need to hold the power button down for a few seconds until you get the menu with the "Power Off" option at the bottom. Once you do, you should select the "Profile: No PM" option. If your shell died and you want it back, you can do the following:<br />
<br />
# modprobe -r cdc_ether <br />
# modprobe -r cdc_acm<br />
<br />
Then unplug the device and plug it back in after turning power-management off.<br />
<br />
=== By using the debug board/serial/JTAG ===<br />
<br />
Please see [[Debug Board#Usage_Instructions]]<br />
<br />
== Getting access to the bootloader console ==<br />
<br />
Please see [[u-boot#Using_usbtty_from_Linux]]<br />
<br />
== Using Audio ==<br />
=== Enable Internal Speaker and Mic in Phone Calls ===<br />
If you got no Speaker and Mic during a Call you need to load the "gsmhandset.state" alsa-configfile<br />
<br />
alsactl -f /etc/alsa/gsmhandset.state restore<br />
<br />
Maybe you need to load another .state file for playing mp3 or a BT-Headset see in /etc/alsa/<br />
<br />
To hear something you can find an .au file (or convert a .wav into an .au by using the sox tool):<br />
<br />
sox ringtone_thereisnophone.wav -t raw -r 8012 -u -b -c 1 rigtone_thereisnophone.au<br />
<br />
copy it to the device and run<br />
<br />
cat ringtone_thereisnophone.au > /dev/dsp<br />
<br />
== Useful commands in Linux ==<br />
<br />
=== Suspending ===<br />
<br />
Writing "mem" into ''/sys/power/state'' tells Linux to suspend - it will enter a low power mode where only the GSM and RAM are powered up and the CPU sleeps. It will persist in this state until a wake-up event arrives. Some currently enabled wake-up events are: AUX or POWER key press, USB cable detect.<br />
<br />
If you're connected over ssh, sshd will stop responding when the OS suspends, so to avoid locking up your ssh client, use the command<br />
# (sleep 1; echo mem > /sys/power/state) & exit<br />
<br />
=== Initial backup ===<br />
<br />
After getting your new Neo1973 booted for the first time you might want to make a back up of the original flash chip contents on your PC, before you overwrite the flash with a custom image or just update to a newer build. <br />
<br />
{{note|For phase 0 developers only (GTA01Bv4 shippment 0, '''not &gt; 0 '''): This is a good idea because there are parts in the root filesystem that can't be distributed over internet so they are only found in the shipped ROM (see the [[GPS]] driver).}}<br />
<br />
One easy way to back up all of the Flash, that doesn't require installing any special software, is with ''netcat'' over the [[USB Networking|USB ethernet]]. The following commands can be used for that.<br />
{|<br />
! On the host !! On the target<br />
|-<br />
|<pre><br />
$ nc -l -p 20000 > mtdblock0<br />
$ nc -l -p 20000 > mtdblock1<br />
$ nc -l -p 20000 > mtdblock2<br />
$ nc -l -p 20000 > mtdblock3<br />
$ nc -l -p 20000 > mtdblock4<br />
</pre><br />
|<pre><br />
# cat /dev/mtdblock0 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock1 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock2 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock3 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock4 | nc 192.168.0.200 20000<br />
</pre><br />
|}<br />
<br />
This stores the five NAND partitions in files named mtdblock*. Knowing the partition layout (u-boot "mtdparts" command or Linux dmesg) you can restore the whole flash with it.<br />
<br />
=== Setting date and time ===<br />
<br />
To set the date and time you need to open a terminal or ssh to the device. To set the date and time to August 9 19:02 2007 type:<br />
<br />
# date -s 080919022007<br />
<br />
The screensaver might turn on as you execute this command - just tap the screen to get back.<br />
<br />
Now, you need to synchronize the time with the hardware date/time by typing:<br />
<br />
# hwclock --systohc<br />
<br />
=== Where to from here ===<br />
<br />
You'll probably want to play with some of the interesting hardware in this device. Obviously, you can explore the applications available through the touch-screen interface. But for those who prefer doing things more in the raw from a shell prompt, you can [[Manually_using_GSM | manually use GSM]], [[Manually_using_SMS | manually use SMS]], or you can start playing with the [[GPS]].<br />
<br />
<span id="bottom">{{Languages|Getting_Started_with_your_Neo1973}}</span><br />
<br />
[[Category:Documentation]]<br />
[[Category:Neo1973_Phase_1_related]]</div>Sunlthttp://openmoko.org/wiki/Manuals/Neo_1973/zh_cnManuals/Neo 1973/zh cn2007-11-16T05:48:19Z<p>Sunlt: </p>
<hr />
<div>这是一个对刚拿到[[Neo1973]]手机的人很有用的上手指南。[[Shipment 1]] has some specifics limited to that batch.<br />
<br />
== 硬件 ==<br />
<br />
=== 拆解 ===<br />
<br />
Google视频上有一些拆解演示: [http://video.google.de/videoplay?docid=-8343770443102960945 Open the back cover, remove the battery, remove the SIM card, remove the micro-SD card, insert the micro-SD card, insert the SIM card, insert the battery, close the back cover]<br />
<br />
The micro-SD slot is underneath the SIM slot, which is underneath the battery. To access any of these, you need to open the back cover of the phone.<br />
<br />
The [[SIM]] card and the [[micro-SD]] memory card are optional; SIM is needed only for cell network functionality and memory card for extra storage.<br />
<br />
==== Back cover ====<br />
<br />
Remove the back cover by putting your fingernail or a guitar pick in the small recess on the top of the Neo and pulling gently (see just the first step of [[Disassembling Neo1973]]).<br />
<br />
When you are done, close the back cover by inserting the pins of the cover into the holes on the bottom of the Neo and pressing the top of the case gently.<br />
<br />
==== Battery ====<br />
<br />
To remove the [[battery]], lift its bottom edge with your fingernail. <br />
<br />
Before closing the cover, insert the battery by pushing it against the three metal springs with the contacts aligned and pressing the bottom edge of the battery down into the case. <br />
<br />
==== SIM card (optional) ====<br />
<br />
The [[SIM card]] is obtained from a cell network operator. The slot for the SIM card is found just under the battery. The metallic card holder has arrows and text indicating which way to push it to lock and unlock it - make sure you don't open it with force when it's locked or it may break. <br />
<br />
Click the holder unlocked and open it up. To remove the SIM card, slide it out of the holder.<br />
<br />
When you're done with the micro-SD slot, slide the SIM card into its holder so that the pads make contact when you close the holder. Push the holder firmly against the springs, then lock it - otherwise the card will not be detected.<br />
<br />
To check in Linux if the SIM card is inserted correctly, you can have a look in gsmd logs or use the instructions detailed in the [[Manually using GSM]] page and issue the ''AT+CIMI'' command.<br />
<br />
==== Micro-SD card (optional) ====<br />
<br />
You should have received a [[micro-SD]] memory card with your phone. You might want to copy some mp3 (or better Ogg Vorbis) files to it to try media playback.<br />
<br />
The micro-SD slot is right under the SIM slot. Gently slide the micro-SD holder toward the battery contacts to unlock it. Lift up the holder. To remove a card, simply slide it out.<br />
<br />
To insert a card, slide it into the holder the metal contacts first and away from the holder. Rotate the holder shut, press it firmly against the springs, and gently slide the holder away from the battery contacts to lock it closed.<br />
<br />
The card should automatically be available under /media/card the next time you boot. You can test it and your audio drivers at the same time by playing an mp3 or ogg from it (see [[Neo1973 Audio Subsystem]]).<br />
<br />
=== Buttons ===<br />
<br />
The [[Neo1973 Power Button|power button]] is on the lower right-hand side, and the [[Neo1973 AUX Button|AUX button]] is on the top-left.<br />
<br />
Button functions while the phone is on (as of writing):<br />
* Power button short press: Close the current application<br />
* Power button 1 second press: Open the [[power management menu]]<br />
* Power button 10 second press: Last-resort power off<br />
* AUX button short press: Go to the [[Today]] application<br />
* AUX button 1 second press: Open the [[functions menu]]<br />
<br />
=== Accessories ===<br />
<br />
==== Stylus ====<br />
<br />
The stylus as shipped has three batteries in it, providing for the laser pointer and flashlight LEDs. A set of replacement batteries is also included. The stylus can be twisted open in middle to access the batteries.<br />
<br />
To use the ballpoint or stylus head, turn the bottom part of the stylus to either direction.<br />
<br />
==== Headset ====<br />
<br />
The Neo ships with a stereo headset including a microphone and a push button. The plug is a standard 2.5 mm four-conductor version, though it differs from standard 3.5 mm headphones. The black socket is on the left side of the phone, and the last millimeter is somewhat firmer so make sure you push the plug all the way.<br />
<br />
==== Lanyard ====<br />
<br />
The provided lanyard can be attached to the hole in the bottom part of the phone. Put the loose end through the phone, through the two metal loops in the lanyard, between the metal loops and back through the first metal loop.<br />
<br />
=== Powering up the phone ===<br />
[[Image:Neo1973_uboot_splash.jpg|200px|thumb|bootloader splash screen]]<br />
Just hitting the power button (depending on your [[u-boot]] version you have to press for >= 5 seconds) should get the phone first into the bootloader, then boot the kernel, and get into X/OpenMoko. The shipped battery typically has enough charge to boot up directly without charging through the usb cable first.<br />
<br />
Once you have pressed the power button sufficiently long, the vibrator makes a short pulse and the screen backlight turns on. You can now release the power button and watch the phone booting.<br />
<br />
If the battery is not sufficiently charged, the phone will not turn on, even if the usb cable is plugged in.<br />
<br />
=== Flashing the Neo1973 GTA01Bv4 ===<br />
The GTA01Bv4 devices that are currently shipping do not boot out of the box. Flashing the phone with the latest kernel and [[Userspace root image|supporting file system ("rootfs")]] is required before the phone will successfully boot.<br />
<br />
Read more information at about [[Flashing openmoko]]. MacOS X users please also refer to [[MacOS_X]].<br />
<br />
=== Powering down the phone ===<br />
<br />
==== While in bootloader mode, or if the phone has crashed ====<br />
<br />
If you press the power button for 9 seconds, the phone will switch off. You can notice this by the backlight going dark.<br />
<br />
==== While running a full linux system with userspace ====<br />
<br />
In this mode, a power-button press of 5 seconds will be sufficient. After this, the init process will take care of safely shutting down the phone, which might take up to 20 extra seconds. The X server should get killed, you should drop back to a (garbled) console, and it should finally switch off - much like a regular Linux PC.<br />
<br />
=== Battery charging ===<br />
:''See also [[Neo1973 Battery Charger]]<br />
The [[Neo1973]] supports two charging modes: One 100mA charge mode (called pre-charge) and 500mA (called fast charge). Charging is always done via the USB socket. You can use any USB-A to USB-mini-B cable to connect the phone to any USB host.<br />
<br />
Note: If the Neo1973 battery completely drains it's possible that even after a long recharge you might not be able to power the phone on. To fix that you need to remove the battery, and leave it out for about a minute, then replace the battery and plug the phone back into a usb port. You should be able to power it on after a few minutes of charging.<br />
<br />
==== While in u-boot ====<br />
<br />
While you are in u-boot mode, the phone only charges with 100mA by default. (This will change in one of the future revisions).<br />
<br />
However, using the u-boot console you can manually enable fast charging. See [[U-boot#Battery_charger_related]] for more information.<br />
<br />
==== While in Linux ====<br />
<br />
As soon as the phone is connected via USB cable, it will charge. However, the default charging current is only 100mA, way too little if you want to operate the phone and charge at the same time. <br />
<br />
If your USB upstream port is capable of supplying 500mA, then it will configure the Neo1973 accordingly and use 500mA charging mode. You can notice this by the following line in the kernel log (/var/log/messages) of the Neo1973:<br />
usb0: full speed config #1: 500 mA, Ethernet Gadget, using CDC Ethernet<br />
<br />
== Getting shell access on the phone ==<br />
<br />
=== By using the terminal emulator and on-screen keyboard ===<br />
<br />
In [[Today]] (the main screen the phone boots to and which can always be accessed by pressing the [[AUX button]]), selecting (with a stylus or a thumb) the "+" tab in the center bottom of the screen shows the application launcher. Make sure the filter at the top of the window is set at "Applications" or "All", then drag upward on the list to scroll it until the Terminal application appears. Alternatively, you can toggle the magnifier glass in the filter and type "terminal" to the text box that appears. Click the application in the list to make it turn yellow and start - this might be difficult a first since any movement is interpreted as dragging rather than clicking. <br />
<br />
The on-screen keyboard should appear whenever you choose a text entry. It can also be toggled by clicking on the tiny keyboard icon in the panel at the very top of the screen. More options are available via Input Manager which can be started in the application launcher filtered by "Utilities" or "All". A white box appears in the panel. It also can be used to toggle the keyboard. You can choose between different keyboard layouts and the stroke recognizer by dragging from the white box to the right of the box, which should make a menu appear.<br />
<br />
=== By using Ethernet emulation over a USB cable ===<br />
<br />
The standard Neo1973 Linux [[kernel]] has support for the "cdc_ether USB gadget", i.e. a standard implementation of how to emulate an Ethernet device over USB.<br />
<br />
The following description is for generic *NIX system. For setting up connectivity specifically on a MacOS X machine, refer to [[MacOS_X]] (because there is no usb0 and you need a special kernel driver first).<br />
<br />
As soon as the kernel is up and running, and you have the phone connected via USB, you should get a '''usb0''' device on your host. <br />
<br />
The Phone will have the IPv4 address 192.168.0.202/24. You can run `ifconfig` in the terminal on the phone to verify this (this is optional, just check it if it doesn't work given the instructions below)<br />
<br />
If you plug a USB cable into a laptop running Linux, you'll likely see the "cdc_ether" kernel module being loaded and a usb0 network interface appear. If not, see [[USB_Networking]] for more details.<br />
<br />
On the '''host PC''', you should then configure your interface to 192.168.0.200 by using<br />
# ifconfig usb0 192.168.0.200 netmask 255.255.255.0<br />
<br />
Then you should be able to<br />
# ping 192.168.0.202<br />
<br />
and last, but not least<br />
# ssh root@192.168.0.202<br />
<br />
Once you press 'enter' (empty password), you should now have a root login.<br />
<br />
See [[USB_Networking]] for more details, including instructions on how to automatically setup masquerading so that your phone can get access to the internet through the host PC.<br />
<br />
Note: If you have a power management profile enabled on your device your ssh connection might appear to freeze when your phone tries to sleep. To stop this from occuring you need to hold the power button down for a few seconds until you get the menu with the "Power Off" option at the bottom. Once you do, you should select the "Profile: No PM" option. If your shell died and you want it back, you can do the following:<br />
<br />
# modprobe -r cdc_ether <br />
# modprobe -r cdc_acm<br />
<br />
Then unplug the device and plug it back in after turning power-management off.<br />
<br />
=== By using the debug board/serial/JTAG ===<br />
<br />
Please see [[Debug Board#Usage_Instructions]]<br />
<br />
== Getting access to the bootloader console ==<br />
<br />
Please see [[u-boot#Using_usbtty_from_Linux]]<br />
<br />
== Using Audio ==<br />
=== Enable Internal Speaker and Mic in Phone Calls ===<br />
If you got no Speaker and Mic during a Call you need to load the "gsmhandset.state" alsa-configfile<br />
<br />
alsactl -f /etc/alsa/gsmhandset.state restore<br />
<br />
Maybe you need to load another .state file for playing mp3 or a BT-Headset see in /etc/alsa/<br />
<br />
To hear something you can find an .au file (or convert a .wav into an .au by using the sox tool):<br />
<br />
sox ringtone_thereisnophone.wav -t raw -r 8012 -u -b -c 1 rigtone_thereisnophone.au<br />
<br />
copy it to the device and run<br />
<br />
cat ringtone_thereisnophone.au > /dev/dsp<br />
<br />
== Useful commands in Linux ==<br />
<br />
=== Suspending ===<br />
<br />
Writing "mem" into ''/sys/power/state'' tells Linux to suspend - it will enter a low power mode where only the GSM and RAM are powered up and the CPU sleeps. It will persist in this state until a wake-up event arrives. Some currently enabled wake-up events are: AUX or POWER key press, USB cable detect.<br />
<br />
If you're connected over ssh, sshd will stop responding when the OS suspends, so to avoid locking up your ssh client, use the command<br />
# (sleep 1; echo mem > /sys/power/state) & exit<br />
<br />
=== Initial backup ===<br />
<br />
After getting your new Neo1973 booted for the first time you might want to make a back up of the original flash chip contents on your PC, before you overwrite the flash with a custom image or just update to a newer build. <br />
<br />
{{note|For phase 0 developers only (GTA01Bv4 shippment 0, '''not &gt; 0 '''): This is a good idea because there are parts in the root filesystem that can't be distributed over internet so they are only found in the shipped ROM (see the [[GPS]] driver).}}<br />
<br />
One easy way to back up all of the Flash, that doesn't require installing any special software, is with ''netcat'' over the [[USB Networking|USB ethernet]]. The following commands can be used for that.<br />
{|<br />
! On the host !! On the target<br />
|-<br />
|<pre><br />
$ nc -l -p 20000 > mtdblock0<br />
$ nc -l -p 20000 > mtdblock1<br />
$ nc -l -p 20000 > mtdblock2<br />
$ nc -l -p 20000 > mtdblock3<br />
$ nc -l -p 20000 > mtdblock4<br />
</pre><br />
|<pre><br />
# cat /dev/mtdblock0 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock1 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock2 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock3 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock4 | nc 192.168.0.200 20000<br />
</pre><br />
|}<br />
<br />
This stores the five NAND partitions in files named mtdblock*. Knowing the partition layout (u-boot "mtdparts" command or Linux dmesg) you can restore the whole flash with it.<br />
<br />
=== Setting date and time ===<br />
<br />
To set the date and time you need to open a terminal or ssh to the device. To set the date and time to August 9 19:02 2007 type:<br />
<br />
# date -s 080919022007<br />
<br />
The screensaver might turn on as you execute this command - just tap the screen to get back.<br />
<br />
Now, you need to synchronize the time with the hardware date/time by typing:<br />
<br />
# hwclock --systohc<br />
<br />
=== Where to from here ===<br />
<br />
You'll probably want to play with some of the interesting hardware in this device. Obviously, you can explore the applications available through the touch-screen interface. But for those who prefer doing things more in the raw from a shell prompt, you can [[Manually_using_GSM | manually use GSM]], [[Manually_using_SMS | manually use SMS]], or you can start playing with the [[GPS]].<br />
<br />
<span id="bottom">{{Languages|Getting_Started_with_your_Neo1973}}</span><br />
<br />
[[Category:Documentation]]<br />
[[Category:Neo1973_Phase_1_related]]</div>Sunlthttp://openmoko.org/wiki/Manuals/Neo_1973/zh_cnManuals/Neo 1973/zh cn2007-11-16T05:45:36Z<p>Sunlt: </p>
<hr />
<div>This is a guide of some first steps for those who have just received their first [[Neo1973]] phone. [[Shipment 1]] has some specifics limited to that batch.<br />
<br />
== Hardware ==<br />
<br />
=== Assembly ===<br />
<br />
'''A short demonstration is available on Google video: [http://video.google.de/videoplay?docid=-8343770443102960945 Open the back cover, remove the battery, remove the SIM card, remove the micro-SD card, insert the micro-SD card, insert the SIM card, insert the battery, close the back cover]'''<br />
<br />
The micro-SD slot is underneath the SIM slot, which is underneath the battery. To access any of these, you need to open the back cover of the phone.<br />
<br />
The [[SIM]] card and the [[micro-SD]] memory card are optional; SIM is needed only for cell network functionality and memory card for extra storage.<br />
<br />
==== Back cover ====<br />
<br />
Remove the back cover by putting your fingernail or a guitar pick in the small recess on the top of the Neo and pulling gently (see just the first step of [[Disassembling Neo1973]]).<br />
<br />
When you are done, close the back cover by inserting the pins of the cover into the holes on the bottom of the Neo and pressing the top of the case gently.<br />
<br />
==== Battery ====<br />
<br />
To remove the [[battery]], lift its bottom edge with your fingernail. <br />
<br />
Before closing the cover, insert the battery by pushing it against the three metal springs with the contacts aligned and pressing the bottom edge of the battery down into the case. <br />
<br />
==== SIM card (optional) ====<br />
<br />
The [[SIM card]] is obtained from a cell network operator. The slot for the SIM card is found just under the battery. The metallic card holder has arrows and text indicating which way to push it to lock and unlock it - make sure you don't open it with force when it's locked or it may break. <br />
<br />
Click the holder unlocked and open it up. To remove the SIM card, slide it out of the holder.<br />
<br />
When you're done with the micro-SD slot, slide the SIM card into its holder so that the pads make contact when you close the holder. Push the holder firmly against the springs, then lock it - otherwise the card will not be detected.<br />
<br />
To check in Linux if the SIM card is inserted correctly, you can have a look in gsmd logs or use the instructions detailed in the [[Manually using GSM]] page and issue the ''AT+CIMI'' command.<br />
<br />
==== Micro-SD card (optional) ====<br />
<br />
You should have received a [[micro-SD]] memory card with your phone. You might want to copy some mp3 (or better Ogg Vorbis) files to it to try media playback.<br />
<br />
The micro-SD slot is right under the SIM slot. Gently slide the micro-SD holder toward the battery contacts to unlock it. Lift up the holder. To remove a card, simply slide it out.<br />
<br />
To insert a card, slide it into the holder the metal contacts first and away from the holder. Rotate the holder shut, press it firmly against the springs, and gently slide the holder away from the battery contacts to lock it closed.<br />
<br />
The card should automatically be available under /media/card the next time you boot. You can test it and your audio drivers at the same time by playing an mp3 or ogg from it (see [[Neo1973 Audio Subsystem]]).<br />
<br />
=== Buttons ===<br />
<br />
The [[Neo1973 Power Button|power button]] is on the lower right-hand side, and the [[Neo1973 AUX Button|AUX button]] is on the top-left.<br />
<br />
Button functions while the phone is on (as of writing):<br />
* Power button short press: Close the current application<br />
* Power button 1 second press: Open the [[power management menu]]<br />
* Power button 10 second press: Last-resort power off<br />
* AUX button short press: Go to the [[Today]] application<br />
* AUX button 1 second press: Open the [[functions menu]]<br />
<br />
=== Accessories ===<br />
<br />
==== Stylus ====<br />
<br />
The stylus as shipped has three batteries in it, providing for the laser pointer and flashlight LEDs. A set of replacement batteries is also included. The stylus can be twisted open in middle to access the batteries.<br />
<br />
To use the ballpoint or stylus head, turn the bottom part of the stylus to either direction.<br />
<br />
==== Headset ====<br />
<br />
The Neo ships with a stereo headset including a microphone and a push button. The plug is a standard 2.5 mm four-conductor version, though it differs from standard 3.5 mm headphones. The black socket is on the left side of the phone, and the last millimeter is somewhat firmer so make sure you push the plug all the way.<br />
<br />
==== Lanyard ====<br />
<br />
The provided lanyard can be attached to the hole in the bottom part of the phone. Put the loose end through the phone, through the two metal loops in the lanyard, between the metal loops and back through the first metal loop.<br />
<br />
=== Powering up the phone ===<br />
[[Image:Neo1973_uboot_splash.jpg|200px|thumb|bootloader splash screen]]<br />
Just hitting the power button (depending on your [[u-boot]] version you have to press for >= 5 seconds) should get the phone first into the bootloader, then boot the kernel, and get into X/OpenMoko. The shipped battery typically has enough charge to boot up directly without charging through the usb cable first.<br />
<br />
Once you have pressed the power button sufficiently long, the vibrator makes a short pulse and the screen backlight turns on. You can now release the power button and watch the phone booting.<br />
<br />
If the battery is not sufficiently charged, the phone will not turn on, even if the usb cable is plugged in.<br />
<br />
=== Flashing the Neo1973 GTA01Bv4 ===<br />
The GTA01Bv4 devices that are currently shipping do not boot out of the box. Flashing the phone with the latest kernel and [[Userspace root image|supporting file system ("rootfs")]] is required before the phone will successfully boot.<br />
<br />
Read more information at about [[Flashing openmoko]]. MacOS X users please also refer to [[MacOS_X]].<br />
<br />
=== Powering down the phone ===<br />
<br />
==== While in bootloader mode, or if the phone has crashed ====<br />
<br />
If you press the power button for 9 seconds, the phone will switch off. You can notice this by the backlight going dark.<br />
<br />
==== While running a full linux system with userspace ====<br />
<br />
In this mode, a power-button press of 5 seconds will be sufficient. After this, the init process will take care of safely shutting down the phone, which might take up to 20 extra seconds. The X server should get killed, you should drop back to a (garbled) console, and it should finally switch off - much like a regular Linux PC.<br />
<br />
=== Battery charging ===<br />
:''See also [[Neo1973 Battery Charger]]<br />
The [[Neo1973]] supports two charging modes: One 100mA charge mode (called pre-charge) and 500mA (called fast charge). Charging is always done via the USB socket. You can use any USB-A to USB-mini-B cable to connect the phone to any USB host.<br />
<br />
Note: If the Neo1973 battery completely drains it's possible that even after a long recharge you might not be able to power the phone on. To fix that you need to remove the battery, and leave it out for about a minute, then replace the battery and plug the phone back into a usb port. You should be able to power it on after a few minutes of charging.<br />
<br />
==== While in u-boot ====<br />
<br />
While you are in u-boot mode, the phone only charges with 100mA by default. (This will change in one of the future revisions).<br />
<br />
However, using the u-boot console you can manually enable fast charging. See [[U-boot#Battery_charger_related]] for more information.<br />
<br />
==== While in Linux ====<br />
<br />
As soon as the phone is connected via USB cable, it will charge. However, the default charging current is only 100mA, way too little if you want to operate the phone and charge at the same time. <br />
<br />
If your USB upstream port is capable of supplying 500mA, then it will configure the Neo1973 accordingly and use 500mA charging mode. You can notice this by the following line in the kernel log (/var/log/messages) of the Neo1973:<br />
usb0: full speed config #1: 500 mA, Ethernet Gadget, using CDC Ethernet<br />
<br />
== Getting shell access on the phone ==<br />
<br />
=== By using the terminal emulator and on-screen keyboard ===<br />
<br />
In [[Today]] (the main screen the phone boots to and which can always be accessed by pressing the [[AUX button]]), selecting (with a stylus or a thumb) the "+" tab in the center bottom of the screen shows the application launcher. Make sure the filter at the top of the window is set at "Applications" or "All", then drag upward on the list to scroll it until the Terminal application appears. Alternatively, you can toggle the magnifier glass in the filter and type "terminal" to the text box that appears. Click the application in the list to make it turn yellow and start - this might be difficult a first since any movement is interpreted as dragging rather than clicking. <br />
<br />
The on-screen keyboard should appear whenever you choose a text entry. It can also be toggled by clicking on the tiny keyboard icon in the panel at the very top of the screen. More options are available via Input Manager which can be started in the application launcher filtered by "Utilities" or "All". A white box appears in the panel. It also can be used to toggle the keyboard. You can choose between different keyboard layouts and the stroke recognizer by dragging from the white box to the right of the box, which should make a menu appear.<br />
<br />
=== By using Ethernet emulation over a USB cable ===<br />
<br />
The standard Neo1973 Linux [[kernel]] has support for the "cdc_ether USB gadget", i.e. a standard implementation of how to emulate an Ethernet device over USB.<br />
<br />
The following description is for generic *NIX system. For setting up connectivity specifically on a MacOS X machine, refer to [[MacOS_X]] (because there is no usb0 and you need a special kernel driver first).<br />
<br />
As soon as the kernel is up and running, and you have the phone connected via USB, you should get a '''usb0''' device on your host. <br />
<br />
The Phone will have the IPv4 address 192.168.0.202/24. You can run `ifconfig` in the terminal on the phone to verify this (this is optional, just check it if it doesn't work given the instructions below)<br />
<br />
If you plug a USB cable into a laptop running Linux, you'll likely see the "cdc_ether" kernel module being loaded and a usb0 network interface appear. If not, see [[USB_Networking]] for more details.<br />
<br />
On the '''host PC''', you should then configure your interface to 192.168.0.200 by using<br />
# ifconfig usb0 192.168.0.200 netmask 255.255.255.0<br />
<br />
Then you should be able to<br />
# ping 192.168.0.202<br />
<br />
and last, but not least<br />
# ssh root@192.168.0.202<br />
<br />
Once you press 'enter' (empty password), you should now have a root login.<br />
<br />
See [[USB_Networking]] for more details, including instructions on how to automatically setup masquerading so that your phone can get access to the internet through the host PC.<br />
<br />
Note: If you have a power management profile enabled on your device your ssh connection might appear to freeze when your phone tries to sleep. To stop this from occuring you need to hold the power button down for a few seconds until you get the menu with the "Power Off" option at the bottom. Once you do, you should select the "Profile: No PM" option. If your shell died and you want it back, you can do the following:<br />
<br />
# modprobe -r cdc_ether <br />
# modprobe -r cdc_acm<br />
<br />
Then unplug the device and plug it back in after turning power-management off.<br />
<br />
=== By using the debug board/serial/JTAG ===<br />
<br />
Please see [[Debug Board#Usage_Instructions]]<br />
<br />
== Getting access to the bootloader console ==<br />
<br />
Please see [[u-boot#Using_usbtty_from_Linux]]<br />
<br />
== Using Audio ==<br />
=== Enable Internal Speaker and Mic in Phone Calls ===<br />
If you got no Speaker and Mic during a Call you need to load the "gsmhandset.state" alsa-configfile<br />
<br />
alsactl -f /etc/alsa/gsmhandset.state restore<br />
<br />
Maybe you need to load another .state file for playing mp3 or a BT-Headset see in /etc/alsa/<br />
<br />
To hear something you can find an .au file (or convert a .wav into an .au by using the sox tool):<br />
<br />
sox ringtone_thereisnophone.wav -t raw -r 8012 -u -b -c 1 rigtone_thereisnophone.au<br />
<br />
copy it to the device and run<br />
<br />
cat ringtone_thereisnophone.au > /dev/dsp<br />
<br />
== Useful commands in Linux ==<br />
<br />
=== Suspending ===<br />
<br />
Writing "mem" into ''/sys/power/state'' tells Linux to suspend - it will enter a low power mode where only the GSM and RAM are powered up and the CPU sleeps. It will persist in this state until a wake-up event arrives. Some currently enabled wake-up events are: AUX or POWER key press, USB cable detect.<br />
<br />
If you're connected over ssh, sshd will stop responding when the OS suspends, so to avoid locking up your ssh client, use the command<br />
# (sleep 1; echo mem > /sys/power/state) & exit<br />
<br />
=== Initial backup ===<br />
<br />
After getting your new Neo1973 booted for the first time you might want to make a back up of the original flash chip contents on your PC, before you overwrite the flash with a custom image or just update to a newer build. <br />
<br />
{{note|For phase 0 developers only (GTA01Bv4 shippment 0, '''not &gt; 0 '''): This is a good idea because there are parts in the root filesystem that can't be distributed over internet so they are only found in the shipped ROM (see the [[GPS]] driver).}}<br />
<br />
One easy way to back up all of the Flash, that doesn't require installing any special software, is with ''netcat'' over the [[USB Networking|USB ethernet]]. The following commands can be used for that.<br />
{|<br />
! On the host !! On the target<br />
|-<br />
|<pre><br />
$ nc -l -p 20000 > mtdblock0<br />
$ nc -l -p 20000 > mtdblock1<br />
$ nc -l -p 20000 > mtdblock2<br />
$ nc -l -p 20000 > mtdblock3<br />
$ nc -l -p 20000 > mtdblock4<br />
</pre><br />
|<pre><br />
# cat /dev/mtdblock0 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock1 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock2 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock3 | nc 192.168.0.200 20000<br />
# cat /dev/mtdblock4 | nc 192.168.0.200 20000<br />
</pre><br />
|}<br />
<br />
This stores the five NAND partitions in files named mtdblock*. Knowing the partition layout (u-boot "mtdparts" command or Linux dmesg) you can restore the whole flash with it.<br />
<br />
=== Setting date and time ===<br />
<br />
To set the date and time you need to open a terminal or ssh to the device. To set the date and time to August 9 19:02 2007 type:<br />
<br />
# date -s 080919022007<br />
<br />
The screensaver might turn on as you execute this command - just tap the screen to get back.<br />
<br />
Now, you need to synchronize the time with the hardware date/time by typing:<br />
<br />
# hwclock --systohc<br />
<br />
=== Where to from here ===<br />
<br />
You'll probably want to play with some of the interesting hardware in this device. Obviously, you can explore the applications available through the touch-screen interface. But for those who prefer doing things more in the raw from a shell prompt, you can [[Manually_using_GSM | manually use GSM]], [[Manually_using_SMS | manually use SMS]], or you can start playing with the [[GPS]].<br />
<br />
<span id="bottom">{{Languages|Getting_Started_with_your_Neo1973}}</span><br />
<br />
[[Category:Documentation]]<br />
[[Category:Neo1973_Phase_1_related]]</div>Sunlthttp://openmoko.org/wiki/USB_Networking/zh_cnUSB Networking/zh cn2007-11-15T02:04:56Z<p>Sunlt: </p>
<hr />
<div>= Neo1973 side =<br />
<br />
== Name resolution ==<br />
<br />
By default Neo1973 has usb0 interface working due to Ethernet gadget (g_ether) compiled into kernel.<br />
<br />
On the Neo, if you want to reach out to the internets using full qualified hostnames, you need to define your DNS server. Create a file /etc/resolv.conf with at least one line saying<br />
<br />
nameserver xxx.xxx.xxx.xxx<br />
<br />
e.g. nameserver 192.168.1.1<br />
<br />
Then you can also easily update your 2007.2 OpenMoko packages with "ipkg update && ipkg upgrade" on the Neo.<br />
<br />
A better approach is to symlink<br />
<br />
ln -s /var/run/resolv.conf /etc/resolv.conf<br />
<br />
and fill the file at bootup with a script /etc/network/if-up.d/08setupdns containing:<br />
<br />
#!/bin/sh -e<br />
echo nameserver 192.168.0.200 > /var/run/resolv.conf<br />
<br />
this way the file is correctly handled from ppp package when dialing into gprs.<br />
<br />
== Routing ==<br />
<br />
You need a additional route for traffic to the internet. This traffic can be routed through your pc (see below) if the pc is the default route destination. you can achieve this by adding<br />
<br />
gateway 10.10.10.21<br />
<br />
to your /etc/network/interfaces in the usb0 section.<br />
<br />
= Desktop side =<br />
<br />
== Manual method ==<br />
<br />
With the device connected, modprobe usbnet module and configure usb0 interface (as root):<br />
<pre><br />
ifconfig usb0 192.168.0.200 netmask 255.255.255.0<br />
</pre><br />
If your eth0 interface is also in the same 'range' (e.g. 192.168.0.105) then you can do the following:<br />
<br />
1. ping the Neo with<br />
# ping -I usb0 192.168.0.202<br />
2. add a route to your Neo:<br />
# /sbin/route add -host 192.168.0.202/32 dev usb0<br />
3 log in to the Neo<br />
# ssh root@192.168.0.202<br />
<br />
If you don't have the necessary modules to get usb0 going, make sure you have the following kernel options enabled:<br />
* CONFIG_USB_USBNET<br />
* CONFIG_USB_NET_CDCETHER<br />
Both options are available in the Device Drivers -> USB support -> USB Network Adapters. For more info see the [http://www.linux-usb.org/usbnet/ usbnet driver homepage].<br />
<br />
== Automatic method ==<br />
<br />
Took from [http://blog.haerwu.biz/2007/03/22/hotpluging-usbnet/ Hotplugging usbnet] post by Marcin 'Hrw' Juszkiewicz.<br />
<br />
'''For Debian or similar distros:'''<br />
Edit /etc/network/interfaces file ():<br />
<pre><br />
allow-hotplug usb0<br />
iface usb0 inet static<br />
address 192.168.0.200<br />
netmask 255.255.255.0<br />
network 192.168.0.0<br />
post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24<br />
post-up echo 1 > /proc/sys/net/ipv4/ip_forward<br />
post-up iptables -P FORWARD ACCEPT<br />
</pre><br />
<br />
'''For Ubuntu (Tested with Feisty and Gutsy):'''<br />
Edit /etc/network/interfaces file ():<br />
<pre><br />
auto usb0<br />
iface usb0 inet static<br />
address 192.168.0.200<br />
netmask 255.255.255.0<br />
network 192.168.0.0<br />
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &<br />
up echo 1 > /proc/sys/net/ipv4/ip_forward &<br />
up iptables -P FORWARD ACCEPT &<br />
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24 &<br />
</pre><br />
<br />
If you are doing the echo 1 > /proc/... command manually, sudo may not be enough, then you will have to execute it from a sudo bash.<br />
<br />
Ubuntu Feisty and Gutsy appear to have a bug where ifdown is not run when the interface is unplugged, meaning this only works once after the system is booted.<br />
One can patch /etc/udev/rules.d/85-ifupdown.rules, editing the two lines at the end of the file:<br />
<pre><br />
SUBSYSTEM=="net", DRIVERS=="?*", GOTO="net_start"<br />
GOTO="net_end"<br />
<br />
LABEL="net_start"<br />
<br />
# Bring devices up and down only if they're marked auto.<br />
# Use start-stop-daemon so we don't wait on dhcp<br />
ACTION=="add", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}"<br />
<br />
LABEL="net_end"<br />
<br />
ACTION=="remove", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}"<br />
</pre><br />
<br />
the bug is that the LABEL="net_end" is at the wrong position<br />
<br />
'''For Red Hat or similar distros'''<br />
Edit /etc/sysconfig/network-scripts/net.hotplug:<br />
<br />
After this statement:<br />
<pre><br />
case $INTERFACE in<br />
# interfaces that are registered after being "up" (?)<br />
</pre><br />
<br />
Add the following:<br />
<pre><br />
usb0)<br />
ifconfig usb0 192.168.0.200 netmask 255.255.255.0<br />
route add 192.168.0.202 usb0<br />
iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT<br />
iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT<br />
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24<br />
echo 1 > /proc/sys/net/ipv4/ip_forward<br />
exit 0<br />
;;<br />
</pre><br />
<br />
'''For Gentoo or similar distros:''' <br />
<br />
* Edit /etc/conf.d/net by adding:<br />
<pre><br />
# Neo1973<br />
config_usb0=( "192.168.0.200 netmask 255.255.255.0" )<br />
routes_usb0=( "192.168.0.202/32 via 192.168.0.200" )<br />
</pre><br />
* Create a new init script:<br />
<pre><br />
# cd /etc/init.d<br />
# ln -s net.lo net.usb0<br />
</pre><br />
<br />
* Put iptables into use:<br />
<pre><br />
# iptables -I INPUT 1 -s 192.168.0.202 -j ACCEPT<br />
# iptables -I OUTPUT 1 -s 192.168.0.200 -j ACCEPT<br />
# iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24<br />
</pre><br />
* Store them<br />
<pre><br />
# /etc/init.d/iptables save<br />
</pre><br />
* If you want the routing to be switched on by default:<br />
<pre><br />
# rc-update add iptables default<br />
</pre> <br />
And now when you connect phone (which has 192.168.0.202 IP) it gets connection to world automatically.<br />
<br />
'''For MacOS X:'''<br />
<br />
there are no files to edit since hotplugging configuration is done automatically by default. Of course, the interface has been initialized once. Install the AJZaurusUSB driver as described on [[MacOS_X]] and then open System Preferences / Networks which will show the new interface. Configure for Manual DHC with Host address 192.168.0.200 and Gateway 192.168.0.202.<br />
<br />
= Mobile development =<br />
<br />
== Proxying DNS requests ==<br />
<br />
If, like me, you move about quite a lot, connecting to various networks as you go and getting your ip via dhcp, you'll probably be annoyed at having to constantly update your resolv.conf on the Neo 1973.<br />
<br />
To get round this, as part of my setup script, I run a proxy dns on the ip address the neo comes in on at the usb0 port. This means that my Neo /etc/resolv.conf only contains:<br />
<br />
nameserver 192.168.0.200 <br />
<br />
and my laptop will proxy all dns requests based on it's own /etc/resolv.conf<br />
<br />
'''note that we only run the dns proxy on the usb0 interface so that we don't break any other networking'''<br />
<br />
=== Proxying with dnrd ===<br />
<br />
The script is designed to use [http://dnrd.sourceforge.net/ dnrd] as the dns proxy. The [http://buildhost.automated.it/gta01 script] and a copy of [http://buildhost.automated.it/dnrd-2.20.3.tar.gz dnrd] are available from my site. The script also performs the initial setup of the connection as per the [[USB_Networking#Manual_method]] above.<br />
<br />
=== Proxying with a UDP forwarder ===<br />
Another easy setup is using a udp forwarder like the one from http://www.tapor.com/udpf/ - is use it with the command<br />
<br />
udpf-elf\<br />
-p=53\<br />
-f=`cat /etc/resolv.conf|awk '$1 == "nameserver"{print $2; exit(0);}'`:53<br />
<br />
=== Proxying with iptables ===<br />
Its is possible to forward DNS requests with iptables using the DNAT target<br />
<br />
iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1<br />
iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200 --dport domain -j DNAT --to-destination 192.168.0.1<br />
<br />
where <tt>192.168.0.1</tt> is the IP of your residential gateway (router). This is the easiest method, but its not recommended if you have a direct connection to the Internet as ISP DNS servers can change, and this does no load-balancing.<br />
<br />
= Connecting to phone =<br />
<br />
Then <tt>ssh root@192.168.0.202</tt> with empty password to get into phone.<br />
<br />
NOTE: the ssh daemon (dropbear 0.49) on the OpenMoko appears to have a bug when sending the exit status back to the client. From time to time you receive an exit status of 255.<br />
<br />
===SSH Extras===<br />
<br />
If you get fed up with typing root@192.168.0.202, on your PC edit /etc/hosts and add an entry for 'phone'<br />
<br />
192.168.0.202 phone<br />
<br />
then edit ~/.ssh/config (or create it) and add<br />
<br />
host phone<br />
user root<br />
<br />
then all you need to do is type <br />
<br />
# ssh phone<br />
<br />
To avoid ssh added a new line for every ssh host-key to you known_hosts you can add the following to the phone section in ~/.ssh/config<br />
<br />
UserKnownHostsFile /dev/null<br />
<br />
You might want to use keys to bypass the login prompt too.<br />
<br />
===SSH Keys===<br />
====From host to phone====<br />
<br />
To generate ssh keys for use as a login mechanism type<br />
<br />
ssh-keygen -t rsa<br />
<br />
when prompted for a password either hit enter for no password (''not really a good idea'') or enter a password for this key. ssh into the phone and create ~/.ssh<br />
<br />
# mkdir ~/.ssh<br />
<br />
then from your PC copy the '''.pub''' file to the phone.<br />
<br />
# scp ~/.ssh/id_rsa.pub phone:.ssh/authorized_keys<br />
<br />
You should now be able to ssh directly into the phone.<br />
<br />
To disable password logins ('''after setting up key access''') edit /etc/init.d/dropbear and change the following line:<br />
<br />
DROPBEAR_EXTRA_ARGS=<br />
<br />
to <br />
<br />
DROPBEAR_EXTRA_ARGS="-s"<br />
<br />
You will need to restart dropbear for this to take effect.<br />
<br />
====From phone to host====<br />
Generate the key<br />
<br />
dropbearkey -t rsa -f id_rsa<br />
<br />
The output will look something like this:<br />
<br />
Will output 1024 bit rsa secret key to 'id_rsa'<br />
Generating key, this may take a while...<br />
Public key portion is:<br />
ssh-rsa AAAAB3Nza[...]<br />
Fingerprint: md5 ca:e8:f0:b7:f6:7b:c2:b6:b9:71:e4:45:86:a9:ff:b8<br />
<br />
Copy and paste the one line (in this example, starting with 'ssh-rsa' onto the end of the host's authorized_keys file (often in ~/.ssh/).<br />
<br />
From the phone, ssh with -i:<br />
<br />
ssh -i id_rsa user@host<br />
<br />
This works for me. I ripped off these instructions from: [[http://forum.openwrt.org/viewtopic.php?pid=53705]]<br />
<br />
===GUI on desktop through SSH===<br />
<br />
If you need to get the GUI on the phone onto the desktop via usb, you can use ssh as follows<br />
<br />
ssh -l root -X -v 192.168.0.202<br />
<br />
Login, and run openmoko-finger-demo for example, and it will open up on the desktop. To get landscape view, just resize the GUI window on the desktop.<br />
<br />
===Remote apps on neo===<br />
<br />
To get desktop apps to show up on your neo, first log in to the phone<br />
<br />
ssh -l root 192.168.0.202<br />
<br />
Then once inside, run:<br />
<br />
DISPLAY=:0 xhost +192.168.0.200<br />
<br />
After this you can close the ssh session. Back on the desktop computer, run:<br />
<br />
DISPLAY=moko:0 xclock<br />
<br />
Note that the xhost command will allow remote applications on 192.168.0.200 to access the X server. It will allow anyone on the desktop machine to access the X server of the neo, including snooping anything you type on it. To disallow remote applications again, run this in the neo:<br />
<br />
DISPLAY=:0 xhost -192.168.0.200<br />
<br />
<span id="bottom"></span> <br />
{{Languages|USB Networking}}<br />
<br />
[[Category:Hardware]]<br />
[[Category:Implemented]]</div>Sunlthttp://openmoko.org/wiki/Translation_HOWTO/zh_cnTranslation HOWTO/zh cn2007-11-06T10:00:11Z<p>Sunlt: </p>
<hr />
<div>Main page for localisation is [[Translation]]<br />
help to improve this page<br />
== 寻找要翻译的内容 ==<br />
First of all package creator/maintainer have to create *.pot file with all messages included.<br />
Search for this files in source tree and you can edit them.<br />
<br />
== 翻译 ==<br />
Rule of thumb: It's better to have some translation than nothing, so feel free to translate.<br />
<br />
== 软件 ==<br />
There are specialised tools for *.pot (*.po) files edition gtranslator, po4a, poedit, pootle, potool ...<br />
<br />
Most of text editors will fit also: vim, emacs, ed ...<br />
<br />
== 更新源代码树 ==<br />
{{todo|descript SVN update after editing}}<br />
== Notes ==<br />
* Encoding for *.po is UTF-8<br />
* Most of packages in Openembedded tree allready iternationalised, its worth to review them<br />
== Common space for localisation effort ==<br />
'''please join the community ml for now.''' there's also some talking about creating a translators ml [[Talk:Translation#Need for translation mailing list (and coordinators?)|here]] [http://lists.openmoko.org/pipermail/community/2007-April/004973.html and here: OM-i18n-ml] feel free to join both discussions. [[User:Cga|cga]] sat apr 28th 20:48:35 CEST 2007)<br />
<br />
== List of OpenMoko related PO's==<br />
Most of apps in /home/moko/sources/svn/ and /home/moko/openmoko/trunk/src/target/OM-2007/applications/ don have *.pot files for now, but some of them have *.po files for some of the languages<br />
<br />
{{Languages|Translation_HOWTO}}</div>Sunlthttp://openmoko.org/wiki/Translation_HOWTO/zh_cnTranslation HOWTO/zh cn2007-11-06T09:59:39Z<p>Sunlt: /* Software */</p>
<hr />
<div>Main page for localisation is [[Translation]]<br />
help to improve this page<br />
== 寻找要翻译的内容 ==<br />
First of all package creator/maintainer have to create *.pot file with all messages included.<br />
Search for this files in source tree and you can edit them.<br />
<br />
== 翻译 ==<br />
Rule of thumb: It's better to have some translation than nothing, so feel free to translate.<br />
<br />
== 软件 ==<br />
There are specialised tools for *.pot (*.po) files edition gtranslator, po4a, poedit, pootle, potool ...<br />
<br />
Most of text editors will fit also: vim, emacs, ed ...<br />
<br />
== Updating source tree ==<br />
{{todo|descript SVN update after editing}}<br />
== Notes ==<br />
* Encoding for *.po is UTF-8<br />
* Most of packages in Openembedded tree allready iternationalised, its worth to review them<br />
== Common space for localisation effort ==<br />
'''please join the community ml for now.''' there's also some talking about creating a translators ml [[Talk:Translation#Need for translation mailing list (and coordinators?)|here]] [http://lists.openmoko.org/pipermail/community/2007-April/004973.html and here: OM-i18n-ml] feel free to join both discussions. [[User:Cga|cga]] sat apr 28th 20:48:35 CEST 2007)<br />
<br />
== List of OpenMoko related PO's==<br />
Most of apps in /home/moko/sources/svn/ and /home/moko/openmoko/trunk/src/target/OM-2007/applications/ don have *.pot files for now, but some of them have *.po files for some of the languages<br />
<br />
{{Languages|Translation_HOWTO}}</div>Sunlthttp://openmoko.org/wiki/Translation_HOWTO/zh_cnTranslation HOWTO/zh cn2007-11-06T09:59:16Z<p>Sunlt: /* Translating */</p>
<hr />
<div>Main page for localisation is [[Translation]]<br />
help to improve this page<br />
== 寻找要翻译的内容 ==<br />
First of all package creator/maintainer have to create *.pot file with all messages included.<br />
Search for this files in source tree and you can edit them.<br />
<br />
== 翻译 ==<br />
Rule of thumb: It's better to have some translation than nothing, so feel free to translate.<br />
<br />
== Software ==<br />
There are specialised tools for *.pot (*.po) files edition gtranslator, po4a, poedit, pootle, potool ...<br />
<br />
Most of text editors will fit also: vim, emacs, ed ...<br />
<br />
== Updating source tree ==<br />
{{todo|descript SVN update after editing}}<br />
== Notes ==<br />
* Encoding for *.po is UTF-8<br />
* Most of packages in Openembedded tree allready iternationalised, its worth to review them<br />
== Common space for localisation effort ==<br />
'''please join the community ml for now.''' there's also some talking about creating a translators ml [[Talk:Translation#Need for translation mailing list (and coordinators?)|here]] [http://lists.openmoko.org/pipermail/community/2007-April/004973.html and here: OM-i18n-ml] feel free to join both discussions. [[User:Cga|cga]] sat apr 28th 20:48:35 CEST 2007)<br />
<br />
== List of OpenMoko related PO's==<br />
Most of apps in /home/moko/sources/svn/ and /home/moko/openmoko/trunk/src/target/OM-2007/applications/ don have *.pot files for now, but some of them have *.po files for some of the languages<br />
<br />
{{Languages|Translation_HOWTO}}</div>Sunlthttp://openmoko.org/wiki/Translation_HOWTO/zh_cnTranslation HOWTO/zh cn2007-11-06T09:58:56Z<p>Sunlt: /* Finding what to translate */</p>
<hr />
<div>Main page for localisation is [[Translation]]<br />
help to improve this page<br />
== 寻找要翻译的内容 ==<br />
First of all package creator/maintainer have to create *.pot file with all messages included.<br />
Search for this files in source tree and you can edit them.<br />
<br />
== Translating ==<br />
Rule of thumb: It's better to have some translation than nothing, so feel free to translate.<br />
<br />
== Software ==<br />
There are specialised tools for *.pot (*.po) files edition gtranslator, po4a, poedit, pootle, potool ...<br />
<br />
Most of text editors will fit also: vim, emacs, ed ...<br />
<br />
== Updating source tree ==<br />
{{todo|descript SVN update after editing}}<br />
== Notes ==<br />
* Encoding for *.po is UTF-8<br />
* Most of packages in Openembedded tree allready iternationalised, its worth to review them<br />
== Common space for localisation effort ==<br />
'''please join the community ml for now.''' there's also some talking about creating a translators ml [[Talk:Translation#Need for translation mailing list (and coordinators?)|here]] [http://lists.openmoko.org/pipermail/community/2007-April/004973.html and here: OM-i18n-ml] feel free to join both discussions. [[User:Cga|cga]] sat apr 28th 20:48:35 CEST 2007)<br />
<br />
== List of OpenMoko related PO's==<br />
Most of apps in /home/moko/sources/svn/ and /home/moko/openmoko/trunk/src/target/OM-2007/applications/ don have *.pot files for now, but some of them have *.po files for some of the languages<br />
<br />
{{Languages|Translation_HOWTO}}</div>Sunlthttp://openmoko.org/wiki/Translation_HOWTO/zh_cnTranslation HOWTO/zh cn2007-11-06T09:58:13Z<p>Sunlt: </p>
<hr />
<div>Main page for localisation is [[Translation]]<br />
help to improve this page<br />
== Finding what to translate ==<br />
First of all package creator/maintainer have to create *.pot file with all messages included.<br />
Search for this files in source tree and you can edit them.<br />
<br />
== Translating ==<br />
Rule of thumb: It's better to have some translation than nothing, so feel free to translate.<br />
<br />
== Software ==<br />
There are specialised tools for *.pot (*.po) files edition gtranslator, po4a, poedit, pootle, potool ...<br />
<br />
Most of text editors will fit also: vim, emacs, ed ...<br />
<br />
== Updating source tree ==<br />
{{todo|descript SVN update after editing}}<br />
== Notes ==<br />
* Encoding for *.po is UTF-8<br />
* Most of packages in Openembedded tree allready iternationalised, its worth to review them<br />
== Common space for localisation effort ==<br />
'''please join the community ml for now.''' there's also some talking about creating a translators ml [[Talk:Translation#Need for translation mailing list (and coordinators?)|here]] [http://lists.openmoko.org/pipermail/community/2007-April/004973.html and here: OM-i18n-ml] feel free to join both discussions. [[User:Cga|cga]] sat apr 28th 20:48:35 CEST 2007)<br />
<br />
== List of OpenMoko related PO's==<br />
Most of apps in /home/moko/sources/svn/ and /home/moko/openmoko/trunk/src/target/OM-2007/applications/ don have *.pot files for now, but some of them have *.po files for some of the languages<br />
<br />
{{Languages|Translation_HOWTO}}</div>Sunlthttp://openmoko.org/wiki/System_Developer/zh_cnSystem Developer/zh cn2007-11-06T09:48:22Z<p>Sunlt: /* Software */</p>
<hr />
<div>In this section you will find information geared towards library and system developers.<br />
<br />
== 软件 ==<br />
<br />
=== 主机端软件 ===<br />
<br />
一些运行在电脑端并与手机相连接的软件。<br />
<br />
* [[sjf2410-linux]] - for un-bricking your Neo1973<br />
* [[s3c2410_boot_usb]] - 向手机的 RAM 传输代码的程序(就像引导加载器一样)。<br />
* [[Toolchain]] - 用来编译引导加载器和内核。<br />
* [[Neo1973 OpenOCD]] - 片上调试器。<br />
<br />
=== 手机端软件 ===<br />
<br />
* 底层<br />
** [[u-boot]] - 我们使用的引导加载器。<br />
** [[Kernel]] - Neo1973 的 Linux 内核<br />
* 用户空间<br />
** [[gsmd]] - The gsm daemon talking to the GSM Modem<br />
** [[gpsd]] - The gps daemon talking to the GPS Unit<br />
** [[OpenMoko]] 发布版<br />
*** [[OpenMoko2007]] is the first release<br />
*** [[Userspace root image]]<br />
{{Languages|System_Developer}}</div>Sunlthttp://openmoko.org/wiki/Hardware_Developer/zh_cnHardware Developer/zh cn2007-11-06T09:37:52Z<p>Sunlt: /* Hardware */</p>
<hr />
<div>In this section you will find information geared towards hardware developers.<br />
<br />
== 硬件 ==<br />
<br />
* [[:Category:Neo1973 Hardware | Neo1973 Hardware]] - FIC 的第一个 OpenMoko 手机。<br />
** [[Disassembling Neo1973]] - 拆解手机硬件的图片展示。<br />
* [[Debug Board]] -- Neo1973 硬件的调试板。<br />
** [[Connecting Neo1973 with Debug Board v2]] (This is for the new v2 Debug Board)<br />
** [[Connecting_GTA01Bv2_with_Debug_Board]] (This is for the old v1 Debug Board)<br />
** [[Neo1973 Debug Board v1]] - The previous version of the Debug Board<br />
* [[QT2410/zh_cn]] - 早期开发中使用的 S3C2410 开发板。<br />
<br />
{{Languages|Hardware_Developer}}<br />
<br />
[[Category:Neo1973 Hardware Debugging]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:35:05Z<p>Sunlt: /* QT2410 */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
为了做到这一点,你需要编辑 u-boot/include/configs/qt2410.h 文件,将32行的 "if 0" 改为 "if 1",然后用 "make" 重新编译。<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写根文件系统 =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 相关的命令 ====<br />
<br />
我们的 u-boot 支持几个 Neo1973 专用命令:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== 关机 =====<br />
<br />
使用<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== 充电器相关 =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== 查询充电器状态 ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== 禁用充电器 ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== 强制快速充电 ======<br />
<br />
使用<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== 使能/禁用自动快速充电 ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== 背光灯 =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== 振动 =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 专用命令 ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:28:26Z<p>Sunlt: /* S3C2410 specific commands */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写根文件系统 =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 相关的命令 ====<br />
<br />
我们的 u-boot 支持几个 Neo1973 专用命令:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== 关机 =====<br />
<br />
使用<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== 充电器相关 =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== 查询充电器状态 ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== 禁用充电器 ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== 强制快速充电 ======<br />
<br />
使用<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== 使能/禁用自动快速充电 ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== 背光灯 =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== 振动 =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 专用命令 ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:27:55Z<p>Sunlt: /* Forcing fast charge */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写根文件系统 =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 相关的命令 ====<br />
<br />
我们的 u-boot 支持几个 Neo1973 专用命令:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== 关机 =====<br />
<br />
使用<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== 充电器相关 =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== 查询充电器状态 ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== 禁用充电器 ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== 强制快速充电 ======<br />
<br />
使用<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== 使能/禁用自动快速充电 ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== 背光灯 =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== 振动 =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:27:22Z<p>Sunlt: /* Neo1973 相关的命令 */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写根文件系统 =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 相关的命令 ====<br />
<br />
我们的 u-boot 支持几个 Neo1973 专用命令:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== 关机 =====<br />
<br />
使用<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== 充电器相关 =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== 查询充电器状态 ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== 禁用充电器 ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== 使能/禁用自动快速充电 ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== 背光灯 =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== 振动 =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:24:12Z<p>Sunlt: /* Neo1973 related commands */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写根文件系统 =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 相关的命令 ====<br />
<br />
Our version of u-boot supports a couple of Neo1973 specific commands:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== Power-off =====<br />
<br />
Using<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== Battery charger related =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== Inquiring the charger state ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== Disabling battery charging ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== Enabling / Disabling automatic fast charge ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== Backlight =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== Vibrator =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:23:49Z<p>Sunlt: /* Writing rootfs to NAND */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写根文件系统 =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 related commands ====<br />
<br />
Our version of u-boot supports a couple of Neo1973 specific commands:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== Power-off =====<br />
<br />
Using<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== Battery charger related =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== Inquiring the charger state ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== Disabling battery charging ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== Enabling / Disabling automatic fast charge ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== Backlight =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== Vibrator =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:22:39Z<p>Sunlt: /* Writing kernel to NAND */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== 向 NAND 写内核 =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== Writing rootfs to NAND =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 related commands ====<br />
<br />
Our version of u-boot supports a couple of Neo1973 specific commands:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== Power-off =====<br />
<br />
Using<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== Battery charger related =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== Inquiring the charger state ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== Disabling battery charging ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== Enabling / Disabling automatic fast charge ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== Backlight =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== Vibrator =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:22:05Z<p>Sunlt: /* Writing new bootloader to NAND */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== 向 NAND 写新的引导装载程序 =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== Writing kernel to NAND =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== Writing rootfs to NAND =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 related commands ====<br />
<br />
Our version of u-boot supports a couple of Neo1973 specific commands:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== Power-off =====<br />
<br />
Using<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== Battery charger related =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== Inquiring the charger state ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== Disabling battery charging ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== Enabling / Disabling automatic fast charge ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== Backlight =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== Vibrator =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:21:03Z<p>Sunlt: /* Loading Kernel from NAND */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== 从 NAND 加载内核 =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== Writing new bootloader to NAND =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== Writing kernel to NAND =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== Writing rootfs to NAND =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 related commands ====<br />
<br />
Our version of u-boot supports a couple of Neo1973 specific commands:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== Power-off =====<br />
<br />
Using<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== Battery charger related =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== Inquiring the charger state ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== Disabling battery charging ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== Enabling / Disabling automatic fast charge ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== Backlight =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== Vibrator =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlthttp://openmoko.org/wiki/U-Boot/zh_cnU-Boot/zh cn2007-11-02T10:19:18Z<p>Sunlt: /* 引导装载程序二进制文件 */</p>
<hr />
<div>[[Image:Uboot-s3c2410fb.jpg|thumb|300px|Neo1973控制台上的u-boot]] [[Image:Neo1973 uboot splash closeup.jpg|thumb|300px|Neo1973上的u-boot引导菜单]]<br />
<br />
== 概述 ==<br />
<br />
GTA01使用了[http://u-boot.sourceforge.net/ u-boot]引导装载程序。<br />
<br />
关于u-boot的更多信息可以在下列地方找到<br />
* http://www.denx.de/wiki/DULG<br />
* http://www.gumstix.org/tikiwiki/tiki-index.php?page=U-Boot<br />
* http://linuxdevices.com/articles/AT5085702347.html<br />
<br />
但是,未经修改的u-boot不支持GTA01所需要的许多特性,比如<br />
* 利用[[S3C2410 Steppingstone/zh_cn|S3C2410 Steppingstone]]从NAND闪存启动<br />
* 从SD/Transflash读取内核/initrd<br />
* S3C2410 NAND闪存<br />
* 通过S3C2410 USB Device控制器下载程序<br />
* S3C2410 Framebuffer启动logo/状态显示<br />
<br />
[[User:HaraldWelte|Harald Welte]]正在为这些解决问题而工作,并且实际上它们中的大多数已经得到了实现。<br />
<br />
== 引导装载程序源代码 ==<br />
<br />
从 http://svn.openmoko.org/trunk/src/target/u-boot/patches/ 可以获得当前的引导装载程序的补丁。<br />
<br />
Untar the sources, apply the patch. run "make gta01bv3_config" (or gta01bv2_config, or whatever hardware revision you have), run "make". You will get a resulting "u-boot.bin" image, which you can directly flash (either using existing bootloader or [[sjf2410-linux]]) into NAND.<br />
<br />
== 引导装载程序二进制文件 ==<br />
<br />
最新的引导装载程序二进制文件可以从 http://buildhost.openmoko.org/tmp/gta01/deploy/images/ 网站找到。它应该写到 NAND flash 0x00000000 (size 0x30000) 地址处。<br />
<br />
== 引导装载程序开发 ==<br />
<br />
=== QT2410 ===<br />
If you want to do bootloader development on the QT2410, it's easier to work with a bootloader image that can be downloaded via USB into RAM instead of flashing.<br />
<br />
To do so, you need to edit the u-boot/include/configs/qt2410.h file, and change the "if 0" in Line 32 into a "if 1", then recompile with "make".<br />
<br />
The resulting "u-boot.bin" is _NOT SUITABLE_ for NAND flash, but only for direct execution from within ram, e.g. by using the [[s3c2410_boot_usb]] program.<br />
<br />
=== GTA01 ===<br />
<br />
Doing bootloader development on the GTA01 is a bit more tricky. first, we don't have any NOR flash. Second, there is no other way to boot _but_ from NAND. Therefore, we also don't have a USB downloader like the QT2410.<br />
<br />
The main problem is: The [[S3C2410 Steppingstone]] unconditionally copies the first 4k of flash into its internal SRAM. That SRAM segment stays unconditionally mapped at physical address zero. How do we get around this<br />
<br />
==== 使用JTAG从RAM启动 ====<br />
<br />
So how can we boot from RAM? We use JTAG / OpenOCD to<br />
<br />
* reset and halt the cpu at PC=0<br />
<pre><br />
> reset halt<br />
target halted in ARM state due to debug request, current mode: Supervisor<br />
cpsr: 0x400000d3 pc: 0x00000000<br />
MMU: disabled, D-Cache: disabled, I-Cache: disabled<br />
</pre><br />
<br />
* download a small piece of code for low-level SDRAM timing initialization (overwrite 4k SRAM of steppingstone)<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/foo.bin 0 <br />
downloaded 332 byte in 0s 21899us<br />
</pre><br />
<br />
* assert a break point at address 0x33f80000 (which indicates that the low-level code has finished)<br />
<pre><br />
> bp 0x33f80000 4 hw<br />
breakpoint added at address 0x33f80000<br />
</pre><br />
<br />
* run the code up to the break point<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
> Target 0 halted<br />
target halted in ARM state due to breakpoint, current mode: Supervisor<br />
cpsr: 0x600000d3 pc: 0x33f80000<br />
MMU: disabled, D-Cache: disabled, I-Cache: enabled<br />
</pre><br />
<br />
* download the u-boot RAM image to 0x33f80000<br />
<pre><br />
> load_binary /space/misc/gta01/u-boot.git/u-boot.bin 0x33f80000<br />
downloaded 135692 byte in 6s 567264us<br />
</pre><br />
<br />
* resume processing<br />
<pre><br />
> resume<br />
Target 0 resumed<br />
</pre><br />
<br />
At this point, the display backlight gets bright and we see the following familiar prompt on the serial console:<br />
<pre><br />
U-Boot 1.1.6 (Jan 13 2007 - 23:44:23)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
*** Warning - bad CRC or NAND, using default environment<br />
<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv2 # <br />
</pre><br />
<br />
== 建立可引导的映像文件 ==<br />
<br />
u-boot needs bootable images (such as kernels, but also initrd and others) in form of a so-called ''uImage''. In order to create a ''uImage'' from e.g. a ''vmlinux'' kernel image, you can proceed as follows:<br />
<br />
<pre><br />
objcopy -O binary -R .note -R .comment -S vmlinux linux.bin<br />
gzip -9 linux.bin<br />
u-boot/tools/mkimage -A arm -O linux -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image QT2410" -d linux.bin.gz uImage<br />
</pre><br />
<br />
== 引导菜单 ==<br />
[[Image:Neo1973 uboot menu.jpg|thumb|400px|u-boot boot menu on Neo1973]]<br />
<br />
As of the Phase-0 release, our u-boot version now features an on-screen boot menu.<br />
<br />
=== 进入引导菜单 ===<br />
<br />
You can access the boot meny by pressing and holding the [[Neo1973 AUX Button]] together with the power button while switching the phone on.<br />
<br />
=== 使用引导菜单 ===<br />
<br />
By pressing the [[Neo1973 AUX Button]] you can cycle through the menu items. Use the ''POWER'' button to select one item.<br />
<br />
=== 给引导菜单增加项目 ===<br />
<br />
You can add items to the boot menu by setting environment variables. FIXME.<br />
<br />
== 引导装载程序命令提示行 ==<br />
<br />
=== Accessing the bootloader prompt ===<br />
The bootloader prompt is available either on the serial console (via [[Debug Board]]), or as virtual USB Serial device (USB CDC_ACM).<br />
Whether the serial port or usb i used depends on the u-boot environment variables '''stdin''', '''stdout''' and '''stderr'''.<br />
<br />
Whether or not you use usbtty, the first couple of messages will always be displayed on the serial console.<br />
<br />
The bootloader is currently configured to waid for three seconds. If a key press on the '''stdin''' is received within those three seconds, auto-boot is aborted.<br />
<br />
==== Using usbtty from Linux ====<br />
<br />
Just by connecting the phone in u-boot mode to your Linux pc should make it detect a [[CDC ACM]] device, and you should get a new tty device called /dev/ttySAC0. Use your favourite terminal emulator (minicom, cu, zc, ...) to access it like any other serial port.<br />
<br />
First, you should try to check whether the USB device shows up in 'lsusb' while you're running in u-boot mode:<br />
<br />
<pre><br />
# lsusb -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
</pre><br />
<br />
<pre><br />
# lsusb -v -d 1457:5119<br />
Bus 005 Device 079: ID 1457:5119 <br />
Device Descriptor:<br />
bLength 18<br />
bDescriptorType 1<br />
bcdUSB 1.10<br />
bDeviceClass 2 Communications<br />
bDeviceSubClass 0 <br />
bDeviceProtocol 0 <br />
bMaxPacketSize0 16<br />
idVendor 0x1457 <br />
idProduct 0x5119 <br />
bcdDevice 0.00<br />
iManufacturer 1 OpenMoko, Inc<br />
iProduct 2 Neo1973 Bootloader U-Boot 1.2.0-g6c7cac8c-dirty-moko3<br />
iSerial 3 0000000<br />
bNumConfigurations 1<br />
Configuration Descriptor:<br />
bLength 9<br />
bDescriptorType 2<br />
wTotalLength 85<br />
bNumInterfaces 3<br />
bConfigurationValue 1<br />
iConfiguration 4 TTY via USB<br />
bmAttributes 0xc0<br />
Self Powered<br />
MaxPower 0mA<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 0<br />
bAlternateSetting 0<br />
bNumEndpoints 1<br />
bInterfaceClass 2 Communications<br />
bInterfaceSubClass 2 Abstract (modem)<br />
bInterfaceProtocol 1 AT-commands (v.25ter)<br />
iInterface 6 Control Interface<br />
CDC Header:<br />
bcdCDC 0.6e<br />
CDC Call Management:<br />
bmCapabilities 0x00<br />
bDataInterface 1<br />
CDC ACM:<br />
bmCapabilities 0x00<br />
CDC Union:<br />
bMasterInterface 0<br />
bSlaveInterface 1 <br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x81 EP 1 IN<br />
bmAttributes 3<br />
Transfer Type Interrupt<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 1<br />
bAlternateSetting 0<br />
bNumEndpoints 2<br />
bInterfaceClass 10 CDC Data<br />
bInterfaceSubClass 0 Unused<br />
bInterfaceProtocol 0 <br />
iInterface 5 Bulk Data Interface<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x02 EP 2 OUT<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Endpoint Descriptor:<br />
bLength 7<br />
bDescriptorType 5<br />
bEndpointAddress 0x83 EP 3 IN<br />
bmAttributes 2<br />
Transfer Type Bulk<br />
Synch Type None<br />
Usage Type Data<br />
wMaxPacketSize 0x0010 1x 16 bytes<br />
bInterval 255<br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 7 USB Device Firmware Upgrade<br />
Device Status: 0x0001<br />
Self Powered<br />
</pre><br />
<br />
Next, you can access it using your favourite terminal program.<br />
<br />
Then, if the environment is not set correctly, you will need to use the current console (e.g. serial console) to set<br />
<pre><br />
GTA01Bv2 # setenv stderr usbtty<br />
GTA01Bv2 # setenv stdout usbtty<br />
GTA01Bv2 # setenv stdin usbtty<br />
</pre><br />
<br />
==== Typical u-boot prompt ====<br />
<br />
<pre><br />
U-Boot 1.2.0-moko1 (Feb 16 2007 - 00:36:13)<br />
<br />
DRAM: 128 MB<br />
NAND: 64 MiB<br />
Found Environment offset in OOB..<br />
Video: 640x480x8 31kHz 59Hz<br />
USB: S3C2410 USB Deviced<br />
In: serial<br />
Out: serial<br />
Err: serial<br />
Hit any key to stop autoboot: 0 <br />
GTA01Bv3 #<br />
</pre><br />
<br />
=== Commands on the bootloader prompt ===<br />
<br />
==== 自动引导 ====<br />
<br />
Auto-boot executes the command[s] specified in the ''bootcmd'' environment variable. The default configuration is:<br />
<pre><br />
GTA01Bv3 # printenv<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
</pre><br />
<br />
This basically tells us that it will load the content of the NAND partition '''kernel''' to memory address 0x32000000 and then try to boot it. <br />
<br />
==== 环境变量 ====<br />
<br />
u-boot is configured to manage a non-volatile environment that is stored in NAND flash. You can use the commands to read/alter/store the environment in the following example:<br />
<pre><br />
GTA01Bv2 # printenv<br />
baudrate=115200<br />
bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
usbtty=cdc_acm<br />
bootdelay=10<br />
stdout=serial<br />
stderr=serial<br />
stdin=serial<br />
mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs)<br />
mtdids=nand0=neo1973-nand<br />
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416<br />
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000<br />
pcf50606_int1=0x40<br />
filesize=160C000<br />
partition=nand0,0<br />
mtddevnum=0<br />
mtddevname=u-boot<br />
<br />
Environment size: 670/16380 bytes<br />
GTA01Bv3 # setenv bootdelay 10<br />
GTA01Bv3 # printenv bootdelay<br />
bootdelay=10<br />
GTA01Bv3 # saveenv<br />
Saving Environment to NAND...<br />
Erasing Nand...Writing to Nand... done<br />
GTA01Bv3 # <br />
</pre><br />
<br />
Note: When setting multiple commands, e.g. for bootcmd, you need to escape the ';', for instance<br />
<br />
<pre><br />
GTA01Bv3 # setenv bootcmd mmcinit\; ext2load mmc 0 0x32000000 uImage\; bootm 0x32000000<br />
</pre><br />
<br />
==== MMC/SD卡 ====<br />
<br />
in order to initialize a MMC/SD card, you have to use the ``mmcinit'' command.<br />
<pre><br />
GTA01Bv3 # mmcinit<br />
trying to detect SD Card...<br />
MMC found. Card desciption is:<br />
Manufacturer ID = 58d564<br />
HW/FW Revision = 3 8<br />
Product Name = 21DN!@X�<br />
Serial Number = 445303<br />
Month = 5<br />
Year = 2000<br />
READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197<br />
size = 4208984064<br />
GTA01Bv3 #<br />
</pre><br />
<br />
afterwards, you can read ext2 filesystems like:<br />
<pre><br />
GTA01Bv3 # ext2ls mmc 0<br />
<DIR> 1024 .<br />
<DIR> 1024 ..<br />
<DIR> 12288 lost+found<br />
1544788 uImage<br />
</pre><br />
<br />
==== NAND ====<br />
<br />
<pre><br />
GTA01Bv3 # help nand<br />
nand info - show available NAND devices<br />
nand device [dev] - show or set current device<br />
nand read[.jffs2] - addr off size<br />
nand write[.jffs2] - addr off size - read/write `size' bytes starting<br />
at offset `off' to/from memory address `addr'<br />
nand erase [clean] [off size] - erase `size' bytes from<br />
offset `off' (entire device if not specified)<br />
nand bad - show bad blocks<br />
nand dump[.oob] off - dump page<br />
nand scrub - really clean NAND erasing bad blocks (UNSAFE)<br />
nand markbad off - mark bad block at offset (UNSAFE)<br />
nand biterr off - make a bit error at offset (UNSAFE)<br />
</pre><br />
<br />
===== Loading Kernel from NAND =====<br />
<br />
<pre><br />
GTA01Bv3 # nand read 0x32000000 kernel<br />
<br />
NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK<br />
GTA01Bv3 # bootm 0x32000000<br />
## Booting image at 32000000 ...<br />
Image Name: OpenMoko Kernel Image Neo1973<br />
Created: 2007-02-15 23:54:18 UTC<br />
Image Type: ARM Linux Kernel Image (gzip compressed)<br />
Data Size: 1546258 Bytes = 1.5 MB<br />
Load Address: 30008000<br />
Entry Point: 30008000<br />
Verifying Checksum ... OK<br />
Uncompressing Kernel Image ... OK<br />
Starting kernel ...<br />
</pre><br />
<br />
===== Writing new bootloader to NAND =====<br />
<br />
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the<br />
bootloader flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin<br />
GTA01Bv3 # nand erase u-boot<br />
GTA01Bv3 # nand write 0x32000000 u-boot ${filesize}<br />
</pre><br />
<br />
===== Writing kernel to NAND =====<br />
<br />
The following set of commands loads the file uImage from ext2/mmc and flashes it into the<br />
kernel flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage<br />
GTA01Bv3 # nand erase kernel<br />
GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}<br />
</pre><br />
<br />
===== Writing rootfs to NAND =====<br />
<br />
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the<br />
rootfs flash partition:<br />
<br />
<pre><br />
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2<br />
GTA01Bv3 # nand erase rootfs<br />
GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}<br />
</pre><br />
<br />
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB.<br />
<br />
==== Neo1973 related commands ====<br />
<br />
Our version of u-boot supports a couple of Neo1973 specific commands:<br />
<pre><br />
GTA01Bv2 # help neo1973<br />
neo1973 neo1973 info - display phone informantion<br />
neo1973 power-off - switch off the phone<br />
neo1973 charger status - display charger status<br />
neo1973 charger autofast - enable automatic fast (500mA) charging<br />
neo1973 charger !autofast - disable automatic fast (500mA) charging<br />
neo1973 charger fast - enable fast (500mA) charging<br />
neo1973 charger off - disable charging<br />
neo1973 backlight (on|off) - switch backlight on or off<br />
neo1973 vibrator (on|off) - switch vibrator on or off<br />
</pre><br />
<br />
===== Power-off =====<br />
<br />
Using<br />
neo1973 power-off<br />
<br />
you can switch the device off from the bootloader prompt.<br />
<br />
===== Battery charger related =====<br />
<br />
For a detailed description of the charger basics, see [[Neo1973 Battery Charger]].<br />
<br />
====== Inquiring the charger state ======<br />
<br />
You can get the current charger status by issuing<br />
neo1973 charger status<br />
<br />
The following modes are possible:<br />
<br />
* idle - no charging<br />
* trickle - FIXME<br />
* pre - Slow (100mA) charging, works in hardware.<br />
* fast_cccv - Fast (500mA) charging, using Constant-Current followed by Constant Voltage (Li-Ion)<br />
<br />
====== Disabling battery charging ======<br />
<br />
You can disable battery charging (until the next reboot) by issuing<br />
neo1973 charger off<br />
<br />
====== Forcing fast charge ======<br />
<br />
Using<br />
neo1973 charger fast<br />
you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.<br />
<br />
====== Enabling / Disabling automatic fast charge ======<br />
<br />
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.<br />
<br />
{{warning|This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging}}<br />
<br />
You can enable or disable autofast by <br />
neo1973 charger autofast<br />
and<br />
neo1973 charger !autofast<br />
respectively.<br />
<br />
===== Backlight =====<br />
<br />
You can switch the backlight on and off by using<br />
neo1973 backlight on<br />
and<br />
neo1973 backlight off<br />
respectively.<br />
<br />
===== Vibrator =====<br />
<br />
You can switch the vibrator on and off by using<br />
neo1973 vibrator on<br />
and <br />
neo1973 vibrator off<br />
respectively.<br />
<br />
==== S3C2410 specific commands ====<br />
<br />
<pre><br />
GTA01Bv2 # help s3c2410<br />
s3c2410 speed get - display current PLL speed config<br />
s3c2410 speed list - display supporte PLL speed configs<br />
s3c2410 speed set - set PLL speed<br />
GTA01Bv2 # s3c2410 speed list<br />
50 MHz<br />
101 MHz<br />
202 MHz<br />
266 MHz<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz<br />
GTA01Bv2 # s3c2410 speed set 101<br />
GTA01Bv2 # s3c2410 speed get<br />
FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz<br />
</pre><br />
<br />
===== 266MHz时钟 =====<br />
<br />
You can re-configure the [[S3C2410]] PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using<br />
GTA01Bv2 # s3c2410 speed set 266 <br />
and<br />
GTA01Bv2 # s3c2410 speed set 202<br />
respectively.<br />
<br />
{{warning|The current hardware (as of GTA01Bv3) only runs stable at 266MHz if you do not attach aynthing (esp. the FPC / [[Debug Board]] to the Debug Port}}<br />
<br />
==== QT2410上的TFTP ====<br />
<br />
The QT2410 cs8900a Ethernet can be used to download images via network.<br />
<br />
First, you have to make sure that ''ipaddr'', ''serverip'', ''ethaddr' and ''netmaskk'' are set correctly in the environment:<br />
<br />
<pre><br />
QT2410 # printenv<br />
ethaddr=00:01:02:03:04:05<br />
netmask=255.255.255.0<br />
ipaddr=192.168.100.100<br />
serverip=192.168.100.1<br />
</pre><br />
<br />
<br />
===== TFTP kernel download =====<br />
<br />
<pre><br />
QT2410 # tftpboot 0x32000000<br />
*** Warning: no boot file name; using 'C0A86464.img'<br />
TFTP from server 192.168.100.1; our IP address is 192.168.100.100<br />
Filename 'C0A86464.img'.<br />
Load address: 0x32000000<br />
Loading: #################################################################<br />
#################################################################<br />
#################################################################<br />
#################################################################<br />
##########################################<br />
done<br />
Bytes transferred = 1544788 (179254 hex)<br />
</pre><br />
<br />
you can then commence booting via<br />
<pre><br />
QT2410# bootm 0x32000000<br />
</pre><br />
<br />
== 设备固件升级 ==<br />
<br />
Our version of u-boot also implements [[USB DFU]].<br />
<br />
To find out whether your version of u-boot supports this, use the output of<br />
$ lsusb -v -d 1457:5119<br />
while the phone is in u-boot mode.<br />
<br />
If it supports DFU, you should see the following snippet towards the end of the output:<br />
<pre><br />
Interface Descriptor:<br />
bLength 9<br />
bDescriptorType 4<br />
bInterfaceNumber 2<br />
bAlternateSetting 0<br />
bNumEndpoints 0<br />
bInterfaceClass 254 Application Specific Interface<br />
bInterfaceSubClass 1 Device Firmware Update<br />
bInterfaceProtocol 1 <br />
iInterface 0 <br />
</pre><br />
<br />
关于如何进行固件升级的信息,请看[[dfu-util/zh_cn|dfu-util]]。<br />
<br />
{{Languages|Bootloader}}<br />
<br />
[[Category:Software]]</div>Sunlt