24 Apr, 2018
1 commit
-
commit 73ce2ce129783813e1ebc37d2c757fe5e0fab1ef upstream.
Fix the pointer to struct scp_subdomian not being moved forward
when each sub-domain is expected to be iteratively added through
pm_genpd_add_subdomain call.Cc: stable@vger.kernel.org
Fixes: 53fddb1a66dd ("soc: mediatek: reduce code duplication of scpsys_probe across all SoCs")
Reported-by: Weiyi Lu
Signed-off-by: Sean Wang
Signed-off-by: Matthias Brugger
Signed-off-by: Greg Kroah-Hartman
20 Dec, 2017
1 commit
-
[ Upstream commit fb2c1934f30577756e55e24e8870b45c78da3bc2 ]
When compiling using sparse, we got the following error:
drivers/soc/mediatek/mtk-pmic-wrap.c:686:25: error: dubious one-bit signed bitfieldChanging the data type to unsigned fixes this.
Signed-off-by: Matthias Brugger
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
19 Aug, 2017
1 commit
-
Pull "arm: mediatek: soc updates for v4.14" from Matthias Brugger:
- add mt7623a smp support
- scpsys: reduce code duplication
- scpsys: add mt7622 support
- pmic wrapper: make of_device_ids constant* tag 'v4.13-next-soc' of https://github.com/mbgg/linux-mediatek:
soc: mediatek: add SCPSYS power domain driver for MediaTek MT7622 SoC
soc: mediatek: add header files required for MT7622 SCPSYS dt-binding
soc: mediatek: reduce code duplication of scpsys_probe across all SoCs
dt-bindings: soc: update the binding document for SCPSYS on MediaTek MT7622 SoC
soc: mtk-pmic-wrap: make of_device_ids const.
ARM: mediatek: add MT7623a smp bringup code
17 Aug, 2017
1 commit
-
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.Signed-off-by: Rob Herring
Acked-by: Krzysztof Kozlowski
Reviewed-by: Geert Uytterhoeven
Acked-by: Matthias Brugger
Acked-by: Simon Horman
Cc: Scott Wood
Cc: Qiang Zhao
Cc: Magnus Damm
Cc: Kukjin Kim
Cc: Javier Martinez Canillas
Signed-off-by: Arnd Bergmann
14 Aug, 2017
2 commits
-
Add SCPSYS power domain driver for MT7622 SoC having four power domains
which are respectively ETHSYS for Ethernet including embedded switch,
WBSYS for WIFI and Bluetooth, HIF0SYS for PCI-E and SATA, and HIF1SYS for
USB. Those functions could be selectively powered gated when the
corresponding function is no longer to use in order to reach more minimal
power dissipation.Signed-off-by: Chen Zhong
Signed-off-by: Sean Wang
Reviewed-by: Ulf Hansson
Signed-off-by: Matthias Brugger -
Reduce code duplication of scpsys_probe_mtXXXX across all SoCs using
the more generic scpsys_probe all covering all cases to avoid starting
to bloat the driver when more MediaTek SoCs supported are added.Suggested-by: Matthias Brugger
Signed-off-by: Sean Wang
Reviewed-by: Ulf Hansson
Signed-off-by: Matthias Brugger
02 Aug, 2017
1 commit
-
of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by work with const
of_device_ids. So mark the non-const structs as const.Signed-off-by: Arvind Yadav
Acked-by: Chen Zhong
Signed-off-by: Matthias Brugger
15 May, 2017
5 commits
-
of_match_device could return NULL, and so can cause a NULL
pointer dereference later.Signed-off-by: Shailendra Verma
Signed-off-by: Matthias Brugger -
According to error handling in this function, it is likely that going to
'err_out2' was expected here.Signed-off-by: Christophe JAILLET
Signed-off-by: Matthias Brugger -
This adds scpsys support for MT6797
Signed-off-by: Mars Cheng
Signed-off-by: Kevin-CW Chen
Signed-off-by: Matthias Brugger -
for some chips, there is vdec item in scpsys, this patch adds it.
Signed-off-by: Mars Cheng
Signed-off-by: Matthias Brugger -
Use variables to replace fixed defines since the offset
of the status of spm power might be different for some chipsSigned-off-by: Mars Cheng
Signed-off-by: Kevin-CW Chen
Signed-off-by: Matthias Brugger
31 Oct, 2016
2 commits
-
Add scpsys driver for MT2701.
mtk-scpsys now supports MT8173 (arm64) and MT2701 (arm). So it should
be enabled on both arm64 and arm platforms.Signed-off-by: Shunli Wang
Signed-off-by: James Liao
Reviewed-by: Kevin Hilman
Signed-off-by: Matthias Brugger -
Refine scpsys driver common code to support multiple SoC / platform.
Signed-off-by: James Liao
Reviewed-by: Kevin Hilman
Signed-off-by: Matthias Brugger
23 Aug, 2016
1 commit
-
Read data fails sometimes because of a timeout that PMIC cannot transfer data
to PMIC wrap on time, extend the waiting time to 10ms to reduce the failed
rate.Signed-off-by: Henry Chen
Signed-off-by: Matthias Brugger
19 May, 2016
2 commits
-
On ARM64, the mtk-pmic-wrap driver causes a harmless warning:
mtk-pmic-wrap.c:1062:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
mtk-pmic-wrap.c:1074:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
mtk-pmic-wrap.c:1086:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
.int_en_all = ~(BIT(31) | BIT(1)),The problem is that the result of the BIT() macro is an 'unsigned long',
so taking the bitwise NOT operation of that results in an integer
with the upper 32 bits all set and that cannot be assigned to a
'u32' variable without loss of information.This is harmless because we were never interested in the upper bits
here anyway, so we can shut up the warning by adding a simple cast
to 'u32'.Signed-off-by: Arnd Bergmann
-
Pull ARM SoC driver updates from Arnd Bergmann:
"Driver updates for ARM SoCs, these contain various things that touch
the drivers/ directory but got merged through arm-soc for practical
reasons.For the most part, this is now related to power management
controllers, which have not yet been abstracted into a separate
subsystem, and typically require some code in drivers/soc or arch/arm
to control the power domains.Another large chunk here is a rework of the NVIDIA Tegra USB3.0
support, which was surprisingly tricky and took a long time to get
done.Finally, reset controller handling as always gets merged through here
as well"* tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
arm-ccn: Enable building as module
soc/tegra: pmc: Add generic PM domain support
usb: xhci: tegra: Add Tegra210 support
usb: xhci: Add NVIDIA Tegra XUSB controller driver
dt-bindings: usb: xhci-tegra: Add Tegra210 XUSB controller support
dt-bindings: usb: Add NVIDIA Tegra XUSB controller binding
PCI: tegra: Support per-lane PHYs
dt-bindings: pci: tegra: Update for per-lane PHYs
phy: tegra: Add Tegra210 support
phy: Add Tegra XUSB pad controller support
dt-bindings: phy: tegra-xusb-padctl: Add Tegra210 support
dt-bindings: phy: Add NVIDIA Tegra XUSB pad controller binding
phy: core: Allow children node to be overridden
clk: tegra: Add interface to enable hardware control of SATA/XUSB PLLs
drivers: firmware: psci: make two helper functions inline
soc: renesas: rcar-sysc: Add support for R-Car H3 power areas
soc: renesas: rcar-sysc: Add support for R-Car E2 power areas
soc: renesas: rcar-sysc: Add support for R-Car M2-N power areas
soc: renesas: rcar-sysc: Add support for R-Car M2-W power areas
soc: renesas: rcar-sysc: Add support for R-Car H2 power areas
...
20 Apr, 2016
10 commits
-
Add the registers, callbacks and data structures required to make the
wrapper work on MT2701 and MT7623.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
Add support for MT6323 slaves. This PMIC can be found on MT2701 and MT7623
EVB. The only function that we need to touch is pwrap_init_cipher().Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
This patch adds a new struct pwrap_slv_type that we use to store the slave
specific data. The patch adds 2 new helper functions to access the dew
registers. The slave type is looked up via the wrappers child node.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
With more SoCs being added the list of helper functions like these would
grow. To mitigate this problem we remove the existing helpers and change
the code to test against the pmic type stored inside the pmic specific
datastructure that our context structure points at. There is one usage of
pwrap_is_mt8135() that is ambiguous as the test should not be dependent on
mt8135, but rather on the existence of a bridge. Add a new element to
pmic_wrapper_type to indicate if a bridge is present and use this where
appropriate.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
Different SoCs will use different bitmask for the wdt_src. This patch
defines the bitmask in the pmic_wrapper_type struct. This allows us to
support new SoCs with a different bitmask to the one currently used.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
Different SoCs will use different bitmask for the SPI_WRITE command. This
patch defines the bitmask in the pmic_wrapper_type struct. This allows us
to support new SoCs with a different bitmask to the one currently used.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
MT2701 and MT7623 use a different bitmask for PWRAP_INT_EN.
Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
This patch moves the SoC specific wrapper init code into separate callback
to avoid pwrap_init() getting too large. This is done by adding a new
element called init_special to pmic_wrapper_type. Each currently supported
SoC gets its own version of the callback and we copy the code that was
previously inside pwrap_init() to these new callbacks. Finally we point the
2 instances of pmic_wrapper_type at the 2 new functions.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
Split init_reg_clock up into SoC specific callbacks. The patch also
reorders the code to avoid the need for callback function prototypes.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger -
As we add support for more devices struct pmic_wrapper_type will grow and
we do not really want to start duplicating all the elements in
struct pmic_wrapper.Signed-off-by: John Crispin
Signed-off-by: Matthias Brugger
13 Apr, 2016
1 commit
-
This reverts commit cc8ed76938b5cf6a54ab3d60edabaf808dc960d1
("soc: mediatek: SCPSYS: Fix double enabling of regulators") [1].This patch fixes mt8173-evb failing boot issue. With commit [1],
genpd state will not sync to real power domain state. So some
resources such as clocks and regulators may stay in a wrong state.There is no regulator double enabling issue on mainline kernel, so
we can refert commit [1] safely.Signed-off-by: James Liao
Signed-off-by: Matthias Brugger
01 Feb, 2016
1 commit
-
With CONFIG_PM enabled do not call genpd->power_on manually as this
will cause the regulators being turned on once in SCPSYS probe and
then again when the genpd core turns on the domains. Instead, call
genpd->power_on only with CONFIG_PM disabled and tell the genpd core
that the domains are disabled when registered.Signed-off-by: Sascha Hauer
Tested-by: Daniel Kurtz
Reviewed-by: Daniel Kurtz
Signed-off-by: Matthias Brugger
26 Jan, 2016
3 commits
-
SCPSYS can't be built as module. Use builtin_platform_driver instead.
For this probe must not be __init and the data accessed can't be
__initconst. Remove this macros. To make the impact as small as possible,
fold scp_domain_data into scp_domain via a pointer.Cc: Sascha Hauer
Cc: Arnd Bergmann
Reported-by: Daniel Kurtz
Signed-off-by: Matthias Brugger
Reviewed-by: Daniel Kurtz
Tested-by: Daniel Kurtz
Acked-by: Arnd Bergmann -
Since STAUPD interrupts aren't handled on mt8173, disable watchdog timeout
monitor of STAUPD to avoid WDT_INT triggered by STAUPD.Signed-off-by: Henry Chen
Reviewed-by: Daniel Kurtz
Signed-off-by: Matthias Brugger -
Sometimes PMIC is too busy to send data in time to cause pmic wrap timeout,
because pmic wrap is waiting for FSM_VLDCLR after finishing WACS2_CMD. It
just return error when issue happened, so the state machine will stay on
FSM_VLDCLR state when data send back later by PMIC and timeout again in next
time because pmic wrap waiting for FSM_IDLE state at the beginning of the
read/write function.Clear the vldclr when timeout if state machine stay on FSM_VLDCLR.
Signed-off-by: Henry Chen
Tested-by: Ricky Liang
Signed-off-by: Matthias Brugger
23 Dec, 2015
1 commit
-
Change the scpsys to builtin_platform_driver_probe.
Add regulator support for scpsys driver.
* tag 'v4.4-next-soc' of https://github.com/mbgg/linux-mediatek:
drivers/soc: make mediatek/mtk-scpsys.c explicitly non-modular
soc: mediatek: SCPSYS: Add regulator supportSigned-off-by: Olof Johansson
18 Dec, 2015
2 commits
-
The Kconfig currently controlling compilation of this code is:
drivers/soc/mediatek/Kconfig:config MTK_SCPSYS
drivers/soc/mediatek/Kconfig: bool "MediaTek SCPSYS Support"...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.Cc: Matthias Brugger
Cc: Sascha Hauer
Cc: Daniel Kurtz
Cc: Paul Gortmaker
Cc: Olof Johansson
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Matthias Brugger -
The power domains are supplied by regulators. Add support for them so
that the regulators are properly turned on before a domain is powered up
and turned off when a domain is powered down.Signed-off-by: Sascha Hauer
Signed-off-by: Matthias Brugger
25 Nov, 2015
1 commit
-
If enable Mediatek 8173 SoC, it should also enable power domain
driver. Otherwise access clk subsystem register will fail.Signed-off-by: Eddie Huang
Acked-by: Matthias Brugger
Signed-off-by: Kevin Hilman
14 Oct, 2015
1 commit
-
In kernel late init, it turns off all unused clocks, which
needs to access subsystem registers such as VENC and VENC_LT.Accessing MT8173 VENC registers needs two top clocks, mm_sel and
venc_sel. Accessing VENC_LT registers needs mm_sel and venclt_sel.
So we need to keep these clocks on before accessing their registers.This patch keeps venc_sel / venclt_sel clock on when
VENC / VENC_LT's power is on, to prevent system hang up while
accessing its registeres.Signed-off-by: James Liao
Signed-off-by: Matthias Brugger
27 Sep, 2015
2 commits
-
Register gpd_dev_ops.active_wakeup function to support keep power
during suspend state. And add flag to each power domain to
decide whether keep power during suspend or not.Signed-off-by: Chunfeng Yun
Signed-off-by: Eddie Huang
Acked-by: Sascha Hauer
Reviewed-by: Daniel Kurtz
Signed-off-by: Matthias Brugger -
The watchdog may not be initialized by the bootloader, even if the rest
of the pwrap is. Move the watchdog initialization out of pwrap_init() to
make sure the watchdog is always initialized and not only when the pwrap
is uninitialized.Signed-off-by: Henry Chen
Acked-by: Sascha Hauer
Signed-off-by: Matthias Brugger
05 Aug, 2015
1 commit
-
SCPSYS driver misses the module.h include which makes it fail
when compiling with allmodconf.This patch fixes this.
Signed-off-by: Matthias Brugger
Acked-by: Sascha Hauer
Signed-off-by: Olof Johansson