Android
Android kernel for bc9 (1/2)

Setup Android bootable linux kernel and userland for bc9 (gumstix) 2

Installing file system images on onboard FlashROM

We need a serial connection with kermit and transfer system image file and kernel image file for installation.
Please refer to following instructions for serial connection setting:

Boot your gumstix, hit any key to stop the autoboot process and drop into U-Boot.

U-Boot 1.2.0 (Dec 21 2007 - 13:37:16) - PXA270@600 MHz - 1578M

*** Welcome to Gumstix ***

DRAM:  128 MB
Flash: 32 MB
Using default environment

Hit any key to stop autoboot:  0

If you successfully stop linux autoboot, you will get U-Boot prompt:

GUM>

Tell U-Boot to prepare to receive a file download at RAM location a2000000:

GUM> loadb a2000000

Break the serial connection and return to the kermit prompt by pressing Ctrl-backslash and then c.
Set up the file transfer as follows:

C-Kermit> cd ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/
C-Kermit> send gumstix-basic-image-gumstix-custom-verdex.jffs2

Then, you will see the progress of the file upload process:

C-Kermit 8.0.211, 30 Mar 2008, localhost



Current Directory: /home/beat/gumstix/gumstix-oe/tmp/deploy/glibc/images/
Communication Device: /dev/ttyUSB0
Communication Speed: 115200
Parity: none
RTT/Timeout: 01 / 02
SENDING:  => GUMSTIX-BASIC-IMAGE-GUMSTIX-CUSTOM-VERDEX.JFFS2
File Type: BINARY
File Size: 7491192
Percent Done: 2   /
...10...20...30...40...50...60...70...80...90..100
Estimated Time Left: 00:13:32
Transfer Rate, CPS: 8963
Window Slots: 1 of 1
Packet Type: D
Packet Count: 68
Packet Length: 4096
Error Count: 0
Last Error:
Last Message:


X to cancel file, Z to cancel group,  to resend last packet,

E to send Error packet, ^C to quit immediately, ^L to refresh screen.

When this process completes you will get U-Boot prompt again. Then re-establish serial connection to gumstix:

GUM> connect

Protects flash sectors 0 and 1,which contain the U-BOOT bootloader. Then erase all other sectors of FlashROM:
Please never forget bootloader protection! If you forget that, gumstix will be bricked. Please be careful.

GUM> protect on 1:0-1
GUM> erase all

Copy already transfered system image to FlashROM:

GUM> cp.b a2000000 40000 ${filesize}

{filesize} is automatically filled with variable filesize, which was set during upload process.
So type just same as above.
When you finished copy of system image, tell U-Boot to prepare to receive a file download again:

GUM> loadb a2000000

Break the serial connection and return to the kermit prompt by pressing Ctrl-backslash and then c.
Set up the file transfer as follows:

C-Kermit> send uImage-2.6.24-r1-gumstix-custom-verdex.bin

Re-establish serial connection to gumstix:

C-Kermit> connect

Install kernel image into FlashROM:

GUM> katinstall 100000

Load kernel image to memory and boot:

GUM> katload 100000
GUM> bootm

First boot after the system image installation takes rather longer.
Because jffs2 system image expansion and ssh key generation are performed during the first boot.
Normaly it boots up only in 4 or 5 seconds.

Unlike default 2.6.21 gumstix kernel, our modified 2.6.24 kernel is configured to build most drivers as modules.
It is because FlashROM kernel sector is limited only 1M byte (max kernel size must be under 1048577 bytes).
So after system image and kernel image installation, we must install kernel modules.

We use USB flash memory to copy modules into gumstix's FlashROM.
First connect USB flash memory to build machine and copy modules to it:

$ cd ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/
$ cp modules-2.6.24-r1-gumstix-custom-verdex.tgz /media/disk/

Then disconnect USB flash memory and connect it to gumstix and extract modules into gumstix.

root@gumstix-custom-verdex:~$ tar -C / -zxvf /media/hdd/modules-2.6.24-r1-gumstix-custom-verdex.tgz

Some modules are already configured to be loaded at boot.
However pxafb module is not configured, so we need to set up additional module loading as follows:

root@gumstix-custom-verdex:~$ vi /etc/modutils/pxafb

Just write pxafb in /etc/modutils/pxafb and save.

root@gumstix-custom-verdex:~$ vi /etc/modutils/fbcon

Just write fbcon in /etc/modutils/fbcon and save and:

root@gumstix-custom-verdex:~$ update-modules

Confirming kernel's Android-compliant

Confirm initialization of Android unique drivers, such as ashmem and logger, which is not included in default kernel.
Following messages should be included in bootup messages:

ashmem: initialized
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'

Confirming framebuffer drawing

Confirm that modified pxafb driver is functioning normally.
First confirm that login prompt is shown in LCD screen.
After boot, login gumstix and confirm that pxafb and fbcon are loaded by lsmod.

root@gumstix-custom-verdex:~$ lsmod
Module                  Size  Used by
i2c_dev                 6052  0 
mousedev               11528  0 
i2c_pxa                 6080  0 
ipv6                  244040  10 
vfat                    9824  0 
fat                    46076  1 vfat
nls_base                6432  2 vfat,fat
tsc2003                 7632  0 
i2c_core               18928  3 i2c_dev,i2c_pxa,tsc2003
pxamci                  6816  0 
pxafb                  11144  1 [permanent]
cfbcopyarea             2976  1 pxafb
cfbimgblt               2496  1 pxafb
cfbfillrect             3488  1 pxafb
pxa2xx_cs               3368  1 
pxa2xx_core            10368  1 pxa2xx_cs
proc_gpio               4492  0 
pcmcia                 26536  0 
pcmcia_core            30704  2 pxa2xx_core,pcmcia
firmware_class          7424  1 pcmcia
ohci_hcd               20100  0 
usbcore               122452  2 ohci_hcd
mmc_block              10244  0 
mmc_core               46260  2 pxamci,mmc_block
fbcon                  40312  65 
tileblit                2272  1 fbcon
font                    4384  1 fbcon
bitblit                 4576  1 fbcon
fbcon_rotate            2336  1 bitblit
fbcon_cw                4928  1 fbcon_rotate
fbcon_ud                5024  1 fbcon_rotate
fbcon_ccw               5120  1 fbcon_rotate
softcursor              1600  4 bitblit,fbcon_cw,fbcon_ud,fbcon_ccw
fb                     32208  8 pxafb,fbcon,tileblit,bitblit,fbcon_cw,fbcon_ud,fbcon_ccw,softcursor
evdev                   8512  0 
smc911x                18753  0 
gumstix_smc911x         2688  1 smc911x
mii                     4768  1 smc911x

If they are properly loaded, start df_dok command and confirm that it drawing patterns on LCD screen.


by Satoshi OTSUKA

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes
Last-modified: 2009-04-10 (Fri) 16:48:05 (3142d)