Commit Graph

50450 Commits

Author SHA1 Message Date
Jason Zhu a07b97f223 mtd: mtd_blk: map the part address if dev is mtd_blk
The blk_dread will occor error if the image is packed with multiple
firmwares, for example boot.img, when nand or spi nand have bad block.
So call mtd_blk_map_table_init to remap part address to make sure
reading correct data.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Icebc6b1c5a10758efa615424d0706b9ed6ec23ad
2020-05-26 22:13:07 +08:00
Joseph Chen 2b7be5df0e rockchip: spl: fix verified-boot flag state print
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic787533a9a4bdb985a63750dbed9c5c112f30da4
2020-05-26 19:55:24 +08:00
Jason Zhu 69808149dc spl: rkfw: call misc_decompress_stop() to clear the decompress irq
Otherwise the next stage will respond to the decompress completed interrupt.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ie56a7eb939374bd5aac326bb3cd022225bf71dd2
2020-05-26 18:17:17 +08:00
Joseph Chen 9bddc4c3dc rockchip: dts: rv1109 remove unused files
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id6ce34e554cd392f8361580feb9af31f6a7635ce
2020-05-26 15:24:35 +08:00
Joseph Chen 37bbf320ac configs: rv1109: sync from rv1126_defconfig
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I995c96f730c080ee082b092062daab8efec4945d
2020-05-26 15:19:23 +08:00
Joseph Chen f30634031c configs: rv1126: clean with make savedefconfig
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib817179165d697b9544099ac5f1409a6d91d333f
2020-05-26 15:18:25 +08:00
Jason Zhu c10175d521 configs: rv1126: support fastboot
1.support boot kernel by spl
2.support pressing key to enter uboot
3.rename the defconfig

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I56e4aa9d90a7fa3efae9e0d7dbdf73741eeb9040
2020-05-26 14:25:11 +08:00
Finley Xiao 5410c5c273 clk: rockchip: rv1126: Add clock init for isp and vop
Change-Id: I1c4a1267e90f84f6f7777a35e0ad5824b6eff2d1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 17:44:27 +08:00
Finley Xiao 5ecc545e4e clk: rockchip: rv1126: Add support for decom clock
Change-Id: I90eacb03ed191b804911429af5ad80daab3776cc
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 17:44:27 +08:00
Finley Xiao c17ccbf6fd clk: rockchip: rv1126: Add support for isp and ispp clocks
Change-Id: Icfd87f56c30bfa81b6e7fecadcda090c26a8c465
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 17:44:27 +08:00
Jon Lin c402731f2d mtd: mtd_blk: Add api to get mtd_blk mapped address
Change-Id: I197df5f03e0894584cd2ffb3b7ac1423e84e43df
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-25 15:20:43 +08:00
Joseph Chen eaa66b0d6a tools: fit: add "/totalsize" property for itb size
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1aa87d5c0e1dd39762c470b134c4d8a57cab4f29
2020-05-25 14:57:18 +08:00
Joseph Chen c516743f40 common: fit: add fit_set_totalsize() interface
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib10984da99aa82d5dd4bbfe2b13233e7155aee41
2020-05-25 14:57:18 +08:00
Joseph Chen b4b532de54 configs: rv1126: verify otp verified-boot flag for SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I7277606c3e46ba1f10f49e9d2cbdea68ba30bc59
2020-05-25 14:57:18 +08:00
Joseph Chen c22a6b218d rockchip: return boolean for otp verified-boot flag
Print this important information.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ibf59f5c13285960d3b022a9c67d6cee3a274eaf1
2020-05-25 14:57:18 +08:00
Joseph Chen 1ab43d022e rockchip: its: remove unused property
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I540d4e741d362c0f2d871d4f14700507e2653b31
2020-05-25 11:05:03 +08:00
Joseph Chen f1d6518991 rockchip: board: fix typo
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I21bf8e925b2746ca62344ffa49b9ccb7c7cdb7c7
2020-05-25 11:05:03 +08:00
Joseph Chen d6f41d79d9 configs: add rv1126-usbplug_defconfig
- enable CONFIG_SUPPORT_USBPLUG to generate mininum usbplug.bin
- only "rockusb" command is supported
- run_command_list() doesn't support powerful syntax, it falls
  back to run_command().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
