set the regulator named "vcc_wl" stay on in suspend.
Change-Id: I6d21b8904a6367938a386df8e905ede62f4069a8
Signed-off-by: JinSen Chen <kevin.chen@rock-chips.com>
Limit the max size of aligned buffer to 64K. Because
64K buffer is enough for most of usb transfers, and
the aligned buffer is a coherent DMA buffer allocated
by dma_alloc_coherent, too large buffer may cause
coherent DMA memory allocation failure on some platforms.
Change-Id: Ib4895349be93d7a298f5cd08c609f1a8a81d2610
Signed-off-by: William Wu <william.wu@rock-chips.com>
If dst buf not 4k align vir address, mmu page may calculate error.
This situation will cause rga hardware not respond, cannot return irq_handle.
Change-Id: I29a104984415b6736713073684c2551252c975b9
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
case 1:
plug in hdmi and power on, after kernel complete and before android
start(maybe can update simplification boot.img) we plug out hdmi will
appear error log.
case 2:
plug in hdmi and power on, at the beginning of drm driver bind, plug out
hdmi, the hdmi irq maybe at disable state, so the vop is in running
state which is set at uboot. in this case vop will not to enable clk
refrerence, after driver probe complete, the unused clk maybe close by
clk driver framework. this will lead to vop appear error log:
[ 4.898107] rockchip-vop ff370000.vop: [drm:vop_crtc_enable] Update mode to 720*288
[ 4.900174] rockchip-vop ff370000.vop: [drm:vop_isr] *ERROR*BUS_ERROR irq err
solution:
1. disable vop all planes before disable crtc and enable crtc;
2. disable vop all planes when can't detect connect at power on.
3. enable dma stop before detach iommu and disable dma stop after attach
iommu.
Change-Id: Ia981d52c96a274fa177493d10362fd4e395a6707
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Detached may occurred at swap operations. Don't ignore
the EVENT_CC during swapping at all, check the connection
after it.
Change-Id: I2c69c8e2a026e3524ee390e25db3bdf84dad7bdb
Signed-off-by: zain wang <wzz@rock-chips.com>
Power role compatible can configure the typec power role,
and we can enable try.role function as well, that can
change the power role to our wanted if possible.
Change-Id: I85a3c4d0c5a54b37573f5fb24fe107d88f385021
Signed-off-by: zain wang <wzz@rock-chips.com>
Sometimes we may prefer our port would be specified power
role when the both attaching port are DRP port. We can
enable this function in dts file, such as:
fusb302,role = "ROLE_MODE_DRP";
fusb302,try_role = "ROLE_MODE_DFP";
It would change the port power role to your wanted
if possible.
Change-Id: Id71595fa10c5c55755ac6b2965c3f14f593c2493
Signed-off-by: zain wang <wzz@rock-chips.com>
This patch set a frame for DR_SWAP, and it only support UFP to DFP,
because there are many works to coordinate USB part and PD part when
change DFP to UFP.
Change-Id: Iebcccdcd9115c5be4704e6e8e0dc0b568a4ac48d
Signed-off-by: zain wang <wzz@rock-chips.com>
If you set your port to DFP(UFP), the port would only detect
UFP(DFP) device. If you want your port to detect both UFP and DFP,
set it to DRP in dts.
Change-Id: I1b8dc46bd3538094a01ee3376bf019113622fcca
Signed-off-by: zain wang <wzz@rock-chips.com>
Exclude rk3308-evb-ext-v10.dtsi from rk3308 evb boards, that it's only
used for IP functional verification.
Change-Id: Ic679da54e16134e6326b50fd7de4fbafab57ac8f
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This patch supports fusb302 to do data role swap for
Type-C Dongle with PD adapter.
The test case is:
- Use a Type-C Dongle (PD adapter & USB & HDMI)
- Plug a PD adapter into Type-C Dongle first, then
connect the Dongle with RK3399 Type-C0 port.
- Check if Type-C Dongle can fetch 5V with the following log:
"fusb302 4-0022: PD connected as UFP, fetching 5V"
- Wait for the data role swap completion (hundreds of
milliseconds), then check if the Type-C USB can work
in DFP mode.
Without this patch, the DWC3 can't switch to DFP mode
after the data role swap completion. It's because that
when the fusb302 do data role swap, it only sends extcon
notifier with EXTCON_USB true or EXTCON_USB_HOST true.
Generally, the sequence of the extcon notifier sent from
fusb302 is:
- send "EXTCON_USB = true" and "EXTCON_USB_HOST=false"
to DWC3 driver, then DWC3 switch to UFP, and set the
connected flag to true.
- After swap completion, send "EXTCON_USB = false" and
"EXTCON_USB_HOST = true" to DWC3 driver. Because the
connected flag is true, the DWC3 is unable to switch
to DFP mode.
This patch forces DWC3 to do disconnection if it detects
the connected flag is true and the DWC3 mode is UFP.
Change-Id: I470187823708e6fb8bb8869bca3b475850a8c2e7
Signed-off-by: William Wu <william.wu@rock-chips.com>
Pickup the fix for handling unresolved phandles in overlays.
This adds the following commits from upstream:
c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
48c91c08bcfa libfdt: add stringlist functions to linker script
Change-Id: I81a0cc9a936f8d1da810460ea5df4472fa27dd5c
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e45fe7f788)
This adds the following commits from upstream:
b1a60033c110 tests: Add a test for overlays syntactic sugar
737b2df39cc8 overlay: Add syntactic sugar version of overlays
497432fd2131 checks: Use proper format modifier for size_t
22a65c5331c2 dtc: Bump version to v1.4.5
c575d8059fff Add fdtoverlay to .gitignore
b6a6f9490d19 fdtoverlay: Sanity check blob size
8c1eb1526d2d pylibfdt: Use Python2 explicitly
ee3d26f6960b checks: add interrupts property check
c1e7738988f5 checks: add gpio binding properties check
b3bbac02d5e3 checks: add phandle with arg property checks
fe50bd1ecc1d fdtget: Split out cell list display into a new function
62d812308d11 README: Add a note about test_tree1.dts
5bed86aee9e8 pylibfdt: Add support for fdt_subnode_offset()
46f31b65b3b3 pylibfdt: Add support for fdt_node_offset_by_phandle()
a3ae43723687 pylibfdt: Add support for fdt_parent_offset()
a198af80344c pylibfdt: Add support for fdt_get_phandle()
b9eba92ea50f tests: Return a failure code when any tests fail
155faf6cc209 pylibfdt: Use local pylibfdt module
50e5cd07f325 pylibfdt: Add a test for use of uint32_t
ab78860f09f5 pylibfdt: Add stdint include to fix uint32_t
36f511fb1113 tests: Add stacked overlay tests on fdtoverlay
1bb00655d3e5 fdt: Allow stacked overlays phandle references
a33c2247ac8d Introduce fdt_setprop_placeholder() method
0016f8c2aa32 dtc: change default phandles to ePAPR style instead of both
e3b9a9588a35 tests: fdtoverlay unit test
42409146f2db fdtoverlay: A tool that applies overlays
aae22722fc8d manual: Document missing options
13ce6e1c2fc4 dtc: fix sprintf() format string error, again
d990b8013889 Makefile: Fix build on MSYS2 and Cygwin
51f56dedf8ea Clean up shared library compile/link options
21a2bc896e3d Suppress expected error message in fdtdump test
2a42b14d0d03 dtc: check.c fix compile error
a10cb3c818d3 Fix get_node_by_path string equality check
548aea2c436a fdtdump: Discourage use of fdtdump
c2258841a785 fdtdump: Fix over-zealous version check
9067ee4be0e6 Fix a few whitespace and style nits
e56f2b07be38 pylibfdt: Use setup.py to build the swig file
896f1c133265 pylibfdt: Use Makefile constructs to implement NO_PYTHON
90db6d9989ca pylibfdt: Allow setup.py to operate stand-alone
e20d9658cd8f Add Coverity Scan support
b04a2cf08862 pylibfdt: Fix code style in setup.py
1c5170d3a466 pylibfdt: Rename libfdt.swig to libfdt.i
580a9f6c2880 Add a libfdt function to write a property placeholder
ab15256d8d02 pylibfdt: Use the call function to simplify the Makefile
9f2e3a3a1f19 pylibfdt: Use the correct libfdt version in the module
e91c652af215 pylibfdt: Enable installation of Python module
8a892fd85d94 pylibfdt: Allow building to be disabled
741cdff85d3e .travis.yml: Add builds with and without Python library prerequisites
14c4171f4f9a pylibfdt: Use package_dir to set the package directory
89a5062ab231 pylibfdt: Use environment to pass C flags and files
4e0e0d049757 pylibfdt: Allow pkg-config to be supplied in the environment
6afd7d9688f5 Correct typo: s/pylibgfdt/pylibfdt/
Change-Id: I0591bb1fe4e76051deae3318011927b350271f6c
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 4201d057ea)
dtc uses an incorrect format specifier for printing a uint64_t value.
uint64_t may be either 'unsigned long' or 'unsigned long long' depending
on the host architecture.
Fix this by using %llx and casting to unsigned long long, which ensures
that we always have a wide enough variable to print 64 bits of hex.
HOSTCC scripts/dtc/checks.o
scripts/dtc/checks.c: In function 'check_simple_bus_reg':
scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]
snprintf(unit_addr, sizeof(unit_addr), "%zx", reg);
^
scripts/dtc/checks.c:876:2: warning: format '%zx' expects argument of type 'size_t', but argument 4 has type 'uint64_t' [-Wformat=]
Link: http://lkml.kernel.org/r/20170829222034.GJ20805@n2100.armlinux.org.uk
Change-Id: Ic485917e85d7ddab7e7711e5f4e7038ceb6675c0
Fixes: 828d4cdd01 ("dtc: check.c fix compile error")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e66186920b)
As the comparison uses process substitution to pass files after
conversion to DTS format, the diff header doesn't show the real
filenames, but the names of the file descriptors used:
--- /dev/fd/63 2017-06-22 11:21:47.531637188 +0200
+++ /dev/fd/62 2017-06-22 11:21:47.531637188 +0200
This is especially annoying when comparing a bunch of DT files in a
loop, as the output doesn't show a clue about which files it refers to.
Fix this by explicitly passing the original file names to the diff
command using the --label option, giving e.g.:
--- arch/arm/boot/dts/r8a7791-koelsch.dtb
+++ arch/arm/boot/dts/r8a7791-porter.dtb
Change-Id: Ic07c743027d42c04f865e1a79f61cd44103a2d80
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 7782b14446)
Fix the following compile error found on odroid-xu4:
checks.c: In function ‘check_simple_bus_reg’:
checks.c:876:41: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 4 has type
‘uint64_t{aka long long unsigned int}’ [-Werror=format=]
snprintf(unit_addr, sizeof(unit_addr), "%lx", reg);
^
checks.c:876:41: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 4 has type
‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
cc1: all warnings being treated as errors
Makefile:304: recipe for target 'checks.o' failed
make: *** [checks.o] Error 1
Change-Id: I08896cc9ecd828822ba9bd8e1b6d382faf7cd95d
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
[dwg: Correct new format to be correct in general]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[robh: cherry-picked from upstream dtc commit 2a42b14d0d03]
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 828d4cdd01)
dtc gained new warnings checking PCI and simple buses, unit address
formatting, and stricter node and property name checking. Disable the
new dtc warnings by default as there are 1000s. As before, warnings are
enabled with W=1 or W=2. The strict node and property name checks are a
bit subjective, so they are only enabled for W=2.
Change-Id: I1928d0fcb0a6fb82ec4a68d092121809cd23c1a0
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 8654cb8d03)
The newly added dtc warning to check DT unit-address without reg
property and vice-versa generates lots of warnings. Turn off the check
unless building with W=1 or W=2.
Change-Id: I423d16369f982e7691fb0921133b5e9d673b74c0
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Michal Marek <mmarek@suse.com>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit bc553986a2)
This adds the following commits from upstream:
756ffc4f52f6 Build pylibfdt as part of the normal build process
8cb3896358e9 Adjust libfdt.h to work with swig
b40aa8359aff Mention pylibfdt in the documentation
12cfb740cc76 Add tests for pylibfdt
50f250701631 Add an initial Python library for libfdt
cdbb2b6c7a3a checks: Warn on node name unit-addresses with '0x' or leading 0s
4c15d5da17cc checks: Add bus checks for simple-bus buses
33c3985226d3 checks: Add bus checks for PCI buses
558cd81bdd43 dtc: Bump version to v1.4.4
c17a811c62eb fdtput: Remove star from value_len documentation
194d5caaefcb fdtget: Use @return to document the return value
d922ecdd017b tests: Make realloc_fdt() really allocate *fdt
921cc17fec29 libfdt: overlay: Check the value of the right variable
9ffdf60bf463 dtc: Simplify asm_emit_string() implementation
881012e44386 libfdt: Change names of sparse helper macros
bad5b28049e5 Fix assorted sparse warnings
672ac09ea04d Clean up gcc attributes
49300f2ade6a dtc: Don't abuse struct fdt_reserve_entry
fa8bc7f928ac dtc: Bump version to v1.4.3
34a9886a177f Add printf format attributes
f72508e2b6ca Correct some broken printf() like format mismatches
397d5ef0203c libfdt: Add fdt_setprop_empty()
69a1bd6ad3f9 libfdt: Remove undefined behaviour setting empty properties
acd1b534a592 Print output filename as part of warning messages
120775eb1cf3 dtc: Use streq() in preference to strcmp()
852e9ecbe197 checks: Add Warning for stricter node name character checking
ef0e8f061534 checks: Add Warning for stricter property name character checking
00d7bb1f4b0e dtc: pos parameter to srcpos_string() can't be NULL
95d57726bca4 livetree.c: Fix memory leak
3b9c97093d6e dtc: Fix NULL pointer use in dtlabel + dtref case
43eb551426ea manual: Fix typo it -> in
4baf15f7f13f Makefile: Add tags rule
Change-Id: Ifb54361ee3f13e124e6728a095dc73b0fe2724d5
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 89d123106a)
Further automate the dtc update script to fill in the dtc version and
commit log.
Change-Id: Ib52a9d54ffbe57c82cb2aa752e3cdd0f6b564e7a
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 86cef6144d)
Tsadc has a tshut pin which is designed to reset the pmic or soc,
when the temperature inside soc is too high. we should switch off
the tshut function and change the pin to gpio function in reboot
process, eg, software reset. If not, the tsadc module will WRONGLY
pull high the tshut pin during its reset process and then WRONGLY
reset the pmic or soc, which incurred a hardware reset. The hardware
reset will reset everything inside soc, even includes the power on
reason flag, which is set by software before reboot process.
we also change over-temperature protection mode to cru mode,
since the tshut pin have be changed to gpio function.
Change-Id: Iac3dacf55a4b5536fccd2eb05a6a9e6923a082c0
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Should disable fiq_debugger if activating sdmmc support
Change-Id: Ib9b24199e3e56015c062f8d2a337bc53ee53e083
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Respect the actual clock for mmc debugfs to help better debug
the hardware.
mmc_host mmc0: Bus speed (slot 0) = 135475200Hz (slot req 150000000Hz,
actual 135475200HZ div = 0)
cat /sys/kernel/debug/mmc0/ios
clock: 150000000 Hz
actual clock: 135475200 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 3 (8 bits)
timing spec: 9 (mmc HS200)
signal voltage: 0 (1.80 V)
driver type: 0 (driver type B)
Cc: Xiao Yao <xiaoyao@rock-chips.com>
Cc: Ziyuan <xzy.xu@rock-chips.com>
Change-Id: I957b9cc00aa4a4abde8c1bcc735204d274388145
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10307501/)