Commit Graph

13308 Commits

Author SHA1 Message Date
Bian Jin chen a0614e0a98 rockchip: resource: fix dtb addr error in hdr_v2.
dtb addr should add the size of recovery_dtbo when
recover_dtbo is included.

Change-Id: I97f7bd6e248f61413b530972abe46c3236bd0b01
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
2019-09-17 10:40:39 +08:00
Joseph Chen d0f492c85c rockchip: resource: improve comment for init_resource_list()
Change-Id: Ic6ac812976b063c6991e33d128e5abe11832c78e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-09 09:17:28 +08:00
Joseph Chen bbe32cd5bf rockchip: resource: support parse dtb from dtb position of android image
- the dtb position was added in boot_img_hdr_v2;
- required for Android Q or later.

Change-Id: Ia0536f0fd68a4cdfc55356c6371d1b781f655a9a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-06 11:45:49 +08:00
Joseph Chen 4ebf6738fd rockchip: resource: add function replace_resource_entry()
Change-Id: I4c038c6812eab39fedab96942c4cf389bf9e668e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-06 11:45:32 +08:00
Joseph Chen 4f74cb3014 rockchip: resource: add comments and header check
Change-Id: I49b47d8716767014987c5913826ee7217869ae99
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-09-06 11:45:32 +08:00
Joseph Chen e6bda4b2ed rockchip: resource: support parse dtb from second position
If the seconds position is not a resource file, maybe it's a
dtb file.

Change-Id: I819cb0ff9c702c306000bf30fb47891009e4ff32
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:02:58 +08:00
Joseph Chen 0905295234 rockchip: resource: clean up code
Change-Id: If133cba598752ce1a1eeed1e6432e7dffa2c5112
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-29 13:02:58 +08:00
Kever Yang 7b6e880558 rockchip: evb-rk3128: add pmic node
Add pmic node so that the fireprime can enable the current limit at
board_early_init().

Change-Id: I64b308b47b437feb19acd8521f37687a4463186c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-29 11:54:18 +08:00
Jason Zhu ce39010b28 rockchip: spl-boot-order: support scan spi nand device
Change-Id: Ia057a4fddd31bc57cd613d6328cfc5b26753a0c1
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-29 11:48:02 +08:00
Jason Zhu 3e429466a7 spl: add some BOOT_DEVICE_MTD_BLK_XXX boot mode
Use the BOOT_DEVICE_MTD_BLK_XXX boot mode if the nand & spi nand & spi
nor driver are appended to MTD device.

New boot mode:
	BOOT_DEVICE_MTD_BLK_NAND
	BOOT_DEVICE_MTD_BLK_SPI_NAND
	BOOT_DEVICE_MTD_BLK_SPI_NOR

Change-Id: I27a63791455073ccdcb80c16bac4dfb635da07de
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-29 11:48:02 +08:00
Jon Lin b0bc5ced0d dts: rk3308: add compatible rockchip,sfc to sfc
in order to support MTD SPI flash framwork

Change-Id: I251fcf343be029a7f2cff8632b0e80a62972291b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-08-27 10:50:01 +08:00
Joseph Chen dba9c9e59f rockchip: board: show regulator initial state by hotkey
It's useful for debug.

Change-Id: Idae556cea02e05f240e3c680a1b02a7506946490
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-23 12:48:57 +08:00
Joseph Chen 665be4b0c2 rockchip: hotkey: enter cli on BOOTM_STATE_OS_PREP/GO
- BOOTM_STATE_OS_PREP: before fdt fixup and DM works normally;
- BOOTM_STATE_OS_GO: before jump to linux and DM can't work normally;

Change-Id: Ic377a426970acd4f600f654a4efd4bdde38c3a89
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-23 12:48:57 +08:00
Joseph Chen 6281e7d505 rockchip: atags: enable atags cmd "dump_atags"
Remove atags test function, we don't need it any more since
we have applied atags to so many platforms and it works well.

Change-Id: Ideecdfb34141f848b81ef5441b61be54f72708ff
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-23 12:48:57 +08:00
Jason Zhu 6c98a58203 dts: rk3308: add secure_otp node for secure otp
Change-Id: If55ab22de9eaad19a75678a892e4ec24643af3c9
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-23 09:16:33 +08:00
Kever Yang e4adbfc93d rockchip: rk3128: correct usb phy phandle
The phy phandle in usb node should be port instead of phy, or else the phy
driver not able to find the ops and abort at generic_phy_get_by_index().