Change-Id: I67ac23aedc48359032c9b44cbf417515090cbd95
2020-05-22 16:58:04 +08:00
Joseph Chen f79adc89c3 rockchip: rv1126: support usbplug
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
Change-Id: I841df666100e78dda2bac4b7ce9a8495a5e4a171
2020-05-22 16:58:04 +08:00
Joseph Chen e90e674ffd rockchip: add usbplug support
The output usbplug.bin is used to replace the rockchip
usbplug binary in the "rkbin" repository.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0ec488bd37f3b3e96232f2ed653a0af453199105
2020-05-22 16:58:04 +08:00
Joseph Chen 4a2b8db466 common: add usbplug support
- disable some message
- add "usbplug.bin" generation
- add minimum usbplug dtb support
- add individual board_init_r() init sequence.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If48ee49247fca6108db3a1fbab3b403241b3a8eb
2020-05-22 16:58:04 +08:00
Joseph Chen 9542469246 gadget: rockusb: support usbplug download mode
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic265243834ce294e6d979bcae89774a42600e5f3
2020-05-22 16:47:41 +08:00
Joseph Chen d45e5655df dm: serial: allow skip console serial init
Always use debug uart.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id751856abd7be219e8acb4c5986469a804051934
2020-05-22 16:46:40 +08:00
Joseph Chen 50c379531a rockchip: rkimg: add configure wrap for kernel dtb code
Allow disable some configure without bringing compile error.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6fddf3368c3e63b82cfb071a2cfe70ebcad7de7b
2020-05-22 16:46:40 +08:00
Joseph Chen 95ce6b2a3b arm: Kconfig: use "imply" for some configures
Allow to disable them in board defconfig.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3519c2c23e9e5407637c8dba73e9645a0480cdd8
2020-05-22 16:46:40 +08:00
Joseph Chen f6aff21fa1 cmd: rockusb: import U_BOOT_CMD_ALWAYS
rockusb command is required for usbplug feature in the furture.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9998ba07e2f7faddae6a830987bea2d6018f431a
2020-05-22 16:46:40 +08:00
Joseph Chen 3d8049ad2f common: add U_BOOT_CMD_ALWAYS() support
This function is used to support some special U-Boot commands with
U_BOOT_CMD_ALWAYS() declared even when CONFIG_CMDLINE is disabled.

It's used when developers requires a critial u-boot.bin by disabling
the U_BOOT_CMD() and using a simple CLI instead.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I768637592a4d85c7fea00564e96fb80f21ab65fe
2020-05-22 16:46:40 +08:00
Joseph Chen aedbab3f0f common: cli: allow fall back to simple cli
The simple CLI mode only support run_command() which can't support
powerful command line syntax like if...then...else...fi conditionals
or `&&' and '||'.

The run_command_list() falls back to run_command().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I136cba71e02fd1f57c9a395b37679d9a885ba4a0
2020-05-22 16:46:40 +08:00
Joseph Chen f3ff8d72ff sysmem: fix compile error
Error msg: multiple definition of `sysmem_overflow_check'.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I46de1ef35f2decfab7412c415b7f734e3459e5d9
2020-05-22 16:46:40 +08:00
Joseph Chen a3320fac15 bidram: fix compile error
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia459afb9f821fa22352615de2fd132cc43ec462e
2020-05-22 16:46:40 +08:00
Joseph Chen 598c6b730e common: fdt_support: update code wrap by configure
It avoids compile error while disabling CONFIG_ARCH_FIXUP_FDT_MEMORY.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I283a335c2ecf559e42544ab138af414423d8a888
2020-05-22 16:46:40 +08:00
Joseph Chen d41e543aa6 common: spl: initial spl->next_stage
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5066612be4c90ff674b61034768eeaba9b9c9b85
2020-05-22 16:39:51 +08:00
Joseph Chen a1247eb812 rockchip: spl: fix typo
Use upper case "V2".

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4b252687c560e13ab78812eb72b59806393beb12
2020-05-22 16:39:51 +08:00
Joseph Chen 869c6dc2a9 include: boot_rkimg: define more partition name
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia8c58e2acca485771ef6a2747bdcbb8326dbfebc
2020-05-22 16:39:51 +08:00
Jason Zhu f0130a0392 rockchip: rv1126: call hang() if timeout when set the pmu
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib92d97e4a2faf3d6002cc6236b576b4c820ad6d9
2020-05-22 15:40:16 +08:00
Simon Glass 6cc5f5cc85 UPSTREAM: spi: Avoid using malloc() in a critical function
In general we should avoid calling malloc() and free() repeatedly in
U-Boot lest we turn it into tianocore. In SPL this can make SPI flash
unusable since free() is often a nop and allocation space is limited.

In any case, these seems no need for malloc() since the number of bytes
is very small, perhaps less than 8.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: d13f5b254a (spi: Extend the core to ease integration of SPI
	memory controllers)
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit ca2abb75a086d8b0bdb51689f331ba8f1a146379)
Change-Id: Ia76abf7491780b1984eb81c6c78796bcc0141095
2020-05-21 17:14:01 +08:00
Bernhard Messerklinger 3dc0a5efc5 UPSTREAM: spi: spi-mem: Check if exec_op function is set before calling it
Add check if exec_op is set before calling it.
At the moment it is called unconditionally, which leads to a crash if it
is not set correctly.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 567a3eb7956f98af4ed065499898c6d0ac6443c7)
Change-Id: Ie9fdf0cbee364fc33965e3234d7457702bd0120f
2020-05-21 17:12:57 +08:00
Jon Lin cbd9216dad spi: rockchip_sfc: Change SPI Nand dummy cycles as X8bits address
Spetial patch for GD devices cause u-boot SPI Nand MTD bad
supporting for GD, and the u-boot mainline haven't synchronize
with Linux.

