Commit Graph

13700 Commits

Author SHA1 Message Date
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
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
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
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 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 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 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
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
Jianqun Xu 72832ab675 pinctrl: rockchip: add rk3308 support
Change-Id: Id2a34aa7984ee00da2bf78e55f38cf268a2ce8f3
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-08-31 16:03:47 +08:00
Jianqun Xu e20d80255b pinctrl: rockchip: add rk1808 support
Change-Id: Iac6b15651e19b7eaf6dd18339f6de6d65a3dd1ff
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-08-31 16:03:47 +08:00
Jianqun Xu 92b1d31aeb pinctrl: rockchip: add rv1126 support
Keep rv1126 support in pinctrl-rockchip.c with legency

Change-Id: I50791c3c30e6efa58d324eaef7bfc4d4aa9e440c
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-08-31 16:03:47 +08:00
Jianqun Xu b8d3e6ff7d pinctrl: rockchip: set mux route in core driver
Change-Id: Iccc880b150b1cea3cef9d2a84d14a0e82ce5c5cf
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-08-31 16:03:47 +08:00
Jianqun Xu 3624458ab0 pinctrl: rockchip: put nr_pins to pinctrl info structure
Put the nr_pins information to pinctrl info structure, instead of
calculating in probe.

Change-Id: I3af11d99ef4b0e30c306ebd99a2233cd0c6b97b5
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-08-31 16:03:47 +08:00
David Wu 5635c457ec UPSTREAM: pinctrl: rockchip: Also move common set_schmitter func into per Soc file
Only some Soc need Schmitter feature, so move the
implementation into their own files.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 79d16e45409f928c952b6935d695cd08f9db76b3)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: I41ede5737258292e27492e391cf9a981210e4a71
2020-08-31 16:03:47 +08:00
David Wu b8a0fe4c87 UPSTREAM: pinctrl: rockchip: Clean the unused type and label
As the mux/pull/drive feature implement at own file,
the type and label are not necessary.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 623aca88308b4f917f0465cd5dd1514ee781bee8)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: Idcbb3fdf4311567c599686d52926a057d1101b6b
2020-08-31 16:03:47 +08:00
David Wu cfe427fe38 UPSTREAM: pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pull
RK3288 pmu_gpio0 pull setting have no higher 16 writing corresponding
bits, need to read before write the register.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 69a38f81bb55893a8555c899319305c539226a0a)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: Ie8f94cf1a0b33a24bb32d3de8231b7f2db51ddff
2020-08-31 16:03:47 +08:00
David Wu 05a5688e53 UPSTREAM: pinctrl: rockchip: Split the common set_pull() func into per Soc
As the common set_mux func(), implement the feature at the own file
for each Soc.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 743a77373bfa22ca099b30d4ac88d95a2f98d1b6)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: Ib0de627d3aee1759965d64852bcd287785538dc0
2020-08-31 16:03:47 +08:00
David Wu 79899a49f9 UPSTREAM: pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' drive strength
RK3288 pmu_gpio0 drive strength setting have no higher 16 writing
corresponding bits, need to read before write the register.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 956362c84b0422ea99da947feca2878193c26ade)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: I409107119d557b953c904b53e657685907879a3a
2020-08-31 16:03:47 +08:00
David Wu 681441e641 UPSTREAM: pinctrl: rockchip: Split the common set_drive() func into per Soc
As the common set_mux func(), implement the feature at the own file
for each Soc.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 625ab11fdae3daf346647aaba59abee804e34589)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: I07caae48cd4699aa7bbddf2edf7de6863c0a58c2
2020-08-31 16:03:47 +08:00
David Wu aa570f0140 UPSTREAM: pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' iomux
RK3288 pmu_gpio0 iomux setting have no higher 16 writing corresponding
bits, need to read before write the register.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit cd8f00ce08102d2dbb350c76bbb53f7b0f804b7d)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: I7aaaf9642ee7bed6a2e9f6538a053bd6e1810dd7
2020-08-31 16:03:47 +08:00
David Wu 5f55bbd7d6 UPSTREAM: pinctrl: rockchip: Split the common set_mux() into per Soc
Such as rk3288's pins of pmu_gpio0 are a special feature, which have no
higher 16 writing corresponding bits, use common set_mux() func would
introduce more code, so implement their set_mux() in each Soc's own
file to reduce the size of code.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 54e75702c48a9757e82cbe71176c0b5ddcf6a092)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: Ifdfce706e9b1cbe94300d2bed91182033f23f301
2020-08-31 16:03:47 +08:00
David Wu 16f7081913 UPSTREAM: pinctrl: rockchip: Remove redundant spaces
Some files have the redundant spaces, remove them.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 8541beb86daf3ce7e4be9ca67859aab3dd0daefb)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: I9f621c3714260165bab0111e486a1d60ecf33c11
2020-08-31 16:03:47 +08:00
David Wu 8fa6c06288 UPSTREAM: pinctrl: rockchip: Add pull-pin-default param and remove unused param
Some Socs use the pull-pin-default config param, need to add it.
And input-enable/disable config params are not necessary, remove it.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 0a5cc3cac96dcbb1f31c9c2a3954dad702a543c1)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: Id7522a4fdd21d42d46c42e6f66b93985064fd9ab
2020-08-31 16:03:47 +08:00
David Wu 49b3d5d5ff UPSTREAM: pinctrl: rockchip: Add 32bit writing function for rk3288 gpio0 pinctrl
There are no higher 16 writing corresponding bits for pmu_gpio0's
iomux/drive/pull at rk3288, need to read the value from register
firstly. Add the flag to distinguish it from normal registers.

Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry picked from commit 502980914b2d6f9ee85a823aa3ef9ead76c0b7f2)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Change-Id: Ibf0ba2d879904a06a2fb6722f5886a39c010a7f7
2020-08-31 16:03:47 +08:00
David Wu f2e4e921f0 UPSTREAM: pinctrl: rockchip: Add common rockchip pinctrl driver
Use this driver to fit all Rockchip SOCs and to support
the desired pinctrl configuration via DTS.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
(cherry picked from commit e7ae4cf27a6d5837cb5e868712cdaa61d3ceb5e0)

1. fix with error handle with pin with IOMUX_UNROUTED.
2. add get pin count operation
3. modify drivers/pinctrl/rockchip/Makefile

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I1a398c865eb9e9afc38c6aca5431b6546e7260a6
2020-08-31 16:03:47 +08:00
Jianqun Xu 9f32e0d2ec gpio: rockchip: handle error code from pinctrl
Change-Id: Iac48b2302da562d0c204884d9eb3f763c2071c9f
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-08-31 16:03:47 +08:00
YouMin Chen 8e4f57b962 drivers: ram: rv1126: modify the dram side DS and ODT for fsp_param
Change-Id: I1080edf76073f9387e7211b8333bf086f26a09d2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-08-31 15:33:52 +08:00
YouMin Chen 38b16f0834 drivers: ram: rv1126: fix the timing about noc and controller
1. set the noc ddrtimingc0.b.wrtomwr for LPDDR4
2. set the noc ddrmode.b.mwrsize for LPDDR4
3. update the noc ddrmode.b.burstsize
4. update the controller timing for 328MHz
5. set ddr4timing to 0 except LPDDR4
6. calculate ddr4timing using *_L timing for DDR4

Change-Id: I9f8fae51a05f8547d64da262d4c69fd4edec79fb
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-08-31 15:33:52 +08:00
Tang Yun ping a5033de0ca rv1126: ddr: fix bug of ca driver strength setup
lpddr4 reg0x107/108 is for clk driver strength.
for other type of dram this register is for A6/A8 driver strength.

