Commit Graph

17266 Commits

Author SHA1 Message Date
Tony Xu 53bea680ec common: write keybox: always write storage flag to security sorage
Change-Id: Iaa536eb51216f46a35ae5999ed19ad5703509b6a
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-11-27 11:31:04 +08:00
Joseph Chen cc3d674144 linux: compiler-gcc: add __cacheline_aligned
Change-Id: I0cc437885aa3a1e6637c1aeee9df718ac61fa914
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-27 11:13:54 +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 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 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 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
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
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 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 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 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 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 25c13168fe irq: virq: add parent irq enable/disable management
- disable virq chip by default;
- fix bank->use_count little than 0;

Change-Id: I69aa07cc2924dab40eea6524588869361ad8cf66
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-23 11:12:30 +08:00
Tony Xu 86574b32ce common: write_keybox: support write keybox by RKDevInfoWriteTool
Change-Id: I853663623f4550469b676239c44586e5efb6b21f
Signed-off-by: Tony Xu <tony.xu@rock-chips.com>
2019-10-22 14:48:33 +08:00
Jason Zhu b4761549e8 rockchip: rk1808: support spl build
Add some spl configs for spl build.

Change-Id: Idc0d3e89c3ac316a540bd6fc7571b68ee440952c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-15 08:49:07 +08:00
Lin Jinhan 434d6fd368 crypto: add crypto v2 TRNG support
Change-Id: I25d4e8115e3ab9060d3bc87db06de481e299d6ab
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-10-14 20:57:26 +08:00
Jason Zhu e1c38c9f84 rockchip: common: add mtd_blk spi nor scan support
Change-Id: I74b2c02bf9d23ffe8a3eada92f90132d0742fbea
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-10-09 09:13:32 +08:00
Jason Zhu 69fdc5969f lib: avb: update and modify the avb library
The commit point is updated to google external/avb/
which commit point is 868db2a514bbb02e166fb55b1592b27de8c9680c.

Change-Id: I10f7c0ac356a7666b518b62e59ccb62277668578
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-09-20 08:50:37 +08:00
Joseph Chen b073251d9c include: irq-platform: add IRQ_USB_OTG definition
Change-Id: Id2a85c67b2f29bf97d19fdb50e7a59ded47b1606
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-19 15:30:13 +08:00
Kever Yang f117ac95ec rockchip: px30: Update CONFIG_SPL_MAX_SIZE to 0x40000
We are going to update atf base to 0x40000, so that we can use space
0~0x40000 for SPL without relocate for support ATF.
0x40000 should be enough for SPL text, and we have separate BSS and
STACK.

Change-Id: I081d289f10a54d8a98e9f466e1730659f2c712a3
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-09-19 12:48:28 +08:00
Algea Cao 75eb6fceb5 video/drm: Add bridge get_timing interface
Some bridge can't get tv edid such as rk1000 cvbs, but
at present bridge can't provide timing without edid. So
we add get_timing interface to provide timing.

Change-Id: Id74802a3bff8140e3677f6633788aacd021afc91
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2019-09-17 10:37:51 +08:00
Joseph Chen c9c9fba95e include: compat: remove dump_stack(...)
- We have implement dump_stack() for both ARM and ARM64;
- It was brought back by careless on commit: (28386b6 UPSTREAM: lib: Add hexdump)

Change-Id: I8ebbd46862475485963d2ac835ea4031207d2153
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-12 11:30:39 +08:00
Alex Deymo 43d520f312 UPSTREAM: Update include/android_image.h from AOSP
This takes the latest changes from AOSP from the file
include/bootimg/bootimg.h from the repository:
https://android.googlesource.com/platform/system/tools/mkbootimg
and update the U-Boot version with the latest changes.

This file keeps the changes from AOSP to a minimum:
 * Comments were converted from C++ to C style.
 * Code inside __cplusplus #ifdef blocks were removed.
 * C++11 struct extensions replaced with a single struct.

Change-Id: Ifdfa7cc365a28e45ab7f192c121b49f6da99af36
Signed-off-by: Alex Deymo <deymo@google.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
(cherry picked from commit 0b6febfdb3cf9b4a51fa65fbd94f9ab2d7738f32)
2019-09-06 11:45:32 +08:00
Sandy Huang 94d85f7bdd drm/rockchip: add picture aspect ratio define
Change-Id: Ie1d8313afe5f24596a989f7c8f290c734815f036
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-29 18:10:28 +08:00
Joseph Chen 7733bf1789 configs: rk3066: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: I1c81f13946b3f8e74b2400f9d12be882e4387b38
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 90ba3aa2da configs: rk322x: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: Ie863ed0627dd8604c8dbc8b59ed8f4197c68bc93
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 1982131941 configs: rk3288: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: Ic5a2df1fbfec0e6d94f9904042db8961aa0abf4d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 56a40692c3 configs: rk3328: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: If806c7736ada2852931f8e06d137658d8cf3c0db
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 975da02e88 configs: rk3368: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: If88b142a81f5cd28f333b9dc901e70619b9ce12b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 99ae836464 configs: rk3399: update malloc size to 32MB
Since AVB use sysmem alloc, we can decrease malloc size.

Change-Id: I627ceab0440a1655524904a8c4b11905bcdc830d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:04:07 +08:00
Joseph Chen 98c1299759 common: android: add android_image_memcpy_separate() interface
This is a encapsulation of android_image_load_separate(). It is used
for AVB boot/recovery.img which has been loaded to ram by AVB bootflow,
and we memcpy kernel/ramdisk/dtb to where we expect.

