BeagleBoard-xM – TI版gingerbreadを動かしてみる。

BeagleBoard-xMでTI DevKit版のgingerbreadを動かすメモ。

ドキュメント

等を参照。

前提

  • BeagleBoard-xMはRev.B(最近Rev.Cなんてのがあるらしく、すこし手間が必要らしい。)
  • 作業はrootで行う。
  • SDカードは「BeagleBoard-xM – Android用SDカードの作成。」で作成したものを使用する。(SDカードは予めビルド環境にセットしておく。)
  • 「TI OMAP35xx/37xx Android Graphics SDK」は予め適用されているようなので、作業には含めない。
    ※See also 「/root/gingerbread1.0/hardware/ti/sgx/ANDROID_RN_4_03_00_01.txt 」 

    * Support for SGX core revisions 1.2.5 (3730 ES5.0), 1.2.1 (3530 ES3.0), and 1.0.3 (3530 ES2.0)
    * Updated IMG DDK version 1.5, that has improved Vector Graphics performance
    * Support for AM389x with 2.6.37 Kernel on Gingerbread.

ツールの取得

下記を実行する。

# mkdir /root/bin
# curl http://android.git.kernel.org/repo >/root/bin/repo
# chmod a+x /root/bin/repo

リポジトリの取得

下記を実行して作業用ディレクトリの作成し、リポジトリ情報を取得する。

# mkdir /root/gingerbread1.0
# cd /root/gingerbread1.0
# /root/bin/repo init -u git://gitorious.org/rowboat/manifest.git -m TI-Android-GingerBread-2.3-DevKit-1.0.xml

上記実行後ユーザ名とメールアドレスを質問される。

Your Name  [root]: ユーザ名
Your Email [root@virtual-machine.(none)]: メールアドレス

入力内容を確認されるので

Your identity is: ユーザ名 <メールアドレス>
is this correct [y/n]? y

間違いがなければ「y」を入力する。

次に端末のカラー表示を確認される。

Testing colorized output (for 'repo diff', 'repo status'):
black    red      green    yellow   blue     magenta   cyan     white
bold     dim      ul       reverse
Enable color display in this user account (y/n)? y

カラー表示に問題がなければ「y」を入力する。

repo initialized in /root/gingerbread1.0

と表示されてリポジトリの初期化が終わったら、リポジトリを取得する。

# /root/bin/repo sync

かなりの時間を要するので我慢して待つ。

toolchainの設定

toolchainとはクロスコンパイルの環境。TIのリポジトリを使用する場合は予め

/root/gingerbread1.0/prebuilt/linux-x86/toolchain

にtoolchainが用意されているので、これを使用する。GingerBread-2.3-DevKit-1.0では

  • arm-eabi-4.2.1
  • arm-eabi-4.3.1
  • arm-eabi-4.4.0
  • arm-eabi-4.4.3
  • i686-unknown-linux-gnu-4.2.1
  • sh-4.3.3

が用意されている。

当環境では”arm-eabi-4.4.3″を使用するとMLO(x-loader)のビルドに失敗するため、”arm-eabi-4.4.0″を使用することにした。

※但し、現時点で自環境でビルドしたMLO・u-boot.binでは起動出来ていない。

toolchainを設定するには環境変数「PATH」にtoolchainのパスを追加設定する。

# export PATH=/root/gingerbread1.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH

ちなみに、上記設定後にtoolchainを変更したい場合は上書きしてしまえばいい。

# export PATH=/root/gingerbread1.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

MLO(x-loader)のビルド

上記理由で使用しないが、一応手順だけ。

# cd /root/gingerbread1.0/x-load-omap3
# make CROSS_COMPILE=arm-eabi- distclean
# make CROSS_COMPILE=arm-eabi- omap3beagle_config
# make CROSS_COMPILE=arm-eabi-

出来上がったx-loader.binは”signGP”コマンドを使用して調整する必要がある。

“signGP”コマンドは

# wget http://beagleboard.googlecode.com/files/signGP

を実行して入手した後に

# chmod +x signGP

として実行権を付与、

# ./signGP x-load.bin
# mv x-load.bin.ift MLO

を実行して”MLO”ファイルを作成する。

u-bootのビルド

MLO同様手順だけ。

# cd /root/gingerbread1.0/u-boot-omap3
# make CROSS_COMPILE=arm-eabi- distclean
# make CROSS_COMPILE=arm-eabi- omap3_beagle_config
# make CROSS_COMPILE=arm-eabi-

上記手順で”u-boot.bin”が作成される。

ブート用スクリプトファイルの作成

