Commit Graph

49489 Commits

Author SHA1 Message Date
Joseph Chen f501ba4438 cmd: boot: add mode args for "reset"
- Add "reboot" command as alias of "reset";
- Support command like: reboot loader/bootloader/recovery, etc.

Change-Id: I9748664aeca052a775a3f88f7fdf9b3923941026
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:34:04 +08:00
Joseph Chen bcb84b5d64 dm: sysreset: support mode args for reboot/reset command
Support command like: reboot loader/bootloader/recovery, etc.
It depends on the node whose compatible is "syscon-reboot-mode".

Change-Id: I3ef497c6a4355a0d8be9a277bd77bbee43df57fb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:34:04 +08:00
Joseph Chen 467d16db4b tools: rockchip: resource_tool: independent on other files
Merge all codes into resource_tool.c

Sync from kernel-4.4:
(0787850 rk: scripts/resource_tool: add sha1 for file entry)

Change-Id: Iff379458086f1623e7e5126dcb532b178d94c684
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:32:12 +08:00
Joseph Chen 92cdb0ce91 scripts: repack-bootimg: independent on kernel build args
Use args just like pack command to replace kernel/second/ramdisk/dtb
as you want:

repack kernel:
    ./scripts/repack-bootimg --boot_img boot.img --kernel zImage -o boot_repack.img

repack second:
    ./scripts/repack-bootimg --boot_img boot.img --second resource.img -o boot_repack.img

Change-Id: I88167049fe645114f1ef2f6a453b12e95456607c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:32:12 +08:00
Joseph Chen 8a334094ee scripts: add mkbootimg and unpack_bootimg
Pack boot.img:
    ./scripts/mkbootimg --kernel zImage --second resource.img --ramdisk ramdisk.img --out boot.img

Unpack boot.img:
    ./scripts/unpack_bootimg --boot_img boot.img --out out/

sync from kernel 4.19:
(ac97525 drm/rockchip: cdn-dp: Add bus format setting)

Change-Id: I886db6e2ac11d07852c2c9a4cb7c5088dbfa3cd5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-12 19:32:12 +08:00
Kever Yang 0db1499c05 rockchip: rk3399: update SPL_STACK_R_ADDR
Use the same SPL_STACK_R_ADDR in Kconfig instead of each board config;
default to 0x4000000(64MB) instead of 0x80000(512KB) for this address
can support all the SoCs including those may have only 64MB memory, and
also reserve enough space for atf, kernel(in falcon mode) loading.

After the ATF entry move to 0x40000, the stack from 0x80000 may be override
when loading ATF bl31.

Change-Id: I9bb524ee0762e908bd390393168f30ca197e2a52
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-12 09:59:47 +08:00
Kever Yang 191d31cd12 rockchip: update CONFIG_SPL_MAX_SIZE to 0x40000
We are using DRAM offset 0~0x40000 as SPL text size, Note that BSS,
STACK and MALLOC may using separate space.

Change-Id: I1d9128b339140569e427fad44dc0a2f3058deaf0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-12 09:59:47 +08:00
Kever Yang 0bd7957468 rockchip: configs: rk3328: no need to reserve IRAM in SPL
Remove CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000 and it will default to
0. No need to reserve the space for we move the bl31 entry to 0x40000
and limit the size of SPL at 0~0x40000.

Change-Id: I39a69f2ee03a93b4556cc29ab41f62c344f28a02
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-12 09:59:47 +08:00
Kever Yang 81adf89fd1 rockchip: configs: rk3368: no need to reserve IRAM in SPL
Remove CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000 and it will default to
0. No need to reserve the space for we move the bl31 entry to 0x40000
and limit the size of SPL at 0~0x40000.

Change-Id: I76385fcb3524eb16c19c3006c59954edc2f3531e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-12 09:59:47 +08:00
Kever Yang 714c681b54 rockchip: rk3399: configs: no need to reserve IRAM in SPL
Remove CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000 and it will default to
0. No need to reserve the space for we move the bl31 entry to 0x40000
and limit the size of SPL at 0~0x40000.

