Commit Graph

4727 Commits

Author SHA1 Message Date
Masahiro Yamada 0e00a84cde UPSTREAM: libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.

This commit moves the header code:
  include/libfdt.h         -> include/linux/libfdt.h
  include/libfdt_env.h     -> include/linux/libfdt_env.h

and replaces include directives:
  #include <libfdt.h>      -> #include <linux/libfdt.h>
  #include <libfdt_env.h>  -> #include <linux/libfdt_env.h>

Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-12-24 17:20:37 +08:00
Masahiro Yamada c78841b69b UPSTREAM: libfdt: move FDT_RAMDISK_OVERHEAD to image-fdt.c
This macro is locally referenced in common/image-fdt.c

Change-Id: Iaf308d919d666be2615ef8f894099c538366e89d
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-12-24 17:20:37 +08:00
Joseph Chen 8bea6fa8fe common: rkimg: add dev_desc validation check
If we use a NULL dev_desc, it causes data abort.

Change-Id: Iaf315f7f0ca4a8c33d4d4b809fffea35fc5dcc51
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-19 18:46:07 +08:00
Joseph Chen 5ea39a570f common: autoboot: using ctrl+c to exit bootdelay and enter hush
We hope user can have more clear purpose on entering hush shell,
this avoids some unexpected key hit during normal boot.

Update message from:
Hit any key to stop autoboot: 5 => Hit key to stop autoboot('CTRL+C'): 5

Change-Id: Ifb1b594dc38f92fa38e2c2b8a9a576e38bbdf03e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-19 17:08:17 +08:00
Joseph Chen caed6b4f82 rockchip: make avb boot flow uninterruptable
- only allow "boot_android" as bootcmd;
- enter rockusb or fastboot when boot failed;
- don't allow ctrl+c to enter hush;

Change-Id: I7a67f4b738ed78370f19fe2c8c920a5abc104b4b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-12 11:00:47 +08:00
Joseph Chen 8c2a7835d0 common: board_r: enable initr_serial() anyway
If we don't enable initr_serial(), even after relocation done, the
serial driver always use no relocation address of ns16550_serial_ops
which is setup in serial_init(). This makes abort issue when arm64 kernel
is load to overlap the ram area.

fixes: 064eb49314
(serial: ns16550: support using pre-loader serial)

Change-Id: Iab67010ba3712754c036ecb2aee76c13a0b200b6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 16:28:16 +08:00
Joseph Chen b4913f9584 android: make android boot message more accurate and clear
1. Actually, the "kernel_address" is android header address but not
   real kernel address, let's use "kernel_addr_r/c" to verbose.

2. print compressed type info, like:
   "Booting LZ4 kernel at 0x02480000(Uncompress to 00680000) with fdt at 1f00000..." or
   "Booting kernel at 0x00680000 with fdt at 0x1f00000..."

Change-Id: Ifb628ab355670681f78d8f73893baddee21223a0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 16:27:42 +08:00
Joseph Chen eb94a25c6f android: fix android load address missing reserve page size
fixes: ee465021fe
(android: support boot images packed with rockchip android hdr)

Change-Id: Iaf340c828196553e433b17322929eaeed6afbf55
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 16:27:07 +08:00
Joseph Chen 645a442d90 common: support skip U-Boot relocation
Change-Id: I8640907204c82928c2fb07177835dc55a126aaf0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-01 11:47:26 +08:00
Joseph Chen d9e2bd8a57 common: boot_rkimg: verbose partition type
rockchip platforms support both efi and rkparam partition types,
it helps a lot for debug.

Change-Id: I3ba3fe552ecd99c38112a1417eb6c22721a03242
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-29 20:40:09 +08:00
Tony Xu 1e8c0e44aa Attestation key: write attestation key to secure storage
Split attestation key into AttestationKey.ec and AttestationKey.rsa,
then write to secure storage.

Change-Id: I8e00d602c4174a002e6ecad2e4cfa846f32a681f
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2018-11-21 10:11:40 +08:00
Joseph Chen 8f88277439 rockchip: support get boot devtype and devnum from atags
- preloader would pass bootdev info;
- avoid going through all the possible bootdev;
- rename devtype_num_envset() to boot_devtype_init();