Change-Id: I79161dc252cfa9e57b34290fb94d926476a3035d
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-21 16:04:29 +08:00
Kever Yang 02e47c3d38 rockchip: dts: rk3328: update init value for ACLK_BUS_PRE
The ACLK_BUS_PRE suppose to be 150M instead of 15M.

Change-Id: Ie746284219ee2a9ad7f61b823211c94f5e61ed77
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-19 10:50:58 +08:00
Kever Yang bd5537509b rockchip: rk3328: correct usb phy phandle in dts
The phy phandle in usb node should be port instead of phy,
or else the phy driver not able to find the ops and
abort at generic_phy_get_by_index().

Change-Id: I6aac0c45b882f45136f58062bccd8d1dab79d524
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-13 10:32:58 +08:00
Kever Yang f99f53c229 rockchip: dts: rk3328: update node for emmc and usb
Enable related nodes in SPL and move all u-boot related dts
into -u-boot.dtsi

Change-Id: I1303598f209d20ebf10722f5451151d3e7c6c982
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-12 17:30:05 +08:00
Joseph Chen 2b2ef88659 rockchip: boot_mode: remove unused recovery env set
Change-Id: I50920f3b24f37d5bea123c7166eb4ed9e17c7b1e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-08 18:12:13 +08:00
Lin Huang 90a8d4436c arm: rockchip: rk1808 set isp qos priority to 2
isp qos priority is 1, and if run with npu, sometime
it can not get right image, so set it priority to 2.

Change-Id: I3cc34ffe9c17c8a4d79f9ba71732fcab3c879511
Signed-off-by: Lin Huang <hl@rock-chips.com>
2019-08-06 14:22:39 +08:00
Jason Zhu 10dd5e8c27 rockchip: spl: set bootdev by atags
Change-Id: Ia47748b95bc2870d1bf7256306230458be42a77c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-02 09:23:44 +08:00
Jason Zhu 7a4963852a rockchip: atags: add interface to set boottype by spl bootdevice
Change-Id: I2dd6435d1c70d18114680c469bce72555735f55e
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-08-02 09:23:44 +08:00
Joseph Chen 6bccab8707 fdt: fixup: move board_fdt_fixup the earliest than others
If we update fdt by create or move operation, the fdt nodes offset are
changed, but device node of DM didn't update its offset linking with the
fdt node. This makes driver can't parse the right fdt node info.

This is a DM framework bug, we need this patch to workarund it.

Change-Id: I18ee427fe2457ae42e5c6d1dab3e365fe87e06e4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-01 17:46:49 +08:00
Adam Ford 1490eb89f4 UPSTREAM: Convert CONFIG_SPI to Kconfig
This converts the following to Kconfig:
   CONFIG_SPI

This partly involves updating code that assumes that CONFIG_SPI implies
things that are specific to the MPC8xx SPI driver.  For now, just update
the CONFIG tests.  This also involves reworking the default for
CONFIG_SYS_DEF_EEPROM_ADDR so that we don't set it when we cannot make a
reasonable default, as it does not cause any compile failures.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit f1b1f77060beadbfe9f42a3be00019bd025afbd6)
Change-Id: Ie9f15ada869105eb407f41d4df7eecbaa916b940
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Christophe Leroy 5bda114b50 UPSTREAM: powercp: mpc8xx: move commproc.h
include/commproc.h is dedicated to the 8xx, rename it cpm_8xx.h and
move it into arch/powerpc/include/asm

Change-Id: I37b02101bd88b607f0f9eca79fdbb7cc1e85ed4d
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 18f8d4c60d26e6cd113461c5d716c64897c3f112)
2019-07-23 17:15:32 +08:00
Christophe Leroy 87e4c6020e UPSTREAM: powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx
CONFIG_8xx doesn't mean much outside of arch/powerpc/
This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ...
It also renames 8xx_immap.h to immap_8xx.h to be consistent with
other file names.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
(cherry picked from commit ee1e600c13d16febd517ab7d0d2c243db174789b)
Change-Id: I564708bb6517b699749e8a54c013d032f785e459
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-07-23 17:15:32 +08:00
Tuomas Tynkkynen 5932b8bc8c UPSTREAM: spi: Migrate CONFIG_KIRKWOOD_SPI to Kconfig
Change-Id: I70b43d668f905f236e18493c07ac6c369b7ca2d1
Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 4a942f49b891872727aa0bdba58e2ca513fc455c)
2019-07-23 17:15:32 +08:00
Chris Packham ab86434d69 UPSTREAM: spi: kirkwood_spi: implement workaround for FE-9144572
Erratum NO. FE-9144572: The device SPI interface supports frequencies of
up to 50 MHz.  However, due to this erratum, when the device core clock
is 250 MHz and the SPI interfaces is configured for 50MHz SPI clock and
CPOL=CPHA=1 there might occur data corruption on reads from the SPI
device.

