When RK3399 work as a host connect to RK1808 work as a ep:
1. RK3399 pcie DO NOT enter L2 state when suspend, because RK1808 won't
send the ACK.
2. Hand the link operation to userspace when RK3399 resume
3. Before RK1808 suspend or reboot, RK3399 do following first to break
the link:
echo 0x2 > sys/devices/platform/f8000000.pcie/pcie_reset_ep
4. After RK1808 resumed or booted, RK3399 do following to restart
the link:
echo 0x1 > sys/devices/platform/f8000000.pcie/pcie_reset_ep
Change-Id: Idc94ab4d2f123744c80ad34a57e1036fec9c53f2
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Signed-off-by: Simon Xue <xxm@rock-chips.com>
When switching from another color to yuv422, neither
encoder input color nor encoder output color is rgb.
CSC coeff will be incorrectly selected as
csc_coeff_full_to_limited, which causes the display
turn to green. To solve this problem, choose
csc_coeff_full_to_limited only if the input and output
colors are both RGB.
Change-Id: I080e18eb8fcca975cd0e6c46d2ed9e7513a26609
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
We need to dynamically resize the TxFIFOs for some cases
where the default values don't match.
Test on RK1808-stick board, configurate the usb with four
functions "rndis, ntb, mass_storage, acm", the default
values of TxFIFOs is:
GTXFIFOSIZ(0) = 0x00000042
GTXFIFOSIZ(1) = 0x00420184
GTXFIFOSIZ(2) = 0x01c60184
GTXFIFOSIZ(3) = 0x034a0184
GTXFIFOSIZ(4) = 0x04ce0184
GTXFIFOSIZ(5) = 0x06520184
GTXFIFOSIZ(6) = 0x07d6002a
The ep6-in is used for acm ep-in which maxpacket is 1024B,
but the default fifo size of ep6-in is only 336B, less than
the length of the ep maxpacket, it cause acm works abnormally.
This patch creates a simple function to allocate enough TxFIFO
space for each of the enabled endpoints.
Change-Id: I389ffdba4f3721ed6ef192f0c85f41fdeff645ce
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch adds a new property "snps,tx-fifo-resize" to
enable resize the TxFIFOs dynamically.
Change-Id: I0714b8a5b3a7f461ae0527c99729db8cf202e066
Signed-off-by: William Wu <william.wu@rock-chips.com>
RK1808 have 8 uart ports, so increase max uart number to 8.
Change-Id: I01dcf83d5f98e57523f6f61049f5fbb7a8a62639
Signed-off-by: Lin Huang <hl@rock-chips.com>
The early (RK_EXCAVATOR_MAIN_V10_20160627) v10 board had some hardware
issues, for example, pwm regulator even a small miscalculation by hardware
and the emmc can't work on hs400 mode. But there still have someone used
the old v10 boards on their hands.
Anyway, that should support the old v10 board with this patch.
Change-Id: If80d890ba713b8dc2893aba406a75af18c0fea03
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
A message can be forged to crash the stack; here we make sure we don't
completely break the system if this occurs
Change-Id: Id5ae7509c7d629c62ce5fe567c551a1e424e0bf3
Signed-off-by: Michel Pollet <michel.pollet@bp.renesas.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 1ca532e991)
The early used the fb for display, the new drm display can't callback
the suspend to resume function in gsl3673 driver.
Change-Id: I36c7d89edaf4052e614c5a354f7a0a12c9c4275a
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
The Linux SDK have a common issue with rk809/rk805/rk817..etc, the
regulator can't be disabled during suspending since the linux config
hadn't enable the CONFIG_PINCTRL_RK805 pinctrl for PMIC.
This config include the rk805/rk809/rk809..pinctrl to control for
pmic. So the related config need be enabled by default.
Change-Id: I284976df9d9d95d8a0104ba96a27464883c8b8e1
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
This adds support to get simple_ondemand governor data from devicetree.
Change-Id: Ic897ad6227152c4ce695d6cee8085b4d303339bf
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
The recommended max voltage of vdd_npu is 0.88V in the datasheet.
Change-Id: I9713810692c5d32b8c41b0b0e0d02405c01dd0b7
Signed-off-by: Liang Chen <cl@rock-chips.com>
The recommended max voltage of vdd_npu is 0.88V in the datasheet.
Change-Id: Id29b97b82ea35f3db03140ebdd8bab85e3f375df
Signed-off-by: Liang Chen <cl@rock-chips.com>
There is an obvious mistake defined on rk3399pro linux.
Change-Id: I89c5589175fa5c8b712d856647442e96330bc669
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
AFAWK, there are four layers in RK3399's VOPB, and two layers for
RK3399's VOPL.
And RK3399's VOBL has the win0 and win2 layers, the formats they support
as below.
win0:
XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV16 NV24 NA12 NA16 NA24
win2:
XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16
So only win0 layer supports NV12 format (for video decode format),
adjust the overlay for video and primary layer for display.
It didn't care this case if some platforms had handled the display in
application (e.g android), then on the Linux platform, it's hard to handle
the all kinds of cases in Display application, perhaps the linux needn't
this patch fixes it in the future.
Depend-CL:76144
Fixes: d82f1d3e58
("arm64: dts: rockchip: reasonable alllcation of VOP on rk3399 linux")
Change-Id: Id93b315b6e3ae670bf5ea4dc0a64e140c6e37e80
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
The zpos currently configure is the order in vop_win_data array,
which is related to the actual hardware plane.
But in the Linux platform, such as video hardware and camera preview,
it can only be played on the nv12 plane.
So set the order of zpos to PRIMARY < OVERLAY (if have) < CURSOR (if have).
Change-Id: Ia9ab3cb9225fd2c385703109afbfbb42a1564110
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Some times, we need to enable/disable ADC grps or DAC
directly to debug.
Change-Id: I53b9fa94733d84f7101e299d3fcb6f9160e36112
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
In general, the kernel dts hadn't defined the rockchip_suspend parameters.
The ARM Trusted Firmware (ATF) had a configure been used by default.
As far, the rockchip_suspend can be configured in kernel when someone need
configure it by themselevs.
Change-Id: Id1b4b79609c3ce345aad946e07105d96f62c04f8
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
for multi camera board, connect npu by pcie,
depend on rockchip,dma_trx_enabled = <1> on dts
Change-Id: I244fdeddd0e64ab35bdb5a63655a3216292bbf34
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
The "OTG wakelock" should be destroyed if otg port was initialized
failed, in case of its memory allocate for other module and the
"wakeup_sources" list would be broken.
Change-Id: Ic478e7297e36def8e105a0736beb86c99ca6261d
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
For the 'otg-mux' irq in SoC should include 'otg-bvalid', 'linestate',
and 'otg-id'. This change fix the previous error condition.
Change-Id: I8fe46c8c9efd6ce04eead89c276227d4cc70902e
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
The pins from GPIO2B0 to GPIO2B6 are located at GRF_GPIO2BL_IOMUX,
they are recalculated to get correct iomux.
Change-Id: I1e46697c4508c396b5e8140c32c4185925a040ea
Signed-off-by: David Wu <david.wu@rock-chips.com>
If there is no codec instance or headphone jack, we
should not request headphone jack from machine driver.
Change-Id: If05ac2f4bbfd3fc495a75c0701a44a325e5010cd
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Some of the RK3399 sapphire excavator boards have a
suspend/resume issue with the following error log:
dpm_run_callback(): usb_dev_suspend+0x0/0x30 returns -16
PM: Device usb6 failed to suspend async: error -16
PM: Some devices failed to suspend, or early wake event detected
If this error happens, the USB port can't recognize
any USB device with the failed log:
usb usb5-port1: connect-debounce failed
It's because that the Type-A USB3 port which belongs
to fe900000.dwc3 is in abnormal state. We can check
the link state easily via the debug node:
cat /sys/kernel/debug/fe900000.dwc3/link_state
The normal link state is Rx.Detect if no USB device plug
in. But after resume, the link state will change to Polling.
According to the USB 3.1 Spec, the link state can change
from Rx.Detect to Polling state if the USB3 PHY detect
the far end receiver termination. From that we infer that
the USB3 PHY affects the USB3 controller link state since
the USB3 PHY is in power on state when enter suspend.
Actually, it's a common problem if the DWC3 work as Host
mode in the following cases, and it only happens if system
enter suspend/resume without any USB device conneted.
Case1. Type-A USB 3.0 interface with dr_mode = "host";
Case2. Type-A USB 3.0 interface with dr_mode = "otg",
and set DWC3 to host mode via "dwc3_mode";
Case3. Type-C USB 3.0 interface with dr_mode = "host";
Case4. Type-C USB 3.0 interface with dr_mode = "otg",
and plug in Type-C to Host cable;
Case5. Type-C USB 3.0 interface with dr_mode = "otg",
and set DWC3 to host mode via "dwc3_mode";
This patch power off the USB3 PHY if no USB device connect
with the DWC3 Host port before enter suspend, and power on
the USB3 PHY again upon resum.
Fixes: 323ccc3640 ("usb: dwc3: rockchip: fix rk3399 dwc3 host power on fail")
Change-Id: Ifd7805e1f4accb281dd047445d97f4cc954eb5ac
Signed-off-by: William Wu <william.wu@rock-chips.com>
Some i2s bus GPIOs maybe designed multiplex, the default
is input, we need to configure IN/OUT dynamically.
Change-Id: I2e0f0f972d6f9fa3fc8e8fc9f5dfd5d4e6deaee1
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>