Commit Graph

1013 Commits

Author SHA1 Message Date
Jason Zhu 7cca3dd4d7 lib: avb: support last boot
Change-Id: I803e3deda068be34061a302c27009db5e444f290
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-06 17:16:13 +08:00
Jason Zhu 4454e90b43 lib: avb: change the output memssage I/O
Since the stderr is not used in uboot, use printf to print the
message.

Change-Id: Ib522609e783acf8f407e2f9fb3805b553c543cba
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-06 17:16:13 +08:00
Joseph Chen 727ebf6de1 lib: sysmem: alloc base and size must be 4-byte aligned
Change-Id: Icf59ee6522f2e0793605b03b0bcf05b58585069f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-04 09:21:58 +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
Joseph Chen 595f057c4e lib: Kconfig: set SYS_STACK_SIZE 2MB size
128KB maybe not enough at sometimes.

Change-Id: I06746b98e005955d4b88904c04ed0af753db6acf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-25 09:59:46 +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 3befe43d90 lib: sysmem: ignore sysmem reserve warning
Change-Id: I970da1456388f825a351dc26d725bb3ba10d41a4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-19 09:10:17 +08:00
Hisping Lin 68ba937304 lib: optee_client: recover original partition after error
1.switch to RPMB partition when call init rpmb
2.switch to original partition when call finish rpmb
3.it will not switch to original partition when error
  occurred, we should recover original partition after error

Change-Id: I41927e82fb2db690058a809f008ca1f59d334011
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-02-14 19:58:09 +08:00
Hisping Lin df99e5808c cmd: add test case for secure storage
1.mmc testsecurestorage to test secure storage
2.test secure storage in rpmb and test secure storage in
  security partition when use emmc
3.test secure storage in security partition when use nand

Change-Id: Id6f72893c002c5040cb1790051c9685911878df7
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-02-14 19:58:09 +08:00
Joseph Chen 7f28cbb61e lib: Kconfig: add CONFIG_SYS_STACK_SIZE
Change-Id: I37cb4ffea5ef6aa2475a3ca7a87f58f23fcff76a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-02-13 09:03:59 +08:00
Jason Zhu 564654eb9c lib: optee_client: add read&wite permanent attributes certificate
Change-Id: I83321afcf9d89b0cde0bcc78f1f02c847f85a115
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-01-28 20:42:54 +08:00
Joseph Chen ffa8f8b76e lib: introduce sysmem for permanent memory management
U-Boot provides MALLOC for runtime temporary memory management and
LMB for bootm memory management. There is not a mechanism for permanent
memory management. so that the memory blocks are easy to overlap with
each other.

What does permanent memory mean ?
 - The memory can't be touched by U-Boot(ATF/OPTEE/SHM/kernel-reserved, etc);
 - The memory occupied even in kernel, such as some firmware load buffer;

This patch introduces sysmem to do permanent memory management, which
implements base on LMB. It provides memory block (pool):
 - init;
 - add;
 - alloc;
 - free;
 - reserve;
 - stat;
 - overflow check;

Here is an example for RK3399 sysmem boot stat(assume the "fdt" region is Overflow)
called by sysmem_dump_all():

sysmem_dump_all:
    ------------------------------------------------------
    memory.rgn[0].base     = 0x00000000
                 .size     = 0x00000000
    memory.rgn[1].base     = 0x00200000
                 .size     = 0x08200000
    memory.rgn[2].base     = 0x0a200000
                 .size     = 0x75e00000

    memory.total           = 0x7e000000 (2016 MiB. 0 KiB)
    ------------------------------------------------------
    reserved.rgn[0].name   = "ATF"
                   .base   = 0x00000000
                   .size   = 0x00100000
    reserved.rgn[1].name   = "PSTORE/ATAGS/SHM"
                   .base   = 0x00100000
                   .size   = 0x00100000
    reserved.rgn[2].name   = "OP-TEE"
                   .base   = 0x08400000
                   .size   = 0x01e00000
    reserved.rgn[3].name   = "U-Boot"
                   .base   = 0x71be03c0
                   .size   = 0x0e41fc40
    reserved.rgn[4].name   = "secure-memory@20000000"
                   .base   = 0x20000000
                   .size   = 0x10000000

    reserved.total         = 0x2041fc40 (516 MiB. 127 KiB)
    ------------------------------------------------------
    allocated.rgn[0].name  = "fdt"      (Overflow)
                    .base  = 0x01f00000
                    .size  = 0x00009704
    allocated.rgn[1].name  = "kernel"
                    .base  = 0x0027c000
                    .size  = 0x0129da04
    allocated.rgn[2].name  = "ramdisk"
                    .base  = 0x0a200000
                    .size  = 0x001e6c04

    allocated.total        = 0x0148dd0c (20 MiB. 567 KiB)
    ------------------------------------------------------
    LMB.reserved[0].base   = 0x00000000
                   .size   = 0x00200000
    LMB.reserved[1].base   = 0x0027c000
                   .size   = 0x0129da04
    LMB.reserved[2].base   = 0x01f00000
                   .size   = 0x00009704
    LMB.reserved[3].base   = 0x08400000
                   .size   = 0x01fe6c04
    LMB.reserved[4].base   = 0x20000000
                   .size   = 0x10000000
    LMB.reserved[5].base   = 0x71be03c0
                   .size   = 0x0e41fc40

    reserved.core.total    = 0x218ad94c (536 MiB. 694 KiB)
    ------------------------------------------------------

Change-Id: If63b7abed2cdd3c054719511fcceed733ddf606d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-24 15:33:12 +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 ee9d343315 lib: avb: fix fail to read PIK minimum
Do not update the PIK version if it is equal to the value in the storage,
otherwise the error may occur in power failure test.

Change-Id: Ia478d9b404de3982b4de5b185e15d181b37f5fd9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-01-16 17:59:46 +08:00
Hisping Lin aa04de65ce lib: optee_client: optimizing print information
Change-Id: I37e6dc56b8eb46bc6d0a2c12bbd4c329d35ca687
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-01-10 18:24:41 +08:00
Joseph Chen b2a1587371 lib: avb: add more help info for AVB_VBMETA_PUBLIC_KEY_VALIDATE
Change-Id: I2c63850244983144a6b5ac8303f1debc7a37cb2a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-01-03 09:53:29 +08:00
Hisping Lin 40f13eb771 lib: optee_clientApi: write table when verify table fail
Change-Id: I38d055945da5bf183e34588a08d8964c2d810f5f
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-12-29 14:39:42 +08:00
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 02f12fd1d3 UPSTREAM: libfdt: migrate libfdt.h to a wrapper + U-Boot own code
There is tons of code duplication between lib/libfdt/libfdt.h and
scripts/dtc/libfdt/libfdt.h.  Evacuate the U-Boot own code to
include/libfdt.h and remove lib/libfdt/libfdt.h.

