Commit Graph

48807 Commits

Author SHA1 Message Date
Jason Zhu c46b3f6d96 lib: add stdlib.c
Since we need to realize standard library function other than use them
with gcc tool chain in U-Boot. So add standard library function here.

Change-Id: I10009c5bbe31fabacd929df3c44218ae9c6a885f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-01 19:17:50 +08:00
Yifeng Zhao d6d708d1a3 rockchip: drivers: mtd: nand: modify the bad block detection process
Change-Id: I97c99e91516f34a270684cbb77820b4078f1cf03
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-07-01 15:47:32 +08:00
Joseph Chen 0bc1964007 common: rkimg: clear boot mode register when its value is not reboot reason
It's not safe to drop clear operation, example: using "reboot fastboot" from
kernel to enter U-Boot fastboot mode and finally reset system by fastboot
command "fastboot reboot", the system reboot and enter U-Boot fastboot mode
again but not boot to kernel.

Take back the clear operation which was dropped on:
(9d2bc40 boot_rkimg: don't override BOOT_MODE_REG)

Change-Id: I5e17e19e53700ec5244660122d837efc9cd30d4f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-01 15:47:04 +08:00
Joseph Chen 791112ddc0 rockchip: boot mode: sync reboot reason flags from kernel
Change-Id: I6d0ec7eadfa7ae0455e53bb21072d5836a09c64e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-01 15:47:04 +08:00
Joseph Chen 579a09e344 configs: rk1808: enable CONFIG_REGULATOR_FAN53555
Change-Id: I0afe69c938a6b59ea6d6cd8cfaedc2f56048b7d8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-28 17:43:05 +08:00
Frank Wang 1bca07a1ff usb: gadget: composite: add null pointer check
The cdev->config means the currently active configuration and
it might be null, fix it by adding null pointer check.

Change-Id: I18261653436186c342b447c24ef46a8acc42825f
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2019-06-28 14:42:13 +08:00
Jason Zhu 87f9541a89 common: android: fix tries_remaining minus twice in avb & ab system
Change-Id: I422cb3c2f7e28849772a65b8060a0d8e26313d47
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-28 09:55:01 +08:00
Jason Zhu c9289edddb mtd: mtd_blk: reserve one block space for gpt table
Reserve one block space for gpt table in mtd part info,
otherwise gpt table will be erased by user program.

Change-Id: I0545c55f7da2b5518ab766ed763b074b7558fd4f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-27 19:52:19 +08:00
Jason Zhu 06c1e1b3ae cmd: rockusb: fix usb serial number bug
Some special characters will be treated as a path in windows environment,
such as '\\' and '/'. If the usb upload its serial number with these
special characters, the usb drive will unwork. So use '_' to replace them.

Change-Id: Ic249316f2b03b0dcb73680078f122e23003e6e3d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-27 08:31:20 +08:00
Jason Zhu 4d432d92ae common: android: fix missing "root=" with linux a/b & avb system
Change-Id: I2f8320eb4f81f88e7ba1f2d62eee55010f243df5
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-27 08:30:57 +08:00
Jason Zhu 139d645e19 rockchip: dts: rk3308: fix compile warning
The warning message is ""reg" property in /nandc@ff4b0000/nand@0
has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)".

Change-Id: I06d4eca600e29d3c00a7888055c7526f9f5cd779
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-26 17:08:17 +08:00
Nickey Yang edf8d43c0e drm/rockchip: vop: use win1 for ui instead of win0 in rk3399 vopl
RK3399's VOPL has win0 and win1 layers.The formats they support as below:
Win0:  XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV16 NV24 NA12 NA16 NA24
Win1:  XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16

Only the win0 layer supports NV12 format(for video decode).
So change to use win0 for video overlay layer and win1 for ui layer.

Change-Id: I2168b48d78e2a27fd93b12646952518d7bb529f2
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2019-06-26 17:05:36 +08:00
Joseph Chen 5fc2a70c78 power: charge animation: allow ctrl+c to exit extrem low charging
Change-Id: I736c2617a4d51085bc91377f1013d7f4b198c9fc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 14:09:28 +08:00
Joseph Chen 8526ae77a4 rockchip: board: ignore cru phandle fix for miss match phandle
This miss match phandle maybe "&pmucru" phandle.
(fixes: 3e45175 rockchip: board: fixup cru phandle for all U-Boot node.)

Change-Id: If053c1d329264967b1d0f1d3dce8f62aea3b69c7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 12:59:02 +08:00
Joseph Chen 8d9f99d87b rockchip: atags: atags_get_tag() is useless for TPL
TPL only needs atags_set_tag(), remove atags_get_tag() to
decrease u-boot-tpl.bin size.

Change-Id: If5301db7aa5e4436863741257be617b1d7dcb56a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 12:59:02 +08:00
Joseph Chen 9a3dcb5be4 rockchip: board: add hotkey "ctrl+s" to enter cli loop
Right after "Starting kernel..." and before jumpping to kernel.

