The dwc3 controller gets clocks from the pipe_clk(125MHz),
utmi_clk(30MHz) and aclk(300MHz). It requires to wait several
clock cycles for the reset controller operation done. The
minimum clock is utmi_clk 30MHz, and suppose that 10 clock
cycles are required, it's about 0.33us. So delay 1us is enough.
Change-Id: I6980b92249356efc20c1f537aa3c83f91561cdd4
Signed-off-by: William Wu <william.wu@rock-chips.com>
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. Fix up the 20+ ms delays here passing the adjusted
"min" value to msleep().
Change-Id: Ideb6798d3a9465b64dee5aaf78a73054474dd017
Signed-off-by: William Wu <william.wu@rock-chips.com>
we cannot do vpu_reset when translate address. that
is the only situation we need to protect. so remove
extra reset_lock place.
Change-Id: Ibb23909788e9a3c7ef1c455cdeacdf6c964a5868
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
This is because set_fmt ops maybe called when PD is off,
and in such case, regmap_ops will lead system hang.
enale PD before doing regmap_ops.
Change-Id: Iafa18acb59995ad86885a8d6a6f5f49a7d233962
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
The commit 62b2a34a21 ("uvcvideo: add quirk for devices
with broken auto suspend") introduced quirk to workaround
an issue with some HD Cameras.
There is one more model that has the same issue - idProduct
=0x9320, so applying the same quirk as well.
Change-Id: I24e3fc1746a9d21d529bc91f52fd5822e998bd93
Signed-off-by: William Wu <william.wu@rock-chips.com>
The pl330 irq may come after terminal chan, and desc is
set null. It can't be avoided by disabling irq, because
other chans use the common irq. If the chan is terminaled,
we needn't call its callback or restart it.
Change-Id: I73201eaa4dbdd09c765129f9f3f41573c73faf73
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
This is because set_fmt ops maybe called when PD is off,
and in such case, regmap_ops will lead system hang.
enale PD before doing regmap_ops.
Change-Id: I86c04679c22e4763fd2539f88371ad1d33951723
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
In order to prevent aliasing attacks on the branch predictor,
invalidate the BTB on CPUs that are known to be affected when taking
a prefetch abort on a address that is outside of a user task limit.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git kpti
commit a07373c8c365746583f25f49fee41b1bc0ff94b2)
CVE-2017-5715
Change-Id: I6b0db5fbf1d495b03560b665dca37c2834d6f3a9
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
In order to avoid aliasing attacks against the branch predictor,
some implementations require to invalidate the BTB when switching
from one user context to another.
For this, we reuse the existing implementation for Cortex-A8, and
apply it to A9, A12 and A17.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git kpti
commit efcd0e857a656bbd1c1da15ff984ad6402332c61)
CVE-2017-5715
Change-Id: Ica839802de678a5456abadf09bb6434efd43da2c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Add constants and callback functions for the dwmac on px30 soc.
The base structure is the same, but registers and the bits in
them moved slightly, and add the clk_mac_speed for the select
of mac speed.
Change-Id: If1aeb2fbafb70a8cb68f9d26a97c5b2a46dcb90f
Signed-off-by: David Wu <david.wu@rock-chips.com>
The default value of the max_transfer_size is only 65535,
but according to the field of PktSizeWidth in GHWCFG3, the
otg controller on rockchip platforms can support max 512KB
transfer size. So we increase the otg max_transfer_size to
128KB, it can help to avoid dividing into two hardware
transmissions if the usb device class driver(e.g. f_mtp.c)
request to transfer more than 65535 Bytes data in a single
usb request.
Change-Id: Ic281965815e48e4a146a13f9d37f88a10ee0d33e
Signed-off-by: William Wu <william.wu@rock-chips.com>
If there is more data in the request than we could fit into
a single hardware request, then check both of the following
conditions:
- ep->dwc_ep.xfer_len < ep->dwc_ep.total_len;
- deptsiz.b.xfersize == 0;
If ep->dwc_ep.xfer_len < ep->dwc_ep.total_len and deptsiz.b.xfersize
isn't zero, it means that we have received a short packet from
host, then we shouldn't setup transfer for next portion of
data.
This patch can fix the following issue:
Use MTP to transfer more than 4GB single file from PC to RK3368
tablet base on the follow conditions:
- Increase the default Tx/Rx buf size to 64K or more in f_mtp.c
- Set the core_params->max_transfer_size to 65535;
Without this patch, it will fail to transfer the file at the end
because the f_mtp driver is waiting for a short packet to signal
EOF for file sizes > 4 gig, but the dwc2 driver doesn't handle
the short packet.
Change-Id: I172d48d727da4b75153705ce6b60728203dd35ca
Signed-off-by: William Wu <william.wu@rock-chips.com>