Change-Id: Ia047c744dc7aca97db97664fc92473e46ba102a9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-16 08:41:36 +08:00
Joseph Chen c777563626 boot rkimg: record blk_desc for late use
Change-Id: Iddd87d441d8ea71929cf7d9494c319345f972fe3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-16 08:41:36 +08:00
Joseph Chen 9ebaf67ccd common: boot_rkimg: init lmb by bi_dram[...] data.
Keep same with ./common/bootm.c.

Don't rely on env_get_bootm_low() and env_get_bootm_size() since
they can't provide a confirm value, but bi_dram[...] it is.

Change-Id: I2c2b64e7b8dfa3c7b38a6498567a5af7248e7a1e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-13 14:07:56 +08:00
Joseph Chen 7c233ca637 android: read two blocks of kernel image
this patch fixes zboot.img boot up failed due to getting kernel
compress type failed(reading IH_COMP_NONE).

we need to read a few kernel image info, i.e. compress type.
Assume 2 blocks maybe enough.

fixes: ee465021fe
(android: support boot images packed with rockchip android hdr)

Change-Id: I140832a899102984aebaad160a3902cfc483bfeb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-13 14:06:36 +08:00
Joseph Chen 2efa632c45 common: bootm: add lmb reserve for fdt
this avoids fdt being overriden when ramdisk relocation if
fdt is too close to lmb allocable high memory region.

fixes: 5af94f7887
(android: get fdt by suitable ways)

Change-Id: Iadd5854269d0832b0c0455c8423b9d4172768ce3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-13 14:06:36 +08:00
Kever Yang 90d1164a04 spl: fit: use ddr for mmc read buffer in SPL
SPL need read data to IRAM for bl31(m0&data), but the SDHCI does
not support this path, we need to use DDR space as buffer.
The SDHCI driver do not have any error/warning if we set the
destination address to IRAM, and complete seems normally, but
the data is not transfer.

Change-Id: Ied9eed835961470bc87fda99a1565992c4103d9c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-11-12 17:06:34 +08:00
Ziyuan Xu 6ebb5f3d0d common: boot_rkimg: get boot_mode from register without misc partition
If the misc partition is nonexistent, it's still to be hope that get the
boot mode from GRF register.

Change-Id: I94e6a64b9433a0c95071e3ee380841b8fddf768d
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2018-11-06 18:15:59 +08:00
Joseph Chen ee465021fe android: support boot images packed with rockchip android hdr
For some legacy reasons, rockchip use mkbootimg tool to pack android
images with special pack parameters(SDK version lower than 8.1) to
assign kernel/ramdisk/seconds address and page size.

Android hdr on RK3399 SDK-7.1:
   kernel size:      1299808
   kernel address:   60408000
   ramdisk size:     1e6b80
   ramdisk addrress: 62000000
   second size:      41c00
   second address:   60f00000
   tags address:     60088000
   page size:        4000
   header_version:   0
   os_version:       e041114 (ver: 1.7.2, level: 2017.4)
   name:
   cmdline:          buildvariant=userdebug

The kernel/ramdisk/seconds address base is not from 0x10000000 and
page size is not 0x800!

This patch makes bootflow to compatible with above legacy packing.

Change-Id: I663a0d1386694658c97586706ff21ed887d6a2e7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-01 08:42:27 +08:00
Jason Zhu 4171cf46e3 android: fix error when the vbmeta is NULL or verification error
If the vbmeta has no data or verify errors occur, the system get abort:
"Synchronous Abort" handler, esr 0x96000010
* Relocate offset = 000000003db40000
* ELR(PC)    =   0000000000220d2c
* LR         =   0000000000220d08
* SP         =   0000000031d35040

Change-Id: I452e9b109ef5f61dfc338ff5bfb72a687a2b0003
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-10-29 15:53:34 +08:00
Joseph Chen 064eb49314 serial: ns16550: support using pre-loader serial
- pass pre-loader serial configure by rk atags;
- it depends on serial aliases to find uart port;
- enabled by CONFIG_ROCKCHIP_USING_PRELOADER_SERIAL;

Change-Id: I6723cccc5e1f3dac77203b4cc19cdac631f5133b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-19 17:40:56 +08:00
Joseph Chen 6ba4112660 board_r: env: support storage env when kernel dtb is enabled
if we would like to use kernel dtb, it must depends on nowhere
env to detect boot media and initialize it. After storage is
initialized, we switch env from nowhere to CONFIG_ENV_IS_IN_xxx=y,
nowhere env info will append or override to storage env.

