Commit Graph

50714 Commits

Author SHA1 Message Date
YouMin Chen c2d71f78b8 rockchip: rv1126: enable TPL and select TPL_TINY_FRAMEWORK
Change-Id: I98b92a45f37653b93039ed63d955b12c8c5c94b0
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-08 10:30:05 +08:00
YouMin Chen 974a33f475 rockchip: rv1126: add tpl build support
Change-Id: I38badd98916d1ca03a1f0de6b293108063fe9bb6
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 19:01:11 +08:00
YouMin Chen f520bb22d7 drivers: ram: rockchip: add rv1126 sdram init code
Change-Id: I0c7ce7f274c396d077a4ae2fe29e382a8e295274
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 16:04:28 +08:00
YouMin Chen 78efceb66a rockchip: ram: add dram_spec_timing.h
Change-Id: I4691d46584b78ed47390ea39a90e449e4c9d0bed
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:35 +08:00
YouMin Chen 9994e22090 arm: rockchip: add CONFIG_ROCKCHIP_UART_MUX_SEL config
CONFIG_ROCKCHIP_UART_MUX_SEL is used for selecting uart multiplexer
in board_debug_uart_init.

Change-Id: I75fb8eab76e4db8cd171d8d6c4462abe52ed168e
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:34 +08:00
YouMin Chen 9ae0e26c7f rockchip: rv1126: configure UART iomux in board_debug_uart_init
Change-Id: I8820d87938209a83d493d16a0244874c75763c34
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:34 +08:00
YouMin Chen 8ab3f2621b rockchip: rv1126: not need syscon_rv1126.c when build TPL_TINY_FRAMEWORK
Change-Id: I5396b568129e2decfe64ad6c589f134034ffd4c4
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:34 +08:00
YouMin Chen 9b31f80a47 driver: ram: rockchip: add sdram_head_info_v2
Change-Id: I5715dbfb296fbc684cbd0f22270d3d3bc922bab1
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:34 +08:00
YouMin Chen 9442a4b3bb driver: ram: rockchip: update the driver of sdram_pctl_px30
Change-Id: I586065b41a22bbee266fa234e6513ef1dac5b37b
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:34 +08:00
YouMin Chen 0e03287145 rockchip: rv1126: add the struct of rv1126_pmugrf
Change-Id: Idb6610023e52e3aa640b665f5a08ff142a660c6c
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-05 15:11:34 +08:00
Joseph Chen 99ca0554fa common: image-fdt: ignore sysmem alloc for reseved memory at zero address
Kernel will alloc reserved memory dynamically for the node.

This patch avoids the sysmem warning dump.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I9b3a397c022450c152d479a60877551ee803ef91
2020-06-05 14:36:13 +08:00
Simon Xue 3cafcfcd6f misc: rockchip_decompress: fix param size
Change-Id: Ia193a6035faff4bab66262cab2e97a3c6b94e45a
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-06-05 11:30:07 +08:00
Shunqing Chen 913fb045d4 fuel gauge: rk817/rk809: fix the issue of dsoc cannot reach 100
Change-Id: I8b5c995509df71f23fdf73381ac0e55de727b5c2
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2020-06-05 10:54:52 +08:00
Wyon Bi cea9b5499b video/drm: dsi: Fix device name for rk3288 dsi1
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Idcd5fb9331a9f038137197d4a53a07dd7c133f3b
2020-06-05 10:46:49 +08:00
Andy Yan 66338042e0 configs: rv1126: Enable rgb/mcu display
Enable VOP and RGB interface on rv1126.

Change-Id: I44b61d6fc5338c8a78a0178af339cadb2227b297
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-06-05 10:40:04 +08:00
Andy Yan c33e1feac9 drm/rockchip: vop: Enable gate bit
Vop WIN with multi-region support(win2 of rv1126)
should enable the bit.

Change-Id: I3e2c4165e0d2c597ab839829f9cbed6a1e37c59a
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-06-05 10:38:15 +08:00
Andy Yan 406bb09a23 drm/rockchip: rgb: Add support for rv1126
Add support for RGB/MCU interface on rv1126.

