Commit Graph

214 Commits

Author SHA1 Message Date
Finley Xiao
f56e208d80 cpufreq: dt: Fix memory leak when cpu on/off
Fixes: e51ed31ccd ("cpufreq: dt: Add support to get static power")
Change-Id: I613a14a061490fb69e913b8c2cf6677757c73ced
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-27 18:10:00 +08:00
Finley Xiao
a8ff5cd6e1 soc: rockchip: ipa: Get leakage when ipa power model init
Change-Id: Ib0f7855c6faa54fa5ca28010d1c05da8ba478d7e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-27 18:10:00 +08:00
Finley Xiao
53a92e3059 soc: rockchip: Add some macro definitions for sip
Change-Id: I39cc8d444945c45f3e97f6e9ba38de972b71f422
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 21:58:16 +08:00
Finley Xiao
b99f359494 soc: rockchip: Add rockchip system monitor support
Change-Id: I4cb7fafcb33fda0212b5ad1f6eebd44503556336
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 21:48:42 +08:00
Finley Xiao
a7bddb708d soc: rockchip: add CONFIG_ROCKCHIP_OPP for rockchip_opp_select.c
Change-Id: I0cde56d1ad7482c8d4e8b518fc49cc028da6501b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 21:43:47 +08:00
Finley Xiao
72b246bef0 soc: rockchip: system_monitor: Add reboot notifier
Change-Id: Ic788ca9ba353c7d7c64e3e323698d8c23303eaa0
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:59:32 +08:00
Finley Xiao
ee8ac7cc36 soc: rockchip: opp_select: Remove unuse code
Change-Id: I7c3a9061f3ef436e498cbabd14c3d13b821d4fe8
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:51:13 +08:00
Finley Xiao
89b636c1e5 soc: rockchip: system_monitor: change cdev state according to system status
Change-Id: Ifff046a840adda8d2f17bf8545aeeeb8ed568216
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:42:44 +08:00
Finley Xiao
62b7ef2340 soc: rockchip: Add config option for rockchip_system_monitor.c
Change-Id: Ic8d2cb645d29d2ea13e04584d22051b02364bd10
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:39:57 +08:00
Finley Xiao
72dc50cd92 soc: rockchip: system_monitor: change cdev state according to temperature
Change-Id: I9c7c54bbe4226314cb1b33e9e071621f6fed1c36
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:39:57 +08:00
Finley Xiao
ce28fbc8a6 soc: rockchip: system_monitor: Add support limit rate when 4k video
Change-Id: I15b443df1e7b24df03e986e401e6032f307aa376
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:38:56 +08:00
Finley Xiao
f23062aa03 soc: rockchip: system_monitor: Add wide-temperature control
Change-Id: I5c1f502f8602c011a9bb26e7e0425e60728f1b66
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:38:51 +08:00
Finley Xiao
0b38b5b1f5 soc: rockchip: Add system monitor driver
Change-Id: Ie5aef98acf6bcbaf319d75a9b34dd834e25a1d32
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-14 19:38:35 +08:00
Finley Xiao
f536573bf6 thermal: trace: Add trace for staitc power
Change-Id: I65fa7e60c606d414e6f5941c5a73347db9874c27
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-12 09:38:43 +08:00
Finley Xiao
93a75af425 soc: rockchip: Add support to change static power according to leakage
Change-Id: Ie25e42ab14a46676819711957afa8aef8dfd0785
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-12 09:38:43 +08:00
Finley Xiao
8da9fcee28 soc: rockchip: Implement rockchip_of_get_leakage()
Change-Id: I6d1bf9ee6957455c2cb6623aa112d918a9fea4d4
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-12 09:38:43 +08:00
Tao Huang
60a5825e9c Merge remote branch 'android-4.19' of https://android.googlesource.com/kernel/common
* android-4.19: (206154 commits)
  Linux 4.19.20
  cifs: Always resolve hostname before reconnecting
  md/raid5: fix 'out of memory' during raid cache recovery
  of: overlay: do not duplicate properties from overlay for new nodes
  of: overlay: use prop add changeset entry for property in new nodes
  of: overlay: add missing of_node_get() in __of_attach_node_sysfs
  of: overlay: add tests to validate kfrees from overlay removal
  of: Convert to using %pOFn instead of device_node.name
  mm: migrate: don't rely on __PageMovable() of newpage after unlocking it
  mm: hwpoison: use do_send_sig_info() instead of force_sig()
  mm, oom: fix use-after-free in oom_kill_process
  mm,memory_hotplug: fix scan_movable_pages() for gigantic hugepages
  oom, oom_reaper: do not enqueue same task twice
  mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT
  kernel/exit.c: release ptraced tasks before zap_pid_ns_processes
  btrfs: On error always free subvol_name in btrfs_mount
  Btrfs: fix deadlock when allocating tree block during leaf/node split
  mmc: sdhci-iproc: handle mmc_of_parse() errors during probe
  platform/x86: asus-nb-wmi: Drop mapping of 0x33 and 0x34 scan codes
  platform/x86: asus-nb-wmi: Map 0x35 to KEY_SCREENLOCK
  ...