Change-Id: Id1cf44d4b25dcaba3c142b283ed093bed0decafe
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-18 10:36:25 +08:00
Joseph Chen 5af94f7887 android: get fdt by suitable ways
We may have special operations for fdt(optional):
- apply fdt overlay;
- select fdt by adc or gpio;

We can't read default rk-kernel.dtb and pass it to kernel,
call rockchip_read_dtb_file() to get dtb.

Change-Id: I3aba002b0cfe324cc7c3852bf8b9561575590fd4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-07 09:19:03 +08:00
Joseph Chen 98ff9f07f8 rockchip: add IF_TYPE_RAMDISK support
Change-Id: I505606516bf186d8e869702c77f563d5cf0d6f37
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-17 09:32:28 +08:00
Zhangbin Tong affcebcd8f android: verity: Fix environment variable "bootargs" override
Change-Id: Idd079d8773f536928d02f1b32bb562d5540ee85a
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2018-09-06 16:57:28 +08:00
Joseph Chen 3302ecb798 Revert "board_f: run reserve_board() earlier"
This reverts commit a80c59f488.

armv7 get new gd after relocation depends on gd->bd position, this
patch breaks the reserved memory layout.

Change-Id: Ic23fe79d8c6edf048774808f3a06be5e17ccf686
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-24 15:27:51 +08:00
Joseph Chen a80c59f488 board_f: run reserve_board() earlier
it promises reserve_board() not to overlay trust os memory.

Change-Id: I149de3b7956a63a80ab91c38c12c16b8709b9756
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-23 10:31:05 +08:00
Joseph Chen 123c920622 board_r: skip mmc init when CONFIG_USING_KERNEL_DTB is enabled
When CONFIG_USING_KERNEL_DTB is enabled, mmc has been initialized earlier.

Change-Id: If3d7374cbbd4e403d9627c44133bf5fd1aeb9af8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-23 10:20:54 +08:00
Jason Zhu fc7985c1ac android: add 'root=PARTUUID=xxx-xxx'
Set 'root=PARTUUID=' to bootargs When use the CONFIG_ANDROID_AB.

Change-Id: I9760f1a9ad67ba1f2cb334a0af50db464d87816b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-08-17 11:31:07 +08:00
Joseph Chen 9e228ce338 android: dtbo: fix "androidboot.dtbo_" => "androidboot.dtbo_idx="
Change-Id: Iefc050e4c503d5e79843c840a8d0b3a002dd9833
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-16 15:28:43 +08:00
Algea Cao 8e2bab3fc5 drm: Transplant dw-hdmi code from rkdevelop
1.Updating edid parse method.
2.New hdmi i2c control method.
3.Adding mode filter.
4.Adding color select method.
5.Support hdmi 2.0.
6.Adding baseparameter reading.
7.Support HDCP 1.4.

Tested in rk3399/rk3229/rk3128h/rk3328.