Change-Id: Iea4ea3404b84e9d3c091954ab27fb8c9d2ad84bc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:03:08 +08:00
Jason Zhu 4dbf7962f3 rockchip: rk3308: add CONFIG_SYS_SPI_U_BOOT_OFFS
Change-Id: I300eb48b224adacab50121f8b3ad8ba469fc22ee
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-29 11:48:02 +08:00
Joseph Chen bd700d6b80 common: bootm: add bootm state param for arch_preboot_os()
- This makes arch_preboot_os() more flexsible;
- call arch_preboot_os() when BOOTM_STATE_OS_PREP;

Change-Id: Ia4ae3666b8180c993c761ef222acbcff5358ae97
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-23 12:48:57 +08:00
Jason Zhu cbe246677b rockchip: otp: add secure_conf_base & otp_mask_base to platdata
We add secure_conf_base & otp_mask_base to platdata to operate
the secure OTP.

Change-Id: Ie336b2cf61076aa82f7c1987cc3cec7166751452
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-21 12:58:49 +08:00
Jason Zhu 6e12c1dd66 rockchip: otp: move some definition to header file
Change-Id: I82b4afe1adbb5f91f3b3146c3cad14e2873b93c3
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-21 12:58:49 +08:00
Jason Zhu 4569f42498 rockchip: common: add mtd_blk spi nand scan support
Change-Id: Ibe59252b9648b61b733f7154ff91ccb90768715f
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-13 14:26:17 +08:00
Joseph Chen 4f9cab2711 dm: fuel gauge: rename fuel_gauge_get_soc() to fuel_gauge_update_get_soc()
New name is more accurate about internal implementation..

Change-Id: I16891f5f614fbb17f1e65e04ef4d8a713c8624f3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 18:11:23 +08:00
Joseph Chen 0f9d23ea98 dm: key: allow power key to skip irq handler init
At sometime, its parent driver would setup the main interrupt(e.g. PMIC).

Change-Id: I8d24266c48f515fc92c3529a5b6aa7a18d181af1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:32:47 +08:00
Joseph Chen ded32713dc power: pmic: register interrupt controller as a irq chip
So that the child drivers can request their irq through the
generic interrupt framework.

Include: RK805/808/816/817/818.

Change-Id: I5556f2e926e850ac6717a05166eab5e19566d531
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:32:43 +08:00
Joseph Chen 2c4e90c1f8 irq: add irq_handler_enable_suspend_only() interface
Change-Id: I3cda4c3a4ce5928be32eaa8b65ccd4e16946c116
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:26:04 +08:00
Joseph Chen 4176611909 irq: add virq irq-chip support
This patch support the device to add its interrupt controller as "irq chip"
into generic interrupt framework, the other driver can request its child
interrupt like a real hardware irq.

Example for PMIC:
    GIC-\
        |- ...
        |- GPIO-\
                |- ...
                |- PMIC-\
                        |_ virq_0
                        |_ virq_1
                        |_ virq_2
                        |...
                        |_ virq_n

Change-Id: I17716f3db494a85fc22b23ff18042771a6116da8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:26:04 +08:00
Joseph Chen cf34425241 irq: clean up code
Change-Id: I51c2713b7c42fa798fee6971a2c91d867042ef70
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:26:04 +08:00
Joseph Chen 0b84b74a16 rockchip: rk3308: more space for ramdisk image on aarch32
It seems ramdisk image needs more space.

Change-Id: Idcdd9ca5b568132381ee1951be603045e1d09d13
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 15:06:27 +08:00
Boris Brezillon 87a1a21db6 UPSTREAM: mtd: nand: Pass mode information to nand_page_io_req
The NAND sub-layers are likely to need the MTD_OPS_XXX mode information
in order to decide if they should enable/disable ECC or how they should
place the OOB bytes in the provided OOB buffer.

Add a field to nand_page_io_req to pass this information.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Change-Id: Idb70434140c0304cfc97d7f3c52cbeca349fdff8
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit f86787280b37e381f8d82f48583434d62dd16e27)
2019-08-07 17:36:08 +08:00
Sandy Huang a2d2b88ee1 video/drm: rockchip_display: add return value for automatic test
Change-Id: I6cd4f7d4bd738c7f4cf59af3a2daf46365e7c1e9
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2019-08-06 10:23:50 +08:00
Lin Jinhan e7846385ca crypto: add crypto v2 SHA512 support
Change-Id: Idee2ada3d5da6aef2a170509da2efa6b1f6e4a9d
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2019-08-05 17:46:03 +08:00
Joseph Chen 2227535d49 lib: add sha512 support
Porting from: https://tls.mbed.org/sha-512-source-code.

Update and follow sha1/256.c function name and coding style.

Change-Id: Idbe70b71e54e0e56a88aac5ec306c75fb2237f4f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-02 10:34:33 +08:00
Jason Zhu 6f678d2aa9 spl: record boot_device into spl_image and call
spl_perform_fixups

On some boards, we want to give the board/architecture-specific code a
chance to look at where the next image has been loaded from and
perform fixups before starting the next image.  This is of particular
importance, when we probe multiple devices for bootable payloads and
boot the first one found.

This change adds the following:
 - we record the boot_device used into the spl_image structure
 - we provide an extension-point for boards/architectures that can
   perform late fixups depending on a fully populated spl_image
   structure (i.e. we'll know the final boot_device and have info
   on the image type and operating system to be booted).

Change-Id: Iebca59a61979bc12eabe743c73dc2279e870e2ff
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-02 09:23:44 +08:00