Commit Graph

48623 Commits

Author SHA1 Message Date
Joseph Chen 505b141795 common: board_r: add board_initr_caches_fixup()
Remove dram_initr_banksize(), use mmu_set_region_dcache_behaviour()
in board_initr_caches_fixup() to set region MMU table attr is more
easily.

Change-Id: I9d9917e938fe5bbab5aa27575a5c8592ff08ab50
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 6e15146eff lib: sysmem: refactor code
- import memblk id to manage memory blocks;
- change "sysmem_property" to generic "memblock";
- use alloc instead of reserve for all memory blocks;
- clean up and fix some logic;
- add U-Boot cmd for sysmem;

Change-Id: I614223ce3bf97a7b3566412a9d1864fb30b68fd8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Joseph Chen 88bfa97963 include: add memblk.h
Provide generic id and struct for memory blocks.

Change-Id: I1fe00dfdb8ee8209eca55c8e7ebbedcafa0371a1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-26 11:04:33 +08:00
Zhangbin Tong a7774f5911 common: boot_rkimg: set "androidboot.mode=" as "normal" or "charger"
- The legacy setting rule is deprecated(Android SDK < 8.1).
- Provide CONFIG_RKIMG_ANDROID_BOOTMODE_LEGACY to enable legacy setting.

Change-Id: I5c8b442b02df068a0ab98ccc81a4f008ebe540c1
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-25 11:42:52 +08:00
Joseph Chen e95ee152a4 common: image-fdt: only care about enabled reserved-memory
Change-Id: I2c17cb1a8237e709cf8a528b35be2dcea70d4627
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-22 09:46:06 +08:00
Joseph Chen a78c73bb66 include: lmb: increase MAX_LMB_REGIONS to 16
Maybe 8 is not enough.

Change-Id: Idc4813fa406def5401fdf423cdf30d47555d1a92
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-22 09:46:06 +08:00
Zhihuan He e5f393836b driver: ram: rv1108: use common code to setup ddr parameter
use rockchip_setup_ddr_param to setup ddr parameter.
The dram_init() and dram_init_banksize() make use of
sdram common code.

Change-Id: Icfc6cbef9fcc128e3a835184b46b89b9b22aab16
Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
2019-03-22 09:00:32 +08:00
Zhihuan He 4cd861d04b arm64: dts: rockchip: rv1108: add u-boot,dm-pre-reloc
The uart, dmc and grf device add "u-boot,dm-pre-reloc".
Before relocated, u-boot will analyse dram capacity which
is need the device of "u-boot,dm-pre-reloc" attribute.

Change-Id: I1d18b564b0c521b176a2293a03403139034ccc0b
Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
2019-03-22 08:50:01 +08:00
Joseph Chen a0f7ba0595 common: fdt support: delete env "initrd="
Fix AB sysmem miss delete env "initrd=".

Change-Id: I77ab135644d3b1d2a2eb3f3be6168cf6ef4417df
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-21 10:36:28 +08:00
Jon Lin 6e9d994efb rkflash: support 8KB page size slc flash
comfirm in MT29F16G08ABABA

Change-Id: Ib2a3c62b3a4c9b9880c78fb01d39d4ad8fe2ac87
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-03-20 16:06:27 +08:00
Joseph Chen ee561e345b lib: avb: AVB_VBMETA_PUBLIC_KEY_VALIDATE select CONSOLE_DISABLE_CTRLC
Clean coding style by the way.

Change-Id: Ib614175e9ea7ceebc49030235b66d82adc57d3a0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-20 15:08:14 +08:00
Joseph Chen 590d13d737 console: add CONFIG_CONSOLE_DISABLE_CTRLC to disable ctrlc
There are sometimes we would like to disable ctrlc, just enable it.

Change-Id: I2911650b22d47b057a039774d8293cad6317bb6d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-20 15:07:59 +08:00
Jason Zhu f3124cd744 spl: fit: use ddr for mmc read buffer in SPL for rk3368
rk3368 has the same problem with rk3399.

