fastboot 烧写内核

摘要:
删除“根”...OKAYb186@b186-desktop:tftpramdiskTTC_DKB>nw_ ramdisk-r//burnrecoveryramdiskTTC_ DKB>输入命令“fb”以启用fastbootfunction。TTC_ DKB>

夏新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

免责声明:文章转载自《fastboot 烧写内核》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇如何将松散的dll打包进需要发布的exeBDC程序步骤下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Xamarin.Forms 学习系列之优秀UI收集

1、各种优秀UI例子 https://github.com/jsuarezruiz/xamarin-forms-goodlooking-UI 输入框例子 https://github.com/enisn/Xamarin.Forms.InputKit 浮动操作按钮  https://github.com/SuavePirate/Xamarin.Forms...

python中filter()函数

filter()函数是 Python 内置的另一个有用的高阶函数,filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 False,filter()根据判断结果自动过滤掉不符合条件的元素,返回由符合条件元素组成的新list。 例如,要从一个list [1, 4, 6, 7, 9, 12, 17]中...

32位程序调用64位函数————开源代码rewolf-wow64ext学习笔记

rewolf-wow64ext的目的就是让运行在Wow64环境中的x86应用程序可以直接调用x64下ntdll.dll中的Native API。   学习中可以得到几个结论 在X64环境下的进程,32位程序,映射了两个地址空间,一个32位,一个64位。而且这两种工作模式是可以切换的的。 WOW64进程中的R12寄存器指向其64位的TEB结构(线程环境块...

网页仿 Office 2003 的工具条

网页仿 Office 2003 的工具条   [ 日期:2005-01-27 ]   [ 来自:网上摘录 ]<html><head><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content=...

js跨域问题的解决

  js提交请求给别的应用实例或者别的服务器,由于同源策略,存在js跨域的情况,我所知道两种处理方式; 1、jquery ajax+jsonp <script type="text/javascript" src="http://t.zoukankan.com/jquery.js"></script> <script type...

intellij 代码下有小黄波浪线

在同一个工程中或模块中,写了重复的代码。 原来“在IDEA中根据设置的不同,有些代码页,当代码重复比较多时,会出现灰色或黄色的波浪线”,…… 知道原因了,解决就有办法了,设置。 在File->Settings->Editor->Code Style->Inspections->General->Duplicated Co...