reference to following Linux commit:
commit f1541773af49ecd1edae29c8ac0775253a0b0760
Author: Chuanhong Guo <gch981213@gmail.com>
Date:   Sat Feb 8 15:43:50 2020 +0800

    mtd: spinand: rework detect procedure for different READ_ID operation

    Currently there are 3 different variants of read_id implementation:
    1. opcode only. Found in GD5FxGQ4xF.
    2. opcode + 1 addr byte. Found in GD5GxGQ4xA/E
    3. opcode + 1 dummy byte. Found in other currently supported chips.

    Original implementation was for variant 1 and let detect function
    of chips with variant 2 and 3 to ignore the first byte. This isn't
    robust:

    1. For chips of variant 2, if SPI master doesn't keep MOSI low
    during read, chip will get a random id offset, and the entire id
    buffer will shift by that offset, causing detect failure.

    2. For chips of variant 1, if it happens to get a devid that equals
    to manufacture id of variant 2 or 3 chips, it'll get incorrectly
    detected.

    This patch reworks detect procedure to address problems above. New
    logic do detection for all variants separatedly, in 1-2-3 order.
    Since all current detect methods do exactly the same id matching
    procedure, unify them into core.c and remove detect method from
    manufacture_ops.

Change-Id: If60d0281eb963486639d5b4ce1939ad2b219c8d6
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-20 13:21:15 +08:00
Jon Lin 113ced8fa4 spi: rockchip_sfc: Remove useless abit setting
Change-Id: I98bdc2eca772eaa5934f2980916438eca2492afd
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-20 13:08:23 +08:00
shengfei Xu c2bb46e4a5 irq: gicv3: Enables Group 1 interrupts for the current Security state
When a CPU enters a low power state, the registers ICC_IGRPEN1_EL1 is lost.
It need to re-initialise.

Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I62d9eed2b29190134d95ebd153f21aa764c4ab3b
2020-05-20 09:08:34 +08:00
Jon Lin b4e0791886 mtd: mtd_blk: Change to use erasesize_shift for calculating
Change-Id: Iba08a6df807db9ca582bc22864f4cc51ac5ca121
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-20 08:53:25 +08:00
Jason Zhu c53a0c58e7 rockchip: atags: support parse mtd block dev type
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ie446393b6f96667f37b2050e32a366b7d7265a94
2020-05-19 21:27:57 +08:00
Joseph Chen 1ff581bb9e scripts: fit: refactor code
- update coding style;
- simply some code logic.
- remove some unused file.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0246dcf5aae6bb73771406518fdaf622bfd9bb2b
2020-05-18 18:16:20 +08:00
Joseph Chen 5bce9eeca6 configs: rv1126: use DTC from host pc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9978690015a0a8533a2e5de5a3a63d25cf095e28
2020-05-18 16:22:34 +08:00
Joseph Chen 1e6f900d03 rockchip: its: remove "@" for nodes
Fix the warning:
	<stdout>: Warning (unit_address_vs_reg): Node /images/uboot@1 has a unit name, but no reg property
	<stdout>: Warning (unit_address_vs_reg): Node /images/uboot@1/hash@1 has a unit name, but no reg property
	<stdout>: Warning (unit_address_vs_reg): Node /images/optee@1 has a unit name, but no reg property
	<stdout>: Warning (unit_address_vs_reg): Node /images/optee@1/hash@1 has a unit name, but no reg property
	<stdout>: Warning (unit_address_vs_reg): Node /images/fdt@1 has a unit name, but no reg property
	<stdout>: Warning (unit_address_vs_reg): Node /images/fdt@1/hash@1 has a unit name, but no reg property
	<stdout>: Warning (unit_address_vs_reg): Node /configurations/conf@1 has a unit name, but no reg property
	......

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If48fa120294ff6061922de3c277654744cdebe02
2020-05-18 16:22:34 +08:00
Joseph Chen 4405dc8ff2 Revert "tools: fit_image: add -Wno-unit_address_vs_reg"
This reverts commit 75e20461a6.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If549e8a3129569b82c625b0afb0b453f4ad56f60
2020-05-18 16:22:31 +08:00
Joseph Chen 8c5bfb85bb rockchip: fit: verify resource depends on CONFIG_FIT_SIGNATURE
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4ab2b177aeae5ecdb843a8215ccab221c3045eae
2020-05-18 16:21:06 +08:00
Finley Xiao 15ede2a15c clk: rockchip: rk3036: Add support for vop
Change-Id: I0f057350a6ad07f61aaf42c84e50c452ee662f46
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-14 16:42:38 +08:00
Joseph Chen b6e67ca896 make.sh: merge all fit common args to a variable
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id485dd311c534260255cfb771b015d83ee401e80
2020-05-14 11:37:26 +08:00
Joseph Chen 6402f0407c scripts: fit: support repack rollback-index version
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3b183e6a7868a5a769d41179f62a5ec0a23b41f5
2020-05-14 11:37:26 +08:00