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)
Add a convenience macro to iterate over subnodes of a node. Make use of
this where appropriate in the code.
Change-Id: Iae0fb554472d0b5819d26becbbcf8909ff891514
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 3991f42ed2e38aff28ba3c24369bfbd90620bea7)
At present we sometimes see warnings of the form:
/tmp/tmpMA89kB:36: warning: overriding the value of CMD_SPL.
Old value: "y", new value: "y".
This is not very useful as it does not show whch defconfig file it relates
to. Update the tool to show this.
Change-Id: Ib4e5c75fa4e7948744d293a8b4d8f07e4474a0ff
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 8639f69a61b47971dba47ab5ed72e47436729bb1)
We can use printf() to limit the string width. Adjust the code to do this
instead of using strlcpy() which is a bit clumbsy.
Change-Id: I69e67116ac1e955498ff886c7daa7461e1fa17ab
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit a0f9acb08bd6f3b4a6f3adcb02c8170e522c074a)
Import include/linux/dma-direction.h from Linux 4.13-rc7 and delete
duplicated definitions of enum dma_data_direction.
Change-Id: I9c6569e4ab91ac82fb1c99a38003a1ac48061813
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b27af39935855c88ef2203dcfc1ff54e013237c4)
Add space around operator "+", make it
match the coding style.
Change-Id: I5cb1e3cea056db89d7ac0c16c233228d39bf6675
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 347e30e1720ea6c0231f81d278b076a39280a314)
Macro VA_BITS and PTE_BLOCK_BITS are not used
in the code, so remove them.
Change-Id: I5a6b900c8d1d145f28d1604c9b614226c20159d5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 4f84cb980fdc25d7735fe114021b4a84ea601b9f)
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)
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)
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)
The USB-PHY may have been in suspend mode before done "reboot loader"
action which will cause the USB device failed to be enumerated by PC
in u-boot context.
So reset USB-PHY and power on its PLL in otg_phy_init(), and invoked
by udc_enable() when the USB Gadget start to fix it.
Change-Id: Ie91fdabece937a6f277cfe80cd707ddcace6470d
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Suspend USB-PHY while doing charge detect and resume it after
finishing to ensure the USB-PHY in normal state.
In addition, disable idm_sink_en and vdp_src_en after primary
detection retry to fix the USB device failed to be enumerated
after do charge detect.
Change-Id: Id1effb049cc6491bcd876aa1cc0449469b11df06
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
It helps when enter rockusb mode in setup_boot_mode()
and rockchip_dnl_mode_check().
Change-Id: Iae0a88ab5e971c8d85a59ba2bef077c7c3a9e5ed
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
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>
For cortex-A7 core, when ACTLR.SMP is 0 during the processor
power-up and power-down procedures, the caches are disabled
regardless of the SCTLR.C bit setting. It's similar for other
cortex A series core.
Change-Id: I69512787015d651fe5bb5d6961f5ed01c2505058
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
devtype can be "emmc" or "rknand", devnum is usually 0.
Change-Id: Ie90169ab2c164e9d91f3365c3d9c99278bf9c8c4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
only BOOT_MODE_CHARGING and BOOT_MODE_UNDEFINE enter charging.
Change-Id: I21a7b93ff50aab47f3a32094fc36083b42b7b9b0
Signed-off-by: Joseph Chen <chenjh@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>
Rockchip release bl31.elf file for armv8 SoCs like rk3399, rk3328,
the elf have more than one section, we need to decode it first and
packed them into u-boot.itb with its file. This script is to generate
the its script.
Need default bl31.elf in root directory of U-Boot source and dtb
as parameter.
Change-Id: Id70181b5d80beaf71458f78d274375efaf871364
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
We package U-Boot and OP-TEE into one itb file for SPL,
so that we can support OP-TEE in SPL.
Change-Id: I2c20333d6f3bb11ac1ec4bbb32c901028fb15d64
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Set ddr as non-secure so that mmc dma can access.
Change-Id: Ia0f51908a8d428b864a9d71b2a3dd8baeb79b952
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
0x2000000 is a fixed address for share the ddr info.
Change-Id: I37e77f73028b0504776ea662ec7b308ab7d21204
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
ftl_read api with un-aligned data buffer will return error data.
Change-Id: I380667d6d671dd96578830939d137fe74015d8ac
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
We are not ablt to go on if we do not able to get some image which
is must.
Change-Id: I1cebd327ec894c688f57627518df85f6ff4aa836
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Do not need to scan disk every time when we get part info
by name.
Change-Id: Id79a3a9065731815567055329a2f7f80b3c8c9d4
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
We can get the new part table when we write a new partition table to
a blank disk with this patch, or else we have to reset the board
to get new partition table.
Change-Id: If6688149a4a3ae9d6f5731757a1b5831494a9152
Signed-off-by: Kever Yang <kever.yang@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>
This CRC32 driver is from: remotes/origin/rkdevelop.
RK format images is packed by mkknlimg tool, it adds the
CRC32 checksum which is not standard into image header,
so this CRC32 function is only used for rockchip platforms.
Change-Id: Ia52c6efa9dede148b1cb448691380f2d3184cd5e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Try emmc first, and then nand;
Try boot_android first, and then bootrkp;
Change-Id: I21ae59bbfe420adc66409766aca05d44db7e19aa
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>