Change-Id: I9b085f80e36fdadf6dcb46c3be034b65e645ddd4
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-06-05 10:38:15 +08:00
Andy Yan a144d23d24 drm/rockchip: vop: Add support for rv1126
Change-Id: I762158891605c1a87fd7d3a7c685052ab9125b31
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-06-05 10:38:15 +08:00
Andy Yan 081dec1b2b drm/rockchip: Fix compile error when I2C_EDID disabled
Change-Id: Ibb549312d9ee2468765e61ccf5c77742bd9f5d5d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-06-05 10:38:15 +08:00
Jon Lin 6193938767 mtd: spinand: Assign initial value 0 for bad block marker
This "= { }" smart initial methord is unreliable.

Change-Id: I64860e8d056f44e99461a4fb68bc9b91c7f95732
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-05 10:18:17 +08:00
Simon Xue 327380da2b misc: rockchip_decompress: add limit decompressed buffer size
In order to prevent physical memory from being written oversize,
limit the decompressed buffer size, user can assign a size to
decompress, the reserved destination buffer size is a choice

Change-Id: I8723c5ec8d58ec1d443c5607987941cf67cf1a01
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-06-05 09:14:02 +08:00
Jason Zhu a6f23aea12 common: spl: define maximum decompressible size to prevent memory overrun
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ib0be02bc85cb16ccdd832abf9a56260b2f2e500d
2020-06-05 09:14:02 +08:00
Jon Lin 6c62cd54f5 configs: rv1126: increase the space of heap for SPL SPI Nand bbt
Change-Id: If32f76b24c0deb4440ed47441f5627672c08fc27
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-04 09:08:45 +08:00
Jon Lin fd817f1d8b mtd: nand: fix error in BBT bit operation
Change-Id: I51aab1342d8ded7ac6c19612d27abb8799b85850
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-04 09:08:45 +08:00
Jon Lin 29f0ea3bb6 mtd: nand: spi: select MTD_NAND_BBT_USING_FLASH
Change-Id: I41a287ab79886982a5f12815afce0641fa641b45
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-04 09:08:45 +08:00
Jon Lin 53bfae0392 mtd: nand: add BBT using flash management strategy
Change-Id: Ib71dfbcf68283d1118742ab29079cab395ff99ca
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-04 09:08:45 +08:00
Jon Lin b8af31a74b mtd: nand: spi: enable using BBT in flash
Change-Id: I4f793a10ae3f329c6be412785a01d0f117cd9b0b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-04 09:08:45 +08:00
Jon Lin d55257eea0 mtd: nand: Support using BBT in flash
Change-Id: I67c8859a711156d1264f783ec2749139999228f3
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-04 09:08:45 +08:00
Jason Zhu 747423edb6 rockchip: spl: bring up to kernel when CONFIG_ROCKCHIP_BOOT_MODE_REG is 0
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3f576fa0527a42ebede6ec252586cf681974fa97
2020-06-03 20:04:17 +08:00
Joseph Chen 371e5b63ad rv1126: common.h: set fit as 1st boot image type
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id36149c79eb0b08fbcb92bd2d55bb808a42bf9dd
2020-06-03 14:29:02 +08:00
Joseph Chen 25047d3f40 rockchip: board: update cli message format
"Cmd interface" is easy to understand.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0c74ad595f6c24abaf1b98bf7a09dc5060a4755d
2020-06-03 14:29:02 +08:00
Jon Lin 360a291130 mtd: mtd_blk: Logical offset should not mix with map address
1.Logical offset should not mix with map address
2.Format with nand_read_skip_bad

Change-Id: I0e5adec374ce4de437e4ce7368caec4c7c07e83b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-03 11:14:37 +08:00
Simon Glass 301f8dd17d UPSTREAM: mtd: Rename free() to rfree()
This function name conflicts with our desire to #define free() to
something else on sandbox. Since it deals with resources, rename it to
rfree().