Change-Id: I242385722f864810273708f03dc62359a7bdb81e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-20 11:29:50 +08:00
Joseph Chen 2e68f6b5f9 power: charge animation: support long key event without release
Change-Id: I9d7cd439376f2f4ff89ea6bfe3baedbeaa4deeb9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-18 11:34:06 +08:00
Ziyuan Xu 6787bf9f0a configs: rk3326: enable lzo/lz4
Change-Id: I7184cd7020a0bbe18dfa91d5a0cfba2e44ccc40c
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-15 18:29:24 +08:00
Ziyuan Xu b60f8c8556 configs: px30: enable lzo/lz4
Change-Id: Ie914d9181e2ab06f92060b359cb65f6139f946db
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2019-03-15 16:38:50 +08:00
Hisping Lin b4a0434fc9 lib: optee_client: do not init RK FS if security not exist
Change-Id: I91e780448cee7884c7477cb0b5720f962b2df00d
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-03-15 15:28:38 +08:00
Hisping Lin 472ddf73a4 lib: optee_client: add support for power-off protection
Change-Id: I4babcc1989563a3c707a1cac7e93069031f033dd
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-03-15 15:28:38 +08:00
Jason Zhu 4df150d128 rockchip: dts: rk322x: add cd-gpios
Add cd-gpios to test the mmc device whether exit.

Change-Id: I171f4c0d895baf1a1b54c971fc88370a0b10ce3a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-15 14:29:05 +08:00
Joseph Chen eef7c6f46a rockchip: board: ignore mmc strength fdt fixup for rk3399pro-npu
Change-Id: Ic2b787e2bff49e73ca3ec3404fc74751d2903aa6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-14 20:14:26 +08:00
Andy Yan 9d2bc40cc0 boot_rkimg: don't override BOOT_MODE_REG
We should keep the boot mode value, linux
kernel need it.

Change-Id: Ic31166dffc3fefdf352cac1d1002a91dea319fc5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-03-14 19:26:47 +08:00
Shunqian Zheng 957c1cf2af usb: rockusb: Forbid data beyond 32MB reading
Simply return magic char if one is trying to read data beyond 32MB.

Fixes: 628c827 ("usb: rockusb: forbid reading data beyond addr 32MB")

Change-Id: If2cdf05dbf9d6dcdd4cf8f9605ab84480fbca32d
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2019-03-14 19:24:48 +08:00
Yifeng Zhao 7aec704a4e drivers: mtd: nand: rockchip nandc add bad block detect api
The data layout for rockchip nandc is:
    1024 bytes data + 32 obb + 1024 data + 32 obb ...
The system detect bad block flag locate at 2048, 4096, 8192...

The system checks for bad blocks and gets the wrong bad block.
Add a bad block detect api to check the bad block.

Change-Id: I8b0f2907a851d3bbb4d1b9f5daf21319bfb047d9
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-03-14 16:51:39 +08:00
Jason Zhu 41175141f3 mtd: nand: rockchip: fix incompatible-pointer-types compile err
Fix the following compile error:
drivers/mtd/nand/rockchip_nand.c: In function ‘nand_spl_load_image’:
drivers/mtd/nand/rockchip_nand.c:657:39: error: passing argument 3 of
‘nand_read_skip_bad’ from incompatible pointer type
[-Werror=incompatible-pointer-types]
  return nand_read_skip_bad(mtd, offs, &size, NULL, size, (u_char
*)dst);
                                       ^
