Commit Graph

513 Commits

Author SHA1 Message Date
Simon Glass 785b4fbf6c Drop the log buffer
This does not appear to be used by any boards. Before introducing a new
log system, remove this old one.

Change-Id: I798cd4aff50b7136ae9f84362185f9f73b04f710
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c5404b64fb5a35d41f7eff6d12b8ffdb0c851040)
2018-01-17 15:27:28 +08:00
Nobuhiro Iwamatsu 51b432dabb UPSTREAM: cmd: i2c: Fix use sdram sub command with CONFIG_DM_I2C
sdram sub command of i2c command does not support Drivers Model.
This adds Drivers Model support to sdram sub command.

Change-Id: I405d05b9b697715759a68ba71597cd9ae63d9565
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 28df8ed07f2ae936e9af28c146d555ed4d0c122a)
2018-01-17 15:27:28 +08:00
Heinrich Schuchardt 6ff3d5909f UPSTREAM: cmd: blk: remove unreachable code
Remove an unreachable return statement.

Change-Id: I523a83571eade593a08b685519757c1df4ffab25
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 254eedee7f383066b70ac4da01bc792a3256a4b3)
2018-01-17 15:27:28 +08:00
Suneel Garapati 1c7b1b4b19 UPSTREAM: cmd: usb: ignore blk, emulation devices in usb tree/info display
Usb tree/info commands iterate over all usb uclass devices recursively.
Blk uclass devices based on struct blk_desc are created for mass storage
device, treating them as usb uclass devices based on struct usb_device
and referencing usb config interface descriptors cause crash.
To fix, ignore blk and usb_emul uclass devices in usb_show_info
and usb_tree_graph. Also avoid addition of preamble for blk uclass
child devices, otherwise tree dump gets messed up.

Change-Id: If25ca43b08c0918c44583f71282a07c928e5bf53
Signed-off-by: Suneel Garapati <suneelglinux@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit abd7cedb19ab7979467734b3933a39879bd8935a)
2018-01-17 15:27:28 +08:00
Bernhard Messerklinger 853f31c42c UPSTREAM: cmd/fdt.c align data buffer to avoid unaligned word access
Since the compiler is free to place a char array to any address in
memory (in this case the stack), also to a non word aligned address the
function "fdt_prop_parse" runs into troubles upon it wants to write some
(fdt32_t *) to such a variable (if it has been placed to a none word
aligned address).

To avoid this we tell the compiler to always align this scratchpad to a
word aligned address.

Change-Id: I6ea64827a9c245db4ba2a2ff522aaddea647c2f2
Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6dfd65f81fd060a85c961a84f85a286e8e96332c)
2018-01-17 15:27:28 +08:00
Tom Rini c9bf1d5a23 UPSTREAM: cmd/pxe.c: Rework bootargs construction to clarify string checks
As the code currently stands, we first check that the length of the
given command line, along with ip_str/mac_str along with an additional 1
for the NULL termination will fit within the buffer we have, and if not,
we return an error.  The way this code was originally written however
left Coverity "unhappy" due to using strcat rather than strncat.
Switching this to strncat however causes clang to be unhappy that we
aren't enforcing the "1" portion within strncat.  Rather than further
re-work the code to include a "- 1" in this case as well, make the
strcat code only be done within the else side of the length test.  This
keeps both clang and Coverity happy.

Fixes: 48ee0a87bc46 ("cmd/pxe.c: Rework initrd and bootargs handling slightly")
Change-Id: I6a3d3ea54d6b7e1f3c2aed200b2f706f42d570d4
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 59ee8f83b6e77550d5697fced4899e9b5173981f)
2018-01-17 15:27:28 +08:00
Tuomas Tynkkynen b0ec94428e UPSTREAM: Drop CONFIG_HAS_DATAFLASH
Last user of this option went away in commit:

fdc7718999 ("board: usb_a9263: Update to support DT and DM")

