Commit Graph

4727 Commits

Author SHA1 Message Date
Joseph Chen b04f87d753 common: spl: support booting bl32
Change-Id: I525f2b3c9ce24464a775291ab8924adbc0da85f0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-22 14:44:24 +08:00
Joseph Chen 6115fdb3c0 common: android: improve os image information
android_image_parse_kernel_comp() doesn't return valid os
compressed type after android_image_set_kload(), so we add
the env "os_comp" to record compressed type.

Change-Id: Ie175649d348c0578ce78e139bdbbf4b6f9ea1101
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen 8d681e4412 common: android: only adjust load address for ARM64 compressed kernel
If there is not "kernel_addr_c", using "kernel_addr_r" for Image/zImage
on 32-bit platform.

If there is not "kernel_addr_c", adjust load address to promise compressed
kernel can normal boot on 64-bit platform.

Change-Id: I42cc3c9074eb8f1caaa44d9256d2abdae6cd97b8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen 892d0a7f9b common: android: remove unnesscessary message
Change-Id: Iaa5da7da492f3fcb8021d175bb9a39a04d7f61d0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 2a14a50bde common: rkimg: add hotkey for sysmem and bidram dump
Change-Id: I32ded101c764df18f66916dd863145ace81d35be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 32c868cf11 common: android: add hotkey for sysmem and bidram dump
Change-Id: Ic866dcc2b160ebd92d518e517e0bc8870aec84d0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen da051cc8bb rockchip: add ctrl+f hotkey to enter fastboot mode
Change-Id: I1f0a98793307b5a261958fe8c29da3271f2d8e4e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 309d75e755 command: board_f/r: add sysmem and bidram
During board_f sequence, it's able to add any count of dram banks
and validate memory layout after reserve_xxx() done, stop bootflow
if there is something wrong.

During board_r sequence, it's able to manage all memory blocks and
add reserve memory blocks for bi_dram[] at late bootflow, it's
nesscessary for AMP boot.

Change-Id: I4443a809792bb04e205bb26d79870c85cb5fe7bd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 505b141795 common: board_r: add board_initr_caches_fixup()
Remove dram_initr_banksize(), use mmu_set_region_dcache_behaviour()
in board_initr_caches_fixup() to set region MMU table attr is more
easily.

Change-Id: I9d9917e938fe5bbab5aa27575a5c8592ff08ab50
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 6e15146eff lib: sysmem: refactor code
- import memblk id to manage memory blocks;
- change "sysmem_property" to generic "memblock";
- use alloc instead of reserve for all memory blocks;
- clean up and fix some logic;
- add U-Boot cmd for sysmem;

Change-Id: I614223ce3bf97a7b3566412a9d1864fb30b68fd8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Zhangbin Tong a7774f5911 common: boot_rkimg: set "androidboot.mode=" as "normal" or "charger"
- The legacy setting rule is deprecated(Android SDK < 8.1).
- Provide CONFIG_RKIMG_ANDROID_BOOTMODE_LEGACY to enable legacy setting.

Change-Id: I5c8b442b02df068a0ab98ccc81a4f008ebe540c1
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-25 11:42:52 +08:00
Joseph Chen e95ee152a4 common: image-fdt: only care about enabled reserved-memory
Change-Id: I2c17cb1a8237e709cf8a528b35be2dcea70d4627
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-22 09:46:06 +08:00
Joseph Chen a0f7ba0595 common: fdt support: delete env "initrd="
Fix AB sysmem miss delete env "initrd=".

Change-Id: I77ab135644d3b1d2a2eb3f3be6168cf6ef4417df
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-21 10:36:28 +08:00
Joseph Chen 590d13d737 console: add CONFIG_CONSOLE_DISABLE_CTRLC to disable ctrlc
There are sometimes we would like to disable ctrlc, just enable it.

Change-Id: I2911650b22d47b057a039774d8293cad6317bb6d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-20 15:07:59 +08:00
Jason Zhu f3124cd744 spl: fit: use ddr for mmc read buffer in SPL for rk3368
rk3368 has the same problem with rk3399.

Change-Id: I242385722f864810273708f03dc62359a7bdb81e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-20 11:29:50 +08:00
Andy Yan 9d2bc40cc0 boot_rkimg: don't override BOOT_MODE_REG
We should keep the boot mode value, linux
kernel need it.

Change-Id: Ic31166dffc3fefdf352cac1d1002a91dea319fc5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-03-14 19:26:47 +08:00
Jason Zhu f44ca27357 android: fix retry mechanism with ab system
Minus the retry-count in every boot with ab system. If the ab system
boot success, the system service boot_ctrl reset the retry-count or set
boot-successful.

Change-Id: Ic37f65b745d1feb978730332835246dc43d72dab
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 18:12:21 +08:00
Jason Zhu d2280c00f2 android: add brackets to fix compile error
There is a compile error when enable AB config. The error message is
"error: a label can only be part of a statement and a declaration isnot
a statement". Add brackets to fix this error.