Conflicts:
	Documentation/devicetree/bindings/clock/rockchip,rk3399-cru.txt
	Documentation/devicetree/bindings/devfreq/event/rockchip-dfi.txt
	Documentation/devicetree/bindings/display/bridge/analogix_dp.txt
	Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
	Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
	Documentation/devicetree/bindings/display/rockchip/inno_hdmi-rockchip.txt
	Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
	Documentation/devicetree/bindings/media/i2c/ov2685.txt
	Documentation/devicetree/bindings/media/i2c/ov5695.txt
	Documentation/devicetree/bindings/media/i2c/ov7251.txt
	Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
	Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
	Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt
	Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
	Documentation/devicetree/bindings/soc/rockchip/grf.txt
	Documentation/devicetree/bindings/sound/rockchip,pdm.txt
	Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt
	Documentation/devicetree/bindings/usb/rockchip,dwc3.txt
	arch/arm/boot/dts/rk3036-kylin.dts
	arch/arm/boot/dts/rk3036.dtsi
	arch/arm/boot/dts/rk3228-evb.dts
	arch/arm/boot/dts/rk3229-evb.dts
	arch/arm/boot/dts/rk322x.dtsi
	arch/arm/boot/dts/rk3288-fennec.dts
	arch/arm/boot/dts/rk3288-firefly-reload.dts
	arch/arm/boot/dts/rk3288-miqi.dts
	arch/arm/boot/dts/rk3288-phycore-rdk.dts
	arch/arm/boot/dts/rk3288-phycore-som.dtsi
	arch/arm/boot/dts/rv1108.dtsi
	arch/arm64/boot/dts/rockchip/rk3328-evb.dts
	arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
	arch/arm64/boot/dts/rockchip/rk3328.dtsi
	arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi
	arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts
	arch/arm64/boot/dts/rockchip/rk3368-px5-evb.dts
	arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
	arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi
	arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
	arch/arm64/boot/dts/rockchip/rk3399.dtsi
	drivers/clk/rockchip/clk-ddr.c
	drivers/clk/rockchip/clk-half-divider.c
	drivers/clk/rockchip/clk-px30.c
	drivers/clk/rockchip/clk-rk3036.c
	drivers/clk/rockchip/clk-rk3128.c
	drivers/clk/rockchip/clk-rk3228.c
	drivers/clk/rockchip/clk-rk3328.c
	drivers/clk/rockchip/clk-rk3399.c
	drivers/clk/rockchip/clk-rv1108.c
	drivers/devfreq/event/rockchip-dfi.c
	drivers/gpu/drm/bridge/analogix/Kconfig
	drivers/gpu/drm/bridge/analogix/Makefile
	drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
	drivers/gpu/drm/bridge/analogix/analogix_dp_core.h
	drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
	drivers/gpu/drm/bridge/dumb-vga-dac.c
	drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
	drivers/gpu/drm/rockchip/cdn-dp-core.c
	drivers/gpu/drm/rockchip/cdn-dp-core.h
	drivers/gpu/drm/rockchip/cdn-dp-reg.c
	drivers/gpu/drm/rockchip/cdn-dp-reg.h
	drivers/gpu/drm/rockchip/dw-mipi-dsi.c
	drivers/gpu/drm/rockchip/inno_hdmi.c
	drivers/gpu/drm/rockchip/inno_hdmi.h
	drivers/gpu/drm/rockchip/rockchip_lvds.c
	drivers/gpu/drm/rockchip/rockchip_vop_reg.c
	drivers/gpu/drm/rockchip/rockchip_vop_reg.h
	drivers/hid/hid-alps.c
	drivers/iio/light/vl6180.c
	drivers/leds/leds-is31fl32xx.c
	drivers/media/cec/cec-adap.c
	drivers/media/cec/cec-api.c
	drivers/media/cec/cec-notifier.c
	drivers/media/i2c/ov5647.c
	drivers/media/i2c/ov5695.c
	drivers/media/i2c/ov7251.c
	drivers/media/platform/rockchip/rga/rga.c
	drivers/media/rc/ir-imon-decoder.c
	drivers/media/rc/serial_ir.c
	drivers/media/spi/Kconfig
	drivers/media/spi/Makefile
	drivers/media/v4l2-core/v4l2-fwnode.c
	drivers/net/phy/rockchip.c
	drivers/phy/rockchip/Kconfig
	drivers/phy/rockchip/Makefile
	drivers/phy/rockchip/phy-rockchip-emmc.c
	drivers/phy/rockchip/phy-rockchip-inno-usb2.c
	drivers/phy/rockchip/phy-rockchip-typec.c
	drivers/phy/rockchip/phy-rockchip-usb.c
	drivers/pinctrl/pinctrl-rk805.c
	drivers/power/reset/reboot-mode.c
	drivers/soc/rockchip/grf.c
	drivers/usb/dwc3/dwc3-of-simple.c
	drivers/usb/gadget/udc/core.c
	include/drm/bridge/analogix_dp.h
	include/dt-bindings/clock/px30-cru.h
	include/dt-bindings/clock/rk3036-cru.h
	include/dt-bindings/clock/rk3128-cru.h
	include/dt-bindings/clock/rk3228-cru.h
	include/dt-bindings/clock/rk3328-cru.h
	include/dt-bindings/clock/rk3399-cru.h
	include/dt-bindings/power/px30-power.h
	include/dt-bindings/power/rk3036-power.h
	include/dt-bindings/power/rk3228-power.h
	include/media/cec-notifier.h
	include/soc/rockchip/rockchip_sip.h
	include/sound/hdmi-codec.h
	sound/soc/codecs/hdmi-codec.c
	sound/soc/rockchip/rockchip_pdm.c
	sound/soc/rockchip/rockchip_pdm.h

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-14 11:48:20 +08:00
Tao Huang
135b29c75f rk: revert to v4.4
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-10 00:33:21 +08:00
Finley Xiao
596651a047 soc: rockchip: opp_select: Add rockchip_cpu_suspend_low_temp_adjust()
If support wide temperature, it necessary to set voltage to low temperature
voltage before system suspend, so that it can resume successfully at low
temperature.

