Commit Graph

839987 Commits

Author SHA1 Message Date
Thinh Nguyen
be0b9b5e29 UPSTREAM: usb: dwc3: debugfs: Dump internal LSP and ep registers
To dump internal LSP and endpoint state debug registers, we must write
to GDBGLSPMUX register. This patch correctly dump LSP and endpoint
states from the debug registers.

If the controller is in device mode, all LSP and endpoint state
registers will be dumped via the debugfs attribute "lsp_dump". In host
mode, the user has to write the LSP number to "lsp_dump" to dump a
specific LSP selection.

Change-Id: I0d60a8af46b6dbdd2193ace7608ecddb41316a99
Fixes: 80b776340c ("usb: dwc3: Dump LSP and BMU debug info")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 62ba09d6bb)
2019-05-16 19:19:54 +08:00
Thinh Nguyen
59f1aadae8 UPSTREAM: usb: dwc3: debugfs: Print eps Tx/RxFIFO in bytes
TxFIFO and RxFIFO from GDBGFIFOSPACE are fifo depths in MDWIDTH. Convert
them into bytes for easier read.

Change-Id: I79f6a64dd08bd7bc59a8aecf8897cffb7b8a440e
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 0f874f79dc)
2019-05-16 19:19:54 +08:00
Thinh Nguyen
53e748a797 UPSTREAM: usb: dwc3: debugfs: Properly name Tx/RxFIFO
The Tx/RxFIFO types in the GDBGFIFOSPACE.FIFO_QUEUE_SELECT are not
queue. Properly rename them.

Change-Id: I553dfda6b5c24d7db1f81c7b2e093b69fbcf8ea9
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 2c85a1817e)
2019-05-16 19:19:54 +08:00
Liang Chen
b2dabd05ec nvmem: rockchip-efuse: add support for rk1808-efuse
This adds the necessary data for handling efuse on the rk1808.

Change-Id: I78b66db1fdc22430ab93b07ad3c7cea3355a7f6e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-05-13 18:04:42 +08:00
Liang Chen
78a3e8a729 dt-bindings: nvmem: rockchip-efuse: add description for RK1808 SoCs
Change-Id: I76c56b0c9709d849c87a059d7e67d67ae98ddbb5
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-05-13 18:04:36 +08:00
Liang Chen
2d697b2e8b nvmem: rockchip-efuse: add support for rk3128-efuse
This adds the necessary data for handling efuse on the rk3128.

Change-Id: Ieda973675ff959b3157bb4afe6e1dcdfac65506c
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-05-13 18:04:29 +08:00
Finley Xiao
eb0712d68f nvmem: rockchip-efuse: add support for rk3288 secure efuse
This adds the necessary data for handling secure efuse on the rk3288.
Need to use secure interface to access efuse when kernel is in no-secure
mode.

Change-Id: I1979f23ed8f85c9eb248de276b32adcbb165bd79
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-05-13 18:04:17 +08:00
Finley Xiao
6af4d023f1 nvmem: rockchip-efuse: add rk3368-efuse support
This adds the necessary data for handling efuse on the rk3368.
As efuse of rk3368 is secure, use secure interface to access efuse.

Change-Id: I72c29348b7744b232d75ab51c56dc7de0988c24e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-05-13 16:50:27 +08:00
Finley Xiao
7e4c7b49f2 nvmem: rockchip-efuse: Change initcall to subsys
We will add a avs driver to adjust opp's voltage according to leakage.
As it need register a notifier before cpufreq starts, and make cpufreq
defer probe is probably not really easy, so avs should probe earlier
than cpufreq, efuse should probe earlier than avs.

Change-Id: I817aa44c3b34d2fdf44148e6b9649ceed76d8f1f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-05-13 15:50:23 +08:00
Liang Chen
76b8d897c1 soc: rockchip: pvtm: fix wrong bit offset of ring sel for RK1808 SoCs
Change-Id: I476a9c77cf23b972eee6846e21eb1a3c6f263cca
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-05-13 15:40:05 +08:00
Elaine Zhang
ac7a2debf2 mfd: rk808: init CLK32KOUT func for rk818
Change-Id: I1e5c261233c08dcbae29a543029fe6455044b9a4
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-05-08 18:01:58 +08:00
Elaine Zhang
801f0b4f48 regulator: rk808: fix up the set voltage overshoot of Buck1/2
modify the rk808 max steps for increase voltage of Buck1/2,
equal 25mv.