Change-Id: Ia0acbe03574ad5a1a4ecdaa2c0f53cb9a45c034b
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-31 15:33:52 +08:00
Jon Lin 14ce3c6d83 mtd: spinand: Support GD5F1GQ5UExxG
Change-Id: I5f494ce09eed8c28bd2cb10bac5ec7d9113bac50
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-27 17:42:11 +08:00
Joseph Chen 446ef41c12 clk: rockchip: rv1126: always support decompress clock get/set
The SPL without thunder-boot or U-Boot needs it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie2d8b59e35fbc2056cfbc910dae94419afcbfc09
2020-08-21 17:49:13 +08:00
Simon Xue 5db33a7101 misc: rockchip_decompress: set default dclk to 400MHz
Change-Id: Ie64c1d7fd25ae2e570a06141c9942faeaadcc09c
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-08-21 14:47:29 +08:00
Elaine Zhang 7c7fff393f clk: rockchip: rk3288: support get pll config by table
add some special pll configs for better clock jitter.

Change-Id: I93f8cab2a995fc584322070e25bbba6067c80dbb
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-08-20 15:09:48 +08:00
Joseph Chen 8353750512 misc: decompress: wait complete before stop for sync
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia70003e9fe2f27b6834324edabae095b6b9c21b7
2020-08-20 15:04:37 +08:00
Joseph Chen 9f59c154c4 misc: rockchip decompress: support invalidate dcache
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I668fc041083c1547357d0556cb483b6ab2f58b5a
2020-08-20 15:04:37 +08:00
Joseph Chen e1e885d399 misc: decompress: correct size_src and size_dst usage
We misunderstood the size_src as decompressed image size.

Without this patch, the decompress can work normally, but
it wastes the time to flush data cache. Let's correct it
for thunder boot version to save boot time.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I93014ccec7814faec5abbe96b383bc1170cdb0e2
2020-08-20 15:04:37 +08:00
Jon Lin a7ff7f48d1 mtd: spi-nand: Support TC58CVG0S3HRAIJ and TC58CVG1S3HRAIJ
Change-Id: I11d36cc2d17b4d8ae59d405b0177ec34f74bb704
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-20 14:48:36 +08:00
Nickey Yang a3c5f2d549 video/drm: inno_mipi_phy: adjust timings for rv1126
According to the spec, phy version of rv1126 is the
same as rk1808, LPX parameters need to be specified.

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I75cf9db0b3763237727f3ebf3576929a3cb9cea8
2020-08-20 10:06:29 +08:00
Sandy Huang eee28ceac9 drm/rockchip: clearly to point out error log
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I9848cdaadcb9aa6b9ccb40f7179a000a1bc6cc00
2020-08-13 09:31:07 +08:00
Wyon Bi f8436d0541 video/drm: Add dsi driver for rk618
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Id8a7044352835fc4a6f733c6cf7a3d318f7f8c56
2020-08-13 09:30:51 +08:00
Wyon Bi ee93770137 video/drm: Add mode_set callback for bridge
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Id08455aacc850074b1bdb67776a4182598ccdb4f
2020-08-13 09:30:51 +08:00
Elaine Zhang 403d8d4c21 clk: rockchip: rk322x: add support to set and get spi clock
Change-Id: I361aa06aa795d2c041d2bdad9ee5ff6982d554fc
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-08-13 09:29:49 +08:00
Elaine Zhang 7f619f26d7 clk: rockchip: rk3128: add support to set and get spi clock
Change-Id: I4ac874ba0542474baf18491f986f401c831a5ad4
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-08-13 09:29:49 +08:00
Elaine Zhang df77e7a38c clk: rockchip: rk3036: add support to set and get spi clock
Change-Id: I24db5f250fa89845b62005950d520600434adb99
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-08-13 09:29:49 +08:00
Elaine Zhang db5be31cab clk: rockchip: rv1108: add support to set and get spi clock
Change-Id: I96891a4adb53bbb84e27cc0ac5eddf3c613c1baa
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-08-13 09:29:49 +08:00
Jon Lin 4243946213 mtd: mtd_blk: Implement mtd_dwrite none-alinged write
Change-Id: I605ee52083ef5d9d2863f347390acc635eabd2bc
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-13 09:29:03 +08:00
Jason Zhu 3fb7bf029a mtd: mtd_blk: implement mtd_dread_prepare()
Prepare to read data, then data is transmitted in background.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Iab560f7f903549a0b6c27f7e8e2ac984ae2ac75c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-13 09:29:03 +08:00
Jason Zhu 7863dac107 dm: mmc: remove mmc_bread_prepare in mmc_blk_ops
Merge it to mmc_bread() with using op_flag.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I3f63ebf66c43184a134c49a39a62feb2d5ae9821
2020-08-11 09:11:21 +08:00
Jon Lin 7ddc1c3556 spi: rockchip_sfc: Support dma xfer prepare
Change-Id: I9c3285daf22775fa3ad72e41abcd205c4caaaaa4
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-11 09:01:19 +08:00
Jon Lin f5a32af5a3 spi: spi-mem: Support dma transfer skip waiting idle
Change-Id: Iabe9260f4c6c7edcb885f9f9a6aa55650fdfc932
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-11 09:01:19 +08:00
Jon Lin fa413375b7 spi: rockchip_sfc: Support transfer large size data
Change-Id: I7c2da2f01ef16ad11ca33cfac25c34793d22d698
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-08-11 09:01:19 +08:00
Jianqun Xu 2a74799b42 video: drm: Add bpc to connector_state structure
Change-Id: Ib181191ceeae8a37f32d0ed31d4cd45efdefcd75
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-08-06 17:02:23 +08:00
Elaine Zhang 514da3912b clk: rockchip: rk3328: fix up the bus and peri aclk div overflow
Change-Id: I3983af87bec9bd79280914c803f0af3d5e3ffbb0
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-08-05 15:52:38 +08:00
Joseph Chen 9ed86f1004 io-domain: rockchip: fix data abort
Stack:
       [< 0041e1ae >]  dev_get_driver_ops+0x4/0x8
       [< 0043fdb5 >]  regulator_get_value+0x9/0x1c
       [< 0043f42b >]  rockchip_iodomain_probe+0x9b/0x114
       [< 0041e07f >]  device_probe+0x14b/0x184
       [< 0041e9ff >]  uclass_get_device_tail+0xd/0x16
       [< 0041eb73 >]  uclass_first_device+0x1b/0x1e
       [< 0043f34f >]  io_domain_init+0x17/0x34
       [< 0040231f >]  board_init+0x7f/0xa0
       [< 0044fe6d >]  initcall_run_list+0x35/0x50
       [< 0040f839 >]  board_init_r+0x15/0x1c
       [< 0040f825 >]  board_init_r+0x1/0x1c

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6864771eb1ffa4ae2ef92e712a503e8048774435
2020-08-05 11:04:50 +08:00
Tang Yun ping ee5f0829e9 rv1126: ddr: add extended temperature support
Enable it by set CONFIG_ROCKCHIP_DRAM_EXTENDED_TEMP_SUPPORT to y.

Change-Id: I54db1d1b33fc9e063c05bc4aca85589b495a4db9
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-04 11:38:08 +08:00
Vasily Khoruzhick 133495af9d UPSTREAM: rockchip: i2c: don't sent stop bit after each message
That's not correct and it breaks SMBUS-style reads and and writes for
some chips (e.g. SYR82X/SYR83X).

Stop bit should be sent only after the last message.

