Some platform requires to reserve memory regions for some firmware
to avoid kernel touches it, but U-Boot may have communication with
firmware by share memory. So that we had better reserve firmware
region after the initr_caches() which enables MMU and init
translation table, we need firmware region to be mapped as cacheable
like other regions, otherwise there would be dcache coherence issue
between firmware and U-Boot.
Change-Id: Icb986022b484c96dffcafc98972ae24362cb8e4b
Signed-off-by: Joseph Chen <chenjh@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>
When DTBO is enabled, dtbo may provide "bootargs_ext" to append
cmdline base on "bootargs".
Change-Id: I4abf554591a3983c5f41494ecadf5614b8f6404b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
dtimg command allows user to work with Android DTB/DTBO image format.
Such as, getting the address of desired DTB/DTBO file, printing the dump
of the image in U-Boot shell, etc.
This command is needed to provide Android boot with new Android DT image
format further.
Change-Id: I2a626f333f604b6f0424aa03feaddab4e8506a3f
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
(am from http://patchwork.ozlabs.org/patch/925871/)
Android documentation recommends new image format for storing DTB/DTBO
files: [1]. To support that format, this patch adds helper functions for
Android DTB/DTBO format. In image-android-dt.* files you can find helper
functions to work with Android DT image format, such us routines for:
- printing the dump of image structure
- getting the address and size of desired dtb/dtbo file
This patch uses dt_table.h file, that was added in 643cefa4d848 ("Import
Android's dt_table.h for DT image format") by Alex Deymo.
[1] https://source.android.com/devices/architecture/dto/partitions
Change-Id: I78f6750af6c4fecb80d331bc06bc5cbe98da5825
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
(am from http://patchwork.ozlabs.org/patch/925870/)
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>
with this patch, we can see the detail boot time of boot flow.
The U-Boot log is like this:
[ 0.259266] U-Boot 2017.09-01739-g856f373-dirty (Jul 10 2018 - 20:26:05 +0800)
[ 0.260596] Model: Rockchip RK3399 Evaluation Board
[ 0.261332] DRAM: 3.8 GiB
Relocation Offset is: f5bfd000
Using default environment
[ 0.354038] dwmmc@fe320000: 1, sdhci@fe330000: 0
[ 0.521125] Card did not respond to voltage select!
[ 0.521188] mmc_init: -95, time 9
[ 0.671451] switch to partitions #0, OK
[ 0.671500] mmc0(part 0) is current device
......
Change-Id: I3ce2a4466f9ecd9eeb6b334ba4ba48391aa47c30
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
We shouldn't go on with the compress/decompress flow
when we get a invalid andoird image.
Change-Id: Ied7266b8791fe571c670cacafffdd393161c8189
Signed-off-by: Andy Yan <andy.yan@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>
Delete default "root=" in the dts when use AB system.
The ab bootctl will choose the high priority system
and storage its UUID to cmdline.The format is:
root=PARTUUID=xxxx-xxxx...
Change-Id: I4ad5b167952c84764fee741b527346bdfe5af1d7
Signed-off-by: Jason Zhu <jason.zhu@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>
provide for platforms to override as early as possible since
interrupt is ready.
Change-Id: I803620b71c3f1559e79074c03bee36a84f1ebc1c
Signed-off-by: Joseph Chen <chenjh@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>
The device node for rksfc and rknand are the same in kernel, so
we can use the same storage media type.
Change-Id: I3eb70bc1a502e516fbf538ac274ee856a98ba556
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
1. support adc value recognize;
2. support gpio value recognize;
Change-Id: I8bcbdd914405184d46029c4995c09b09e36c7ea3
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>
Some devices cann't use SPL framework at TPL stage, but the
CONFIG_SPL_FRAMEWORK is still defined at TPL stage, so need
to separate them with CONFIG_TINY_TPL.
If the SPL framewrok was used both at TPL and SPL stage,
CONFIG_TINY_TPL is not defined.
If the SPL framewrok was used at SPL stage, but not use at
TPL, need to define CONFIG_TINY_TPL.
Change-Id: Iabb7e0377ee00311ca468cb8ff7544c96bd999d6
Signed-off-by: David Wu <david.wu@rock-chips.com>
The NULL address maybe point to a security region on
rockchip armv8 platform, which can't be accessed from
u-boot(normal world). So before we access devtype by strcmp,
set devtype to mmc if we failed to get it from env.
Change-Id: Iceae3d1b89abd78fe59a3b57938254e55fa3894f
Signed-off-by: Andy Yan <andy.yan@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>
actually that relocation takes some troubls for our debug,
print relocation offset can help a lot.
Change-Id: Ib15d6111930fda8e8cdfab505d977aaf1da934b2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
We may read the dtb file before bootrkp command, we can use it directly.
Change-Id: Iff6dcd037d9d3637f1be81f458140189c13b1977
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Add API for rockchip pass uboot logo memory info to kernel.
Change-Id: Ib3bfadc381efae21359a43654493e8e0f4e67dd0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
in some case, we need persistent file system in NOR or NAND,
such as squashfs, we need to boot system in flash.
Change-Id: I46e4ae3e43f96f77f1ca6b4df8424fce19866226
Signed-off-by: Yu YongZhen <yuyz@rock-chips.com>