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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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>
'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>
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>
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>
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>
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>
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>
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>
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>
change OpteeClientTest.c to OpteeClientInterface.c
Change-Id: I68b32a2a4757af655bd4eaa723067f024ff112ef
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
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>
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>
input mmc testrpmb to test store data to rpmb.
Change-Id: I0b8361bd7a22fc7854e1a94ae4ae81972e523b3b
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
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
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
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
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
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
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
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
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