Implement the workaround by setting the TMISO_SAMPLE value to 0x2
in the timing1 register.

Change-Id: Iee0b8cb304816d74c6442132be4cc04e6cb8adbc
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit df16881cea50a787c37591bd2168c8ea656217bd)
2019-07-23 17:15:31 +08:00
Joseph Chen 996752e678 rockchip: memblk: update memblk attr
Add M_ATTR_IGNORE_INVISIBLE for kernel memblk on RK3308-AArch32 to
alloc kernel region within 0~1M address.

Add "ramoops" alias for share memblk to avoid sysmem check warning.

Add M_ATTR_KMEM_CAN_OVERLAP for some images.

Change-Id: I1d7ed93a19ea22e5c69f23d75a1c1faf4e9f0104
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-22 14:23:50 +08:00
Joseph Chen ab4c011acf rockchip: hotkey: disable hotkey when CONFIG_CONSOLE_DISABLE_CTRLC enabled
If we enable CONFIG_CONSOLE_DISABLE_CTRLC for AVB bootflow, we want to
disable hotkey too.

Change-Id: Idd542a1fa8b3b2a7d232373a767e91e49e90d9ae
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-19 11:31:38 +08:00
Joseph Chen 8dbcccd6d4 rockchip: atags: disable set atags if it is not available
We make the appoint that the other pre-loader can set atags
only when TPL ative it(creating the valid atags header).

Change-Id: I579d31e0880f35193b9c017fc83cbe0f5a25bfb3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-19 11:31:13 +08:00
Joseph Chen e8b8350080 rockchip: resource: dump android version and build time
It prints like: "Android 8.1, Build 2019.7", maybe helpful
for debugging.

Change-Id: I10acbb6e8d864ae2daa2621bf9cfdf4b902a49b4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-19 11:30:53 +08:00
Joseph Chen 2208cd926b rockchip: board: clean up code
Change-Id: Ic4cdd4b54514a4c89f5603063ca791e9efa39193
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-19 11:30:20 +08:00
Joseph Chen 1d30bcc50c rockchip: resource: support parse "logo" partition picture
We provide a "logo" partition for user to store logo.bmp
and update from kernel user space dynamically.

This patch follows the rkdevelop usage:
- Only support store one picture named "logo.bmp";
- Use "dd" command to generate partition image with logo.img
  eg: "dd if=logo.bmp of=logo.img count=1 bs=19456"

Change-Id: Iffde4d123e303c010d99cd446c241a535bce1dcf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-12 11:58:13 +08:00
Joseph Chen 47e67a816e rockchip: boot mode: remove "recovery" partition lookup for recovery mode
Since we have unified android and linux image format that "recovery" partition
is necessary, we remove partition lookup when recovery mode is required.

Anyway, there is no recovery partition in A/B system and recovery ramdisk
has been moved to boot.img, and adding this judgment code is a little mess.

Change-Id: I9f590f464a14ac25855b8a9487c55cec8d353890
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-12 11:57:55 +08:00
Jason Zhu 41beaf3970 rockchip: dts: rv1108: add cd-gpios
Add cd-gpios to test the mmc device whether exist.

Change-Id: I36bcdf0a0b0d5ca79392646cfcc17f03c5704235
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-10 15:46:41 +08:00
Joseph Chen 069b847777 rockchip: dts: rk3399: add "sclk_crypto1" for clock-names
It was missed by careless on:
(272fdf6 rockchip: dts: rk3399: add and enable crypto node)

Change-Id: I89c4c2acfd72d88dcf37b3ef3a7a39474cd73854
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-10 14:29:15 +08:00
Jason Zhu 7d9fa41d1f rockchip: rk3308: correct the nand iomux
The nand has two group iomuxs, change the iomux to the correct one.

Change-Id: I38affa1287f64dd72d8a17b7d6c56671108b831a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-10 08:32:03 +08:00
Jason Zhu 5afd331559 rockchip: atags: add interface to get boot type from brom
We get bootsource from BROM_BOOTSOURCE_ID_ADDR. The array bootdev_map
is used to transform rom bootsource type to rk atags boot type.