Change-Id: Ie6787092c9510788054217bd830b5ae1e4dd6bc2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-01-28 14:33:33 +08:00
Finley Xiao
b5d345b2e8 PM / devfreq: rockchip_dmc: Change readlatency according to plane number
Change-Id: Ie0340c80c693c86fed90a155104cf2f8ca6ce16e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-01-23 18:39:42 +08:00
Finley Xiao
85115a5899 PM / devfreq: rockchip_dmc: Implement rk3399_set_msch_readlatency()
The ATF must contain the following commit:
cd61876e275e ("plat: rk3399: ddr: add support adjust noc read latency")

Change-Id: I322f8c9d454fb1234b042438c85521275ceda4bc
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-01-23 18:39:16 +08:00
YouMin Chen
90cf7903d4 PM / devfreq: rockchip_dmc: add support for rk1808
Change-Id: If6a5230f84f8ea293f3d6c84f7586dbff3a02230
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-11-16 15:09:32 +08:00
Finley Xiao
0f77f53e39 soc: rockchip: Add a simple power model for ipa
This patch adds support to calculate the static power in milliwatts
consumed by devices.

Change-Id: Ied4ba5adecea45ff34b372a6e23c70882000aef3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-11-14 10:14:15 +08:00
Laurentiu Tudor
853dc104e6 soc: fsl: qbman: add APIs to retrieve the probing status
Add a couple of new APIs to check the probing status of qman and bman:
 'int bman_is_probed()' and 'int qman_is_probed()'.