Change-Id: Id05869deccb88c1102700dd5af58a8c249e3e9e2
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c68c03f52badc90951dbf8a054c0e500e04bf365)
2018-01-17 15:27:28 +08:00
Tuomas Tynkkynen 9a544e36a8 UPSTREAM: env: Drop CONFIG_ENV_IS_IN_DATAFLASH
Last user of this option went away in commit:

fdc7718999 ("board: usb_a9263: Update to support DT and DM")

Change-Id: Ie6cec28e4daf26b669f3f35db026427bdb47a5b6
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 7b7341d7f3ee915c89a7f8ab7054e39872057d90)
2018-01-17 15:27:28 +08:00
York Sun f9b2adb5dc UPSTREAM: cmd: spl: fix compiling error when CONFIG_CMD_SPL_WRITE_SIZE not defined
CONFIG_CMD_SPL_WRITE_SIZE is used for writing parameters to non-volatile
storage. So far it is only used for NAND. Fix compiling error when this
macro is not used for SD.

Change-Id: I879971e42fb333e1e0ff4e21ce6b34caf8498aa5
Signed-off-by: York Sun <york.sun@nxp.com>
CC: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b65ac633f52da596cfa573bb4a597e2edd2318c8)
2018-01-17 15:27:28 +08:00
Tom Rini fafa35c559 UPSTREAM: cmd: Make CMD_LZMA / CMD_UNZIP default y if CMD_BOOTI
In the Linux Kernel on ARM64, the Image.COMPRESSION file is not
self-extracting in the way that x86 and ARM images are.  So when
CMD_BOOTI is enabled we should also default to enabling CMD_UNZIP and
CONFIG_LZMA in order for the user to be able to decompress many of the
common compressions that will be done to an Image file.

Change-Id: Ic7958458ddc16c8b78ea40ff56d380d02883d76a
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 99e46dfc6a9176f6f0680c9dfdf33c97d56336ce)
2018-01-17 15:27:28 +08:00
Sam Protsenko 70c6966892 UPSTREAM: scripts: Move Kconfig contents to cmd/Kconfig
On case-insensitive file systems we have collision between
scripts/kconfig/ directory and scripts/Kconfig file. This patch moves
scripts/Kcofnig contents to cmd/Kconfig to fix that.

Change-Id: Ia60682a7eb9c3379e6e257b07e799b06e304c95f
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 610eec7f0593574c034054ba54fc1c934755e208)
2018-01-17 15:27:28 +08:00
Tom Rini 017aad0449 UPSTREAM: cmd/gpt.c, cmd/nvedit.c, tools/fit_image.c: Rework recent fixes for Coverity
The recent changes to these files did not completely fix the previous
issues, or introduced different (minor) issues.  In cmd/gpt.c we need to
dereference str_disk_guid to be sure that malloc worked.  In
cmd/nvedit.c we need to be careful that we can also fit in that leading
space when adding to the string.  And in tools/fit_image.c we need to
re-work the error handling slightly in fit_import_data() so that we only
call munmap() once.  We have two error paths here, one where we have an
fd to close and one where we do not.  Adjust labels to match this.

Change-Id: I66fafd0ed8d1c290a7773bba5ece8d11bfc15b50
Reported-by: Coverity (CID: 167366, 167367, 167370)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bf52fcdef4aac242b5e6b6b9827acf6d69ce1951)
2018-01-17 15:27:28 +08:00
Tom Rini 8ab67e0d6c UPSTREAM: cmd/time.c: Initialize 'repeatable' variable
We cannot leave this uninitialized, set it to 0.

Change-Id: Ic8f3dd4d7395921bf4269a618aaf92a717dbfe46
Reported-by: Coverity (CID: 144426)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 146dda391126d4f199c7692f2342efcc34b45ebd)
2018-01-17 15:27:28 +08:00
Tom Rini 7f2f366160 UPSTREAM: cmd/pxe.c: Rework initrd and bootargs handling slightly
For the initrd portion of handling our bootm arguments we do not have a
sufficiently long enough buffer for some improbable 64bit cases.  Expand
this buffer to allow for a 64bit address and almost 256MB initrd to be
used.  Make use of strncpy/strncat when constructing the values here
since we know what the worst case valid values are, length wise.