Change-Id: I5ded4a43ed726b7cffa35d020ef763471bd01b41
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit c9fca5ec8849b8fa16b16cece091645e7d3aa02b)
2020-08-03 10:25:38 +08:00
Tang Yun ping f4f57f8ed1 rv1126: ddr: fix modify ca de-skew bug
Change-Id: Ia3fffce1e062bee68d1b85a9b55858c53626942b
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-03 10:22:37 +08:00
Tang Yun ping 95fd4f9d53 rv1126: ddr: rm phy soft reset code
Change-Id: I60c9288da24304125de2951f45c28d5be33c5ce8
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-03 10:22:37 +08:00
Tang Yun ping 8ecb6ff226 rv1126: ddr: update driver strength and odt strength config
Change-Id: Id78273d75ef13cfc6f1f335e475f16862bfaf938
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-03 10:22:37 +08:00
Tang Yun ping 70fee8b333 rv1126: ddr: update drv odt table
Change-Id: Ic20957d02c36fe2d167c1a63b5e016535a181baf
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-03 10:22:37 +08:00
Tang Yun ping d5bb9a92b1 rv1126: ddr: wrlvl support dqs longger than clk
Change-Id: I3c94787e1ffdc9f43c591b05002f0b70ffedf1ec
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-03 10:22:37 +08:00
Tang Yun ping df8389e3dc rv1126: ddr: fix some coding bug
Change-Id: Ic70018f2afeacb167403937a54c7b8cb62605bfe
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-08-03 10:22:37 +08:00
Jon Lin 299b0bf8ca mtd: spi-nor-ids: mx25l12805d add SPI_NOR_QUAD_READ support
Change-Id: I90f1513ca7698650b87985bd38c8b9a5bb3027ca
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-31 11:57:16 +08:00
Wyon Bi 90a6d58f15 video/drm: rk618: change clkin rate to 11289600
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Ic98a1eb1265ded4b6f237d93cd47f13bcb56d7f9
2020-07-30 14:59:32 +08:00
Wyon Bi a9cbfff9cb clk/rockchip: px30: support any frequency for i2s1_mclk
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Ica0ca19d1a4fafbaf62e5c789ae3223ff9d86632
2020-07-30 14:59:32 +08:00
Wyon Bi 9936e5dd9c clk: rockchip: px30: fix n/m for sclk_i2s1
High 16-bit for numerator, Low 16-bit for denominator.

Fixes: 95f2641240 ("clk: rockchip: px30: add support clock for SCLK_I2S1")
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Iafbb03ceaa7ccc178ee2a74be2fab6c2b7268ced
2020-07-30 14:59:32 +08:00
Wyon Bi 5cfabef40a video/drm: display: Downgrade "available display" messages to debug
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Ie12ae2a2f412706eb1dc566cf3ce2226de58bfac
2020-07-30 14:59:32 +08:00
Wyon Bi ac6274b35d drm/rockchip: loader kernel bmp for rk fb driver
Always try to load kernel logo bmp.

Fixes: 5eb61944c8 ("drm/rockchip: loader kernel bmp for rk fb driver")
Change-Id: I2b85562ed04f2c6c9cc92aa994a76211d55a3fe1
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-07-30 14:59:24 +08:00
Joseph Chen b367c66bb3 misc: rockchip decompress: add dm resets support
Using dm reset API to reset decompress module.

There seems to be some unknown cause to make the module
in abnormal state, which output the wrong decompress
data. Let's reset it before starting decompress.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ic4113eec0701f83059453fa263810d31caa406eb
2020-07-27 14:44:28 +08:00
Joseph Chen 8fce363f27 dm: reset: add reset support for SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8210b7f656b99bf7cbf4a6708696ebbf91aa7685
2020-07-27 11:22:37 +08:00
Joseph Chen 8b225c61c2 misc: rockchip_decompress: add dcache flush
If the decompress module doesn't access the data through dcache,
it should add flush behavior to promise getting the real data
from dram. Otherwise it may decompress the wrong data but not
report any failure.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I6570ca7dc3a60c4b5bb9fcf3ae9f1025e2c658ea
2020-07-24 18:02:27 +08:00
Joseph Chen adf6937910 misc: rockchip decompress: remove IRQ support
SPL don't support IRQ and U-Boot proper is not deeply care
about boot time. There is not a mechanism to support IRQ
mode now.

In addition, the decompress irq is design to catch the exceptions
but not to decompress images continuously.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I842bce530aa180d5b0a30c1d2038575e464241b8
2020-07-24 18:02:27 +08:00
Joseph Chen 656bdb598a misc: decompress: add/update API
- Support get gunzip data size from src data;
- Support sync decompress for this round;
- Support return the gunzip data size of compressed image.
- Add misc_decompress_cleanup() for waiting last decompress done.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie84b2a6174d04592110333d66667da66f98f07f6
2020-07-24 18:02:27 +08:00
Joseph Chen 01b57c0600 misc: decompress: add Kconfig option
It's used for other generic code.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I925c89d77165d781f9eff3c609eb06e2a1895a3e
2020-07-24 18:02:27 +08:00
Joseph Chen a91da5984b input: rk8xx: always enable key interrupt
We use it to exit charge animation while system is in runtime.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia6bc3f7a20310f73e060418f0a0ab01ef8745b11
2020-07-24 11:00:18 +08:00
Lin Jinhan 864e581c22 crypto: rockchip: add ROCKCHIP_RSA and SPL_ROCKCHIP_RSA config
use ROCKCHIP_RSA to enable RSA in uboot.
use SPL_ROCKCHIP_RSA to enable RSA in spl.

Change-Id: I1c3ae3754e9dbdfe39c81b554387fe78451a9fa2
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-07-23 10:04:14 +08:00
Jason Zhu 04a8326ac7 mtd_blk: correct the ubi part info when enable a/b
The default ubi part info must be corrected while the part info will
be changed when enable a/b.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I84db2e284f732f62014d3d14d99217fb707b85c0
2020-07-22 18:05:32 +08:00
Joseph Chen e0d8614639 dm: crypto: remove TPL crypto kconfig option
They are impossible to be used in TPL.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia42330ce3f6621020ae492675de320aa75f33da4
2020-07-21 16:14:48 +08:00
YouMin Chen 112c8ab573 drivers: ram: rv1126: modify ddr support frequency
Modify ddr support frequency to match PLL setting.

Change-Id: I1d93b2178933ada04e178bd068a8fec4ef43a4de
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-07-16 19:51:04 +08:00
Wyon Bi 34d0c224c5 video/drm: support get panel timing from EDID
Change-Id: I301cc9927504d90452978abe788f1c97261ff319
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-07-16 19:38:08 +08:00
Jianqun Xu 2f6aff5865 pinctrl: rockchip: fix rk3288 nr_pins warning
Change-Id: I4631a88b5706cb8cdc190fb3432936c791e70bda
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-15 10:33:45 +08:00
Jon Lin 02ed3e1202 mtd: spinand: Remove useless write enable op
Change-Id: I5e4c953e1107c52bf4a40d397bd92617107b21f1
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-13 15:43:41 +08:00
Jon Lin fc656fc366 mtd: spinand: Support xtx devices
Support XT26G01A, XT26G02A, XT26G04A, XT26G01B, XT26G02B

Change-Id: I447d83e5c5da8f6ba8515aab77a8039fe9cb2cc4
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-10 15:58:11 +08:00
Jianqun Xu e21613fbf5 pinctrl: rockchip: fix rk3308 nr_pins to 160
Change-Id: Ib3d1d9149d222c8fe60bbfe20bdc9f1dadbeabe8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-09 20:37:05 +08:00
Lin Jinhan 086e8fa830 crypto: rockchip: crypto_v2: split the data into 32M chunks when update
fix timeout bug of crypto V2 computing large amounts of data all
at one time.

Change-Id: I6c4a3f8b0a40e95b0832244313d7e378e1e70615
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-07-08 17:27:34 +08:00
Joseph Chen 659e640a99 core: dump: add symbol for remained dm device
Symbol:
	"**" : pre-reloc node and the device is remained in dm tree.
	"* " : pre-reloc node but the device is already being removed from dm tree.

