Commit Graph

13700 Commits

Author SHA1 Message Date
Elaine Zhang 802c460a72 clk: rockchip: rk3568: support ppll setting 200M
Change-Id: If5d4d1994956a8e18f3208a22daee6efca80950b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-11-16 15:05:05 +08:00
David Wu 458cbae45a power: rockchip-io-domain: Use private write for rk3568
The i2c5 xfer went wrong because of io-domain was not right
and was configured correctly in uboot to ensure that kernel
was right before initializing the io-domain driver.

Change-Id: Ic2f94952f7a851dc5b781af9f31bba2562b5a2b5
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-11-16 11:45:51 +08:00
Joseph Chen 8db677370c irq: irq-gpio-switch: add gpio alias name support
Before the patch, we get gpio index(0,1,2..) depends on gpio
fdt node name, such as: gpio0@..., gpio1@..., etc.

But from RK3568, we add gpio alias to indicate gpio index
information and index is removed from gpio node name, ie:
gpio@fdd60000, gpio@fe740000, etc.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I56e45941f9572fbc6a5a5916896e12f6eff9dcf3
2020-11-14 15:32:03 +08:00
David Wu e4e3f4318d net: gmac_rockchip: Add rmii support for rv1126
Change-Id: I89401b89ff8fd3d9cca754d6f1c05dc76ef2cda6
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-11-14 15:23:48 +08:00
William Wu 3b2dd5de37 usb: dwc3: do not use 3.0 clock when operating in 2.0 mode
In the 3.0 device core, if the core is programmed to operate in
2.0 only, then setting the GUCTL1.DEV_FORCE_20_CLK_FOR_30_CLK makes
the internal 2.0(utmi/ulpi) clock to be routed as the 3.0 (pipe)
clock. Enabling this feature allows the pipe3 clock to be not-running
when forcibly operating in 2.0 device mode.

Change-Id: Ib93da14b5309ec094b952e03f8514817910fedfa
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-11-14 12:05:13 +08:00
Jason Zhu 60238d95dc mmc: sdhci: rockchip: change tapnum to 16
According to the test hadware testing.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I2750a7de9f79807256800868ae53d3fe4a23b2f1
2020-11-14 11:55:39 +08:00
Yifeng Zhao 007849d805 drivers: rockusb: add new idb feature for rk3568
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Iee5ed01bb336a5b5994381fc8e734da3b87329fe
2020-11-12 20:12:17 +08:00
Yifeng Zhao 8d74d6b7d3 drivers: mmc: rockchip: rk3568: config rx clock no inverter for hs200
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I426a5c3ee0899fbd54711e13550310f77f8abd3e
2020-11-11 19:48:46 +08:00
Jianqun Xu fcff2851be power: io-domain: rockchip: fix rk3568 grf offset
Change-Id: I1045ce0d942ea57e325bdf3b8aa4bc8c9023d9e8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-11-10 17:15:52 +08:00
Jianqun Xu 836c6892fa pinctrl: rockchip: fix RK3568 for pull set
Change-Id: I9fa739d65caf54067f8c61142ced44f9ad9d7313
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-11-10 17:15:52 +08:00
Elaine Zhang 801ca42bf6 clk: rockchip: rk3568: fix up the vpll register address
Fix up the error description of TRM.

Change-Id: Ie95482efea4e78505d361b5377ff4a23826d69e3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-11-10 10:20:20 +08:00
Ren Jianing e475bd5dfd phy: rockchip-inno-usb2: add usb2 phy support for rk3568
RK3568 has two USB 2.0 PHYs, and each PHY has two ports, the
OTG port of PHY0 support OTG mode with charging detection
function, they are similar to previous Rockchip SoCs.

However, there are three different designs for RK3568 USB 2.0 PHY.
1. RK3568 uses independent USB GRF module for each USB 2.0 PHY.
2. RK3568 accesses the registers of USB 2.0 PHY IP directly by APB.
3. The two ports of USB 2.0 PHY share one interrupt.

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ia33d3de222a6c7f263290f4098d0a5e557a9d568
2020-11-09 19:39:27 +08:00
Yifeng Zhao 28b3b131e9 drivers: mmc: rockchip: fix phy dll config for hs200
Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Ie72f2414eca2856102e0a477668ec2729396cd25
2020-11-09 16:10:02 +08:00
Elaine Zhang d41e2874c4 clk: rockchip: rk3568: emmc support 52MHz
Change-Id: I54841ec5c7a5030bbbf9fa5b6b6fdc742250a127
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-11-08 20:28:41 +08:00
Elaine Zhang d01aebd267 clk: rockchip: rk3568: emmc support 400KHz
Change-Id: I1b16a4ad2e67749e63eb1506c6c1462db3e6abbd
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-11-08 19:15:43 +08:00
Jon Lin a80fd39692 drivers: rkflash: Support new devices
MT29F2G1ABA, F50L2G41XA, W25Q128JVSIM, ZB25LQ128, FM25Q64-SOB-T-G