For host tools, <libfdt.h> should include scripts/dtc/libfdt/libfdt.h,
which is already suitable for user-space.

For compiling U-Boot, <linux/libfdt.h> should be included because we
need a different libfdt_env.h .

Change-Id: I61a718a3fecb9f316cf3ddbac7c125394532a9c5
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 4e2c3b8c76 UPSTREAM: libfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.c
The only difference between scripts/dtc/libfdt/fdt_rw.c and
lib/libfdt/fdt_rw.c is fdt_remove_unused_strings().

It is only used by fdtgrep, so we do not need to compile it for U-Boot
image.  Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c
can be a wrapper of scripts/dtc/libfdt/fdt_rw.c.

Change-Id: I6e2578d4bfdf75438d3aa1cb51f270f34527d37d
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
Kever Yang 260eab1873 rockchip: video: use common API instead of private
We can use fdtdec_get_is_enabled() instead of fdt_device_is_available().

Change-Id: I7aa03ed82f83fc72206659889a4f7f095dc66b36
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-12-24 17:20:37 +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 a349065b9f avb: Kconfig: add config AVB_VBMETA_PUBLIC_KEY_VALIDATE
Change-Id: I2f9c74a8427874066e1bb7ac7b774a0fb3befba9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-12 11:00:47 +08:00
Joseph Chen 36ba3f8d39 lib: initcall: add time cost verbose
This is more helpful than bootstage timing record since it
is quite possible for every developer to enable inicall
verbose for debug and find abnormal time cost as early as
possible.

It looks like:
  initcall: 000000000061015c
                                                                  #   183 us
  initcall: 000000000ff3e614
                                                                  #     0 us
  initcall: 000000000ff3e408
                                                                  #     0 us
  initcall: 00000000006105fc (relocated to 000000000ff3e5fc)
                                                                  #  6401 us
  initcall: 0000000000610420 (relocated to 000000000ff3e420)
                                                                  #     1 us
  initcall: 0000000000604444 (relocated to 000000000ff32444)
                                                                  #     5 us
Change-Id: Ib59f3e5052f921d0046a6fa73cbfb968000fd34e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-10 15:13:19 +08:00
Hisping Lin d8100d74a0 lib: optee_client: remove widevine ta from uboot
Change-Id: I9e6e4d6743d0a8e9787c2b01e535d920d4f93008
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-12-06 09:17:57 +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
Hisping Lin 9983001913 lib: optee_client: remove keymaster ta from uboot
keymaster ta is too large, so we change store data
to static ta and remove keymaster ta

Change-Id: Icdb694138caf005d2cb2821714a8526d0391b18b
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-11-13 11:51:51 +08:00
Hisping Lin 099b8ebcd1 lib: optee_client: fix bug for security partition not find
bug make error R&W when security partition is not defined

Change-Id: Iddf840d3f9c090292e58f73492c20f84e4b3b4ea
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-10-30 09:12:33 +08:00
Jian Qiu 4711f91491 lib: optee_client: Reduce keymaster ta size
Change-Id: I2a82e33f92123ba29e6fb456b4e6b35312620e64
Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
2018-10-26 08:54:06 +08:00
Tony Xu f18b06fb49 lib: optee_clientApi: Optimze the function write_keybox_to_secure_storage
Change-Id: Icb88355494eb23c9403fc078adb5f2f46c4a870c
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2018-10-16 09:22:57 +08:00
Joseph Chen bcf5a32a7c lib: gzip: lower the message when parse header
Change-Id: Iedd2cbefac99fb17256770dc334741b9e760c449
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-10-07 15:37:50 +08:00
Hisping Lin bdf50261ca lib: optee_client: search security partition once
Change-Id: I4f3fbdb1e319e5b200225353a2d945bebd888f8c
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-09-11 09:52:43 +08:00
Hisping Lin f01cc52bce lib: optee_client: speed up secure store
use R&W multi blocks and cache used flag to
speed up secure store.

Change-Id: Ib534fa33e1bb03006ed3b85992d1d48b5fe36f39
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-09-05 09:23:55 +08:00
Jason Zhu 7c1937d6d1 lib: avb: change judgement value when read from rpmb
If the item is not existent, trust will return TEE_ERROR_GENERIC
TEE_ERROR_NO_DATA and TEE_ERROR_ITEM_NOT_FOUND. We initialize
the item when return these value.

TEST: fastboot getvar at-vboot-state

ERROR: avb-perm-attr-set=0
avb-locked=
avb-unlock-disabled=

Change-Id: Ie1b4e1ce7d1dc419a0af11e5701b0130f2f7f553
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-08-17 11:41:20 +08:00
Jason Zhu 615e0cde57 lib: avb: fix bug HANG in fastboot getvar at-vboot-state
Bug: Run 'fastboot getvar at-vboot-state', then HANG
in the fastboot without any message.

Cause: The fastboot can not decide the vboot size when
the return information size of vboot state is larger
than the VBOOT_STATE_SIZE. This makes the device will not
response to console.

Solution: 1. Enlarge VBOOT_STATE_SIZE. The max size of
vboot state may be 862, so define VBOOT_STATE_SIZE
to 1000.
2. Use snprintf to get the info.

Change-Id: I2d0fda76ca9034c596993ab27a02cbf2fa550977
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-08-17 11:41:20 +08:00
tony.xu a7df48681a load keybox to secure storage thtough u-boot: u-boot->ca->ta
Change-Id: Ifdf237ec235c791565d2da1b5881df2f1499d422
Signed-off-by: tony.xu <tony.xu@rock-chips.com>
2018-08-15 15:29:43 +08:00
Hisping Lin d156c9ff6f lib: optee_client: v2 client support compile to 32 bits
Change-Id: I25cbbe486016cbe6fb1a6eff440bb7efab46a4c6
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-08-07 10:48:14 +08:00
Joseph Chen bff338f2e6 lib: optee client: printf content end with "\n".
Change-Id: I9a2f503c4e6b3c1f0c117f93fc2f2d429d43dfbc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 19:17:01 +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
Hisping Lin d5d77aebb0 lib: optee_client: modify macro in Kconfig
CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION is support
for OPTEE_V1

Change-Id: Ic83d06a08a1d409905dcc61e0f7346ab23261b0c
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-07-14 11:37:57 +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 8d0db1d983 lib: avb: implement the function get_random()
Use the function get_timer to get the random
seed. Then the seed is used by function srand
to initialize the random data.