Similarly for bootargs themselves, we need to make use of strlen/sizeof
and strncpy/strncat to ensure that we don't overflow bootargs itself.

Cc: Simon Glass <sjg@chromium.org>
Cc: Alexander Graf <agraf@suse.de>
Change-Id: I86151e4bde53972d9b6105f3a85db93b114e22d8
Reported-by: Coverity (CID: 131256)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 48ee0a87bc46a6f863ffd9e0396b7a068dd68c50)
2018-01-17 15:27:28 +08:00
Tom Rini bc846a8c08 UPSTREAM: cmd/nvedit.c: Update input handling to cover overflow cases
When we have multiple messages provided, we need to be sure that we do
not exceed the length of our 'message' buffer.  In the for loop, make
sure that pos is not larger than message.  Only copy in at most however
much of the message buffer remains.  Finally, if we have not reached the
end of the message buffer, put in a space and NULL, and if we have,
ensure the buffer is now NULL termined.

Change-Id: I0c4f88803f8525eb6ef0207a6b7fdbec2b43e9ff
Reported-by: Coverity (CID: 165116)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c667723ffb50b00585b729ee0da7b0e8c93ffa13)
2018-01-17 15:27:28 +08:00
Alison Chaiken cb40c099ea UPSTREAM: GPT: fix memory leaks identified by Coverity
Create a common exit for most of the error handling code in
do_rename_gpt_parts.   Delete the list elements in disk_partitions
before calling INIT_LIST_HEAD from get_gpt_info() a second time.

The SIZEOF_MISMATCH error is not addressed, since that problem was
already fixed by "GPT: incomplete initialization in
allocate_disk_part".

Change-Id: I4ec9881a86c8a50960844e07f69c04a239bc218f
Signed-off-by: Alison Chaiken <alison@peloton-tech.com>
Reported-by: Coverity (CID: 167222, 167235, 167237)
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 18030d04d25d7c08d3deff85881772a520d84d49)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 90aa625c9a treewide: replace with error() with pr_err()
U-Boot widely uses error() as a bit noisier variant of printf().

This macro causes name conflict with the following line in
include/linux/compiler-gcc.h:

  # define __compiletime_error(message) __attribute__((error(message)))

This prevents us from using __compiletime_error(), and makes it
difficult to fully sync BUILD_BUG macros with Linux.  (Notice
Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

Let's convert error() into now treewide-available pr_err().

Done with the help of Coccinelle, excluing tools/ directory.

The semantic patch I used is as follows:

// <smpl>
@@@@
-error
+pr_err
 (...)
// </smpl>

Change-Id: I921807c1770d36a91e692c48ab477558bb2ed0b8
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Re-run Coccinelle]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9b643e312d528f291966c1f30b0d90bf3b1d43dc)
2018-01-17 15:27:28 +08:00
Maxime Ripard 14464b32f6 UPSTREAM: cmd: Move CONFIG_RANDOM_UUID to Kconfig
CONFIG_RANDOM_UUID is used by the GPT command to generate random UUID when
none are provided.

Move that option to Kconfig.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Change-Id: Ie4c840fb583d1e5c95170e452ccbb04034926119
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 47738acceda5bae52b7c33ce912da6b52244c033)
2018-01-17 15:27:28 +08:00
Heinrich Schuchardt 3152629475 UPSTREAM: GPT: incomplete initialization in allocate_disk_part
memset(newpart, '\0', sizeof(newpart));
only initializes the firest 4 or 8 bytes of *newpart and not the whole
structure disk_part.

We should use sizeof(struct disk_part).

Instead of malloc and memset we can use calloc.

