Commit Graph

49506 Commits

Author SHA1 Message Date
Joseph Chen 763ecaa306 scripts: stacktrace.sh: use grep to filter lines
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3817c654f9391dd6b6a216333a3a8c9fc519c0d3
2019-11-22 08:42:16 +08:00
Joseph Chen 270d4d86b3 core: read: add dev_read_s32_default()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I174670da004001feafcec568e978d2dfd9f55ef9
2019-11-22 08:42:16 +08:00
Jason Zhu 2442fbadc2 fastboot: support cmd boot-recovery & reboot-fastboot
Change-Id: I01693db8304c8fb1804c4342501cdbb38f8ccf2a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-22 08:41:53 +08:00
Jason Zhu fd633ddcf6 android: add function android_bcb_write
Change-Id: Ie65068dc4fca751a9bcc959c56209aaf4729f638
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-11-22 08:41:53 +08:00
Joseph Chen f61a2da6e8 usb: gadget: validate NULL string before strncpy()
The variable "s" is passed as NULL(i.e 0) When g_dnl_set_serialnumber()
is called from hdelete_r() originally.

The memory 0~1M is secure for ATF on rockchip arm64 platforms,
so the strncpy() accesses 0 address and causes a data-abort.

This issue occurs on deleting env "serial#".

Change-Id: Idbf76d26809ab8b195ff4f8193e2eeac99692289
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-20 11:40:22 +08:00
Kever Yang 6de0075c5d rockchip: Kconfig: enable CONFIG_DEBUG_UART_BOARD_INIT for all SoC
Some SoC may missing this config, this is need by all the SoC, so set it
at higher level.

Change-Id: I16e935635cce61d02d6641992483baf98f9fe71b
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-19 17:22:04 +08:00
Kever Yang c90232ab81 rockchip: ram: add support for rk3326 evb
PX30 evb is ddr3;
RK3326 evb is lpddr3

Change-Id: I02c365e8c0f9b5e6cfa47ad7c5972d6a8ce327d9
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-19 16:52:51 +08:00
Kever Yang e82920f397 rockchip: px30: Enable support for UART5
Because the UART2 IOs are mux with SDcard, in order to use SDCard,
we need to use UART5(on evb RPi connector) instead of UART2M0

Change-Id: Ibeab51636eb748f389d9211193c0b5682c266c9e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-19 16:52:42 +08:00
Kever Yang f546c94580 rockchip: rk3288: no need to check PLL setting.
Remove assert to make DEBUG work.

Change-Id: Idd41066f98c759b4fefe25c8715138c1c54df418
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-19 16:49:37 +08:00
Joseph Chen ef473e3642 regulator: pwm: remove init voltage setting
Regulator uclass takes over this job, avoid to init twice.

Change-Id: Idea56143bd7008742936d3bbe1ebadb00c683a47
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-19 14:25:46 +08:00
Dayao Ji 0a34d7e5db common: android: support A/B with DP support
Need to pass androidboot.force_normal_boot=1 instead of
skip_initramfs when A/B supporting dynamic partition.

Change-Id: I1748690d04d4ef16e121d8dc88f69745a3cbb77d
Signed-off-by: Dayao Ji <jdy@rock-chips.com>
2019-11-15 10:00:47 +08:00
Jon Lin ad65dd86b6 mtd: spinand: support GD5F2GQ4UExxG
Change-Id: If7b0c17129b9a914fc6854959cf074b33b876a5e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-11-15 09:09:30 +08:00
Andy Yan a05d668445 rockchip: rv1108: reduce u-boot.bin size below 512KB
According to rkcommon.h, when back to bootrom from ddr
initializing, the next payload size is defined RK_MAX_BOOT_SIZE,
which is 512KB.

So we disable some cmd module here.

Current u-boot-dtb.bin is 508KB.

Change-Id: I1ff97907c19fd33f428627a6de66ec790514599a
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-11-15 09:09:01 +08:00
Andy Yan df7b19b0b1 rockchip: dts: rv1108-evb: enable sdmmc
Add sd card support, tested on rv1108 evb v11.

Change-Id: I61e25c78c23c4f774a314b9489f81dab1d990531
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-11-15 09:09:01 +08:00
Andy Yan 2bfd4c143b rockchip: dts: rv1108: increase sdmmc drive strength to 8ma
sync from linux kernel develop-3.10:
"ARM: dts: rk1108: increase sdmmc's drive strength to 8ma"
(sha1: 90ac5cb61aabf2e344c10b4c55954d6a3f41bd55)

Change-Id: Ifd38ced2b0a9cada25e9348f455454c9edbc7bd8
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-11-15 09:09:01 +08:00
Joseph Chen a84f21ebb8 rockchip: add misc BCB message offset compatibility
Rockchip platforms defines BCB message at the 16KB offset of
misc partition while the Google defines it at 0x0 offset.

From Android-Q, the 0x0 offset is mandary on Google VTS, so this
patch is a compatibility according to android image 'os_version'.

Android os version >= 10 is at 0x0 offset, otherwise at 16KB offset.

Change-Id: I54a7674e2dc2e0c29fc624f17b4453663c9ea462
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-14 11:08:45 +08:00
Joseph Chen c092b1390d common: image: provide BCB offset according to android os version
Rockchip platforms defines BCB message at the 16KB offset of
misc partition while the Google defines it at 0x0 offset.

From Android-Q, the 0x0 offset is mandary on Google VTS.

Change-Id: Iac36d421ed605684353c30bfe0e9982bdd5de065
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-14 11:08:45 +08:00
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