Change-Id: I2b3b1fb0079e97ba4b737781356e920548d6ad75
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-08-15 10:10:19 +08:00
Jason Zhu dc3aa58f81 android: add verify state to cmdline
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>
2018-08-13 15:20:44 +08:00
Jason Zhu c9d7fcc61d fastboot: get mmc erase group size for fastboot
Change-Id: I2b3502bffc26c762ff10c55414b18037aed291cd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-08-13 09:58:31 +08:00
Joseph Chen edac97f481 android: dtbo: enable depends on CONFIG_CMD_DTIMG
Change-Id: I04ba7d39fed1b5c6950a3882f04de5420dfcff2e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-09 14:23:17 +08:00
Andy Yan 5f08e86fd7 fdt: add config to enable/disable fdt_root function
commit 10be5b5d3a ("fdt: Pass the device serial number through
devicetree") introduce function fdt_root to pass a device serial
number to kernel through devicetree. But sometimes we may want
to generate the device serial number from kernel itself. So it's
better to have a configuration to enable/disable this function.

Change-Id: I9efd4fd63faca9ce5e44cade856993be251f4760
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2018-08-09 10:40:57 +08:00
Joseph Chen 7cef4c7ca2 fdt_support: add more debug info when merge bootargs
Change-Id: Ib01c2b20bf2b71fe3079febcfb3b4e77e874026a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-08 11:39:32 +08:00
Joseph Chen f4d148502c board_r: add dram_initr_banksize()
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>
2018-08-07 10:47:42 +08:00
Joseph Chen f8dbe86116 android: support dtb overlay
- 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>
2018-08-06 11:15:19 +08:00
Joseph Chen c67b8746fb image: android: use debug to print cmdline
if cmdline is too long, it wastes time.

Change-Id: Ie8658fca11c3706df50d1eaae2ee479af6e8de08
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-06 11:15:19 +08:00
Joseph Chen bcd21a1f01 image: android-dt: add dt_for_each_entry() to iterate over all dt entry of DT image
Change-Id: I4db1e1da0d55701798bb8c296dd58e26592ef3c8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-06 11:15:19 +08:00
Joseph Chen c673757f56 common: fdt_support: support "bootargs_ext" merge into "bootargs"
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>
2018-08-06 11:15:19 +08:00
Joseph Chen 09f4e561ac android: update android image header to support new version
mainly to support android P.

Change-Id: I34a49e4eedcde06a9e40792c7c908737dc10b426
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-06 11:15:19 +08:00
Sam Protsenko 2967d2f74d FROMLIST: cmd: Add dtimg command
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/)
2018-08-06 11:15:19 +08:00
Sam Protsenko e91b3373a9 FROMLIST: common: Add support for Android DT image
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/)
2018-08-06 11:15:19 +08:00
Dingqiang Lin c8638ec3c0 common: boot_rkimg: add SPI flash boot type
Change-Id: I9d1d36390833387a93eb7ed76b1d6f90e3640edb
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-07-31 14:51:32 +08:00
Jason Zhu d34064effa android: get dev_desc by rockchip_get_bootdev()
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>
2018-07-19 09:57:37 +08:00
Jian Qiu 65413a00f9 fastboot: add FASTBOOT_OEM_UNLOCK option
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>
2018-07-19 09:56:14 +08:00
YouMin Chen ba5fd738de rockchip: tpl: rename CONFIG_TINY_TPL to CONFIG_TPL_TINY_FRAMEWORK
Change-Id: Ia05a73467578f5620a9ba168e67bcfb02c40e1d0
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-07-18 17:09:38 +08:00
Joseph Chen 243527b501 console: support timestamp for printf
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>
2018-07-17 10:07:08 +08:00
Andy Yan 79bdfc405d android: only handle compressed kernel after read a valid android image
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>
2018-07-16 16:00:10 +08:00
Andy Yan e2ced6c33b android: only take the successed return value as load_address from android_image_load
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>
2018-07-16 09:05:39 +08:00
Joseph Chen 3ee3aa8966 common: fdt_support: replace env_update with env_update_filter
Change-Id: Ic47d3b82b3aac6b36f9fe7803c0d3a165ebd9e05
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:36:03 +08:00
Jason Zhu 2c9c7f0d24 common: fdt_support: delete root=
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>
2018-07-14 17:23:30 +08:00
Andy Yan 008aee876a boot_android: add runtime compatible for un/compressed kernel image
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>
2018-07-14 11:39:04 +08:00
Jason Zhu 6651d4c0fb dev_desc: judge dev_desc whether NULL or not before use it
Change-Id: I9d0e2d207a143a02949fbdff2d9ad39f154e4f3e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-07-04 09:31:05 +08:00
Jason Zhu 051c625387 android: fix android_bootloader_message_write bug
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>
2018-06-28 16:26:46 +08:00
Jason Zhu 8e620d08b8 android: add the default fastbootcmd
Run the default fastbootcmd if can not get fastbootcmd
from env.

Change-Id: Iaf4d155a9737dd712673f1a7ab9543dc405343fa
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-25 09:11:32 +08:00
Joseph Chen c2304c02b1 console: add warning message if slient console is enabled
Change-Id: Ibc50e9bc19c77bb688a0312c1d1290250a9b6a2f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-22 19:40:00 +08:00
Joseph Chen 7f571427ef board_r: add interrupt_debugger_init()
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>
2018-06-13 10:56:38 +08:00
Joseph Chen 3fc26c82e8 board_r: initialize interrupt earlier
Change-Id: I1c674efd0d1b7e8229179ac570727da9b4adab27
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-12 18:03:55 +08:00
Joseph Chen 4cda574961 boot_rkimg: check recovery mode by env "reboot_mode"
This is set when recovery key pressed.

