If board_fit_config_name_match() doesn't match any configuration node,
then use the default one (if provided).
Change-Id: Ieb93f146a54cb6d75d8f6b395078c315a4fac134
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 02035d0086b3f9114463a9b9df38a5618ffe8a04)
If the dtb is the first data of the FIT, the its offset is 0x0. Change the
test to '<' instead of '<='
Change-Id: Ie6dd1734049f642511db0fc1b19f2af0bec8de04
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 d56b86eec32a700cdc16170ad8365ee7c6522f0e)
Those 2 functions don't modify their input, we can mark it const.
This prevents compilation warnings when they are provided const input.
Change-Id: I9583751451cfc26a99ee94f87447dd6337d0cc67
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 906a9dbbcba85e8b02414c960c75103cc4755102)
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)
While this came in with a default value of 6 I am lowering this to 4.
The MTD/UBI code has a large number of error messages that we include
now. In addition, "normally" warning messages are not included so this
feels like a more natural level to have.
Change-Id: I20bc4b32caf1876d5f6052851580383f00a67dc9
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6a3e65dea3e525b5337ca8014aa4be9f5fafeb92)
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)
When we import code from Linux, with regular re-sync planned, we want
to use printk() and pr_*(). U-Boot does not support them in a clean
way. So, people end up with local macros, or compat headers here and
there, then we occasionally see build errors of definition conflicts.
We have include/linux/compat.h, but putting all sorts of unrelated
things into a single header is just a temporal workaround. Hence this
patch, to find the best home for all printk variants. If you want to
use printk() and friends, please include <linux/printk.h>. This header
is self-contained, and pulls in only a few headers.
When I was testing this clean-up, I noticed the image size exceeded
its platform limit on some boards. This is because all pr_*() that
were previously defined as no-op in include/linux/mtd/mtd.h (unless
CONFIG_MTD_DEBUG is set), are now enabled.
To make such boards happy, this commit also implements CONFIG_LOGLEVEL.
The concept is similar to the kernel parameter "loglevel". (Actually,
the Kconfig help message was taken from kernel-paremeter.txt of Linux)
Messages with a loglevel smaller than console loglevel will be printed.
The difference is the loglevel is build-time determined. To save the
image size, lower priority pr_*() are compiled out. I set the default
of CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages
are compiled in.
I adjusted CONFIG_LOGLEVEL to avoid build error for some boards.
Change-Id: I997d8bbeedd48777be87472df8ed126181fc4b8e
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[trini: Add in SPL_LOGLEVEL that is the same as LOGLEVEL]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b44b30260ffa3dc82f4bb98b022483bb09e95353)
The stored 'blk' value is overwritten to 'size / 512' before it can
be used in usb_stor_set_max_xfer_blk(). This is not what we want.
In fact, when 'size' exceeds the upper limit (USHRT_MAX * 512), we
should simply assign 'size' to the upper limit.
Change-Id: I078963e74b22450d0d876e846e44d93118cff96a
Reported-by: Coverity (CID: 167250)
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 72ac8f3fc29016a31ee309b4d025b487e78906ab)
USB 3.0 hubs report bit[5] in the port status change response as BH
reset. The hub shall set the C_BH_PORT_RESET field for this port.
Change-Id: I54d72aba3b1901c505aec754f2183e4d8d2e82dd
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 061895fbe57d29f50bb3c6c8609d56a668d1387d)
During usb_hub_port_connect_change(), a port reset set feature
request is issued to the port, and later a port reset clear feature
is done to the same port before the function returns. However at
the end of usb_scan_port(), we attempt to clear port reset again
on a cached port status change variable, which should not be done.
Adjust the call to clear port reset to right before the call to
usb_hub_port_connect_change().
Change-Id: Ib3df40451289134cc7e60a37293a33fc9fd35547
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b90203526f2c5bcc05b4a65241ea226b7b9f52d0)
For xHCI it is not possible to read a device descriptor before it
has been assigned an address. That's why usb_setup_descriptor()
was called with 'do_read' being false. But we really need try to
read the device descriptor before starting any real communication
with the default control endpoint.
Change-Id: I14a3f6698ba805f5ef35242ab9b374a91158552c
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 932bb668bb2464115f2d08abbed44e58cfce9536)
Full speed device endpoint 0 can have 8/16/32/64 bMaxPacketSize0.
Other speed devices report fixed value per USB spec. So it only
makes sense if we send a get device descriptor with 64 bytes to
full speed devices.
While we are here, update the comment block to be within 80 cols.
Change-Id: I035b83fb71ce4aa37f23fccba430d65814600a55
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit c008faa77358bb5b313696dd1d5bb8afa03a6ca2)
If there are no CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR and CONFIG_SPL_OS_BOOT,
there is unused-function build warning. Add __maybe_unused macro
to remove the warning.
Change-Id: Ibd880ebc42fdb4610106a8f53645bfd61825dc9e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b016b585425b66ea53eef6b8600aff78a4205b9e)
When EHCD and xHCD are enabled at the same time, USB storage device
driver will fail to read/write from/to the storage device attached
to the xHCI interface, due to its transfer blocks exceeds the xHCD
driver limitation.
With driver model, we have an API to get the controller's maximum
transfer size and we can use that to determine the storage driver's
capability of read/write.
Note: the non-DM version driver is still broken with xHCD and the
intent here is not to fix the non-DM one, since the xHCD itself is
already broken in places like 3.0 hub support, etc.
Change-Id: Id95b187ad7c34d80b236f425cd1cf3da7b954589
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ea7fad91019654fb21e6cd04f963e0482869dba5)
This adds a new memeber max_xfer_blk in struct us_data to record
the maximum number of transfer blocks for the storage device.
It is set per HCD setting, and so far is to 65535 for EHCD and 20
for everything else.
Change-Id: I53b942501431471c981b3f82ae1028ecd7b45069
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6158d0b42411165d34635a2ddfea17e12dce3329)
common/spl/spl_fit.c:201:12: warning: passing argument 4 of ‘gunzip’
from incompatible pointer type [-Wincompatible-pointer-types]
src, &length))
Change-Id: I58ddaf516e012064afaea3710abb4e4d9710487b
Signed-off-by: York Sun <york.sun@nxp.com>
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
CC: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 933f67aa56ea742f014b21bfe50a16a00e97b9bd)
For timing our bootstages on the RK3368, which has a minimal TPL
(and where we consequently don't want to time the bootstages) and a
full-featured SPL (where we can bootstage recording), we need to
adjust the Makefile.
Use the $(SPL_TPL_) macro in the Makefile for bootstage.o
Change-Id: Ib3cd45000bfbfb37377c96c9f41a467a760650aa
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 148a139d65b7fdb93326d7870b40c618d4601a8a)
Introduce an overlay based method for constructing a base DT blob
to pass to the kernel.
It is based on a specific method now to get the FDT from a FIT image
named boot_get_fdt_fit().
Change-Id: I98e0526edd594e63b1c29bdd916e4c66774f4337
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 169043d826e6b0db3c67a60acbedfc72c43aae5d)
fit_image_load() threw away the extra configuration parts when
loading. We need them around for applying extra overlays for
building the boot fdt.
Change-Id: Icad7d35f5efb4ebb16a2dba969a9228674d7fb39
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 7c3dc776b91a683b2f7dd40ed91361124a3a91c0)
As part of the fdt overlay support which need it, allow
a list of configurations per property.
Change-Id: I3068dcdd2bd823fd2ee5cfa0d337c4589e2a9588
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 ad026adbcf0d719e736eb58a9059cbbebb2d2423)
Introduce fdt_overlay_apply_verbose, a method that applies an
overlay but in the case of an error produces a helpful message.
In addition if a base tree is found to be missing the __symbols__
node the message will point out that the probable reason is that
the base tree was miscompiled without the -@ option.
Change-Id: I22cc210c6a7bb0aaa9655197c859f54677532099
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 fc7c31891c40dd1aac2e71e9d1546727ca2b3556)
With debug enabled, SPL output following these debug prints is on the
same line and it is hard to read. Fix it.
Change-Id: I6b0983a285f1deb38cac7e0292c9c286ca6e901b
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 2d2531be861cb7ec25aa7980b1099ca4f5f46d86)
Add a new image type representing TI Power Management
Micro-Controller (PMMC) Firmware image type.
Change-Id: I28a8132dfd5549ffde3d81e6da7399c3768ac1e7
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6442c9643e82966ae8fff391bab3fcc763662564)
If CONFIG_SPL_OS_BOOT is enabled, boot OS if kernel image is found
in FIT structure.
Change-Id: I6fcb0a0ac05e4d548b2bce93f9def04c12294998
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 c8bc3c0c9ff7ce649b2af1416919b50ecf504874)
SPL supports U-Boot image in FIT format which has data outside of
FIT structure. This adds support for embedded data for normal FIT
images.
Change-Id: Iad87ee9d443259a6af53f0473dc1b97db083df8d
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 5fd13d973613d308663f97b51059ecd9179baf09)
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)
Use 'int' instead of 'ulong' as type of image size,
and return err if can not find MISC partition.
Change-Id: I661a221a8a4049f2a7d9ee45b8a4d987ae515188
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
There are two ways to get boot mode: misc partition and
CONFIG_ROCKCHIP_BOOT_MODE_REG, we unify them in the
rockchip_get_boot_mode() function.
Change-Id: Ia2dd452e8df8a8d736300048f131ed43ec2ec3a3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
blk_dread returns negtive error code or blocks number
that read successfully.
Change-Id: I0f2afe98cfb64fe8e83a065fa64b91481856f5be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
size in byte for malloc, and in block/512bytes for blk read.
Change-Id: I0534a13838ff00452d9ca472d7caea03502cc058
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
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>
Get the dtb file from boot img second position or inside resource for
Rockchip image.
Change-Id: I843366b32f79ea8fb320d695d79420607a496d68
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Rockchip use rkimg bootloader to boot Android during development cycle and for
other OS, typical content kernel.img with zImage/Image, boot.img and
recovery.img with Ramdisk, packed with 'KNRL' header; and resource.img
with dtb and uboot/kernel logo bmp, vendor storage for custom info
like SN and MAC address.
Change-Id: I400195a5e622437f234f22d6675a5e96db9085c6
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The original edid parsing methods are too simple. The
new parsing methods are carried from kernel.
Change-Id: I28b9b14e1bc76c38366f41d23f0e01ac779780d0
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
The fdt must be named of "kernel.dtb", and it's saved
in the root dir of the oem partition.
Change-Id: I70dc9cbbc295f23b08bf122df3b29bba7dacb82f
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
If user get the kernel fdt into the independent partition
which is the ext4 filesystem, we can use this api to load
fdt.
Change-Id: I4fa494beffecb41e8c0e4c02f1e782d0291e2d05
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
If GPT buf is invalid, it will send actual disk size
back. We can use this actual disk size to build correct
GPT partition.
Change-Id: Ia54112951b7b8daa6afe369bc16a037cdbe8db39
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
In file boot_android.c, we use some functions
belong to common/android_bootloader.c. BUt these
functions attribute are static. So we modify these
functions used in the boot_android.c.
And android_avb_boot_flow is added to boot a/b
android system.
Change-Id: I3ebc0a6fb24691ab1a0f8475220e16ca633412f1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Android kernel image format can include an initramfs image in the same
kernel partition. This patch passes the initramfs to the kernel, which
in the normal boot mode ignores it by passing "skip_initramfs" in the
command line.
Bug: 34346003
Test: `am broadcast -a android.intent.action.MASTER_CLEAR` factory
reseted the device.
Change-Id: I21d89e34a0f54badf3b2e3ad8981cef75f6d5edf
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