They return the following values.
 *  1 if qman/bman were probed correctly
 *  0 if qman/bman were not yet probed
 * -1 if probing of qman/bman failed
Drivers that use qman/bman driver services are required to use these
APIs before calling any functions exported by qman or bman drivers
or otherwise they will crash the kernel.
The APIs will be used in the following couple of qbman portal patches
and later in the series in the dpaa1 ethernet driver.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2018-09-27 15:43:35 -05:00
Jianqun Xu
ffbd3042bc soc: rockchip: add CONFIG_ROCKCHIP_OPP for rockchip_opp_select.c
Change-Id: I0cde56d1ad7482c8d4e8b518fc49cc028da6501b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-09-10 18:38:51 +08:00
Tao Huang
75654db877 Merge branch 'linux-linaro-lsk-v4.4' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4: (519 commits)
  Linux 4.4.154
  cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status
  iscsi target: fix session creation failure handling
  scsi: core: Avoid that SCSI device removal through sysfs triggers a deadlock
  scsi: sysfs: Introduce sysfs_{un,}break_active_protection()
  MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7
  MIPS: Correct the 64-bit DSP accumulator register size
  kprobes: Make list and blacklist root user read only
  s390/pci: fix out of bounds access during irq setup
  s390/qdio: reset old sbal_state flags
  s390: fix br_r1_trampoline for machines without exrl
  x86/spectre: Add missing family 6 check to microcode check
  x86/irqflags: Mark native_restore_fl extern inline
  pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()
  ASoC: sirf: Fix potential NULL pointer dereference
  ASoC: dpcm: don't merge format from invalid codec dai
  udl-kms: fix crash due to uninitialized memory
  udl-kms: handle allocation failure
  udl-kms: change down_interruptible to down
  fuse: Add missed unlock_page() to fuse_readpages_fill()
  ...

Conflicts:
	Makefile
	arch/arm64/mm/init.c
	fs/squashfs/block.c
	include/uapi/linux/prctl.h
	kernel/sys.c

Change-Id: Ie03b5adfbbb4ab2bf16bc55d99f0d8a9c540a53b
2018-09-07 17:34:34 +08:00
Wyon Bi
363e47c6aa phy/rockchip: typec: improved handling of typec_dp_phy_config()
Change-Id: I61ca43ffe7fe85e041fb3ed66ba1d59f515770d9
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-16 18:13:54 +08:00
huang lin
eedd1893c9 BACKPORT: FROMLIST: phy: rockchip-typec: support variable phy config value
the phy config values used to fix in dp firmware, but some boards
need change these values to do training and get the better eye diagram
result. So support that in phy driver.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Lin Huang <hl@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10420473/)

Conflicts:
	drivers/phy/phy-rockchip-typec.c
[phy-rockchip-typec.c is different path in upstream code]

BUG=b:72006974
TEST=DP can display on Dru

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1032713

Change-Id: I8a63307ad5cb690d819779662d70ae1c232842a5
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Lin Huang
707ec089ca BACKPORT: FROMLIST: soc: rockchip: split rockchip_typec_phy struct to separate header
we may use rockchip_phy_typec struct in other driver, so split
it to separate header.

Signed-off-by: Lin Huang <hl@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10420467/)

Conflicts:
	drivers/phy/phy-rockchip-typec.c
[phy-rockchip-typec.c is different path in upstream code]

BUG=b:72006974
TEST=DP display on Dru

Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1069958

Change-Id: I709331d1577923be662660eb606f92b743903ba7
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-08-15 17:28:40 +08:00
Dmitry Osipenko
e55c920c90 memory: tegra: Apply interrupts mask per SoC
[ Upstream commit 1c74d5c0de ]