Change-Id: Id5fe334fafd67fec461c36df13b2e856e519a083
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-06-06 17:55:12 +08:00
Jason Zhu 564ab2efb0 common: bootm: reserve memory bank
Reserve lmb according to gd->bd->bi_dram.

Change-Id: Ib1d4da95e826d3afe034bd3a90ec1d1c92a692bf
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-06 16:36:00 +08:00
Jason Zhu 9cc336e89e android: bring up the kernel if device is unlock
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>
2018-06-05 08:56:54 +08:00
Joseph Chen 93d59c05c7 android: fix "reboot recovery" command doesn't work
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>
2018-05-25 17:48:46 +08:00
Kever Yang fd262f5b6d rockchip: rkimg: rksfc use the storagemedia type 'nand'
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>
2018-05-24 09:56:51 +08:00
Kever Yang 083c304ab8 rockchip: rkimg: add 'sd' type for storagemedia
mmc1 is sd card in U-Boot.

Change-Id: I9f57d0029dcf0af043bc6b7c2e184e6e02482d89
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-05-24 09:56:51 +08:00
Joseph Chen 740107bb19 rockchip: support alternative kernel dtb depends on adc/gpio
1. support adc value recognize;
2. support gpio value recognize;

Change-Id: I8bcbdd914405184d46029c4995c09b09e36c7ea3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-05-11 11:12:35 +08:00
Dingqiang Lin c2717d6fed common: boot_rkimg: add boot devtype rksfc
Change-Id: I2ec14959aa1cc83ef7edf82944f8235f4db17690
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-05-11 11:08:38 +08:00
Jason Zhu dc588d96b8 common: boot_rkimg: make devnum alterable
make devnum alterable when get blk_desc

Change-Id: I0bd7387003c78cae058b85c93c3de266d90e9ee7
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-05-08 11:35:20 +08:00
qiujian 9e68721b27 bootargs : read oem unlock status
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>
2018-04-03 10:30:56 +08:00
qiujian f61a997e29 fastboot: implement oem unlock commands for bootrkp
Read-write oem unlock status from optee client api.

Implement the following fastboot commands:
  fastboot oem unlock
  fastboot oem unlock_accept
  fastboot oem lock
  fastboot getvar oem-unlock

Change-Id: I99edcee7b60c6d9529e6687291d87f22bf97b771
Signed-off-by: Qiu Jian <qiujian@rock-chips.com>
2018-04-03 10:30:56 +08:00
jason.zhu 5353f2a9a0 android: fix memory overflow
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>
2018-04-02 16:15:23 +08:00
David Wu 30129f2f83 config: Add CONFIG_TINY_TPL to disable SPL framework at TPL
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>
2018-03-29 16:27:44 +08:00
Joseph Chen f2d1698c73 autoboot: only allow ctrl+c to abort bootcmd
It works only for rockchip platforms.

Change-Id: I67e7d9ab625b7667ec411347249582ed9537686c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-27 09:02:33 +08:00
Andy Yan 849faaa0e3 common: boot_rkimg: avoid to access NULL address when failed to get bootdev type from env
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>
2018-03-22 08:55:24 +08:00
qiujian 91c73fb4d1 lib: optee_client:Support attestation
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>
2018-03-21 16:38:08 +08:00
Jason Zhu 2301a6f51c rockchip: resrouce_img: support a/b
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>
2018-03-05 14:42:53 +08:00
Joseph Chen 2e3f27707f board_f: print relocation offset
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>
2018-03-05 09:54:07 +08:00
Kever Yang 64e1e04c21 fastboot: support rknand device
Use rockchip_get_bootdev() to get dev_desc.

Change-Id: I127d5418f65db42d93930283348bb4072447012f
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-03-01 08:54:25 +08:00
Joseph Chen 3c3675ddd7 rockchip: recoganize boot devtype dynamicly
currently support: emmc and rknand.

Change-Id: I8b0e2623256ed3357de2acbee0d2455162228ab5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-25 16:49:34 +08:00
Kever Yang eb2a5055ad rockchip: boot_rkimg: do not read dtb again if we have do it
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>
2018-02-23 10:28:27 +08:00
Kever Yang 3a39dbf874 fdt_support: add fdt_update_reserved_memory()
Add API for rockchip pass uboot logo memory info to kernel.

