Commit Graph

9 Commits

Author SHA1 Message Date
Weiwen Chen 90e877b59c android: load fdt from the oem partition
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>
2017-11-20 10:32:54 +08:00
Weiwen Chen 8ce4d2843d android: add api for loading fdt
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>
2017-11-20 10:32:54 +08:00
Jason Zhu b3b934b636 android: boot the system without a/b and avb
Change-Id: I9a6da661c9cf17e2e3190b55f18acd600f9b63f1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:32:54 +08:00
Cody Xie 0e3d235ecd androidboot: Pass "androidboot.serialno" to kernel cmdline.
Change-Id: Ia0b693f2652ab35b2e29b1c23335f962b3943050
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
2017-11-20 10:26:12 +08:00
Jason Zhu de183ed0f1 android: declare some functions externally
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>
2017-11-14 10:55:50 +08:00
Alex Deymo a49a055226 android: Pass the ramdisk to the kernel.
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
2017-11-14 10:55:47 +08:00
Alex Deymo 170e9eb9d1 android: Fix off-by-one error when joining strings
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
2017-11-14 10:55:47 +08:00
Alex Deymo 8062224026 boot_android: Pass the slot from the command.
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
2017-11-14 10:55:46 +08:00
Alex Deymo 67dac67453 Initial support for the Android Bootloader flow
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>
2017-11-14 10:55:46 +08:00