Change-Id: Ic6c016e99ce67f5773d5f5df0b65fa1de10f557a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-05-08 18:01:58 +08:00
Elaine Zhang
be8fe08b78 clk: rockchip: pvtm : fix up the of_match_table cross-border access
fix up the error log:
[    2.901537] ==================================================================
[    2.901625] BUG: KASAN: global-out-of-bounds in __of_match_node.part.0+0x30/0xa0
[    2.901655] Read of size 1 at addr ffffff900934ae08 by task swapper/0/1
[    2.901693]
[    2.901727] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.20 #11
[    2.901766] Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT)
[    2.901817] Call trace:
[    2.901863]  dump_backtrace+0x0/0x250
[    2.901909]  show_stack+0x14/0x1c
[    2.901942]  dump_stack+0xf8/0x170
[    2.901998]  print_address_description+0x54/0x238
[    2.902049]  kasan_report+0x294/0x2bc
[    2.902099]  __asan_load1+0x24/0x50
[    2.902154]  __of_match_node.part.0+0x30/0xa0
[    2.902188]  of_match_node+0x38/0x5c
[    2.902240]  of_match_device+0x48/0x4c
[    2.902294]  platform_match+0x60/0xe8
[    2.902341]  __driver_attach+0x40/0x10c
[    2.902392]  bus_for_each_dev+0x10c/0x134
[    2.902424]  driver_attach+0x30/0x3c
[    2.902454]  bus_add_driver+0x238/0x28c
[    2.902503]  driver_register+0x140/0x188
[    2.902559]  __platform_driver_register+0x7c/0x88
[    2.902619]  rockchip_clock_pvtm_driver_init+0x18/0x20
[    2.902666]  do_one_initcall+0x14c/0x47c
[    2.902702]  kernel_init_freeable+0x5ec/0x60c
[    2.902752]  kernel_init+0x10/0x110
[    2.902801]  ret_from_fork+0x10/0x18
[    2.902841]
[    2.902863] The buggy address belongs to the variable:
[    2.902925]  rockchip_clock_pvtm_match+0xc8/0x2e0
[    2.902944]
[    2.902991] Memory state around the buggy address:
[    2.903028]  ffffff900934ad00: 00 00 00 07 fa fa fa fa 00 00 00 00 00 00 00 00
[    2.903073]  ffffff900934ad80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    2.903126] >ffffff900934ae00: 00 fa fa fa fa fa fa fa 00 02 fa fa fa fa fa fa
[    2.903167]                       ^
[    2.903197]  ffffff900934ae80: 00 05 fa fa fa fa fa fa 00 00 00 00 03 fa fa fa
[    2.903230]  ffffff900934af00: fa fa fa fa 00 00 03 fa fa fa fa fa 00 00 00 06
[    2.903266] ==================================================================

Change-Id: Ie2bc926da76dfbb14ca6e250d7fe57e842939f79
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-04-29 09:46:26 +08:00
Jon Lin
30c6c39d90 drivers: rkflash: support 4KB page size spi nand
1.support 4KB page size spi nand
2.add new spi nand: ATO25D1GA, XT26G02B, XT26G01B, HYF4GQ4UAACBE

Change-Id: I35f357ccec4d7977bbb10f2d647d1a2a1f8cedca
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-04-24 10:12:42 +08:00
Zain Wang
e75db4e1ef mfd: add driver for fusb302 Type-C PD
New driver only support DRP mode without swap function.
Swap function will be added in later.

Change-Id: I7e0c2c424def069d4be78c3bc8f704c3f7e5be48
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2019-04-22 17:15:51 +08:00
Tao Huang
da75c6afba printk: add support show process information on printks
Change-Id: I34cf76388ceb2e1f6b6417638c82bf774641ebac
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-04-19 12:00:55 +08:00
Tao Huang
4b1fe5cca9 ARM: rockchip: support CPU config
CACHE_L2X0/TWD/ARM_GLOBAL_TIMER are only available on Cortex-A9.
DW_APB_TIMER_OF only use on rk3066a.