起動時のパラメータを自動で与えるためのファイル”boot.scr”を作成する。

まず、vi等でboot.scriptというファイル新規作成する。場所はどこに作成しても構わないが、今回は/root/imagesに作成する事とした。

# cd /root/images
# vi boot.script

内容は

mmc init
fatload mmc 1 80200000 uImage
setenv bootargs 'console=ttyS2,115200n8 mpurate=1000 androidboot.console=ttyS2 buddy=none mem=512M vram=16M omapfb.vram=0:8M,1:4M,2:4M omapfb.mode=dvi:1360x768MR-16@60 omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init omap_vout.vid1_static_vrfb_alloc=y'
bootm 0x80200000

とした。

omapfb.mode=dvi:1360x768MR-16@60

の赤文字部分は解像度の指定。当環境では”1360×768″にしないとモニタへの表示がされなかった。

上記内容でファイルを作成したら、下記を実行する。

# mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "BeagleBoard" -d boot.script boot.scr

“boot.scr”ファイルが作成されるので

# cp boot.scr /media/boot/.

を実行してSDカードにコピーする。

カーネル(uImage)のビルド

下記手順でビルド。

# cd /root/gingerbread1.0/kernel
# make CROSS_COMPILE=arm-eabi- distclean
# make CROSS_COMPILE=arm-eabi- omap3_beagle_android_defconfig
# make CROSS_COMPILE=arm-eabi- uImage

“uImage”は

/root/gingerbread1.0/kernel/arch/arm/boot

に作成されているので

# cd arch/arm/boot
# cp uImage /media/boot/.

を実行してSDカードにコピーする。

アンドロイド・ファイルシステム(rootfs)のビルド

下記手順でビルド。

# cd /root/gingerbread1.0
# make TARGET_PRODUCT=beagleboard OMAPES=5.x -j2

“rootfs”は

/root/gingerbread1.0/out/target/product/beagleboard

に作成されているので

# cd out/target/product/beagleboard
# cp -a ./root/* /media/rootfs/.
# cp -a ./system/* /media/rootfs/system/.

を実行してSDカードにコピーする。

最後に

SDカードを

# sync
# umount /media/boot
# umount /media/rootfs
# umount /media/data

を実行した後に取り外し、BeagleBoard-xMへ装着して確認。

正常にビルドできていれば、

のようにgingerbreadが起動するはず。

ちなみに端末情報は

こんな感じ。

起動時のログは

Texas Instruments X-Loader 1.4.4ss (Aug 19 2010 - 02:49:27)
Beagle xM Rev A
Reading boot sector
Loading u-boot.bin from mmc

U-Boot 2010.03-dirty (Aug 20 2010 - 20:50:46)

OMAP3630/3730-GP ES2.0, CPU-OPP2, L3-165MHz,
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
DRAM:  512 MB
NAND:  0 MiB
*** Warning - bad CRC or NAND, using default environment

In:    serial
Out:   serial
Err:   serial

Probing for expansion boards, if none are connected you'll see a harmless I2C error.

No EEPROM on expansion board
Beagle xM Rev A
Die ID #61da00011ff00000015739eb09017009
Hit any key to stop autoboot:  3  2  1  0
mmc1 is available
The user button is currently NOT pressed.
reading boot.scr

416 bytes read
Running bootscript from mmc ...
## Executing script at 80200000
mmc1 is available
reading uImage