=> dm tree
 Class      Probed        Driver               Name

Change-Id: Ie242117d4d323ba24894dd99ab061d187230621d
----------------------------------------------------------
 root       [ + ]   root_driver                root_driver
 rsa_mod_ex [   ]   mod_exp_sw                 |-- mod_exp_sw
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm0 *
 clk        [   ]   fixed_rate_clock           |-- external-gmac-clockm1 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe000000 *
 syscon     [ + ]   rv1126_syscon              |-- syscon@fe020000 *
 ......
 mtd        [   ]   rk_nandc_v6                |-- nandc@ffc80000 **
 blk        [   ]   mtd_blk                    |   `-- nandc@ffc80000.blk
 spi        [   ]   rockchip_sfc               |-- sfc@ffc90000 *
 mtd        [   ]   spi_nand                   |   |-- flash@0 **
 blk        [   ]   mtd_blk                    |   |   `-- flash@0.blk
 spi_flash  [   ]   spi_flash_std              |   `-- flash@1 **
 blk        [   ]   mtd_blk                    |       `-- flash@1.blk
 ......

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5bf643b9a2b29a86ac7315462ad9f65f30e18442
2020-07-08 17:20:32 +08:00
Joseph Chen 8f5dfc4a5c core: device: use list_del_init() instead of list_del() to remove node
In order to check this node by list_del_init().

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I723821d8b9fc6d899fbd5c0b830b240486a48c73
2020-07-08 17:20:32 +08:00
Jianqun Xu 2e312f93c5 power: rockchip-io-domain: get regmap base from parent device
The io-domain/pmu-io-domain node always under grf/pmugrf, so get the
grf/pmugrf regmap base just from its parent device.

Change-Id: I9f7d950744b48c239a556b7fe685749cdd5f99f2
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-08 14:21:02 +08:00
Jianqun Xu 13c03cb6ca pinctrl: rockchip: Covert the struct rockchip_pin_ctrl to const type
The rockchip_pin_ctrl struct is BSS data, only memset oncetime, but the
driver maybe probed several times, the nr_pins member of struct won't
to start from 0. that will cause pinctrl driver error.

Change-Id: I3d081da8bb91573126c6ee5af345ed73c85bb7af
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-08 14:17:51 +08:00
Jason Zhu 31767fe77d misc: otp: support write rollback space several times
Naturally, otp is written by bytes and programed just one time.
Now the rollback space is written by bit and programed several times.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I964693c5067ffdedfc0990f038f6d013a49a41a8
2020-07-07 15:40:33 +08:00
Jon Lin ea437e2ce4 mtd: spinand: Fix the way to detect gigadevice id
Parts of esmt devices are the same MFR id, and it's
reasonable.

Change-Id: I245c66ebd734ebabe89d8a6792446b80b76dd0e3
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-07 14:44:25 +08:00
Jon Lin 52b0060178 mtd: spinand: Support esmt devices
Support F50L1G41LB

Change-Id: I094a093fd07b6b2f924a58cf45375e214df796ce
Signed-off-by: Carl <xjxia@grandstream.cn>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-07 14:44:25 +08:00
Nickey Yang efcb7be134 video/drm: dsi: add support for rv1126
also update GRF_REG_FIELD for support some chip
(like rv1126) GRF's register offset over 0x10000

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: Iedb281dae00f85375166915c39663e92d990b0d3
2020-07-07 10:17:25 +08:00
Nickey Yang 8f1f6d607b video/drm: inno_mipi_phy: Add support for rv1126
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I5f79ddbfebd2f31d7225f7f779d680c2b27ddc0f
2020-07-07 10:17:25 +08:00
Jon Lin c219aedb27 mtd: spinand: Support dosilicon devcies
Support DS35X1GA

Change-Id: Iadbda15075e54325bf5c2dffa28d560947cec627
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-07-06 19:52:24 +08:00
Algea Cao f097e41095 drm/rockchip: inno-hdmi: Support inno-hdmi
Change-Id: Ib1b98c83de53053858c2cef2d3175cc55f12bdad
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-07-06 19:40:40 +08:00
Algea Cao 00997ff116 edid: Move functions of sorting modes to edid.c
Not only does dw-hdmi use these functions, but others
need to use them, such as inno-hdmi.

Change-Id: I1ced6e30b7634511fecbbfb39c24ede78894dd1d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2020-07-06 19:40:40 +08:00
Joseph Chen 2833da14a1 pmic: rk8xx: fix compile error if CONFIG_IRQ is disabled
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I23a0da11618822be08f233cd0c75f550e8d8ca3a
2020-07-01 10:37:08 +08:00
Jon Lin 78cac1dffd mtd: nand: Remove bbt option property if scan fail
Change-Id: Ifb5b500b6ffee551aea5b6aecea629b3d0ea6207
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-29 09:18:21 +08:00
Wyon Bi f0f5bdc29d video/drm: inno_video_phy: Increase the timeout delay of PLL lock status to 100ms
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I60422087623c6c9f3a0219cb1a3e1c59ec523e73
2020-06-29 09:17:52 +08:00
Tang Yun ping 970fa5d876 drivers: ram: rv1126: optimizing dram type select code
Use CONFIG_ROCKCHIP_TPL_INIT_DRAM_TYPE to select dram type.
Use the same define with arch/arm/include/asm/arch-rockchip/sdram.h (0 for
DDR4, 2 for DDR2, 3 for DDR3, 5 for LPDDR2, 6 for LPDDR3, 7 for LPDDR4).

Change-Id: I982db49c1881f6975afd4ba48f88ee3dd9286d3e
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-06-24 10:11:36 +08:00
Joseph Chen ed71c65549 pmic: rk8xx: add "addr" filed for battery bind
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I073dcd49f89a75d1d320f3e80307b137814d0e2f
2020-06-23 19:30:23 +08:00
Joseph Chen 50454a094f dm: pmic: add "addr" field for binding children
If some child info->prefix are the same, try to
distinguish them by parent addr.

Example:
	pmic@20, pmic@1a...

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I504cd887e232bb309d8e1790f6d55910172d08b5
2020-06-23 19:30:21 +08:00
Tang Yun ping d3f5f12c3c rockchip: rv1126: tpl support thunder boot
If CONFIG_ROCKCHIP_THUNDER_BOOT=y, it will enable ddr fast boot.

Change-Id: Ia43039dd1247ebb937aaa8b6d9a9103df2dfe1f5
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-06-23 16:41:26 +08:00
Joseph Chen 61c4c6b471 phy: rockchip: fix compile error
Report compile error if CONFIG_IO_TRACE=y.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I2cc791659a77c8c7d9fe01eed2c7b9ae052730bb
2020-06-22 20:02:28 +08:00
Tang Yun ping f876ce9b2e drivers: ram: rv1126: adjust some print info
Change-Id: I07e0509dee69e172e6d5adbaabf61f3eef5eec4a
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-06-19 12:46:03 +08:00
Tang Yun ping 2c5208e273 drivers: ram: rv1126: use read preamble training mode for ddr4
Change-Id: I8128352f9727a502c029c08eb57e486a9835c405
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-06-19 11:46:51 +08:00
Jason Zhu 4298c19d4f misc: decompress: add function misc_decompress_process()
Use it to decompress data.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I189cded00069cc9f559097811733a481aae8d08f
2020-06-18 10:34:30 +08:00
Jason Zhu 809af6ba3d misc: rockchip_decompress: update the decompress driver
1.add DECOM_AXI_STAT to test decompress whether is in idle
2.correct the misc_decompress_is_complete return value

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I904d9909ade709fb479893325dd6c0b3d47d5908
2020-06-18 10:34:04 +08:00
Sandy Huang 859836bc0c drm/rockchip: change 8bit bmp decoder result from BGR565 to RGB565
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I0ca715bd69bc9ff1a61c98f766ecab2458737b27
2020-06-17 16:49:21 +08:00
Sandy Huang f0e8414b2a drm/rockchip: fix rgb888 format color incorrect
vop full need to do rb swap when deal with rgb888/bgr888;

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I60fac72b21720fcf4f406c56fe7d9dc21ebf7635
2020-06-17 16:49:21 +08:00
Joseph Chen 558b8198d4 dm: serial: introduce DEBUG_UART_ALWAYS_MODE configure
Rename CONSOLE_SERIAL_SKIP_INIT to DEBUG_UART_ALWAYS_MODE for
easy understand.