Change-Id: Iaae6a17d22b8e85fb4d4b6c6247cd11003b64eea
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-14 11:04:46 +08:00
Jason Zhu ab608f806e lib: avb: update avb source code
according to google lib avb
commit id: 44e07124afb1f46af0d745d83481f49c482900b1

Change-Id: Ie59a7265699e3e6b1673bb64da6d1c7a1e7b6201
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Jason Zhu 57c7f8fe0d lib: avb: support generate unlock challenge
Change-Id: Ia21746ec2bc729fd92ca7ea7a3320dfcbd4dd238
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Jason Zhu 83ab7b4937 lib: avb: rk: add authenticated unlock interface
Change-Id: Ib2aa1ac07d25f14aa08fc759ec99b6ba64d6abef
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-06-13 10:50:36 +08:00
Hisping Lin cb49af8fa6 lib: optee_client: Change param when get share memory config
Change-Id: I572bf900af26b2c2dcfce23e912b95aa729d786b
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-06-13 08:31:59 +08:00
Hisping Lin 981b79162b lib: optee_client: get share memory config to init
Change-Id: I92fff248650ff239e050fb058ee095e9bed231c6
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-06-06 09:19:41 +08:00
Hisping Lin f303baf0d8 lib: optee_client: optee os v1 support multi file system
Change-Id: I78487659e9fb5b9f2b5d468d587cd00756fdb98c
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-06-06 09:19:41 +08:00
Hisping Lin 58737b30a2 lib: optee_client: update keymaster TA
compile form keymaster 8.0/develop commit:ddd71dca
Features:
	ddd71dca ta: support emmc/nand storage for keymaster & gatekeeper
	2692c551 Update export-user_ta/ to support dual filesystems
	bc288722 keymaster: uboot write data overwrite

Change-Id: I51b84f62db15bd4825035089dbb6ee38d11d4cac
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-06-06 09:19:41 +08:00
Hisping Lin d30aacafd1 lib: optee_client: updata keymaster TA
compile form keymaster 8.1/develop-next commit:9d05fa8a
Features:
	9d05fa8a keymaster: uboot write data delete old obj
	ff399cf0 ta keymaster: fix null point input panic
	186df0e4 keymaster & gatekeeper: rk3326 use partition storage

Change-Id: Id15168f8782d4ab3680b9a424f8eee3843b6aa45
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-04-27 17:01:21 +08:00
qiujian 78ef5fbdb9 lib: optee_client: add oem unlock status func
Change-Id: If92c59650994bd2ab8e689f063acf1d65dc08e48
Signed-off-by: Qiu Jian <qiujian@rock-chips.com>
2018-04-03 10:30:56 +08:00
Hisping Lin a6bee18f07 lib: optee_client: fix bug of rk file system
fix bug which make error when we try to create
a new file, old file should be delete, but old
file which fd equal to zero is exist!

Change-Id: I602e889ae12756c0c40e409d6439ac36cc1b5382
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-03-22 20:52:07 +08:00
Jason Zhu c3230cf0df lib: avb: add bootloader-min-versions
The bootloader include uboot and trust. The uboot slot index
number is 0. The trust slot number index is 1.

Change-Id: Ia62edbf60486fa4128756458c6312f682a83d0f7
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-22 10:57:04 +08:00
Jason Zhu df50318e9d lib: avb: add slot number to avb-min-versions
Acording to google, the avb-min-versions includes the slot number
rather than the image rollback-index stored in the image.

PIK/PSK: use AVB_ATX_PSK_VERSION_LOCATION and AVB_ATX_PIK_VERSION_LOCATION
as slot number.

Change-Id: I06b8d107e27f1e0f136b5e964c1287bc13f80b7c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-22 10:57:04 +08:00
Hisping Lin 3251364c8e lib: optee_client: support rk file system for optee v2
uboot can secure store data to nand or emmc "security"
partition for optee v2

Change-Id: I85abbfb3970a2fa3f46f540d3f16dfc7ca605317
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-03-21 16:18:53 +08:00
Hisping Lin 8e407a7f44 lib: optee_client: fix compare bug in keymaster TA
uboot send data and data length to keymaster TA, keymaster
TA secure store the data, and read temp data from secure
store, compare data and temp data, but the compare length
use temp data length is wrong, fix the bug to use data length.

Change-Id: I900a7ab1b1e95ca844dfb7327c34c793cf635278
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-03-09 10:32:54 +08:00
Jason Zhu 82e713e13f lib: avb: support set_key_version
the lib avb use this function to set key version

Change-Id: Id0903b3326a0d6a0eadebd1ce23a19f92102908c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-07 16:45:39 +08:00
Hisping Lin e37b3ef462 lib: optee_client: update keymaster TA
uboot read date return error when file not exit,
do not to create new file.

Change-Id: Ic4cbc631b9e75dc345759d6d0dbcc86250245511
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-03-06 17:32:58 +08:00
Hisping Lin d7407b119c lib: optee_client: move CONFIG_OPTEE_V1/V2 define
move CONFIG_OPTEE_V1/V2 to lib/optee_clientApi/Kconfig

Change-Id: I446454547a186a27110aa95183264154fc538de9
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-03-06 17:32:55 +08:00
Jason Zhu da980a5200 lib: avb: initialize temp_flag before next used
Change-Id: Icbc570fdb1cd1f8ff30309f5776421ee6c4a086b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-05 20:41:36 +08:00
Jason Zhu 90ed034fda lib: avb: change the return value if the item is not found
Change-Id: Ie6d29a59323789c594b4c6e9167c3bbe58e25e9f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-05 20:39:32 +08:00
Jason Zhu 76c40fa69f lib: avb: fix compile error in arm64
Change-Id: I7be9c7bab1721500c70cacb1774b579d2939436a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-03-05 11:35:03 +08:00
Hisping Lin ba8f56d9f1 lib: optee_client: remove printf log
Change-Id: Ie0b41b309544e36c7c39863339bf5888e0683dcb
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-03-02 15:51:12 +08:00
Hisping Lin 1f25ada2a8 lib: optee_client: support new optee message
Change-Id: I83e8da2252f1fef6dff7d388d12e6fb7972cf79e
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2018-02-24 15:41:54 +08:00
Jason Zhu 99ff1ad0c6 lib: avb: fix compile warning
Change-Id: I0cdddc0da44a839371fd8b6d6402053e505976fd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-02-10 10:48:41 +08:00
Jason Zhu 187a5bc522 lib: avb: declare some functions externally
1. extern load_metadata
2. extern save_metadata_if_changed