Currently we are enabling handling of interrupts specific to Tegra124+
which happen to overlap with previous generations. Let's specify
interrupts mask per SoC generation for consistency and in a preparation
of squashing of Tegra20 driver into the common one that will enable
handling of GART faults which may be undesirable by newer generations.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-06 16:24:38 +02:00
Olof Johansson
1ca8c0a763 Merge tag 'soc-fsl-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into next/drivers
Various updates to soc/fsl for 4.19

Moves DPAA2 DPIO driver from staging to fsl/soc
Adds multiple-pin support to QE gpio driver

* tag 'soc-fsl-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: cleanup Kconfig menu
  soc: fsl: dpio: Convert DPIO documentation to .rst
  staging: fsl-mc: Remove remaining files
  staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl
  staging: fsl-dpaa2: eth: move generic FD defines to DPIO
  soc: fsl: qe: gpio: Add qe_gpio_set_multiple

Signed-off-by: Olof Johansson <olof@lixom.net>
2018-07-26 00:12:56 -07:00
Olof Johansson
d7e8323043 Merge tag 'qcom-drivers-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/drivers
Qualcomm ARM Based Driver Updates for v4.19

* Add Qualcomm LLCC driver
* Add Qualcomm RPMH controller
* Fix memleak in Qualcomm RMTFS
* Add dummy qcom_scm_assign_mem()
* Fix check for global partition in SMEM

* tag 'qcom-drivers-for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux:
  soc: qcom: rmtfs-mem: fix memleak in probe error paths
  soc: qcom: llc-slice: Add missing MODULE_LICENSE()
  drivers: qcom: rpmh: fix unwanted error check for get_tcs_of_type()
  drivers: qcom: rpmh-rsc: fix the loop index check in get_req_from_tcs
  firmware: qcom: scm: add a dummy qcom_scm_assign_mem()
  drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children
  drivers: qcom: rpmh-rsc: allow active requests from wake TCS
  drivers: qcom: rpmh: add support for batch RPMH request
  drivers: qcom: rpmh: allow requests to be sent asynchronously
  drivers: qcom: rpmh: cache sleep/wake state requests
  drivers: qcom: rpmh-rsc: allow invalidation of sleep/wake TCS
  drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS
  drivers: qcom: rpmh: add RPMH helper functions
  drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE
  dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs
  drivers: qcom: rpmh-rsc: add RPMH controller for QCOM SoCs
  drivers: soc: Add LLCC driver
  dt-bindings: Documentation for qcom, llcc
  soc: qcom: smem: Correct check for global partition

Signed-off-by: Olof Johansson <olof@lixom.net>
2018-07-26 00:03:25 -07:00
Roy Pledge
c89105c9b3 staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl
Move the NXP DPIO (Datapath I/O Driver) out of the
drivers/staging directory and into the drivers/soc/fsl directory.

The DPIO driver enables access to Queue and Buffer Manager (QBMAN)
hardware on NXP DPAA2 devices. This is a prerequisite to moving the
DPAA2 Ethernet driver out of staging.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2018-07-24 16:18:55 -05:00
Lina Iyer
c8790cb6da drivers: qcom: rpmh: add support for batch RPMH request
Platform drivers need make a lot of resource state requests at the same
time, say, at the start or end of an usecase. It can be quite
inefficient to send each request separately. Instead they can give the
RPMH library a batch of requests to be sent and wait on the whole
transaction to be complete.

rpmh_write_batch() is a blocking call that can be used to send multiple
RPMH command sets. Each RPMH command set is set asynchronously and the
API blocks until all the command sets are complete and receive their
tx_done callbacks.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-07-21 13:33:36 -05:00
Lina Iyer
564b5e24cc drivers: qcom: rpmh: allow requests to be sent asynchronously
Platform drivers that want to send a request but do not want to block
until the RPMH request completes have now a new API -
rpmh_write_async().