Select this to always use debug UART, skip complicated
console UART register.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I3c265840bde015fe5fd7c73d959ba0538297b7c2
2020-06-16 15:07:35 +08:00
Jason Zhu 47f7fd3a52 blk/mmc: add function blk_dread_prepare
This function prepares to read data without confirming completed.
We can use it to prefetch data and run other process.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I76116c25dfdb7559b80a0216c414189e85409a3e
2020-06-16 11:34:02 +08:00
Jon Lin 0f1dc4879a mtd: mtd_blk: Check map table block address overflow
1.Check map table block address overflow
2.Reinit map table original value

Change-Id: I4450b5a6856e38e2624da9db31d5eb98de7f5696
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-15 21:05:44 +08:00
Sandy Huang 48efbc7eef drm/rockchip: vop: rk312x use win1 to show logo
since kernel set rk312x win1 to show kernel logo, so here sync with
kernel config.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I3ed562526cd6f61359bef1567c7f2ea57149435d
2020-06-15 10:52:19 +08:00
Sandy Huang 695a88c4e9 drm/rockchip: win module base on rk3366 need to treats rgb888 as bgr888
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I83a28d0530db1d388176e2c249d6af8b9763f209
2020-06-15 10:52:19 +08:00
Jon Lin 2f0bb0e6b9 mtd: nand: Fix error in counting BITS_PER_LONG
Change-Id: I148a18733e055e5e43f7b259af05b3e0b36ac648
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-14 18:55:46 +08:00
Jon Lin 9dd9794e32 rkflash: Support new SPI Nor devices
1.Support FM25Q128A, MX25L3233FM2I
2.Change XT25F128A, GD25Q256B

Change-Id: I359bcb9fac25ae298c2e3c5ae22d61e9e5077c63
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-12 17:07:22 +08:00
Jon Lin b191872f34 mtd: spinand: Support GD5F2GQ4UBxxG
Change-Id: Ia3e340ae8b86c282953f94c16b801414218818bf
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-12 15:09:10 +08:00
YouMin Chen 05431850c7 drivers: ram: rv1126: add support DDR3/LPDDR3 1056MHz
Change-Id: Ib24e263f1a58861a173b5b566718385b3f67eedc
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-11 13:21:52 +08:00
YouMin Chen 48c0a787fe drivers: ram: rv1126: fix DDR3 read training error
Change-Id: I0fef4eda1d14d1e46fdfdf474b6abfcc9577617d
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-06-11 09:33:02 +08:00
Jon Lin 9ee38883a7 mtd: mtd_blk: Support mtd_map_write
Change-Id: Ifbd05736a48aa89a2e808ae4d4385bf59458d010
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-08 16:37:14 +08:00
Jon Lin 951aa503aa mtd: spi nor: Support parse dts node label property
Change-Id: Ib27976970e12f4e97fab2b3c84f6580a09f2c9c1
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-08 15:58:53 +08:00
Jon Lin 31e5d7a303 spi: rockchip_sfc: Make SPI host spi-max-frequency not configurable
Change-Id: I6184134ee423a8ffbead9cac739c6f0b5db91f6c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-08 15:32:21 +08:00
Jon Lin be6c00c075 mtd: nand: Mark bbt start with spare offset 0 and ECC enabled
Change-Id: Ib388c6475003917da302f0535c18ac5fc51fb3e2
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-08 11:17:00 +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 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
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 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
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 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 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 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
David Wu 6f0a52e952 net: gmac_rockchip: Add dwc_eth_qos support
Change the original data structure so that Rockchip's Soc
gmac controller can support the designware.c and dwc_eth_qos.c
drivers, a Soc can only support one.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I313674274fc2eddb7717ba76c537cd668d6a492b
2020-06-02 16:10:47 +08:00
David Wu a494aeaa44 net: dwc_eth_qos: Fix the reset for RGMII
When using rgmii Gigabit mode, the wait_for_bit_le32()
reset method resulting in RX can not receive data, after
this patch, works well.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Id1d2405397d0c2f59b7bf1e341cdf66b023e4226
2020-06-02 16:10:47 +08:00
David Wu 23ca6f743c net: dwc_eth_qos: Export common struct and interface at head file
Open structure data and interface, so that Soc using dw_eth_qos
controller can reference.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ic845d330465c1bb8f7868fb188e5bf30c865b9b5
2020-06-02 16:10:47 +08:00
David Wu e2d5843168 net: dwc_eth_qos: make eqos_start_clks and eqos_stop_clks optional
If there are definitions for eqos_start_clks and eqos_stop_clks,
then call these callback function.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Id5ffc944a2c066d78a784aeb28ecb846b53e52fd
2020-06-02 16:10:47 +08:00
David Wu 5bcea7aac5 net: dwc_eth_qos: Split eqos_start() to get link speed
For Rockchip, need to obtain the current link speed to
configure the tx clocks, (for example, in rgmii mode,
1000M link: 125M, 100M link: 25M, 10M link is 2.5M rate)
and then enable gmac. So after the adjust_link(), before
the start gamc, this intermediate stage needs to configure
the clock according to the current link speed.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I9a46da28abca0544cb0a56b0a0574e2fd1de0c52
2020-06-02 16:10:47 +08:00
David Wu b29cefabfd net: dwc_eth_qos: Make clk_rx and clk_tx optional
For others using, clk_rx and clk_tx may not be necessary,
and their clock names are different.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I952ac6cc6a4278c887b530bd6d387752358c89a8
2020-06-02 16:10:47 +08:00
David Wu bbbbc81c01 net: dwc_eth_qos: Move interface() to eqos_ops structure
After moving to eqos_ops, if eqos_config is defined
outside file, can not export interface() definition,
only export eqos_ops struct defined in dwc_eth_qos.c.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ibc60f49f36bb2011454370ed7fcc6d9db3b34d9f
2020-06-02 16:10:47 +08:00
David Wu 13105a0ba7 net: dwc_eth_qos: Add option "snps,reset-gpio" phy-rst gpio for stm32
It can be seen that most of the Socs using STM mac, "snps,reset-gpio"
gpio is used, adding this option makes reset function more general.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I428c7158c113143a7e51296705fabde6f05eb0f6
2020-06-02 16:10:47 +08:00
David Wu dcf8de121a net: dwc_eth_qos: Use dev_ functions calls to get FDT data
It seems dev_ functions are more general than fdt_ functions.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ia1d19c61fb8a2c8540b3dfda53b6aeb3b72acb7f
2020-06-02 16:10:47 +08:00
Ye Li 4d0fb6f008 UPSTREAM: eQos: Implement the read_rom_hwaddr callback
Implement the read_rom_hwaddr callback to load MAC address from fuse
for imx8m platforms.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I4204948ae6a0408f7d642007d27923a3c6941562
2020-06-02 16:10:47 +08:00
Fugang Duan ad018a0c24 UPSTREAM: net: eqos: implement callbaks to get interface and set txclk rate
Implement the callbacks to get phy mode interface and txclk
rate configuration.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I0a5265347936c1bc821c175eea1698d2624d4873
2020-06-02 16:10:47 +08:00
Fugang Duan a7b3400fe0 UPSTREAM: net: dwc_eth_qos: add dwc eqos for imx support
Add dwc eqos for imx support.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I49127be057a49e6b45e37f940d523d808c20343b
2020-06-02 16:10:47 +08:00
Ye Li 8e3eceb053 UPSTREAM: net: Update eQos driver and FEC driver to use eth phy interfaces
Update eQoS and fec ethernet drivers to support shared MDIO framework

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iaf5f3ca585190c6469b68195aaea2499242a0096
2020-06-02 16:10:47 +08:00
Ye Li 70664e19a3 UPSTREAM: net: Add eth phy generic driver for shared MDIO
For dual ethernet controllers, the HW design may connect ETH phys to
one MDIO ports. So two different ethernet drivers have to share MDIO bus.
Since two ethernet drivers are independent, we can't ensure their probe
order.