Identified by cppcheck.

Fixes: 09a49930e4 GPT: read partition table from device into a data structure
Change-Id: Ifc937b64f6ac6abc56c0c6bb3d094c2316b9268e
Reported-by: Coverity (CID: 167228)
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit f66bc0e0beeff7fa27c29f740d2f314d63b3346d)
2018-01-16 18:17:07 +08:00
Heinrich Schuchardt 10eca96895 UPSTREAM: efi_loader: bootefi hello should use loadaddr
Command 'bootefi hello' currently uses CONFIG_SYS_LOAD_ADDR
as loading address.

qemu machines have by default 128 MiB RAM.
CONFIG_SYS_LOAD_ADDR for x86 is 0x20000000 (512 MiB).
This causes 'bootefi hello' to fail.

We should use the environment variable loadaddr if available.
It defaults to 0x1000000 (16 MiB) on qemu_x86.

Change-Id: Iff6bfbd6c93f115f7f616c42b6e1c2dc4d61e156
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 51c533fdce75fbdec7de28a05a675a553d209bcb)
2018-01-16 18:16:48 +08:00
Bin Meng ec5e502c14 UPSTREAM: cmd: blk: Use LBAFU in the common block command
There is already a macro LBAFU to aid formatted print with lbaint_t
variables. Let's use it in the common block command codes.

Change-Id: I93256536d5af97877ecf9c4edc36d268b498dd1b
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit e2888a7fa7f8d23396c4b25ea763fe1f38851b3d)
2018-01-16 18:16:48 +08:00
Bin Meng 010034028f UPSTREAM: blk: Remove various places that do flush cache after read
All these places seem to inherit the codes from the MMC driver where
a FIXME was put in the comment. However the correct operation after
read should be cache invalidate, not flush.

The underlying drivers should be responsible for the cache operation.
Remove these codes completely.

Change-Id: I8f04c721432753b34e85b19616a0b42d83a633eb
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: York Sun <york.sun@nxp.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 723b43daec7ee2ddb600cfcb9b0253d4a71c3915)
2018-01-16 18:16:48 +08:00
Pantelis Antoniou 7c95a4956f UPSTREAM: fdt: Switch to using the verbose overlay application method
The verbose overlay application method prints out more helpful
messages, so switch to it.

Change-Id: Ie8bd31e939e3c12fe547028d0fa3ddc8b254d33d
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 81ecc5d92badfcf1415a6052b5896a62271a94dc)
2018-01-16 18:16:48 +08:00
York Sun 40484c6d8c UPSTREAM: cmd: spl: Fix compiling warning
Fix warning "cast from pointer to integer of different size".

Change-Id: Ib6306c30cdbfc180c5cd452def44eb661cc4fc28
Signed-off-by: York Sun <york.sun@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d1f2ee7021dc4a89f43e25f289747a27da0e930f)
2018-01-16 18:13:50 +08:00
Kever Yang 7ad0afacd5 rockchip: bootrkp: add log when boot from recovery
Add a log to show boot from recovery.

Change-Id: I8302820558d53e6b239533806305b2dec7c38c0c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-12 15:40:12 +08:00
Kever Yang 32af749a74 rockchip: bootrkp: update cmd name
Change-Id: If67d534c73b6ea0ba432dceb85f10e6ee4322e16
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 16:50:11 +08:00
Kever Yang 891380b57d cmd: boot_android: support legacy aosp image from rockchip
New cmd usage:
boot_android mmc 0

update boot_android:
- do not need provide argv for misc partition and slot
- If CONFIG_ROCKCHIP_RESOURCE_IMAGE is enabled, try to get dtb from resource
partition.

Change-Id: I7242880f9cde916ca10d677ddac07790c66a07a4
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-08 18:13:25 +08:00
Kever Yang a0e58cf2cc cmd: bootrkp: add a cmd for rockchip rkimg bootloader
'bootrkp' will find the boot device and find all necessary images.
Basically, these partitions are must:
Kernel.img: kernel Image
Resource.img: kernel dtb and logo
system.img: rootfs