Change-Id: Ied2f49b5d308e961ce5af72eb577aac23e3eb890
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-04-19 12:00:47 +08:00
Tao Huang
3eef0d794e ARM: decompressor: fix start of RAM alignment
256KB alignment is not work for (textofs & 0xf0000) > 0x40000.
Change to 1MB.

Change-Id: I9803b22d7d64a244842dcc811e47e214d247fc0c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-04-19 10:18:22 +08:00
Finley Xiao
dab2c42a76 nvmem: rockchip-otp: Add Rockchip OTP driver
Add simple read only driver for the OTP (One Time Programmable)
memory found on Rockchip SoCs.

Change-Id: I01c63dcacaf471ed7d06e0e8263a14e29af7fb0e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-18 19:36:47 +08:00
David Wu
eb743c6a7b pinctrl: rockchip: Add pinctrl support for rk3308b
The main description for rk3308b is as follows:
 - Old iomux multiplexing extension;
 - GRF_SOC_CON5 register add some bits;
 - Newly added GRF_SOC_CON13/15 register.

Change-Id: I94bfcae5387aceae14895f1cafa0bfea51bf8b63
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-04-18 19:30:06 +08:00
David Wu
046dbf0f28 pinctrl: rockchip: Add pinctrl support for rk3308
The most pins of rk3308 are 2bits iomux, but the banks's register
width is 0x8.

Change-Id: I3305810b3f75febd6ec7a933b65e3c9d50f003dd
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2019-04-18 19:23:31 +08:00
Finley Xiao
1aae5d1eed clk: rockchip: rk3308: Remove the reduplicative dclk_vop_frac
Fixes: 0ee785bb30 ("clk: rockchip: Add supprot to limit input rate for fractional divider")
Change-Id: Ifd387f4dd2cdddedda4cb65f36806260eb3e03ef
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-18 19:05:31 +08:00
Liang Chen
fa98363309 ARM: dts: rockchip: delete gpu 100MHz for rk3288
100MHz will hurt performance when app startup.

Change-Id: Ia55a5f53b101559b9d6b94ca98609f7072df6d86
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-04-12 11:38:50 +08:00
Sugar Zhang
600355f776 arm: dts: rockchip: add reset properties for i2s
Change-Id: I4c04448a7f1630aec0f0a6e32edbcf9e6669efcb
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2019-04-09 21:36:59 +08:00
William Wu
fda619f528 ARM: dts: rockchip: reconfig dwc2 device fifo size
According to the dwc2 programmer's guide v3.10a, in '2.1.3.2 Dedicated
FIFO Mode with No Thresholding', it suggested that:

Device RxFIFO =
- Scatter/Gather DMA mode:
(4 * number of control endpoints + 6) + ((largest USB packet used / 4) +
1 for status information) + (2 * number of OUT endpoints) + 1 for Global NAK

on rockchip platforms:
(4 * 1 + 6) + ((1024 / 4) + 1) + (2 * 6) + 1 = 280

- Slave or Buffer DMA mode:
(5 * number of control endpoints + 8) + ((largest USB packet used / 4) +
1 for status information) + (2 * number of OUT endpoints) + 1 for Global NAK

on rockchip platforms:
(5 * 1 + 8) + ((1024 / 4) + 1) + (2 * 6) + 1 = 283

Device IN Endpoint TxFIFO =
The TxFIFO must equal at least one MaxPacketSize (MPS).

In addition to RxFIFO and TxFIFOs, refer to dwc2 databook v3.10a,
'Figure 2-13 Device Mode FIFO Address Mapping and AHB FIFO Access Mapping
(Dedicated FIFO)', it required that when the device is operating in non
Scatter Gather Internal DMA mode, the last locations of the SPRAM are used
to store the DMAADDR values for each Endpoint (1 location per endpoint).

When the device is operating in Scatter Gather mode, then the last locations
of the SPRAM store the Base Descriptor address, Current Descriptor address,
Current Buffer address, and status quadlet information for each endpoint
direction (4 locations per Endpoint). If an Endpoint is bidirectional , then
4 locations will be used for IN, and another 4 for OUT).