To resolve this problem, introduce an eth phy generic driver and uclass.

After eth-uclass binds, we search the mdio node and binds the phy node
with the eth-phy-generic driver.

When one eth driver get its phy device, the parent of phy device will
probe prior than phy device. So this ensure the eth driver ownes the
MDIO bus will be probed before using its MDIO.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ice83493e9e1caf3842f9ce0c129e29ad46cc0532
2020-06-02 16:10:47 +08:00
Alex Marginean 8a2d844d7d UPSTREAM: net: introduce MDIO DM class for MDIO devices
Adds UCLASS_MDIO DM class supporting MDIO buses that are probed as
stand-alone devices.  Useful in particular for systems that support
DM_ETH and have a stand-alone MDIO hardware block shared by multiple
Ethernet interfaces.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I8e106f4360aa46289e0ed551f8f685cad9dc6269
2020-06-02 16:10:47 +08:00
Marek Vasut 0731427808 UPSTREAM: net: dwc_eth_qos: Prevent DMA from writing updated RX DMA descriptor
The DMA may attempt to write a DMA descriptor in the ring while it is
being updated. By writing the DMA descriptor buffer address to 0, it
is assured the DMA will not use such a buffer and the buffer can be
updated without any interference.

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: If70a57f195c146d571de20385b55ff75f7dea7db
2020-06-02 16:10:47 +08:00
Marek Vasut 076e66fb70 UPSTREAM: net: dwc_eth_qos: Invalidate RX packet DMA buffer
This patch prevents an issue where the RX packet might have been
accessed by the CPU, which now has cached data from the packet in
the caches and possibly various write buffers, and these data may
be evicted from the caches into the DRAM while the buffer is also
written by the DMA.

By invalidating the buffer after the CPU accessed it and before the
DMA populates the buffer, it is assured that the buffer will not be
corrupted.

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I6271396aad6abac3fb11e5e742a3b2c9e7cc355b
2020-06-02 16:10:47 +08:00
Marek Vasut 865fce80b7 UPSTREAM: net: dwc_eth_qos: Invalidate RX descriptor before reading
The current code polls the RX desciptor ring for new packets by reading
the RX descriptor status. This works by accident, as the RX descriptors
are often in non-cacheable memory. However, the driver does support use
of RX descriptors in cacheable memory.

This patch adds a missing RX descriptor invalidation, which assures the
CPU will read a fresh copy of the RX descriptor instead of a cached one.

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ia05e8a43d707088bc3699b7d00434c8d12d2692f
2020-06-02 16:10:47 +08:00
Marek Vasut 6399c699b8 UPSTREAM: net: dwc_eth_qos: Flush the RX descriptors on init
Currently the code only flushes the first RX descriptor, not every entry
in the RX descriptor ring. Fix this, to make sure the DMA engine can pick
the RX descriptors correctly.

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I7a37f8a1fd51b2b7ca4fb557885d711ebd72c49c
2020-06-02 16:10:47 +08:00
Marek Vasut 364f8fdc57 UPSTREAM: net: dwc_eth_qos: Correctly wrap around TX descriptor tail pointer
This code programs the next descriptor in the TX descriptor ring into
the hardware as the last valid TX descriptor. The problem is that if
the currenty descriptor is the last one in the array, the code will
not wrap around correctly and use TX descriptor 0 again, but instead
will use TX descriptor at address right past the TX descriptor ring,
which is the first descriptor in the RX ring.

Fix this by adding the necessary wrap-around.

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iaf0f5dba76c232af1cbef628c099aaf43542757d
2020-06-02 16:10:47 +08:00
Marek Vasut 6143c348bd UPSTREAM: net: dwc_eth_qos: Fully rewrite RX descriptor field 3
The RX descriptor field 3 should contain only OWN and BUF1V bits before
being used for receiving data by the DMA engine. However, right now, if
the descriptor was already used for receiving data and is being cleared,
the field 3 is only modified and the aforementioned two bits are ORRed
into the field. This could lead to a residual dirty bits being left in
the field 3 from previous transfer, and it generally does. Fully set the
field 3 instead to clear those residual dirty bits.

Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I5b116fa58de65b3958c3ddd87f6c182c532b9542
2020-06-02 16:10:47 +08:00
Patrick Delaunay 83d31c080c UPSTREAM: net: dwc_eth_qos: implement phy reg and max-speed for stm32
Add management of property "reg" to configure @ of phy and
also "max-speed" property to specify maximum speed in Mbit/s
supported by the device

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I6ecabcffc4782f1e641d8ee1021f6c3caf360707
2020-06-02 16:10:47 +08:00
Christophe Roullier 5bd3c53883 UPSTREAM: net: dwc_eth_qos: implement reset-gpios for stm32
Add management of property "reset-gpios" in the node identified by
"phy-handle" to configure any GPIO used to reset the PHY.

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ia7dfcafc2e2f90a5ca48205dd2562fb62a3d6d84
2020-06-02 16:10:47 +08:00
Marek Vasut 369f6fd338 UPSTREAM: net: dwc_eth_qos: Pass -1 to phy_connect() to scan for all PHYs
PHY address 0 is a valid PHY address, to scan for all PHYs, pass -1 to
phy_connect(). Passing 0 used to work before be accident, but does no
longer.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ibc8a780b8a7e1be6f827ca901d0b1f2b384ca627
2020-06-02 16:10:47 +08:00
Patrick Delaunay 1e8d5d80b6 UPSTREAM: net: dwc_et_qos: update weak function board_interface_eth_init
Align the board and driver prototype for board_interface_eth_init
to avoid execution issue (the interface_type parameter is defined
as int or phy_interface_t).

To have a generic weak function (it should be reused by other driver)
I change the prototype to use directly udevice.

This prototype is added in netdev.h to allow compilation check
and avoid warning when compiling with W=1 on file
board/st/stm32mp1/stm32mp1.c