Change-Id: Iba3df2535705fa3ed529377f44f041fa2294ce60
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-08 18:13:25 +08:00
Joseph Chen 05b73bbbfe cmd: charge: support command parameter
This is maily for debug. the format is:
charge <power on soc> <power on voltage> <screen on voltage>

Change-Id: I821d574a386eb2eddd03ef50f543f96cb05b620e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-05 09:34:48 +08:00
Jason Zhu bf17c6275d androidboot: boot the system without a/b avb
Support boot the system in the old mode, and there
is no need to differentiate the _a or _b slot
in the gpt table.

Change-Id: I162e34a9bd0120db051f709faec06daf3bc0aa9c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:32:54 +08:00
Jason Zhu 9aed1a1336 androidboot: add some new info to cmdline
The android things system need some avb info
in the stage of u-boot, like VBH value and so
on.

Change-Id: Ia102931f3b0c912c7e1f34f668d8af0b45fa4a6e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-20 10:32:54 +08:00
Frank Wang dd31eefe79 cmd: rockusb: fix upgrade failed when gpt partitions exist
We found rockusb upgraded failed when there had gpt partitions in
system caused by total sectors checking, this change expose all mmc
partitions for rockusb command.

Change-Id: I8847c3c7885d17d47189c55765f97abb4965e8b4
Reported-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-11-14 11:12:42 +08:00
Wenping Zhang 9f7ea89d5d androidboot: add BOOT_RECOVERY support
if user input "reboot recovery" by adb or serial console,
uboot will load recovery ramfs image to run.

Change-Id: Ibad1709ed78938dbf1826446a0de5c822c6ce4e4
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
split boot_android and boot_mode int two commits.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-11-14 10:55:57 +08:00
Jason Zhu 82ee22d4d3 androidboot: support recovery and fastboot mode
The system must support recovery and fastboot
mode, so the u-boot must judge the boot command
in the misc partition.

Change-Id: I53c876eeefdc20ebe313a6a73d4cfac443fafa67
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu cf7b148dc2 androidboot: free no use buffer
If excute avb_ab_flow() failed, the free the
no use buffer.

Change-Id: I874f3367eceb35424b069a04a1ec35c37b46e639
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Jason Zhu 708de1435a androidboot: close optee client when start kernel
Change-Id: I4b4626e8e2bc89c711988fe23245fa6e71ac7204
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:56 +08:00
Hisping Lin e13fd25b91 rockchip: mmc: add test case.
Change-Id: I87e616c0a0f49f426b5e222fcc56cf5a170b3419
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:54 +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 4397fdfd14 androidboot: modify do_avb_flow
In the fuction do_avb_flow, the return value of
avb_ab_flow() must be judged. If not, the process
can not return to u-boot command line when execute
avb_ab_flow failing.

Change-Id: I925c9c63cee2153d365ea78b286d8958624b106c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:53 +08:00
Jason Zhu f0864c7f9d androidboot: init slot_partition
Change-Id: I1be603307523d245ef8961815a0df38786366d0d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:51 +08:00
Jason Zhu e8e29e8d8b androidboot: add new android boot cmds with avb.
The android things boot must have avb function,
then we add the fuction in file cmd/boot_android.c.
In boot_android.c, we add bootavb flow v/n to
bootload android system.

The bootavb flow v bootload android system
with avb.And bootavb flow n bootload android
system as usual.

Change-Id: I3064f8a4aebf2b4bfdb0cf6f0458f42438c27027
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2017-11-14 10:55:51 +08:00
Hisping Lin 87b8e6decf mmc: add mmc cmd to test tipc functions
input mmc testrpmb to test store data to rpmb.