2618036 bytes read
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   Linux-2.6.32
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2617972 Bytes =  2.5 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux................................................................................................................................................................... done, booting the kernel.
Linux version 2.6.32 (root@ubuntux64) (gcc version 4.4.0 (GCC) ) #1 Sat Apr 30 04:50:19 JST 2011
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP3 Beagle Board
Memory policy: ECC disabled, Data cache writeback
OMAP3630/DM3730 ES1.0 (l2cache iva sgx neon isp 192mhz_clk )
SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x100000
Reserving 16777216 bytes SDRAM for VRAM
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyS2,115200n8 mpurate=1000 androidboot.console=ttyS2 buddy=none mem=512M vram=16M omapfb.vram=0:8M,1:4M,2:4M omapfb.mode=dvi:1360x768MR-16@60 omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init omap_vout.vid1_static_vrfb_alloc=y
Beagle expansionboard: none
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 497536KB available (4532K code, 825K data, 172K init, 0K highmem)
Hierarchical RCU implementation.
NR_IRQS:402
Clocking rate (Crystal/Core/MPU): 26.0/332/600 MHz
Reprogramming SDRC clock to 332000000 Hz
GPMC revision 5.0
IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
Total of 96 interrupts on 1 active controller
OMAP GPIO hardware version 2.5
OMAP clockevent source: GPTIMER12 at 32768 Hz
Console: colour dummy device 80x30
Calibrating delay loop... 524.12 BogoMIPS (lpj=2048000)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
Found NAND on CS0
Registering NAND on CS0
Unable to get DVI reset GPIO
Target VDD1 OPP = 4, VDD2 OPP = 2
OMAP DMA hardware revision 5.0
bio: create slab  at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c_omap i2c_omap.1: bus 1 rev4.0 at 2600 kHz
twl4030: PIH (irq 7) chaining IRQs 368..375
twl4030: power (irq 373) chaining IRQs 376..383
twl4030: gpio (irq 368) chaining IRQs 384..401
regulator: VUSB1V5: 1500 mV normal standby
regulator: VUSB1V8: 1800 mV normal standby
regulator: VUSB3V1: 3100 mV normal standby
twl4030_usb twl4030_usb: Initialized TWL4030 USB module
regulator: VMMC1: 1850 <--> 3150 mV normal standby
regulator: VDAC: 1800 mV normal standby
regulator: VPLL2: 1800 mV normal standby
regulator: VSIM: 1800 <--> 3000 mV normal standby
regulator: VAUX3: 1800 mV normal standby
regulator: VAUX4: 1800 mV normal standby
i2c_omap i2c_omap.2: bus 2 rev4.0 at 400 kHz
i2c_omap i2c_omap.3: bus 3 rev4.0 at 100 kHz
Switching to clocksource 32k_counter
musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0
musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
omap-iommu omap-iommu.0: isp registered
NetWinder Floating Point Emulator V0.97 (double precision)
ashmem: initialized
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
JFFS2 version 2.2. (NAND) c 2001-2006 Red Hat, Inc.
yaffs Apr 30 2011 04:46:37 Installing.
msgmni has been set to 972
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
OMAP DSS rev 2.0
OMAP DISPC rev 3.0
OMAP VENC rev 2
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 72) is a ST16654
serial8250.1: ttyS1 at MMIO 0x4806c000 (irq = 73) is a ST16654
serial8250.2: ttyS2 at MMIO 0x49020000 (irq = 74) is a ST16654
console [ttyS2] enabled
brd: module loaded
loop: module loaded
usbcore: registered new interface driver asix
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver cdc_eem
usbcore: registered new interface driver dm9601
usbcore: registered new interface driver smsc95xx
usbcore: registered new interface driver gl620a
usbcore: registered new interface driver net1080
usbcore: registered new interface driver plusb
usbcore: registered new interface driver rndis_host
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver MOSCHIP usb-ethernet driver
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
android init
android_probe pdata: c04d153c
android_bind
android_usb gadget: android_usb ready
musb_hdrc musb_hdrc: MUSB HDRC host driver
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
f_adb init
android_register_function adb
adb_bind_config
f_mass_storage init
android_register_function usb_mass_storage
mice: PS/2 mouse device common for all mice
input: gpio-keys as /devices/platform/gpio-keys/input/input0
i2c /dev entries driver
Linux video capture interface: v2.00
mt9v113 2-003c: Registered to v4l2 master omap34xxcam!!
omap-iommu omap-iommu.0: isp: version 1.1
OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
mmci-omap-hs mmci-omap-hs.1: err -16 configuring card detect
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
logger: created 64K log 'log_system'
Advanced Linux Sound Architecture Driver Version 1.0.21.
usbcore: registered new interface driver snd-usb-audio
usb 1-2: new high speed USB device using ehci-omap and address 2
No device for DAI omap-mcbsp-dai-0
No device for DAI omap-mcbsp-dai-1
No device for DAI omap-mcbsp-dai-2
No device for DAI omap-mcbsp-dai-3
No device for DAI omap-mcbsp-dai-4
OMAP3 Beagle SoC init
asoc: twl4030 <-> omap-mcbsp-dai-0 mapping ok
ALSA device list:
  #0: omap3beagle (twl4030)
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
Power Management for TI OMAP3.
Unable to set L3 frequency (400000000)
Switched to new clocking rate (Crystal/Core/MPU): 26.0/332/1000 MHz
IVA2 clocking rate: 800 MHz
SmartReflex driver initialized
omap3beaglelmb: Driver registration complete
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
fbcvt: Aspect ratio not CVT standard
fbcvt: 1360x768@60: CVT Name - Not a CVT standard - 1.044 Mega Pixel Image