Change-Id: I4ec3af984503e35fc1304d08cd7cd8ab587dfb0a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-06 17:16:13 +08:00
Jason Zhu 332992a7f2 android: minus retry in AB system
Change-Id: Icc9764fb10dc87d3c4f2f7417b971338a7f98ca4
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-06 17:16:13 +08:00
Tony Xu bdeba27611 common: write_keybox: fix write attestation key compatibility error
Using the same name when write key in new formation and old formation
cause ta parse key data error when use key in old formation

Change-Id: I7f83efc3672e903e608d89f7dc214465dc321502
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-03-05 15:09:17 +08:00
Joseph Chen 785ce82a19 common: android: support misc partition absent
Change-Id: Ida7780a1fd0981d8dbf01c0f25e283dfc6332eca
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-05 14:11:41 +08:00
Tony Xu b671af0a93 common: write keybox: fix some non-standard code style
Change-Id: If202eb86ceed4a358939e1f4d6f36c678afee3e9
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-02-25 15:07:42 +08:00
Joseph Chen 0a53d515e6 lib: initcall: add system total boot time debug
Change-Id: I3d4cd151acf699b25c9caab0452e40fddb6c31e1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-25 09:59:46 +08:00
Tony Xu 75d7f9972b common: write keybox: write Playready SL3000 root key to secure storage
Change-Id: Ia202f7f81c7c618e7d6fc8ecb28ceb8a65157a1c
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-02-25 09:36:33 +08:00
Joseph Chen 8a127f59e0 common: rkimg: skip ramdisk and fdt relocation
It saves boot time and make final load address is where we expect.

Change-Id: I1e7c3bba48c9b318e7016bf15acf0a3bc8047cb3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-21 11:47:01 +08:00
Joseph Chen 2c9d117912 sysmem: fdt: reserve more CONFIG_SYS_FDT_PAD size for fdt
Sometimes, framework or user would call fdt_increase_size() to update
fdt size, it's better reserve more space to avoid sysmem gives the fdt
region overflow report.

The CONFIG_SYS_FDT_PAD default value is sync with bootm framework
in: common/image-fdt.c

Change-Id: I363e9a4182e13b1628a76666acd8272d25db659d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-19 14:37:36 +08:00
Joseph Chen 1485a1b338 common: boot rkimg: print boot mode
Change-Id: I75ddae437315a148871756ef88ff03cdca0c301d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-19 09:09:12 +08:00
Kever Yang fd810b8003 android: return fail if not found misc partition
Return directly and do not continue read from misc partition
if there is no partition.

Change-Id: I549d123632aecc5bd29ebdc2c4c7917c76750247
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-02-15 10:15:32 +08:00
Joseph Chen 10e1f9ebb7 android: fix avb enable state set error
Fixes: 8e66ecd25d
(android: fix get wrong ramdisk address when avb verify)

Change-Id: I6b28ee32824e97e7eaed4aa8a530903d8486004b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-31 20:00:49 +08:00
Tony Xu 9780bd18ce common: write keybox: Add readback check interface
Change-Id: Ic020bd7e80869c2e3096637fce0adced654d3ce4
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-01-31 11:08:44 +08:00
Joseph Chen 8e66ecd25d android: fix get wrong ramdisk address when avb verify
- add interface to get android avb enable state;
- get ramdisk from "ramdisk_addr_r" only when android avb disabled
  and CONFIG_ANDROID_BOOT_IMAGE_SEPARATE is enabled;

(fixes: 644e344 android: support loading android image separate)

Change-Id: I7280f911a0c5db851d119acb458b3f335dc28bce
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-30 16:51:22 +08:00
Joseph Chen f9f027c19e common: attestation key: use debug for "ca head not found"
Change-Id: I2d685acbcf18fa21aad35813a23abcfe0cf465a8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:43:04 +08:00
Joseph Chen 644e344181 android: support loading android image separate
This patch support loading android image separate for the
kernel/ramdisk/second images. It is disabled when android
AVB is enabled, because AVB need verify the full android image.

It brings some benefits, mainly for saving a lot of boot time:
  - allow skip load second content when kernel dtb is enabled;
  - allow skip fdt and ramdisk relocation during bootm boot flow;
  - allow loading fdt/ramdisk to "fdt_addr_r"/"ramdisk_addr_r";
  - avoid android image too large when load to ram;

Change-Id: Ia040b3031307a8a7c98b011ce038ec61fee6804a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +08:00
Joseph Chen 2280fbdd62 rockchip: boot_rkimg: import sysmem to alloc image buffer
sysmem avoids memory block overlap with each other.

Change-Id: I7c705c7860a7c88b0d3672b6b4edb8cb8334654d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +08:00
Joseph Chen 9866229841 rockchip: boot_rkimg: add descrption for reloading kernel dtb
"gd->fdt_blob != (void *)fdt_addr_r" makes users confused, let's
add some descrption.

Change-Id: I3ffe6c26892e99af4183eebcfb3c27ed1bdea38a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +08:00
Joseph Chen a384e3f1db common: image-fdt: add boot_fdt_add_sysmem_rsv_regions()
It reserves fdt reserved memory for sysmem.