warning: no previous prototype for 'board_interface_eth_init'\
[-Wmissing-prototypes]
     int board_interface_eth_init(int interface_type, ....
         ^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I7301e49ef8e51ecdde0629a69d7bcc07465952d0
2020-06-02 16:10:47 +08:00
Patrick Delaunay 8aaada72f0 UPSTREAM: net: dwc_eth_qos: Change eqos_ops function to static
This patch solves many warnings when compiling with W=1:
warning: no previous prototype for '....' [-Wmissing-prototypes]

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ice01d9d56324b450f313a4a74e5039581e20a08e
2020-06-02 16:10:47 +08:00
Christophe Roullier 7a4c4edd4e UPSTREAM: net: dwc_eth_qos: add Ethernet stm32mp1 support
Synopsys GMAC 4.20 is used. And Phy mode for eval and disco is RMII
with PHY Realtek RTL8211 (RGMII)
We also support some other PHY config on stm32mp157c
PHY_MODE	(MII,GMII, RMII, RGMII) and in normal,
PHY wo crystal (25Mhz and 50Mhz), No 125Mhz from PHY config

Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ie696f22dd260f6712c61744c60dc9d5a64737a5a
2020-06-02 16:07:42 +08:00
Carlo Caione 7965f3d331 UPSTREAM: net: phy: Add generic helpers to access MMD PHY registers
Two new helper functions (phy_read_mmd() and phy_write_mmd()) are added
to allow access to the MMD PHY registers.

The MMD PHY registers can be accessed by several means:

1. Using two new MMD access function hooks in the PHY driver. These
functions can be implemented when the PHY driver does not support the
standard IEEE Compatible clause 45 access mechanism described in clause
22 or if the PHY uses its own non-standard access mechanism.

2. Direct access for C45 PHYs and C22 PHYs when accessing the reachable
DEVADs.

3. The standard clause 45 access extensions to the MMD registers through
the indirection registers (clause 22) in all the other cases.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I53a73274b6386f8a510b590a0f7ce1923f7b5528
2020-06-02 16:07:42 +08:00
Pankaj Bansal 5b8d12099d UPSTREAM: net: phy: Add clause 45 identifier to phy_device
The phy devices can be accessed via clause 22 or via clause 45.
This information can be deduced when we read phy id. if the phy id
is read without giving any MDIO Manageable Device Address (MMD), then
it conforms to clause 22. otherwise it conforms to clause 45.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iae1c8e2414b655639c42f7098a097c6a0a1e5792
2020-06-02 16:07:42 +08:00
Grygorii Strashko 7ef8964296 UPSTREAM: net: phy: add ofnode node to struct phy_device
Now the UCLASS_ETH device "node" field is owerwritten by some network drivers in
case of Ethernet PHYs which are linked to UCLASS_ETH device using
"phy-handle" DT property and when Ethernet PHY driver needs to read some
additional information from DT. In such cases following happens (in
general):

- network drivers
	priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev,
				   priv->interface);
	<-- phydev is connected to dev which is UCLASS_ETH device

	if (priv->phy_of_handle > 0)
		dev_set_of_offset(priv->phydev->dev, priv->phy_of_handle);
	<-- phydev->dev->node is overwritten by phy-handle DT node

- PHY driver in .config() callback
	int node = dev_of_offset(dev);
	<-- PHY driver uses overwritten dev->node
        const void *fdt = gd->fdt_blob;

	 if (fdtdec_get_bool(fdt, node, "property"))
		...

As result, UCLASS_ETH device can't be used any more for DT accessing.

This patch adds additional ofnode node field to struct phy_device which can
be set explicitly by network drivers and used by PHY drivers, so
overwriting can be avoided. Also add helper function phy_get_ofnode()
which will check and return phy_device->node or dev_ofnode(phydev->dev) for
backward compatibility with existing drivers.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I31fcf01cfb19894bc90d198d9138c1fd3e25802e
2020-06-02 16:07:42 +08:00
Fabrice Gasnier 827e2ae92e UPSTREAM: clk: add clk_valid()
Add clk_valid() to check for optional clocks are valid.
Call clk_valid() in test/dm/clk.c and add relevant test routine to
sandbox clk tests.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I78b1edea1f8ef54d3aa3f7610d39d79dd994d1bf
2020-06-02 16:07:42 +08:00
Finley Xiao 24f48ac9a8 clk: rockchip: rv1126: Change pclk pdbus parent to gpll
As dmac aclk comes from hclk pdbus, dmac pclk comes frome pclk pdbus,
dmac aclk should be an integer multiple of dmac pclk and the same
parent with dmac pclk. so let hclk pdbus and pclk pdbus only come from
gpll.

Change-Id: Idd2f362fcf160352dcb4577ad8a13b4dbec7c65f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-06-02 11:01:58 +08:00
Jason Zhu 33e40bac6a mmc: dw_mmc: set DWMCI_CARDTHRCTL
Since v2.80a, dwmmc controller introduced the card write threshold for
HS200 & HS400 mode. So CardThrCtl can be supported during write operation, not
only read operation.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I7f345660107c2978d2f874d36f2dffd2acdfbcb6
2020-06-02 09:49:38 +08:00
Joseph Chen e59905bf16 irq: use CONFIG_ROCKCHIP_GPIO_V2 instead of CONFIG_IRQ2GPIO_V2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id8b232efce483501053bcbd779a444d395c061fc
2020-05-28 19:20:09 +08:00
Jianqun Xu d1aef94b5a gpio/rockchip: rk_gpio support v2 gpio controller
The v2 gpio controller add write enable bit for some register,
such as data register, data direction register and so on.

This patch support v2 gpio controller by redefine the read and
write operation functions.

Change-Id: I2adbcca06a37c48e6f494b89833cd034ba0dae29
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-05-28 19:20:09 +08:00
Jianqun Xu 7d13e745d6 gpio/rockchip: rk_gpio correct pin count for each bank
Do 'gpio status -a' will cause system crash, due to the pins number
error for gpio4 (last gpio controller).

Test on RV1126 IOTEST board, which has only 8 pins for GPIO4.

Change-Id: I4150abd0ca97bc4f3043eb7fcae2287818125031
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-05-28 19:20:09 +08:00
Jianqun Xu 33f8d8a65e pinctrl: export pinctrl_get_pins_count as generic API
Change-Id: I0c5e4977b068a09276a1d0561058679bd1791e0a
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-05-28 19:20:09 +08:00
Jianqun Xu 09989a56e1 pinctrl/rockchip: pinctrol support get_pins_count operation
Change-Id: I8459d9e21a7c95e62c053ea7848b189b714ddbfd
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-05-28 19:20:09 +08:00
Joseph Chen d5cc49d9e2 core: dump: update "dm uclass" print format
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I751a9458721df165e6cfb1ce34d00dc85edf4716
2020-05-28 16:24:55 +08:00
Joseph Chen 25a7c60a0b Revert "regulator: pwm: remove init voltage setting"
This reverts commit ef473e3642.

We merged this commit while we didn't notice that this driver gets
init voltage from legacy "rockchip,pwm_voltage = <...>", but regulator
uclass gets it from "regulator-init-microvolt = <...>". so we have to
revert this commit to compatible the legacy one.

Change-Id: I52606d9a9268659d3d77f7d29d1eed1d80b30b1e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2020-05-27 15:45:58 +08:00
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
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 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
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
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
Sandy Huang cf53642aa6 drm/rockchip: filter the edid modes accordinig to vop max output resolution
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Id338a2b3bc659799c4fb391d36fa814c44e0274d
2020-05-13 09:04:23 +08:00
Sandy Huang af50552e4f drm/rockchip: vop: fix win2 csc register define error
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ice649d5319b488a8a0aea4d9545d462b33fec05c
2020-05-13 09:04:23 +08:00
Joseph Chen 5a157e97d5 Merge branch 'thunder-boot' into next-dev 2020-05-12 10:37:37 +08:00
Shunqing Chen 23858492ef power: charge animation: fix the issue that did not auto turn off screen
1.set auto_wakeup_screen_invert to 1 and set auto_off_screen_interval to 0.
2.set auto_screen_off_timeout to 1.
2.press power key to turn on screen.
3.screen will not be turned off at this time.