regulator_init_complete: incomplete constraints, leaving VAUX3 on
regulator_init_complete: incomplete constraints, leaving VDVI on
regulator_init_complete: incomplete constraints, leaving VDAC on
hub 1-2:1.0: USB hub found
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
hub 1-2:1.0: 5 ports detected
mt9v113 2-003c: chip id mismatch read 0x0,				 expecting 0x2280
mt9v113 2-003c: Unable to detect decoder
mt9v113 2-003c: chip id mismatch read 0x0,				 expecting 0x2280
mt9v113 2-003c: Unable to detect decoder
mt9v113 2-003c: chip id mismatch read 0x0,				 expecting 0x2280
mt9v113 2-003c: Unable to detect decoder
mt9v113 2-003c: chip id mismatch read 0x0,				 expecting 0x2280
mt9v113 2-003c: Unable to detect decoder
omapdss DPI error: display already enabled
omap_vout omap_vout: 'dvi' Display already enabled
omapdss DPI error: display already enabled
omap_vout omap_vout: 'dvi' Display already enabled
omap_vout omap_vout: Buffer Size = 3686400
omap_vout omap_vout: : registered and initialized video device 0
omap_vout omap_vout: Buffer Size = 3686400
omap_vout omap_vout: : registered and initialized video device 1
Waiting 1sec before mounting root device...
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU08G 7.40 GiB
 mmcblk0: p1 p2 p3
usb 1-2.1: new high speed USB device using ehci-omap and address 3
smsc95xx v1.0.4
usb0: register 'smsc95xx' at usb-ehci-omap.0-2.1, smsc95xx USB 2.0 Ethernet, b6:2e:89:e0:c1:2c
usb 1-2.2: new low speed USB device using ehci-omap and address 4
input: HID 04f3:0103 as /devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/input/input1
generic-usb 0003:04F3:0103.0001: input: USB HID v1.10 Keyboard [HID 04f3:0103] on usb-ehci-omap.0-2.2/input0
input: HID 04f3:0103 as /devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.1/input/input2
generic-usb 0003:04F3:0103.0002: input: USB HID v1.10 Device [HID 04f3:0103] on usb-ehci-omap.0-2.2/input1
usb 1-2.4: new low speed USB device using ehci-omap and address 5
input: PIXART USB OPTICAL MOUSE as /devices/platform/ehci-omap.0/usb1/1-2/1-2.4/1-2.4:1.0/input/input3
generic-usb 0003:093A:2510.0003: input: USB HID v1.11 Mouse [PIXART USB OPTICAL MOUSE] on usb-ehci-omap.0-2.4/input0
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
Freeing init memory: 172K
Warning: unable to open an initial console.
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
# enabling adb
adb_open
warning: `zygote' uses 32-bit capabilities (legacy support in use)
alarm_set_rtc: no RTC, time will be lost on reboot
request_suspend_state: wakeup (3->0) at 33894226077 (1970-01-02 00:00:11.894317627 UTC)
binder: release 1061:1061 transaction 1061 out, still active
binder: 929:944 transaction failed 29189, size 14448-0
binder: send failed reply for transaction 1061, target dead
init: sys_prop: permission denied uid:1000  name:user.language
init: sys_prop: permission denied uid:1000  name:user.region
request_suspend_state: sleep (0->3) at 372469207769 (1970-01-02 00:05:50.469299319 UTC)
PM: Syncing filesystems ... done.
Freezing user space processes ...
Freezing of tasks aborted after 0.00 seconds (280 tasks refusing to freeze):

ちなみに自ビルドなMLO・u-bootで起動した場合は

Texas Instruments X-Loader 1.47 (Apr 30 2011 - 04:32:09)
Unsupported Chip!
Beagle xM Rev A
Starting X-loader on MMC
Reading boot sector

208660 Bytes Read from MMC
Starting OS Bootloader from MMC...
Starting OS Bootloader...

U-Boot 2010.06 (Apr 30 2011 - 04:32:58)

OMAP34xx/35xx-GP ES2.0, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
DRAM:  384 MiB
NAND:  0 MiB
*** Warning - bad CRC or NAND, using default environment

In:    serial
Out:   serial
Err:   serial
Beagle xM Rev A
Die ID #61da00011ff00000015739eb09017009
Hit any key to stop autoboot: 10  9  8  7  6  5  4  3  2  1  0
mmc1 is available
reading boot.scr

416 bytes read
Running bootscript from mmc ...
## Executing script at 82000000
mmc1 is available
reading uImage

2618036 bytes read
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   Linux-2.6.32
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2617972 Bytes = 2.5 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux................................................................................................................................................................... done, booting the kernel.

となる。


コメント

タイトルとURLをコピーしました