Change-Id: I7ce1be9bd25a3609bc6dabdc265addbd2571076c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +08:00
Joseph Chen 322222b253 common: board_r: add sysmem init
setup right after malloc init done.

Change-Id: I6dbf55d825d0b03ed2cc64f2dab0a7331ce56228
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +08:00
Jason Zhu e92f47e469 android: test the vbmeta to enable avb
Change-Id: I36d6473a247ab7fc012ceb9a7c9a43e14e701611
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-01-22 16:59:11 +08:00
Jian Qiu c2ba77d93f lib: optee_client: Extract keymaster CA module
Extract keymaster CA module from OpteeClientInterface
refactoring code for keymaster reads and writes form caller module

Change-Id: I1069fce0d29d9d9815f71e7f3b4d231754382acd
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
2019-01-18 09:09:34 +08:00
Tony Xu dfbf26e839 lib: optee_client: move keybox code to write_keybox.c
Change-Id: Ifcd9962a8b802ee2bcbdbd0e88effb4485e5963a
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-01-16 18:10:16 +08:00
Jason Zhu d549e1d1e1 android: add androidboot.verifiedbootstate
Since the androidboot.verifiedbootstate is required in android Pie, so add
it to bootargs when secure boot flag is not set.

Change-Id: I4a883ca87bbba321a894ee66ebcf0ff9d5cb6ca8
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-01-14 11:52:51 +08:00
Joseph Chen 1153acfe76 android: print android avb enable state
Change-Id: I0be76d29eef3614d4885e2d69048cf521352ffc0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-10 18:24:21 +08:00
Joseph Chen 6ff768feef common: add system boot time report
Change-Id: Id7db8f7f7e30719188403f92282ca17c6fe564d6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-10 16:02:35 +08:00
Jason Zhu 424bfdcf40 android: enable secure boot by vboot_flag
We read the vboot_flag which is the flag of secure boot to enable
verified boot in uboot.

Change-Id: I592473ad14f9e19c6529602d029b7ec2fb335da8
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-08 15:44:38 +08:00
Joseph Chen ee4798e5b5 common: bootrkp: add fdt load address and size information
Change-Id: If2220c5163ad8159ecfd4a2499b465e238371bc3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-08 15:05:41 +08:00
Joseph Chen eaec55340e common: android: add more clear description for getting fdt
Change-Id: I66865eaed98d08d37047cda50d262d637c8865f8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-08 15:05:41 +08:00
Joseph Chen 67c90ac350 android: include fdt_support.h file
fix compile error when enable fdt overlay

Change-Id: I283ef3cd44aeb6c64f3362907fcc399919401345
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-03 10:32:24 +08:00
Jason Zhu 270ed4a992 android: fix compare slot_suffix error
If slot_suffix is equal to "_a", slot_index_to_boot is equal to '0'
but not '1' when use function strncmp.

Change-Id: I53ffc920824e03c923f1d9ab8fd326a733c59654
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-12-29 14:38:16 +08:00
Jason Zhu bdd65000c0 common: bootm: test cmdtp is NULL or not before use it
Test cmdtp is NULL or not before use it. If not and the image is
incorrect, then the error occur:
"Synchronous Abort" handler, esr 0x96000010
* Relocate offset = 0000000007911000
* ELR(PC)    =   00000000006148f8
* LR         =   00000000006148f8
* SP         =   0000000005b020d0

* ESR_EL2    =   0000000096000010
        EC[31:26] == 100101, Exception from a Data abort,
                     from current exception level
        IL[25] == 1, 32-bit instruction trapped

* DAIF       =   00000000000003c0
        D[9] == 1, DBG masked
        A[8] == 1, ABORT masked
        I[7] == 1, IRQ masked
        F[6] == 1, FIQ masked

* SPSR_EL2   =   00000000000003c9
        D[9] == 1, DBG masked
        A[8] == 1, ABORT masked
        I[7] == 1, IRQ masked
        F[6] == 1, FIQ masked
        M[4] == 0, Exception taken from AArch64
        M[3:0] == 1001, EL2h

* SCTLR_EL2  =   0000000030c51835
        I[12] == 1, Icaches enabled
        C[2] == 1, Dcache enabled

Change-Id: I367051e8e91a1b6fee957390af79980bfd5e5916
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-12-27 19:43:13 +08:00
Alexey Brodkin f05ce84792 UPSTREAM: fdt: Implement weak arch_fixup_fdt()
Only ARM and in some configs MIPS really implement arch_fixup_fdt().
Others just use the same boilerplate which is not good by itself,
but what's worse if we try to build with disabled CONFIG_CMD_BOOTM
and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was
apparently implemented in arch/xxx/lib/bootm.c.

Now with weak arch_fixup_fdt() right in image-fdt.c where it is
used we get both items highlighted above fixed.

Change-Id: Iaac96fbb0bcc484906952ced132b10b2cead782e
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: York Sun <york.sun@nxp.com>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-12-24 17:20:37 +08:00