Change-Id: I59bec92b0727b6ff62d2c4f461e99c5a7f6f5426
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:24:37 +08:00
Joseph Chen 4fe75b5b95 rockchip: hotkey: add comments for hotkey definitions
Change-Id: I710bd7f2a1c393397f8e5536528a6fe5817fa392
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:24:37 +08:00
Joseph Chen 9b78eaa402 rockchip: hotkey: support ctrl+s enter cli loop
Change-Id: I4e0bc24c38f9bada07bc09a563cfd4385c6265f2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:24:37 +08:00
Hisping Lin 266906806d lib: optee_client: init rpmb before find_mmc_device
Change-Id: I1f2c3d76c9015f1a59822314df5e92b6355c7827
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-06-26 11:23:32 +08:00
Joseph Chen 6d5e656643 common: android: add sysmem overflow check
Change-Id: I263bbc9f9f2a71322591ef3528b8fa6039eb3509
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:23:12 +08:00
Joseph Chen 0c4b2feaa3 common: rkimg: add sysmem overflow check
Change-Id: I9892482f672290dbc65cda7734b52bffba06996f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:23:12 +08:00
Joseph Chen 2c66f6f37e lib: sysmem: add sysmem overflow check support
Change-Id: Ifcb6e8cd59656b133f56115d104a1bba017c7c1b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:23:12 +08:00
Joseph Chen c7c0bd5956 rockchip: memblk: add M_ATTR_CACHELINE_ALIGN for AVB memblk
The alloc region for storage read/write should be aligned to
cacheline size.

Change-Id: Ib529a5f62d3937b66b0d325a49feb22eacb04317
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:23:09 +08:00
Joseph Chen 556bbbe436 lib: sysmem: add M_ATTR_CACHELINE_ALIGN support
If alloc buffer for storage read/write should be aligned to
cacheline size, please add the M_ATTR_CACHELINE_ALIGN flag
for this region.

Change-Id: I1e5d46405ddacfadd1cdb4670f943996d9b66426
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-26 11:23:03 +08:00
Yifeng Zhao 3bce84dba8 rockchip: dts: rk3308: add nandc config for mtd nand drivers
Change-Id: I50657ce5d9f021d42471d0e0b15471b7b6788cef
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-06-26 11:06:24 +08:00
Jason Zhu b75a3992f5 cmd: mmc: find current device first before find mmc device
Find the current device before find mmc device, otherwise '-1'
will be use as curr_device and error occur. The error log is
"MMC Device -1 not found".

Change-Id: Id6157f73d006f4bbe1c4d105244eb59ca7290c13
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-26 10:59:13 +08:00
Jason Zhu 278b570da4 common: fdt_support: correct function part_mtd_parse to mtd_part_parse
Change-Id: I935696c9aff9f464e5e625dd96f0acde67f60c8c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-25 17:53:27 +08:00
Joseph Chen 059ed03284 disk: rkparm: fix get partition issue
Without this patch, it always returns the last partition when
"idx" is larger than the last partititon.

Change-Id: I1d126861327c02cab7dd8cc00dd0800651f7da3c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 15:36:34 +08:00
Yifeng Zhao e91ae64f65 lib: rockchip: nand: modify udevice_id to compatible with NAND driver include FTL
Modify the opensource nandc driver to compatible with
the NAND driver include FTL,which used udevice_id
"rockchip,rk-nandc".

Change-Id: I67b9beb43b9935f88c98802f6df3507248324a12
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-06-25 11:23:21 +08:00
Yifeng Zhao 8623fa54b3 rockchip: nand: modify udevice_id to compatible with NAND driver include FTL
Modify the opensource nandc driver to compatible with
the NAND driver include FTL,which used udevice_id
"rockchip,rk-nandc".

Change-Id: I8dda456aed89e15b2b9885e8d9d723f2d2e84ccb
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-06-25 11:21:05 +08:00
Joseph Chen 6a20f1c71f disk: rkparm: check return value only when do initialization
Change-Id: Id2f9e6a7c5843e5d277a70797c4a3a2768230c14
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:31:09 +08:00
Joseph Chen 24f9e652a5 tools: rockchip: boot_merger: add option to enable rc4 flag
The legacy chips like rk3188 maskrom require all IDB data with RC4,
the boot_merger pack the loader with a rc4 flag in header,
and the upgrade_tool will write the data with rc4 to IDB area.

usage:
boot_merger --rc4 RKBOOT/RK310BMINIALL.ini

and you can see log below if success with RC4:
* enable RC4 for IDB data(both ddr and preloader)

Test on rk3188.

Change-Id: If221a32a462bb43bef67aae802adff5e1e8436ac
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:30:37 +08:00
Joseph Chen 52243bce13 tools: rockchip: loaderimage: add "--prepath" support
Add prefix path of binary path.

