Commit Graph

51068 Commits

Author SHA1 Message Date
Kever Yang 4857df5d78 rockchip: evb-rk3128: enable android boot cmd
Enable android boot cmd to support rk aosp boot img.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I37fc3311ccbc4251e6ef90599f534b485a38f0dd
2020-09-27 11:16:50 +08:00
Joseph Chen 02b8a383be rockchip: rk3308: remove unused code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id079ca34c140de00c1a798327420c8687c660631
2020-09-24 17:13:18 +08:00
Joseph Chen 7abb254d74 rockchip: board: correct debug uart init
Should use debug_uart_init() which include board_debug_uart_init().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib3479aed3e874ac11da3ebb8f8868a6f43218ef8
2020-09-24 17:13:18 +08:00
Dayao Ji 40a6a2cba2 fastboot: add virtual A/B feature support
Add "fasboot getvar snapshot-update-status" support and
prevent erase/wipe of userdata/metadata when virtual A/B
merge status is MERGING or SNAPSHOTTED (+source slot !=
current slot).

Signed-off-by: Dayao Ji <jdy@rock-chips.com>
Change-Id: Ibb6ea5778b78b2601178f489d6efcee60d5d0a49
2020-09-23 19:01:12 +08:00
Dayao Ji 132e9ecacf rockchip: rkimg: Add R/W interfaces for virtual A/B metadata
According to the AOSP default definition, the virtual A/B
metadata is located at the offset 32KB of the misc partition.

Signed-off-by: Dayao Ji <jdy@rock-chips.com>
Change-Id: Ib60379f25e4c72be9f5ed03934ab7dc928cdd585
2020-09-23 16:26:32 +08:00
Joseph Chen ab2b3191ab rockchip: rv1126: add periph device region for thunder-boot SPL
It makes thunder-boot SPL only map periph device region as
dcache off but not all 4GB region to save boot time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib0abafe1b74cde24755780261fb7fcfaa8932ea2
2020-09-21 15:42:09 +08:00
Joseph Chen 2a3fb7bb04 arm: cp15: only map periph device region as dcache off for thunder-boot SPL
Don't waste time to map all 4GB region.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I24ba4e4e42545dcf3ac6622c36995485956eae1b
2020-09-21 15:41:43 +08:00
Joseph Chen d93c779cf8 include: linux: add SZ_3G/4G definition
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I97ebf0e488bc33da29c923e7fe9a253f5369ad9a
2020-09-21 15:38:29 +08:00
Joseph Chen 745aeb1a7d common: android: add boot_img_hdr_v3 and vendor boot support
Android Header v3 and vendor boot partition are introduced
from Android-11(R).

Header populate:
  Header v3 is no longer compatible with v0/1/2 header, we
  add populate_andr_img_hdr() to merge boot and vendor_boot
  partition header into struct andr_img_hdr in order to
  compatible with v0/1/2 header.

resource.img:
  The second_addr and second_size fields are removed in v3,
  so we require resource partition to restore resource.img.

A/B system:
  If not A/B system, the boot.img header version is 3 and
  recovery header is version 2.

AVB load image:
  - If allow verification error: the image is loaded by
    ops->get_preloaded_partition() which auto populates
    boot_img_hdr_v3.
  - If not allow verification error: the image is full loaded
    by ops->read_from_partition() which doesn't populate
    boot_img_hdr_v3, we need to fix it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2afce53c43d782fc57baa01acf9c05518b580840
2020-09-18 14:41:37 +08:00
Liang Chen 5a4b526e82 configs: rk3399: enable D-cache for SPL
enlarge the CONFIG_SYS_MALLOC_F_LEN for MMU table

Change-Id: I77800cb6dd8a2049d43edee4ebdfcf16c3333f94
Signed-off-by: Liang Chen <cl@rock-chips.com>
2020-09-17 20:03:01 +08:00
Joseph Chen 93fd134f77 common: malloc simple: enable space exhausted message
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If089f38abf5e205a2b9f00fd2d735751fd7d5201
2020-09-17 20:03:01 +08:00
Jon Lin e091dc9d13 mtd: mtd_blk: Map table length round up to erase size
Change-Id: I5f615d37a572ce0d8ceb8d6d6b76983fc61e316b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-17 15:20:49 +08:00
Jason Zhu 51ceae363d mtd: mtd_blk: support map bad block table in spl
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I48112628812b948e4ab5a34362c8ada12b00471e
2020-09-17 15:20:49 +08:00
Jon Lin 2ac88c1bbc rkflash: Check bad block mark in spare 1st and 2nd byte
Change-Id: I60bb761d1f7a015c76939db165c53bf53bd514cf
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-17 14:40:02 +08:00
Jon Lin 03d86fc3c0 mtd: spinand: Support FM25S01A
Change-Id: I805cbf0e8bc47cd9bd94fd296dbaf46921490f15
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-16 12:58:33 +08:00
Joseph Chen ae33e3114a scripts: rename fit-mkimg.sh to fit.sh
The name style follows other rockchip scripts is better, like:

./scripts/atf.sh
./scripts/loader.sh
./scripts/spl.sh
./scripts/tos.sh
./scripts/uboot.sh

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I249f67d0b4e385a3f05f9c754bc0a9c371b46910
2020-09-16 12:07:26 +08:00
Joseph Chen 3a02727caf scripts: uboot.sh: use lodaerimage from rkbin
Upstream U-Boot can't generate local loaderimage.

Change-Id: Ic5748003cdbd4df2cd8c558acf4f6a02d7307ab0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-09-16 12:07:25 +08:00
Joseph Chen 45986beb25 scripts: not allow error for rockchip scripts
Change-Id: Iee56011cda94803802d368f7a8f27590d1091d16
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-09-16 12:07:25 +08:00
Joseph Chen a524b379f7 make.sh: support parse CONFIG_SYS_TEXT_BASE for upstream U-Boot
Change-Id: Ic3be7c38d4eb11924ea2a09e6256210dc61009c9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-09-16 12:07:25 +08:00
Nickey Yang e50bd74269 rockchip: dts: rv1126: correct build errror
this patch fixed "rockchip: dts: rv1126: SFC add pinctrl"
build error log:
   Error: arch/arm/dts/rv1126-pinctrl.dtsi:291.3-4 syntax error
   FATAL ERROR: Unable to parse input tree

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I4dde5b49fc2b56701b3326bca4978529286455c3
2020-09-16 11:01:58 +08:00
Jason Zhu 0ee21b67f5 include: image: fix compile error
error message: include/image.h:1015:1: error: unknown type
name 'bool'; did you mean '_Bool'?

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I786c04be6f389ad42685b934eb13426ea9a9e5a4
2020-09-16 08:39:09 +08:00
Jon Lin f28847a81d rkflash: Simplify SPI Nand flash table
1.Simplify SPI Nand flash table
2.Support new SPI Nand devices
3.Format coding styles

Change-Id: Ie7beae2de5b2165ce7f727aa6eab18d726d0dedc
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-16 08:39:00 +08:00
Jon Lin 4d72219b9d rkflash: Remove SFC reset in initial progress
Only when the host work wrong, run SFC reset.

Change-Id: Ia2c7f30e4e93203250dc378f2704942d99d73c55
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-16 08:38:37 +08:00
Jon Lin bc966f92a1 rockchip: dts: rv1126: SFC add pinctrl
1.SFC add pinctrl;
2.Adjust fspi_pins property.

Change-Id: Ia89669aeee9a5097c7a74850b478891573493f1d
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-16 08:38:10 +08:00
Jon Lin b66d41c240 mtd: spinand: Support hyf devices
Support HYF1GQ4UPACAE, HYF1GQ4UDACAE

Change-Id: I9b8022d9320150d587b443cfa4cdc7495267795e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-16 08:37:57 +08:00
Tang Yun ping 958e04de67 rockchip: rv1126: tpl: thunder boot use SPL_KERNEL_BOOT
Use CONFIG_SPL_KERNEL_BOOT for thunder boot to stay the same with SPL.

Change-Id: I0d2f0a91a5f628233de1cb848519fd76b692a2af
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-09-16 08:37:30 +08:00
Weiwen Chen 6ab927d862 configs: add rv1126-ab.config
It is used for AB system.

Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I5cc24afe5f737c4172783f00198d96ed536d80e4
2020-09-15 15:12:57 +08:00
Joseph Chen 34df577a5d scripts: fit-repack.sh: fix cp issue
cp: omitting directory ‘out/repack’

Ignore directory.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4ebca3319b290a7eab9f4b51e9338a0cb3c6c10f
2020-09-15 11:47:28 +08:00
Joseph Chen 69b1ad4693 common: android: clean up code
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I98dfd54edd813f892c5f2717a694b2424b8ecded
2020-09-15 10:55:29 +08:00
Joseph Chen f870210e35 rockchip: resource: add comments
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I45434529a44a5e311af1b693c0af56473c770bf9
2020-09-15 10:55:29 +08:00
Jon Lin 247c5a81b3 mtd: spinand: Add initial support for the MX35LF4GE4AD
Change-Id: Ib1228650e76dc82bc86fb28472616d0fefb269bf
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-15 09:42:28 +08:00
Elaine Zhang 9848d60c83 dt-bindings: clock: rk3568: Add binding header for rk3568
files origin from kernel.