Change-Id: I2718843dd4646b7450c36e84cc16e6440c718959
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 8d38a8459b0de45f5ff41f3e11c278a5cf395fd0)
2020-06-03 10:48:53 +08:00
William Zhang b16d7c2247 UPSTREAM: drivers: nand: brcmnand: fix nand_chip ecc layout structure
The current brcmnand driver is based on 4.18 linux kernel which uses
mtd_set_ooblayout to set ecc layout. But nand base code in u-boot is from
old kernel which does not use this new API and expect nand_chip.ecc.layout
structure to be set. This cause nand_scan_tail function running into a bug
check if the device has a different oob size than the default ones.

This patch ports the brcmstb_choose_ecc_layout function from kernel 4.6.7
that supports the ecc layout struture and replaces the mtd_set_ooblayout
method

Change-Id: I31aec45275decfb03af2829c744c3dda0e261d12
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit e365de90517ba4686d7a88417b1a729f5891d376)
2020-06-03 10:48:53 +08:00
Joseph Chen 5cc4c624ec dm: uclass: move new uclass id to the end
This patch handles the issue in SPL:

	U-Boot SPL board initspl_early_init()
	   - found match at 'rv1126_syscon'
	   - found match at 'rv1126_syscon'
	   - found match at 'syscon'
	   - found match at 'rockchip_rv1126_pmucru'
	   - found match at 'rockchip_rv1126_cru'
	   - found match at 'ns16550_serial'
	   - found match at 'rockchip_rk3288_dw_mshc'
	   - found match at 'rk_nandc_v6'
	   - found match at 'rockchip_sfc'
	   - found match at 'spi_nand'
	   - found match at 'spi_flash_std'
	   - found match at 'rockchip_crypto_v2'
	   - found match at 'rockchip_secure_otp_v2'
	Cannot find uclass for id 36: please add the UCLASS_DRIVER() declaration for this UCLASS_... id
	Missing uclass for driver rockchip_secure_otp_v2
	secure_otp@0xff5d0000: ret=-96
	dm_scan_fdt() failed: -96
	dm_extended_scan_dt() failed: -96
	dm_init_and_scan() returned error -96
	spl_early_init() failed: -96
	......

The root cause is drivers/misc/rockchip-secure-otp-v2.S is pre-compile
but not compile every time, it occupies the UCLASS_MISC id as 36.

There are the same situation for other otp drivers, so let's move it to
the end.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I58a2bec703c2af743d209192fefda6ff6167b01c
2020-06-03 10:24:44 +08:00
Joseph Chen e3d9a19ada Revert "misc: otp: re-compile the code due to the UCLASS_MISC is changed"
This reverts commit 551ae2b922.

Change-Id: Ic2723614182b8c4cf2a5433f97ce17bceac4f8dc
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-06-03 10:24:41 +08:00
Jason Zhu 551ae2b922 misc: otp: re-compile the code due to the UCLASS_MISC is changed
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Icec8cf342f8cb5f0cf5bdae5644c2814a76c5860
2020-06-03 10:11:36 +08:00
Jon Lin bfb4edbc07 mtd: spinand: Propagate ECC information to the MTD structure
This is done by default in the raw NAND core (nand_base.c) but was
missing in the SPI-NAND core. Without these two lines the ecc_strength
and ecc_step_size values are not exported to the user through sysfs.

Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

Change-Id: I37f29616e1522d9ce9e9d7ec18a473c73e1d1551
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-03 10:08:02 +08:00
Jon Lin 0ebe729199 mtd: spinand: Do not erase the block before writing a bad block marker
Currently when marking a block, we use spinand_erase_op() to erase
the block before writing the marker to the OOB area. Doing so without
waiting for the operation to finish can lead to the marking failing
silently and no bad block marker being written to the flash.

In fact we don't need to do an erase at all before writing the BBM.
The ECC is disabled for raw accesses to the OOB data and we don't
need to work around any issues with chips reporting ECC errors as it
is known to be the case for raw NAND.

Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200218100432.32433-4-frieder.schrempf@kontron.de