Change-Id: I30fe03e0614c7724f452ad8b9d3800acd92db02c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:30:37 +08:00
Joseph Chen 5f0203b772 tools: rockchip: boot_merger: ignore "--prepath" for output path
Change-Id: I89335926cc161c484e813fbd8a699935762f1a34
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:30:37 +08:00
Joseph Chen 29cdb69100 common: image-android: print separate load fail message
Change-Id: I2bb06d24ce7cfa22a7c197932b67d6bd2055a03d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:28:54 +08:00
Wyon Bi dd884e9de9 configs: rk3368: enable CONFIG_DRM_ROCKCHIP_ANALOGIX_DP
Change-Id: Ice335cd1535cf4318629d2943b372eb4c030b902
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2019-06-24 18:31:52 +08:00
Jason Zhu 4a7c178034 lib: avb: change the hardware rsa verified interface
Change-Id: Id42cf3a829a35514b75f3c5990ce7e00b94f712e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-24 18:31:36 +08:00
Jason Zhu 5a1674a738 drivers: core: do not use mtd node from kernel dtb
Do not use mtd node from kernel dtb, otherwise the driver will
be initialized twice.

Change-Id: I6f3dca8fd8c3e05475f4359fe6c3c5312c0984cd
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-24 18:31:03 +08:00
Jason Zhu 57b5e70433 common: fdt_support: support parse mtd part info
Parse the mtd part info and pass it to kernel by bootargs if
the device is mtd.

Change-Id: I746081c58d797b8dbd63c47915c6d88a314e1a90
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-24 18:30:52 +08:00
Jason Zhu 22dccd1122 mtd: mtd_blk: parse the block part info to mtd part info
Change-Id: Ib4117bf22d1c91a5b2d69a45b6584e8d0cb47021
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-24 16:17:39 +08:00
Joseph Chen 73251fc230 scripts: stacktrace: support parse spl/tpl stacktrace info
Usage:
	./scripts/stacktrace.sh ./dump.txt
	./scripts/stacktrace.sh ./dump.txt tpl
	./scripts/stacktrace.sh ./dump.txt spl

Change-Id: I6a496109206d26917d5677c076aa770388c36ae6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:15:56 +08:00
Joseph Chen 1b4592b538 scripts: Makefile.spl: generate symbol file for spl and tpl
u-boot-tpl.sym and u-boot-spl.sym are required by stacktrace scripts

Change-Id: Ie408332eaff71c3ed244016adb9f75401ca35845
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:15:56 +08:00
Joseph Chen 34bdfea0a0 make.sh: support objdump tpl/spl elf file
Example:
	./make.sh elf tpl  --- objdump u-boot-tpl
	./make.sh elf spl  --- objdump u-boot-spl
	./make.sh elf      --- objdump u-boot

Change-Id: I8dca1cfce207b98e755db8841f3d614cfad9bfb4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:15:56 +08:00
Joseph Chen 89514e0a47 configs: evb-rk3229: spl increase stack_r malloc size
Fix the SPL boot issue:

U-Boot TPL 2017.09-02983-ga891458 (Jun 19 2019 - 21:50:08)
Returning to boot ROM...
U-Boot SPL board init
U-Boot SPL 2017.09-02983-ga891458 (Jun 19 2019 - 21:50:08)
Trying to boot from MMC2
mmc fail to send stop cmd

Change-Id: I2f47ff906eacfd51af1ec5145331349167c55166
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:15:29 +08:00
Joseph Chen c88a887aa9 configs: evb-rk3229: update by make savedefconfig
Change-Id: Iac13ed18452db14f41dc8bc1e4a2736392f35330
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:15:17 +08:00
Joseph Chen e8048e8f0a rockchip: dts: rk3229-evb: update "u-boot,dm-xxx" prop for some nodes
Change-Id: If9fcdae550c967712e8b9a0be73bb661481d171b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:14:32 +08:00
Joseph Chen 8dd9db5d1c Makefile: tpl: u-boot-tpl.dtb support include node with prop "u-boot,dm-tpl"
Without this patch, u-boot-tpl.dtb is always copy from u-boot-spl.dtb which
doesn't apply fdtgrep with "-b u-boot,dm-tpl".

Sometimes, the platform with critical sram size requires u-boot-tpl.dtb as
smaller as possible, so we use "u-boot,dm-tpl" prop to idendify what the
tpl really needs.

Rules:
"u-boot,dm-tpl": include node with prop for u-boot-tpl.dtb;
"u-boot,dm-spl": include node with prop for u-boot-spl.dtb;
"u-boot,pre-reloc": include node with prop for u-boot-tpl.dtb and u-boot-spl.dtb;

Change-Id: I29c2464d285174f4d0a4a1f8b91a84238ed82384
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:13:10 +08:00
Joseph Chen df5ff5a374 common: spl: atf: disable and clean-invalidate icache/dcache
Refer to cleanup_before_linux().

Change-Id: Ia738f2816ab8c6fa09776aebd83f775697117d8c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-21 18:12:15 +08:00
Jason Zhu e6482de4e5 mtd: mtd_blk: get desc->product by mtd->name
Change-Id: I9c089032db87de20fa9a57a9637247df8fac2fbb
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-21 15:12:58 +08:00
Yifeng Zhao d2e692d264 drivers: mtd: nand: rockchip: the mtd name used the same as kenrel drivers
Change-Id: Ib3c6d70896f6bb5acb3ea506d01facc5ca465ba2
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-06-21 11:19:15 +08:00