Change-Id: Idf09d96161130d4741e046acd9d520683c37213e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-11-06 14:09:54 +08:00
Jon Lin e66d4537db gadget: rockusb: Support rkusb_do_erase_force
Change-Id: Ia18c5a8414411044a72858d83ccddec63ac83e70
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-11-05 17:01:02 +08:00
Jon Lin 338697c52f mtd: mtd_blk: Support mtd_derase
1.Support SPI Nand and SLC Nand in mtd case;
2.Only support address and length erasesize aligned case;

Change-Id: I8e76274677c153fb61616ebf320e1b86d5060439
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-11-03 15:36:16 +08:00
YouMin Chen 547ad455e4 drivers: ram: rockchip: add rk3568 sdram_init for build only
Change-Id: I09a83b3192f4b332aad37f709949011f173a3dac
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-11-03 10:54:39 +08:00
Joseph Chen 407f6521ad serial: Kconfig: default y for DEBUG_UART_ALWAYS
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie40ee20335c4aaafe8e31c32438b78de41bc01fd
2020-11-02 20:47:30 +08:00
Joseph Chen 034db99592 dm: serial: support always use uart debug mode
In this mode, uart debug is initialized depends on
configuration from pre-loader or CONFIG_UART_DEBUG_.

The serial is not care about dts "stdout-path" and
not register into console framework any more. It's
nice to use pre-loader serial and make serial easy
to configure.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: If4c68229d76b6f1710a35e3ef9a2a91cb306fa9c
2020-11-02 18:34:22 +08:00
Joseph Chen 6a1649e26d core: node: remove unused API
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I797cb2f594865ab9310651183bf98b8112fe429e
2020-11-02 18:34:21 +08:00
Joseph Chen 8c22eae691 dm: serial/16550: rollback to upstream version
rollback to: 02234e4 UPSTREAM: usbtty: fix typos

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I84296fad2b06823afc77477ef4ef11a2f801960a
2020-11-02 18:34:21 +08:00
Tang Yun ping 1040f70ad7 rockchip: rv1126: tpl: add ddr3 16bit support
This patch auto detect BW16 constitute by byte0 and byte2 or
byte0 and byte3.

Change-Id: I22a8fa70db1d996573004320196c0892d5380f64
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-10-30 18:07:30 +08:00
Lin Jinhan c48f1acf4a crypto: rockchip: modify crypto hash cache support for crypto v1&v2
Change-Id: I6e0604bf02908269ab021714378b66ed712fdc06
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-10-30 09:24:49 +08:00
Joseph Chen 73a2b1f652 driver: fpga: add rockchip support
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I52b089453383f9b48693c1cae3e0a97a5cf2339f
2020-10-29 15:20:08 +08:00
Joseph Chen 275a49e3fb irq: gicv3: use cpu interface system registers for gicc read/write
RK3568 only support cpu interface system registers access.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie89380e49ee61afe57560dcc4eba6233f2aca3f2
2020-10-28 21:23:07 +08:00
Joseph Chen 3582f7fa15 ram: Kconfig: select RKPARM_PARTITION by RAMDISK_RO
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Idb6ff31bf8ca4f9bf9a8fb5f0fb447236a9f8e76
2020-10-28 21:23:07 +08:00
Jason Zhu b7b235505b mmc: sdhci: support new phy IP
The new phy IP is designed by rockchip.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I5a84bcc6fff7aaf0bc848cdb70b78a57f471e51e
2020-10-28 15:03:46 +08:00
Jason Zhu 05f3b0ab30 mmc: sdhci: clean up the phy code
Different platform has different phy IP, distinguish them by
the compatible data.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Iaf78eee8abe7e9cd91c1edcd42fd65a611c3b0be
2020-10-28 15:03:46 +08:00
Elaine Zhang 392d4cef34 clk: rockchip: rk3568: update the clk config
modify the cpll and gpll register.
support Hpll set/get rate.