In file included from drivers/mtd/nand/rockchip_nand.c:11:0:
include/nand.h:101:5: note: expected ‘size_t * {aka long unsigned int
*}’ but argument is of type ‘unsigned int *’
 int nand_read_skip_bad(struct mtd_info *mtd, loff_t offset, size_t
*length,

Change-Id: I44c97f21c2c2d40a7dcbdab7ddb96a1025949ee4
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-14 16:51:28 +08:00
William Wu 6a3f8006e0 usb: phy: rockchip: fix implicit definition warning
When make with rock_defconfig, compile warning for the
following implicitly defined function are raised due to
a missing include directive:

  drivers/usb/phy/rockchip_usb2_phy.c: In function ‘otg_phy_parse’:
  drivers/usb/phy/rockchip_usb2_phy.c: 102:10: error:
  implicit declaration of function ‘fdt_translate_address’ [-Werror=implicit-function-declaration]
  addr = fdt_translate_address(blob, node, reg);
          ^~~~~~~~~~~~~~~~~~~~~
This change fixes this by including <fdt_support.h>.

And this patch also fixes the following compile error:

  drivers/usb/phy/rockchip_usb2_phy.c:96:1: error:
  label ‘retry’ defined but not used [-Werror=unused-label]

Change-Id: Ia82d0ff02b0f528ddde8a553d457c6c0cb763680
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-03-14 14:04:14 +08:00
Joseph Chen 28e9b49d47 rockchip: board: fdt fixup mmc strength as 2mA for rk1808
Change-Id: I183e671a6a3ea753f163b2c3f534de85f584bd38
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-12 19:28:01 +08:00
Keerthy e217fe3cbd lib: fdtdec: fdtdec_get_addr_size_fixed remove checks
With 8 bytes addressing even on 32 bit machines these checks
are no longer valid. Remove them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit f51f6715a5013f37620c38f0430e21d4736e235a)
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

Change-Id: I07d143dbd4dfeff1ce99d081d1279c4f70fa4e8f
2019-03-12 14:40:07 +08:00
Joseph Chen 841c4e1755 rockchip: atags: add tag for SoC information
Change-Id: Ic2f89b8deb5cebeaaa05fb6cd67997429821904c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-12 10:00:40 +08:00
Jason Zhu f44ca27357 android: fix retry mechanism with ab system
Minus the retry-count in every boot with ab system. If the ab system
boot success, the system service boot_ctrl reset the retry-count or set
boot-successful.

Change-Id: Ic37f65b745d1feb978730332835246dc43d72dab
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 18:12:21 +08:00
Jason Zhu 74b485fb2b fastboot: delete write perm-attr hash if use pre-loader pub_key
Since we use the pre-loader public key to verify permanent attribute, then
we do not need to write permanent attribute hash to otp & efuse.

Change-Id: Ic5e19fed2fc9405ab5bc7504dd930fd5f02d847c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 18:12:14 +08:00
lifangyuan e84ef14d6d configs: rockchip: rk3288: Fdt overlay enabled by default.
Change-Id: I61a127b39b5bbb03da3042b776b5d0fff1a20aed
Signed-off-by: lifangyuan <fangyuan.li@rock-chips.com>
2019-03-08 17:41:26 +08:00
Joseph Chen dd9ee2cc6f rockchip: rk3368: correct MMU ram map size
Change-Id: I4884a88613fe5c2fa515360d4c754f4eade84ed3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-08 17:41:06 +08:00
Joseph Chen d17dc7d485 Revert "rockchip: dts: rk3308: add cd-gpios"
This reverts commit 18601cb12a.

Change-Id: I9d1501ab0492a24ddbd6877b3cc735dfbc5a6944
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-08 17:35:12 +08:00
Andy Yan 4701d790f4 cmd: bootrkp: return CMD_RET_FAILURE on error
A cmd only returned with CMD_RET_XXX defined
by command_ret_t can ensure it work well when
called from shell.