Considering that the total FIFO size of dwc2 otg is 0x3cc (972),
and we must reserve (4 * 13) = 52 locations for all Endpoints.
So reconfig dwc2 device fifo size as follows:

Device RxFIFO = 280
Device IN Endpoint TxFIFO
- FIFO #0 = (64 / 4) = 16 (Assuming this is used for EP0)
- FIFO #1 = (1024/4) = 256 (Assuming this is used for Isochronous)
- FIFO #2 = (512/4) = 128
- FIFO #3 = (512/4) = 128
- FIFO #4 = (256/4) = 64
- FIFO #5 = (128/4) = 32
- FIFO #6 = (64/4) = 16

After reconfig the dwc2 device fifo size, test mtp write on rockchip
platform (PC -> rockchip platform) on rk312x/rk3326/px30/rk3288 evb,
when mask the 'vfs_write' in f_mtp.c, the writing data rate can be
increased from 16MBps ~ 20MBps to 30MBps ~ 36MBps on different kinds
of rockchip evbs.

Change-Id: Icdf8a5dd95f96d174233e4ffc765c9a982b9f0b6
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-04-09 21:36:40 +08:00
Finley Xiao
262535cf9a arm: dts: rockchip: Change cpu opp-microvolt form one entry to three
Single entry is for target voltage and three entries are for
<target min max> voltages. Change cpu opp-microvolt form one entry to
three entries and set maximum acceptable voltage to a high value so that
regulator device can supply multiple consumers at the same time.

Fixes: 16e9353f89 ("arm: dts: rockchip: Change cpu opp-microvolt form one entry to three")

Change-Id: I96e5f87f2945e63e8f4a073fa0292f001830b13c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-09 21:36:33 +08:00
Finley Xiao
f60efb2e82 arm: dts: rk3066a-rayeager: Enable cpu and gpu opp table
Change-Id: I7c4a6ce9d9ba81e37a05462ccfc34dd4697492d7
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-09 21:35:17 +08:00
Finley Xiao
79747ecfb6 clk: rockchip: rk3066a: Rename i2s hclk id
Change-Id: I0a5ccf1846950353ea6fc6980c1c4a4fb3457fd1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-09 21:35:09 +08:00
Finley Xiao
b1e59714a2 arm: dts: rk3066a: Add operating-points-v2 property for cpu
This patch adds a new opp table for cpu.

Change-Id: I236fd158efc404c3d3611e3e7d1860cdf534aa57
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-09 21:34:51 +08:00
Zhen Chen
c7b8b6accf ARM: dts: rockchip: rk3066a: correct and add settings of gpu node
Change-Id: I969ced5b48b470868558f19088b8413e1fb99226
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2019-04-09 21:34:43 +08:00
David Wu
96ec48da98 ARM: dts: rk3066a-rayeager: Make hdmi regulator always on
Change-Id: I9bca56928f6f9c12579107f430f8cd0eedd69665
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-04-09 21:34:36 +08:00
David Wu
5b83a341fd ARM: dts: rk3066a-rayeager: Enable vop0 at dts level
Change-Id: Ie3fe65d6d4d59b24a5fa22772e39496914bb0f13
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-04-09 21:34:29 +08:00
Sugar Zhang
5d060ef316 ARM: dts: rk3066-rayeager: add support for hdmi audio
Change-Id: Idc15040a95a97584117f2f229063b7b404ab2268
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2019-04-09 21:34:21 +08:00
Zheng Yang
8498c39168 ARM: dts: rockchip: rk3066a: add HDMI nodes
Change-Id: Ic8d7731c445ff1ea8fd607c1f9984ce4672833b3
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-04-09 21:34:13 +08:00
Joseph Chen
d4312deed5 ARM: dts: rk3066a-rayeager: add vdd_logic regulator
The vdd_logic is a pwm regulator. Since '#pwm-cells = <2>', there
is not polarity invert support by pwm driver, so we have to add
property 'pwm-dutycycle-range = <100 0>' to support polarity invert
by pwm regulator driver itself.