The API allocates memory and send the requests and returns the control
back to the platform driver. The tx_done callback from the controller is
handled in the context of the controller's thread and frees the
allocated memory. This API allows RPMH requests from atomic contexts as
well.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-07-21 13:33:27 -05:00
Lina Iyer
600513dfee drivers: qcom: rpmh: cache sleep/wake state requests
Active state requests are sent immediately to the RSC controller, while
sleep and wake state requests are cached in this driver to avoid taxing
the RSC controller repeatedly. The cached values will be sent to the
controller when the rpmh_flush() is called.

Generally, flushing is a system PM activity and may be called from the
system PM drivers when the system is entering suspend or deeper sleep
modes during cpuidle.

Also allow invalidating the cached requests, so they may be re-populated
again.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
[rplsssn: remove unneeded semicolon, address line over 80chars error]
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-07-21 13:33:12 -05:00
Lina Iyer
c1038456b0 drivers: qcom: rpmh: add RPMH helper functions
Sending RPMH requests and waiting for response from the controller
through a callback is common functionality across all platform drivers.
To simplify drivers, add a library functions to create RPMH client and
send resource state requests.

rpmh_write() is a synchronous blocking call that can be used to send
active state requests.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-07-21 13:32:40 -05:00
Lina Iyer
658628e7ef drivers: qcom: rpmh-rsc: add RPMH controller for QCOM SoCs
Add controller driver for QCOM SoCs that have hardware based shared
resource management. The hardware IP known as RSC (Resource State
Coordinator) houses multiple Direct Resource Voter (DRV) for different
execution levels. A DRV is a unique voter on the state of a shared
resource. A Trigger Control Set (TCS) is a bunch of slots that can house
multiple resource state requests, that when triggered will issue those
requests through an internal bus to the Resource Power Manager Hardened
(RPMH) blocks. These hardware blocks are capable of adjusting clocks,
voltages, etc. The resource state request from a DRV are aggregated
along with state requests from other processors in the SoC and the
aggregate value is applied on the resource.

Some important aspects of the RPMH communication -
- Requests are <addr, value> with some header information
- Multiple requests (upto 16) may be sent through a TCS, at a time
- Requests in a TCS are sent in sequence
- Requests may be fire-n-forget or completion (response expected)
- Multiple TCS from the same DRV may be triggered simultaneously
- Cannot send a request if another request for the same addr is in
  progress from the same DRV
- When all the requests from a TCS are complete, an IRQ is raised
- The IRQ handler needs to clear the TCS before it is available for
  reuse
- TCS configuration is specific to a DRV
- Platform drivers may use DRV from different RSCs to make requests

Resource state requests made when CPUs are active are called 'active'
state requests. Requests made when all the CPUs are powered down (idle
state) are called 'sleep' state requests. They are matched by a
corresponding 'wake' state requests which puts the resources back in to
previously requested active state before resuming any CPU. TCSes are
dedicated for each type of requests. Active mode TCSes (AMC) are used to
send requests immediately to the resource, while control TCS are used to
provide specific information to the controller. Sleep and Wake TCS send
sleep and wake requests, after and before the system halt respectively.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-07-21 13:32:06 -05:00
Finley Xiao
0c406a7db0 soc: rockchip: opp_select: Limit minimum voltage when low temperature
Change-Id: I4d4dd9d8a1130a11b6364479c24c1bb452045c23
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-13 16:25:59 +08:00
Finley Xiao
bf4d561a65 soc: rockchip: opp_select: Implement APIs for wide-temperature control
Add a basic wide-temperature control model for device to adjust opp
table and max frequency.

Change-Id: I23f29ac1892093c527e730164eba086f02667de3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-07-06 19:38:51 +08:00
Stefan Wahren
be3035e362 ARM: bcm2835: Add GET_THROTTLED firmware property
Recent Raspberry Pi firmware provides a mailbox property to detect
under-voltage conditions. Here is the current definition.