Change-Id: I16e76ed62928380eaaf3c352efb4df9463b7e72d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-03-08 16:50:55 +08:00
Jason Zhu 65f0143b26 lib: avb: verify the perm attr by root public key
Change-Id: I7e06152a21325ffcd785223952fe8ffaff4d5f08
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 15:32:09 +08:00
Jason Zhu 3cf641a815 fastboot: support write&read perm attr rsa certificate
Change-Id: Iab2ca981dedc188c61c60cd8cebd0f01c5896d44
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 15:32:09 +08:00
Jason Zhu 1f670f7cc9 lib: avb: get public key by atags
Change-Id: I0d77229585263e81e8be4f5c67a02080c07b0e55
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 15:32:09 +08:00
Jason Zhu 9b83ce70a9 lib: avb: add get&set perm-attr cer
Change-Id: I89d3a30f43659ae8c9d107ede5db1590b022440d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 15:32:09 +08:00
YouMin Chen 00e55222d3 driver: ram: rk3399: clear interrupt before data training
Clears the corresponding interrupt bit of the PI_INT_STATUS
parameter before trigger data training.

Change-Id: Ic25c952a19913cb4332b6cd3405f41474585bfb1
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2019-03-08 15:07:29 +08:00
Jon Lin 6f226dcaab rkflash: change flash_read_page_raw return to error_ecc_bits
1.increase the number of read retry, Triggered only when the
readout is wrong, so efficiency affects small
2.add nand buildin ecc support
3.skip ECC error block instead of marking as bad block
4.less debug printing
5.adjust the way of building tables to increase ftl init

Change-Id: I9cbc369472740d472dfad29449d1fd6529cd9877
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-03-08 14:57:22 +08:00
Jason Zhu 18601cb12a rockchip: dts: rk3308: add cd-gpios
Add cd-gpios to test the mmc device whether exit.

Change-Id: I6a07ff130e506678a20e5128ef4c8e608e0ec448
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 09:11:39 +08:00
Jason Zhu b73a762978 dts: rockchip: rk3288: add cd-gpios
Add cd-gpios to test the mmc device whether exit.

Change-Id: I3d4839180b36de22ce1e5f2b26c9090b0686a8a0
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 09:10:32 +08:00
Jason Zhu aa0fd9f34b rockchip: px30: add cd-gpios
Add cd-gpios to test the mmc device whether exit.

Change-Id: Ie1cfffe0f7826eae47fab705d3a3bb7d1a85f8ce
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-03-08 09:10:24 +08:00
Joseph Chen 01ff14b054 rockchip: resource: add return value validation
Change-Id: I3ed362564e7aed48fc212f299f3712fdbc19ee53
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-07 10:13:40 +08:00
Hisping Lin f4e1db9544 lib: optee_client: add judgment of return value
Change-Id: If616f89ffb2c3ea30afb7bced56a1ca28b1232b2
Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
2019-03-06 18:44:39 +08:00
Joseph Chen d08ece9d97 configs: rk3399pro: enable CONFIG_DOS_PARTITION for fat fs
Change-Id: I02f68c31399b695a81705b53e8dad161d5366002
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-06 18:42:19 +08:00
Joseph Chen 2b3bb4e5c8 configs: rk3308: enable CONFIG_DOS_PARTITION for fat fs
Change-Id: Ifb975cf96cdcc0d1d070bcc39bd4555828fb9fd0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-06 18:42:19 +08:00
Joseph Chen 688a40e1c9 configs: rk3126: enable CONFIG_DOS_PARTITION for fat fs
Change-Id: I3837289269240d383bc3272840e6f27dd9406b00
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-06 18:42:19 +08:00
Joseph Chen 68373a9aa5 configs: rk322x: enable CONFIG_DOS_PARTITION for fat fs
Change-Id: I8435a6f1e0e802072279dabaa6887fd2f074a040
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-06 18:42:19 +08:00
Joseph Chen 4dc1628ce4 configs: rk3368: enable CONFIG_DOS_PARTITION for fat fs
Change-Id: Ie05cdec6c52c0173f2f8e8c2b3f47105b164f2c0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-03-06 18:42:19 +08:00