Change-Id: Ib3bfadc381efae21359a43654493e8e0f4e67dd0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-23 10:28:26 +08:00
Yu YongZhen 09e52837fc common: boot_rkimg: go on the boot flow even no ramdisk found
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>
2018-02-11 20:28:48 +08:00
Kever Yang e4feb814ab rockchip: android: fix compile warning
Change-Id: Ic89e97a852999a9ec929942b1b612f13cc43f57f
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-11 19:49:52 +08:00
Joseph Chen e87597928c image-fdt: print reserved-memory node name
Change-Id: Ib7d4d7d4ae8355877b45eccc93deb03298f1e138
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-11 11:57:26 +08:00
Jason Zhu b666ac0523 android: support android verified boot(AVB)
Define CONFIG_ANDROID_AVB to open avb.

Change-Id: Iae0306391e403b25aa454205dd5a70a578752aba
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-02-10 10:48:34 +08:00
Jason Zhu 8f254cea36 android: change enter recovery and a/b mode
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>
2018-02-10 10:48:25 +08:00
Jason Zhu 37a7bc39c0 lib: avb: update and modify the avb library
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>
2018-02-10 10:41:04 +08:00
Kever Yang fac2f0408a common: board_r: init env before board_init()
We need to get and update env if we need to read kernel dtb in board_init().
Note that the env is NOWHERE now, or else we need to init emmc first if
ENV_IS_IN_MMC.

Change-Id: I22685fea77315811f3ff2bac7fb29d3b9206be34
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-10 10:40:52 +08:00
Kever Yang c0ae4ef946 rockchip: rkimg: fix compile warning
Change-Id: I8988761a6504d9e7bfca3a6702266b8b69631984
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-09 12:00:22 +08:00
Kever Yang d2e8ba4eb0 Revert "rockchip: add support to load and use kernel dtb"
This reverts commit af586a3812.

Change-Id: Ie1f8012b89ac810e3bc6219459127bc9ee88c674
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-07 18:12:44 +08:00
Joseph Chen ca5e018d11 common: fdt_support: add bootargs debug output
Change-Id: I06636c498b015774968b3c52ce53f54637fa8525
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-06 10:45:03 +08:00
Jason Zhu f52e474fa5 android: support slot suffix
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>
2018-02-05 21:02:00 +08:00
Joseph Chen 31435dfd5d common: fdt_support: clean up bootargs combine
1. use env_update() to combine bootargs which avoid variable repeat;
2. use env_delete() to delete legacy property: "initrd=0x...,0x,,,".

Change-Id: I5fd444a789df3f2ef9e527b9287e5173749cbb87
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Jason Zhu 6e806ac8f7 android: fix rockchip_get_resource_file compile warning
Change-Id: Ie510718333ef379f733ee50fed40058225281a7e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-01-31 14:56:34 +08:00
Joseph Chen bb9827924e bootm: reserve memory when BOOTM_STATE_RAMDISK enabled
Change-Id: I2ba6dc7484de12aa7de28c9a8d6125b046029947
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-30 17:25:14 +08:00
Joseph Chen 39d5abb81d common: boot_rkimg: clean up boot options
options are: "storagemedia=" and "androidboot.mode=".

Change-Id: I4deba2fce27324bc5020ba79e586383fefe92b83
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-30 17:25:13 +08:00
Kever Yang af586a3812 rockchip: add support to load and use kernel dtb
We are going to use a tiny dtb(with 'u-boot,dm-pre-reloc') in pre-relocate,
and then read kernel dtb and use it after relocate.
This feature only works with CONFIG_OF_LIVE enabled now.

Change-Id: I429ccd90ef562a96f2f7916255e7e427ce8f451d
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-26 16:40:36 +08:00
Kever Yang ab174b958c bootm: fix to lmb mem reserve
This is a bug fix to:
534066e bootm: resever memory before any lmb_alloc()
the patch make distro boot hand.

Change-Id: I13634154daad211a2f51ee94043f6dfd57710eb3
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-25 16:17:19 +08:00
Joseph Chen 1f5bcda2a8 android: replace CONFIG_ROCKCHIP_BOOTLOADER with CONFIG_RKIMG_BOOTLOADER
Change-Id: I24db85313652bd21aada68cd472bdf888b7d022d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-24 18:17:48 +08:00