Change-Id: I3afe604c39a5f7cf31a0a28d7cc939da51295c10
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-02-10 10:48:30 +08:00
Jason Zhu 459bc93392 lib: avb: get the dev_desc by function rockchip_get_bootdev
Change-Id: I62211b54b0efc11e232d9473a9f566c9fa82b3d8
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-02-10 10:48:21 +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 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
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
Goldschmidt Simon 6222c40124 spl: make CONFIG_OF_EMBED pass dts through fdtgrep
Building spl with CONFIG_OF_EMBED enabled results in an error message
on my board: "SPL image too big". This is because the fdtgrep build
step is only executed for CONFIG_OF_SEPARATE.

Fix this by moving the fdtgrep build step ('cmd_fdtgreo') from
scripts/Makefile.spl to dts/Makefile so that the reduced dtb is
available for all kinds of spl builds.

The resulting variable name for the embedded device tree blob changes,
too, which is why common.h and fdtdec.c have tiny changes.

Change-Id: I2bf2d9780a544ac602752527d17f14aa6b12c5a2
Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-26 16:40:36 +08:00
Masahiro Yamada 0e13c182e0 Move CONFIG_PANIC_HANG to Kconfig
Freescale (NXP) boards have lots of defconfig files per board.
I used "imply PANIC_HANG" for them.

Change-Id: I56347810ee33ccd8bb3553b0ee95b858e827ce9b
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 7e3caa81e0e9cc5e2beed4a3a1c334e2119f4498)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 70b70db64a UPSTREAM: libfdt: migrate fdt_wip.c to a wrapper of scripts/dtc/libfdt/fdt_wip.c
Now, lib/libfdt/fdt_wip.c is the same as scripts/dtc/libfdt/fdt_wip.c

Change the former to a wrapper of the latter.

Change-Id: Ifce4c63db38146297c14218ef94d226bf6e3bb27
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>
(cherry picked from commit 26e961c8cfdff00c5c9389d301d9a2eb10eb844c)
2018-01-17 15:27:28 +08:00
Masahiro Yamada e1c3728190 UPSTREAM: libfdt: move fdt_find_regions() to fdt_region.c from fdt_wip.c
All the other fdt_*_region() functions are located in fdt_region.c,
while only fdt_find_regions() was added to fdt_wip.c, strangely.

Move it to the suitable place.

Change-Id: I463419815b4132b6e39b5b02a857126201a854fb
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>
(cherry picked from commit 87be1e9fb4dcc130e90d497cc5ce49c715efc6c2)
2018-01-17 15:27:28 +08:00
Marek Vasut acda6ec11c UPSTREAM: fdtdec: Support parsing multiple /memory nodes
It is legal to have multiple /memory nodes in a device tree . Currently,
fdtdec_setup_memory_size() only supports parsing the first node . This
patch extends the function such that if a particular /memory node does
no longer have further "reg" entries and CONFIG_NR_DRAM_BANKS still
allows for more DRAM banks, the code moves on to the next memory node
and checks it's "reg"s. This makes it possible to handle both systems
with single memory node with multiple entries and systems with multiple
memory nodes with single entry.