Change-Id: Ifc92f23a38d8ba0da4f6e37625b4114edb42f6a8
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2020-05-11 16:33:49 +08:00
Jon Lin c9e94690ba mtd: mtd_blk: Optimize map table reinitialization
Change-Id: Ie27c8a215568755857cf67444637b1d89f55bd3a
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-11 11:34:22 +08:00
Finley Xiao 2438a166f4 clk: rockchip: rv1126: Add support for gmac
Change-Id: I10ade6acbbfe5dd23e33a250ef601948606bc57e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-11 11:31:56 +08:00
Joseph Chen b0c9708366 Merge branch 'next-dev' into thunder-boot 2020-05-08 15:52:44 +08:00
Jason Zhu 2056aa9f86 drivers: mmc: pass the mmc ext_csd to kernel
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I95dbd0da5d8750e5b19f00a54596ca484f72ecb2
2020-05-06 22:12:30 +08:00
Joseph Chen e9e0746f31 Merge branch 'next-dev' into thunder-boot 2020-04-27 16:54:06 +08:00
Jon Lin 88ea3acb7b spi: rockchip_sfc: Support setting SPI Nand write xbits address
Change-Id: I09d746191323c1e14d8993e71df6d1d5fd621910
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-27 14:59:44 +08:00
Jon Lin bdf7b34b60 mtd: nand: Fix memory allocation in nanddev_bbt_init()
Fix the size of the buffer allocated to store the in-memory BBT.
This bug was previously hidden by a different bug, that was fixed in
commit e4fd10db8b8 ("mtd: nand: Fix nanddev_neraseblocks()").

Fixes: ed99f7731 ("mtd: nand: Add core infrastructure to deal with NAND devices")
Change-Id: I365fdfe053ef352661a832b33a232cbb18e81be6
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-27 14:31:17 +08:00
Joseph Chen 5d45852261 ram: ramdisk_ro: add u-boot device definition
In order not to add the device info in dts.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I334c2c99a71476545f311d26b32d7954ca8d8dfd
2020-04-26 15:14:11 +08:00
Joseph Chen aedeb70ba0 ram: Kconfig: RAMDISK_RO requires rkparam partition
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I166450ab0d406d2a452afb137c57511def54760c
2020-04-26 15:13:44 +08:00
Jon Lin 19a7802737 mtd: mtd_blk: skip bad block if mtd map isn't initiated
Change-Id: I3a2b5d311b43cc82135ecd84956e7a365c5910db
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-26 09:15:15 +08:00
Jon Lin d629023889 mtd: mtd_blk: skip bad block if mtd map isn't initiated
Change-Id: I3a2b5d311b43cc82135ecd84956e7a365c5910db
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-24 14:34:59 +08:00
Jon Lin 1f21bf610b mtd: mtd_blk: add flash map block management
1.SPI Nand MTD partition bad block will not be detected if the address
isn't begin with the partition first block.
2.To avoid this problem, we should use map partition block address to
get right data.
3.It's compatible if the map table isn't initialed.

Change-Id: I11858b9b30a8fffecdbad804b1bad7b247b51d23
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-24 10:23:25 +08:00
Jason Zhu 94b85d035d misc: otp: use buffer to store capability
ioctl() should return error code but not data.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ica1242619ed59728acbeda7db493e5710f410a17
2020-04-24 10:23:25 +08:00
Jon Lin 0d7422431a mtd: mtd_blk: add flash map block management
1.SPI Nand MTD partition bad block will not be detected if the address
isn't begin with the partition first block.
2.To avoid this problem, we should use map partition block address to
get right data.
3.It's compatible if the map table isn't initialed.

Change-Id: I11858b9b30a8fffecdbad804b1bad7b247b51d23
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-23 20:00:40 +08:00
Jason Zhu f394ba0e85 misc: otp: use buffer to store capability
ioctl() should return error code but not data.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ica1242619ed59728acbeda7db493e5710f410a17
2020-04-23 16:53:24 +08:00
Joseph Chen 2bc8e1106f Merge branch 'next-dev' into thunder-boot 2020-04-23 16:43:12 +08:00
Joseph Chen dc33c23192 misc: rockchip_decompress: use buffer to store capability
ioctl() should return error code but not data.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I66eaefc64a20303400b730cc46f3814a9f050cf0
2020-04-23 16:17:06 +08:00
Joseph Chen 40f8ee7a99 misc: rockchip-efuse: implement IOCTL_REQ_CAPABILITY of ioctl()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8ae7b1bad8a892173bee442e1163cb5872b169e5
2020-04-23 16:17:06 +08:00
Joseph Chen 374c241cf9 misc: add a common api to get device by capability
fix: ioctl() should return error code but not capability.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8030a1842692697f32f87e765ce3d68d1adb1c11
2020-04-23 16:17:06 +08:00
Joseph Chen 1cef1b20c4 dm: misc: merge generic header file into misc.h
Puting the generic function declaration together that the
caller don't need care too much about different header file.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib37d1550e5a747d8f18e30c428ea8f613f9cc006
2020-04-23 16:17:06 +08:00
Joseph Chen fd85085a4b Merge branch 'next-dev' into thunder-boot 2020-04-23 14:13:56 +08:00
Lei Chen f21c060e4b driver: input: update RK remote control driver
This patch updates the RC driver to accommodate the new framework

Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I3ff2b5844ce5f1776ac2f94b3cbd42eb5d73cc41
2020-04-23 10:23:19 +08:00
Jon Lin f3a2c32e2d rkflash: enable reinit SNOR from snor flash packet
Change-Id: I21fa94d1ded675323a02c8a8d7073b31290bc7c7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-23 10:19:50 +08:00
Jon Lin 9371a438f4 rkflash: support SNOR reinit from snor flash packet
That snor_info_packet is SPI Nor information placed in IDB header
area, each progress can parse it to get flash information.

Change-Id: I63621a5b92c2fb85b588365d9415fbb40eece8a3
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-04-23 10:19:50 +08:00
Joseph Chen 710cfa3daa Merge branch 'next-dev' into thunder-boot 2020-04-22 18:15:33 +08:00
Yifeng Zhao e65bf00a8c spl: drivers: mtd: nand: raw: switch to the device model
Switch to the device model and support mtd.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Idfb60cec7a375254a423677b1c3f1da4be954eb5
2020-04-22 18:10:49 +08:00
Jason Zhu 6a8fa29e04 misc: otp: realize otp interface layer function
Realize otp read & write functions for application layer calling.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ic8f698b36fce4c1c6cd7a2848afd370567b43448
2020-04-22 18:08:19 +08:00
Jason Zhu f9519410b1 misc: otp: support rockchip secure otp version 2 driver
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I10a8cc92f2130c1f1957fd36fb924d9846707e65
2020-04-22 18:08:19 +08:00
Jason Zhu 5b7d32987c drivers: misc: use misc_mode to distinguish different device
The misc attach different device. We use the misc_mode to show
different device's capability.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ibce5bb0465e452a7e783c5859f1e8ab2bfd8b0c5
2020-04-22 18:08:19 +08:00
Joseph Chen 2ca0cbb64a dm: sysreset: disable psci sysreset for SPL and TPL
SPL is the stage early than atf/op-tee that psci sysreset
is not supported.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I46b988b3776638265bf8f374a10f9027d1ebc90f
2020-04-22 18:07:21 +08:00
Joseph Chen 98894c7310 Merge branch 'next-dev' into thunder-boot 2020-04-21 16:19:07 +08:00
Joseph Chen abedddcfae input: add spl adc key driver
Providing a mininum adc key driver for SPL, which does not
depend on key uclass, but ADC uclass is still required.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I80f861780acd9c47d345b95762a4dd39d19ea6fc
2020-04-21 16:15:22 +08:00
Joseph Chen 3509e794f3 input: Makefile: clean for SPL build
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8ea0bd45ef86802e2992a44793a91eb8bb7b08fc
2020-04-21 16:15:22 +08:00
Joseph Chen 35ef9ac329 dm: adc: decoupling regulator from adc uclass
Regulator should be a option but not mandory for dm adc.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I5fdda2d76dd8ce75673732cc0563d7a18be211e2
2020-04-21 16:15:22 +08:00