Change-Id: I6d0cef250dc2e65ccb6e55077bc2b4be6115bd90
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-10 08:31:46 +08:00
Jason Zhu 17e5c754fc rockchip: atags: add BOOT_TYPE_UNKNOWN
Change-Id: I486f78a8394bba27119ba3e318ae11288f3a585c
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-09 09:36:55 +08:00
Jason Zhu b7307f89b5 rockchip: bootrom: sync bootsource from bootrom
Add more bootsource:
1.BROM_BOOTSOURCE_UNKNOWN
2.BROM_BOOTSOURCE_I2C
3.BROM_BOOTSOURCE_SPI

Change-Id: Idd4c28caa532a22b576b255e12d1e83e4b96471d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-09 09:36:26 +08:00
Joseph Chen 5b045e7d5a rockchip: board: move rk3288 fdt fixup to rk3288.c
Change-Id: I6ec415121457c86412648cc6f54b4001bc044dd9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-08 12:10:25 +08:00
Joseph Chen 38ce626101 rockchip: board: move rk1808 fdt fixup to rk1808.c
Change-Id: I83914f26081802f7580b40acf357546b0003c2bb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-08 12:10:16 +08:00
Joseph Chen 46929408f2 rockchip: rk1808: fixup "ramdisk_addr_r" by real image address
We fixup "ramdisk_addr_r" with real image address which has been already
loaded by pre-loader. This brings benefits:

- It saves boot time when ramdisk is large;
- It avoids memory overlap with original ramdisk data.

Change-Id: Ib67545e1895c09c8294a1682f9cd52d59c3b33b8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-07-08 12:08:57 +08:00
Jason Zhu 0abc5d192a rockchip: board: test the bootdev if the bootdev is error
Test the bootdev if the bootdev is error which passed by
pre-loader. Run the devtype_num_set to get correct dev_desc.

Change-Id: I5a6f7cd996032a649b2a8fe821314265f00a0091
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-08 08:48:11 +08:00
Simon Glass b6e92505d5 UPSTREAM: sf: Add a method to obtain the block-protect setting
It is useful to obtain the block-protect setting of the SPI flash, so we
know whether it is fully open or (perhaps partially) write-protected. Add
a method for this. Update the sandbox driver to process this operation and
add a test.

Signed-off-by: Simon Glass <sjg@chromium.org
Change-Id: I8e8abe197ab483a26622f02666cc234a1544e642
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a58986ca8b53d8c7a441397082f84edc7f47d19f)
2019-07-05 19:33:46 +08:00
Simon Glass 583deafe1b UPSTREAM: dm: spi: Clean up detection of sandbox SPI emulator
Now that we don't have to deal with the command-line flag we can simplify
the code for detecting the emulator. Remove the lookup based on the SPI
specification, relying just on the device tree to locate the emulator.

Change-Id: I6dd9372cb74b8ee991e12314a02e928e3201ae3d
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 66613f5dd25c4372b3f5ecb2f0c1d08b7f77b3a8)
2019-07-05 19:33:45 +08:00
Miquel Raynal cfcc706c90 UPSTREAM: mtd: move NAND files into a raw/ subdirectory
NAND flavors, like serial and parallel, have a lot in common and would
benefit to share code. Let's move raw (parallel) NAND specific code in a
raw/ subdirectory, to ease the addition of a core file in nand/ and the
introduction of a spi/ subdirectory specific to SPI NANDs.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Change-Id: Ibb56f85620c4798fb579be3e4e30438963b7c48b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a430fa06a4ac50e785fdbfb7f43c3cb14b35619c)
2019-07-05 19:33:44 +08:00
Ezequiel Garcia c398bb76a3 UPSTREAM: nand: zynq: Cleanup initialization
CONFIG_NAND_ZYNQ selects CONFIG_SYS_NAND_SELF_INIT, so the
driver doesn't have to play any ifdef game.

Also, we can mark zynq_nand_init() as static and get rid
of the mach-specific nand.h header.

This is really a revert of:
"mtd: zynq: nand: Move board_nand_init() function to board.c"
(sha1: 310995d9f91ae56082b49be06fe8c3d01424f8f6)

Change-Id: I3d435d645c911c88bdf1d25600896141cd37d54e
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 41b7d7f241221ab9f0888f47f31226cfa74a971a)
2019-07-05 19:33:37 +08:00