When we use avb, we will add the verify result to cmdline.
The format is "androidboot.verifiedbootstate=green, yellow
orange, or red".
Change-Id: I0059fbd7e73225f580bb5bf0b5e4b04faeb22f45
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
- read dtbo from recovery or dtbo partition;
- append "androidboot.dtbo_idx" to cmdline;
- apply dtb overlay when first read kernel dtb;
- pass dtb that first time read to kernel;
Change-Id: Iba5c02c1307d3dad69ef96d3b3b0927fb507be8f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Get dev_desc by call rockchip_get_bootdev() but not
default mmc 0.
Change-Id: I78c6760eb6410a14a9f767db2f90902ec97f432f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This enables the following fastboot commands:
fastboot oem unlock
fastboot oem unlock_accept
fastboot oem lock
fastboot getvar oem-unlock
Android 8.1 need the oem unlock status attach to bootargs on boot.
Change-Id: Icc83451336a4dea2cbcf4927287de23bc8e28cb1
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
Function android_image_load will return a negative value in case
of error. We should check the return value first before take it
as an unsigned long load_address.
This fix 008aee876ae5("boot_android: add runtime compatible for
un/compressed kernel image"), which may cause system panic on
a system that boot with none-android format image.
Change-Id: I7f67c322d4ef343328b2276fe83432716148a76d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This patch add auto parse the compress format of kernel image.
Then decompress the compressed kernel image for arm64, as for
arm32 zImage, we only need to load it to a higher memory, then
the kernel will handle the decompress itself.
Test on RK3308 AARCH64 mode (Cortex A35 816 MHZ) boot with eMMC:
------------------------------------------------------------------
Format | Size(Byte) | Ratio | Decomp time(ms) | Boot time(ms) |
-------------------------------------------------------------------
Image | 7720968 | | | 488 |
-------------------------------------------------------------------
Image.lz4 | 4119448 | 53% | 59 | 455 |
-------------------------------------------------------------------
Image.lzo | 3858322 | 49% | 141 | 536 |
-------------------------------------------------------------------
Image.gz | 3529108 | 45% | 222 | 609 |
-------------------------------------------------------------------
Image.bz2 | 3295914 | 42% | 2940 | |
-------------------------------------------------------------------
Image.lzma| 2683750 | 34% | | |
-------------------------------------------------------------------
Note: the boot time is counted from first ddr init log to first Kernel log.
Change-Id: I73b12ec944fbc8238b0e061a37e2f31aa3093231
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Acording to rockchip, the bootloader message is storaged
in the misc, and the offset address is BOOTLOADER_MESSAGE_BLK_OFFSET
blocks. But the offset address is zero in the normal state.
So add the CONFIG_RKIMG_BOOTLOADER to seperate it.
Change-Id: Ie4cd473ff9a32f578fe901b48689e60c7a28012a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Run the default fastbootcmd if can not get fastbootcmd
from env.
Change-Id: Iaf4d155a9737dd712673f1a7ab9543dc405343fa
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
If the device is unlock, the device can be brought
up when use avb.
Change-Id: I82dd71d33f47dda0a760740428988dd658a96713
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
If not find recovery message in misc partition, we try to check
kernel reboot command.
Change-Id: I25847cb5cc06efc39c419426ab6dbe9acde3797d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Read oem unlock status from optee_client api
and attach it to bootargs
Change-Id: Ib8b1a9bc115ec9cb7e5ce09dc50845cfd7c1c81b
Signed-off-by: Qiu Jian <qiujian@rock-chips.com>
In the function android_assemble_cmdline, the allocated_suffix
size must be strlen(ANDROID_ARG_SLOT_SUFFIX) + strlen(slot_suffix)
+1. If not, the later strcpy and strcat operation will be
out of bounds.
Change-Id: Ib0ed73ebc2f076c8dc8afac168c7aaeccfddfa67
Signed-off-by: jason.zhu <jason.zhu@rock-chips.com>
Add methods to read attestation key from the misc partition of
last 64K, store key and certificate chain data in secure storage.
When CONFIG_OPTEE_CLIENT is defined,
uboot support load attestation data.
Change-Id: I8f3bd7096a7856de9e58d294822a818d5fe380ba
Signed-off-by: qiujian <qiujian@rock-chips.com>
If apply the a/b system, open the macro CONFIG_ANDROID_AB.
Then get the dtb from the boot '_a' or '_b' image.
Change-Id: I21ad9d5a5e6e63e26bc16b1aeeb2e690c669a535
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Choose which partition to enter recovery and a/b depend
on CONFIG_ANDROID_AB.
Change-Id: I10d03f1c592702f857e6224566deea3a4d607788
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
The commit point is updated to google external/avb/
which commit point is cf8c56208d2d9643804a7f123b196c7ebc9af276.
Change-Id: I5a10a8a45d3e9e2c9d20d9b3d44946073c9a49ff
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
If the device support the AB system, must add the slot suffix
to partition.
Change-Id: Ibac54109dd937e22a76e6fa68e9fdd1c0be48cc1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
In the new android images, the ramdisk.img is packed in the
system.img. So transmit the "skip_initramfs" to cmdline to
ignore the ramdisk.img (if have) loaded from boot.img.
Change-Id: I1b2051d65078c903411f3ddcc0c7803cbd6892f4
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
New cmd usage:
boot_android mmc 0
update boot_android:
- do not need provide argv for misc partition and slot
- If CONFIG_ROCKCHIP_RESOURCE_IMAGE is enabled, try to get dtb from resource
partition.
Change-Id: I7242880f9cde916ca10d677ddac07790c66a07a4
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The fdt must be named of "kernel.dtb", and it's saved
in the root dir of the oem partition.
Change-Id: I70dc9cbbc295f23b08bf122df3b29bba7dacb82f
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
If user get the kernel fdt into the independent partition
which is the ext4 filesystem, we can use this api to load
fdt.
Change-Id: I4fa494beffecb41e8c0e4c02f1e782d0291e2d05
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
In file boot_android.c, we use some functions
belong to common/android_bootloader.c. BUt these
functions attribute are static. So we modify these
functions used in the boot_android.c.
And android_avb_boot_flow is added to boot a/b
android system.
Change-Id: I3ebc0a6fb24691ab1a0f8475220e16ca633412f1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Android kernel image format can include an initramfs image in the same
kernel partition. This patch passes the initramfs to the kernel, which
in the normal boot mode ignores it by passing "skip_initramfs" in the
command line.
Bug: 34346003
Test: `am broadcast -a android.intent.action.MASTER_CLEAR` factory
reseted the device.
Change-Id: I21d89e34a0f54badf3b2e3ad8981cef75f6d5edf
When concatenating the strings to form a new command line in the
android bootloader flow, the null-terminator was placed one byte after
the end of the allocated string.
Bug: None
Test: booted a rpi3.
Change-Id: I120e09a77bb1c27980e7ce2b5f9b8961424ed0c3
In order to support booting from either slot, this patch passes the
slot name from the command line.
Bug: 32707546
Test: Booted rpi3.
Change-Id: I30582bd8b1b95dc0f25b0c6624e7909ee4118bd0
An Android Bootloader must comply with certain boot modes and change
the kernel command line accordingly. This patch introduces the Android
boot mode concept which determines whether the device should boot to
one of the following:
* recovery: which should boot to the recovery image,
* bootloader: which should boot to the "bootloader" (fastboot) and
* normal: which should boot to the system image.
The boot mode is determined in part by the Boot Control Block (BCB)
which is stored at the beginning of the "misc" partition. The BCB
is defined in the "bootloader_message.h" file in AOSP, now copied
here as android_bootloader_message.h with minor modifications.
This patch implements the basic boot flow that loads and boots an
Android kernel image assuming an A/B device which implies that it uses
boot as recovery (BOARD_USES_RECOVERY_AS_BOOT in the BoardConfig.mk).
This means that the recovery image shares the same kernel with the
normal boot system image, but stores the recovery image as a ramdisk
which is not used in normal mode.
Among the limitations, this patch doesn't implement the A/B slot
selection, it only boots from the slot "a".
Bug: 31887729
Test: Booted a rpi3 with this flow.
Signed-off-by: Alex Deymo <deymo@google.com>
Change-Id: Ia2932c6f398f1ae713f0cd9670828f84103dca38
update setenv/getenv to env_set/env_get.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>