Change-Id: Ieaa72162810105bf5d62caf2efc16a1c2ef89d6d
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-03 10:08:02 +08:00
Jon Lin 35a88e77a0 mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB
When writing the bad block marker to the OOB area the access mode
should be set to MTD_OPS_RAW as it is done for reading the marker.
Currently this only works because req.mode is initialized to
MTD_OPS_PLACE_OOB (0) and spinand_write_to_cache_op() checks for
req.mode != MTD_OPS_AUTO_OOB.

Fix this by explicitly setting req.mode to MTD_OPS_RAW.

Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200218100432.32433-3-frieder.schrempf@kontron.de

Change-Id: Id415efc0cd8d61d97d98e0340729f8bc60fc28cf
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-03 10:08:02 +08:00
Jon Lin d537a52df3 mtd: spinand: Stop using spinand->oobbuf for buffering bad block markers
For reading and writing the bad block markers, spinand->oobbuf is
currently used as a buffer for the marker bytes. During the
underlying read and write operations to actually get/set the content
of the OOB area, the content of spinand->oobbuf is reused and changed
by accessing it through spinand->oobbuf and/or spinand->databuf.

This is a flaw in the original design of the SPI NAND core and at the
latest from 13c15e07eedf ("mtd: spinand: Handle the case where
PROGRAM LOAD does not reset the cache") on, it results in not having
the bad block marker written at all, as the spinand->oobbuf is
cleared to 0xff after setting the marker bytes to zero.

To fix it, we now just store the two bytes for the marker on the
stack and let the read/write operations copy it from/to the page
buffer later.

Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: stable@vger.kernel.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200218100432.32433-2-frieder.schrempf@kontron.de

Change-Id: I5a47981f004c60d753da382ef6d683a7da1e436b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-03 10:08:02 +08:00
Robert Marko e0242caf53 UPSTREAM: mtd: spi-nand: Import Toshiba SPI-NAND support
Linux has good support for Toshiba SPI-NAND, so lets import it.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Tested-by: Luka Kovacic <luka.kovacic@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: I70a328bf28c7e8740d818958faf749016dd9ca77
(cherry picked from commit 89127104848cea38bac5d40e3d6973fc203e2df6)
2020-06-03 10:08:02 +08:00
Finley Xiao d0999afb2e clk: rockchip: rk3308: add support to set and get sfc clock
Change-Id: I322471da6e50b0bad328dde015d0d7d0466cc3a9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-06-03 09:57:07 +08:00
Finley Xiao d47b686da8 clk: rockchip: rv1126: Add support to get dpll rate
Change-Id: Icd7c40235d4627befc216812bfdcb288790e63e3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-06-03 09:56:37 +08:00
David Wu 664ab5ca74 configs: rv1126: Enable GMAC
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I9cce5c1f8e5488365c6e1c14d27e528fa0e952e8
2020-06-02 17:50:16 +08:00
David Wu 225d510420 configs: rv1126_common: reserve 1M nocache memory
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ibc82c3dd0a19c2ae5a7997fda077f8cfea830abf
2020-06-02 17:50:16 +08:00
David Wu 63a2faadfe net: dwc_eth_qos: Fix compile error for gpio
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ife092cc2aca2c359fc465058e44ca645afbc8114
2020-06-02 17:49:16 +08:00
David Wu dcfb333ad8 net: gmac_rockchip: Add RV1126 gmac support
This Soc is different from the previous Socs, need to
define eqos_config, and follow the dwc_eth_qos driver
process.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I4a1c1605dd46ed31fb7ca15c7c26572739f636ec
2020-06-02 16:10:47 +08:00
David Wu 65dd574d8d net: dwc_eth_qos: Add EQOS_MAC_MDIO_ADDRESS_CR_100_150 for Rockchip
The Rockchip CSR clock range is from 100M to 150M, add
EQOS_MAC_MDIO_ADDRESS_CR_100_150.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ib60f306cb9e8abec9557e92a6d04d76a7071b9ea
2020-06-02 16:10:47 +08:00
David Wu fc99c7ab03 net: dwc_eth_qos: Add eqos_rockchip_ops
The eqos_rockchip_ops is simillar to eqos_stm32_ops, and
export the eqos_rockchip_ops to use.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I214b0b2fbe04a139de911435c4abf224264f5495
2020-06-02 16:10:47 +08:00