Change-Id: Idc8b4bebc916b6a6bc0d2deb3c4008921d268d1e
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 942ee0933e881ff500aae7e42309bf6abbc495d4)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 5d099091a8 UPSTREAM: lib: libfdt: wrap scripts/dtc/libfdt/* where possible
lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
followings 6 files:
  fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
  fdt_sw.c

Make them a wrapper of scripts/dtc/libfdt/*.  This is exactly what
Linux does to sync libfdt.  In order to make is possible, import
<linux/libfdt.h> and <linux/libfdt_env.h> from Linux 4.14-rc5.

Unfortunately, U-Boot locally modified the following 3 files:
  fdt_ro.c fdt_wip.c fdt_rw.c

The fdt_region.c is U-Boot own file.

I did not touch them in order to avoid unpredictable impact.

Change-Id: I154855ba51291bf56775714c0066247431d66244
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 50a327ded68b7e675389ad284ea3f8c62e683bda)
2018-01-17 15:27:28 +08:00
Masahiro Yamada b63953bc21 UPSTREAM: libfdt: change libfdt_internal.h to a wrapper of scripts/dtc/libfdt/*
Fortunately, U-Boot did not modify libfdt_internal.h locally.

Change it to a wrapper of scripts/dtc/libfdt/fdt.h, which will be
periodically synced with the upstream DTC (or kernel).

Change-Id: Ia9e6f3ca1f19a3cfe9f85b02ae792e85cf81798e
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 35a33baea59210924bceedabcfba794f0fed59dd)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 81a2b0debe UPSTREAM: libfdt: change fdt.h to a wrapper of scripts/dtc/libfdt/*
Fortunately, U-Boot did not modify fdt.h locally.

Change it to a wrapper of scripts/dtc/libfdt/fdt.h, which will be
periodically synced with the upstream DTC (or kernel).

Change-Id: I3a40cb81ecacf189af3f04fe0b599628f70f81f9
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9e65b01ac57f7be2bbc17c9f4c0ee43fab22221e)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 815366520a UPSTREAM: pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefile
The pylibfdt is used by dtoc (and, indirectly by binman), but there
is no reason why it must be generated in the tools/ directory.

Recently, U-Boot switched over to the bundled DTC, and the directory
structure under scripts/dtc/ now mirrors the upstream DTC project.
So, scripts/dtc/pylibfdt is the best location.

I also rewrote the Makefile in a cleaner Kbuild style.

The scripts from the upstream have been moved as follows:

  lib/libfdt/pylibfdt/setup.py -> scripts/dtc/pylibfdt/setup.py
  lib/libfdt/pylibfdt/libfdt.i -> scripts/dtc/pylibfdt/libfdt.i_shipped

The .i_shipped is coped to .i during building because the .i must be
located in the objtree when we build it out of tree.

Change-Id: I48233cbae93794809397b7160234469f66fa11dc
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 15b97f5c5e6d88e0560c6928f3acd01c999a494d)
2018-01-17 15:27:28 +08:00
André Draszik 726c9bee54 UPSTREAM: tpm: fix reading of permanent flags
The offset of the permanent flags structure is in a different
place in the response compared to what the code is doing,
which gives us a completely useless result.

Fix by replacing hand-crafted code with generic parser
infrastructure.

Change-Id: I29e8e1ec7c8ae04d2bf9815290064a54a68c2b88
Signed-off-by: André Draszik <adraszik@tycoint.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit e8155dfe33eb2b3e538e8717d6578c1d08651454)
2018-01-17 15:27:28 +08:00
zijun_hu 51380c3b1c ARMv8: get new GD address from gd->new_gd directly
the new GD address is calculated via board data BD currently
it require the new GD area locates below BD tightly, so a strict
constraint is imposed on memory layout which maybe make special
platform unpleasant.

fix it by getting new GD address from gd->new_gd directly.

Change-Id: I9fdfbbb13a7b0a572d7aa8394f754148c6285669
Signed-off-by: zijun_hu <zijun_hu@htc.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 01a835998935b78c31e80227358ac11212d60878)
2018-01-17 15:27:28 +08:00
Jean-Jacques Hiblot 476f6045b8 UPSTREAM: spl: dm: Make it possible for the SPL to pick its own DTB from a FIT
u-boot can be embedded within a FIT image with multiple DTBs. It then
selects at run-time  which one is best suited for the platform.
Use the same principle here for the SPL: put the DTBs in a FIT image,
compress it (LZO, GZIP, or no compression) and append it at the end of the
SPL.

Change-Id: Ifebdd14bdf1abc923d228f9f3947e719c8645356
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
[trini: Move default y of SPL_MULTI_DTB_FIT_DYN_ALLOC to it being the
default choice if SYS_MALLOC_F, drop spl.h include from lib/fdtdec.c
it's unused.]
Signed-off-by Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 2f57c95100f231de0f4e0301237cbe477e09084b)
2018-01-17 15:27:28 +08:00
Jean-Jacques Hiblot 6f869ebd90 UPSTREAM: fdtdec: sort include files
Sort include files in accordance to U-Boot coding style.

Change-Id: I3c7992edd31468f4105a95b86a6f05108e751e92
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 035d64025c3e32a2f372981f86fc69255feeb2b2)
2018-01-17 15:27:28 +08:00
Jean-Jacques Hiblot 205ac79efb UPSTREAM: lib: allow building lzo for the SPL
Change-Id: If6ccf36b13632f5450f700b8931975a4742a698e
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit f52bdf4b678defea2341aa4b68736e6978180222)
2018-01-17 15:27:28 +08:00
Jean-Jacques Hiblot 194712615e UPSTREAM: gzip: add a function to parse the header
Change-Id: I9829ad25a955eb4764ae2e66f1c32751703d9ae6
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 376ddf9d4a21d0af4c70e97c52e5f0854fb2d696)
2018-01-17 15:27:28 +08:00
Jean-Jacques Hiblot df70772d8a UPSTREAM: lzo: add a function to check the validity of the header
Change-Id: I8835606db327dc958e90ce717ae4fe85439b46e3
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d753f942ec12e6b5b2db73698aa6c55588053d3a)
2018-01-17 15:27:28 +08:00
Jean-Jacques Hiblot 2bbcffb1d3 UPSTREAM: dts: renamed FIT_EMBED to MULTI_DTB_FIT and moved it to the dts Kconfig
CONFIG_FIT_EMBED might be confused with CONFIG_OF_EMBED, rename it
MULTI_DTB_FIT as it is able to get a DTB from a FIT image containing
multiple DTBs. Also move the option to the Kconfig dedicated to the DTS
options and create a README for this feature.

Change-Id: Ide55c474339db3ccd5e20499c54c8bb41fe3a2c9
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 11955590a284ecb75892aad5f1174ca1b94a709b)
2018-01-17 15:27:28 +08:00
Marek Behún 92193ef734 UPSTREAM: lib: Add CRC32-C
This is needed for BTRFS.

Change-Id: I7415e99a6f06aef89f3520ebe9a9ba92a9189059
Signed-off-by: Marek Behun <marek.behun@nic.cz>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 85d8bf57131a21424b50e50884372e813345f09a)
2018-01-17 15:27:28 +08:00
Pantelis Antoniou d80212386f UPSTREAM: fdt: Allow stacked overlays phandle references
This patch enables an overlay to refer to a previous overlay's
labels by performing a merge of symbol information at application
time.

In a nutshell it allows an overlay to refer to a symbol that a previous
overlay has defined. It requires both the base and all the overlays
to be compiled with the -@ command line switch so that symbol
information is included.

base.dts
--------

	/dts-v1/;
	/ {
		foo: foonode {
			foo-property;
		};
	};

	$ dtc -@ -I dts -O dtb -o base.dtb base.dts

bar.dts
-------

	/dts-v1/;
	/plugin/;
	/ {
		fragment@1 {
			target = <&foo>;
			__overlay__ {
				overlay-1-property;
				bar: barnode {
					bar-property;
				};
			};
		};
	};

	$ dtc -@ -I dts -O dtb -o bar.dtb bar.dts

baz.dts
-------

	/dts-v1/;
	/plugin/;
	/ {
		fragment@1 {
			target = <&bar>;
			__overlay__ {
				overlay-2-property;
				baz: baznode {
					baz-property;
				};
			};
		};
	};

	$ dtc -@ -I dts -O dtb -o baz.dtb baz.dts

Applying the overlays:

	$ fdtoverlay -i base.dtb -o target.dtb bar.dtb baz.dtb

Dumping:

	$ fdtdump target.dtb
	/ {
            foonode {
                overlay-1-property;
                foo-property;
                linux,phandle = <0x00000001>;
                phandle = <0x00000001>;
                barnode {
                    overlay-2-property;
                    phandle = <0x00000002>;
                    linux,phandle = <0x00000002>;
                    bar-property;
                    baznode {
                        phandle = <0x00000003>;
                        linux,phandle = <0x00000003>;
                        baz-property;
                    };
                };
            };
            __symbols__ {
                baz = "/foonode/barnode/baznode";
                bar = "/foonode/barnode";
                foo = "/foonode";
            };
	};

Change-Id: If72870ec3e9260ccd4fbcbaff27ba035d001bd00
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit f00c36a01e774dea1ed2a1171da9e372610ee8eb)
2018-01-16 18:16:48 +08:00
Tien Fong Chee 174235d4a2 UPSTREAM: libfdt: Initialize the stack variable
Report Coverity log:
The code uses a variable that has not
been initialized, leading to unpredictable
or unintended results.

Change-Id: I488a9d183590a2dc1ef049351d0c71a4eded2299
Reported-by: Coverity (CID: 60519)
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 18c991ca2bd72c30b7fb578cee8b5c7c835d383d)
2018-01-16 18:14:14 +08:00
Rob Clark 48d1b0a57c UPSTREAM: lib: strto: fix incorrect handling of specified base
The strto functions should honor the specified base (if non-zero) rather
than permitting a hex or octal string when the user wanted (for example)
base 10.

This has been fixed somewhere along the way in the upstream linux kernel
src tree, at some point after these was copied in to u-boot.  And also
in a way that duplicates less code.  So port _parse_integer_fixup_radix()
to u-boot.

Change-Id: I4e2383c6d8ac4666e7e4e40b15f7577522bc9700
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 2e794614838292499910060509d3c4a7aaed986a)
2018-01-16 18:14:09 +08:00
Rob Clark aa5728ff9b UPSTREAM: vsprintf.c: add GUID printing
This works (roughly) the same way as linux's, but we currently always
print lower-case (ie. we just keep %pUB and %pUL for compat with linux),
mostly just because that is what uuid_bin_to_str() supports.

  %pUb:   01020304-0506-0708-090a-0b0c0d0e0f10
  %pUl:   04030201-0605-0807-090a-0b0c0d0e0f10

It will be used by a later efi_loader paths for efi variables and for
device-path-to-text protocol, and also quite useful for debug prints
of protocol GUIDs.

Change-Id: I6b0920ae6fe99ac0638c9c3c8eed6ea3f964d2b5
Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 22ada0c8e6d50281af72176eecdfc356c794639c)
2018-01-16 18:13:59 +08:00
Rob Clark 5ec685037a UPSTREAM: vsprintf.c: add UTF-16 string (%ls) support
This is convenient for efi_loader which deals a lot with UTF-16.  Only
enabled with CC_SHORT_WCHAR, leaving room to add a UTF-32 version when
CC_SHORT_WCHAR is not enabled.

Change-Id: I3c6cd45db5f29157760f99bc5956b482ff96fc6c
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 274325c50951dd16ad2a6f45e79dc062ad47011b)
2018-01-16 18:13:59 +08:00
Rob Clark 407d40f45f UPSTREAM: lib: add some utf16 handling helpers
We'll eventually want these in a few places in efi_loader, and also
vsprintf.

Change-Id: I6c04463ad364e46730fcc84b86d38400f433e8de
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 78178bb0c9dfe2a91a636a411291d8bab50e8a7d)
2018-01-16 18:13:59 +08:00
Simon Glass 48545cfb07 UPSTREAM: moveconfig: Use fd.write() instead of print >>
Adjust this code so that it can work with Python 2 and 3.

Fixes: d73fcb1 (moveconfig: Support building a simple config database)
Change-Id: Ifad4813594adfaf6504cc85f2ee99afb9d1c0fd2
Reported-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c79d18c4b40d10c0a95b56e51f4517aca4515364)
2018-01-16 18:13:59 +08:00
York Sun b81c4739f4 UPSTREAM: spl: fit: Eanble GZIP support for image decompression
Add Kconfig option SPL_GZIP and SPL_ZLIB to enable gunzip support for
SPL boot, eg. falcon boot compressed kernel image.

Change-Id: I68f64aca8ecad26478f2ce25676253cee7e57d30
Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 7264f2928b46c5f5685e39ed607652c8991e47b6)
2018-01-16 18:13:41 +08:00
Hisping Lin df3e17bde5 lib: optee_client: Fix compile error.
this bug make compile error when we compile all code in android.

Change-Id: Id9b8673576bee13c4df0990bd068548fa11458bf
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-12-08 11:25:16 +08:00
Cody Xie 95a5167379 libavb: Fix compile warning.
Change-Id: I6a36f02348e61c166334221edc157ee8a261253a
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
(cherry picked from commit a0e0ea07af830fdf873fb874a7e76264597bca3b)
2017-11-22 10:43:28 +08:00
Andy Ye 4aa617558f lib: optee_client: add attestation protocol support using optee
support attestation commands:
at-attest-dh,at-attest-uuid,at-get-ca-request,at-set-ca-request

Change-Id: I3fe94befa57a131e89dbe136c065a948b1631756
Signed-off-by: Andy Ye <andy.ye@rock-chips.com>
2017-11-20 10:32:54 +08:00
Jason Zhu ceecd5fea6 lib: avb: support the atx and public_key verify
1.support the permanent attribute verify
2.support the PRK, PIK, PSK certificate verify
and then get the psk public_key, compare it with
public_key in vbmeta.

If the function is required, please open the macro
AVB_VBMETA_PUBLIC_KEY_VALIDATE.

Change-Id: Ifeab776c76f97fadd980671481ce27d203516673
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu fd717dcefe lib: avb: support write efuse
Write the permanent attributes hash to efuse.

Change-Id: Id11586a66f055e7eb1a66997814f351509d49b21
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:29:57 +08:00
Jason Zhu e291f58fb4 lib: avb: modify load boot partition size
Load the boot image real size other than the
boot partition size. If not, the uboot can not
malloc a big buffer for the all boot partition.

Change-Id: Ifc8d7cc1f214b94f6018c68cb03e8e9ce89781de
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:26:13 +08:00
Jason Zhu 52b8c717cf lib: avb: close optee client
Change-Id: Iee7c991f7c06acbb064e016e11338cbf846be20d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Hisping Lin 468df3b26a lib: optee_client: add read vboot key flag func
Change-Id: Id0405cc2b695f00b5d7586d01bd0b66279b24430
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu fe83bbf40d lib: avb: add reed/write vbootkey hash
The android things require the soc-v key hash to be flashed
using the fastboot. So these function can be used in fastboot
to flash the key hash.

Change-Id: I6e00f2e1e371793b6f0868356ac0a51090adfe5e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu f74d184a88 lib: avb: add a permanent attribute flag
Add a flag to indicate the permanent attributes
have been written or not.

Change-Id: Id0b22158772bdf18466205df5f08cb0ddb820fbf
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Jason Zhu 5b09015999 lib: avb: change the prefix of some functions to make them coincident
Change-Id: Id876e6e49fb614e43d9f15cd9d24cee29aead223
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:55 +08:00
Hisping Lin 095e2a8236 lib: optee_client: add R&W attribute flag support.
Change-Id: I682e1d9133c005022351c540f843f383703c7c65
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:54 +08:00
Hisping Lin 46b2a054c3 lib: optee_client: write attr to keymaster
updata keymaster ta and write attributes to keymaster

Change-Id: Iac3e64f7e4da1d6b5700d9f049d5fa8b1427b077
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:54 +08:00
Hisping Lin 2cd27853d2 lib: optee_client: add R&W vboot key hash func
uboot can read vboot key hash from efuse and write
vboot key hash to efuse, secure boot will be enable
after you write vboot key hash.

Change-Id: Ibe7b2a5778a3f38e13a241261617f1be8537c88e
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:54 +08:00
Hisping Lin 165396163e lib: optee_client: notify optee when uboot end
trusty_notify_optee_uboot_end() function is used before uboot
jump into kernel, then optee will free memery and denied
call some tipc functions, denied call read write attribute hash.

Change-Id: I96b5687e1afd5bfdf1780ed1641f5fff2fc17eee
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:54 +08:00
Hisping Lin 6ef445a4c2 lib: optee_client: add support for R&W efuse
Change-Id: I8b06523c5379f253994c3ad89aa3b354d79b4c45
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:53 +08:00
Hisping Lin ae8ec5e139 lib: optee_client: change file name
change OpteeClientTest.c to OpteeClientInterface.c

Change-Id: I68b32a2a4757af655bd4eaa723067f024ff112ef
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:53 +08:00
Jason Zhu e7e0443e3e avb: modify the function read_from_partition and write_to_partition
There is no need to malloc a space if offset
and num_bytes is multiple of 512 in function
read_from_partition.

The blk_dwrite in write_to_partition do not
return 1 if execute success. So do not need
to judge the return value.

Change-Id: Icd5681815640e86166d05ab3fc74f95d669621c7
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:53 +08:00
Jason Zhu 5170bcddec avb: provide read/write vboot state function for fastboot
Change-Id: I197868d00a24719ce504a25fb81dc1577d2a214e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:52 +08:00
Jason Zhu 023e4d5516 avb: provide read-write flash_lock_state functions for fastboot
Change-Id: Id6135c58416b0b914d2de8b5d911bf9eb02c5c60
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:52 +08:00
Jason Zhu ccc0859168 tipc: add read/write flashing lock state
The new fastboot cmd need to store the flashing
lock state in order to prevent flash. And the state
is stored in rpmb. So the tipc provide the functions
to read/write the flash_lock_state.

Change-Id: Idf6eb7de7aff1b3257fcd70d0fc87ac7634de4d0
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:52 +08:00
Jason Zhu b71a2499bf avb: provide some functions used by fastboot
In the avb process, the pub_key must be verified
by some permanent attributes.The permanent attributes
is written by fastboot. So the write_permanent_attributes
function is provided to write permanent attributes.
the read_permanent_attributes functions is provided to
verified the data.

Change-Id: Ib448c31062e34ce7f15fc32ab141793755bacf8a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:51 +08:00
Jason Zhu 2d07abe111 tipc: change the tipc compile conditions
Since the tipc is not used in tpl and
spl, we just compile tipc and generate
in u-boot.bin.

Change-Id: Id2845aef127d209c8243cb4cfee8dfbd04ba1305
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:50 +08:00
Jason Zhu 38de3d97e4 avb: add avb config to spl and tpl
Change-Id: Idc5102e29c4b66acacda554f3c61903606314025
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:50 +08:00
Jason Zhu 844d3f39ae libavb_user: add config depended on tipc
In the avb_ops_user.c file, we use some
functions provided by tipc, so excute the
functions may depend on tipc. If the config
is not enable, it may compile fail.

Change-Id: I323f7e8d675407f2ec2f9f5358d1696b3b118880
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:50 +08:00
Jason Zhu 6c551138ca avb: create avb function for user use
The libavb_user provide some fuctions to get
a/b and avb information from misc or vbmeta
partitions, which can be use in libavb...

It also can use to enable or disable the verification
function by using avb_user_verity_set in the file
avb_user_verify.c.

Since we use fastboot to program our firmware,
some necessary function is provided to fastboot
to get useful information, like slot number, current
slot and so on.

Some functions in the avb_ops_user.c, like read_rollback_index,
depend on the OpteeClientTest.h.

Change-Id: I94f77db30d5c7896724b5da3d218041ebdc1f46a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:49 +08:00
hisping abdd243750 lib: add tipc functions
tipc functions is used for uboot communicate
with TEE. uboot can request service for secure
store or secure algorithm.

Change-Id: Ie44095aff4c044feceb5f362abf6e3d24ceb8d4c
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:49 +08:00
Jason Zhu 3ccd4bb0b4 avb: support vbmeta key_pub verify
Android Things requires specific public key
metadata and verification logic to correctly
verify vbmeta public keys.

This commit provide fuction avb_atx_validate_vbmeta_public_key
to verify the vbmeta.

Change-Id: I227e93b342671b4395cbaa7dea2121cbf0d7234b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:48 +08:00
Jason Zhu cf7c71c1bf avb: add functions to choose a/b system
This commit is based on google avb, and it
can be getted by https://android.googlesource.com/platform/external/avb.

This new rk_libavb_ab depend on rk_libavb.

This commit provide some useful functions.
The function of avb_ab_flow can be use to
chose a/b system and flow.The other functions
can be used to debug.

Change-Id: I768272286898b36e9a64749ff30bc6ff0cb019a1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:48 +08:00
Jason Zhu 5b69db0720 avb: add the google avb to lib
The avb lib is provided by google, and it must be
used in the android things to boot and verify
android system. It can be getted in
https://android.googlesource.com/platform/external/avb.

Then we can use the functions suported by avb to program
the a/b and avb code.

Change-Id: I09371fe53cd50233a69533cfa09d5ebca5b10871
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:48 +08:00
Joseph Chen 5492555290 arm: armv7: introduce cpu suspend and resume support
Just like linux, it supports cpu save and restore context
during enter and exit low power mode. With this patch, cpu
is able to suspend with core power off.

Workflow for trap into ATF for system suspend:
	cpu_suspend
	   -> cpu_do_suspend
	      -> arch specific fn: int (*fn)(unsigned long)
		  -> psci_system_suspend(deliver 'cpu_resume()' address to ATF)
		     -> ATF system suspend
		     <- ATF system resume
	      <- cpu_resume
	   <- cpu_do_resume
	next instruction

Notice: If needed, you should remember to save and restore GIC by yourself.

Change-Id: I5cb6fb6ac5b6a7f4ec4a975b0fc38250b000b28e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-11-09 09:57:50 +08:00
Paweł Jarosz a3584243c9 mtd: nand: add the rockchip nand controller driver
Add basic Rockchip nand driver.

Driver in current state has 16, 24, 40, 60 per 1024B BCH/ECC ability and 8 bit asynchronous flash interface support. Other features will come later.

Change-Id: I8e766afe7358a2357d75cfe094c4cd6fe92bd281
Signed-off-by: Paweł Jarosz <paweljarosz3691@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-07 16:30:52 +08:00
Zhangbin Tong c634813016 lib: add bit reverse library config
Change-Id: Ib3d72274b07fb088d320f751a8a576338f3a4d0b
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-10-25 10:29:12 +08:00
cwz d807358c86 libfdt: add api fdt_node_offset_by_phandle_node() find node with phandle and start node.
Change-Id: I3d7c710367005510ed936e75863f9d3685cb4bc5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: cwz <cwz@rock-chips.com>
2017-10-11 15:55:17 +08:00
yxj f82d121178 libfdt: add function fdt_device_is_available
Change-Id: Ia6c727e246339107c280f715d0e35edd54ce6dc3
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: yxj <yxj@rock-chips.com>
2017-10-11 15:55:16 +08:00
Simon Glass 1b0ab182b4 fdt: Sync libfdt up to upstream
Add upstream changes to U-Boot:

- new pylibfdt functions
- fdt_setprop_placeholder()

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-09-12 16:04:35 +08:00
Kever Yang e2f2fb237e lib: add TPL_OF_LIBFDT option for TPL
TPL may need use libfdt for dt decode, add option for it.

Change-Id: I20a7e7510cb3e10fbad68bd489fe1c5d03b012c3
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-09-12 16:04:31 +08:00
Jonathan Gray 8f1603bd78 bch: don't use __BSD_VISIBLE to test for fls
Commit 4ecc988301 assumes fls is in libc
if __BSD_VISIBLE is defined.  This appears to only be true on FreeBSD
and DragonFlyBSD.  OpenBSD defines __BSD_VISIBLE and does not have fls
in strings.h/libc.

Switch the test for __BSD_VISIBLE to one for __DragonFly__ and
__FreeBSD__ to unbreak the build on OpenBSD.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2017-09-03 15:30:31 -04:00
Adam Ford 6ef2f90108 Convert CONFIG_BCH to Kconfig
This converts the following to Kconfig:
   CONFIG_BCH

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-09-01 20:45:26 -04:00
Anatolij Gustschin f1a7ba1da5 Fix 'notes' typos
s/notes/nodes

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-08-20 09:54:34 -04:00
Tom Rini 5619295995 EFI Fixes for 2017.09:
- Fix GOP w/o display
   - Fix LocateHandle
   - Fix exit return value truncation
   - Fix missing EFIAPI in efi_locate_handle (for x86)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJZlq5xAAoJECszeR4D/txgM9MP/3lZ8gUWCb5iNnIUhTwNyTPG
 T2tCvoI90YkNTY67L/J5JtDR8BaW4D+yJTeR+tIxB7BMMeF/UJ+kLPdncNyF082b
 9h6Ht5m47osSuBji0v8G2/wjkzNAIonXdoVFQxKQ9t3WgjvyWlp4sK6wrmGyukQJ
 Pb6cqEo/BH3u9/+xPZvyv9eZErJukfs4GHawzP1olH50mF8yVGUbJT2ctKhk5m3b
 F5gdp0pPsebISjWhoq8CKxQitDH6WG6IsLJTu0htEGjP5qPtXSIQhKMj4zIBSH9U
 paiO0k7DeQyfiKqeenk9zY+X33T/JlVPmLco4osP70pg6bzYdnjPGAuwpEhiL1cN
 QZcNb+liZceik5iWO1bjAoUd4rOKD4snl6kg6qLUiYCNF2oSo5h8Em3oyHiiw6Dw
 ohX840jdtnl3Xuuo0jCtHZoOH5glWCO+HTZTPhdE0K/9s79yPy59v9RqBNRM5LB+
 dH7Zg/50AtebOLqqd35YQdSaV1im80EbdxLaV1yJsMtQw2xucVHJC099oyTDXcSg
 0pzBDYsQia/hDDvum8TVHheHfz0cJi9u+VrjgauTK2GmcYNr1hxSyM0pSFveB3C3
 C9qP/20yI3ZMuECC67SIfYK5E03bI2gHH8/k+fQEqxYgqqr50I7aWYGw2nFZTecC
 sdWxgTolQsjn/xlfFBWY
 =wyGe
 -----END PGP SIGNATURE-----

Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

EFI Fixes for 2017.09:
  - Fix GOP w/o display
  - Fix LocateHandle
  - Fix exit return value truncation
  - Fix missing EFIAPI in efi_locate_handle (for x86)
2017-08-18 18:24:58 -04:00
Simon Glass bfebc8c965 env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()
We are now using an env_ prefix for environment functions. Rename these
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:32 -04:00
Simon Glass 00caae6d47 env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:24 -04:00
Simon Glass 382bee57f1 env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:22:18 -04:00
Tom Rini c1b62ba9ca Merge branch 'master' of git://git.denx.de/u-boot-rockchip 2017-08-14 10:40:01 -04:00
xypron.glpk@gmx.de 36d35345b1 tpm: add missing va_end
va_start must always be matched by va_end.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13 15:17:29 -04:00
Philipp Tomsich 96b9082c64 rockchip: rk3188: rock: adjust for SPL/TPL split
With the changes to split SPL/TPL for the RK3368, I apparently missed
some needed adjustments to the RK3188 Kconfig and rock_defconfig.

This fixes build-issues for the rock board after applying the RK3368
enablement (and SPL/TPL) set that resulted from TPL_SERIAL_SUPPORT,
TPL_ROCKCHIP_BACK_TO_BROM and TPL_TINY_MEMSET being separate symbols
now.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13 17:12:37 +02:00
Philipp Tomsich 6dced7dffc lib: spl: differentiate between TPL and SPL for libfdt/of_control/of_platdata
This splits the compilation of code modules for TPL and SPL for
OF_CONTROL (and related) features between TPL and SPL.  The typical
use-case of this is a TPL stage that uses OF_PLATDATA at TPL and
provides full OF_CONTROL at SPL (e.g. on the RK3368).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-13 17:12:21 +02:00
xypron.glpk@gmx.de aee4f06dff efi_loader: use EFI_PAGE_MASK instead of EFI_PAGE_SIZE - 1
We should be consistent in the way we calculate page sizes.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-12 14:05:45 +02:00
Rob Clark 3d9880784e efi_loader: GOP fix for no display
uclass_first_device() returns 0 if there is no device, but error if
there is a device that failed to probe.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11 13:49:23 +02:00
Rob Clark 796a78cbe5 efi_loader: LocateHandle should return EFI_NOT_FOUND if none found
Spotted this debugging OpenBSD's bootloader in qemu.  (Wouldn't really
fix anything, the problem was not having any disks, but we should
probably return the correct error code.)

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11 11:08:33 +02:00
xypron.glpk@gmx.de ebf199b92f efi_loader: attribute EFIAPI of efi_locate handle()
efi_locate_handle is called internally so it should not be
marked as EFIAPI.

The external function is efi_locate_handle_ext.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11 10:57:10 +02:00
Alexander Graf c1ae1a1608 efi_loader: Fix warning in efi_gop
Commit ca9193d2b1 ("efi_loader: gop: fixes for CONFIG_DM_VIDEO without
CONFIG_LCD") dropped the explicit (void*) cast for fb_base in efi gop support
for CONFIG_LCD without DM. This patch adds it back, eliminating the now occuring
warning again

Fixes: ca9193d2b1 ("efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD")
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-31 07:28:13 -04:00