Change-Id: Iff502eec2a38bfe112b5cadc22d772fded39c4ed
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-12 09:59:47 +08:00
Jon Lin ce7ac0aae2 rockchip: px30: add SFC node
Change-Id: I86828e529d30a018f38a61e6b669d8d3a5879f2e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-11-11 18:32:03 +08:00
Joseph Chen 48f2fe23c2 configs: rk3308: increase CONFIG_SYS_MALLOC_F_LEN
Make sure there is enough memory when more nodes are
enabled in u-boot.dtb.

Change-Id: Ieb204daa41c04035b86064962569b08152375124
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-11 17:00:57 +08:00
Jason Zhu a9bb1266c6 dts: rk3308: add sdmmc node to support sdmmc
Change-Id: Iebf8b4c800ceaea95530c553955e727e2d76345f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-11 14:12:12 +08:00
Jason Zhu 224c13b893 rk3308: add node "sdmmc_pin"
So that we can add "u-boot,dm-pre-reloc" to node "sdmmc_pin"
in rk3308-u-boot.dtsi to control the sdmmc iomux in spl.

Change-Id: I867927c37dd20f1b586a62676a195dbf52dca44d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-11 11:26:33 +08:00
Jason Zhu d2e2dbd6d5 pinctrl: rockchip: use flat device tree to find the node in spl
Change-Id: I9eaa8aa17a0fad3bf9ea67746db3ed470a63a85b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-11 09:46:07 +08:00
Joseph Chen 5d3e5a0afc Revert "regulator: fixed: print failed message"
This reverts commit b8f8a39729.

Change-Id: I6a2d474504833b9a4efa3ef37dc76c4051db1098
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-08 18:21:03 +08:00
Andy Yan d9ba2df1ad rockchip: dts: include rk3368-u-boot.dtsi for px5 evb
Let's rk3368-px5-evb-u-boot.dtsi include rk3368-u-boot.dtsi.

Note: px5 evb use uart4 as debug console.

Change-Id: Icca1fe00f95fb956abd41d34202af380b18f3c34
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-11-08 11:27:11 +08:00
Andy Yan e1f8eabf6c rockchip: dts: Enable sdmmc on px5 evb
Change-Id: Ib7cf9595e337d4179d79775deb0a126f6ccb4878
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-11-08 11:27:11 +08:00
Joseph Chen 3c9d2903a9 common: image: fix parse kernel compressed type issue
This issue happens on the SDK version < 8.1. The reason is we don't
read enough blocks from storage for kernel compressed type validation.

ANDROID_ROCKCHIP_LEGACY_PAGE_SIZE(16KB) is defined by rockchip legacy
mkboot tool(SDK version < 8.1) and larger than Google defined.

To compatible this, we malloc enough buffer but only read android
header and kernel image(1 block) from storage.

Change-Id: I9800e4150985adcd5dbd78c28c471604eb403eae
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 14:58:09 +08:00
Joseph Chen b8f8a39729 regulator: fixed: print failed message
Fixed-regulator maybe the first device probed by regulators_enable_boot_on(),
its failure ends up the other regulator traverse(e.g. PMIC regulator), we hope
to get this information.

Change-Id: I2f1f67232dbb8a1b72dc8dfec75f1f6414b2abb9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 10:01:39 +08:00
Joseph Chen 54c0dba4a1 dm: regulator: print uc_pdata name instead of dev name
The uc_pdata->name is from property "regulator-name" which
is more accuracy to descript this regulator.

Change-Id: I813604ff528b757a1f9b9191dbdd4472f838a367
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 09:55:16 +08:00
Joseph Chen fde344bd1b configs: rk3399: enable crypto v1
Change-Id: Iea8c869ff9cec34f1117dd3b3f995df2db73cf4c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 09:37:18 +08:00
Joseph Chen e0cee41234 rockchip: resource: add sha1/256 verify for kernel dtb
This is important and necessary for U-disk firmware upgrade to
avoid loading the bad kernel dtb to init USB driver.

Also helpful for normal boot.

Change-Id: I81629991547ccb2930312278295e9737f4827945
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 09:37:18 +08:00
Joseph Chen fcecee42b0 rockchip: resource: update print message
At this moment, we just load file entries but not really load file.

