0% found this document useful (0 votes)
56 views

Fastboot

This document describes supporting fastboot mode on an Android platform. It discusses: - Fastboot allows flashing images to the phone faster than normal booting. It abstracts hardware details. - The feature detects if the phone should boot into fastboot mode via key presses or reboot commands. It resets the USB and configures the driver for fastboot. - It reads commands from the host, responds with data, and uses storage interfaces to flash/erase from storage. Optional LCD output indicates fastboot mode.

Uploaded by

Meenali Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Fastboot

This document describes supporting fastboot mode on an Android platform. It discusses: - Fastboot allows flashing images to the phone faster than normal booting. It abstracts hardware details. - The feature detects if the phone should boot into fastboot mode via key presses or reboot commands. It resets the USB and configures the driver for fastboot. - It reads commands from the host, responds with data, and uses storage interfaces to flash/erase from storage. Optional LCD output indicates fastboot mode.

Uploaded by

Meenali Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

FEATURE_SLB_FASTBOOT_SUPPORT

INTEL CONFIDENTIAL, FOR INTERNAL USE ONLY


Requirement

• XMM6321 is Android platform

• Most Android Phone are support fastboot


• Fastboot speeds up your development, NOT the time it takes
to boot. It is the method that Android uses to flash image to
the phone.
• Fastboot abstracts the details of memory type, error
correction code used, etc, so the user doesn’t need to know
them.

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Configuration

Feature is apply to
• Virtualized Android platform.
• Any other platform required this feature

Feature is not apply to:


• NON-EMMC platform

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Enable/Disable

To Enable this feature:


In config file, add below:
FEATURE += FEATURE_SLB_FASTBOOT_SUPPORT

To Disable this feature:


Remove above FEATURE in config file

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Over view
Target (SLB)

HW dependent HW independent

SLB Mode Reboot


SLB keypad driver
mangement info

SLB storage driver


Fastboot module

Fastboot
storage

LCD driver
Fastboot Logic
(optional)

Fastboot
communication

PC HOST USB driver

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Overview

• SLB mode management detect KEY event or reboot info in IRAM non-clear
area to determine if SLB need boot to fastboot mode. (Also call bootloader
mode/seconder level bootloader mode).
• User could power off the phone and hold both “Vol +” key and “Menu” key
during phone power on to enter fastboot, alternately user could issue
command “adb reboot bootloader” command to Android to trigger the phone
reboot into fastboot mode. (See SLB mode management Dspec for details)
• When the phone boot into fastboot mode, fastboot module reset USB, and
config the USB driver into fastboot devices, fastboot logic layer
receives/response commands from/to fastboot communication layer, and use
fastboot storage interface to flash/erase/read from internal EMMC.
• Optionally fastboot can put an image on LCD and let user know the phone is
booting into fastboot mode.

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
USB Enumeration

Create new configuration ”COMM_USB_CONFIG_USB_FASTBOOT”

Fastboot enumeration requires:


• Interface class = 0xFF (vendor specific)
• Interface subclass = 0x42
• Interface protocol = 0x03
 
Flashusb standard enumeration has:
• Interface class = 0x02 (communications)
• Interface subclass = 0x00
• Interface protocol = 0x00

In bootloader USB driver, for fastboot USB driver enumeration case, we should keep
waiting until the enumeration success.

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
USB

• Read unkown size data


Host sends a command, which is an ascii string in a single packet no greater than 64
bytes.

In case of USB_HW_S_RX_LAST_PACKET, for USB fastboot driver, we


should skip the size comparation and directly use ”call-back” to inform
the caller the fastboot command has been received and report the
received size.

• Fastboot USB string descriptor


When user type fastboot devices in command line, the fastboot tool will request the USB
string descriptor -> USB_Serial_Product and show to the user.
Normally this string should be an unique number, in XMM6321, we are using IMEI number.

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
getvar: version-bootloader

Get version of bootloader, should return SLB version string.

HOST TARGET

getvar:version-bootloader

OKAY1336.100_M1S1

   C:\>fastboot getvar version-bootloader


 version-bootloader: 1336.100_M1S1
 finished. total time: 0.014s

Wireless Platform R&D


INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Fastboot commands

  getvar: version
Get version of fastboot protocol supported. Should return “0.4”

getvar: product
Get product string, return XMMxxxx string.

reboot
Reboot phone into normal mode

reboot-booloader
Reboot phone into fastboot mode

Wireless Platform R&D


0 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
getvar: secure

Get security state of bootloader. We should return “yes” if


device is OEM unlock and “no” if it is not.

HOST TARGET

getvar:secure Is_secure?

OKAYYES
OKAYNO
 

Wireless Platform R&D


1 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Oem unlock

Unlock bootloader.
This command is implemented by many handset vendors and in essence it
opens the device for unsigned images and thus community development use.
At the same time there is a requirement that all access to secure storage is
prevented. (Refer to XMM6321_fastboot_oem_unlock_concept.doc for details)

Content Check, locked state Check, unlocked state


PSI YES YES
SLB YES YES
Modem stack YES YES
Modem DSP firmware YES YES
Virtualizer YES YES
Virtualized linux kernel + YES NO
normal mode initrd
Native recovery kernel + YES NO
recovery mode initrd
System partition NO (not possible) NO
Userdata partition NO NO
Cache partition NO NO
 