The u32 value returned by the firmware is divided into 2 parts:
  - lower 16-bits are the live value
  - upper 16-bits are the history or sticky value

  Bits:
  0: undervoltage
  1: arm frequency capped
  2: currently throttled
  16: undervoltage has occurred
  17: arm frequency capped has occurred
  18: throttling has occurred

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-06-21 17:17:11 -07:00
Linus Torvalds
8efcf34a26 Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC late updates from Olof Johansson:
 "This is a branch with a few merge requests that either came in late,
  or took a while longer for us to review and merge than usual and thus
  cut it a bit close to the merge window. We stage them in a separate
  branch and if things look good, we still send them up -- and that's
  the case here.

  This is mostly DT additions for Renesas platforms, adding IP block
  descriptions for existing and new SoCs.

  There are also some driver updates for Qualcomm platforms for SMEM/QMI
  and GENI, which is their generalized serial protocol interface"

* tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (186 commits)
  soc: qcom: smem: introduce qcom_smem_virt_to_phys()
  soc: qcom: qmi: fix a buffer sizing bug
  MAINTAINERS: Update pattern for qcom_scm
  soc: Unconditionally include qcom Makefile
  soc: qcom: smem: check sooner in qcom_smem_set_global_partition()
  soc: qcom: smem: fix qcom_smem_set_global_partition()
  soc: qcom: smem: fix off-by-one error in qcom_smem_alloc_private()
  soc: qcom: smem: byte swap values properly
  soc: qcom: smem: return proper type for cached entry functions
  soc: qcom: smem: fix first cache entry calculation
  soc: qcom: cmd-db: Make endian-agnostic
  drivers: qcom: add command DB driver
  arm64: dts: renesas: salvator-common: Add ADV7482 support
  ARM: dts: r8a7740: Add CEU1
  ARM: dts: r8a7740: Add CEU0
  arm64: dts: renesas: salvator-common: enable VIN
  arm64: dts: renesas: r8a77970: add VIN and CSI-2 nodes
  arm64: dts: renesas: r8a77965: add VIN and CSI-2 nodes
  arm64: dts: renesas: r8a7796: add VIN and CSI-2 nodes
  arm64: dts: renesas: r8a7795-es1: add CSI-2 node
  ...
2018-06-11 18:19:45 -07:00
Arnd Bergmann
32561354b1 ARM: tegra: fix compile-testing PCI host driver
The tegra_cpuidle_pcie_irqs_in_use() function is stubbed out for non-ARM
builds, but now we can compile-test the Tegra pci driver on non-Tegra
ARM platforms as well, which results in a new link error:

drivers/pci/host/pci-tegra.o: In function `tegra_pcie_map_irq':
pci-tegra.c:(.text+0x288): undefined reference to `tegra_cpuidle_pcie_irqs_in_use'
drivers/pci/host/pci-tegra.o: In function `tegra_msi_map':
pci-tegra.c:(.text+0xba0): undefined reference to `tegra_cpuidle_pcie_irqs_in_use'

This adapts the #ifdef statement to match the exact condition under which
the function can be called.

Fixes: 51bc085d64 ("PCI: Improve host drivers compile test coverage")
Cc: Rob Herring <robh@kernel.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2018-06-02 01:17:47 -07:00
Finley Xiao
71e634507f soc: rockchip: opp_select: Add support to adjust power scale
Change-Id: I2358d75c2fdada7cfe385e85d2106370f9aa5ea3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-06-01 16:58:27 +08:00
Olof Johansson
ae709bf8ad Merge tag 'qcom-drivers-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/late
Qualcomm ARM Based Driver Updates for v4.18

* Various SMEM updates/fixes
* Add qcom_smem_virt_to_phys SMEM API
* Update MAINTAINERS to include qcom_scm pattern
* Add Qualcomm Command DB driver
* Add Qualcomm SCM compatible for IPQ4019
* Add MSM8998 to smd-rpm compatible list
* Add Qualcomm GENI based QUP wrapper
* Fix Qualcomm QMI buffer sizing bug

