RV1126 PMU supports to enable USB interrupt as wakeup
source, include USB PHY irqs from OTG port and Host port.
In additionally, it needs to enable Host port wakeup in
GRF_SOC_CON0.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ia4d2b868a42afb9fe35d444d5df557c3b6c12b37
* Add SRAM memory allocation and manager support
* Improve job submit stability
* Add reset and mm node for debugging
Signed-off-by: Felix Zeng <felix.zeng@rock-chips.com>
Change-Id: Iab0fc924e9289f37b9d209ceb0f8fd6c60f3e8fa
make ARCH=arm64 rockchip_linux_defconfig rk3568j.config
make ARCH=arm64 rk3568j-core-ddr4-v10.img -j8
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: If728fe50328ab3aa098bb770bd5eaa42134d1d81
The xHCI specification 1.1 does not require xHCI-compliant
controllers to always enable hardware USB2 LPM. However,
the current xHCI driver always enable it when seeing HLC=1.
On rk3566 platforms, the xHCI USB2 LPM is enabled by default.
And we found that a lot of USB Disks have USB2 HW LPM broken
issue when connected to rk3566 USB2 OTG interface.
Here are a part of special USB Disks with USB2 HW LPM broken:
1. idVendor=325d, idProduct=6410, Manufacturer: aigo
2. idVendor=21c4, idProduct=0cd1, Manufacturer: Lexar
3. idVendor=0951, idProduct=1666, Manufacturer: Kingston
When use dd command to write to these USB Disks, it may fail
with the following log:
[ 2844.700148] usb 7-1: reset high-speed USB device number 4 using xhci-hcd
[ 2889.072272] usb 7-1: reset high-speed USB device number 4 using xhci-hcd
[ 2921.498045] usb 7-1: reset high-speed USB device number 4 using xhci-hcd
......
[ 2953.923773] usb 7-1: reset high-speed USB device number 4 using xhci-hcd
Theoretically, we can add USB_QUIRK_NO_LPM individually for
these special USB Disks, however, it's diffcult to cover all
USB Disks. So it's better to disable the USB2 LPM for xHCI
on rk3566 platforms.
Change-Id: I2c180b68f41a4d25a4c860c32550f3a406eb2028
Signed-off-by: William Wu <william.wu@rock-chips.com>
f_hid provides the OUT Endpoint as only way for receiving reports
from the host. SETUP/SET_REPORT method is not supported, and this causes
a number of compatibility problems with various host drivers, especially
in the case of keyboard emulation using f_hid.
- Some hosts do not support the OUT Endpoint and ignore it,
so it becomes impossible for the gadget to receive a report
from the host. In the case of a keyboard, the gadget loses
the ability to receive the status of the LEDs.
- Some BIOSes/UEFIs can't work with HID devices with the OUT Endpoint
at all. This may be due to their bugs or incomplete implementation
of the HID standard.
For example, absolutely all Apple UEFIs can't handle the OUT Endpoint
if it goes after IN Endpoint in the descriptor and require the reverse
order (OUT, IN) which is a violation of the standard.
Other hosts either do not initialize gadgets with a descriptor
containing the OUT Endpoint completely (like some HP and DELL BIOSes
and embedded firmwares like on KVM switches), or initialize them,
but will not poll the IN Endpoint.
This patch adds configfs option no_out_endpoint=1 to disable
the OUT Endpoint and allows f_hid to receive reports from the host
via SETUP/SET_REPORT.
Previously, there was such a feature in f_hid, but it was replaced
by the OUT Endpoint [1] in the commit 99c5150058 ("usb: gadget: hidg:
register OUT INT endpoint for SET_REPORT"). So this patch actually
returns the removed functionality while making it optional.
For backward compatibility reasons, the OUT Endpoint mode remains
the default behaviour.
- The OUT Endpoint mode provides the report queue and reduces
USB overhead (eliminating SETUP routine) on transmitting a report
from the host.
- If the SETUP/SET_REPORT mode is used, there is no report queue,
so the userspace will only read last report. For classic HID devices
like keyboards this is not a problem, since it's intended to transmit
the status of the LEDs and only the last report is important.
This mode provides better compatibility with strange and buggy
host drivers.
Both modes passed USBCV tests. Checking with the USB protocol analyzer
also confirmed that everything is working as it should and the new mode
ensures operability in all of the described cases.
Link: https://www.spinics.net/lists/linux-usb/msg65494.html [1]
Change-Id: I5cd93f642e5696a84e58afc63aaaaf8e27c7d514
Reviewed-by: Maciej Żenczykowski <zenczykowski@gmail.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Maxim Devaev <mdevaev@gmail.com>
Link: https://lore.kernel.org/r/20210821134004.363217-1-mdevaev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit d7428bc26f)
add rkispp-subdev pad2:Source set format API to support fec
crop output size by mesh size.
Change-Id: I8857547d1dc07ff033a50b1dc7bc2079a9221b12
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
Fix the following smatch warnings:
rockchip_drm_vop2.c:2892 rk3568_crtc_load_lut() warn: we tested 'vp->gamma_lut_active' before and it was 'true'
rockchip_drm_vop2.c:6995 vop2_setup_hdr10() warn: we tested 'vp->hdr_out' before and it was 'true'
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I239658d19924b12843efdee8edf89962df1dae0b
We have the same LAYER_SEL&PORT_SEL register conflicts
issue as rk356x.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I68bf32499b04bba5b0089df2bb473673d9804b90
We notice there are many POST_BUF_EMPTY irq when user space
enable a video port but without any attached plane.
Setup dly in this situation can avoid the POST_BUF_EMPTY
irq storm.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I907eb1737ac134dda8b2d237584c9d2f2b917b5e
This patch fix following two cases dwc2 resume does not recognize
peripherals.
1. plug in device after system suspend, then press the power-on
button to wake up,at this time the dr_mode is OTG, op_state is
still Peripheral, the Bit[0] of GINTSTS is 1 and the port power
is off, dwc2 will not resume at this time.
2. plug in device then press the power-on button to put the system
to sleep, then we press the power-on button to wake up the system,
At this time, the dr_mode is OTG, op_state is still Host, the Bit[0]
of GINTSTS is 1, dwc2 will not resume and working abnormally.
To resolve the first exception, we should call the dwc2_hsotg_resume()
directly to resume dwc2. To resolve the second exception, if the dwc2
is lost power during suspend like RK3326S platform, wo should reinit
the core to device mode, and after do dwc2_hsotg_resume, it can trigger
the ID status change interrupt if the OTG cable is still connect. Then
we can init it for host mode in the ID status change interrupt handler.
We can use the power on bit of Hprt register to distinguish whether
it is lost power during suspend.
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Change-Id: I7cd09bce993dcee8e5bfcaddd5fe884cdfab6b52
Use IS_ERR() instead of checking for a NULL pointer when calling for
drm_atomic_helper_duplicate_state() failures.
drm_atomic_helper_duplicate_state() return an ERR_PTR()-encoded error
code on failure.
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I95388698239a7e1bd2bfbedd2bd921bbf52372f0
Linux app always use the default zpos, and they thought:
Primary plane zpos < overlay plane zpos < cursor plane zpos.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I5d10be4c4a6463248a80fb2e3f6ff27e8b3cc414
cluster mix config followed cluster, so we move mix register from
vop_ctrl to cluster_regs is more suitable.
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I28d80ce9e902992870b9876296af3daa2f5add65
some product will use gpio to instead of TE, so we add soft TE for all
vp.
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Idb2d8b6a63c17308519761ae986f853b2baf0bc4
The fifo depth of RK356X/RK3588 writeback is 1920x4/16.
A fifo_throd larger than this value will cause a empty(zero)
writeback.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Id67209f7b162608dcba191ab23cf6eec11e3fc08
Solve the problem that LRCK level amplitude is not enough
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: Id79df3de70cd525e1d5425d4177d774a514c45da
enable kernel config for docker
make ARCH=arm64 rockchip_linux_defconfig rockchip_linux_docker.config
Signed-off-by: Jianlong Wang <jianlong.wang@rock-chips.com>
Change-Id: Idf52c56a30d6918ea12fb985c14dacccfaeb2583
drivers/video/rockchip/rga3/rga_drv.c:1068:1: warning: label 'failed' defined but not used [-Wunused-label]
MODPOST vmlinux.o
drivers/video/rockchip/rga3/rga_job.o: In function `rga_job_run':
drivers/video/rockchip/rga3/rga_job.c:364: undefined reference to `rga_power_enable'
drivers/video/rockchip/rga3/rga_job.c:403: undefined reference to `rga_power_disable'
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ie8633a6c74b3e684714e7ea71dab7c34a4221071
make ARCH=arm64 rockchip_linux_defconfig rk3568j.config
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I00332f2f73741b3cf8cec2c7ab0a660ab7cd324a
move monitor param to rkcif node
ag &rkcif {
status = "okay";
rockchip,cif-monitor = <3 200 1000 5 0>;
/*
* index 0: monitor mode
* val: 0 idle
* 1 Continue mode, detect cut of stream or csi2 err
* 2 trigger mode, detect csi2 err
* 3 Hotplug, detect hot plug or cut off stream or csi2 err
* index 1: monitor cycle
* val: timer of monitor cycle, unit ms
* index 2: error interval
* val: time of error keeping, such as 1000,
* mean atfer one second error still occur,force reset dev,
* the max timer to wait error stop
* index 3: err_ref_cnt:
* val: timer error ref val for reset
* index 4: reset_by_user
* val: set val 1 to control reset by user
*/
};
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: If4da872c7ee3c5140f94e5cf331cab84005361d2
struct sg_table is a common structure used for describing a memory
buffer. It consists of a scatterlist with memory pages and DMA addresses
(sgl entry), as well as the number of scatterlist entries: CPU pages
(orig_nents entry) and DMA mapped pages (nents entry).
It turned out that it was a common mistake to misuse nents and orig_nents
entries, calling the scatterlist iterating functions with a wrong number
of the entries.
To avoid such issues, lets introduce a common wrappers operating directly
on the struct sg_table objects, which take care of the proper use of
the nents and orig_nents entries.
While touching this, lets clarify some ambiguities in the comments for
the existing for_each helpers.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
(cherry picked from commit 709d6d73c7)
Change-Id: I62f0a356857420927f11e46ac9f9156e891b4d22
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
soft reset works on SCLK, which come from external device
when controller work as slave mode.
When SCLK disabled before reset done, the controller stalled
and can not recovery.
Instead, we do global reset for this issue.
Change-Id: If801aa03a01d42386f7cfa6145cd6d0af7a3b041
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>