Change-Id: Ie5d2cda67ce19dc792f96263836bab658d385681
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 21:34:06 +08:00
Finley Xiao
e01e0aead2 clk: rockchip: rk3066a: Add some clock IDs
Change-Id: I57f948a425936e0f69b63e7ded86c8d2cdf84148
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-04-09 21:33:41 +08:00
Chris Zhong
a566b29fe6 ARM: dts: rk3066a-rayeager: add supports- for mmc
Add supports-emmc for emmc; supports-sd for sdcard; supports-sdio for
wifi.

Change-Id: I13d3918f41f63ed9b27e9969e6f89d1006c9d45c
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2019-04-09 21:26:06 +08:00
Jacob Chen
8fa7f79317 ARM: dts: rockchip: add ums boot mode for Linux
Change-Id: I7f5edb9edbe5b9656fafdfb84f523aa45aa93d93
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2019-04-09 21:25:30 +08:00
Chris Zhong
c9c979e20a ARM: dts: rk3066a-rayeager: bring up wifi
Change-Id: Iffcf4970fdd5bf1976860a9be695452a748bdc2a
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2019-04-09 21:24:46 +08:00
Chris Zhong
541782c78b ARM: dts: rockchip: add nandc node for rk3066a/rk3188
Change-Id: I496f76e9aef91f35c2b7fde285b67add7d5f90ae
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2019-04-09 21:23:30 +08:00
Mark Yao
33ed95fc92 ARM: dts: rk3066a-rayeager: enable gpu function
Change-Id: Ib4fe4770129eacfd7d6f1d6434f065aeb3123d5c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-04-09 21:19:07 +08:00
Mark Yao
240a97ba6f ARM: dts: rockchip: rk3066a: add mali gpu node
Change-Id: I193269edc32fc40d825f69820f77a96c5d06084c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-04-09 21:19:01 +08:00
Mark Yao
ee4bace69f ARM: dts: rockchip: rk3066a: add vop display nodes
Change-Id: I060e02d8dc053c93ff964525cf1643eed3ed0059
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-04-09 21:18:56 +08:00
Finley Xiao
12d7a1addf ARM: dts: rockchip: rk3066a: Add assigned-clocks for cru
Change-Id: I82713524f754b05b8f53921bc4730a10163963be
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-09 21:18:49 +08:00
Mark Yao
2464d45ed3 ARM: dts: rockchip: add emac phy-reset for rk3066a-rayeager
Change-Id: I0fb2dfa7c6772189b24fe651ca01511509ff1e87
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-04-09 21:18:39 +08:00
David Wu
7af9a5b91d ARM: dts: Add bootargs for rk3036-kylin
Add console and UUID in the bootargs.

Change-Id: I69827656752725ac9a0d39d36833f23bf36cab28
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-04-09 21:14:30 +08:00
Randy Li
8537a2400c ARM: dts: rockchip: add serial Flash controller to rk3036
Serial Flash controller is used to control the data
transfer between this SoC and a serial nor or nand
flash device.

Change-Id: Ibe7c8c4a11410287c34c1a7dc5b232b330ee6751
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2019-04-09 21:14:20 +08:00
Elaine Zhang
42a89e1767 ARM: dts: rk3036: mark xin32k clk as fixed clk
Change-Id: I5bf0a64502a7dd7b36545437b1675bb896c97bce
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-04-09 21:14:12 +08:00
Finley Xiao
30d8dfd2f6 ARM: dts: rockchip: rk3036: Add vpu qos node
The vpu qos registers need to save and restore when reset.

Change-Id: I649cf4a360842ad1abb06c35a6fd8d3868fbf706
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-04-09 21:13:01 +08:00
Caesar Wang
76f7a63950 ARM: dts: rockchip: update rk808's regulators for rk3036 kylin
According to the actual schematic designed by kylin board, update and
rename the regulators for rk808 node information.

Especially gpu regulator voltage, the schematic didn't have this
regulator, this regulaor should be applied by cpu regulator since the
cpu/gpu/ddr are belong to the same logic power supply.

Change-Id: I39e4cf18969391da396cc775f8660701e42977bd
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2019-04-09 21:12:54 +08:00