Change-Id: I550e6bd90bcdf81f866c0d5f5c6b71faa0ecde19
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 09:37:18 +08:00
Joseph Chen ca6fb2913f rockchip: Kconfig: add CONFIG_ROCKCHIP_HWID_DTB for hw-id dtb
Only a few developers need this feature, disable it by default.

Change-Id: I074594c8e47c34a05324e363d11613383f3528a7
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 09:03:38 +08:00
Joseph Chen a6926964ec rockchip: resource: clean rockchip_read_dtb_file()
Remove unused rockchip_get_resource_file_size().

Change-Id: I5fd24f68b226e9b3ae3a36e574f5efd8c8728e65
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 09:03:38 +08:00
Joseph Chen 5e817a0ea4 tools: rockchip: resource_tool: add sha1 for file entry
Change-Id: If7bd80d68019f6ea5ad737793ed996d47134b568
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-07 08:55:31 +08:00
Jason Zhu e1c1c23dd8 android: change the verification mode
The mode AVB_HASHTREE_ERROR_MODE_RESTART_AND_INVALIDATE will add
"androidboot.vbmeta.invalidate_on_error=yes" to cmdline, and kernel
will invalidate vbmeta if verified fail. This will modify the vbmeta.img
head and make uboot verify vbmeta.img fail in avb system. And in avb & ab
system, we can use the retry-count to change slot if verify fail without
modify the vbmeta. So just use the mode AVB_HASHTREE_ERROR_MODE_RESTART.

Change-Id: I98d60683d5365b996fcca2e85d4847d4a6df2ef6
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-06 14:41:53 +08:00
Yu YongZhen b754d47013 video/drm: rgb: add S888 mode support
Change-Id: I73c6cec7a35dd5e15110da429b836463cab0a193
Signed-off-by: Yu YongZhen <yuyz@rock-chips.com>
2019-11-05 14:23:48 +08:00
Joseph Chen 3aff587f06 tools: rockchip: remove useless checksum
Change-Id: I0b40f0b0677920abfe873fd6b8db23475f113a78
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-05 12:25:19 +08:00
Joseph Chen fc474da559 lib: sha256: add sha256_csum()
Change-Id: I3b053f9c07df0d124cdbde9f905e309bcd11c84e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-05 12:24:10 +08:00
Joseph Chen c6666740ee common: android/rkimg: remove/clean android a/b (slot) code
- the partition disk layer takes over the responsibility of slot suffix
  appending, we remove relative code to make file clean;
- put android a/b code together and name them to be eary understood,
  this makes file esay to read.

Change-Id: Id8c838da682ce6098bd7192d7d7c64269f4e86ba
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 15:43:46 +08:00
Joseph Chen f2b98302da rockchip: resource: remove android a/b slot append
The partition disk layer takes over the responsibility of
slot suffix appending.

Change-Id: Ia02f5b8635676d49ec60eec7d3930740f2ba5ee4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 15:43:46 +08:00
Joseph Chen bd4d909bda disk: part: auto append android a/b slot suffix when query partition
This patch takes over the responsibility of slot suffix appending from
developer to framework on querying partition, it makes slot suffix
invisible for developers.

Change-Id: I33e1e8f6611232c4797d68b7b844a70db88a3eb8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 15:43:46 +08:00
Joseph Chen eb89f0a81d lib: avb: add partition slot append interface
Dump current slot information is helpful.

Change-Id: I872c29b9a67860703951a4e88e9549be17b94eed
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 15:43:46 +08:00
Joseph Chen 0ed06f16e2 rockchip: support boot from U-disk
- The U-disk boot is only supported from U-Boot, the earlier preloader
  doesn't support it;
- MMC1(SD) has higher priority than U-disk;
- Always boot into recovery mode and deliver "usbfwupdate" to cmdline;
- Usb driver may depend on clock/regulator init, so behind of them;
- Suggest to add ./dts/kern.dtb file to promise the kernel dtb always
  to be loaded successfully even the native images are all damaged.

Change-Id: Ibbb2a061a727752277ac1b80abf362de5d94cca2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 14:53:45 +08:00
Joseph Chen 01f0422dca common: bootm: skip usb_stop() if usb is boot device
We may access usb at late sequence.

