Beagle Board Project Hui Keji

download Beagle Board Project Hui Keji

of 15

Transcript of Beagle Board Project Hui Keji

  • 8/2/2019 Beagle Board Project Hui Keji

    1/15

    BeagleBoard Fast Boot

    Hui ChenKeji Ren

    Dec 10th, 2009

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    2/15

    Outline Motivation

    Objectives

    Hardware of BeagleBoard

    Techniques in optimizing boot time

    Boot time result

    Conclusions

    Future work

    Live demo

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    3/15

    Motivation:Why Faster Boot Time?

    Boot time definition:

    Time from turning on power to a shell

    Impact the first perception an end

    Critical to obtain a positive end us

    Save power

    elcome prompt (or a GUI).

    ser has of the product

    r experience

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    4/15

    Objectives

    Optimize software in BeagleBoard

    1. bootloader

    2. Linux Kernel

    3. user-space applications

    Achieve a 5-second fast boot time

    was about 15 seconds.

    for speed

    in BeagleBoard. Original boot time

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    5/15

    BeagleBoard Har

    OMAP 3530 Processor

    600 MHz ARM Cortex-A8 with NEO

    256MB on-chip RAM

    256MB NAND Flash

    Peripheral I/Os

    DVI-D, SD/MMC+, S-Video, USB 2.

    Stereo In/Out, RS232 Serial

    Power

    USB or 5V DC

    ware

    N

    0

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    6/15

    Serial Cable SetuWe made a customized Null Modem ca

    PC's serial port.

    ble to connect BeagleBoard to

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    7/15

    Boot Sequence

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    8/15

    Strategies Load from NAND Flash

    X-loader/u-boot loading speed in SVC3NANDs block size is 128 KB per readin

    blocks (instead of 7 blocks originally).

    Remove unnecessary initialization, i

    We modified u-boot to

    1. Embed configuration environments i

    2. Turn off Kernel CRC check

    3. Remove Kernel relocation in u-boot (

    cpu mode: NAND = 1MB, MMC = 500KB/sg. We modified x-loader to only load 2

    ntegration check and data movement

    to u-boot (instead of reading from NAND)

    skip the 64-byte header of Linux image)

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    9/15

    Reduce user response time

    1. Set bootdelay to zero in u-boot (so us

    2. Turn off serial output by passing 'quiet'

    Strategies (cont.

    Reduce code size

    We used '-Os -mthumb' flag to compile a

    user-space applications). Code size win

    Remove unnecessary functionalities

    We compiled a 1.2MB 2.6.29 Kernel with

    for our Pegasus USB Ethernet adapter.

    r can't interrupt u-boot)

    parameter to Kernel

    ll code (x-loader, u-boot, kernel and

    hands down.

    in Kernel and avoid modules

    USB, network, ext3/JFFS2 and a driver

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    10/15

    User-space optimization

    1. Build Linux rootfs from scratch. By ca

    reduced total size of rootfs to about 780

    2. Minimize init script: disable syslogd a

    Strategies (cont

    scripts.

    Choose faster file system

    Ext3 needs journal daemon whose loadi

    Instead we use Ext2.

    We didn't choose JFFS2 on NAND due

    refully tuning uclibc and busybox, we

    B without losing desired features.

    d klogd, remove unused tty and rc

    .)

    ng time varies (can be over one second).

    o the buggy Linux driver.

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    11/15

    Boot Time Result[ 0.000005] < 0.000005> Texas Instruments X-Loader 1.4.2 (De

    [ 0.003808] < 0.003803> Loading u-boot.bin from nand[ 0.228279] < 0.224471>

    [ 0.228349] < 0.000070>

    [ 0.232136] < 0.003787> U-Boot 2009.06-rc2-dirty (Dec 08 200

    [ 0.232178] < 0.000042>

    [ 0.239877] < 0.007699> OMAP3530-GP ES3.0, CPU-OPP2 L3-16

    [ 0.239932] < 0.000055> OMAP3 Beagle board + LPDDR/NAND

    [ 0.239959] < 0.000027> DRAM: 256 MB

    [ 0.251298] < 0.011339> NAND: 256 MiB

    0.259473 < 0.008175> In: serial

    BoLin

    [ 0.259526] < 0.000053> Out: serial[ 0.259545] < 0.000019> Err: serial

    [ 0.263444] < 0.003899> Board revision C

    [ 0.263485] < 0.000041> Hit any key to stop autoboot: 0

    [ 0.267380] < 0.003895>

    [ 0.271382] < 0.004002> NAND read: device 0 offset 0x280000,

    [ 1.551374] < 1.279992> 1191936 bytes read: OK

    [ 1.555640] < 0.004266> ## Booting kernel from Legacy Image[ 1.561426] < 0.005786> Loading Kernel Image ... OK

    [ 1.561455] < 0.000029> OK

    [ 1.565348] < 0.003893>

    [ 1.565392] < 0.000044> Starting kernel ...

    [ 1.565410] < 0.000018>

    [ 1.895363] < 0.329953> Uncompressing Linux.....................

    kernel.[ 2.923280] < 1.027917>

    Please press Enter to activate this console.

    $ piTotpro

    8 2009 - 23:36:42)

    - 23:47:30)

    MHz

    t time was measured by using ptx_ts script from hostx PC:

    size 0x123000

    t 80007fc0 ...

    ......................................................... done, booting the

    cocom --b 115200 -d 8 /dev/ttyS0 | ptx_ts 'Texas'l boot time from power on to terminal welcome

    mpt is 2.92 seconds without network.

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    12/15

    Boot time compo

    Loading u-boot from NAND

    Loading Kernel from NAND

    xecu on x- oa er + u- oo

    Uncompressing Kernel

    Execution (Kernel)

    Mounting Memory Card

    User-space applications

    Total

    ition

    Delay (second)

    0.22

    1.28

    .

    0.73

    0.29

    0.27

    0.07

    2.92

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    13/15

    Conclusions

    We achieved shorter boot time than we exp

    We established a website with wiki pages,

    http://code.google.com/p/swiftbeagle/

    We obtained a good understanding on

    1. BeagleBoard hardware

    2. What are required in writing a boot

    detecting machine ID and passingbootloader called S-Boot. However, d

    phase and Kernel stalls after uncompre

    3. Patching Kernel source

    4. Building a Linux rootfs from scratch

    5. Compiler optimization techniques (w

    Sourcery's latest ARM gcc compiler/libr

    ected.

    ll modified source code and binaries:

    loader (such as disabling MMU/dcache,

    TAGS to Kernel). We wrote our ownvelopment of S-Boot is still in debugging

    ssing itself.

    believe we found a defect in Code

    ry)

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    14/15

    Future Work: What Wou

    0.5 second boot can be realized by utilizing

    NAND driver, uncompressed Kernel and fas

    Delay

    Loading u-boot from NAND

    Loading Kernel from NAND

    Execution (x-loader + u-boot)

    Uncompressing Kernel

    Execution (Kernel)

    Mounting Memory Card

    User-space applications

    Total

    d Be Different?

    XIP(Execution in Place), faster

    er FS(JFFS2 on MTD).

    (second) Optimization to use

    .22 XIP/driver

    1.28 XIP/driver

    .06

    .73 uncompressed Kernel

    .29

    .27 faster FS/driver

    .07

    .42

    EE382N-4 Project

  • 8/2/2019 Beagle Board Project Hui Keji

    15/15

    Demo Time

    EE382N-4 Project