zoukankan      html  css  js  c++  java
  • fastboot 烧写内核

    夏新N80手机,很久没用,今天想试试自己的kernel性能,插上进不了串口,问人才知道OBM关了开机进入串口模式,得开机时按下 向下键才能进入串口模式,而且N80的bug,还不能插上串口开机,
    不如试试fastboot 烧 kernel记录如下,防止忘记:
    先下载fastboot工具放在桌面上,然后:
    b186@b186-desktop:~/桌面$ sudo ./fastboot erase boot
    sudo: ./fastboot: command not found
    b186@b186-desktop:~/桌面$ chmod +x fastboot
    b186@b186-desktop:~/桌面$ sudo ./fastboot erase boot
    < waiting for device >
    erasing 'boot'... OKAY
    b186@b186-desktop:~/桌面$ sudo ./fastboot flash boot ~/svn/lnx2632pxa/arch/arm/boot/zImage
    sending 'boot' (1916 KB)... OKAY
    writing 'boot'... OKAY
    b186@b186-desktop:~/桌面$ sudo ./fastboot reboot
    rebooting... 

    顺便贴点公司共享服务器上的其他相关:

    Uboot and Fastboot commands

    From $1

    Table of contents
    No headers

    erase command

    command [offset] [size]
    nand erase 0x920000 0x280000
    onenand erase 0x920000 0x280000

    write command

    command [ddr address] [offset] [size]
    nand write 0x1000000 0x920000 0x280000
    onenand write 0x1000000 0x920000 0x280000

    read command

    command [ddr address] [offset] [size]
    nand read 0x1000000 0xa40000 0x80000
    onenand read 0x1000000 0xa40000 0x80000

    Common commands

    TTC_DKB>> tftp zImage
    TTC_DKB>> w -k               // burn kernel
    TTC_DKB>> tftp uboot
    TTC_DKB>> w -u               // burn uboot
    TTC_DKB>> tftp ramdisk
    TTC_DKB>> nw_ramdisk -n //burn normal ramdisk
    TTC_DKB>> nw_ramdisk  -r //burn recovery ramdisk
    TTC_DKB>> nw_ramdisk  w 0x100000  //burn ramdisk to a special address

    Fastboot burn image

    1. download the attachment
    2. enter uboot, input command "fb" to enable fastboot function.
       TTC_DKB>> fb

    3. Input these commands on PC to burn image,

    sudo ./fastboot burn [image name] [-z {raw image}|-y {yaffs}] [offset in NAND]
    sudo ./fastboot burn erase 0x920000 0x280000   //earse zImage
    sudo ./fastboot burn zImage -z 0x920000 //burn zImage

    if ramdisk.img size is 512K, we can use following command to burn ramdisk.
    sudo ./fastboot burn erase 0xba0000 0x80000   //earse ramdisk
    sudo ./fastboot burn ramdisk_len.img -z 0xba0000 //burn ramdisk


    sudo ./fastboot erase system   //erase system
    sudo ./fastboot flash system system.img  //burn system
    sudo ./fastboot burn system.img -y 0xf20000 //burn system
    sudo ./fastboot erase opl      //erase opl
    sudo ./fastboot flash opl opl.img    //burn opl
    sudo ./fastboot burn opl.img -y 0xcf20000 //burn opl
    sudo ./fastboot erase userdata   //erase userdata
    sudo ./fastboot flash userdata userdata.img   //erase userdata
    sudo ./fastboot burn userdata.img -y 0x118a0000 //burn userdata

    sudo fastboot burn erase 0x120000  0x800000 //erase the whole cp
    sudo fastboot burn Arbel.bin -z 0x120000  //flash the arbel
    sudo fastboot burn TTC1_M06_AI_A0_Flash.bin  -z 0x820000 //TTC

    Total command

    sudo fastboot burn erase 0x920000 0x280000 ; sudo fastboot burn zImage -z 0x920000;sudo fastboot burn erase 0xba0000 0x80000 ;sudo fastboot burn ramdisk_len.img -z 0xba0000;sudo fastboot erase system;sudo fastboot burn system.img -y 0xf20000;sudo fastboot erase opl;sudo fastboot burn opl.img -y 0xcf20000;sudo fastboot erase userdata;sudo fastboot burn userdata.img -y 0x118a0000;sudo fastboot burn erase 0x120000  0x800000;sudo fastboot burn Arbel.bin -z 0x120000;sudo fastboot burn TTC1_M06_AI_A0_Flash.bin  -z 0x820000;sudo fastboot reboot;

    Fastboot HowTO (JIL: QCOM)

    From $1

    Table of contents
    No headers

    What is fastboot?
    Fastboot is protocol used to update the flash filesystem in Android devices from a host over USB. It allows flashing of unsigned partition images.
    =================================================================
    File structrues of JIL fastboot(beta2 only):
    .
    |-- Makefile
    |-- README
    |-- legacy
    |   |-- README
    |   |-- arch_qsd8k
    |   |   |-- Makefile
    |   |   |-- clock.c              //set up the ARM core clock(to 998MHz)
    |   |   |-- gpio.c               //gpio-setting functions
    |   |   |-- hsusb.c              //usb controler driver.
    |   |   |-- lcdc.c               //***LCDC driver, set the reslustion&color bit. (check the marcos)
    |   |   |-- logo.h               //***define the logo in BMP format.
    |   |   |-- mddi.c               //***MDDI driver, set the reslustion&color bit. (check mddi_set_caps())
    |   |   |-- mddi_console.c       //console driver to display information on LCD during boot. call mddi_init() to initialize/config the panel/LCDC.
    |   |   |-- nand.c               //***nand driver.
    |   |   |-- shared.c             //share memory driver.
    |   |   |-- smem.c               //share memory driver.
    |   |   |-- uart.c               //uart driver.
    |   |   `-- vic.c                //define the functions used to config the ISR.
    |   |-- fastboot_protocol.txt
    |   |-- include
    |   |   |-- boot
    |   |   |   |-- arm.h
    |   |   |   |-- board.h
    |   |   |   |-- boot.h
    |   |   |   |-- bootimg.h
    |   |   |   |-- flash.h
    |   |   |   |-- font5x12.h
    |   |   |   |-- gpio.h
    |   |   |   |-- gpio_keypad.h
    |   |   |   |-- tags.h
    |   |   |   |-- uart.h
    |   |   |   |-- usb.h
    |   |   |   `-- usb_descriptors.h
    |   |   `-- qsd8k
    |   |       |-- dmov.h
    |   |       |-- gpio.h
    |   |       |-- gpt.h
    |   |       |-- hsusb.h
    |   |       |-- irqs.h
    |   |       |-- lcdc.h
    |   |       |-- mddi.h
    |   |       |-- mdp.h
    |   |       |-- nand.h
    |   |       |-- shared.h
    |   |       |-- uart.h
    |   |       `-- vic.h
    |   |-- libboot                             //helper functions used to bootup the phone.
    |   |   |-- Makefile
    |   |   |-- flash.c                         //handle patition info.
    |   |   |-- gpio_keypad.c                   //implement keypad polling/initial logic.
    |   |   |-- init.c                         
    |   |   |-- poll.c                          //init poll framwork.
    |   |   |-- tags.c                          // handle the tags SENT to bootloader
    |   |   |-- tags_cmdline.c                 
    |   |   |-- tags_partition.c
    |   |   |-- tags_revision.c
    |   |   `-- tags_serialno.c
    |   |-- libc                                //common usage lib. HW independent.
    |   |   |-- Makefile
    |   |   |-- cprintf.c
    |   |   |-- crypto.c
    |   |   |-- dprintf.c
    |   |   |-- inttypes.h
    |   |   |-- libc_private.h
    |   |   |-- malloc.c
    |   |   |-- memcmp.c
    |   |   |-- memcpy.c
    |   |   |-- memset.c
    |   |   |-- rsa.c
    |   |   |-- rsa.h
    |   |   |-- sha.c
    |   |   |-- sha.h
    |   |   |-- sprintf.c
    |   |   |-- strcmp.c
    |   |   |-- strcpy.c
    |   |   |-- strlen.c
    |   |   |-- strstr.c
    |   |   `-- xprintf.c
    |   `-- usbloader
    |       |-- Makefile
    |       |-- init.S                           //the entry of bootloader, setup the ARM core then jump to main.c 
    |       |-- main.c                           //initialize the GPIO, keypad, LCD, NAND and USB etc. control flash SW/load kernel+ramdisk.
    |       |-- usbl_off_chg.c
    |       `-- usbloader.c                      //implement the fastboot protocol.
    |-- setup.sh                                 //setup the building environment. run it before start new build.
    |-- tools
    |   `-- mkbootimg                            //tool used to generate the boot.img which is consist of hearder, zImage, and ramdisk.
    |       |-- Android.mk
    |       |-- bootimg.h
    |       `-- mkbootimg.c
    `-- vendor
        |-- qcom
        |   |-- qsd8250_bigcreek
        |       `-- boot
        |           |-- Makefile
        |           |-- board.c                  //***define partitions, default cmdline, and enable the URAT. depand on HW.
        |           |-- boot.ld
        |           |-- keypad.c                 //***GPIO configuration/mapping for keypad, depand on HW.
        |           |-- panel.c                  //***initialize the panal. FEATURE_BCK_COMMON for LCDC, FEATURE_DH970V_FIH for MDDI. lcdc_samsung_320x480_init_table[] is current setting.
        |           |-- tests
        |           |   |-- irqtest.c
        |           |   `-- timertest.c
        |           `-- tools
        |               `-- mkheader.c           //the bootloader have an 40-bytes header used to save the meta data. this is the generator.
        `-- qcom-proprietary
            `-- hardware
                `-- scorpion                     //these files are used to setup up the ARM A8 core, and we can get them from Qualcomm release.
                    |-- sc_sa_fuse_ro.S
                    |-- scorpion_armv7_macros_gas.h
                    `-- scorpion_sysini_gas.h
    =======================================================================================
    How to change the partition setting:
    change vendor/qcom/qsd8250_bigcreek/boot/board.c :: PTABLE[].
    =====================================================
    How to support new panel(LCDC):
    1.reslustion&color:
        change marcos definition in legacy/arch_qsd8k/lcdc.c ::
        LCDC_FB_PHYS
        LCDC_FB_BPP

        LCDC_FB_WIDTH
        LCDC_FB_HEIGHT

        LCDC_HSYNC_PULSE_WIDTH_DCLK
        LCDC_HSYNC_BACK_PORCH_DCLK
        LCDC_HSYNC_FRONT_PORCH_DCLK
        LCDC_HSYNC_SKEW_DCLK

        LCDC_VSYNC_PULSE_WIDTH_LINES
        LCDC_VSYNC_BACK_PORCH_LINES
        LCDC_VSYNC_FRONT_PORCH_LINES
    2.panel setting:
        create new init_table[]
    ======================================================
    How to support new nand:
    add new entry in legacy/arch_qsd8k/nand.c :: supported_flash[].
    =====================================================
    How to change the key used to enter the flash mode:
    change vars in vendor/qcom/qsd8250_bigcreek/boot/keypad.c ::
        halibut_row_gpios[]
        halibut_col_gpios[]
        halibut_key_map[]
    ====================================================
    How to support flashing new added partition:
    change legacy/usbloader/usbloader.c ::
    static void usb_rx_cmd_complete(struct usb_request *req, unsigned actual, int status)
    {
    ..........
    #ifdef BIGCREEK_QSD8K
            if (rx_length > (128*1024*1024)) {   //change the "128" to the bigest image size
    #else
    ......... 
            if(!strcmp(ptn->name,"system") || !strcmp(ptn->name,"userdata") ||
               !strcmp(ptn->name,"opl")    || !strcmp(ptn->name,"local")    ||
               !strcmp(ptn->name,"cache")) {     //add new partitions image name to here if they are yaffs2 images.
                extra = 64;
            } else {
    .........
    }
    ===================================================
    Known issue:
    Some buffers(frame buffer .etc) use fixed address which may overlape with other(usb buffer .etc) then cause issues.
    =======================================================================

    ****************************************************************************************************************************

    Fastboot usage:

    1) HowTO create boot.img:
    ==============================
    ./mkbootimg --kernel zImage-borqs --ramdisk ramdisk.img -o boot.img

    2) HowTO flash:
    ==============================

    i) Press power key + home key enter fastboot mode.

    ii) Connect to PC via USB cable and flash mobile using below commands:
    sudo ./fastboot flash boot boot.img
    sudo ./fastboot flash system system.img
    sudo ./fastboot flash opl opl.img

    Log (mobile station side):

    ========================

    USB FastBoot:  V0.5
    Machine ID:    1008000 v0
    Build Date:    Jun 30 2009, 09:20:37
    ...
    boot_from_flash: 0
    usb: online (highspeed)                <-- waiting for command/data from PC

    > download:05bd2500                 <-- downloading
    recv data addr=16008000 size=05bd2500

    > flash:system                               <-- flashing
    writing 96281856 bytes to 'system'
    writing 'system' (96281856 bytes)skipping @ 753 (bad block)
    flash_write_image: bad block @ 753
    flash_write_image: success
    partition 'system' updated
     - OKAY

    Log (PC side):

    ========================

    [leohe@4Q49B2X:~/work/device/kernel/branches/test/tiger]$ sudo ../fastboot flash system system-new.img
    < waiting for device >
    sending 'system' (93984 KB)... OKAY
    writing 'system'... OKAY
    [leohe@4Q49B2X:~/work/device/kernel/branches/test/tiger]$ sudo ../fastboot flash opl opl.img
    < waiting for device >
    sending 'opl' (47150 KB)... OKAY
    writing 'opl'... OKAY
    天不会黑
  • 相关阅读:
    [转]Spring Cloud在国内中小型公司能用起来吗?
    [转]关于maven pom.xml中dependency type 为pom的应用
    如何直接在github网站上更新你fork的repo?
    Eclipse在Tomcat环境下运行项目出现NoClassDefFoundError/ClassNotFoundException解决办法
    Jquery mobile 中在列表项上使用单选按钮
    QBus 关注并推送实时公交信息
    常用序列号
    SVN 使用锁实现独占式签出
    SQL速记
    利用交通在手数据为换乘添加关注
  • 原文地址:https://www.cnblogs.com/yuanfang/p/1939910.html
Copyright © 2011-2022 走看看