Change-Id: I0b8361bd7a22fc7854e1a94ae4ae81972e523b3b
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2017-11-14 10:55:49 +08:00
Alex Deymo 170e9eb9d1 android: Fix off-by-one error when joining strings
When concatenating the strings to form a new command line in the
android bootloader flow, the null-terminator was placed one byte after
the end of the allocated string.

Bug: None
Test: booted a rpi3.
Change-Id: I120e09a77bb1c27980e7ce2b5f9b8961424ed0c3
2017-11-14 10:55:47 +08:00
Alex Deymo 180cc7c601 android: Implement A/B slot select.
The android_bootloader_control struct defined in bootloader_message.h
stored the A/B metadata used to decide which slot should we use to boot
the device. This patch implements the bootloader side of the slot
selection in a new "android_ab_select" command which decides the
current slot and updates the metadata as needed.

Bug: 32707546
Test: Booted a rpi3, updated to the other slot.
Change-Id: I9344ff5b76194160d2b466a50e84f4f423b1a98a
2017-11-14 10:55:46 +08:00
Alex Deymo df7cce4361 boot_android: Drop the "mmc" restriction on the partition name.
part_get_info_by_name() was extended to support more than just mmc/efi
partitions. This patch remove this restriction from the
part_get_info_by_dev_and_name() function.

Bug: 32707546
Test: Booted rpi3.
Change-Id: If6399f7d24e99911b3b14a125a6bc1f472b7eecf
2017-11-14 10:55:46 +08:00
Alex Deymo 8062224026 boot_android: Pass the slot from the command.
In order to support booting from either slot, this patch passes the
slot name from the command line.

Bug: 32707546
Test: Booted rpi3.
Change-Id: I30582bd8b1b95dc0f25b0c6624e7909ee4118bd0
2017-11-14 10:55:46 +08:00
Alex Deymo 06f4a8746e Add "boot_android" command.
The new "boot_android" command simply executes the Android Bootloader
flow. This receives the location (interface, dev, partition) of the
Android "misc" partition which is then used to lookup and infer the
kernel and system images that should be booted.

Bug: 32707546
Test: Booted a rpi3 build with Android Things.
Signed-off-by: Alex Deymo <deymo@google.com>

Change-Id: Ibf3f31e38b159d42db7a0835b99ad7ec260fc2a7
2017-11-14 10:55:46 +08:00
Alex Deymo 76e2a5a6c6 Move Android Image loading logic to image-android.c
This patch moves the Android Image loading logic from the load_android
command to a new android_load_image() function in image-android.c so it
can be re-used from other commands.

Bug: 32707546
Test: Booted the rpi3 with this patch.
Signed-off-by: Alex Deymo <deymo@google.com>
Change-Id: I12d206141ead1b94ebbcc90ee05512a276c7595a
2017-11-14 10:55:46 +08:00
Jocelyn Bohr 965eda410b Add support for fastboot command over UDP
The Raspberry Pi does not support USB device mode, so fastboot over
USB does not work. This patch adds support for and partially
implements the device side fastboot UDP protocol as a U-boot command.
It requires an ip address set and ethernet initialized.

- Modify U-boot fastboot command to do fastboot over UDP
- Add net/fastboot.c, which implements fastboot server functions
- Handle QUERY and INIT fastboot packets
- Add CONFIG_UDP_FUNCION_FASTBOOT to enable fastboot over UDP

Bug: 31887729
Test: Tested with fastboot, responds correctly to query and init
      packets.

Change-Id: I4045abaf7a4455d756b7c1c00215afaa90c70a6e
2017-11-14 10:55:44 +08:00
Alex Deymo 83a51ebaaa Add 'load_android' command to load Android images.
Android kernel images include a header that specifies addresses and
kernel size. This patch adds a command to load these images from
storage without specifying the size or address of them, and parsing
them from the header instead.

Bug: 31636643
Change-Id: I84a9cf82cff78ce2299b1981c4f6f9a5720e4d0d
2017-11-14 10:55:44 +08:00