Commit Graph

46409 Commits

Author SHA1 Message Date
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
Simon Glass 17c82fdc12 UPSTREAM: dm: core: Add ofnode_for_each_subnode()
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)
2018-01-16 18:13:59 +08:00
Simon Glass 0c69cd527f UPSTREAM: genconfig.py: Print defconfig next to warnings
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)
2018-01-16 18:13:59 +08:00
Simon Glass ae9ecb9781 UPSTREAM: dm: core: Show driver name with 'dm tree'
It is often useful to see which driver was actually selected for each
device. Add a new 'Driver' column to provide this information. Sample
output:

 Class       Probed   Driver     Name
----------------------------------------
 root        [ + ]    root_drive root_driver
 keyboard    [ + ]    i8042_kbd  |-- keyboard
 serial      [ + ]    ns16550_se |-- serial
 rtc         [   ]    rtc_mc1468 |-- rtc
 timer       [ + ]    tsc_timer  |-- tsc-timer
 syscon      [ + ]    ich6_pinct |-- pch_pinctrl
 pci         [ + ]    pci_x86    |-- pci
 northbridge [ + ]    bd82x6x_no |   |-- northbridge@0,0
 video       [ + ]    bd82x6x_vi |   |-- gma@2,0
 vidconsole0 [ + ]    vidconsole |   |   `-- gma@2,0.vidconsole0
...

Change-Id: Ib6ed67d9de2d94f9aae4d4a180a71191a0836786
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 ee3e520dad0b368df4541cd0af0d4011cf481e5b)
2018-01-16 18:13:59 +08:00
Simon Glass 58b0f0021c UPSTREAM: dm: core: Drop use of strlcpy()
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)
2018-01-16 18:13:53 +08:00
Masahiro Yamada 9ff3d0147e UPSTREAM: dma: import linux/dma-direction.h to consolidate enum dma_data_direction
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)
2018-01-16 18:13:53 +08:00
Andy Yan 91603e0221 UPSTREAM: armv8: mmu: add space around operator
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)
2018-01-16 18:13:53 +08:00
Andy Yan 3d53e4e680 UPSTREAM: armv8: mmu: remove unused macro definition
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)
2018-01-16 18:13:53 +08:00
York Sun ebec805a62 UPSTREAM: spl: fit: Add booting OS first
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)
2018-01-16 18:13:51 +08:00
York Sun 0ea10b9f85 UPSTREAM: spl: fit: Support both external and embedded data
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)
2018-01-16 18:13:51 +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
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
Frank Wang eb7c724022 phy: rockchip-inno-usb2: add otg_phy_init api
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>
2018-01-12 16:47:13 +08:00
Frank Wang a607e103bc phy: rockchip-inno-usb2: amend charge detect process
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>
2018-01-12 16:47:13 +08:00
Joseph Chen 15e088ea51 rockchip: boot_mode: setup devtype and devnum env
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>
2018-01-12 16:46:05 +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 570fb7e31a rockchip: rkimg: update some error handling
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>
2018-01-12 15:35:05 +08:00
Joseph Chen ec82a6c959 common: boot_rkimg: append boot media type to bootargs
Android need this property for bring up.

Change-Id: I0fb5367221079e3bfcf36db4e5b58fc994848dcd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-03 17:38:25 +08:00
Joseph Chen 817007c143 armv7: start.S: enable ACTLR.SMP bit
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>
2018-01-02 19:05:07 +08:00
Joseph Chen b1fd4f58f3 rockchip: boot_mode: recognise devtype and devnum dynamicly for rockusb
devtype can be "emmc" or "rknand", devnum is usually 0.

Change-Id: Ie90169ab2c164e9d91f3365c3d9c99278bf9c8c4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen 221b522060 power: charge animation: skip charge while special boot mode
only BOOT_MODE_CHARGING and BOOT_MODE_UNDEFINE enter charging.

Change-Id: I21a7b93ff50aab47f3a32094fc36083b42b7b9b0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen b7195498ca rockchip: unify boot mode in rockchip_get_boot_mode()
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>
2017-12-28 15:23:35 +08:00
Joseph Chen d2975239b8 rockchip: support pack resources into resource.img
This script supports pack charge pictures into resource.img

Usage:
 ./pack_resource.sh <input resource.img>

Change-Id: If0577a62d58a0c93826ac6c0db5df7872dced964
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen cd7ae718e1 rockchip: make.sh: support trust and loader image pack
Change-Id: I9b2cf170138c6aba7578e14126f3010e8bffee3a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen a1b32c2412 irq: clean up code
remove unused code and fix compile warning.

Change-Id: I912eff25bf60da925791b889f08e91d4fcb61893
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen 618d619d02 input: rk8xx pwrkey: replace printf with debug
I forgot to do this.

Change-Id: I4db233255a633cd403f4a279970d069b39124fe6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen 1225f03eaa rockchip: fix blk_dread return value check error
blk_dread returns negtive error code or blocks number
that read successfully.

Change-Id: I0f2afe98cfb64fe8e83a065fa64b91481856f5be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen 65f7800c7d common: boot_rkimg: fix 'krenel' typo
Change-Id: I4f4d4bce863208b7297ed57aa51afecada4c8f37
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:18:40 +08:00
Kever Yang f562460ada rockchip: add a common script for generate fit its
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>
2017-12-27 17:01:55 +08:00
Kever Yang 15974eb4a1 rockchip: add fit source file for pack itb with op-tee
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>
2017-12-27 17:01:31 +08:00
Kever Yang 0aec9aff9e rockchip: boot_rkimg: fix wrong variable
part -> part_info.

Change-Id: Icbcd4191a02115b87d4d552355680691f63ad2e1
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-27 16:54:58 +08:00
Joseph Chen 6639be8fa9 rockchip: boot_rkimg: add CRC verify for images
Change-Id: I8b5cc6e6ae455eafb46ea022ea1f3a93d04972eb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-27 11:01:28 +08:00
Kever Yang 26f074b872 rockchip: update rkimg bootcmd
Change-Id: Id7e051156e74acc1b0fd5dc50ae4646be2f9067a
2017-12-21 16:50:11 +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 bfe741ab9e rockchip: rk3328: set ddr as non-secure in tpl
Set ddr as non-secure so that mmc dma can access.

Change-Id: Ia0f51908a8d428b864a9d71b2a3dd8baeb79b952
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 15:49:23 +08:00
Kever Yang 93a905c1e0 spl: atf: pass NULL for bl32_ep pc
Change-Id: Ibfd0054936fffed3603103226e304e4878598c84
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 14:46:57 +08:00
Kever Yang 4b7908ad8b rockchip: rk3328: ram: pass ddr params to trustos
0x2000000 is a fixed address for share the ddr info.

Change-Id: I37e77f73028b0504776ea662ec7b308ab7d21204
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 14:46:53 +08:00
Kever Yang 3a2e317c25 rockchip: sdram-common: add api to pass dram info to trust os
Trust OS decode this info like this:
https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/rockchip/common/drivers/parameter/ddr_parameter.c#L19
We have to set a available value, or else we get error info from
Trust OS like this:
"ERROR:   over or zero region, nr=3145987, max=10"

Change-Id: I8adbf0332e8b981cda089177e4c62a9f7d326581
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 14:46:32 +08:00
Zhaoyifeng d738f2ccb4 drivers: rknand: fix read error data
ftl_read api with un-aligned data buffer will return error data.

Change-Id: I380667d6d671dd96578830939d137fe74015d8ac
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
2017-12-21 14:31:41 +08:00
Kever Yang 0fe38820d9 rockchip: rk3229: update header macro
Do not use a common name '_CONFIG_H_'

Change-Id: I1b184e9663eb27a06ec89039b6b88b1d099119dc
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 11:06:31 +08:00
Kever Yang f011305a0a rockchip: rk3128: move timer init to arch_cpu_init
The board init is too late.

Change-Id: Ie63e86c98644123d1f611280784252a0cc0ada2e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 11:06:31 +08:00
Kever Yang 2f773ef544 rockchip: resc_img: return err if some img missing
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>
2017-12-21 11:06:31 +08:00
Kever Yang f5a168ec10 rockchip: clk: remove not used file
Change-Id: I29debf757749ca2a63a55d5b45a96d5170b51d85
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-21 11:06:31 +08:00
Kever Yang 5ecf0ee53b disk: part: use common api to lookup part driver
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>
2017-12-14 14:42:09 +08:00
Kever Yang 067b22ddca disk: part: scan the disk if the part_type is unknow
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>
2017-12-14 14:42:08 +08:00
Kever Yang 1a3726ad91 rockchip: boot_rkimg: fix wrong size for bootloader_message
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>
2017-12-14 11:35:48 +08:00
Joseph Chen b7c7eca21d make.sh: guide user how to obtain rkbin Responsity
Change-Id: I74f6902da21cf0ea50298653fc029c410b0771bb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-08 18:14:44 +08:00
Joseph Chen 882c725118 rockchip: add CRC32 image verify driver
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>
2017-12-08 18:13:45 +08:00
Kever Yang 5059d297b0 rockchip: config: add a bootcmd for rkimg
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>
2017-12-08 18:13:25 +08:00
Kever Yang 3c186af272 rockchip: rk3229: config: updpate block api to rkimg api
Change-Id: Ic73e266835f17509d7a45af589dd11d2df79fc14
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-08 18:13:25 +08:00