Wireless Platform R&D
2 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Oem unlock

HOST TARGET
 

oem unlock

INFO Unlocking the bootloader means the following:


INFO All user data will be deleted
INFO Any securely stored data will be inaccessible
INFO Warranty will be void
INFO After unlocking you have to execute
INFO > fastboot format userdata
INFO > fastboot format cache
INFO or carry out a factory reset from recovery
INFO To confirm the unlock, please execute the command
INFO > fastboot oem unlock confirm
OKAY

Wireless Platform R&D


3 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Oem unlock
 C:\>fastboot oem unlock
 ...
   (bootloader) Unlocking the bootloader means the following:
 (bootloader) All user data will be deleted
 (bootloader) Any securely stored data will be inaccessible
 (bootloader) Warranty will be void
 (bootloader) After unlocking you have to execute
 (bootloader) > fastboot format userdata
 (bootloader) > fastboot format cache
 (bootloader) or carry out a factory reset from recovery
 (bootloader) To confirm the unlock, please execute the command
 (bootloader) > fastboot oem unlock confirm
 OKAY [ 0.110s]

Wireless Platform R&D


4 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Oem unlock confirm

  HOST TARGET

oem unlock confirm Is_recived_oem_unlock?

yes
INFO Unlocking and rebooting into unlocked state
OKAY

No
FAILPlease run oem unlock first and read instructions

Wireless Platform R&D


5 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Oem unlock confirm

 C:\>fastboot oem unlock confirm


   ...
 (bootloader) Unlocking and rebooting into unlocked state
 OKAY [ 0.021s]

 C:\>fastboot oem unlock confirm


 ...
 FAILED (remote: Please run oem unlock first and read instructions)

Wireless Platform R&D


6 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
getvar:partition-type:<partition_name>

  HOST TARGET

getvar:partition-type:system

OKAYext4

Get the partition type of <partition_name>


partition.
The partition type could be ext4 or raw

Wireless Platform R&D


7 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
<partition_name>

Content Type Partition name (in fastboot


  context)

Modem stack raw radio

Modem DSP firmware raw dsp

Virtualizer raw hypervisor

Virtualized linux kernel + raw boot


normal mode initrd

Native recovery kernel + raw recovery


recovery mode initrd

System partition Ext4 system

Userdata partition Ext4 userdata

Cache partition Ext4 cache

Wireless Platform R&D


8 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
getvar:partition-size:<partition_name>

  HOST TARGET

getvar:partition-size:system

OKAY0x1234AB

Get the size of <partition_name> partition.


Response is in hex format.

Wireless Platform R&D


9 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
erase: <partition_name>

  HOST TARGET

erase:system Do_erase

done
INFO Erasing partition: system
OKAY

Fail
FAIL Fail to erase partition: system

Wireless Platform R&D


0 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
download:<size>

HOST TARGET
 

Download:1000
INFO Ready to receive: 0x1000 size of data
DATA1000
D
a <data>
t
a
: <data>
1
0
<data>
0
0

OKAY

Wireless Platform R&D


1 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
flash: <partition_name>

HOST TARGET

Flash:system
INFO Flashing partition: system

D
a
t
a EMMC
: SYSTEM
1 Partition
0
0
0

OKAY

Wireless Platform R&D


2 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Fastboot format partition
HOST TARGET
• Some of the fastboot
Getvar:partition-type:system commands like “fastboot
Ext4 is a support OKAYext4
by format format” are consisted of a set
command
Getvar:partition-size:system of commands.
OKAY30000000
Prepare a sparse
image (ext4, size:
0x30000000)
Download:e46178 • Here take the “fastboot format
INFO Ready to receive: 0xe46178 size of data
DATA1000 system” as an example.
D <data> D
a <data> a
t t
a <data> a
OKAY

Flash:system
INFO Flashing partition: system
D
EMMC
a
SYSTEM
t
Partition
a

OKAY

Wireless Platform R&D


3 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Fastboot interfaces

typedef struct
{
FBS_BOOL_T get_security_status;
FBS_PCHAR_PT_T get_partition_type;
FBS_U32_PT_T get_partition_size;
FBS_FLASH_T flash_partition;
FBS_BOOL_T oem_unlock;
FBS_BOOL_PT_T erase_partition;

Storage FPs

Fastboot Logic

csp_fastboot_main csp_fastboot_set_storage_fp

Wireless Platform R&D


4 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Test

Test case 1:
Fastboot devices: return IMEI

Test case 2:
Fastboot gervar:* return correct value.

Test case 3:
Oem unlock

Wireless Platform R&D


5 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Test

Test case 4:
Flash XMM6321 software, let it boot,
Use ADB to put some file into cache partition.
Fastboot format cache.
The phone still can boot, and nothing in cache partition.

Test case 5:
For each partition, Erase and flash RAW binary, the phone still can
boot.

Wireless Platform R&D


6 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Test

Test case 6:
Fastboot reboot will boot to normal mode

Test case 7:
Fastboot reboot bootloader will boot to fastboot mode again

Wireless Platform R&D


7 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions
Enhancement

Now the feature is only apply on EMMC platform.

TODO:
Apply this to other flash type when we need this feature.

Wireless Platform R&D


8 INTEL CONFIDENTIAL Creating Tomorrow’s Wireless Solutions

You might also like