Change-Id: Iab1de697da1db28ef0d4d10c96c437373363c1bd
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-09-14 17:14:15 +08:00
Jon Lin aec089f883 rockchip: rv1126: Pull up SFC IO2
GPIO0_D6 pull down in default, but it's needed for SPI Flash with
WP# pin pull up.

Change-Id: I80a79e0072f1fff49673bbe834f51603e10283dc
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-14 17:12:18 +08:00
Joseph Chen 1dd64bce5e rockchip: rv1126: clean arch_cpu_init() for SPL
Moving current configurations into SPL boot stage except
something belongs to USBPLUG.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I64ec47f7c0c3cef57854a72af86e9ef1bebbcaed
2020-09-14 15:39:08 +08:00
Jon Lin d30345d690 mtd: spinand: Add initial support for the MX35LF2GE4AD
Change-Id: Iab488487f9937d31cf419757988a4152f359e62b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-12 20:41:43 +08:00
Ziyuan Xu f771421f9c configs: add new configuration for lp3_emmc-tb boards
Overlay from rv1126-emmc-tb.config

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: Ic0b26dc2934b1ff87d6120e8a66078639f0e1e23
2020-09-09 17:06:44 +08:00
Jon Lin 65c356141d spi: rockchip_sfc: Limit io rate to 100MHz
Change-Id: Icec10dbe65d5bbef72b858447aa15e848084712b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-08 17:51:24 +08:00
Jon Lin 177c873697 cmd: rockusb: Add block continue write flag
1.It's good for Nand devices P/E align
2.But actually 0x200 sector(USB limit) is aligned with Nand flash block size

Change-Id: I69510161c32e15ee739c99d36f0294d59df554dd
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-08 17:51:23 +08:00
Jon Lin 853fc11fcc blk: Add BLK_MTD_CONT_WRITE tag
Change-Id: I72537387912d5c981dbe205c0d0c1864fa42a555
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-08 17:51:23 +08:00
Jason Zhu 0e91bf0e81 configs: rv1126-emmc-tb: enable CONFIG_SPL_BLK_READ_PREPARE
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3f1fcde5f0c2c1ee623302310dbaca138b5e8428
2020-09-07 16:26:04 +08:00
Jason Zhu fdb19f3978 spl: fit: add file spl_fit_tb_arm_v7.S
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I59554a339cbad5f03806c6b1007ccf69e03be470
2020-09-07 16:26:04 +08:00
Jason Zhu 2201a451d5 common: fit: add fit_image_is_preload()
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3c3001a347ae59fcfd186156382c04b4b8a77546
2020-09-07 14:53:06 +08:00
Jason Zhu 4d62a7e032 blk: remove unused code
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib43223baa7d335f6810f714fd64c40cd314b0185
2020-09-07 14:53:06 +08:00
Elaine Zhang 62be0c2c53 clk: rockchip: rk3368: support get pll config by table
add some special pll configs for better clock jitter.

Change-Id: I3484d36feb9f4b99a42a2ba532ae2015968d83ff
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-09-04 14:22:54 +08:00
Joseph Chen 3eac03e218 common: spl: ab: allow missing misc partition
Return partition name without any slot suffix in this case.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If0692e3e2845f152802632994f5da5a9d3fb1731
2020-09-02 17:10:09 +08:00
Joseph Chen b8fa09953a common: console: support enable timestamp in SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Iefe5f9ea6e9abb8c3cc07e75beb68c387f20320f
2020-09-02 16:35:17 +08:00
Joseph Chen c9f753f3de misc: rockchip decompress: use flush_dcache_all() before decompress
flush_dcache_all() operating on set/way is faster than
flush_cache() and invalidate_dcache_range() operating
on virtual address.

Tested: it saves about 12.5ms in rv1126 thunder-boot.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie8ba42f56e72d0d554dca3949573196ef2165bd7
2020-09-02 16:35:16 +08:00
Joseph Chen 8259a58e4a rv1126: configs: do reset for bootcmd if thunder-boot version
We made a deal: Not allow U-Boot to bring up thunder-boot kernel.

Because the thunder-boot feature may require special memory layout
or other appointments, U-Boot can't handle all that. Let's go back
to SPL to bring up kernel.

Note: bootcmd is only called in normal boot sequence, that means
we allow user to boot what they want in U-Boot shell mode.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8a68af3fbd441ab7e30ad310640eaf3ee5f24525
2020-09-02 16:02:49 +08:00
Jon Lin d38748a7d2 mtd: spinand: Support DS35X2GA
Change-Id: I05e3a0d28983cf24a8a7ba0aee23e434cda4a1a9
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-01 14:44:03 +08:00
Jon Lin f1b20f5a45 rkflash: Support FS35ND02G-S3Y2
Change-Id: Ifd62df6188c09fc9fccf4a38bd7c856bc8061d80
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-01 14:43:56 +08:00