Change-Id: I8e8b40fc7e1018fe279f384282481805bceb5daa
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 14:53:45 +08:00
Joseph Chen 5704c899ed fdtdec: support pack "kern.dtb" to the end of u-boot.bin
- It provides a way to promise kernel dtb can be loaded successfully
  even when the image is damaged.
- This makes developers easily to add what they what just like a "U-Boot" dtb.
- The kern.dtb file is pack into the end of u-boot.bin while ./dts/kern.dtb
  is exist.

Change-Id: I93a36a9c65ea8719e5610cdcbcc7708e5337c53f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 14:53:45 +08:00
Joseph Chen 6069a2cc24 rockchip: resource: fix/optimise some code logic
- alloc sysmem after load kernel dtb successfully;
- allow distro kernel dtb to be loaded later than other
  resource file, that is not controlled by code condition
  "if (list_empty(&entrys_head))".

Change-Id: If1657289a4f8980ad7d7a5df7da0e061aab21504
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 14:53:45 +08:00
Joseph Chen bcf005ba08 lib: sysmem: no need to increase alloc size when base is 0
Change-Id: Ia716956e1a0e980330d6a7f7eb6c89f91e133ddf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 10:23:52 +08:00
Joseph Chen 3ceae1099b rockchip: param: fix get usable size error
fixes: (ced10db rockchip: param: add SDRAM_MAX_SIZE as ram top limit)

Change-Id: I9b27570116d931be484548c440df30f5026de1bd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 10:23:52 +08:00
Joseph Chen d65bf0c630 lib: sysmem: fix alloc failed at 0x0 address
The 0x0 address is usually allocated by 32-bit uncompressed kernel
and this alloc action is just a peek. Due to LMB core doesn't support
alloc at 0x0 address, we have to alloc the memblk backword a few bytes.

This patch is mainly to avoid fail message from sysmem/LMB.

Change-Id: I894ae2252a30a7690d10899484266191dfb12d15
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-31 16:39:43 +08:00
Joseph Chen ced10dbe1c rockchip: param: add SDRAM_MAX_SIZE as ram top limit
This patch handles the boot fail for RK3288 4GB machine.

Change-Id: I2be6e532120595a6c10e9e99a779d9ec32f48fb5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-31 16:39:42 +08:00
Jason Zhu f3ba630b34 mtd: mtd_blk: fix get: mtd error if device is nand
Change-Id: I1cebba63cbabefa87fd67d98a4d93e151604626d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-30 16:40:28 +08:00
Jason Zhu 4bac908b8b rockchip: spl-boot-order: move rk_nand_init() to the function end
Since the nand driver is not standard dm driver in spl, so move
rk_nand_init() to the function end.

Change-Id: I075a309fa3d2d0b938863cdb1867b70d217f2ce3
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-30 11:56:18 +08:00
Jon Lin 19d68200a9 rkflash: decrece reserved IDBlock from 16 to 8
Change-Id: Ice651f23ad487b6c08aacf73bab9bc7942155928
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-10-29 10:43:02 +08:00
Joseph Chen cd6239260c make.sh: ignore warn/error message of command 'ls'
fix: "ls: cannot access trust*.img: No such file or director".

Change-Id: Iabecb6b751dd3ba3f25fe725dac17cf4b7c39801
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-28 10:34:27 +08:00
Joseph Chen 9b32339749 fastboot: add Android-Q feature support
Add "fasboot getvar is-userspace" support.

The Android-Q document shows "not allow the flashing of dynamic partitions"
is not aimed at the physical partition(call "super") but its child partitions
(i.e. system, vendor, oem...).

Change-Id: I4e21a9728a1093b68a9d1a08420586f33dcf0117
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-28 09:45:19 +08:00
Joseph Chen 8b84e8b629 rockchip: rk3399: correct comment
Change-Id: I98046f1869504c0877e5e344ef121dfde7824227
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-28 09:18:07 +08:00
Jon Lin c84f0ed80a rkflash: uniform code with linux
Uniform loader, u-boot, linux low layer driver code to reduce bug in
the migration process

Change-Id: I618345fdfece2a59437a15cb3bd8d70b7c292abb
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-10-24 22:09:37 +08:00