* tag 'qcom-drivers-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux:
  soc: qcom: smem: introduce qcom_smem_virt_to_phys()
  soc: qcom: qmi: fix a buffer sizing bug
  MAINTAINERS: Update pattern for qcom_scm
  soc: Unconditionally include qcom Makefile
  soc: qcom: smem: check sooner in qcom_smem_set_global_partition()
  soc: qcom: smem: fix qcom_smem_set_global_partition()
  soc: qcom: smem: fix off-by-one error in qcom_smem_alloc_private()
  soc: qcom: smem: byte swap values properly
  soc: qcom: smem: return proper type for cached entry functions
  soc: qcom: smem: fix first cache entry calculation
  soc: qcom: cmd-db: Make endian-agnostic
  drivers: qcom: add command DB driver
  soc: qcom: Add GENI based QUP Wrapper driver
  soc: qcom: smd-rpm: Add msm8998 compatible
  firmware: qcom: scm: Add ipq4019 soc compatible

Signed-off-by: Olof Johansson <olof@lixom.net>
2018-05-26 11:51:55 -07:00
Mahesh Sivasubramanian
312416d917 drivers: qcom: add command DB driver
Command DB is a simple database in the shared memory of QCOM SoCs, that
provides information regarding shared resources. Some shared resources
in the SoC have properties that are probed dynamically at boot by the
remote processor. The information pertaining to the SoC and the platform
are made available in the shared memory. Drivers can query this
information using predefined strings.

Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-05-25 15:53:52 -05:00
Olof Johansson
6874f9de65 Merge tag 'tegra-for-4.18-memory-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers
memory: tegra: Changes for v4.18-rc1

This contains some cleanup of the memory controller driver as well as
unification work to share more code between Tegra20 and later SoC
generations. Also included are an implementation for the hot resets
functionality by the memory controller which is required to properly
reset busy hardware.

* tag 'tegra-for-4.18-memory-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  dt-bindings: memory: tegra: Remove Tegra114 SATA and AFI reset definitions
  memory: tegra: Remove Tegra114 SATA and AFI reset definitions
  memory: tegra: Register SMMU after MC driver became ready
  memory: tegra: Add Tegra210 memory controller hot resets
  memory: tegra: Add Tegra124 memory controller hot resets
  memory: tegra: Add Tegra114 memory controller hot resets
  memory: tegra: Add Tegra30 memory controller hot resets
  memory: tegra: Add Tegra20 memory controller hot resets
  memory: tegra: Introduce memory client hot reset
  memory: tegra: Squash tegra20-mc into common tegra-mc driver
  memory: tegra: Remove unused headers inclusions
  memory: tegra: Apply interrupts mask per SoC
  memory: tegra: Setup interrupts mask before requesting IRQ
  memory: tegra: Do not handle spurious interrupts
  dt-bindings: memory: tegra: Add hot resets definitions

Signed-off-by: Olof Johansson <olof@lixom.net>
2018-05-25 05:14:34 -07:00
Tao Huang
c95036feef PM / devfreq: rockchip_dmc: Fix deadlock between dmcfreq and vop on/off
When change vop status and ddr frequency at the same time,
the following deadlock will happen:

vop no/off                            dmcfreq
vop_crtc_disable                      update_devfreq
->mutex_lock(&vop->vop_lock);         ->mutex_lock(&pd->pmu->mutex);
->pm_runtime_put(vop->dev);           ->mutex_lock(&vop->vop_lock);
  ->mutex_lock(&pd->pmu->mutex);      ...

Use new dmcfreq rwsem to decouple vop and pd driver, and get better
parallelism.

Change-Id: I56a4ee944200826d2a09e3ae8d2f4837f6f769d6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-05-17 11:43:55 +08:00
Tao Huang
5a754e153e PM / devfreq: rockchip_dmc: move some functions
Move rockchip_dmcfreq_vop_bandwidth_request and
rockchip_dmcfreq_vop_bandwidth_update from rockchip_drm_fb.h
to rockchip_dmc.h.

Change-Id: I5b023e44b46a6c613af71452a940d31feb9b2d97
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-05-08 17:21:46 +08:00
Tao Huang
ab0d877240 PM / devfreq: rockchip_dmc: include pm_domains.h
remove rockchip_pm_register_notify_to_dmc from rockchip_dmc.h

Change-Id: I9e78eaec2a88cfc06ac3d24f01870cd39c9d05ad
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-05-08 17:18:43 +08:00