Change-Id: I46b372078435bc70a34d1402d43ce2431110ddbd
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-10-26 16:25:37 +08:00
Finley Xiao a4c57e8a07 rockchip: otp: Add support for rv1126
This adds the necessary data for handling otp on the rv1126.

Change-Id: Ie78ad04861ee8dca506f0bb7b851570b360694de
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-10-23 15:06:11 +08:00
Jianqun Xu 230491661d io-domain: rockchip: add rk3568 support
Change-Id: Ic3a984043e82bd65957239acc25de79e00e1a6b8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-10-23 15:02:15 +08:00
Jianqun Xu 3f4af2112b pinctrl: rockchip: add rk3568 support
Change-Id: Ie8c3d6f6a3909ab481241b98d3af55b26c38accc
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-10-23 15:02:15 +08:00
CanYang He e8885e2486 drivers: ram: rv1126: dram 32bit interface use pageclose
after system test, 32bit interface use pageclose can improve
performance, 16bit interface not improve.

Change-Id: Iecac7aae1e5f8ec4f162200d80be16f1b91180f5
Signed-off-by: CanYang He <hcy@rock-chips.com>
2020-10-23 15:01:23 +08:00
YouMin Chen da1862e965 drivers: ram: rv1126: fix the timing about noc burstpenalty
Change-Id: I1ce56c57f8798dfc4fbefd68d47fbe97de6c390a
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-10-23 15:01:00 +08:00
Elaine Zhang 417bebc456 clk: rockchip: rk3568: Add clock driver
Add basic clock for rk3568 which including cpu, bus, mmc,
i2c, pwm, gmac ...clocks init.

Change-Id: I4119f10897d06befa4a39198b3724dc515d416e3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-10-22 19:39:19 +08:00
Joseph Chen c3723ef337 clk: rockchip: rk3399: support crypto clk set/get in SPL
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I159d062320ca523e8dc4f0dcce94a619692481f3
2020-10-22 16:37:49 +08:00
Jon Lin 6524556d8d mtd: mtd_blk: Fix the way to get Nand mtd_info
Change-Id: I6e47180db41242a92ac74083d5984bcb06d92e9c
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-10-19 11:00:29 +08:00
Yifeng Zhao 6f8d5ecc09 spl: nand: add mtd erase size config for mtd blk
The mtd blk need mtd erase size to check bad block.x

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: If1bca0ce442599be41f3fd12638529018885f3e0
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-10-16 17:57:43 +08:00
Jon Lin 3ac03e839f mtd: spinand: Support FM25S02A
Change-Id: I855a01500977285c4b8eb09ec1c013a4cdb5636e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-10-15 16:02:18 +08:00
Jon Lin 9f568152b6 rkflash: Fix last data block vpn has been modify issue
Change-Id: Ie3aa7140c368693ddd18a53225975ec2fd6ce141
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-10-10 14:54:28 +08:00
Dayao Ji 40a6a2cba2 fastboot: add virtual A/B feature support
Add "fasboot getvar snapshot-update-status" support and
prevent erase/wipe of userdata/metadata when virtual A/B
merge status is MERGING or SNAPSHOTTED (+source slot !=
current slot).

Signed-off-by: Dayao Ji <jdy@rock-chips.com>
Change-Id: Ibb6ea5778b78b2601178f489d6efcee60d5d0a49
2020-09-23 19:01:12 +08:00
Jon Lin e091dc9d13 mtd: mtd_blk: Map table length round up to erase size
Change-Id: I5f615d37a572ce0d8ceb8d6d6b76983fc61e316b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-17 15:20:49 +08:00
Jason Zhu 51ceae363d mtd: mtd_blk: support map bad block table in spl
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I48112628812b948e4ab5a34362c8ada12b00471e
2020-09-17 15:20:49 +08:00
Jon Lin 2ac88c1bbc rkflash: Check bad block mark in spare 1st and 2nd byte
Change-Id: I60bb761d1f7a015c76939db165c53bf53bd514cf
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-17 14:40:02 +08:00
Jon Lin 03d86fc3c0 mtd: spinand: Support FM25S01A
Change-Id: I805cbf0e8bc47cd9bd94fd296dbaf46921490f15
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-09-16 12:58:33 +08:00
Jon Lin f28847a81d rkflash: Simplify SPI Nand flash table
1.Simplify SPI Nand flash table
2.Support new SPI Nand devices
3.Format coding styles

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

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

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

Change-Id: I0d2f0a91a5f628233de1cb848519fd76b692a2af
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2020-09-16 08:37:30 +08:00
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